Plugin Directory

Changeset 689566


Ignore:
Timestamp:
03/31/2013 07:32:20 PM (13 years ago)
Author:
Bilbud
Message:
  • added export fonctionnality.
  • improved extension filters.
Location:
404-error-monitor/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • 404-error-monitor/trunk/css/admin.css

    r662942 r689566  
    4545
    4646.postbox .inside li { list-style: square; }
     47
     48#error_monitor-export-form {
     49    margin: 10px 0;
     50}
  • 404-error-monitor/trunk/includes/Error.php

    r662942 r689566  
    147147        foreach($ext_filterArray as $filter){
    148148            if($filter != "")
    149                 $subQuery2 .= " AND url NOT LIKE '%".$filter."'";
     149                $subQuery2 .= " AND url NOT LIKE '%".$filter."%'";
    150150        }
    151151       
  • 404-error-monitor/trunk/includes/errorList.php

    r662942 r689566  
    6767                    function_exists('is_super_admin') &&
    6868                    is_multisite()&&
    69                     is_super_admin()):?>
     69                    is_super_admin()):
     70                    ?>
    7071           
    7172                    <div style="width:79%;" class="postbox-container">
     
    102103    <br class="clear" />
    103104    <h3>Error list</h3>
     105    <form id="error_monitor-export-form" action="<?php bloginfo('wpurl'); ?>/wp-admin/admin-ajax.php" method="post">
     106        <input type="button" value="Export to csv" class="button-primary" id="export_btn" item-id="<?php echo $blog_id;?>" name="export_btn">
     107    </form>
    104108    <table class="widefat error_monitor-error-list" cellspacing="0">
    105109        <thead>
     
    156160        </tbody>
    157161    </table>
     162    <form id="error_monitor-export-form" action="<?php bloginfo('wpurl'); ?>/wp-admin/admin-ajax.php" method="post">
     163        <input type="button" value="Export to csv" class="button-primary" id="export_btn" item-id="<?php echo $blog_id;?>" name="export_btn">
     164    </form>
    158165</div><?php
  • 404-error-monitor/trunk/index.php

    r662942 r689566  
    2020 *     Plugin URI: http://www.php-geek.fr/plugin-wordpress-404-error-monitor.html
    2121 *     Description: This plugin logs 404 (Page Not Found) errors on your WordPress site. It also logs useful informations like referrer, user address, and error hit count. It is fully compatible with a multisite configuration.
    22  *     Version: 1.0.5
     22 *     Version: 1.0.6
    2323 *     Author: Bruce Delorme
    2424 *     Author URI: http://www.php-geek.fr
     
    9191        add_action('wp_ajax_deleteBlogErrors', array(&$this,'deleteBlogErrors') );
    9292        add_action('wp_ajax_updatePluginSettings', array(&$this,'updatePluginSettings') );
     93        add_action('wp_ajax_exportErrorList', array(&$this,'exportErrorList') );
    9394        $this->enqueueScript('admin.js');
    9495        $this->enqueueStyle('admin.css');
     
    238239            }
    239240        }
     241       
     242        if($ext_filter != ''){
     243            $ext_filter_tmp= array();
     244            foreach(explode(',',$ext_filter) as $ext){
     245               
     246                if(substr($ext,0,1) !='.'){
     247                    $ext = '.'.$ext;
     248                }
     249                $ext_filter_tmp[] = $ext;
     250            }
     251            $ext_filter = implode(',',$ext_filter_tmp);
     252        }
     253       
    240254        errorMonitor_DataTools::updatePluginOption('min_hit_count',($min_hit_count != '')?$min_hit_count:null);
    241255        errorMonitor_DataTools::updatePluginOption('ext_filter',($ext_filter != '')?$ext_filter:null);
     
    248262       
    249263        echo true;
     264    }
     265   
     266    function exportErrorList()
     267    {
     268        header('Content-type: text/csv');
     269        header('Content-disposition: attachment;filename=404-error-monitor-export.csv');
     270       
     271        $error = new errorMonitor_Error();
     272       
     273        $itemId = $_GET['item-id'];
     274       
     275        if($itemId != 'null'){
     276            $blogId = $itemId;
     277        } else {
     278            $blogId = null;
     279        }
     280        $errorsRowset = $error->getErrorList($blogId);
     281       
     282        $eol = "\n";
     283        echo "URL;Count;Referer;Last Error".$eol;
     284        foreach($errorsRowset as $row){
     285            $domain = $error->getDomain($row);
     286            if($row->referer != ""){
     287                $referer = $row->referer;
     288            } else {
     289                $referer = "--";
     290            }
     291            echo $domain.$row->url.";".$row->count.";".$referer.";".$row->last_error.";".$eol;
     292        }
     293        die;
    250294    }
    251295
  • 404-error-monitor/trunk/js/admin.js

    r662942 r689566  
    118118      return false;
    119119  });
     120 
     121  $("#error_monitor-export-form #export_btn").click(function(){
     122     
     123    var itemId = null;
     124    if($(this).attr('item-id') != ''){
     125        itemId = $(this).attr('item-id');
     126    }
     127    location.href = $(this).closest("form").attr('action')+"?action=exportErrorList"+"&item-id="+itemId;
     128 });
    120129});
    121130
  • 404-error-monitor/trunk/readme.txt

    r662942 r689566  
    55Requires at least: 3.2.1
    66Tested up to: 3.5.1
    7 Stable tag: 1.0.5
     7Stable tag: 1.0.6
    88License: GPLv3
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    4343* added new fonctionnality that clean entries that are older than the configured limit.
    4444* improved activate and deactivate methods.
     45
     46= 1.0.6 =
     47* added export fonctionnality.
     48* improved extension filters.
Note: See TracChangeset for help on using the changeset viewer.