PHP Request Timeout Error

PHP Request Timeout Error

Request Timeout

This request takes too long to process, it is timed out by the server. If it should not be timed out, please contact administrator of this web site to increase ‘Connection Timeout’.

If you got an error like the one shown above, and your host is using LiteSpeed as its server, then chances are you have gotten the same error as me. To solve it, edit your .htaccess in the root folder of your site with the following

RewriteEngine On
RewriteRule .* - [E=noabort:1]
RewriteRule .* - [E=noconntimeout:1]

 

Enjoyed the content ? Share it with your friends !

WordPress custom cron schedules and intervals code

WordPress custom cron schedules and intervals

By default, WordPress only supports the intervals 'hourly', 'twicedaily', and 'daily' . What if we want our cron job to run at intervals other than the default? It is quite simple actually, we just have to hook cron_schedules

add_filter( 'cron_schedules', 'custom_cron_schedules' );
function custom_cron_schedules( $schedules ) 
{
    $schedules['every-1-minute'] = array(
        'interval' => MINUTE_IN_SECONDS, // Every 1 Minute
        'display'  => __( 'Every 1 Minute' ),		
    );
    
    $schedules['every-1-hour'] = array(
        'interval' => HOUR_IN_SECONDS * 1, // Every 6 hours
        'display'  => __( 'Every 1 Hour' ),
    );
    
    $schedules['every-6-hour'] = array(
        'interval' => HOUR_IN_SECONDS * 6, // Every 6 hours
        'display'  => __( 'Every 6 Hours' ),
    );
    
        
    return $schedules;
}

 

Enjoyed the content ? Share it with your friends !