Make WordPress Core

Opened 15 years ago

Closed 14 years ago

Last modified 13 years ago

#4212 closed enhancement (invalid)

Use require_ and include_once instead in wp-settings.php

Reported by: rob1n's profile 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 15 years ago.

Download all attachments as: .zip

Change History (11)

15 years ago

#1 @rob1n
15 years ago

  • Cc rob1n added

#2 @rob1n
15 years ago

  • Status changed from new to assigned

#3 @rob1n
15 years ago

  • Cc rob1n removed

#4 @rob1n
15 years ago

  • Status changed from assigned to new

#5 @foolswisdom
15 years ago

  • Milestone changed from 2.3 to 2.5 (future)

#6 @rob1n
14 years ago

  • Owner rob1n deleted

#7 @darkdragon
14 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
14 years ago

Premature optimization.

#9 @darkdragon
14 years ago

Won't fix?

#10 @darkdragon
14 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.