• Resolved Paul

    (@headwall)


    Hi

    We’re picking up doing_it_wrong warnings with Automptimize and WordPress 6.7:

    Function _load_textdomain_just_in_time was called incorrectly
    classes/autoptimizeProTab line 24 & line 26

    It looks like you’re calling esc_html__() in the constructor, before WP has initialised. The guidance says to move any calls that might use gettext() or translate() into the init action (or later).

    Thanks

    Paul

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    thanks for the heads up Paul, I’ll look into that! ??

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    have been trying to get that deprecation warning to show up, but can’t find it anywhere strangely enough. nothing of that sort in php errorlog, nothing via query monitor, nothing showing on pages even with WP_DEBUG and WP_DEBUG_DISPLAY set to true. any tips on how to get this to show are more than welcome! ??

    Thread Starter Paul

    (@headwall)

    I’ve gone back to a fresh dev site and double-checked. Here is what I’ve got:

    • WordPress 6.7
    • mu-plugins : none
    • plugins:
      • Autoptimize 3.1.12
      • Query Monitor 3.16.4
    • theme:
      • twentytwentyfive
    • Site language: English (UK) << Important that you don’t use the default English (US)

    When I view the admin dashboard, Query Monitor reports Autpotimize autoptimizeProTab.php line 24 is trying to access translation functions too early in the page load.

    I’ve seen this a lot on my hosting network, and it’s mostly caused by plugins calling __() in class constructors, before the “init” action has triggered.

    Does that help?

    • This reply was modified 2 weeks ago by Paul.
    Plugin Author Optimizing Matters

    (@optimizingmatters)

    changing the language to a non-default one, that’s what I was missing! thanks for that! ??

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    OK, so just pushed a fix to the Beta version on Github, would be great if you could download the zipfile and test as well Paul? ??

    Thread Starter Paul

    (@headwall)

    I just tried the new beta version on one of my dev sites and I can confirm the Doing it Wrong warnings have been resolved ??

    I deactivated and reactivated the beta plugin and there is a Doing it Wrong warning in your activation action handlers somewhere, but the plugin looks OK for general usage now.

    I’m happy to help with additional testing if needs be.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    OK, just fixed the issue with the “doing it wrong” in the upgrade routine as well, thanks for the assistance! ??

    enjoy the weekend!
    frank

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.