Opened 8 years ago
Closed 8 years ago
#34395 closed defect (bug) (fixed)
Don't load admin files on each request
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.4 | Priority: | normal |
Severity: | normal | Version: | 4.4 |
Component: | REST API | Keywords: | has-patch dev-feedback |
Focuses: | performance | Cc: |
Description
In wp-settings.php
, where WordPress is actually started, we load wp-includes/rest-api.php
which loads wp-includes/rest-api/class-wp-rest-server.php
which loads wp-admin/includes/admin.php
which then loads a bunch of admin files and translation.
This is wrong for two reasons:
- We shouldn't load admin files on each request.
- It is against #33413.
I don't see why admin files are needed in WP_REST_Server
though they might be needed by REST API. In that case, it should be lazy loaded somewhere.
Attachments (1)
Change History (4)
Note: See
TracTickets for help on using
tickets.
This was introduced long time ago, back when @rmccue worked on it during GsoC. See https://gsoc.trac.wordpress.org/changeset/1980
Seems like it was related to some date handling functions. I ran the core tests and the plugin tests from GitHub now without including
wp-admin/includes/admin.php
and it worked without a problem. So either it really isn't needed or we just don't know the reason why it's still included.