[wp-trac] [WordPress Trac] #9826: Prevent including pluggable.php by plugins

WordPress Trac wp-trac at lists.automattic.com
Fri May 15 07:13:42 GMT 2009


#9826: Prevent including pluggable.php by plugins
-------------------------+--------------------------------------------------
 Reporter:  lilyfan      |       Owner:           
     Type:  enhancement  |      Status:  new      
 Priority:  low          |   Milestone:  2.9      
Component:  Plugins      |     Version:  2.7.1    
 Severity:  major        |    Keywords:  has-patch
-------------------------+--------------------------------------------------
 It is a bad manner to include wp-includes/pluggable.php by plugins.

 Some plugins (such as [http://wordpress.org/extend/plugins/events-
 calendar/ 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') );
 }
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/9826>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list