• Hello,
    in classic use of your shortcode even with timeout settings,
    remote content load is blocking my page load.

    1) Is it possible to run this code simultaneously in the way that where home content is note blocked?

    2) Is it possible that specific shortcode is runned in schedule, for example 1 time per week, and the loaded remote content is saved in txt file on my server?

    Roman

Viewing 1 replies (of 1 total)
  • Thread Starter zumput

    (@zumput)

    Ok,
    I have a solution.
    1. Add some code to the plugin

    
    ...
    $pathUser = "/opt/webspace/zum/public/wp-content/yourpath
    //some selector filtering and triming
    $mySelector = substr($selector, 3); 
    $mySelector = substr($mySelector, 0, -3);
    $pos = strrpos($url, "/");
    $trimURL = substr($url, $pos+1); 
       
    //combine path and txt filename
    $pathUser = $pathUser .  $trimURL . "_". $mySelector . ".txt";
       
    //response proccessing to variable
    $mResponse = apply_filters( 'remote_content_shortcode_return', $response, $url );
       
    //save to file
    $fp = fopen($pathUser, "w+");
    fwrite($fp,$mResponse);
    fclose($fp);
    ...
    // filter the response
    return apply_filters( 'remote_content_shortcode_return', $response, $url );

    2. WP Crontrol plugin
    3. echo do_shortcode( ‘[remote_content url=”” );

    • This reply was modified 5 years, 3 months ago by zumput.
Viewing 1 replies (of 1 total)
  • The topic ‘Remote content load in background ?’ is closed to new replies.