Make WordPress Core

Opened 8 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 8 years ago.

Download all attachments as: .zip

Change History (11)

@rob1n8 years ago

comment:1 @rob1n8 years ago

  • Cc rob1n added

comment:2 @rob1n8 years ago

  • Status changed from new to assigned

comment:3 @rob1n8 years ago

  • Cc rob1n removed

comment:4 @rob1n8 years ago

  • Status changed from assigned to new

comment:5 @foolswisdom8 years ago

  • Milestone changed from 2.3 to 2.5 (future)

comment:6 @rob1n8 years ago

  • Owner rob1n deleted

comment:7 @darkdragon8 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.

comment:8 @darkdragon8 years ago

Premature optimization.

comment:9 @darkdragon8 years ago

Won't fix?

comment:10 @darkdragon8 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.