• Resolved kevinsmith0214

    (@kevinsmith0214)


    I have a link from my supplier to sync prices but it has a time limit. (1 every 10min) , It seems WP all import makes a double request when I want to set up the feed, How can I avoid this so that only 1 request is made?

Viewing 1 replies (of 1 total)
  • Plugin Author WP All Import

    (@wpallimport)

    Hey @kevinsmith0214,

    How can I avoid this so that only 1 request is made?

    It’s likely that WP All Import is pinging the feed a second time to try to get the feed type. Try adding this code to your child theme’s functions.php file:

    add_filter( 'wp_all_import_curl_download_only', 'wpai_wp_all_import_curl_download_only', 10, 1 );
    function wpai_wp_all_import_curl_download_only( $download_only ){
    	return true;
    }
    
    add_filter('wp_all_import_feed_type', 'wpai_wp_all_import_feed_type', 10, 2);
    function wpai_wp_all_import_feed_type($feed_type, $url) {
        if ($url == 'https://example.com/feed') {
    	    return 'json';
        }
        return $feed_type;
    }
    
    add_filter('http_request_timeout', 'wpai_http_request_timeout', 10, 2);
    function wpai_http_request_timeout($timeout, $url) {
        return 60;
    }

    Make sure to change ‘https://example.com/feed’ and ‘json’ to your feed URL and the feed type (like ‘csv’ or ‘xml’).

    Let me know how it goes.

Viewing 1 replies (of 1 total)
  • The topic ‘double requests issue on time limit’ is closed to new replies.