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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Well, I hadn’t really thought much about it before but there’s actually only one page on a WordPress site, isn’t there. That page finishes up producing very different HTML in the end for return to the user agent, but it’s still just one page.

    So it has to bootstrap itself every time it’s called. I’m sure cleverer programmers than me could find a different way of doing things, but I can’t see it, offhand. If you can, I guess you’d better get yourself on the development team as soon as possible so we can all benefit.

    Cheers

    PAE

    Thread Starter jhansensd

    (@jhansensd)

    All I was thinking was that wordpress implements a selective loading mechanism. This code would simply have a list of components. You would ask this object whether a component was needed and it would return yes or no. This way, you could check if a page was going to need a certain module and only load it if it was.

    I would imagine this could significantly improve performance of wordpress. The question then comes down to modularization. Is wordpress modularized well enough that you could split out the components into black boxes and then determine which of those components might not be needed on a page load?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Where is the WordPress Entry Point? (main?)’ is closed to new replies.