Warning: Cannot modify header information - headers already sent by (output started at /home2/gharris/public_html/stutteringpsychotherapy.com/wp-content/themes/attitude/functions.php:165) in /home2/gharris/public_html/stutteringpsychotherapy.com/wp-includes/pluggable.php on line 875
I had some trouble with my plugins.php ealier, and had to delete the last five lines of code or so to get my site working, so the problem either lies there or in the pluggables.php, methinks. Do I have some whitespace I shouldn’t or something or that sort?
Here’s a paste of my Pluggable file: https://codebin.org/view/330fce7b
Here’s a paste of my Plugins file: https://codebin.org/view/bc4c493c
Thank you so much for any and all help you can offer!
]]>* 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:
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
]]>Example,
Lets say in my theme framework I have some pluggable function
if(!function_exists('function_name')){
function function_name(){}
}
If in my functions, or custom-functions.php I define that method function_name(){} every thing works out and is happy.
How ever if in my functions or custom-functions.php I say:
require_once(‘path_to_file.php’) where path_to_file contains the definition of that method function_name() I get an error. Saying it was already defined in such and such file on such and such line.
Yes I can define it in the functions.php or custom-functions with no error? I just cannot link to a file, in the functions or custom-functions that defines it?
why? if the case is, that the functions.php or custom-functions.php runs before any theme file then the fact that I am linking to a file that redefines the method should not be an issue.
thoughts?
]]>Plugin could not be activated because it triggered a fatal error.
Fatal error: Cannot redeclare wp_authenticate() (previously declared in […]/wp-includes/pluggable.php:456) in […]/plugins/myplugin/login.php on line 64
Is this a bug? Or am I doing something wrong?
For now I’ve just commented out wp_authenticate in pluggables.php, but that’s not a very good solution!
]]>Plugin could not be activated because it triggered a fatal error.
Fatal error: Cannot redeclare wp_authenticate() (previously declared in […]/wp-includes/pluggable.php:456) in […]/plugins/myplugin/login.php on line 64
Is this a bug? Or am I doing something wrong?
For now I’ve just commented out wp_authenticate in pluggables.php, but that’s not a very good solution!
]]>