[Bug Report] rtMedia Pro hooks with myCRED


with latest version of mycRED 1.4.3 and rtMedia Pro, there is only one item (enable?) under Points of rtMedia, no any options for setting points for actions.

When I turned on the debug, and I got:

PHP Warning:  Invalid argument supplied for foreach() in /var/www/fitnesshubs-com/wp-content/plugins/rtmedia-pro/app/main/controllers/media/RTMediaProMyCredHook.php on line 79  

Then I checked the code and found out that

      if(!is_array($rtmedia_points) && sizeof($rtmedia_points) <= 0 ) {  

I think it should be:

      if(!is_array($rtmedia_points) || sizeof($rtmedia_points) <= 0 ) {  

I checked the database, the options value for option rtmedia_points as below:
(I have a network configuration with 3 sites, buddypress site is on one subdomain in the network,3 options table seems have same value.)

option_value for option_name ‘rtmedia_points’:

` a:16:{s:18:“after_upload_image”;a:3:{s:6:“action”;s:23:“rtmedia_after_add_photo”;s:7:“message”;a:1:{s:10:“cp_message”;s:26:“rtMedia after upload image”;}s:6:“points”;a:1:{s:9:“cp_points”;i:0;}}s:18:“after_upload_music”;a:3:{s:6:“action”;s:23:“rtmedia_after_add_music”;s:7:“message”;a:1:{s:10:“cp_message”;s:26:“rtMedia after upload music”;}s:6:“points”;a:1:{s:9:“cp_points”;i:0;}}s:18:“after_upload_video”;a:3:{s:6:“action”;s:23:“rtmedia_after_add_video”;s:7:“message”;a:1:{s:10:“cp_message”;s:26:“rtMedia after upload video”;}s:6:“points”;a:1:{s:9:“cp_points”;i:0;}}s:18:“after_album_create”;a:3:{s:6:“action”;s:23:“rtmedia_after_add_album”;s:7:“message”;a:1:{s:10:“cp_message”;s:26:“rtMedia after album create”;}s:6:“points”;a:1:{s:9:“cp_points”;i:0;}}s:21:“after_playlist_create”;a:3:{s:6:“action”;s:26:“rtmedia_after_add_playlist”;s:7:“message”;a:1:{s:10:“cp_message”;s:29:“rtMedia after playlist create”;}s:6:“points”;a:1:{s:9:“cp_points”;i:0;}}s:16:“after_media_rate”;a:3:{s:6:“action”;s:30:“rtmedia_pro_after_rating_media”;s:7:“message”;a:1:{s:10:“cp_message”;s:24:“rtMedia after media rate”;}s:6:“points”;a:1:{s:9:“cp_points”;i:0;}}s:20:“after_media_download”;a:3:{s:6:“action”;s:33:“rtmedia_pro_before_download_media”;s:7:“message”;a:1:{s:10:“cp_message”;s:28:“rtMedia after media download”;}s:6:“points”;a:1:{s:9:“cp_points”;i:0;}}s:16:“after_media_like”;a:3:{s:6:“action”;s:24:“rtmedia_after_like_media”;s:7:“message”;a:1:{s:10:“cp_message”;s:24:“rtMedia after media like”;}s:6:“points”;a:1:{s:9:“cp_points”;i:0;}}s:16:“after_media_view”;a:3:{s:6:“action”;s:24:“rtmedia_after_view_media”;s:7:“message”;a:1:{s:10:“cp_message”;s:24:“rtMedia after media view”;}s:6:“points”;a:1:{s:9:“cp_points”;i:0;}}s:16:“after_media_edit”;a:3:{s:6:“action”;s:24:“rtmedia_after_edit_media”;s:7:“message”;a:1:{s:10:“cp_message”;s:24:“rtMedia after media edit”;}s:6:“points”;a:1:{s:9:“cp_points”;i:0;}}s:18:“after_media_delete”;a:3:{s:6:“action”;s:26:“rtmedia_after_delete_media”;s:7:“message”;a:1:{s:10:“cp_message”;s:26:“rtMedia after media delete”;}s:6:“points”;a:1:{s:9:“cp_points”;i:0;}}s:18:“after_media_report”;a:3:{s:6:“action”;s:30:“rtmedia_pro_after_report_media”;s:7:“message”;a:1:{s:10:“cp_message”;s:26:“rtMedia after media report”;}s:6:“points”;a:1:{s:9:“cp_points”;i:0;}}s:21:“after_set_album_cover”;a:3:{s:6:“action”;s:33:“rtmedia_pro_after_set_album_cover”;s:7:“message”;a:1:{s:10:“cp_message”;s:29:“rtMedia after set album cover”;}s:6:“points”;a:1:{s:9:“cp_points”;i:0;}}s:18:“after_set_featured”;a:3:{s:6:“action”;s:26:“rtmedia_after_set_featured”;s:7:“message”;a:1:{s:10:“cp_message”;s:26:“rtMedia after set featured”;}s:6:“points”;a:1:{s:9:“cp_points”;i:0;}}s:13:“after_comment”;a:3:{s:6:“action”;s:25:“rtmedia_after_add_comment”;s:7:“message”;a:1:{s:10:“cp_message”;s:21:“rtMedia after comment”;}s:6:“points”;a:1:{s:9:“cp_points”;i:0;}}s:16:“after_edit_album”;a:3:{s:6:“action”;s:26:“rtmedia_after_update_album”;s:7:“message”;a:1:{s:10:“cp_message”;s:24:“rtMedia after edit album”;}s:6:“points”;a:1:{s:9:“cp_points”;i:0;}}}
The serialised data is corrupted?


update myCRED to 1.4.4 and which version of rtMedia and rtMedia-PRO you using?

I am using rtMedia 3.6.14 and rtMeida Pro 2.3, they are latest version, and I upgraded myCRED to 1.4.4, no changes.

The rtMedia Galleries section in myCRED hooks is OK, there are several items, just the “Points for rtMedia” only has a Enable checkbox.

BTW, my InspireBook theme can not be auto upgraded, no any upgraded notification received, is this designed like that? if not auto upgraded, what’s the best way to upgraded it in one working online site?


rtMedia Galleries section is added by myCRED itself whereas Points for rtMedia is added by rtMedia-PRO. Previously with major myCRED update it has issues but those issues has been resolved. I checked on our demo site and is working fine. Can you check it with fresh WordPress setup?

Which version of InspireBook you are using? Current version of InspireBook is v1.2.1. You can manually download it from your account section -> https://rtcamp.com/my-account/

I used InspireBook 1.2, I did not get email notification for the updates, can we make it auto updates just same as rtMedia Pro?

Back to the topic: I once made it work before, but after several times of updates of myCRED and rtMedia, I can not know when it stop work. I don’t have enough time to try all kinds of installations, I would like to track down the root cause in code and fix it. one code problem I gave in the post, but after changed the code, the hook problem is not solved yet, and I hope your guys can dig more to find root cause:

my site configuration: a wordpress network with 3 sites: buddypress with InspireBook theme is on secondary subdomain site, not the network primary site, both myCRED and rtMedia are network activated.


That’s strange, InspireBook also get automatic update notification same as rtMedia-PRO.

You said you made it work before. So, is there any code that you had modify or something??
This is really strange, I had checked on 2-3 of our site and I am not getting this error on any if the site. Do one thing, re-install myCRED and rtMedia-PRO.

Yes, you are right it should be
if( !is_array($rtmedia_points) || sizeof($rtmedia_points) <= 0 )
instead of
if( !is_array($rtmedia_points) && sizeof($rtmedia_points) <= 0 )
It is minor logical mistake and will be updated in next update of rtMedia-PRO. But if you see, logically that value will be either blank or this full array with values for different possible actions.

Yes, serialise array for option name ‘rtmedia_points’ is corrupted in your databse. Can you try replacing it with this value -> http://pastebin.com/xstREMhA and check.