• Welcome to RadioDJ - Free Radio Automation Software Forum. Please log in or sign up.

The old WordPress plugin

Started by AndyDeGroo, July 27, 2014, 06:14:45 PM

AndyDeGroo

This plugin is a complete rewrite of the old WordPress plugin by Marius (which is still available on downloads page). With permission from Marius, naturally.

Main changes from the old plugin:
1. Now using mysqli_* functions if available. Falls back to mysql_* if mysqli is not available or fails to connect;
2. Added [top-artists] shortcode;
3. AJAX refresh of now playing and recently played tracks every 10 seconds. Can be enabled in options;
4. Database settings verification on options screen to assist with troubleshooting;
5. Every interface string can be translated using WP i18n conventions;
6. Data from queries gets cached in WordPress database for short period to reduce load on RDJ database if there are many users;
7. Timezone setting has been removed. Possible timezone difference is solved by calculating minutes since playback using SQL query.

What you should know before testing:
1. It is tested and working on WP 3.8, 3.9.1, 4.0 and 4.2, but not tested on PHP version before 5.4.
2. It is using same WordPress options, so keep that in mind when changing them.
3. Shortcodes have not changed. Installing new plugin alongside the old will override them.
4. HTML structure, class names and IDs are unchanged. If you have customised the look in using CSS outside plugin, you should have the same look.
5. If you have testing server or WP installation, use that instead of main site.
7. Using WP installation with zip file uploading will overwrite old plugin.

All feedback is welcome. Especially from native English speakers if there are any obvious *speling erors* or bad style in interface strings.

Plugin has been updated to version 0.6.2. You can download it from link below.

Changes in version 0.6.2:

  • Enhancement: Better caching for data in shortcodes
  • Enhancement: Added option to display song titles of upcoming tracks
  • Enhancement: Separator hyphen between artist and title wrapped in <span class="separator"> so it can be hidden/styled using CSS
  • Bugfix: Connect to database only if cached data not available
  • Bugfix: Removed invalid <h3> tags from table headings
Download it here: radiodj-for-wordpress-0.6.2.zip.
Tested in WordPress 4.1 and 4.2, but there are no breaking changes for earlier versions.

Changes in version 0.6.1:

       
  • Enhancement: Added option to override radiodj.css by copying it to current theme's or child theme's root
    Now the plugin checks if radiodj.css exists in theme or child theme and loads that instead.
  • Bugfix: Add stripcslashes for input variables in database verification
radiodj-for-wordpress-0.6.1.zip.

FAQ

How to translate WordPress plugin?
For translation you may use either Codestyling Localization plugin to translate in WordPress dashboard or Poedit to edit .po file and generate a .mo file. Do not edit plugin code or you will have to re-edit it after update!
If you add translation for your language, please PM me the .po file so I can add it to plugin.

My site is loading slower when using plugin shortcodes. Why?
Remote database connections can be slow over average consumer-grade networks and there is no way to speed them up. To minimize connection impact, plugin is caching remote data, so that it's not loaded from remote server on every page load.
Now playing shortcode is cached until current song ends. All top shortcodes are cached for 10 minutes. Requests shortcode data is not cached because it may change at any moment.

DJ Garybaldy

Cheers Andy I shall have a play around with this tomorrow.  :cool:
Worlds Biggest Fan of RadioDJ

Install MariaDB https://djgarybaldy.blogspot.com/2020/08/installing-maria-db.html

Install RadioDJ: https://djgarybaldy.blogspot.com/2020/08/how-to-install-radiodj-free-radio.html

Into Internet radio for 25 years 1999-2024

RadioDJ 2045 MariaDB 11.2 Windows 11

SnowHow

#2
Excellent!  :cool:

I'll play with this on my test site and report any bugs I find.


Thank you for your hard work!  :)


J-

Update

So far everything working as expected. Found one spelling error. RadioDJ Settings -> Offline Error. Underneath the field, "plubin" should be "plugin".

NOTE: Working well with PHP 5.3.5, MariaDB 10 (latest)

Hope this helps! :)

J-


dberdi

Hi Andy!

I'm just bilding new wordpress website and it well be nice to inplement your plugin.
Please, point me to download link.  :)
Proud user of RadioDJ.

SnowHow

Quote from: AndyDeGroo on July 27, 2014, 06:14:45 PM

You can download zip file from Dropbox for now: radiodj-for-wordpress-0.6.zip.
I'm going to publish it in WP plugins repository after it is ready for production use.





Bottom of the first post...

joshuatree44

Can we install right over the old one or uninstall then reinstall?

Quote from: AndyDeGroo on July 27, 2014, 06:14:45 PM
I've spent few days completely rewriting the old WordPress plugin. With permission from Marius, naturally.

Right now it should be considered stable release candidate. I have tested as many thing as I can, but something could still break. I'd like to ask those who use the old plugin to test my creation.

Main changes:
1. Now using mysqli_* functions if available. Falls back to mysql_* if mysqli is not available or fails to connect;
2. Added [top-artists] shortcode;
3. AJAX refresh of now playing and recently played tracks every 10 seconds. Can be dsiabled in options;
4. Database settings verification on options screen to assist with troubleshooting;
5. Every interface string can be translated using WP i18n conventions;
6. Data from queries gets cached in WordPress database for short period to reduce load on RDJ database if there are many users;
7. Timezone has been setting removed. Possible timezone difference is solved by calculating minutes since played using SQL query.

I might have forgot something that I have implemented and there are more features on my mind.

What you should know before testing:
1. It is tested and working on WP 3.8 and 3.9.1, but not tested on PHP version before 5.5.
2. It is using same WordPress options, so keep that in mind when changing them.
3. Shortcodes have not changed. Installing new plugin alongside the old will override them.
4. HTML structure, class names and IDs are unchanged. If you have customised the look in using CSS outside plugin, you should have the same look.
5. If you have testing server or WP installation, use that instead of main site.
6. To install it alongside the old plugin, place it in radiodj-new directory.
7. Using WP installation with zip file uploading will overwrite old plugin.

All feedback is welcome. Especially from native English speakers if there are any obvious *speling erors* or bad style in interface strings.

You can download zip file from Dropbox for now: radiodj-for-wordpress-0.6.zip.
I'm going to publish it in WP plugins repository after it is ready for production use.

P.S. This forum software, SMF, is a bloody c*nt. I had to rewrite this whole message just because attached file was too large. FML!

joshuatree44

I have it working on my listen live page. very nice. Just have to edit the CSS to get rid of the colors to fit with my them. Otherwise it is nice to see the now playing and the rest updating on its own. Nice work and looking forward to the next versions.

AndyDeGroo

Quote from: joshuatree44 on July 27, 2014, 11:28:56 PM
Can we install right over the old one or uninstall then reinstall?
It will replace the old plugin if installed using zip file upload method. Another option is to just replace all plugin files. Please remember to make a backup if you have modified the old plugin.
New plugin will use settings from the old one, so it will be already set up.

Note for those who have modified or would like to modify the style.css file: The file has been moved and renamed to radiodij/css/radiodj.css and gets included on frontend only. I encourage to move your customisations to your theme. That will reduce headaches when updating the plugin.
I've added more CSS classes for targeting specific table cells. Namely .artist, .title, .album-title, .count-played and few more. Those who know what I'm talking about will appreciate the advantage.

dberdi

 :cool:

Thanks SnowHow! Must be speed reading....   :bash: :hihi:

Excellent Andy!  You are champion!
I'll install it on my site and report the bugs if any.  8)
Proud user of RadioDJ.

AndyDeGroo

#9
I've made few small tweaks to html and corrected one glitch in requests list (first column displayed all ones).
File has been updated and is located under same link.

Update:
If anyone else wants to hide timestamp and duration in now playing, here is the CSS:

/* hide now playing timestamp */
.now-playing .timestamp {
    display: none;
}
/* hide now playing duration */
.now-playing .duration {
    display: none;
}

Place the code in style.css of your theme and the fields should vanish.

I really dislike the original html and how un-styleable it is, but I've retained it for those who might like it. If there is anyone else who would like more modern approach to HTML+CSS in this plugin, please speak out.

joshuatree44

Andy thanks for the coding help! I love it and it is rocking nice and fast. Good WORK!


SnowHow

Quote from: AndyDeGroo on July 28, 2014, 01:54:39 AM
I've made few small tweaks to html and corrected one glitch in requests list (first column displayed all ones).
File has been updated and is located under same link.


I just noticed and was just about to report this.

My site looks better already. Thanks for your hard work.

Getting updated file....

J-


AndyDeGroo

#12
Quote from: SnowHow on July 28, 2014, 02:17:40 AM
I just noticed and was just about to report this.

My site looks better already. Thanks for your hard work.
You're welcome, SnowHow. I checked your site and discovered another bug - request search doesn't work if pretty permalinks are not enabled. That's fixed now.
I can't go to sleep after listening to joshuatree44's station for a while and surprisingly good responses here.

Update:
Version bumped up - 0.6.0-dev3
Changes:
* Bug Fix: Request search was not working without pretty permalinks
* Bug Fix: Requests were placed without IP addresses
* Added: TODO.txt

radiodj-for-wordpress-0.6.1.zip

^^ for those who do skimming more often than reading

dberdi

 :P   hahahahaha OK got it!
It's big enough
Proud user of RadioDJ.

SnowHow

Quote from: AndyDeGroo on July 28, 2014, 03:23:59 AM
You're welcome, SnowHow. I checked your site and discovered another bug - request search doesn't work if pretty permalinks are not enabled. That's fixed now.

Good deal. :)

Quote from: AndyDeGroo on July 28, 2014, 03:23:59 AM

I can't go to sleep after listening to joshuatree44's station for a while and surprisingly good responses here.

Yeah, it gets the blood pumping, don't it?  :hihi:

I haven't seen any functionality problems with the plugin. Seems to be working great.

I did notice that when a track is requested, the requestor's name is appended to the end of the Artist/Title, but I think that's with the RDJ plugin. I would like to disable that. I don't care for that much...

J-