Opened 16 years ago
Closed 16 years ago
#9826 closed enhancement (wontfix)
Prevent including pluggable.php by plugins
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | low | |
Severity: | major | Version: | 2.7.1 |
Component: | Plugins | Keywords: | has-patch |
Focuses: | Cc: |
Description
It is a bad manner to include wp-includes/pluggable.php by plugins.
Some plugins (such as Events Calendar) DOES the implementation, and cause confliction with other plugins which overloads the functions in pluggable.php
To prevent this implementation, insert some code to check the valid timing to load pluggable.php.
At line 478 of wp-settings.php
if ( defined('WP_PLUGGABLE_READY') ) { die ( __('A bad plugin attempted premature load of pluggable.php') ); } define ('WP_PLUGGABLE_READY', true); require (ABSPATH . WPINC . '/pluggable.php');
At top of wp-includes/pluggable.php
<?php if ( !defined('WP_PLUGGABLE_READY') ) { die ( __('A bad plugin attempted premature load of pluggable.php') ); }
Change History (1)
Note: See
TracTickets for help on using
tickets.
That plugin should change its behaviour, There is NO reason why it should have to do that, All plugin code needs to be run on, or after, the plugins_loaded hook fires.
Invalid due to bad plugin behavior, Closing as wontfix, since checking for things like that adds extra overhead which really isnt needed.. esp. not when the plugin author should be fixing it instead.