. */ if (!function_exists('add_action') || !function_exists('plugins_url')) exit; if (!function_exists('wp_die')) : function wp_die ($message = 'wp_die') { die($message); } endif; !defined('WP_CONTENT_DIR') && define('WP_CONTENT_DIR', ABSPATH . 'wp-content'); !defined('WP_PLUGIN_DIR') && define('WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins'); !defined('WP_CONTENT_URL') && define('WP_CONTENT_URL', get_option('siteurl') . '/wp-content'); !defined('WP_PLUGIN_URL') && define('WP_PLUGIN_URL', WP_CONTENT_URL . '/plugins'); !defined('AA_G404_DIR') && define('AA_G404_DIR', trailingslashit(WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . str_replace("\\","/",basename(dirname(__FILE__))))); !defined('AA_G404_URL') && define('AA_G404_URL', plugins_url('/',__FILE__)); /** * AA_G404 * * @package * @author AskApache * @version 2009 * @access public */ class AA_G404 { var $options = array(); var $plugin = array(); var $code = array('css' => '', 'javascript' => '', 'html' => ''); /** * AA_G404::AA_G404() */ function AA_G404() { } function LoadOptions($opts=array('options', 'code', 'plugin')) { foreach ($opts as $pn) $this->{$pn} = get_option("askapache_google_404_{$pn}"); } function SaveOptions($opts=array('options','code','plugin')) { foreach ($opts as $pn) update_option("askapache_google_404_{$pn}", $this->{$pn}); $this->save_keys(); } function default_options() { // get all the plugin array data $this->plugin = $this->get_plugin_data(); // original code that comes with plugin $this->code = $this->get_original_code(); // default options $this->options = array( 'api_key' => $this->get_api_key(), 'adsense_key' => $this->get_adsense_key(), '404_handler' => AA_G404_DIR . '404.php', 'google_404' => '0', 'related_posts' => '1', 'recent_posts' => '1', 'google_ajax' => '1', 'tag_cloud' => '1', 'robots_meta' => '1', 'robots_tag' => 'noindex,follow', 'iframe_preview' => '0', 'iframe_url' => site_url('wordpress-google-AskApache/f2?askapache=htaccess-plugin&missing-5+this-post'), 'related_num' => 10, 'related_length' => 240, 'received_num' => 6 ); // Save all these variables to database $this->SaveOptions(); } function save_keys() { update_option('aa_google_404_api_key', $this->options['api_key']); update_option('aa_google_404_adsense_key', $this->options['adsense_key']); } function get_api_key() { //ABQIAAAAGpnYzhlFfhxcnc02U1NT1hSrXMCP0pDj9HHVk8NG53Pp2_-7KxSdZ5paIt0ciL3cNLv20-kmmxlTcA $api_key = get_option('aa_google_404_api_key'); return ($api_key !== false && strlen($api_key) > 5) ? $api_key : ''; } function get_adsense_key() { //pub-4356884677303281 $adsense_key = get_option('aa_google_404_adsense_key'); return ($adsense_key !== false && strlen($adsense_key) > 5) ? $adsense_key : ''; } function get_original_code() { foreach(array_keys($original_code = array('css' => '', 'html' => '', 'javascript' => '')) as $pn) $original_code["{$pn}"] = $this->_readfile(AA_G404_DIR . "f/orig.{$pn}"); return $original_code; } function init() { $this->LoadOptions(); add_action("load-{$this->plugin['hook']}", array(&$this, 'load')); add_action("admin_print_styles-{$this->plugin['hook']}", array(&$this, 'admin_print_styles')); } function load() { // parse and handle posts to plugin 'POST' == $_SERVER['REQUEST_METHOD'] && $this->handle_post(); // add meta boxes foreach(array('404 Options', 'Plugin Options', 'Google Options', 'Robot Options', 'Recent Posts Options', 'Related Posts Options', 'Popular Tag Cloud', 'CSS Code', 'HTML Code', 'Javascript Code') as $box){ add_meta_box(preg_replace('/\W/i', '', strtolower(str_replace(' ', '_', "ag4_box_{$box}"))), "{$box}", array(&$this, "print_box"), 'askapachegoogle', 'normal', 'high'); add_meta_box(preg_replace('/\W/i', '', strtolower(str_replace(' ', '_', "ag4_box_{$box}"))), "{$box}", array(&$this, "print_box"), 'askapache-google-404', 'normal', 'high'); add_meta_box(preg_replace('/\W/i', '', strtolower(str_replace(' ', '_', "ag4_box_{$box}"))), "{$box}", array(&$this, "print_box"), 'settings_page_askapache-google-404', 'normal', 'high'); } // add contextual help $this->add_contextual_help(); // enqueue css wp_enqueue_style($this->plugin['pagenice'], plugins_url('/f/admin.css',__FILE__), array('dashboard', 'wp-admin', 'thickbox'), $this->plugin['version'], 'all'); // enqueue js wp_enqueue_script($this->plugin['pagenice'], plugins_url('/f/admin.js',__FILE__), array('jquery', 'postbox', 'thickbox','codepress'), $this->plugin['version']); } function template_redirect() { global $wp_query, $AA_G404_Handler, $wpdb; // return execution back to wordpress if not 404 if (!is_404()) return true; if(!is_object($AA_G404_Handler))$AA_G404_Handler = new AA_G404_Handler(); add_action('wp_head', array(&$AA_G404_Handler, 'wp_header')); add_filter('nocache_headers', create_function('$a', 'return (is_404()? array("Cache-Control"=>"private, max-age=0", "Expires"=>"-1") : $a);'), 99999); add_filter('wp_headers', create_function('$a', 'return (is_404()? array("Cache-Control"=>"private, max-age=0", "Expires"=>"-1") : $a);'), 99999); add_filter('wp_title', create_function('$a', 'global $AA_G404_Handler; if(!is_object($AA_G404_Handler))$AA_G404_Handler =& new AA_G404_Handler(); return ( !is_404() ) ? $a : $AA_G404_Handler->sc . " " . $AA_G404_Handler->reason;')); $AA_G404_Handler->handle_it(); if(file_exists($this->options['404_handler'])) load_template($this->options['404_handler']); return; } function handle_post() { current_user_can('administrator') || wp_die('ERROR: Not an Admin!'); if(isset($_POST["_{$this->plugin['nonce']}"])) wp_verify_nonce($_POST["_{$this->plugin['nonce']}"], $this->plugin['nonce']) || wp_die('ERROR: Incorrect Form Submission, please try again.'); elseif(isset($_POST["ag4_action_reset"])) wp_verify_nonce($_POST["ag4_action_reset"], 'ag4_action_reset_nonce') || wp_die('ERROR: Incorrect Form Submission, please try again.'); if(isset($_POST["ag4_action_reset"])) return $this->default_options(); wp_verify_nonce($_POST["_{$this->plugin['nonce']}"], $this->plugin['nonce']) || wp_die('ERROR: Incorrect Form Submission, please try again.'); // load up the current options from the database $this->LoadOptions(); // process absolute integer options foreach (array('related_num', 'related_length', 'received_num') as $k) $this->options[$k] = ((isset($_POST["ag4_{$k}"])) ? absint($_POST["ag4_{$k}"]) : absint($this->options[$k])); // process options of type string foreach (array('api_key', 'adsense_key', 'robots_tag', '404_handler', 'step', 'iframe_url') as $k)$this->options[$k] = ((isset($_POST["ag4_{$k}"])) ? $_POST["ag4_{$k}"] : $this->options[$k]); // process on ('1') or off ('0') options foreach (array('iframe_preview', 'robots_meta', 'google_404', 'related_posts', 'recent_posts', 'google_ajax', 'tag_cloud') as $k)$this->options[$k] = ((!isset($_POST["ag4_{$k}"])) ? '0' : '1'); // process incoming unfiltered code foreach (array('css', 'html', 'javascript') as $k) if (isset($_POST["ag4_{$k}"])) $this->code[$k] = stripslashes($_POST["ag4_{$k}"]); // Save code and options arrays to database $this->SaveOptions(); } function options_page() { current_user_can('administrator') || wp_die('ERROR: Not an Admin!'); $this->print_page_header(); $this->print_form_header(); $this->show_meta_boxes(); $this->print_form_footer(); $this->show_footer_links(); } function print_page_header() { echo '
For this plugin to work, you must use a 404.php file, one is included with this plugin.
For intermediate - advanced level WP users you can use your own 404.php file. To use your own 404.php file just create a 404.php file in your template directory and make sure that <php if(function_exists("aa_google_404"))aa_google_404(); ?> is somewhere between your get_header and get_footer functions. Also, you should add an ob_start(); call as the first php code in the 404.php file, before get_header();, and the last php code should be exit; right before the closing php. See the included 404.php file for a simple working example.
| 404 File Handling | '; echo ' |
|---|
This prevents your error pages from being indexed by Google and other search engines, which saves your PageRank for your non-error pages. Highly recommended, Google recommended.
'; AA_G404::form_field( 1, 'Add robots meta to prevent indexing', 'robots_meta', 'Prevent 404 pages from being indexed.' ); AA_G404::form_field( 2, 'Robots meta tag value (?)', 'robots_tag', 'Value of robots meta tag.' ); break; case 'ag4_box_google_options': echo 'You need a Google API Key for your site to display the ajax results. Go ahead and add your AdSense ID as future versions of this plugin will allow you to incorporate AdSense compliant with Google Guidelines.
Note: Both the API key and the AdSense ID are now stored separate from the main plugin options, so once saved they will remain even if you delete or deactivate the plugin.
Shows a list of single posts on your blog that are related to the keywords auto-parsed from the bad url.
'; AA_G404::form_field( 1, 'Show Related Posts', 'related_posts', 'Displays List of Posts similar to the query' ); AA_G404::form_field( 3, 'Related Posts # to Show', 'related_num', 'How many related posts to show..' ); AA_G404::form_field( 3, 'Related Posts Excerpt Length', 'related_length', 'How many related posts to show..' ); break; case 'ag4_box_recent_posts_options': echo 'Shows a list of Recent Posts on your blog.
'; AA_G404::form_field( 1, 'Show Recent Posts', 'recent_posts', 'Displays List of Recent Posts' ); AA_G404::form_field( 3, 'Recent Posts # to Show', 'received_num', 'How many recent posts to show..' ); break; case 'ag4_box_popular_tag_cloud': echo 'Shows a cloud of your popular tags where each tag is displayed with a font-size showing how popular the tag is, more popular tags are larger.
'; AA_G404::form_field( 1, 'Show Popular Tag Cloud', 'tag_cloud', 'Displays Popular Tag Cloud' ); break; case 'ag4_box_html_code': echo 'This lets you determine the placement and any extra html you want output by this plugin.';
echo '%error_title% - replaced with the status code and error phrase - 404 Not Found
';
echo '%related_posts% - replaced with your related posts html if enabled%tag_cloud% - replaced with your tag cloud if enabled
';
echo '%recent_posts% - replaced with the recent posts html if enabled%google_helper% - replaced with the Google Fixurl Help box.
Modify the css that is output (inline) on your 404 error pages. Changes the appearance of, well, everything.
'; AA_G404::form_field( 5, '', 'css','The css that controls the google ajax search results.. (and anything else on the page)' ); break; case 'ag4_box_javascript_code': echo 'For advanced users only. Future versions will provide much more control over this without having to code.
'; AA_G404::form_field( 5, '', 'javascript','The javascript that runs the google ajax search.. (and anything else on the page)'); break; endswitch; echo ""; } function print_metabox_nonce() { ?>'; echo ''; } function form_field($w = 1, $title = '', $id = '', $desc = '') { echo '
options[$id],false)." />";
echo "
";
echo "
";
echo "
For super-advanced users, or those with access and knowledge of Apache .htaccess/httpd.conf files';
$help .=' you should check that your error pages are correctly returning a 404 Not Found';
$help .=' HTTP Header and not a 200 OK Header which appears to be the default for many WP installs, this plugin attempts to fix this using PHP, but the best way I have found';
$help .=' is to add the following to your .htaccess file.
ErrorDocument 404 /index.php?error=404'."\n".'Redirect 404 /index.php?error=404'; $help .= '
You can check your headers by requesting a bad url on your site using my online tool Advanced HTTP Headers.
'; $help .= 'The goal of this plugin is to boost your sites SEO by telling search engines to ignore your error pages, with the focus on human users to increase people staying on your site and being'; $help .= ' able to find what they were originally looking for on your site. Because I am obsessed with fast web pages, many various speed/efficiency improvements are also on the horizon.
'; $help .= 'Another feature that I am using with beta versions of this plugin, is tracking information for you to go over at your leisure, to fix recurring problems. The information is collected'; $help .= ' is the requested url that wasnt found, the referring url that contains the invalid link.
'; $help .= 'The reason I didnt include it in this release is because for sites like AskApache with a very high volume of traffic (and thus 404 requests) this feature can create a bottleneck and '; $help .= 'slow down or freeze a blog if thousands of 404 errors are being requested and saved to the database. This could also very quickly be used by malicious entities as a Denial of Service '; $help .= 'attack. So I am figuring out and putting into place limits.. like once a specific requested url resulting in a not found error has been requested 100x in a day, an email is sent to the '; $help .= 'blog administrator. But to prevent Email DoS and similar problems with the number and interval of emails allowed by your email provider other considerations on limits need to be examined.
'; $help .= 'Future versions of this plugin will add this option for everyone.. Basically, there will be an option to switch to using a 100% javascript (instead of javascript + php) method of '; $help .= 'handling 404 errors, this will be BIG because the plugin will simply create 1 static html file named 404.html and then use .htaccess ErrorDocument to redirect all 404 errors to this '; $help .= 'static html file. The downside is the only way to get stuff like related posts and recent posts would be to use ajax or to create the 404.html static file at regular intervals or for '; $help .= 'multiple error requests. This will help tremendously in keeping your site and server speedy as it will reduce CPU/Memory/Disk IO/and Database Queries to almost nothing. Stay tuned.
'; $help .= 'One other big improvement or feature-add is to show the admin a list of error urls and allow the admin to specify the correct url that the error url should point to. Then using mod_rewrite '; $help .= 'rules automatically generated by the plugin and added to .htaccess these error urls will 301 redirect to the correct urls, boosting your SEO further and also helping your visitors. A '; $help .= 'big difference between this method and other redirection plugins is that it will use mod_rewrite, I would really like to avoid using php to redirect or rewrite to other urls, as this method'; $help .= ' has a HUGE downside in terms of your site and servers speed, bandwidth usage, CPU/Memory usage, Disk Input/Output (writes/reads), security issues, Database Usage, among other problems.
'; $help .= 'Anyone smart enough to find and use this plugin deserves to earn a little income too, so I am working on integrating AdSense into the Search Results. Currently this is very new and not '; $help .= 'enabled or allowed by Google in certain circumstances and just isnt a feature yet of the Google AJAX API. At the very least I am going to add a custom search engine results for your site '; $help .= 'that will allow you to display relevant ads, but I am still waiting for some clarification from my Google Homeslices on whether we can use the AJAX API to display ADS on 404 error pages '; $help .= 'automatically based on the requested url or if that violates the Google TOS, which is something I would never condone or even get close to violating. If not then we will have to settle '; $help .= 'for no ADS being displayed automatically and only being displayed if the user actually types something in the search box. So go get your AdSense account (free) and also sign up for a '; $help .= 'Google CSE (custom search engine) as soon as possible.
'; $help .= 'Please visit AskApache.com or send me an email at webmaster@askapache.com
%2$s', $c, htmlspecialchars((is_array($t) ? print_r($t, 1) : $t))); } function minimize_code($t = '') { return preg_replace( array('/\0+/','/(\\\\0)+/','/\s\s+/',"/(\r\n|\n|\r)/",'/\/\*(.*?)\*\//','/(:|,|;) /','# +{#','#{ +#','#} +#','# +}#','#;}#','#,+#','# +,#'), array('','',' ',"\n",'',"\\1",'{','{','}','}','}',',',','),$t); } function stripdeep(&$value) { return (is_array($value) ? array_map(array(&$this, 'stripdeep'), $value) : stripslashes($value)); } function parse_args($a, $d = '', $r = '') { return (false !== ($r = (is_object($a)?get_object_vars($a):((!is_array($a) && false !== (parse_str($a, $r)))?(1 == get_magic_quotes_gpc()?$this->stripdeep($r):$r):$a))) && is_array($d)?array_merge($d, $r):$r); } function _readfile($f, $b = false) { $fp = NULL; $d = ''; !$b && $b = @filesize($f); if (!($b > 0) || !file_exists($f) || !false === ($fp = @fopen($f, 'r')) || !is_resource($fp)) return false; if ($b > 4096) while (!feof($fp) && strlen($d) < $b)$d .= @fread($fp, 4096); else $d = @fread($fp, $b); @fclose($fp); return $d; } function _exists($f) { return (((@file_exists($f))===false || (@realpath($f))===false) && (@stat($f))===false) ? false : true; } } /** * AA_G404_Handler * * @package * @author * @copyright Produke * @version 2009 * @access public */ class AA_G404_Handler { var $reason = ''; var $uri = ''; var $sc; var $msg = ''; var $proto = ''; var $ASC = array( 400 => "Your browser sent a request that this server could not understand.", 401 => "This server could not verify that you are authorized to access the document requested.", 402 => '', 403 => "You don't have permission to access %U% on this server.", 404 => "We couldn't find that uri on our server, though it's most certainly not your fault.", 405 => "The requested method %M% is not allowed for the URL %U%.", 406 => "An appropriate representation of the requested resource %U% could not be found on this server.", 407 => "An appropriate representation of the requested resource %U% could not be found on this server.", 408 => "Server timeout waiting for the HTTP request from the client.", 409 => '', 410 => "The requested resource %U% is no longer available on this server and there is no forwarding address. Please remove all references to this resource.", 411 => "A request of the requested method GET requires a valid Content-length.", 412 => "The precondition on the request for the URL %U% evaluated to false.", 413 => "The requested resource %U% does not allow request data with GET requests, or the amount of data provided in the request exceeds the capacity limit.", 414 => "The requested URL's length exceeds the capacity limit for this server.", 415 => "The supplied request data is not in a format acceptable for processing by this resource.", 416 => 'Requested Range Not Satisfiable', 417 => "The expectation given in the Expect request-header field could not be met by this server. The client sent
Expect:",
422 => "The server understands the media type of the request entity, but was unable to process the contained instructions.",
423 => "The requested resource is currently locked. The lock must be released or proper identification given before the method can be applied.",
424 => "The method could not be performed on the resource because the requested action depended on another action and that other action failed.",
425 => '',
426 => "The requested resource can only be retrieved using SSL. Either upgrade your client, or try requesting the page using https://",
500 => '',
501 => "%M% to %U% not supported.",
502 => "The proxy server received an invalid response from an upstream server.",
503 => "The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.",
504 => "The proxy server did not receive a timely response from the upstream server.",
505 => '',
506 => "A variant for the requested resource %U% is itself a negotiable resource. This indicates a configuration error.",
507 => "The method could not be performed. There is insufficient free space left in your storage allocation.",
510 => "A mandatory extension policy in the request is not accepted by the server for this resource."
);
/**
* AA_G404_Handler::AA_G404_Handler()
*/
function AA_G404_Handler(){}
/**
* AA_G404_Handler::handle_it()
*/
function handle_it()
{
global $AA_G404;
global $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);
$this->proto = $_SERVER["SERVER_PROTOCOL"];
$this->uri = $this->sc = $this->msg = $this->reason = '';
$this->uri = attribute_escape(stripslashes($_SERVER['REQUEST_URI']));
$this->sc = absint((isset($_SERVER['REDIRECT_STATUS']) && $_SERVER['REDIRECT_STATUS'] != 200) ? $_SERVER['REDIRECT_STATUS'] : (!isset($_REQUEST['error'])) ? 404 : $_REQUEST['error']);
if ('HTTP/1.1' != $this->proto && 'HTTP/1.0' != $this->proto && $this->proto = 'HTTP/1.0') $this->sc = 505;
$this->reason = get_status_header_desc($this->sc);
if ($this->sc == 402 || $this->sc == 409 || $this->sc == 425 || $this->sc == 500 || $this->sc == 505) $this->msg = 'The server encountered an internal error or misconfiguration and was unable to complete your request.';
else $this->msg = (array_key_exists($this->sc, $this->ASC) !== false) ? str_replace(array('%U%', '%M%'), array($this->uri, $_SERVER['REQUEST_METHOD']), $this->ASC["{$this->sc}"]) : 'Error';
if ($this->sc == 400 || $this->sc == 403 || $this->sc == 405 || floor($this->sc / 100) == 5) {
if ($this->sc == 405) @header('Allow: GET,HEAD,POST,OPTIONS,TRACE', 1, 405);
echo "\n\n{$this->msg}
\n
' . wp_tag_cloud(array('echo' => false)) . '
' : ''); $sr = array( '%error_title%' => $this->sc . ' ' . $this->reason, '%related_posts%' => $related, '%recent_posts%' => $recent, '%google_helper%' => $google_helper, '%tag_cloud%' => $tag_cloud, ); if ($AA_G404->options['google_ajax'] == '1') echo str_replace(array_keys($sr), array_values($sr), $AA_G404->code['html']); } /** * AA_G404_Handler::wp_header() */ function wp_header() { if (!is_404()) return; global $AA_G404; $css = $AA_G404->minimize_code($AA_G404->code['css']); $javascript = $AA_G404->code['javascript']; printf('%9$s%1$s' . '%1$s%9$s', "\n", get_option('blogname'), str_replace('www.', '', $_SERVER['HTTP_HOST']), $this->get_keywords('|', 6), ' ',//'OR allinurl:' . $this->get_keywords(' ', 2), get_bloginfo('language'), get_bloginfo('wpurl'), 'http://www.google.com/jsapi?key=' . $AA_G404->options['api_key'], "", str_replace('}', "};", $javascript), $css); if($AA_G404->options['robots_meta'] == '1') echo "\n" . '' . "\n"; } /** * AA_G404_Handler::get_keywords() */ function get_keywords($sep, $num = 6) { $comp_words = $found_words = array(); $n = preg_match_all("/[\w]{3,15}/", strtolower(html_entity_decode(strip_tags($_SERVER['REQUEST_URI'], ' ' . $_SERVER['QUERY_STRING']))), $found_words); if ($n < 1) return $_SERVER['HTTP_HOST']; foreach (array_unique((array )$found_words[0]) as $key => $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']); } } /** * AA_G404_Handler::related_posts() */ function related_posts($limit = 15, $l = 120) { global $wpdb; $terms = $rr = $out = ''; $terms = $this->get_keywords(' '); if (strlen($terms) < 3) return; $sql = "SELECT ID, post_title, post_name, post_content, MATCH (post_name, post_content) AGAINST ('{$terms}') AS `score` FROM {$wpdb->posts} WHERE MATCH (post_name, post_content) AGAINST ('{$terms}') " . "AND post_type = 'post' AND post_status = 'publish' AND post_password = '' AND post_date < '" . current_time('mysql') . "' ORDER BY score DESC LIMIT {$limit}"; $results = $wpdb->get_results($wpdb->prepare($sql)); if ($results) { foreach ($results as $r) { $out .= sprintf('%4$s%4$s%4$s', get_permalink($r->ID), attribute_escape(stripslashes(apply_filters('the_title', $r->post_title))), substr(wp_trim_excerpt(stripslashes(strip_tags($r->post_content))), 0, $l), "\n"); } } return $out; } } if (!function_exists('aa_google_404')) { function aa_google_404() { global $AA_G404_Handler, $AA_G404; if (!is_object($AA_G404))$AA_G404 =& new AA_G404(); if (!is_object($AA_G404_Handler))$AA_G404_Handler =& new AA_G404_Handler(); $AA_G404_Handler->output(); } } $AA_G404 = new AA_G404(); add_action('init', array(&$AA_G404, 'init')); add_action('template_redirect', array(&$AA_G404, 'template_redirect')); if (is_admin()) : add_filter('screen_meta_screen', create_function('$a', 'if($a == "settings_page_askapache-google-404")return "askapachegoogle";else return $a;')); add_filter('screen_layout_columns', create_function('$a', 'if(!array_key_exists("askapachegoogle",$a))return array_merge($a,array("askapachegoogle"=>2));else return $a;')); add_action('admin_menu', create_function('', 'global $AA_G404; if(!is_object($AA_G404))$AA_G404=&new AA_G404(); add_options_page( "AskApache Google 404", "AA Google 404", "administrator", "askapache-google-404.php", array(&$AA_G404,"options_page"));')); add_filter('plugin_action_links_askapache-google-404/askapache-google-404.php', create_function('$l', 'return array_merge(array("Settings"), $l);')); add_action('deactivate_askapache-google-404/askapache-google-404.php', create_function('', 'foreach ( array("code", "plugin", "orig_code", "iframe_one_time") as $pn ) delete_option("askapache_google_404_{$pn}" );')); add_action('activate_askapache-google-404/askapache-google-404.php', create_function('', 'global $wpdb, $AA_G404;if(!is_object($AA_G404))$AA_G404=&new AA_G404();$r=$wpdb->query($wpdb->prepare("ALTER TABLE $wpdb->posts DROP INDEX `post_related`, ADD FULLTEXT `post_related` (`post_name`,`post_content`)"));$AA_G404->default_options();')); add_action('admin_footer-settings_page_askapache-google-404', create_function('', '$g="";$g.="\n";echo $g;')); endif; ?>%3$s...
%4$s