Where is the WordPress Entry Point? (main?)
-
Does anyone know where the wordpress main entry point is? I am not able to find it. I know that wp-load.php gets called on every single page but I can’t figure out there wp-load gets called from. How does wordpress know which page you are reading from the browser url? I can’t seem to figure out how wordpress works. There is no entry point function, and I can’t figure out how the url is retrieved and routed to the code. Does anyone have any ideas?
The other thing I was wondering is about all the code that gets run every single time you load any page on wordpress. It seems like a hell of a lot of code is executed that is completely unnecessary. Wouldn’t it be better to only have functions loaded that are needed for each page instead of loading every single function in the entire wordpress code page for every page? I mean, wp-load.php is loaded for every single page. I am not experienced in php development, but it can’t be good that all that code is running for every single page. WordPress sites seem pretty slow compared to non wordpress sites. Just look at wp-settings.php which also gets run on every single page load, I mean you have code like this:
require( ABSPATH . WPINC . ‘/user.php’ );
require( ABSPATH . WPINC . ‘/meta.php’ );
require( ABSPATH . WPINC . ‘/general-template.php’ );
require( ABSPATH . WPINC . ‘/link-template.php’ );
require( ABSPATH . WPINC . ‘/author-template.php’ );Every single php file in wordpress is getting included on every single page in wordpress. Then use also have code like this on that page:
$wp_rewrite = new WP_Rewrite(); /** * WordPress Object * @global object $wp * @since 2.0.0 */ $wp = new WP(); /** * WordPress Widget Factory Object * @global object $wp_widget_factory * @since 2.8.0 */ $wp_widget_factory = new WP_Widget_Factory();
I find it really hard to believe that it can in any way be a good thing to create these objects for every single page on an entire wordpress site.
Thanks.
- The topic ‘Where is the WordPress Entry Point? (main?)’ is closed to new replies.