[wp-trac] [WordPress Trac] #20225: Self-contain wp-includes/load.php, wp-includes/plugin.php

WordPress Trac wp-trac at lists.automattic.com
Tue Mar 13 10:50:01 UTC 2012


#20225: Self-contain wp-includes/load.php, wp-includes/plugin.php
-----------------------------+-----------------------------
 Reporter:  scottconnerly    |      Owner:
     Type:  feature request  |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Performance      |    Version:  3.3.1
 Severity:  normal           |   Keywords:  needs-patch
-----------------------------+-----------------------------
 I'm trying to write a high-performance plugin.

 I still want the whole of WP to be used by the admins, and the main part
 of WP to still be used by most user workflows, but I want certain end
 users to instead be using an alternate controller, instead of /index.php,
 when they're doing certain things.

 This new controller I'll write will use a couple of the core files, but
 skips most for the goal of increased performance. The proposed core files
 to re-use are:
 * wp-includes/version.php
 * wp-includes/load.php
 * wp-includes/plugin.php
 * wp-includes/wp-db.php
 * wp-includes/class-wp-error.php

 However, wp-includes/functions.php is a can of worms, that if I included,
 would require me to include many other files, and it spiders out from
 there.

 What would be better is if the following functions that wp-
 includes/load.php and wp-includes/plugin.php require be moved into those
 files from the functions file. Specifically:
 * wp_die()
 * validate_file()
 * stripslashes_deep()
 * add_magic_quotes()
 * _doing_it_wrong()
 * trailingslashit()

 If they aren't, I'll have to copy-paste them into my custom controller,
 maintaining separate versions of them (less than optimal).

 Of course, this process still requires me to write my own simpler versions
 of many more complex functions:
 * wp_cache_init()
 * wp_cache_close()
 * wp_get_active_network_plugins()
 * is_blog_installed()
 * get_option()
 * update_option()

 but that's completely acceptable.

 Moving those first 6 functions from the functions file to the load and
 plugin files would not negatively affect core, but would positively affect
 plugin authors' abilities to write high-performance plugins.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/20225>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list