Forums › Forums › Search & Filter Pro › Update Cache after WP All Import
- This topic has 12 replies, 3 voices, and was last updated 5 years, 1 month ago by
Ross.
-
Trevor(Private) July 2, 2020 at 8:35 am #251060
I would try triggering the updates to the cache later (the 1000 in this code):
add_action('pmxi_saved_post', 'wp_all_import_post_saved', 1000, 1); function wp_all_import_post_saved($id) { do_action('search_filter_update_post_cache', $id); }
I do not think you can trigger our full cache rebuild using a cron job.
If you have an array of all the post IDs affected by the update, you could write some code to loop through that array after the bulk import, triggering the update per post.
That would require you have available such an array, but I am guessing you could do that.
Anonymous(Private) July 2, 2020 at 9:19 pm #251246I turned off my cron and put your code in my functions.php file. This was something I tried before, and after another test, newly imported posts are not getting added to cache. There were no errors in the error_log. Any other ideas or thoughts on how I can continue debugging this?
Ross Moderator(Private) July 6, 2020 at 11:37 am #251454Hi Scott
This issue has come up from time to time, while I have never been able to replicate it myself… Some users’ have reported a conflict with another plugin while other have managed to mystically resolve themselves…
I think at this point, we need to be able to reproduce your issue, with the minimum amount of configuration / setup.
Are you able to setup a staging / dev / test site, with your site stripped back to only essential content / plugins – while the issue still presents itself?
Thanks
Anonymous(Private) July 8, 2020 at 9:29 pm #252069I setup a staging environment and did some testing, and it may be related to Hummingbird Pro, which is a caching plugin. When I deactivate that plugin and run another import, new posts are added to Search & Filter’s cache and pull up on the frontend search.
I have not begun to test with Hummingbird Pro back on, but the plugin does offer URL and template file exclusions from their caching. Do you have experience with Hummingbird Pro and how to use it and Search & Filter together?
Ross Moderator(Private) July 9, 2020 at 9:01 am #252099Hi Scott
Thanks for the update, I actually use Hummingbird Pro on a couple of sites (that don’t need S&F) – so will see if I can do some testing with that and figure out the cause / a way to set this up.
If you can let me know though, by simply enabling the plugin again and re-running the import, if that then breaks things again?
Best
Anonymous(Private) July 17, 2020 at 9:04 pm #253234I did some more testing, and Hummingbird Pro does not seem to be the issue. Whether the plugin is on or off, new posts will be added to Search & Filter’s cache if I manually run a WP All Import import. Using the code above works as intended. However, I’m running WP All Import on a cron. When the import is finished via the cron, new posts are not added to Search & Filter’s cache.
Ross Moderator(Private) July 17, 2020 at 9:11 pm #253236So it looks like on a cron job it fails?
That might make some sense actually… At least I finally have a line of investigation 🙂
Best
-
AuthorPosts