array( "verify_peer"=>false, "verify_peer_name"=>false, ), ); if(file_exists(AOMIN_PLUGIN_ABS_CACHE_PATH.$post_slug.".html")) { unlink(AOMIN_PLUGIN_ABS_CACHE_PATH.$post_slug.".html"); } $content = file_get_contents($permalink, false, stream_context_create($arrContextOptions)); $withoutSanitize = file_put_contents(AOMIN_PLUGIN_ABS_CACHE_PATH.$post_slug.".html",$content); unlink(AOMIN_PLUGIN_ABS_CACHE_PATH.$post_slug.".html"); $withSanitize = file_put_contents(AOMIN_PLUGIN_ABS_CACHE_PATH.$post_slug.".html",sanitize_output($content)); global $wpdb; $datetime = date('Y-m-d H:i:s'); $minifyStatus = 1; $table_name = $wpdb->prefix . 'alone_minifier_analysis'; $querystr = "SELECT postID FROM $table_name WHERE postID = $post_id LIMIT 1 "; $pageposts = $wpdb->get_results($querystr, OBJECT); if(count($pageposts) > 0) { $wpdb->query($wpdb->prepare("UPDATE $table_name SET docBeforeTime = '$withoutSanitize', docAfterTime = '$withSanitize', datetime = '$datetime' WHERE postID = $post_id AND minifyStatus = $minifyStatus ")); } else { $wpdb->insert($table_name, array('postID' => $post_id, 'minifyStatus' => $minifyStatus, 'docBeforeTime' => $withoutSanitize, 'docAfterTime' => $withSanitize, 'datetime' => $datetime)); } } else { if ( $_SERVER['REQUEST_METHOD']=='GET' && realpath(__FILE__) == realpath( $_SERVER['SCRIPT_FILENAME'] ) ) { header( 'HTTP/1.0 403 Forbidden', TRUE, 403 ); die( header( 'location: /404' ) ); } }