Changeset 750330
- Timestamp:
- 08/02/2013 10:47:56 PM (11 years ago)
- Location:
- 404-notifier/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
404-notifier/trunk/404-notifier.php
r277865 r750330 3 3 /* 4 4 Plugin Name: 404 Notifier 5 Plugin URI: http://alexking.org/projects /wordpress5 Plugin URI: http://alexking.org/projects 6 6 Description: This plugin will log 404 hits on your site and can notify you via e-mail or you can subscribe to the generated RSS feed of 404 events. Adjust your settings <a href="options-general.php?page=404-notifier.php">here</a>. 7 Version: 1. 2a7 Version: 1. 8 8 Author: Alex King 9 9 Author URI: http://alexking.org 10 10 */ 11 11 12 // Copyright (c) 2006-20 08Alex King. All rights reserved.12 // Copyright (c) 2006-20 Alex King. All rights reserved. 13 13 // http://alexking.org/projects/wordpress 14 14 // … … 84 84 ) 85 85 "); 86 add_option('ak404_mailto', $this->mailto , 'Address to send mail to.');87 add_option('ak404_mail_enabled', $this->mail_enabled , 'Send mail notifications?');88 add_option('ak404_rss_limit', $this->rss_limit , '# of items to show at once in RSS Feed');86 add_option('ak404_mailto', $this->mailto); 87 add_option('ak404_mail_enabled', $this->mail_enabled); 88 add_option('ak404_rss_limit', $this->rss_limit); 89 89 } 90 90 91 91 function update_settings() { 92 93 94 92 95 foreach ($this->options as $option => $type) { 93 96 if (isset($_POST[$option])) { … … 111 114 } 112 115 } 113 114 header('Location: '.get_bloginfo('wpurl').'/wp-admin/options-general.php?page=404-notifier.php&updated=true'); 115 die(); 116 wp_redirect(admin_url('options-general.php?page=404-notifier.php&updated=true')); 116 117 } 117 118 … … 169 170 170 171 function options_form() { 171 switch ($this->mail_enabled) {172 case '1':173 $enabled = ' checked="checked"';174 break;175 case '0':176 $enabled = '';177 break;178 }179 172 print(' 180 173 <div class="wrap"> … … 183 176 <fieldset class="options"> 184 177 <p> 185 <input type="checkbox" name="mail_enabled" id="ak404_mail_enabled" value="1" '. $enabled.'/>178 <input type="checkbox" name="mail_enabled" id="ak404_mail_enabled" value="1" './> 186 179 <label for="ak404_mail_enabled">'.__('Enable mail notifications on 404 hits.', '404-notifier').'</label> 187 180 </p> … … 197 190 <input type="hidden" name="ak_action" value="update_404_settings" /> 198 191 </fieldset> 199 <p class="submit">200 <input type="submit" name="submit" value="'.__('Update 404 Notifier Settings', '404-notifier').'" />192 <p> 193 <input type="submit" name="submit" value="'.__('Update 404 Notifier Settings', '404-notifier').'" /> 201 194 </p> 195 202 196 </form> 203 197 </div> … … 294 288 295 289 function ak404_options() { 296 if (function_exists('add_options_page')) { 297 add_options_page( 298 __('404 Notifier Options', '404-notifier') 299 , __('404 Notifier', '404-notifier') 300 , 10 301 , basename(__FILE__) 302 , 'ak404_options_form' 303 ); 304 } 290 add_options_page( 291 __('404 Notifier Options', '404-notifier'), 292 __('404 Notifier', '404-notifier'), 293 'manage_options', 294 basename(__FILE__), 295 'ak404_options_form' 296 ); 305 297 } 306 298 add_action('admin_menu', 'ak404_options'); … … 336 328 // CHECK FOR 404 NOTIFIER TABLES 337 329 if (isset($_GET['activate']) && $_GET['activate'] == 'true') { 338 $result = mysql_list_tables(DB_NAME); 330 $results = $wpdb->get_results(" 331 SHOW TABLES FROM ".DB_NAME." 332 ", ARRAY_N); 339 333 $tables = array(); 340 while ($row = mysql_fetch_row($result)) {341 $tables[] = $r ow[0];334 ) { 335 $tables[] = $r[0]; 342 336 } 343 337 if (!in_array($wpdb->ak_404_log, $tables)) { -
404-notifier/trunk/README.txt
r37078 r750330 2 2 Tags: 404, error, log, notify 3 3 Contributors: alexkingorg 4 Requires at least: 1.55 Tested up to: 2.56 Stable tag: 1. 2a4 Requires at least: 5 Tested up to: 6 Stable tag: 1. 7 7 8 8 Log 404 (file not found) errors on your site and get them delivered to you via e-mail or RSS. … … 35 35 36 36 http://alexking.org/projects/wordpress 37 38 39 40 41 42 43 44 45 46 47
Note: See TracChangeset
for help on using the changeset viewer.