Make WordPress Core

Opened 17 years ago

Closed 17 years ago

#11750 closed enhancement (fixed)

fix_active_plugins() should not be needed

Reported by: Denis-de-Bernardy Owned by:
Priority: normal Milestone: 3.0
Component: Optimization Version: 3.0
Severity: normal Keywords: has-patch dev-feedback 2nd-opinion
Cc: Focuses: multisite

Description

Where we call get_option(active_plugins), we should always include a default value of array(). The fix_active_plugins() function should never be needed.

Attachments (3)

11750-full-incl-valid-plugins-function.patch​ (8.6 KB ) - added by hakre 17 years ago.
11750-array-defaults.patch​ (5.6 KB ) - added by hakre 17 years ago.
only get_option( 'active_plugins', array() ) where applicable
11750.patch​ (6.1 KB ) - added by hakre 17 years ago.

Download all attachments as: .zip

Change History (11)

#1 @hakre
17 years ago

  • Keywords reviewing added

Right, that logic is part of validate_active_plugins() in existing core already (plugin.php). While doing some sniffs over the codebase for a first patch I realize that the newly introduced approach ticks edge-cases here and there.

#2 @hakre
17 years ago

  • Keywords has-patch added; reviewing removed

A first patch that streamlines the reading of the active_plugins value as well as streamlining the loading of both, standard and wpmu plugins based on the standard plugins loading validations. introducing a new function called valid_plugins() which reduces plugin inclusion into a simple foreach clause.

will create a second patch w/o those improvements.

@hakre
17 years ago

only get_option( 'active_plugins', array() ) where applicable

#3 @hakre
17 years ago

Second patch taking care of propper default values. Will write the next follow up for fix_active_plugins() removal.

#4 @hakre
17 years ago

  • Keywords dev-feedback 2nd-opinion added

Third patch as the straight fix to the ticket. Could be merged with first patch to improve the codebase if wanted.

#5 @hakre
17 years ago

Additional info: I tested against loding WPMU and standard plugins. Worked properly (first patch).

#6 @nacin
17 years ago

  • Keywords multisite added

#7 @Denis-de-Bernardy
17 years ago

I like the valid_plugins() idea in the first patch (11750-full-incl-valid-plugins-function.patch)

#8 @ryan
17 years ago

  • Resolution → fixed
  • Status new → closed
Note: See TracTickets for help on using tickets.