NextGEN breaking pluggable functions after version 2.0.7
-
One of the recent changes for NextGEN was introduced in 2.0.7:
* Fixed: Ensure that pluggable.php is loaded at the start of every request
I’m using now version 2.0.17, and I see this in nggallery.php line 78:
function _load_non_pope() { // Load WordPress pluggables for plugin compatibility include_once(path_join(ABSPATH, 'wp-includes/pluggable.php')); ... }
Etc. Now, a website I’m supporting is using the S2Member Membership plugin (www.s2member.com). This plugin overrides some pluggable functions in WordPress, in particular, wp_new_user_notification.
I’ve been having some trouble with this function, as our customizations for a new user registration email weren’t being used by WordPress or S2Member. Fortunately, newer versions of S2Member give out a warning:
“New User Email Configuration
Conflict warning: You have another theme or plugin installed that is preventing s2Member from controlling this aspect of your installation. When the pluggable function wp_new_user_notification() is handled by another plugin, it’s not possible for s2Member to allow customization of New User Emails. This is NOT a major issue. In fact, in some cases, it might be desirable. That being said, if you DO want to use s2Member’s customization of New User Emails, you will need to deactivate one plugin at a time until this conflict warning goes away.”That made me think that there was a conflict between plugin usage of that specific pluggable function (wp_new_user_notification) and I did some research. Turns out that the conflict wasn’t limited to that function, but that pluggables weren’t working at all!
Here’s a reference of S2Member’s Support team mentioning the issue:
https://www.s2member.com/forums/topic/strange-conflict-with-plugin/
In particular, note that they mention this:
“Generally speaking, a plugin should really NOT include/require the pluggable.php file at all. Instead, it should simply wait until the WordPress? init Hook has been fired, at which point any functionality it needs from the pluggable functions will be available already; so there’s no need for a plugin developer to include it.”
Based on that, I did some research, and found that NextGEN is doing that, precisely. So I made a manual fix to nggallery.php:
function _load_non_pope() { // Load WordPress pluggables for plugin compatibility<br /> //include_once(path_join(ABSPATH, 'wp-includes/pluggable.php')); .. }
This solves the issue with S2Member. Now, this might break NextGEN. I’m not sure, but my priority is for S2Member to work correctly, so I’m going to leave that in myself. But it’d be good if your developers investigate this issue, as doing the “pluggable.php” inclusion too soon (as NextGEN appears to be doing) would prevent ANY plugin from declaring its own pluggables. This could be a big issue for websites.
So I’d like to leave this issue here, in the hope that a fix can be included in a future NextGEN version.
Thanks!
Leo
- The topic ‘NextGEN breaking pluggable functions after version 2.0.7’ is closed to new replies.