Forums Forums Search & Filter Pro Search cache not updating after WP All Import

Viewing 8 posts - 1 through 8 (of 8 total)
  • Anonymous
    #190039

    Hello

    This I have the following code in functions.php

    //Rebuild search and filter pro cache after wp all import 
    
    add_action('pmxi_saved_post', 'wpai_post_saved', 10, 1);
    
    function wpai_post_saved($id) {
        do_action('search_filter_update_post_cache', $id);
    }
    
    //Reindex relvanssi after wp all import
    
    add_action('pmxi_after_xml_import', 'after_xml_import', 10, 1);
    
    function after_xml_import($import_id) {
        relevanssi_build_index();
    }

    WP All Import runs on a cron job, and so every day we are having to rebuild the cache manually.

    What are we doing wrong

    Thanks

    Trevor
    #190051

    The only other time I have been asked this question is in this thread, if it is of any help to you:

    https://support.searchandfilter.com/forums/topic/wp-all-import-taxonomies-not-updated/

    Anonymous
    #190583
    This reply has been marked as private.
    Anonymous
    #190587
    This reply has been marked as private.
    Anonymous
    #190589

    So the action pmxi_saved_post is where search_filter_update_post_cache is called, which from the log appears to be after the taxonomies are imported. However, looking at the terminologies used in the log, WP_All_Import saves posts and imports taxonomies.

    Tomorrow I will see whether running search_filter_update_post_cache on the pmxi_after_post_import hook makes any difference.

    In the meantime, is there anything else you could suggest please?

    Trevor
    #190593

    Do you think it possible that the save process is getting truncated, at or around where the taxonomy data is not being saved?

    I wonder is WP does not have enough memory allocated (so, NOT a PHP issue but related to the WP_MEMORY_LIMIT varible (our System Status page should show this, I hope)?

    Or maybe PHP Max Input Vars is too low (default is 1000, but I usually have it a lot higher).

    Or maybe the SQL query to save is being truncated (some hosts do that, such as WP Engine)?

    Anonymous
    #190642

    Thank you – I think they are all things we’ll need to take a look at.

    Also, we are using acf, and the wpai-acf-add-on plugin. I’ve just run the import on my local machine, where I have better debugging, and I can see that the following error is thrown, twice, at the start of the log:

    Warning: Invalid argument supplied for foreach() in /Applications/MAMP/htdocs/engage-education-wordpress/wp-content/plugins/wpai-acf-add-on/libraries/acf-fields/fields/fieldTaxonomy.php on line 59

    I can see that relates to $taxonomies_hierarchy = json_decode($xpath[‘value’]);

    A var_dump of $xpath reveals it to be array(2) { [“value”]=> string(0) “” [“delim”]=> string(1) “,” }

    Does this point to maybe something being wrong with how the fields are being mapped in our set up?

    Trevor
    #190644

    Could be. I guess the import would fail without that plugin?

Viewing 8 posts - 1 through 8 (of 8 total)