• Resolved anton7249

    (@slieptsov)


    Hi,

    When Optimize JavaScript Code? option is off I get these Notices and Warnings:

    Notice: is_page was called incorrectly. Conditional query tags do not work before the query is run. Before then, they always return false. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.) in ../wp-includes/functions.php on line 5535

    Notice: is_single was called incorrectly. Conditional query tags do not work before the query is run. Before then, they always return false. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.) in ../wp-includes/functions.php on line 5535

    Warning: Cannot modify header information – headers already sent by (output started at ../wp-includes/functions.php:5535) in ../wp-includes/functions.php on line 6584

    Warning: Cannot modify header information – headers already sent by (output started at ../wp-includes/functions.php:5535) in ../wp-admin/includes/misc.php on line 1310

    Warning: Cannot modify header information – headers already sent by (output started at ../wp-includes/functions.php:5535) in ../wp-admin/admin-header.php on line 9`

    Can you please fix it?

    Kind regards

    • This topic was modified 3 years, 3 months ago by anton7249.
Viewing 15 replies - 1 through 15 (of 21 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    Do you have the Enable configuration per post/ page? option on? Does the notice go away when it is off?

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    additionally; do the warnings/ notices appear when browsing the frontend or when editing pages/ posts?

    Thread Starter anton7249

    (@slieptsov)

    Yes it shows when editing pages/ posts and on the frontend it shows:

    Notice
    : is_page was called
    incorrectly
    . Conditional query tags do not work before the query is run. Before then, they always return false. Please see
    Debugging in WordPress
    for more information. (This message was added in version 3.1.0.) in
    ../wp-includes/functions.php
    on line
    5535
    
    Notice
    : is_single was called
    incorrectly
    . Conditional query tags do not work before the query is run. Before then, they always return false. Please see
    Debugging in WordPress
    for more information. (This message was added in version 3.1.0.) in
    ../wp-includes/functions.php
    on line
    5535

    I do not know where is Enable configuration per post/ page? option.

    I use multisite.

    Kind regards

    • This reply was modified 3 years, 3 months ago by anton7249.
    Plugin Author Optimizing Matters

    (@optimizingmatters)

    I do not know where is Enable configuration per post/ page? option.

    It’s at the bottom of the main Autoptimize settings page (JS & CSS & HTML)

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    fyi: I’ve tried with both “configuration per post/page” on and off (on my local multisite installation) but haven’t been able to reproduce yet.

    might you have a plugin (or theme) that hooks into Autoptimize using the API, adding additional logic if “optimize JS” is on?

    Thread Starter anton7249

    (@slieptsov)

    The messages are gone when Enable configuration per post/ page? option is off.

    I use only this:

    // Remove defer attribute from js file in Autoptimize plugin
    add_filter( 'autoptimize_filter_js_defer', 'mega_no_defer', 10, 1 );
    function mega_no_defer( $defer ) {
    	return '';
    }

    But messages do not gone when removing it.

    You sure define( 'WP_DEBUG', true ); on your installation?

    Kind regards

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    The messages are gone when Enable configuration per post/ page? option is off.

    so “JS optimize” off and “per post/page config” on -> notices/ warnings?

    I use only this:

    and you’re sure no other plugin is doing anything related? does the problem persist with all other plugins off?

    You sure define( ‘WP_DEBUG’, true ); on your installation?

    absolutely, yes.

    Thread Starter anton7249

    (@slieptsov)

    so “JS optimize” off and “per post/page config” on -> notices/ warnings?

    Yes, correct.

    Kind regards

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    I’ve tried with that configuration on some other sites of mine (hosted elsewhere) but still can’t reproduce. And are you sure no other plugin is doing anything related? Does the problem persist with all other plugins off?

    Thread Starter anton7249

    (@slieptsov)

    Activated default theme and deactivated all other plugins and the the problem still persist.

    Kind regards

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    how bizarre … can you list all your AO settings, I’ll try reproducing with the exact same config.

    Thread Starter anton7249

    (@slieptsov)

    Sorry, can you add additional information, where are these AO settings?

    Kind regards

    Thread Starter anton7249

    (@slieptsov)

    It actually does not bother me as I just deactivated “per post/page config” option.

    Kind regards

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    It actually does not bother me as I just deactivated “per post/page config” option.

    happy to read that, but I’m somewhat bothered with the possibility of a bug that I can’t seem to reproduce ??

    Sorry, can you add additional information, where are these AO settings?

    I was referring to the other Autoptimize settings;
    * is “optimize CSS” on? does toggling that make any difference?
    * is “optimize HTML” on? does toggling that make any difference?
    * What about settings on the “images” tab? does toggling those make any difference?
    * What about settings on the “extra” tab? does toggling those make any difference?

    If you want you can also reach out to me through my contact form ??

    Thread Starter anton7249

    (@slieptsov)

    * “optimize CSS” is off.
    * “optimize HTML” is off.
    * “Optimize HTML Code” is off.
    * “Save aggregated script/css as static files?” is on.
    * “Minify excluded CSS and JS files?” is on.
    * “Enable 404 fallbacks?” is off.
    * “Also optimize for logged in editors/ administrators?” is on.
    * “Enable configuration per post/ page?” is off.
    * What about settings on the “images” tab? all is off.
    * What about settings on the “extra” tab? does toggling those make any difference? * “Removes WordPress’ core emojis’ inline CSS, inline JavaScript, and an otherwise un-autoptimized JavaScript file.” is on.

    Kind regards

Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘Notice and Warning’ is closed to new replies.