#4212 closed enhancement (invalid)
Use require_ and include_once instead in wp-settings.php
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | low | |
Severity: | minor | Version: | |
Component: | Optimization | Keywords: | has-patch 2nd-opinion |
Focuses: | Cc: |
Description
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)
Change History (11)
Note: See
TracTickets for help on using
tickets.
There is no need to profile.
require_once()
andinclude_once()
are slower thanrequire()
andinclude()
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.