WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#9826 closed enhancement (wontfix)

Prevent including pluggable.php by plugins

Reported by: lilyfan 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)

comment:1 DD325 years ago

  • Milestone 2.9 deleted
  • Resolution set to wontfix
  • Status changed from new to closed

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.

Note: See TracTickets for help on using tickets.