Make WordPress Core

Opened 9 years ago

Closed 8 years ago

Last modified 6 years ago

#4212 closed enhancement (invalid)

Use require_ and include_once instead in wp-settings.php

Reported by: rob1n Owned by:
Milestone: Priority: low
Severity: minor Version:
Component: Optimization Keywords: has-patch 2nd-opinion
Focuses: Cc:


Use require_once and include_once instead of require and include in wp-settings.php. What this will accomplish is minimize the chance of files getting included twice, however likely.

Ryan, however, when I brought up this idea on IRC, mentioned that the _once functions was slower than its cousins. Might be good if we could profile this.

Attachments (1)

4212.diff (5.7 KB) - added by rob1n 9 years ago.

Download all attachments as: .zip

Change History (11)

9 years ago

#1 @rob1n
9 years ago

  • Cc rob1n added

#2 @rob1n
9 years ago

  • Status changed from new to assigned

#3 @rob1n
9 years ago

  • Cc rob1n removed

#4 @rob1n
9 years ago

  • Status changed from assigned to new

#5 @foolswisdom
8 years ago

  • Milestone changed from 2.3 to 2.5 (future)

#6 @rob1n
8 years ago

  • Owner rob1n deleted

#7 @darkdragon
8 years ago

There is no need to profile. require_once() and include_once() are slower than require() and include() up to PHP version either 5.1.x or 5.2.x. Since you support PHP 4.2, you'll being slowing WordPress down for what might be a majority of your users.

Also, I haven't yet had any problems with what you describe. Do you witness any plugins that require certain wp-includes files? I would just assume that unless someone else messed up that the files wouldn't need to use require.

It should be assumed that wp-settings sets up and includes the files in wp-includes and no one else should do so.

#8 @darkdragon
8 years ago

Premature optimization.

#9 @darkdragon
8 years ago

Won't fix?

#10 @darkdragon
8 years ago

  • Milestone 2.6 deleted
  • Resolution set to invalid
  • Status changed from new to closed

Premature optimization and if there are any problems, then it is the problem of another script.

Note: See TracTickets for help on using tickets.