Forums Forums Search & Filter Pro Rebuild cache after All Import

Tagged: ,

Viewing 10 posts - 1 through 10 (of 62 total)
  • Anonymous
    #204985

    Hi

    I have a site that uses WP All Import to add/update posts. The client is flagging that updated posts aren’t always showing in the results. When I rebuild the cache on the search they do appear.

    I’ve added the following to the functions on All Import, which as far as I can see should solve this problem but unfortunately it hasn’t. Any thoughts?

    add_action('pmxi_saved_post', 'wp_all_import_post_saved', 10, 1);
    
    function wp_all_import_post_saved($id) {
        do_action('search_filter_update_post_cache', $id);
    }

    Thanks

    Trevor
    #204991

    That code should work, but a few users have found, like you, that it does not. Can you try an experiment?

    Do the import with that code in place, and then do the import again?

    Anonymous
    #205061

    Hi Trevor

    I just tried that with some new data but no luck. Once the cache was rebuilt, after the second import was finished, the figures changed quite drastically.

    Alan

    Trevor
    #205129

    You somehow need to see if that function is being used. These plguins might help:

    https://wordpress.org/plugins/debug-bar/
    https://wordpress.org/plugins/debug-bar-actions-and-filters-addon/

    Anonymous
    #205141

    I do use Query Monitor, which I believe does a similar thing.

    I did spot this in the actions on the Query Monitor plugin, if it’s of any interest.

    Search_Filter_Post_Cache->wp_shutdown()

    I did also echo the ID and ‘- cached’ in the same All Import function, which did show on the log so I know wp_all_import_post_saved is being used.

    Trevor
    #205157

    Are you able to look through the database and find our cache tables and see if the post data appears to be updated in there?

    The shutdown function is merely part of our code calling the WordPress shutdown action.

    Anonymous
    #205167

    How do I know if the post data in that table has been updated? I have rebuilt the cache since the last import so may have to wait now until the next import, in a few days.

    Trevor
    #205169

    Ah, yes, you would have to wait, unless you made a test post, and updated just that.

    Anonymous
    #205512

    It doesn’t look like the cache table is updating with the new imports. The most recent product added is ID 14523 but the cache table only references up to 14428.

    Trevor
    #205516
    This reply has been marked as private.
Viewing 10 posts - 1 through 10 (of 62 total)