Problem using BuddyPress functions from WordPress cron
-
Hi,
Since a lot of time, I want to fix a problem with WangGuard cron.
After testing time, I opened this ticket http://buddypress.trac.wordpress.org/ticket/5229 because I discovered that bug, but the fix, don’t fix the WordPress Cron problem.
WangGuard cron, search every x hours a new splog users, If WangGuard find them, they are marked as spam with the WordPress function
update_user_status( $spuserID, 'spam', '1' );
That function fire
bp_core_mark_user_spam_admin( $user_id );
that make all work for BuddyPress.Problem, if I use this function for example in WangGuard users screen, it work fine, because I’m the super admin, but cron cannot use it.
When update_user_status call to bp_core_mark_user_spam_admin -> bp_core_process_spammer_status from WordPress cron, it is killed, so the user is marked as spam user, but the activity are not removed.
For testing , I placed bp_core_process_spammer_status, replacing update_user_status in WangGuard cron. Nothing happens, bp_core_process_spammer_status are blocked without errors (no logs with WP_DEBUG), users are not marked as spam, no activity removed, etc
After that, i created a new function:
function wangguard_core_mark_user_spam_admin( $user_id ) { bp_core_process_spammer_status( $user_id, 'spam' ); }
but that function I placed in the file /buddypress/bp-loader.php (as new BuddyPress function)
After that, I rewrite again the wangGuard cron, but using this new “BuddyPress function”, the users were marked as spam, but the activity was not removed, why? because the function bp_core_process_spammer_status use other BuddyPress function that use a BuddyPress Class for clean all user activity.
Brief:
There is something in BuddyPress that block functions and classes that are in the “lower levels” to be used by WordPress cron.
Has someone a solution for this problem?
Thank you
- The topic ‘Problem using BuddyPress functions from WordPress cron’ is closed to new replies.