( $check_minutes * 60 ) ) || ( ! $vcheck = get_site_option('scoper_version_info') ) ) {
$vcheck = wp_remote_fopen( 'http://agapetry.net/downloads/role-scoper_version.chk' );
$rechecked = true;
update_option( 'scoper_version_info', $vcheck );
}
if ( $vcheck ) {
if ( ( (time() - $last_check) > ( $check_minutes * 60 ) ) || ( ! $vcheck_ext = get_site_option('scoper_extension_info') ) ) {
$vcheck_ext = awp_remote_fopen( 'http://agapetry.net/downloads/role-scoper-extensions.chk', 5 );
$rechecked = true;
update_option( 'scoper_extension_info', $vcheck_ext );
}
} else
$vcheck_ext = false;
if ( $rechecked )
update_option( 'scoper_last_version_update_check', time() );
if($vcheck)
{
$status = explode('@', $vcheck);
$theVersion = $status[1];
if( ( version_compare( strval($theVersion), strval(SCOPER_VERSION), '>' ) == 1 ) )
{
$msg = '' . sprintf(__( "A new version of Role Scoper is available (%s)", "scoper" ), $theVersion);
if ( $rechecked || ( ! $vcheck = get_site_option('scoper_version_message') ) ) {
$vcheck = awp_remote_fopen( 'http://agapetry.net/downloads/role-scoper.chk', 5 );
add_site_option( 'scoper_version_message', $vcheck );
}
if ( $vcheck ) {
$status = explode('@', $vcheck);
$theMessage = $status[3];
if ( $ver_pos = strpos($theMessage, '
' . SCOPER_VERSION) )
$theMessage = substr($theMessage, 0, $ver_pos);
$theMessage = str_replace( "'", ''', $theMessage ); // Despite this precaution, don't include apostrophes in .chk file because older RS versions (< 1.0.0-rc9) will choke on it.
$theMessage = str_replace( '"', '"', $theMessage );
$msg .= '' . $theMessage . '';
}
if ( strpos( $msg, '' ) ) {
$more_caption = __( 'read more...', 'scoper');
$msg = preg_replace( '/\<\!\-\-more\-\-\>/', '' . $more_caption . '
' . $msg . '
' . $msg . '