• Resolved Matt

    (@syntax53)


    If I add “error_log(‘page_load’);” to one of my plugins and then click “tools” (for example, but any dashboard page is the same), I get two lines with “page_load” in my error log. If I disable broken link checker and do the same thing I only get 1.

    I’m afraid BLC is causing all of my dashboard pages to load twice and slow it down.

    https://www.ads-software.com/plugins/broken-link-checker/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Janis Elsts

    (@whiteshadow)

    My psychic debugging skills say that the second line corresponds to an AJAX request, not a second page load of the same page. Consider logging the current URL or something else that lets you identify which page is actually being requested.

    By default BLC is set to run continuously while the Dashboard is open. This means it will periodically send AJAX requests to see if there are any links that need to be checked. The first request happens when you open any admin page. While the page is open, it sends another request every 5 minutes or so.

    As a result, if your plugin logs every single request, you will see at least one additional “page_load” line for every admin page + another one every few minutes while you have the Dashboard open.

    Thread Starter Matt

    (@syntax53)

    Ok that makes sense, and I assume that is exactly what’s happening. Is it unavoidable (or necessary) to cause all plugins to reload in the ajax request though? I assume it may be necessary in order to process shortcodes depending on how you’re doing it.

    Janis Elsts

    (@whiteshadow)

    Is it unavoidable (or necessary) to cause all plugins to reload in the ajax request though? I assume it may be necessary in order to process shortcodes depending on how you’re doing it.

    I’m afraid so. In addition to shortcdodes, most custom post types also only work properly when the corresponding plugins are loaded.

    In theory, it would be enough to load only shortcode/CPT-related plugins. In practice, however, there’s no good way to automatically identify which plugins are needed, or to prevent WordPress from loading specific plugins without actually deactivating them.

    Thread Starter Matt

    (@syntax53)

    alright, thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Plugin seems to cause pages to load twice?’ is closed to new replies.