Forum Replies Created

Viewing 1 replies (of 1 total)
  • I also have had some issues with many wp-cron processes running and causing CPU throttling.
    As I knew which plugin was running, rather than disabling wp-cron on wp-config.php (I am not brave enough .), I came up with a few lines of code using API_transient that make the trick.

    $prefix = .... // something to help you searching your stuff on wp_options table
    $name = ..... // whatever identifies your function
    $mins = .... // maximum frequency
    $trname = substr( $prefix . sprintf( "%u", crc32($name)), 0, 45 );
    if( get_transient($trname) )
    return "-- not yet";
    set_transient( $trname, date('c'), $mins*60 );
    // your program ....

Viewing 1 replies (of 1 total)