Plugin Directory

Changeset 750330

Timestamp:
08/02/2013 10:47:56 PM (11 years ago)
Author:
alexkingorg
Message:

wp 3.6 compat

Location:
404-notifier/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • 404-notifier/trunk/404-notifier.php

    r277865 r750330  
    33/*
    44Plugin Name: 404 Notifier
    5 Plugin URI: http://alexking.org/projects/wordpress
     5Plugin URI: http://alexking.org/projects
    66Description: 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.2a
     7Version: 1.
    88Author: Alex King
    99Author URI: http://alexking.org
    1010*/
    1111
    12 // Copyright (c) 2006-2008 Alex King. All rights reserved.
     12// Copyright (c) 2006-20 Alex King. All rights reserved.
    1313// http://alexking.org/projects/wordpress
    1414//
     
    8484            )
    8585        ");
    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);
    8989    }
    9090   
    9191    function update_settings() {
     92
     93
     94
    9295        foreach ($this->options as $option => $type) {
    9396            if (isset($_POST[$option])) {
     
    111114            }
    112115        }
    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'));
    116117    }
    117118   
     
    169170
    170171    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         }
    179172        print('
    180173            <div class="wrap">
     
    183176                    <fieldset class="options">
    184177                        <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" './>
    186179                            <label for="ak404_mail_enabled">'.__('Enable mail notifications on 404 hits.', '404-notifier').'</label>
    187180                        </p>
     
    197190                        <input type="hidden" name="ak_action" value="update_404_settings" />
    198191                    </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').'" />
    201194                    </p>
     195
    202196                </form>
    203197            </div>
     
    294288
    295289function 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    );
    305297}
    306298add_action('admin_menu', 'ak404_options');
     
    336328    // CHECK FOR 404 NOTIFIER TABLES
    337329    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);
    339333        $tables = array();
    340         while ($row = mysql_fetch_row($result)) {
    341             $tables[] = $row[0];
     334        ) {
     335            $tables[] = $r[0];
    342336        }
    343337        if (!in_array($wpdb->ak_404_log, $tables)) {
  • 404-notifier/trunk/README.txt

    r37078 r750330  
    22Tags: 404, error, log, notify
    33Contributors: alexkingorg
    4 Requires at least: 1.5
    5 Tested up to: 2.5
    6 Stable tag: 1.2a
     4Requires at least:
     5Tested up to:
     6Stable tag: 1.
    77
    88Log 404 (file not found) errors on your site and get them delivered to you via e-mail or RSS.
     
    3535
    3636http://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.