Make WordPress Core

Opened 15 years ago

Closed 15 years ago

#11750 closed enhancement (fixed)

fix_active_plugins() should not be needed

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

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 15 years ago.
11750-array-defaults.patch (5.6 KB) - added by hakre 15 years ago.
only get_option( 'active_plugins', array() ) where applicable
11750.patch (6.1 KB) - added by hakre 15 years ago.

Download all attachments as: .zip

Change History (11)

#1 @hakre
15 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
15 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
15 years ago

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

#3 @hakre
15 years ago

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

@hakre
15 years ago

#4 @hakre
15 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
15 years ago

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

#6 @nacin
15 years ago

  • Keywords multisite added

#7 @Denis-de-Bernardy
15 years ago

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

#8 @ryan
15 years ago

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.