Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter applic

    (@applic)

    Hi!

    here is my solution:

    With the constant SHORTINIT you can make your wordpress-call very fast.
    But it is only a minimal init of wordpress.
    To get a user auth you need to call a few more files.

    With the following code i need about 0,003 seconds to get the user id in an external script.

    Regard Daniel


    define(‘WP_USE_THEMES’, false);
    define(‘SHORTINIT’, TRUE);
    require_once(‘../../wp-load.php’);
    require_once(ABSPATH . WPINC . ‘/class-wp-user.php’);
    require_once(ABSPATH . WPINC . ‘/class-wp-roles.php’);
    require_once(ABSPATH . WPINC . ‘/class-wp-role.php’);
    require_once(ABSPATH . WPINC . ‘/class-wp-session-tokens.php’);
    require_once(ABSPATH . WPINC . ‘/class-wp-user-meta-session-tokens.php’);
    require_once(ABSPATH . WPINC . ‘/formatting.php’);
    require_once(ABSPATH . WPINC . ‘/capabilities.php’);
    require_once(ABSPATH . WPINC . ‘/query.php’); // – might be useful
    require_once(ABSPATH . WPINC . ‘/user.php’);
    require_once(ABSPATH . WPINC . ‘/meta.php’);
    wp_cookie_constants();
    require_once(ABSPATH . WPINC . ‘/vars.php’);
    require_once(ABSPATH . WPINC . ‘/kses.php’);
    require_once(ABSPATH . WPINC . ‘/rest-api.php’);
    require_once(ABSPATH . WPINC . ‘/pluggable.php’);

    • This reply was modified 3 years, 2 months ago by applic.
    • This reply was modified 3 years, 2 months ago by applic.
    Thread Starter applic

    (@applic)

    Hi!

    Thanks for your answers!

    I would not call 20 ms as “very fast”

    20ms is for a full roundtrip (Client (Javascript Ajax) –> .php with wp_load.php –> Rest Call to Backend (c#) –> 10ms calculation –> .php script –> client.

    I use this way to get the actual user ID.

    I tried all you ideas, but unfortunately nothing makes the call of “wp_load.php” faster.
    I did a measurement at another wordpress site of mine (same server and database) and wp_load is about 0.6ms!

    I also tried to disable all plugins, but this also does not help.

    I have a lot a blog entries at the page (150.000), but this can not be the reason?

    Have you any idea how i can measure which part of wordpress makes wp_load slowly on my installation?

    Regards
    Daniel

    Same issue here!
    Very confusing for my customer! They think everything is for free…
    Also the SMS of the providers says “0”…
    Lot of credit cards also do not work… Customers getting charged but the plugins answer is “credit card is expired”, which is simply not true

Viewing 3 replies - 1 through 3 (of 3 total)