Viewing 15 replies - 1 through 15 (of 20 total)
  • Plugin Support Kim L

    (@kimmyx)

    Hi @gerold1968,

    Thanks so much for sharing! Daniel and the team are working very hard to patch some of the issues reported.

    We appreciate your patience! ??

    Plugin Author Daniel Iser

    (@danieliser)

    @gerold1968 – Are you seeing these everywhere, or only in the admin, or only when running our upgrades? Any extra info would be helpful. I’m about to push a large set of small changes meant to make things more strict in our code, and have patched about 7 other known reported issues so this might have been resolved already.

    Also from the looks these were during an upgrade. If your done with the upgrade you might likely not ever see them again anyways.

    If your not seeing them any longer lets go ahead and mark this resolved for now.

    Thread Starter gerold1968

    (@gerold1968)

    Hi, I see this all the time, repeated warnings. But only using the patched code you gave me. (Update from 2.0.6). I can′t see it on the 1. version.

    Plugin Author Daniel Iser

    (@danieliser)

    @gerold1968 – Hmm, I went through and the only time those things are called is during the upgrade in the admin. I can’t see how it would be run on the frontend at all, and shouldn’t be running in the admin either.

    Did you already open an email ticket and submit a login token? Would like to see if I can work out what is happening.

    Thread Starter gerold1968

    (@gerold1968)

    Ok, seems I was unclear. I see these warnings in server protocol, not on frontend or in the admin. If I roll back to version 1.1.10 I see no errors in protocol.

    Upgrade on the neweset version 2.0.8 results in fatal error:

    AH01071: Got error ‘PHP message: PHP Fatal error: Uncaught Error: Call to a member function using_index_permalinks() on null in /wp-includes/rest-api.php:467\nStack trace:\n#0 /wp-includes/rest-api.php(530): get_rest_url()\n#1 /wp-content/plugins/content-control/inc/functions/compatibility.php(51): rest_url()\n#2 /wp-content/plugins/content-control/inc/functions/compatibility.php(99): ContentControl\is_rest()\n#3 /wp-content/plugins/content-control/inc/functions/developers.php(217): ContentControl\is_frontend()\n#4 /wp-content/plugins/content-control/classes/Controllers/Frontend/Restrictions/QueryPosts.php(45): ContentControl\protection_is_disabled()\n#5/wp-includes/class-wp-hook.php(310): ContentControl\Controllers\Frontend\Restrictions\Que…’,

    So rolling back to 1.1.10

    Plugin Author Daniel Iser

    (@danieliser)

    @gerold1968 – Ahh, thats a different error than the previous one. Can you check if there are any others, I’d love to patch them all in one go, the more we solve & the earlier we solve it the better for any body else who might run into this.

    Also that log is truncated (…), any chance of getting the full message or logs? I’m trying to figure out what is starting this process leading to an error, and the initial calls are buried in the …

    Plugin Author Daniel Iser

    (@danieliser)

    Ok so just based on what I do see, this function is where the error occurs is here: https://developer.www.ads-software.com/reference/functions/get_rest_url/

    Specifically it means $wp_rewrite is null when this line is called: $wp_rewrite->using_index_permalinks()

    I’m back tracking up through our usage of that function, but I believe this means something is forcing our plugins query filters to be run much earlier than they should.

    In which case I need to find the source so I can figure out how to best address it on our end.

    Those logs would be super helpful.

    Plugin Author Daniel Iser

    (@danieliser)

    @gerold1968 – I’ve added a new filter in v2.0.9 (will be out later tonight).

    This might be a temporary filter so lets not rely on it long term, but it should help us track down the sweet spot for enabling query filters, or at least test the validity of that as the cause of the problem

    When you update, please add the following filter somewhere in your sites code (Code Snippets plugin is great if you need something).

    add_filter( 'content_control/query_filter_init_hook', function () {
        return 'init'; // Try setup_theme, after_theme_setup, init or wp_loaded
    } );
    Thread Starter gerold1968

    (@gerold1968)

    Thanks for all your efforts! This is outstanding. As I am in Austria/Europe we have a litte timeshift of 7-8 hours I think. During today I am going to try this and reply in detail. If you need anything else for debugging pls. tell me. I will be more than happy to do so.

    Thread Starter gerold1968

    (@gerold1968)

    Unfortunately, after updating to 2.0.8 (with your snippet installed) fatal error and site crashed:

    Got error ‘PHP message: PHP Fatal error: Uncaught Error: Call to a member function using_index_permalinks() on null in /wp-includes/rest-api.php:467\nStack trace:\n#0 /wp-includes/rest-api.php(530): get_rest_url()\n#1 /wp-content/plugins/content-control/inc/functions/compatibility.php(51): rest_url()\n#2 /wp-content/plugins/content-control/inc/functions/compatibility.php(99): ContentControl\\is_rest()\n#3 wp-content/plugins/content-control/inc/functions/developers.php(217): ContentControl\\is_frontend()\n#4 /wp-content/plugins/content-control/classes/Controllers/Frontend/Restrictions/QueryPosts.php(45): ContentControl\\protection_is_disabled()\n#5 /wp-includes/class-wp-hook.php(310): ContentControl\\Controllers\\Frontend\\Restrictions\\Que…’, referer: https://xxxxx/wp-admin/admin.php?page=edit-snippet&id=244

    Snippet 244 is your provided filter.

    Rollback to 1.1.10

    • This reply was modified 1 year, 2 months ago by gerold1968.
    Plugin Author Daniel Iser

    (@danieliser)

    @gerold1968 – Sorry for the confusion. I didn’t get the update out as I ran into a longer fix for another issue I was trying to get in. I’m about to push v2.0.9 shortly which will add that filter.

    That said I’m concerned about finding what plugin is actually causing this error. Let me explain.

    We call rest_url(), a WP function that then looks for the global $wp_rewrite.

    The global $rewrite is set within wp-settings.php file which is one of the first loaded. There are only a handful of actions which can be used before that time.

    sanitize_comment_cookies
    plugins_loaded
    plugin_loaded
    muplugins_loaded
    network_plugin_loaded
    mu_plugin_loaded

    The error suggests a plugin, theme or custom code is running post type queries this early, there are very few valid reasons to do so. Either they have a valid use case we need to account for, or someone should let them know so they might address it long term.

    The filter I gave will hopefully prevent our code from running that early, thus causing that wp function to not run either.

    Look for it in the next few hours.

    Plugin Author Daniel Iser

    (@danieliser)

    @gerold1968 I wanted to add, you can also install the Health Check & Troubleshooting plugin, with that you can enable Troubleshooting mode on our plugin. This will deactivate (only for you) all the other plugins.

    Then you can follow the following to narrow down the conflict:

    1. Activate other plugins a few at a time.
    2. Test if it works. If so, return to step #1.
    3. If it breaks, deactivate each plugin you just enabled one at a time.
    4. Test if it works. If not, return to step #3.
    5. If it works, the last plugin deactivated is a conflict.
    6. Deactivate that one, return to step #1 skipping known conflicts.
    7. Follow this until you have a list of all the conflicting plugins.
    Thread Starter gerold1968

    (@gerold1968)

    Hi, I have updated to 2.0.9 and ould trace the error down to the Plugin WooCommerce Order Status Manager by SkyVerge.

    Plugin Author Daniel Iser

    (@danieliser)

    @gerold1968 – Very good. Can you give me a quick idea of how you used that plugin? Probably straight forward but want to try and duplicate it in the same way your seeing issues.

    Did this code not help at all?

    add_filter( 'content_control/query_filter_init_hook', function () {
        return 'wp_loaded'; // Try setup_theme, after_theme_setup, init or wp_loaded
    } );
    Thread Starter gerold1968

    (@gerold1968)

    Hi, I am using this plugin for what it is intended to do: create custom order statusses. I cannot imagine, why there is any incompatibilty, but the plugin is used quite commonly…

    And yes: your code helps. No more errors with that!

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘php warnings’ is closed to new replies.