Daniel Iser
Forum Replies Created
-
@lewisburgess79 – v2.0.9 had some changes to the custom message, both in how it is saved and rendered. Might be worth seeing if that helps resolve any issues.
Let me know.
@nobodee – I patched a lot of reported issues that might have helped resolve this in v2.0.9, can you check and let me know?
- This reply was modified 2 years, 9 months ago by Daniel Iser.
@dkurapati – I just released a big update with fixes for a bunch of reported issues. Among them was allowing admins to delay query processing until a specific action.
If your still seeing issues in v2.0.9, try adding the following snippet to your site (Code Snippets plugin works great).
add_filter( 'content_control/query_filter_init_hook', function () { return 'init'; // Try setup_theme, after_theme_setup,initor wp_loaded } );This should prevent plugins that are querying before all your rules are registered from triggering issues with normal WP queries which you want the plugin to scan.
You can play with the different actions listed in the comment to see which gives better results.
Let us know.
@rogererkens, @rabbit424 – Can you both try the latest version, it fixed a bug where content replacement wasn’t always being triggered. Now its the default fallback if no other protection method got applied.
@defender75, @joroabv – Just pushed another update which fixed quite a few issues, including one with Elementor post queries with ACF.
Let us know if its fixed for you now.
Hmm, I wonder if this filter might be useful for your setup:
https://contentcontrolplugin.com/docs/troubleshooting/basic-troubleshooting-guide/#h-4-my-top-restrictions-stop-or-short-circuit-ones-lower-in-the-restriction-listTo clarify, this is something we are trialing at first in v2 via a filter, and it may become standard if we see it solves more issues than it potentially could cause.
What this allows is to have multiple restrictions that could match a specific piece of content or user, and then it takes the highest priority (set by you in the dash).
You might be able to then set up several different restrictions, even multiple targeting the same content and different users, or different content and the same users etc.
Try it out and let me know if it gets you any closer. If not maybe you can help me duplicate the issue in some simple way on a test site where I can debug more closely.
add_filter( 'content_control/check_all_restrictions', '__return_true' );@nobodee – Just pushed an update, would love to hear if it helped resolve your issues. We resolved quite a few issues for other users. If not would love to have more details on your issue so we can get it resolved ASAP.
Hmm, I think its gonna be a grouping thing here, and likely a good scenario for us to add to our docs once we work it out.
Can you tell me exactly what your trying to restrict, how, and from who?
Want to be sure I understand the goal of your restrictions.
—-
Some rule types are global under the hood, we might have to list/mark them at some point.
Is Search Pageis one of these. Then there are general content rules such asIs a post .... There are also other types of rules but not important here.General rules can apply to the main query, but also to posts within other queries (eg search results), as well as be used with developer functions.
Global rules will only be checked against the main query.
So if I understood your premise correctly, its possible that
AND Is Not Search Pageis checking against the global page and always returning false on search results pages. Anyfalsefor anANDrule means it will fail to match.
So I think those content types are failing to hide on search pages, well, because its set up that way.- This reply was modified 2 years, 9 months ago by Daniel Iser. Reason: fix formatting
- This reply was modified 2 years, 9 months ago by Daniel Iser. Reason: formatting broken for underline
@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:- Activate other plugins a few at a time.
- Test if it works. If so, return to step #1.
- If it breaks, deactivate each plugin you just enabled one at a time.
- Test if it works. If not, return to step #3.
- If it works, the last plugin deactivated is a conflict.
- Deactivate that one, return to step #1 skipping known conflicts.
- Follow this until you have a list of all the conflicting plugins.
For the record, we added a filter in v2.0.9 that will allow delaying our query filtering. This will allow you to bypass these types of issues by effectively ignore any queries made before
initusing the example below. You can usesetup_theme,after_theme_setup,initorwp_loadedadd_filter( 'content_control/query_filter_init_hook', function () { return 'init'; // Try setup_theme, after_theme_setup, init or wp_loaded } );That should hopefully at least allow quickly resolving any issues like this in the future from plugins we don’t control.
Marking this resolved for now. Please take a moment to rate & review the plugin and or support to spread the word.
If you have any further issues please open a new thread for those.
- This reply was modified 2 years, 9 months ago by Daniel Iser.
@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 withinwp-settings.phpfile 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_loadedThe 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.
@pwosterbrock – Awesome, glad I could help. Please take a moment to rate & review the plugin and or support to spread the word.
@ronstallmach – Thanks, that helped. I can confirm its working as of the v2.0.9 update I’m about to push. Update and let me know if you have any other issues.
Otherwise please take a moment to rate & review the plugin and or support to spread the word.
- This reply was modified 2 years, 9 months ago by Daniel Iser.
@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 problemWhen 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 } );@pwosterbrock – You sir are amazing, that was just enough to get me all the way. I’ve worked out a solution I’m happy with and its already in place on that testing/staging site you sent over.
There are a few fixes coming the next version, but I believe this is the one that fixed everything.
Let me know if you see any other issues still.
I’ll get a patch out tonight, thanks again for the assistance.