[wp-trac] [WordPress Trac] #28364: WordPress Entry Points (wp-load.php occurrences)

WordPress Trac noreply at wordpress.org
Mon May 26 12:16:57 UTC 2014


#28364: WordPress Entry Points (wp-load.php occurrences)
--------------------------+-----------------------------
 Reporter:  szepe.viktor  |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  3.9.1
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 I was looking for entry point by searching for wp-load.php for plugin
 refactoring. I mean conditionally use require().

 1. 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

 2. wp-trackback.php uses a strange way to detect the core `if
 (empty($wp))`

 3. xmlrpc.php uses alone `include()` all others `require()`

 4. 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 ==

 1. frontend: wp-blog-header.php:12 {{{!is_admin()}}}
 1. admin GET request: wp-admin/admin.php:30 {{{is_admin()}}}
 1. admin POST request: wp-admin/admin-post.php:15 {{{is_admin()}}}
 1. admin upload: wp-admin/async-upload.php:16
 {{{@$_SERVER['SCRIPT_FILENAME'] === ABSPATH . 'wp-admin/async-
 upload.php'}}}
 1. AJAX call: wp-admin/admin-ajax.php:20 {{{defined('DOING_AJAX')
 && DOING_AJAX}}}
 1. WordPress cron webserver/CLI: wp-cron.php:26 {{{defined('DOING_CRON')
 && DOING_CRON}}} {{{php_sapi_name() === 'cli'}}}
 1. XML-RPC protocol: xmlrpc.php:29 {{{defined('XMLRPC_REQUEST') &&
 XMLRPC_REQUEST}}}

 === Frontend low priority ===

 1. wp-comments-post.php:16 {{{@$_SERVER['SCRIPT_FILENAME'] === ABSPATH .
 'wp-comments-post.php'}}}
 1. wp-trackback.php:12 {{{1 === get_query_var('tb')}}}

 === Dashboard low priority ===

 1. wp-login.php:12
 1. wp-signup.php:4
 1. wp-activate.php:12
 1. wp-mail.php:11

 === Exclude from profiling ===

 1. wp-links-opml.php:15
 1. wp-includes/ms-files.php:12
 1. wp-includes/js/tinymce/wp-mce-help.php:9
 1. wp-admin/install.php:36
 1. wp-admin/install-helper.php:39
 1. wp-admin/upgrade.php:18
 1. wp-admin/maint/repair.php:10
 1. wp-admin/moderation.php:10

 Total: '''21 entry points''' as of version 3.9.1

 [https://github.com/szepeviktor/WPHW/blob/master/wp-entry-points.md from
 WPHW]

--
Ticket URL: <https://core.trac.wordpress.org/ticket/28364>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list