• Resolved rolfhuiber

    (@rolfhuiber)


    In 2.7.3 free, on eache request I have 9 such error messages in the debug.log (we run in debug mode, to detect any issues).

    [02-Oct-2021 17:10:12 UTC] is_page was called <strong>incorrectly</strong>. Conditional query tags do not work before the query is run. Before then, they always return false. Please see <a href="https://www.ads-software.com/support/article/debugging-in-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 3.1.0.) in .../wp-includes/functions.php on line 5663
    [02-Oct-2021 17:10:12 UTC] PHP Notice:  is_singular was called <strong>incorrectly</strong>. Conditional query tags do not work before the query is run. Before then, they always return false. Please see <a href="https://www.ads-software.com/support/article/debugging-in-wordpress/">Debugging in WordPress</a> for more information.
Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Support mediawebster

    (@mediawebster)

    Hello

    In 2.7.3 free – We do not have such a version of the plugin

    what plugin version number are you using?

    Thread Starter rolfhuiber

    (@rolfhuiber)

    Sorry for the confusion, version 1.3.7

    Plugin Support mediawebster

    (@mediawebster)

    Hello
    Ok! also my plugin does not use the function is_singular

    Do you use side switcher?

    Thread Starter rolfhuiber

    (@rolfhuiber)

    I am using the side switcher. Deactivating didn’t resolve the issue.

    I was maybe to quick that the problem is with WOOCS, but it is in conjunction with WooCommerce Dynamic Pricing & Discounts (), when both plugins are active. Only have WooCommerce also active, all other plugins are inactive.

    I deleted all rules in WooCommerce Dynamic Pricing & Discounts, but still received the error.

    Added to wp-includes/functions.php
    $message .= ‘ Backtrace: ‘ . wp_debug_backtrace_summary();

    [06-Oct-2021 16:46:02 UTC] PHP Notice:  is_page was called <strong>incorrectly</strong>. Conditional query tags do not work before the query is run. Before then, they always return false. Please see <a href="https://www.ads-software.com/support/article/debugging-in-wordpress/">Debugging in WordPress</a> for more information. Backtrace: require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('plugins_loaded'), WP_Hook->do_action, WP_Hook->apply_filters, RP_WCDPD->on_plugins_loaded, require_once('/plugins/wc-dynamic-pricing-and-discounts/classes/rp-wcdpd-settings.class.php'), RP_WCDPD_Settings::get_instance, RP_WCDPD_Settings->__construct, RP_WCDPD_Settings->load_settings, RP_WCDPD_Settings::get_structure, get_woocommerce_currency_symbol, apply_filters('woocommerce_currency_symbol'), WP_Hook->apply_filters, WOOCS->woocommerce_currency_symbol, is_account_page, is_page, _doing_it_wrong (This message was added in version 3.1.0.) in /store/store0/www/dev/wp-includes/functions.php on line 5665
    
    [06-Oct-2021 16:46:02 UTC] PHP Notice:  is_singular was called <strong>incorrectly</strong>. Conditional query tags do not work before the query is run. Before then, they always return false. Please see <a href="https://www.ads-software.com/support/article/debugging-in-wordpress/">Debugging in WordPress</a> for more information. Backtrace: require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('plugins_loaded'), WP_Hook->do_action, WP_Hook->apply_filters, RP_WCDPD->on_plugins_loaded, require_once('/plugins/wc-dynamic-pricing-and-discounts/classes/rp-wcdpd-settings.class.php'), RP_WCDPD_Settings::get_instance, RP_WCDPD_Settings->__construct, RP_WCDPD_Settings->load_settings, RP_WCDPD_Settings::get_structure, get_woocommerce_currency_symbol, apply_filters('woocommerce_currency_symbol'), WP_Hook->apply_filters, WOOCS->woocommerce_currency_symbol, is_account_page, wc_post_content_has_shortcode, is_singular, _doing_it_wrong (This message was added in version 3.1.0.) in /store/store0/www/dev/wp-includes/functions.php on line 5665

    In function woocommerce_currency_symbol, is_account_page is called, which calls is_page () (from where is_singular is coming I haven’t found out), when query is not open, throw error.

    Plugin Support mediawebster

    (@mediawebster)

    Hello

    My plugin doesn’t have this function (is_singular) anyway and is_page – this is only called in the side switcher, if you disable it it won’t work

    Try in file – wp-content\plugins\woocommerce-currency-switcher\classes\woocs.php – delete this code – https://share.stackovergo.com/image/i20211008173355.png and do a test

    Thread Starter rolfhuiber

    (@rolfhuiber)

    Thanks, that fixed that the is_page and the is_singular are not logged any more.

    Will the patch be implemented in a future release?

    • This reply was modified 3 years, 1 month ago by rolfhuiber.
    Plugin Support mediawebster

    (@mediawebster)

    Hello

    Unfortunately, I do not know. The developers will check this and decide how to fix it.

    Thread Starter rolfhuiber

    (@rolfhuiber)

    Sorry to bother again.
    We are also using WooCommerce Wholesale Prices Premium.

    We changed from single products to variations last week.

    With your patch https://www.ads-software.com/support/topic/is_page-is_singular-called-before-query-is-run/#post-14951679 we noticed that the wholesale prices for other currencies where not converted on the product page. Only the currency symbol changes. When added to the cart, the cart shows the correct conversion.

    Without the patch all works fine. But with WooCommerce Dynamic Pricing & Discounts active it fills our debug.log.

    Can you please have a look with your developers to have a sustainable solution.

    • This reply was modified 3 years ago by rolfhuiber.
    dev

    (@devksec)

    I spoke to the developers of “WooCommerce Wholesale Prices Premium” and they implemented compatibility with WOOCs.

    I recommend you reach out to them and see if they’re able to investigate/further check as they’re quick to respond.

    Thread Starter rolfhuiber

    (@rolfhuiber)

    Everything is working just fine when using the 3 plugins as is.

    However when WooCommerce Dynamic Pricing & Discounts is active our debug.log gets filled without the patch https://www.ads-software.com/support/topic/is_page-is_singular-called-before-query-is-run/#post-14951679. Currently we have 35GB logs daily.

    When the patch is active WooCommerce Wholesale Prices Premium does not convert the prices for other currencies correct.

    The problem is with WooCommerce Dynamic Pricing & Discounts calling WOOCS in a way were is_single/is_singular complain.

    Plugin Support mediawebster

    (@mediawebster)

    Plugin Support mediawebster

    (@mediawebster)

    Hello @devksec

    Thank you for cooperation

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘is_page/is_singular called before query is run’ is closed to new replies.