Found 404.php template file at '. str_replace(WP_CONTENT_DIR,'',$four_file);
echo ' - add the following in that file where you want this plugins output to go. Learn more... ';
echo '<?php if(function_exists("aa_google_404"))aa_google_404(); ?>';
}
else {
echo '
No 404.php file found, so this plugin will be the 404.php, which is a not good or bad.. Note that for more customization use a 404.php template file. and add ';
echo '<?php if(function_exists("aa_google_404"))aa_google_404(); ?>
Found .htaccess config file at '. $htaccess_file.' '.
'To help WordPress handle 404s and your ErrorDocuments add the below to the htaccess file. Learn more... '.
'ErrorDocument 404 '.$r.'index.php?error=404 Redirect 404 '.$r.'index.php?error=404
';
}
?>
This is the last time my site will show up in this preview. Just so you can see if Im changing anything.';
}
else $hry='../wordpress-google-plugin-'.get_bloginfo('name').'/USA/rocks?askapache=plugin&missing-9027435972345+this-post';
?>
VIEW LARGE PREVIEW test url: /wordpress-google-plugin-/USA/rocks?askapache=plugin&missing-9027435972345+this-post
$aa_word ) $comp_words[] = $aa_word;
if ( sizeof((array )$comp_words) > 0 ) if ( sizeof($comp_words) > $num ) array_splice( $comp_words, $num + 1 );
return ( (sizeof($comp_words) > 0) ? trim(implode($sep, $comp_words)) : $_SERVER['HTTP_HOST'] );
}
/**
* AskApacheGoogle404::get_plugin_data()
*
* @param mixed $find
* @return
*/
function get_plugin_data( $find = array('Description', 'Author', 'Version', 'DB Version', 'Requires at least', 'Tested up to', 'WordPress', 'Plugin', 'Plugin Name', 'Short Name', 'Domain Path', 'Text Domain', '(?:[a-z]{2,25})? URI') )
{
//error_log(__FUNCTION__.':'.__LINE__);
$fp = fopen( __FILE__, 'r' );
if ( !is_resource($fp) ) return false;
$data = fread( $fp, 1000 );
fclose( $fp );
$mtx = $plugin = array();
preg_match_all( '/(' . join('|', $find) . ')\:[\s\t]*(.+)/i', $data, $mtx, PREG_SET_ORDER );
foreach ( $mtx as $m ) $plugin[trim( $m[1] )] = str_replace( array("\r", "\n", "\t"), '', trim($m[2]) );
$plugin['pb'] = preg_replace( '|^' . preg_quote(WP_PLUGIN_DIR, '|') . '/|', '', __FILE__ );
$plugin['Title'] = '' . $plugin['Plugin Name'] . '';
$plugin['Author'] = '' . $plugin['Author'] . '';
$plugin['page'] = basename( __FILE__ );
$plugin['hook'] = 'settings_page_' . rtrim( $plugin['page'], '.php' );
$plugin['action'] = 'options-general.php?page=' . $plugin['page'];
return $plugin;
}
}
endif;
if ( !in_array('AAGoogle404Handler', (array)get_declared_classes() ) && !class_exists( 'AAGoogle404Handler' ) ) :
/**
* AAGoogle404Handler
*
* @package
* @author webmaster@askapache.com
* @copyright AskApache
* @version 2009
* @access public
*/
class AAGoogle404Handler
{
var $options = false;
var $code = false;
var $status_code = 404;
var $errors = false;
var $messages = false;
var $message = false;
var $reason = false;
var $ASC = array(
100 => 'Continue',
101 => 'Switching Protocols',
102 => 'Processing',
200 => 'OK',
201 => 'Created',
202 => 'Accepted',
203 => 'Non-Authoritative Information',
204 => 'No Content',
205 => 'Reset Content',
206 => 'Partial Content',
207 => 'Multi-Status',
226 => 'IM Used',
300 => 'Multiple Choices',
301 => 'Moved Permanently',
302 => 'Found',
303 => 'See Other',
304 => 'Not Modified',
305 => 'Use Proxy',
306 => 'Reserved',
307 => 'Temporary Redirect',
400 => array('Bad Request', "Your browser sent a request that this server could not understand."),
401 => array('Unauthorized', "This server could not verify that you are authorized to access the document requested."),
402 => array('Payment Required', "%I_ERR%"),
403 => array('Forbidden', "You don't have permission to access %R_URI% on this server."),
404 => array('Not Found', "We couldn't find that uri on our server, though it's most certainly not your fault."),
405 => array('Method Not Allowed', "The requested method %R_METH% is not allowed for the URL %R_URI%."),
406 => array('Not Acceptable', "An appropriate representation of the requested resource %R_URI% could not be found on this server."),
407 => array('Proxy Authentication Required', "An appropriate representation of the requested resource %R_URI% could not be found on this server."),
408 => array('Request Timeout', "Server timeout waiting for the HTTP request from the client."),
409 => array('Conflict', "%I_ERR%"),
410 => array('Gone', "The requested resource%R_URI%is no longer available on this server and there is no forwarding address. Please remove all references to this resource."),
411 => array('Length Required', "A request of the requested method GET requires a valid Content-length."),
412 => array('Precondition Failed', "The precondition on the request for the URL %R_URI% evaluated to false."),
413 => array('Request Entity Too Large', "The requested resource %R_URI% does not allow request data with GET requests, or the amount of data provided in the request exceeds the capacity limit."),
414 => array('Request-URI Too Long', "The requested URL's length exceeds the capacity limit for this server."),
415 => array('Unsupported Media Type', "The supplied request data is not in a format acceptable for processing by this resource."),
416 => array('Requested Range Not Satisfiable', ""),
417 => array('Expectation Failed', "The expectation given in the Expect request-header field could not be met by this server. The client sent Expect:"),
422 => array('Unprocessable Entity', "The server understands the media type of the request entity, but was unable to process the contained instructions."),
423 => array('Locked', "The requested resource is currently locked. The lock must be released or proper identification given before the method can be applied."),
424 => array('Failed Dependency', "The method could not be performed on the resource because the requested action depended on another action and that other action failed."),
425 => array('No Code', "%I_ERR%"),
426 => array('Upgrade Required', "The requested resource can only be retrieved using SSL. Either upgrade your client, or try requesting the page using https://"),
500 => array('Internal Server Error', "%I_ERR%"),
501 => array('Not Implemented', " %R_METH% to %R_URI% not supported."),
502 => array('Bad Gateway', "The proxy server received an invalid response from an upstream server."),
503 => array('Service Unavailable', "The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later."),
504 => array('Gateway Timeout', "The proxy server did not receive a timely response from the upstream server."),
505 => array('HTTP Version Not Supported', "%I_ERR%"),
506 => array('Variant Also Negotiates', "A variant for the requested resource %R_URI% is itself a negotiable resource. This indicates a configuration error."),
507 => array('Insufficient Storage', "The method could not be performed. There is insufficient free space left in your storage allocation."),
510 => array('Not Extended', "A mandatory extension policy in the request is not accepted by the server for this resource.")
);
/**
* AAGoogle404Handler::AAGoogle404Handler()
*/
function AAGoogle404Handler()
{
//error_log(__FUNCTION__.':'.__LINE__);
global $wpdb;
add_action( 'wp_head', array(&$this, 'wp_header') );
add_filter( 'wp_title', array(&$this, 'title_fix') );
$this->options = get_option( 'askapache_google_404_options' );
$this->code = get_option( 'askapache_google_404_code' );
$this->status_code = ( isset($_SERVER['REDIRECT_STATUS']) && $_SERVER['REDIRECT_STATUS'] != 200 ) ? $_SERVER['REDIRECT_STATUS'] : ( !isset($_REQUEST['error']) ) ? 404 : ( int )$_REQUEST['error'];
$sr = array( '%I_ERR%' => 'The server encountered an internal error or misconfiguration and was unable to complete your request.', '%R_URI%' => attribute_escape(stripslashes($_SERVER['REQUEST_URI'])), '%R_METH%' => $_SERVER['REQUEST_METHOD'] );
$this->message = ( isset($this->ASC[$this->status_code][1]) ) ? str_replace( array_keys($sr), array_values($sr), $this->ASC[$this->status_code][1] ) : '';
$this->reason = $this->ASC[$this->status_code][0];
}
/**
* AAGoogle404Handler::handle_404()
*/
function handle_404()
{
//error_log(__FUNCTION__.':'.__LINE__);
global $wpdb, $posts, $post, $wp_did_header, $wp_did_template_redirect, $wp_query, $wp_rewrite, $wpdb, $wp_version, $wp, $id, $comment, $user_ID;
if ( is_array($wp_query->query_vars) ) extract( $wp_query->query_vars, EXTR_SKIP );
ob_start();
@header( "HTTP/1.1 {$this->status_code} {$this->reason}", 1 );
@header( "Status: {$this->status_code} {$this->reason}", 1 );
if ( $this->status_code == 400 || $this->status_code == 403 || $this->status_code == 405 || (string )$this->status_code[0] == '5' ) return $this->handle_non_404();
if ( file_exists(TEMPLATEPATH . '/404.php') && is_file(TEMPLATEPATH . '/404.php') ) load_template( TEMPLATEPATH . '/404.php' );
else {
get_header();
$this->handle_it();
get_sidebar();
get_footer();
}
ob_flush(); flush();
}
/**
* AAGoogle404Handler::handle_it()
*/
function handle_it()
{
//error_log(__FUNCTION__.':'.__LINE__);
global $wpdb, $posts, $post, $wp_did_header, $wp_did_template_redirect, $wp_query, $wp_rewrite, $wpdb, $wp_version, $wp, $id, $comment, $user_ID;
if ( is_array($wp_query->query_vars) ) extract( $wp_query->query_vars, EXTR_SKIP );
$recent = $related = $google_help = $title = '';
$title = $this->status_code . ' ' . $this->reason;
if ( $this->options['google_404'] == '1' ) $google_helper = '' . "\n";
if ( $this->options['rec'] == '1' )
{
//error_log(__FUNCTION__.':'.__LINE__);
ob_start();
echo '