WordPress.org

Plugin Directory

Changeset 1012837


Ignore:
Timestamp:
10/23/14 14:21:04 (3 years ago)
Author:
danbahrami
Message:

v1.1 added with new features: a new toolbar icon that displays new errors on current page and the plugin now knows what errors are newly logged since the last time the error log was looked at.

Location:
custom-error-log/trunk
Files:
2 added
12 edited

Legend:

Unmodified
Added
Removed
  • custom-error-log/trunk/admin/admin.php

    r1012063 r1012837  
    66 
    77This file sets up a page in the admin area under 'Tools' -> 'Error Log'. 
    8 */ 
    98 
    10 /* 
    119Set up the management page... 
    1210*/ 
     
    1917        __( 'Error Log', 'custom-error-log' ),  
    2018        'install_plugins',  
    21         'custom_error_log',  
     19        'custom-error-log',  
    2220        'cel_admin' 
    2321         
    2422    ); 
    2523     
    26     add_action( 'load-' . $cel_log_page, 'cel_load_admin_scripts' ); 
     24    add_action( 'load-' . $cel_log_page, 'cel_load_log_table_scripts' ); 
    2725     
    2826} 
     27 
     28add_action( 'admin_menu', 'cel_add_admin' ); 
    2929 
    3030/* 
     
    3333 
    3434function cel_admin() { 
    35  
    36     echo '<h2 style="margin-top: 30px;">' . __( 'Error Log' , 'custom-error-log' ) . '</h2>'; 
    3735     
     36    echo '<h2 class="cel-title">' . __( 'Error Log' , 'custom-error-log' ) . '</h2>'; 
     37     
     38    /* Import the main log table file... */ 
    3839    require_once( CEL_DIR . 'admin/log-table.php' ); 
     40     
     41    /* Clear the new logs array as now all logs should have been seen... */ 
     42    update_option( 'cel_new_logs', null ); 
    3943     
    4044} 
    4145 
    42 add_action( 'admin_menu', 'cel_add_admin' ); 
    43  
    4446/* 
    45 Load scripts for the admin page... 
     47Load scripts for the log table page... 
    4648*/ 
    4749 
    48 function cel_load_admin_scripts() { 
     50function cel_load_log_table_scripts() { 
    4951 
    50     add_action( 'admin_enqueue_scripts', 'cel_admin_scripts' ); 
     52    add_action( 'admin_enqueue_scripts', 'cel_log_table_scripts' ); 
    5153     
    5254} 
    5355 
    54 function cel_admin_scripts() { 
     56function cel_log_table_scripts() { 
    5557     
    5658    wp_register_style( 'mainStyle', CEL_URI . 'css/style.css' ); 
    5759     
    5860    /* Enqueue script for the error log table and pass translatable strings to it... */ 
    59     wp_register_script( 'logTable', CEL_URI . 'js/logTable.js', array('jquery'), '', TRUE ); 
     61    wp_register_script( 'logTable', CEL_URI . 'js/logTable.js', array( 'jquery' ), '', TRUE ); 
    6062     
    6163    $data_array = array( 
  • custom-error-log/trunk/admin/introduction.php

    r1012063 r1012837  
    77When no errors are logged the contents of this file appear on the admin error log page 
    88It explains to new users how to start logging errors 
     9 
     10Introduction... 
    911*/ 
    10  
    1112 
    1213$output = __( 'You haven\'t logged any errors yet. To log errors use the following function in your theme template files...', 'custom-error-log' ); 
     
    1718 
    1819$output .= __( 'Errors and notices behave in exactly the same way but you can filter the error log to show only errors or only notices. Once you have logged an error or notice you can return to this page to see a log of all your errors and notices.', 'custom-error-log' ) . '<br /><br />'; 
     20 
     21/* 
     22Parameters... 
     23*/ 
    1924 
    2025$output .= '<hr><h3 style="margin-top:30px;">' . __( 'Parameters', 'custom-error-log' ) . '</h3>'; 
     
    2732 
    2833$output .= '<br />&nbsp; &nbsp; &nbsp; &nbsp; <span class="default">' . __( 'Default', 'custom-error-log' ) . ': None</span>'; 
     34 
     35/* 
     36sample usage... 
     37*/ 
    2938 
    3039$output .= '<hr style="margin-top:30px;"><h3 style="margin-top:30px;">' . __( 'Sample Usage', 'custom-error-log' ) . '</h3>'; 
     
    6372}</pre>'; 
    6473 
     74/* 
     75Make it theme ready... 
     76*/ 
     77 
    6578$output .= '<hr style="margin-top:30px;"><h3 style="margin-top:30px;">' . __( 'Make it theme ready', 'custom-error-log' ) . '</h3>'; 
    6679 
     
    6982$output .= '<pre> 
    7083<span class="pre-comment">//If custom error log is active...</span> 
    71 if( function_exists ) { 
     84if( function_exists( \'log_error\' ) { 
    7285 
    7386    <span class="pre-comment">//Log the error...</span> 
  • custom-error-log/trunk/admin/log-table.php

    r1012063 r1012837  
    1010$logs = cel_get_all_logs(); 
    1111 
    12 /* 
    13 Start building the page... 
    14 */ 
     12/* Find out if the user has selected to see the admin menu icon... */ 
     13$ab_show = get_option( 'cel_ab_show', true ); 
     14 
     15$ab_checked = null; 
     16 
     17if( $ab_show == true ) { 
     18     
     19    $ab_checked = 'checked'; 
     20     
     21} 
    1522 
    1623?> 
    1724 
    18 <h1><?php __( 'Error Logs', 'custom-error-log' ); ?></h1> 
     25<form id="cel-ab-toggle" method="post" action=""> 
     26         
     27    <label><?php _e( 'Show in the admin bar', 'custom-error-log' ); ?></label> 
     28             
     29    <input type="checkbox" name="cel_ab_show" id="cel_ab_show" <?php echo $ab_checked; ?> /> 
     30             
     31</form> 
     32         
     33<div class="wrap" id="error-log"> 
    1934 
    20 <div class="wrap" id="error-log"> 
     35    <hr style="margin-bottom: 15px;"> 
    2136 
    2237    <div id="cel-ajax-message"></div> 
     
    3247        if( $logs['have_both'] == true ) { ?> 
    3348             
    34             <a class="cel-log-filter" filter="all" nonce="<?php echo $nonce; ?>">All</a> | 
     49            <a class="cel-log-filter" filter="all" nonce="<?php echo $nonce; ?>"> 
    3550             
    36             <a class="cel-log-filter" filter="error" nonce="<?php echo $nonce; ?>">Errors</a> | 
     51                <?php _e( 'All', 'custom-error-log' ); ?> 
     52             
     53            </a> | 
     54             
     55            <a class="cel-log-filter" filter="error" nonce="<?php echo $nonce; ?>"> 
     56                 
     57                <?php _e( 'Errors', 'custom-error-log' ); ?> 
     58                 
     59            </a> | 
    3760 
    38             <a class="cel-log-filter" filter="notice" nonce="<?php echo $nonce; ?>">Notices</a> 
     61            <a class="cel-log-filter" filter="notice" nonce="<?php echo $nonce; ?>"> 
     62                 
     63                <?php _e( 'Notices', 'custom-error-log' ); ?> 
     64                 
     65            </a> 
    3966 
    4067        <?php } ?> 
    4168         
    42         <a class="cel-delete-all" data-nonce="<?php echo $nonce; ?>">Clear Log</a> 
     69        <a class="cel-delete-all" data-nonce="<?php echo $nonce; ?>"><?php _e( 'Clear Log', 'custom-error-log' ); ?></a> 
    4370         
    4471        <table class="cel-table"> 
  • custom-error-log/trunk/css/style.css

    r1012063 r1012837  
    99Error Log Table 
    1010*/ 
     11 
     12h2.cel-title { 
     13    margin-top: 30px; 
     14    float: left; 
     15} 
     16 
     17#error-log { 
     18    clear: both; 
     19} 
    1120     
    1221.cel-table { 
     
    6574} 
    6675 
     76.cel-table .cel-new-log td { 
     77    background: #b9ed91; 
     78    -webkit-transition: background-color .7s ease-in-out; 
     79    -moz-transition: background-color .7s ease-in-out; 
     80    -o-transition: background-color .7s ease-in-out; 
     81    -ms-transition: background-color .7s ease-in-out; 
     82    transition: background-color .7s ease-in-out; 
     83} 
     84 
    6785.cel-log-filter, 
    6886.cel-log-unfilter { 
     
    114132} 
    115133 
     134#cel-ab-toggle { 
     135    float: right; 
     136    margin-right: 15px; 
     137    margin-top: 30px; 
     138} 
     139 
     140#cel-ab-toggle label { 
     141    font-size: 0.9em; 
     142    color: #999; 
     143    margin-right: 5px; 
     144} 
     145 
    116146/* 
    117147Introduction 
  • custom-error-log/trunk/custom-error-log.php

    r1012063 r1012837  
    88Domain Path: /languages 
    99Author: Dan Bahrami 
    10 Version: 1.0.0 
     10Version: 1.1 
    1111License: GPL2 
    1212 
     
    2222 
    2323@package Custom Error Log 
    24 @version 1.0.0 
     24@version 1.1 
    2525@author Dan Bahrami 
    2626@copyright Copyright (c) 2014, Dan Bahrami 
     
    7474        /* Include main admin file, this sets up the plugin's admin area */ 
    7575        require_once( CEL_DIR . 'admin/admin.php'); 
     76        require_once( CEL_DIR . 'admin/admin-bar.php'); 
    7677         
    7778    } 
     
    8283        add_option( 'custom_error_log' ); 
    8384        add_option( 'custom_notice_log' ); 
     85        add_option( 'cel_new_logs' ); 
     86        add_option( 'cel_ab_show', true ); 
    8487         
    8588    } 
     
    9093        delete_option( 'custom_error_log' ); 
    9194        delete_option( 'custom_notice_log' ); 
     95        delete_option( 'cel_new_logs' ); 
     96        delete_option( 'cel_ab_show' ); 
    9297         
    9398    } 
  • custom-error-log/trunk/includes/functions.php

    r1012063 r1012837  
    2626    } 
    2727     
     28    $error_id = $error_log['next_error']; 
     29     
    2830    /* Insert new error into array... */ 
    29     $error_log['errors'][$error_log['next_error']] = array( 
     31    $error_log['errors'][$error_id] = array( 
    3032     
    3133        'type'          => 'error', 
    3234        'date'          => current_time( 'timestamp' ), 
    33         'id'            => $error_log['next_error'], 
     35        'id'            => $error_id, 
    3436        'message'       => sanitize_text_field( $message ) 
    3537         
     
    4042     
    4143    /* Update the error log in the wp_options table... */ 
    42     update_option( 'custom_error_log', $error_log ); 
     44    $update = update_option( 'custom_error_log', $error_log ); 
     45     
     46    /* Add to list of new logs... */ 
     47    if( $update ) { 
     48         
     49        cel_add_to_new_logs( $error_id, 'errors' ); 
     50         
     51    } 
    4352 
    4453} 
     
    6473    } 
    6574     
     75    $notice_id = $notice_log['next_notice']; 
     76     
    6677    /* Insert new notice into array... */ 
    67     $notice_log['notices'][$notice_log['next_notice']] = array( 
     78    $notice_log['notices'][$notice_id] = array( 
    6879     
    6980        'type'          => 'notice', 
    7081        'date'          => current_time( 'timestamp' ), 
    71         'id'            => $notice_log['next_notice'], 
     82        'id'            => $notice_id, 
    7283        'message'       => sanitize_text_field( $message ) 
    7384         
     
    7889     
    7990    /* Update the notice log in the wp_options table... */ 
    80     update_option( 'custom_notice_log', $notice_log ); 
     91    $update = update_option( 'custom_notice_log', $notice_log ); 
     92     
     93    /* Add to list of new logs... */ 
     94    if( $update ) { 
     95         
     96        cel_add_to_new_logs( $notice_id, 'notices' ); 
     97         
     98    } 
    8199 
    82100} 
     
    367385function cel_format_logs( &$logs, $nonce ) { 
    368386     
     387    if( !$logs ) { 
     388     
     389        return __( 'No logs could be found', 'custom-error-log' ); 
     390     
     391    } 
     392     
     393    /* Sort logs into date order... */ 
     394    uasort( $logs['logs'], 'cel_sort_by_date' ); 
     395     
     396    /* Get the list of new logs so we can mark unseen logs as new... */ 
     397    $new_logs = get_option( 'cel_new_logs', true ); 
     398     
     399    /* Create output for each log... */ 
     400    $return = ''; 
    369401    $count = 1; 
    370402    $row_class = 'cel-table-row'; 
    371403     
    372     if( !$logs ) { 
    373      
    374         return __( 'No logs could be found', 'custom-error-log' ); 
    375      
    376     } 
    377      
    378     /* Sort logs into date order... */ 
    379     uasort( $logs['logs'], 'cel_sort_by_date' ); 
    380      
    381     /* Create output for each log... */ 
    382     $return = ''; 
    383      
    384404    /* Start the loop... */ 
    385405    foreach( $logs['logs'] as $log ) { 
     406         
     407        /* Check if the log is new... */ 
     408        if( $new_logs ) { 
     409             
     410            /* If the current log is in the new logs then add an extra class... */ 
     411            if( in_array( $log['id'], $new_logs[$log['type'] . 's'] ) ) { 
     412                 
     413                $row_class .= ' cel-new-log'; 
     414                 
     415            } 
     416             
     417        } 
    386418         
    387419        /* Build the output for each table row... */ 
     
    419451     
    420452} 
     453 
     454/* 
     455cel_ab_toggle() toggles on/off the admin bar item... 
     456*/ 
     457 
     458function cel_ab_toggle() { 
     459     
     460    $value = $_POST['update']; 
     461     
     462    $update = update_option( 'cel_ab_show', $value ); 
     463     
     464    die(); 
     465     
     466} 
     467 
     468add_action( 'wp_ajax_nopriv_cel_ab_toggle', 'cel_ab_toggle' ); 
     469add_action( 'wp_ajax_cel_ab_toggle', 'cel_ab_toggle' ); 
     470 
     471/* 
     472cel_add_to_new_logs() adds a new log to the cel_new_logs option... 
     473Currently used for displaying the amount of unmoderated logs in the admin bar... 
     474*/ 
     475function cel_add_to_new_logs( $id, $type ) { 
     476     
     477    $new_logs = get_option( 'cel_new_logs', true ); 
     478     
     479    if( !$new_logs ) { 
     480     
     481        $new_logs = array( 
     482         
     483            'errors'    => array(), 
     484            'notices'   => array() 
     485         
     486        ); 
     487         
     488    } 
     489     
     490    $new_logs[$type][] = $id; 
     491     
     492    $update = update_option( 'cel_new_logs', $new_logs ); 
     493     
     494} 
  • custom-error-log/trunk/js/logTable.js

    r1012063 r1012837  
    99 
    1010/* 
    11 Load all functions on page load... 
     11Load all functions when document is ready... 
    1212*/ 
    1313 
     
    1717    celDeleteAll(); 
    1818    celLogFilter(); 
     19    celAbToggle(); 
    1920 
    2021}); 
     
    4748        var deleted = '#'+log_type+'-'+error_code; 
    4849         
     50        /* Toggle class of all table rows after current to maintain the nice stripes... */ 
    4951        $( deleted ).nextAll().toggleClass( 'cel-dark' ); 
    5052        $( deleted ).hide(); 
     
    175177 
    176178} 
     179 
     180/* 
     181Toggles on and off the admin bar button... 
     182*/ 
     183 
     184function celAbToggle() { 
     185     
     186    $( '#cel_ab_show' ).change( function() { 
     187         
     188        if( $( this ).is( ":checked" ) ) { 
     189             
     190            var toggle_value = 1; 
     191            $( '#wp-admin-bar-error-log' ).show(); 
     192             
     193        } 
     194         
     195        else { 
     196             
     197            var toggle_value = 0; 
     198            $( '#wp-admin-bar-error-log' ).hide(); 
     199             
     200        } 
     201         
     202        $.ajax({ 
     203         
     204            type: 'POST', 
     205            url: errorAjax.ajaxurl, 
     206            data: { 
     207             
     208                action: 'cel_ab_toggle', 
     209                update: toggle_value, 
     210                 
     211            }, 
     212            success: function( data, textStatus, XMLHttpRequest ) { 
     213                 
     214            }, 
     215            error: function( MLHttpRequest, textStatus, errorThrown ) { 
     216             
     217                alert( errorThrown ); 
     218                 
     219            } 
     220             
     221        }); 
     222         
     223    }); 
     224     
     225} 
     226 
     227/* 
     228Load function when the window has loaded... 
     229*/ 
     230 
     231$( window ).on( 'load', function() { 
     232     
     233    celHighlightNewLogs(); 
     234 
     235}); 
     236 
     237/* 
     238celHighlightNewLogs() adds a bit of a flourish to new logs... 
     239*/ 
     240 
     241function celHighlightNewLogs() { 
     242     
     243    $( '.cel-new-log' ).each( function() { 
     244         
     245        /* Find out if this is a dark row or not... */ 
     246        if( $( this ).is( '.cel-dark' ) ) { 
     247             
     248            var color = '#e6e6e6'; 
     249             
     250        } 
     251         
     252        else { 
     253             
     254            var color = '#f1f1f1'; 
     255             
     256        } 
     257         
     258        /* Store current item as var so we can use it in a timeout function... */ 
     259        var current = this; 
     260         
     261        /* after 800ms convert the background color back to normal... */ 
     262        setTimeout( function(){ 
     263         
     264            $( current ).find( 'td' ).css( 'background', color ); 
     265         
     266        }, 800 ); 
     267         
     268    }) 
     269     
     270} 
  • custom-error-log/trunk/languages/en_US.po

    r1012063 r1012837  
    22msgstr "" 
    33"Project-Id-Version: Custom Error Log\n" 
    4 "POT-Creation-Date: 2014-10-22 11:46-0000\n" 
    5 "PO-Revision-Date: 2014-10-22 11:46-0000\n" 
     4"POT-Creation-Date: 2014-10-23 14:30-0000\n" 
     5"PO-Revision-Date: 2014-10-23 14:30-0000\n" 
    66"Last-Translator: Dan Bahrami <dan.bahrami@googlemail.com>\n" 
    77"Language-Team: \n" 
     
    1616"X-Poedit-SearchPath-0: ..\n" 
    1717 
    18 #: ../admin/admin.php:18 ../admin/admin.php:19 ../admin/admin.php:36 
     18#: ../admin/admin-bar.php:70 ../admin/log-table.php:57 
     19msgid "Errors" 
     20msgstr "" 
     21 
     22#: ../admin/admin.php:16 ../admin/admin.php:17 ../admin/admin.php:36 
    1923msgid "Error Log" 
    2024msgstr "" 
    2125 
    22 #: ../admin/admin.php:64 
     26#: ../admin/admin.php:66 
    2327msgid "Deleting" 
    2428msgstr "" 
    2529 
    26 #: ../admin/introduction.php:12 
     30#: ../admin/introduction.php:13 
    2731msgid "" 
    2832"You haven't logged any errors yet. To log errors use the following function " 
     
    3034msgstr "" 
    3135 
    32 #: ../admin/introduction.php:18 
     36#: ../admin/introduction.php:19 
    3337msgid "" 
    3438"Errors and notices behave in exactly the same way but you can filter the " 
     
    3842msgstr "" 
    3943 
    40 #: ../admin/introduction.php:20 
     44#: ../admin/introduction.php:25 
    4145msgid "Parameters" 
    4246msgstr "" 
    4347 
    44 #: ../admin/introduction.php:24 
     48#: ../admin/introduction.php:29 
    4549msgid "required" 
    4650msgstr "" 
    4751 
    48 #: ../admin/introduction.php:26 
     52#: ../admin/introduction.php:31 
    4953msgid "The error/notice message you want to log for internal use." 
    5054msgstr "" 
    5155 
    52 #: ../admin/introduction.php:28 
     56#: ../admin/introduction.php:33 
    5357msgid "Default" 
    5458msgstr "" 
    5559 
    56 #: ../admin/introduction.php:30 
     60#: ../admin/introduction.php:39 
    5761msgid "Sample Usage" 
    5862msgstr "" 
    5963 
    60 #: ../admin/introduction.php:32 
     64#: ../admin/introduction.php:41 
    6165msgid "Log an error" 
    6266msgstr "" 
    6367 
    64 #: ../admin/introduction.php:34 ../admin/introduction.php:74 
     68#: ../admin/introduction.php:43 ../admin/introduction.php:87 
    6569msgid "There was an error with my theme" 
    6670msgstr "" 
    6771 
    68 #: ../admin/introduction.php:36 
     72#: ../admin/introduction.php:45 
    6973msgid "Use dynamic content to log an error" 
    7074msgstr "" 
    7175 
    72 #: ../admin/introduction.php:38 
     76#: ../admin/introduction.php:47 
    7377msgid "There was an error with" 
    7478msgstr "" 
    7579 
    76 #: ../admin/introduction.php:38 
     80#: ../admin/introduction.php:47 
    7781msgid "in my theme'" 
    7882msgstr "" 
    7983 
    80 #: ../admin/introduction.php:41 
     84#: ../admin/introduction.php:50 
    8185msgid "A real life example" 
    8286msgstr "" 
    8387 
    84 #: ../admin/introduction.php:43 
     88#: ../admin/introduction.php:52 
    8589msgid "error handling when creating a Wordpress user programatically" 
    8690msgstr "" 
    8791 
    88 #: ../admin/introduction.php:65 
     92#: ../admin/introduction.php:78 
    8993msgid "Make it theme ready" 
    9094msgstr "" 
    9195 
    92 #: ../admin/introduction.php:67 
     96#: ../admin/introduction.php:80 
    9397msgid "" 
    9498"If you want to include the basic functions of custom error log in themes " 
     
    97101msgstr "" 
    98102 
    99 #: ../admin/log-table.php:18 
    100 msgid "Error Logs" 
     103#: ../admin/log-table.php:27 
     104msgid "Show in the admin bar" 
    101105msgstr "" 
    102106 
    103 #: ../admin/log-table.php:52 
     107#: ../admin/log-table.php:51 
     108msgid "All" 
     109msgstr "" 
     110 
     111#: ../admin/log-table.php:63 
     112msgid "Notices" 
     113msgstr "" 
     114 
     115#: ../admin/log-table.php:69 
     116msgid "Clear Log" 
     117msgstr "" 
     118 
     119#: ../admin/log-table.php:79 
    104120msgid "Date" 
    105121msgstr "" 
    106122 
    107 #: ../admin/log-table.php:54 
     123#: ../admin/log-table.php:81 
    108124msgid "Time" 
    109125msgstr "" 
    110126 
    111 #: ../admin/log-table.php:56 
     127#: ../admin/log-table.php:83 
    112128msgid "Message" 
    113129msgstr "" 
    114130 
    115 #: ../includes/functions.php:122 
     131#: ../includes/functions.php:140 
    116132#, php-format 
    117133msgid "%s %d has been successfully deleted" 
    118134msgstr "" 
    119135 
    120 #: ../includes/functions.php:130 
     136#: ../includes/functions.php:148 
    121137#, php-format 
    122138msgid "%s %d could not be deleted" 
    123139msgstr "" 
    124140 
    125 #: ../includes/functions.php:170 
     141#: ../includes/functions.php:188 
    126142msgid "All errors have been deleted" 
    127143msgstr "" 
    128144 
    129 #: ../includes/functions.php:178 
     145#: ../includes/functions.php:196 
    130146msgid "Errors could not be deleted" 
    131147msgstr "" 
    132148 
    133 #: ../includes/functions.php:374 
     149#: ../includes/functions.php:389 
    134150msgid "No logs could be found" 
    135151msgstr "" 
  • custom-error-log/trunk/languages/en_US.pot

    r1012063 r1012837  
    22msgstr "" 
    33"Project-Id-Version: Custom Error Log\n" 
    4 "POT-Creation-Date: 2014-10-22 11:46-0000\n" 
    5 "PO-Revision-Date: 2014-10-22 11:47-0000\n" 
     4"POT-Creation-Date: 2014-10-23 14:30-0000\n" 
     5"PO-Revision-Date: 2014-10-23 14:30-0000\n" 
    66"Last-Translator: Dan Bahrami <dan.bahrami@googlemail.com>\n" 
    77"Language-Team: \n" 
     
    1616"X-Poedit-SearchPath-0: ..\n" 
    1717 
    18 #: ../admin/admin.php:18 ../admin/admin.php:19 ../admin/admin.php:36 
     18#: ../admin/admin-bar.php:70 ../admin/log-table.php:57 
     19msgid "Errors" 
     20msgstr "" 
     21 
     22#: ../admin/admin.php:16 ../admin/admin.php:17 ../admin/admin.php:36 
    1923msgid "Error Log" 
    2024msgstr "" 
    2125 
    22 #: ../admin/admin.php:64 
     26#: ../admin/admin.php:66 
    2327msgid "Deleting" 
    2428msgstr "" 
    2529 
    26 #: ../admin/introduction.php:12 
     30#: ../admin/introduction.php:13 
    2731msgid "" 
    2832"You haven't logged any errors yet. To log errors use the following function " 
     
    3034msgstr "" 
    3135 
    32 #: ../admin/introduction.php:18 
     36#: ../admin/introduction.php:19 
    3337msgid "" 
    3438"Errors and notices behave in exactly the same way but you can filter the " 
     
    3842msgstr "" 
    3943 
    40 #: ../admin/introduction.php:20 
     44#: ../admin/introduction.php:25 
    4145msgid "Parameters" 
    4246msgstr "" 
    4347 
    44 #: ../admin/introduction.php:24 
     48#: ../admin/introduction.php:29 
    4549msgid "required" 
    4650msgstr "" 
    4751 
    48 #: ../admin/introduction.php:26 
     52#: ../admin/introduction.php:31 
    4953msgid "The error/notice message you want to log for internal use." 
    5054msgstr "" 
    5155 
    52 #: ../admin/introduction.php:28 
     56#: ../admin/introduction.php:33 
    5357msgid "Default" 
    5458msgstr "" 
    5559 
    56 #: ../admin/introduction.php:30 
     60#: ../admin/introduction.php:39 
    5761msgid "Sample Usage" 
    5862msgstr "" 
    5963 
    60 #: ../admin/introduction.php:32 
     64#: ../admin/introduction.php:41 
    6165msgid "Log an error" 
    6266msgstr "" 
    6367 
    64 #: ../admin/introduction.php:34 ../admin/introduction.php:74 
     68#: ../admin/introduction.php:43 ../admin/introduction.php:87 
    6569msgid "There was an error with my theme" 
    6670msgstr "" 
    6771 
    68 #: ../admin/introduction.php:36 
     72#: ../admin/introduction.php:45 
    6973msgid "Use dynamic content to log an error" 
    7074msgstr "" 
    7175 
    72 #: ../admin/introduction.php:38 
     76#: ../admin/introduction.php:47 
    7377msgid "There was an error with" 
    7478msgstr "" 
    7579 
    76 #: ../admin/introduction.php:38 
     80#: ../admin/introduction.php:47 
    7781msgid "in my theme'" 
    7882msgstr "" 
    7983 
    80 #: ../admin/introduction.php:41 
     84#: ../admin/introduction.php:50 
    8185msgid "A real life example" 
    8286msgstr "" 
    8387 
    84 #: ../admin/introduction.php:43 
     88#: ../admin/introduction.php:52 
    8589msgid "error handling when creating a Wordpress user programatically" 
    8690msgstr "" 
    8791 
    88 #: ../admin/introduction.php:65 
     92#: ../admin/introduction.php:78 
    8993msgid "Make it theme ready" 
    9094msgstr "" 
    9195 
    92 #: ../admin/introduction.php:67 
     96#: ../admin/introduction.php:80 
    9397msgid "" 
    9498"If you want to include the basic functions of custom error log in themes " 
     
    97101msgstr "" 
    98102 
    99 #: ../admin/log-table.php:18 
    100 msgid "Error Logs" 
     103#: ../admin/log-table.php:27 
     104msgid "Show in the admin bar" 
    101105msgstr "" 
    102106 
    103 #: ../admin/log-table.php:52 
     107#: ../admin/log-table.php:51 
     108msgid "All" 
     109msgstr "" 
     110 
     111#: ../admin/log-table.php:63 
     112msgid "Notices" 
     113msgstr "" 
     114 
     115#: ../admin/log-table.php:69 
     116msgid "Clear Log" 
     117msgstr "" 
     118 
     119#: ../admin/log-table.php:79 
    104120msgid "Date" 
    105121msgstr "" 
    106122 
    107 #: ../admin/log-table.php:54 
     123#: ../admin/log-table.php:81 
    108124msgid "Time" 
    109125msgstr "" 
    110126 
    111 #: ../admin/log-table.php:56 
     127#: ../admin/log-table.php:83 
    112128msgid "Message" 
    113129msgstr "" 
    114130 
    115 #: ../includes/functions.php:122 
     131#: ../includes/functions.php:140 
    116132#, php-format 
    117133msgid "%s %d has been successfully deleted" 
    118134msgstr "" 
    119135 
    120 #: ../includes/functions.php:130 
     136#: ../includes/functions.php:148 
    121137#, php-format 
    122138msgid "%s %d could not be deleted" 
    123139msgstr "" 
    124140 
    125 #: ../includes/functions.php:170 
     141#: ../includes/functions.php:188 
    126142msgid "All errors have been deleted" 
    127143msgstr "" 
    128144 
    129 #: ../includes/functions.php:178 
     145#: ../includes/functions.php:196 
    130146msgid "Errors could not be deleted" 
    131147msgstr "" 
    132148 
    133 #: ../includes/functions.php:374 
     149#: ../includes/functions.php:389 
    134150msgid "No logs could be found" 
    135151msgstr "" 
  • custom-error-log/trunk/readme.txt

    r1012063 r1012837  
    11=== Custom Error Log === 
    22Contributors: danbahrami 
    3 Tags: error, errors, custom errors, error log, log, php, php error, php errors, debug, debugging 
     3Tags: error, errors, custom errors, error log, log, php, php error, php errors, debug, debugging, admin, development, tools 
    44Requires at least: 3.0.1 
    55Tested up to: 4.0.0 
    6 Stable tag: 1.0 
     6Stable tag: 1.1 
    77License: GPLv2 or later 
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html 
     
    2323* **Log notices:** Notices can be logged for less serious issues and viewed seperately in the admin area. 
    2424* **Keep Track:** View and moderate all your errors in the Wordpress admin area. 
     25* **Toolbar icon:** The admin toolbar displays how many new errors and notices have occurred on the current page. 
    2526 
    2627### Getting Started: 
     
    2930In your theme use either of the two built in functions to log an error `log_error($message);` or a notice `log_notice($message);`. 
    3031 
    31 When these functions are executed the will log whatever error or notice you want. 
     32When these functions are executed they will log whatever error or notice you want. 
    3233 
    3334### Ongoing Development: 
     
    3738The plugin is translation ready but as of yet contains only an English translation file. If you would like to contribute any translations I would be very grateful. 
    3839 
     40### Please note: 
     41This plugin is aimed at developers who have at least a basic understanding of PHP. If this isn't you then you may not find much use from this plugin however if you are unsure how to use any of the functions explained you can post a topic in the support section of the plugin directory and I will do my best to help you. 
     42 
    3943== Installation == 
    4044 
    41451. Upload `Custom Error Log` to the `/wp-content/plugins/` directory. 
    42462. Activate the plugin through the 'Plugins' menu in WordPress. 
    43 3. Place the function `log_error($error);` in your theme where you would like to log an error. 
     473. Place the function `log_error($message);` in your theme where you would like to log an error. 
    4448 
    4549Once the plugin is installed and activated you can find more detailed instructions under *Tools > Error Log* in the Wordpress admin menu. 
     
    5963It's simple, you place the following function in your theme/plugin where you want to log an error... 
    6064 
    61 `log_error($message);` 
     65`log_error( $message );` 
    6266 
    6367Replace $message with whatever error message you want to log for example if you're adding a new user you could do this... 
     
    7377    $message .= " The following error occurred: " . $error_response; 
    7478     
    75     log_error($message); 
     79    log_error( $message ); 
    7680     
    7781}` 
     
    8387== Changelog == 
    8488 
     89= 1.1 = 
     90* Added toolbar icon for displaying new errors/notices that occur on the current page. 
     91* Added option to hide the new toolbar icon. 
     92* Added ability to track which errors/notices have not yet been viewed in the error log. 
     93* Added a nice animation to highlight which logs are new in the error log. 
     94* updated some non-internationalized strings. 
     95 
    8596= 1.0 = 
    8697* Hello world... 
    8798 
    8899== Upgrade Notice == 
     100 
     101Added new toolbar icon that displays new errors/notices that have occurred on the current page. 
Note: See TracChangeset for help on using the changeset viewer.