• Resolved alcym

    (@alcym)


    After updating to versions 4.0 and then 4.0.1, the Query Monitor panel fails to open when clicked in the admin toolbar. Rolling back to 4.0.0 has the same issue. Version 3.20.4 works totally fine.

    in the page source, the inline script reads var QueryMonitorData = ; with no data between the equals sign and semicolon. This causes an Uncaught SyntaxError in the browser, followed by Uncaught ReferenceError: QueryMonitorData is not defined, which prevents the panel from loading. The error isn’t browser specific – it occurs regardless.

    Environment: PHP 8.3, WordPress latest, no JS minification or caching plugins active. Server and page caches cleared. Multiple browsers tested. The QM admin top bar tab simply is null.

    • This topic was modified 1 month, 3 weeks ago by alcym.
Viewing 15 replies - 1 through 15 (of 22 total)
  • Plugin Author John Blackbourn

    (@johnbillion)

    WordPress Core Developer

    Thanks for the report.

    • Can you try deactivating some of your plugins one by one to see if one of them is causing the problem?
    • Is there a fatal error logged in the PHP error log?
    Thread Starter alcym

    (@alcym)

    We have disabled all plugins and the issue persists but only with the lastest versions of QM.

    3.20.4 works fine. No fatal errors, in fact no errors in the logs anywhere referring to QM.

    I have the same problem. The plugin worked perfectly until I updated it to v4.0. I can no longer access anything in it. It does not show up when clicking on the Query Monitor tab in the admin bar on top.

    The URL appends #qm-overview and that’s it.

    4.0.1 also doesn’t work for me.

    Thread Starter alcym

    (@alcym)

    @mrgrooves Yes that’s exactly what we’re seeing as well. The URL just has #qm-overview and that’s all. Not even clickable.

    Plugin Author John Blackbourn

    (@johnbillion)

    WordPress Core Developer

    Thanks for the info everyone.

    • Does this happen only on the front end? Or in the admin area too?
    • Which theme are you using? Does the problem still occur if you switch to one of the default “Twenty” themes?
    • Are there any JavaScript errors in the browser console?

    I have the same issue. My link at the admin top bar says: PHP Fatal Error and its URL points to https://…mydomain…./#qm-fatal

    The error logs are full of messages like:
    PHP message: PMCS Caught Error: Cannot use object of type QM_Data_Stack_Frame as array in /home/runcloud/webapps/………../wp-content/plugins/object-cache-pro/src/Extensions/QueryMonitor/templates/commands.phtml on line 69; PHP message: PHP Warning: Undefined array key “file” in /home/runcloud/webapps/……………../wp-content/plugins/query-monitor/dispatchers/Html.php on line 650; PHP message: PHP Warning: Undefined array key “line” in /home/runcloud/webapps/…………………/wp-content/plugins/query-monitor/dispatchers/Html.php on line 650

    Plugin Author John Blackbourn

    (@johnbillion)

    WordPress Core Developer

    @bsmolyanov Thanks for that info. I’m already chatting with the author of Object Cache Pro about this issue. We’ll release a fix either in QM or in OCP. Bear with us!

    We published Object Cache Pro v1.25.3 just now which fixes this incompatibility.

    I am getting the same error on my localhost.

    Undefined array key “line” in ../wp-content/plugins/query-monitor/dispatchers/Html.php on line 650

    Similar experience here on my localhost. In my case the conflicting plugin appears to be Pods. With Pods activated, QM 4 just throws a fatal error. With Pods deactivated, QM 4 appears to work ok.
    Env.: Pods 3.3.8, WP 6.9, PHP 8.3, MySQL 5.7

    And same as everyone else, 3.20.4 works fine all the time.

    • This reply was modified 1 month, 3 weeks ago by jbleys. Reason: add error snapshot

    I just realized that the issue is happening when Pods is active. The latest version of Query Monitor seems to be conflicting with Pods.

    Plugin Author John Blackbourn

    (@johnbillion)

    WordPress Core Developer

    Thanks everyone. I’m taking a look.

    Plugin Author John Blackbourn

    (@johnbillion)

    WordPress Core Developer

    I’ve just released 4.0.2 with further backwards compatibility fixes, including a fix for Pods and older versions of Object Cache Pro. Cheers!

    Is there anything that plugins like Pods can do to better improve forward compatibility here?

    I can run a release today for Pods with whatever is necessary.

    Plugin Author John Blackbourn

    (@johnbillion)

    WordPress Core Developer

    The underlying issue is that the data collected by Query Monitor used to live in associative arrays, but in version 4 this switched to proper data transfer objects to reduce memory usage and increase type safety. The base QM_Data class implemented ArrayAccess for backwards compatibility with third-party plugins, but some of the child classes used for data collection didn’t. This is what tripped up Pods and others.

    Going forward you could switch to conditionally reading the object properties instead of using array access, but I think this backwards-compatibility will need to remain in QM now.

Viewing 15 replies - 1 through 15 (of 22 total)

You must be logged in to reply to this topic.