prepare("INSERT INTO $table_name (pagenotfoundurl,pagenotfoundreferrers,pagenotfoundip, pagenotfounduseragent, pagenotfounddate) VALUES (%s, %s, %s, %s, %s)", $wpdb->escape($pagenotfoundurl),$wpdb->escape($pagenotfoundreferrers), $wpdb->escape($pagenotfoundip),$wpdb->escape($pagenotfounduseragent),$wpdb->escape($pagenotfounddate) ); $wpdb->query($m_mysql); } function tomas_check_bots() { $bots = array(); $bots[] = 'bot'; $bots[] = 'spider'; $bots[] = 'crawler'; $user_bots_or_not_agent = $_SERVER['HTTP_USER_AGENT']; $user_bots_or_not_result = false; foreach ( $bots as $bot_single ) { $bot_single = trim($bot_single); if ( !(empty($bot_single))) { $bot_single = strtolower($bot_single); $user_bots_or_not_agent = strtolower($user_bots_or_not_agent); if (strpos( $user_bots_or_not_agent, $bot_single ) === false) { $user_bots_or_not_result = false; } else { $user_bots_or_not_result = true; } } else { $user_bots_or_not_result = false; } } return $user_bots_or_not_result; } add_action( 'template_redirect', 'tomas_process_404s_log' ); function tomas_manage_404s() { global $wpdb,$table_prefix; $table_name = $table_prefix . "404s"; $m_checkHadThere = "SELECT * FROM $table_name"; $m_checkResult = $wpdb->get_results($m_checkHadThere,ARRAY_A); ?>
404 Page Not Found Log:



query($clearLogsQuery); messageBarFor404s('404 logs has been removed'); } } $selectClear404Log = get_option('selectClear404Log'); $title = '404s Global Settings'; setting_panel_404s_head($title); $title = 'CLear 404 Logs'; $content = ''; $content .= '
'; $content .= ''; $content .= ''; $content .= ''; $content .= ''; $content .= ''; $content .= ''; $content .= '
'; $content .= 'Clear 404 logs now ? '; $content .= ''; $content .= ''; $content .= ''; $content .= ''; $content .= '
'; $content .= '
'; tomas_setting_panel_404s($title, $content); } function messageBarFor404s($p_message) { echo "
"; echo $p_message; echo "
"; } ?>