Complete backtrace shows that the call in this particular instance was initiated by something in JetPack that triggered the filter/action you are hooked into at a time when it isn’t appropriate to call is_page().
[23-Sep-2019 22:10:56 UTC] SCM_DEBUG: Function: is_page; Version: 3.1.0; Message: Conditional query tags do not work before the query is run. Before t
hen, they always return false.
[23-Sep-2019 22:10:56 UTC] SCM_DEBUG: Backtrace: #0 /home/simplych/public_html/wp-includes/class-wp-hook.php(286): scm_doing_it_wrong_run(‘is_page’, ‘
Conditional que…’, ‘3.1.0’)
#1 /home/simplych/public_html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(”, Array)
#2 /home/simplych/public_html/wp-includes/plugin.php(465): WP_Hook->do_action(Array)
#3 /home/simplych/public_html/wp-includes/functions.php(4746): do_action(‘doing_it_wrong_…’, ‘is_page’, ‘Conditional que…’, ‘3.1.0’)
#4 /home/simplych/public_html/wp-includes/query.php(570): _doing_it_wrong(‘is_page’, ‘Conditional que…’, ‘3.1.0’)
#5 /home/simplych/public_html/wp-content/plugins/ti-woocommerce-wishlist-premium/public/tinvwl.class.php(469): is_page(1260564)
#6 /home/simplych/public_html/wp-includes/class-wp-hook.php(288): TInvWL_Public_TInvWL->add_ogp(‘lang=”en-US”‘)
#7 /home/simplych/public_html/wp-includes/plugin.php(208): WP_Hook->apply_filters(‘lang=”en-US”‘, Array)
#8 /home/simplych/public_html/wp-includes/general-template.php(3836): apply_filters(‘language_attrib…’, ‘lang=”en-US”‘, ‘html’)
#9 /home/simplych/public_html/wp-includes/general-template.php(3851): get_language_attributes(‘html’)
#10 /home/simplych/public_html/wp-content/plugins/jetpack/modules/protect/blocked-login-page.php(344): language_attributes()
#11 /home/simplych/public_html/wp-content/plugins/jetpack/modules/protect/blocked-login-page.php(285): Jetpack_Protect_Blocked_Login_Page->display_page(‘Jetpack has loc…’, ‘<p><p>Your IP a…’, NULL, true)
#12 /home/simplych/public_html/wp-content/plugins/jetpack/modules/protect/blocked-login-page.php(291): Jetpack_Protect_Blocked_Login_Page->protect_die(‘<p><p>Your IP a…’, ‘Jetpack has loc…’, NULL, true)
#13 /home/simplych/public_html/wp-content/plugins/jetpack/modules/protect/blocked-login-page.php(213): Jetpack_Protect_Blocked_Login_Page->render_recovery_form()
#14 /home/simplych/public_html/wp-content/plugins/jetpack/modules/protect.php(637): Jetpack_Protect_Blocked_Login_Page->render_and_die()
#15 /home/simplych/public_html/wp-content/plugins/jetpack/modules/protect.php(496): Jetpack_Protect_Module->kill_login()
#16 /home/simplych/public_html/wp-content/plugins/jetpack/modules/protect.php(906): Jetpack_Protect_Module->check_login_ability()
#17 /home/simplych/public_html/wp-content/plugins/jetpack/class.jetpack.php(1871): include_once(‘/home/simplych/…’)
#18 /home/simplych/public_html/wp-includes/class-wp-hook.php(286): Jetpack::load_modules(”)
#19 /home/simplych/public_html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)
#20 /home/simplych/public_html/wp-includes/plugin.php(465): WP_Hook->do_action(Array)
#21 /home/simplych/public_html/wp-settings.php(394): do_action(‘plugins_loaded’)
#22 /home/simplych/wp-config.php(196): require_once(‘/home/simplych/…’)
#23 /home/simplych/public_html/wp-load.php(42): require_once(‘/home/simplych/…’)
#24 /home/simplych/public_html/wp-login.php(12): require(‘/home/simplych/…’)
#25 {main}
I know that if I modified your plugin code (which I did to test) for all instances where you were using one of those calls, and first tested to be sure the global $wp_query was set, the warnings go away. The same with the other plugins that I have reported to, becuase I am frustrated by having a log filled up with these messages about ‘doing it wrong’. 🙂 It is also frustrating that everyone points the finger at everything else, it is hard to get problems resolved.
Our test site probably will not reveal this, as we don’t have JetPack fully configured on there so I don’t believe it is calling out the same filters at the same times.
Does the above (complete) backtrace help at all?
UPDATE: I also have sent a message to JetPack about possibly having them change something, as it is the same module of JetPack, the Jetpack_Protect_Module, that is causing the problem here and in the YOAST WP-SEO WooCommerce plugin. The other one I have reported and am working on is with InstantSearch+ and it is not triggered by JetPack, but by WOoCommerce Memberships.
-
This reply was modified 5 years, 4 months ago by scmsteve.