Daniel Iser
Forum Replies Created
-
@ferthalangur – Glad you found it, that tool is pretty great, very handy both for debugging issues after the update, but also testing repeatedly before we pushed it, probably hundreds of times collectively.
Please take a moment to rate & review the plugin and or support to spread the word.
@peter8nss – That is correct. It is on our list of possible future features, though the rest API doesn’t adhere to normal query style restrictions, so much of our targeting rules for example do not translate properly and would need unique versions for the Rest API.
Not impossible, but I’m not under the impression much of what we have now translates directly for the Rest API, so we’d need to study it more deeply.
I’m planning to move our feature requests to a public facing page on our site, if you want I’ll try to remember to ping you when i do, you can then sign up and vote as well as get notified if/when we build it.
@ferthalangur – I’ll check it out as soon as I can. In the mean time the plugin I sent previously should add a new Content Control item to the top admin toolbar. There you will find all the tools I mentioned.
It also includes a button to perform a clean install (delete everything of ours).
@ferthalangur – Sorry to hear that. I’m already planning some changes to the way backup task is handled in our upgrades. Essentially its not able to write the file to disk so its retrying a few times and failing.
Until then, did you have global restrictions to back up? If not, or if they were super easy to re-create you could install this tool and click the “Clean Install” option it adds to the admin toolbar. You shouldn’t need upgrades if your using fresh install of v2.
https://github.com/code-atlantic/content-control-migration-tester/releases/tag/v1.1.0
That said there are options there to backup & restore your v1 data (not the same as “Load v1 Data”, but anything destructive should give you confirm prompts.
Let me know, if you need you can generate a token and submit it, and I’ll see if I can bypass it.
Forum: Plugins
In reply to: [User Menus - Nav Menu Visibility] Avatar for non-logged users@foxermarcin – Hmm, that might be doable within WP already. I think we just use get_avatar, so you could filter it and return a value if user is not logged in.
I haven’t tested this but looks like it should do the trick, change
$default_imageto be the url to whatever image you prefer.function custom_default_avatar( $avatar, $id_or_email, $size, $default, $alt ) { // If there's no logged in user if ( ! is_user_logged_in() ) { // Path to your default avatar image (change to your actual path) $default_image = get_template_directory_uri() . '/path-to-your-default-image.jpg'; // Replace the avatar URL with your default image URL $avatar = "<img alt='{$alt}' src='{$default_image}' class='avatar avatar-{$size} photo' height='{$size}' width='{$size}' />"; } return $avatar; } add_filter( 'get_avatar', 'custom_default_avatar', 10, 5 );- This reply was modified 2 years, 8 months ago by Daniel Iser.
@davecarpenter – I’ve moved this to our issue tracker so we can work on it over the next few versions and keep track.
https://github.com/code-atlantic/content-control/issues/94
Feel free to add more info there if needed.@peter8nss – Can you retry the following code snippet again? Prior to v2.0.11 the rules checked for each restriction were not properly being checked against the right post in the loop.
add_filter( 'content_control/check_all_restrictions', '__return_true' );Also v2.0.11 includes query monitor support.
Here is how to use it while logged out.
I’m not confident we have all the needed info there yet to fully troubleshoot any scenario, but I’d love your feedback to know which direction to go with it.
@sachinkothiyal567 – Just tried to patch for this, if your still seeing it the only alternative is to unhook that filter.
Update and let us know.
if ( function_exists( '\ContentControl\plugin' ) ) { remove_filter( 'get_the_excerpt', [ \ContentControl\plugin('Frontend\Restrictions\PostContent'), 'filter_the_excerpt_if_restricted' ], 1000 ); }Hope that helps. Please take a moment to rate & review the plugin and or support to spread the word.
@chezterman Incoming today.
@peter8nss – No, it has an option to set a cookie so you and only you can view it while logged out as well.
I’m pushing an update today with some basic integrations showing all the restrictions applied to posts or the main query.
We are exploring an Everyone option, but from what I can see it’s only purpose would ever be to override a previous restriction which I’d deem as “greedy”, or targeting more than intended.
If that is in fact the case, though it would make a good backup tool in the toolbox, I think it’s the wrong solution. It would be useless on a fresh install and this confusing as to why it was an option.
The better solution would be to figure out how to make the other restriction not “greedy”. In this scenario we would tweak how rules like Is Search and Is Post work under the hood, so that they can be used in non-conflicting ways.
So consider this from your example:
- Is Search is always checking global state, on a search results page it always returns true. As such using it for single posts in the search list will always result in their removal.
- is post can be checked against the global state, is this the url for that post etc, or it can be checked in a loop accurately.
So on a search page you end up with the individual posts being checked against an always true global rule. It’s this that I want to mainly address. I’m just not 100% of how to do it without confusing extra “apply globally only” checkbox to each rule when you add it.
@sachinkothiyal567 – Sorry to hear that. I just looked over everything and the only thing that makes since is that your using a version of WordPress before 4.5, or another plugin (VC in this case), is calling the filter incorrectly.
If its an older version of WP, it shouldn’t have let you even install it as we marked it for WP 5.6+ only.
Otherwise is your VC plugin and addons up to date? Might be worth a support ticket to them to let them know there should be another parameter for that filter.
I can try adding a default value for the second parameter, but we can’t remove it, so I’m not entirely sure the error would be fixed or just masked, the only solutions would be fixing it on the VC side, or disabling our filtering of excerpts if your not using it.
/home/customer/www/staging7.taxsystems.com/public_html/wp-content/plugins/js_composer/include/params/vc_grid_item/attributes.php(461): apply_filters(‘get_the_excerpt’, ”)@peter8nss – Circling back, I’ve been adding support for Query Monitor plugin to view our processes visually to make it easier to troubleshoot. I’d love to hear what you think would be the most useful information to see there.
Further I’m having team read over things and give me separate takes on what they think the issue might be and what solutions might help, in the mean time I’d love to hear your thoughts on what you think the proper solution for your use case would be.
Would a 3rd option for “All Users” to override other restrictions be of use here for example? Do you think its more config limitations or in the processing.
To be clear we are hoping to make it more intuitive and flexible, so your feedback would be great.
@peter8nss we could definitely add some debug logging there, or maybe add some query monitor hooks to display conditional data there since many use that plug-in already for similar troubleshooting.
Great idea. Will start on that today.
@chezterman – As stated in email, I’ve put some patches in that should hopefully prevent these notices in the future. Look for v2.0.11 and let us know if your still seeing issues.
@bcourcet – In that case there must be a plugin/theme conflict somewhere, please refer to the steps here: https://ww.wp.xz.cn/support/topic/unable-to-select-video-category-or-tag/#post-17090884