Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3rd Party Plugin Compatibility: WPBakery Visual Composer Post Grid #673

Open
raamdev opened this issue Feb 18, 2016 · 24 comments
Open

3rd Party Plugin Compatibility: WPBakery Visual Composer Post Grid #673

raamdev opened this issue Feb 18, 2016 · 24 comments

Comments

@raamdev
Copy link
Contributor

raamdev commented Feb 18, 2016

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.

@raamdev
Copy link
Contributor Author

raamdev commented Feb 18, 2016

Mentioned here (internal ticket): https://websharks.zendesk.com/agent/tickets/11238

@almeco
Copy link

almeco commented Feb 18, 2016

I vote for this

@ThePopularizer
Copy link

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]

@pavelthq
Copy link

@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');

@pavelthq
Copy link

Also @raamdev filter I provided disables nonce checking

@ThePopularizer
Copy link

Thanks @AngeIII, I've left it for a day, and so far so good.

@raamdev
Copy link
Contributor Author

raamdev commented Feb 25, 2016

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.

@pavelthq
Copy link

@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

  1. when server receives ajax call [file: include/autoload/hook-vc-grid.php::getGridDataForAjax ] server check if this request is valid [ request data, tag, nonce ]
  2. 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.

@raamdev
Copy link
Contributor Author

raamdev commented Feb 26, 2016

  1. 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.

@pavelthq
Copy link

@raamdev sent to your public email in @raamdev.com

@raamdev
Copy link
Contributor Author

raamdev commented Feb 26, 2016

@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.

@renzms
Copy link

renzms commented Dec 20, 2016

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.

@raamdev
Copy link
Contributor Author

raamdev commented Dec 20, 2016

@renzms I provided you with a copy of Visual Composer in Slack for testing purposes.

@cschalenborgh
Copy link

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');

@pavelthq
Copy link

@cschalenborgh note that this filter will disable _vcnonce (wp_verify_nonce) checks for ajax calls.

@lukecav
Copy link

lukecav commented Apr 12, 2017

@viet0viet
Copy link

I have the exact same problem. Can someone tell me how to add the filter?

@kodyaz
Copy link

kodyaz commented Jun 18, 2017

Thanks @AngeIII
This fixed it:
add_filter('vc_grid_get_grid_data_access','__return_true');
I use Wp Fastest Cahce.

@viet0viet
Copy link

Where did you add the filter? Can you be more specific?

@kodyaz
Copy link

kodyaz commented Jun 19, 2017

hi, wp-include/function.php

@raamdev
Copy link
Contributor Author

raamdev commented Jun 19, 2017

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.

@thardmanskagit
Copy link

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!

@TFornario
Copy link

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?

@Nodws
Copy link

Nodws commented May 23, 2019

FIXED if your content is in the front page, add this to the functions

$_GET['preview'] = 'true';
remove_action( 'template_redirect', 'redirect_canonical' );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests