Opened 12 years ago
Last modified 7 years ago
#28364 new defect (bug)
WordPress Entry Points (wp-load.php occurrences) — at Initial Version
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 3.9.1 |
| Component: | Bootstrap/Load | Keywords: | |
| Focuses: | Cc: |
Description
I was looking for entry point by searching for wp-load.php for plugin refactoring. I mean conditionally use require().
- There are easy to identify entry points like admin-ajax.php but there are no defines e.g in async-upload.php, wp-loging.php or wp-comments-post.php
- wp-trackback.php uses a strange way to detect the core
if (empty($wp))
- xmlrpc.php uses alone
include()all othersrequire()
- How to distinguish between admin.php and admin-post.php?
Proposal
- There should be a uniform way requiring wp-load.
- All entry point should be distinguished by different defines
List of entry points and ways to detect them
- frontend: wp-blog-header.php:12
!is_admin() - admin GET request: wp-admin/admin.php:30
is_admin() - admin POST request: wp-admin/admin-post.php:15
is_admin() - admin upload: wp-admin/async-upload.php:16
@$_SERVER['SCRIPT_FILENAME'] === ABSPATH . 'wp-admin/async-upload.php' - AJAX call: wp-admin/admin-ajax.php:20
defined('DOING_AJAX') && DOING_AJAX - WordPress cron webserver/CLI: wp-cron.php:26
defined('DOING_CRON') && DOING_CRONphp_sapi_name() === 'cli' - XML-RPC protocol: xmlrpc.php:29
defined('XMLRPC_REQUEST') && XMLRPC_REQUEST
Frontend low priority
- wp-comments-post.php:16
@$_SERVER['SCRIPT_FILENAME'] === ABSPATH . 'wp-comments-post.php' - wp-trackback.php:12
1 === get_query_var('tb')
Dashboard low priority
- wp-login.php:12
- wp-signup.php:4
- wp-activate.php:12
- wp-mail.php:11
Exclude from profiling
- wp-links-opml.php:15
- wp-includes/ms-files.php:12
- wp-includes/js/tinymce/wp-mce-help.php:9
- wp-admin/install.php:36
- wp-admin/install-helper.php:39
- wp-admin/upgrade.php:18
- wp-admin/maint/repair.php:10
- wp-admin/moderation.php:10
Total: 21 entry points as of version 3.9.1
Note: See
TracTickets for help on using
tickets.