Stop Spammers Conflict With BBPress and Buddypress
-
Hi and great plugin. It worked great on my sites until I decided to use buddypress and bbpress.
I sandbox my development and have wp debug on and it started firing all sorts of notices.
Notice: bbp_setup_current_user was called incorrectly. The current user is being initialized without using $wp->init()
I looked up what was going on and Stop Spammers is calling the function is_user_logged_in() too early in the stack.
This can cause all sorts of weird errors and permission issues.
per this link…
https://buddypress.trac.www.ads-software.com/ticket/4957
quote”The debug notice is annoying, but invoking the current user that early in the stack is going to cause a myriad of other invisible issues with both BuddyPress and bbPress. Closing this as wontfix.”endquote.I found the workaround here…
https://github.com/wp-e-commerce/WP-e-Commerce/issues/497The fix is to call after the theme is loaded. Instead of bbp_loaded we use after_setup_theme because that is what triggers the notice.
Line 76 holds the setup_current_user() function for buddypress in
plugins/buddypress/bp-core/bp-core-dependency.php
Line 142 holds the setup_current_user() for bbpress in
plugins/bbpress/includes/core/sub-actions.php
Neither plugin likes other plugins to call for user info too early in the stack. It causes too many untraceable issues (see above link).
I corrected by adding / replacing line 27 in stop-spammer-registrations.php
add_action('bbp_loaded','kpg_load_all_checks',99); // try hooking into bbpress loaded
to
add_action('after_setup_theme','kpg_load_all_checks',99); // try hooking into bbpress loaded
I corrected by adding / replacing line 59 in stop-spammer-registrations.php
remove_action('bbp_loaded','kpg_load_all_checks',99); // try hooking into bbpress loaded
to
remove_action('after_setup_theme','kpg_load_all_checks',99); // try hooking into bbpress loaded
So I changed lines 27 and 59 in stop-spammer-registrations.php and the notices stopped.
Hope it helps!
-TJ
https://www.ads-software.com/plugins/stop-spammer-registrations-plugin/
- The topic ‘Stop Spammers Conflict With BBPress and Buddypress’ is closed to new replies.