Open raamdev opened 8 years ago
Mentioned here (internal ticket): https://websharks.zendesk.com/agent/tickets/11238
I vote for this
I'm experiencing a conflict with Visual Composer's Post Grid at the moment, where, after a few days of having it cached, it would not load; more precisely, it shows the loading graphics, but it would not load the actual posts. Strangely enough, it works fine soon after the cache is cleared or when it is first cached. It's a little difficult to troubleshoot, given this element of time interval. The issue remains even when the exception is made for js_composer in the HTML compressor.
I've also submitted this issue to them on the VC CodeCanyon site.
Thanks for you time!
[re-post]
@ThePopularizer Hi, i'm one of core developers of visual composer. Can you please test this snippet:
add_filter('vc_grid_get_grid_data_access','__return_true');
Also @raamdev filter I provided disables nonce
checking
Thanks @AngeIII, I've left it for a day, and so far so good.
add_filter('vc_grid_get_grid_data_access','__return_true');
[...] filter I provided disables nonce checking
@AngeIII Thanks for chiming in here! Could you explain a bit more about what that filter does? ZenCache / Comet Cache specifically disables caching for any pages where it finds a Nonce value being added to the page source (specifically so that there are no issues where a time-sensitive Nonce value might get cached). I'm curious if that's not working as expected, or if Visual Composer is doing something else that is not working right with ZenCache / Comet Cache.
@raamdev
Okay I will try to explain full process:
1) when grid [vc_basic_grid, vc_media_grid, vc_masonry_grid, vc_masonry_media_grid] being rendered it creates a nonce: data-vc-public-nonce="<?php echo vc_generate_nonce( 'vc-public-nonce' ); ?>
2) function vc_generate_nonce actually calls wp_create_nonce with our prefix
This is being used in javascript ajax call
3) when server receives ajax call [file: include/autoload/hook-vc-grid.php::getGridDataForAjax ] server check if this request is valid [ request data, tag, nonce ] 4) before check server calls filter: 'vc_grid_get_grid_data_access' to actually disable this check.
Summary:
1) it seems system have cached shortcode template with old/wrong nonce 2) also it seems your plugin doesn't have catched wp_create_nonce usage.
2) also it seems your plugin doesn't have catched wp_create_nonce usage.
Correct, caching a nonce is a bad idea. See What are WordPress nonces and why are they not cache-compatible?
It appears that Visual Composer is not using the standard _wpnonce
values but instead using a custom _vcnonce
. Comet Cache currently looks for _wpnonce
in the page source and disables caching for that page when it finds it. Since Visual Composer is not using the standard _wpnonce
, Comet Cache currently caches the page, which causes problems when the _vcnonce
expires.
@AngeIII Would it be possible for us to get a copy of Visual Composer Post Grid so that we can look into improving compatibility with Comet Cache? I'd like to run some tests to see if we can make things more seamlessly for our users. raam at websharks-inc dot com is my email.
@raamdev sent to your public email in @raamdev.com
@AngeIII Received. Thank you. I'll add Visual Composer + Comet Cache testing to my todo list and update here again when I have something to add.
Mentioned here in (internal ticket)
Details:
Customer has issues when using Visual Composer with Comet Cache. While Comet Cache is active they are unable to see Visual Composer options in Page(s)/Post(s)/Portfolio(s), etc. When Comet Cache is deactivated it reportedly works fine. Customer has also tried deactivating html compression, but issue still exists.
@renzms I provided you with a copy of Visual Composer in Slack for testing purposes.
Fyi @AngeIII, I've experienced the same issue, but with WP Fastest Cache.
This fixed it:
add_filter('vc_grid_get_grid_data_access','__return_true');
@cschalenborgh note that this filter will disable _vcnonce (wp_verify_nonce) checks for ajax calls.
I have the exact same problem. Can someone tell me how to add the filter?
Thanks @AngeIII This fixed it: add_filter('vc_grid_get_grid_data_access','__return_true'); I use Wp Fastest Cahce.
Where did you add the filter? Can you be more specific?
hi, wp-include/function.php
wp-include/function.php
This is not correct. Please don't modify WordPress Core files.
You can add the filter to the bottom of your theme's function.php
file (e.g., wp-content/themes/[your-theme]/functions.php
) or even better you can create an MU-Plugin and put the filter in there.
I was having an issue where post grids would show up if I used "preview page" or if I was in incognito mode, but not while accessing the site regularly. I added the code to my function.php file and now it works perfectly!
Hello, I've tried the filter given by @Angelll but the VC grid still does not show properly. Weird thing is that images DO appear, but the first grid image does not show. Only the first image of the grid. If I have a grid of 4 images, only 3 will appear and the first one is an empty space.
I've installed WP Fastest Cache and added the clear cache rule every 10 hours as described on this page: http://www.wpfastestcache.com/tutorial/visual-composer-post-grid-problem/ - It still doesn't work for me. Has there been any other solutions found to this problem?
FIXED if your content is in the front page, add this to the functions
$_GET['preview'] = 'true';
remove_action( 'template_redirect', 'redirect_canonical' );
This issue exists to track compatibility between Comet Cache and WPBakery's Visual Composer Post Grid. This article explains one method that could be used to improve integration.