Plugin Directory

Changeset 654882


Ignore:
Timestamp:
01/18/2013 02:18:56 PM (13 years ago)
Author:
micc83
Message:

Adding version 0.0.3 of my plugin

Location:
wpdevtool/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • wpdevtool/trunk/inc/help.php

    r653225 r654882  
    2222    define( 'WP_DEBUG_DISPLAY', FALSE );
    2323    @ini_set( 'display_errors', 0 );
    24 }</pre>"
     24}</pre>
     25<p>" . __( "<strong>Warning:</strong> Dont mess up with your wp-config file if you are not sure about what you're doing and remember to clear up the log file periodically so that it does not become too large.",'wpdevtool' ) ."</p>"
    2526            ) );
    2627            break;
  • wpdevtool/trunk/langs/wpdevtool-it_IT.po

    r653225 r654882  
    22msgstr ""
    33"Project-Id-Version: WpDevTool\n"
    4 "POT-Creation-Date: 2013-01-15 23:19+0100\n"
    5 "PO-Revision-Date: 2013-01-15 23:19+0100\n"
    6 "Last-Translator: Comodolab <micc83@gmail.com>\n"
     4"POT-Creation-Date: 2013-01-18 13:31+0100\n"
     5"PO-Revision-Date: 2013-01-18 13:34+0100\n"
     6"Last-Translator: Alessandro Benoit <micc83@gmail.com>\n"
    77"Language-Team: Alessandro Benoit <micc83@gmail.com>\n"
    88"Language: Italiano\n"
     
    2828msgstr "%s è in manutenzione al momento. Contattaci all'indirizzo %s"
    2929
    30 #: ../wpdevtool.php:126
     30#: ../wpdevtool.php:137
    3131msgid "is under maintenance"
    3232msgstr "è in manutenzione"
    3333
    34 #: ../wpdevtool.php:128
     34#: ../wpdevtool.php:139
    3535msgid "Maintenance Screen"
    3636msgstr "Sito in Manutenzione"
    3737
    38 #: ../wpdevtool.php:178
     38#: ../wpdevtool.php:188
    3939msgid "Something went wrong. Your log file is missing..."
    4040msgstr "Qualcosa è andato storto. Il tuo file log è mancante..."
    4141
    42 #: ../wpdevtool.php:208
     42#: ../wpdevtool.php:218
    4343#, php-format
    4444msgid "Log file has been deleted. <a href=\"%s\">Go back to WpDevTool</a>"
    4545msgstr "Il file Log è stato eliminato. <a href=\"%s\">Torna a WpDevTool</a>"
    4646
    47 #: ../wpdevtool.php:236
     47#: ../wpdevtool.php:253
    4848#, php-format
    4949msgid "%d query in %s secondi, memoria %s Kb"
    5050msgstr "%d query in %s seconds, memory %s Kb"
    5151
    52 #: ../wpdevtool.php:239 ../views/admin.php:10 ../views/admin.php:75
     52#: ../wpdevtool.php:256 ../views/admin.php:10 ../views/admin.php:108
    5353msgid "WpDevTool Options"
    5454msgstr "Opzioni WpDevTool"
    5555
    56 #: ../wpdevtool.php:242
     56#: ../wpdevtool.php:259
    5757msgid "WordPress Logs"
    5858msgstr "Log di WordPress"
     
    8888#: ../inc/credits.php:12
    8989msgid "WordPress Codex"
    90 msgstr ""
     90msgstr "Codex di WordPress"
    9191
    9292#: ../inc/help.php:18
     
    103103"sotto"
    104104
    105 #: ../views/admin.php:49
     105#: ../inc/help.php:25
     106msgid ""
     107"<strong>Warning:</strong> Dont mess up with your wp-config file if you are "
     108"not sure about what you're doing and remember to clear up the log file "
     109"periodically so that it does not become too large."
     110msgstr ""
     111"<strong>Attenzione:</strong> Non mettete le mani al vostro file wp-config se "
     112"non siete sicuri di ciò che state facendo e ricordate di eliminare "
     113"periodicamente il file log, attraverso l'apposito bottone, in modo che non "
     114"diventi troppo grande."
     115
     116#: ../views/admin.php:50
     117msgid "Maintenance text cant be left empty!"
     118msgstr "Il testo della pagina manutenzione non può essere lasciato vuoto!"
     119
     120#: ../views/admin.php:65
     121msgid "Something went wrong with the catch all email address"
     122msgstr "Qualcosa è andato storto con l'email inserita"
     123
     124#: ../views/admin.php:81
    106125msgid "Well done!"
    107126msgstr "Ben fatto!"
    108127
    109 #: ../views/admin.php:64 ../views/error_log.php:35
     128#: ../views/admin.php:97 ../views/error_log.php:36
    110129msgid "You do not have sufficient permissions to access this page."
    111130msgstr ""
    112131
    113 #: ../views/admin.php:70 ../views/error_log.php:66
     132#: ../views/admin.php:103 ../views/error_log.php:67
    114133msgid "WordPress Development Tool"
    115134msgstr "Strumenti di sviluppo WordPress"
    116135
    117 #: ../views/admin.php:82 ../views/admin.php:88 ../views/admin.php:102
     136#: ../views/admin.php:116 ../views/admin.php:122 ../views/admin.php:137
    118137msgid "Enable maintenance mode"
    119138msgstr "Attiva modalità manutenzione"
    120139
    121 #: ../views/admin.php:83
     140#: ../views/admin.php:117
    122141msgid "Return a HTTP RESPONSE 503 (Service Temporary Unavailable) landing page"
    123142msgstr ""
     
    125144"Sospeso)"
    126145
    127 #: ../views/admin.php:96
     146#: ../views/admin.php:131
    128147msgid "Maintenance message"
    129148msgstr "Messaggio manutenzione"
    130149
    131 #: ../views/admin.php:97
     150#: ../views/admin.php:132
    132151msgid "Shortcodes: <br>[email] Blog email <br>[name] Blog name"
    133152msgstr "Codici supportati: <br>[email] Email del blog <br>[name] Nome del blog"
    134153
    135 #: ../views/admin.php:110 ../views/admin.php:116
     154#: ../views/admin.php:146 ../views/admin.php:152
    136155msgid "Enable Debug Bar"
    137156msgstr "Abilita la Debug Bar"
    138157
    139 #: ../views/admin.php:111
     158#: ../views/admin.php:147
    140159msgid "Show a simple debug bar on the bottom of every template page"
    141160msgstr "Mostra una semplice barra per il debug nel frontend"
    142161
    143 #: ../views/admin.php:124 ../views/admin.php:130
     162#: ../views/admin.php:161 ../views/admin.php:167
     163msgid "Redirect all emails"
     164msgstr "Reindirizza tutte le email"
     165
     166#: ../views/admin.php:162
     167msgid "Redirect all WordPress emails to a single address"
     168msgstr "Reindirizza tutte le email di WordPress ad un singolo indirizzo"
     169
     170#: ../views/admin.php:176 ../views/admin.php:182
     171msgid "Catch all Email"
     172msgstr "Email"
     173
     174#: ../views/admin.php:177
     175msgid "Catch all the emails sent through wp_mail()"
     176msgstr "Qui arrivano tutte le email inviate attraverso wp_mail()"
     177
     178#: ../views/admin.php:191 ../views/admin.php:197
    144179msgid "WP_DEBUG is active"
    145180msgstr "WB_DEBUG è attivo"
    146181
    147 #: ../views/admin.php:125
     182#: ../views/admin.php:192
    148183msgid "Check wheter you have set WP_DEBUG to TRUE"
    149184msgstr "Controlla di aver settato WP_DEBUG a TRUE"
    150185
    151 #: ../views/admin.php:138 ../views/admin.php:144
     186#: ../views/admin.php:206 ../views/admin.php:212
    152187msgid "Logging is enabled"
    153188msgstr "Il logging è abilitato"
    154189
    155 #: ../views/admin.php:139
     190#: ../views/admin.php:207
    156191msgid "To enable silent logging give a look to Contextual Help"
    157192msgstr ""
     
    159194"all'aiuto in linea"
    160195
    161 #: ../views/error_log.php:12 ../views/error_log.php:71
     196#: ../views/error_log.php:12 ../views/error_log.php:72
    162197msgid "WpDevTool Error Log Console"
    163198msgstr "WpDevTool Console degli errori"
     
    167202msgstr "Console Errori"
    168203
    169 #: ../views/error_log.php:71
     204#: ../views/error_log.php:72
    170205msgid "errors"
    171206msgstr "errori"
    172207
    173 #: ../views/error_log.php:78
     208#: ../views/error_log.php:79
    174209msgid "It's your lucky day... Ain't no errors!"
    175210msgstr "E' il tuo giorno fortunato, non ci sono errori!"
    176211
    177 #: ../views/error_log.php:88
     212#: ../views/error_log.php:89
    178213msgid "More Options"
    179214msgstr "Più opzioni"
    180215
    181 #: ../views/error_log.php:90
     216#: ../views/error_log.php:91
    182217msgid "Clear log file"
    183218msgstr "Elimina il file log"
    184219
    185 #: ../views/error_log.php:91
     220#: ../views/error_log.php:92
    186221msgid "Download log file"
    187222msgstr "Scarica il file log"
  • wpdevtool/trunk/readme.txt

    r653225 r654882  
    77Requires at least: 3.0.1
    88Tested up to: 3.5
    9 Stable tag: 0.0.2
     9Stable tag: 0.0.3
    1010License: GPLv2 or later
    1111License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    2020* **Debug bar**: A simple bar which show number of query, timing and memory of current page
    2121* **Log Console**: A console to show WordPress Error Log ( WP_DEBUG_LOG must be set to TRUE )
     22* **Email Redirect**: Redirect all WordPress emails to a single address
    2223* **wdt_dump()**: A formatted version of var_dump()
    2324
     
    5354== Changelog ==
    5455
     56= 0.0.3 =
     57* Fix console showing 1 error with no errors bug
     58* Fix debug bar background on style.css for internet explorer enhancement
     59* Redirect all WordPress Mail feature
     60* Fix Check on which admin page to include script.js bug
     61
    5562= 0.0.2 =
    5663* Add default options to wpdevtool_activation
     
    6673== Upgrade Notice ==
    6774
     75= 0.0.3 =
     76Fix some issues. Add redirect all email feature. Most important, fix the including of WpDevTool script on every admin page.
     77
    6878= 0.0.1 =
    6979First release
    70 
    71 == To Do ==
    7280
    7381== To Be ==
     
    7886* Add db table check up
    7987* Enable advanced error tracking
     88* Add Developer User type
     89* Add hidden test posts
    8090
    8191== Credits ==
  • wpdevtool/trunk/styles/style.css

    r652874 r654882  
    77.postbox {margin: 10px 0;}
    88.wp-editor-wrap .mceIframeContainer{background: #fff;}
     9label {
     10    font-weight: 800;
     11}
     12.required_field {
     13    color: #f00;
     14}
     15input.long-text {
     16    width: 100%;
     17}
    918@media screen and (max-width:1024px) {
    1019    .postbox.left_col, .postbox.right_col {width: 100%;}
  • wpdevtool/trunk/views/admin.php

    r653225 r654882  
    3131
    3232    register_setting( 'wpdevtool_admin-settings', 'wpdevtool_maintenance', 'intval' );
    33     register_setting( 'wpdevtool_admin-settings', 'wpdevtool_maintenance_message', 'wp_kses_post' );
     33    register_setting( 'wpdevtool_admin-settings', 'wpdevtool_maintenance_message', 'wpdevtool_maintenance_text_eval' );
    3434    register_setting( 'wpdevtool_admin-settings', 'wpdevtool_debug_bar', 'intval' );
     35    register_setting( 'wpdevtool_admin-settings', 'wpdevtool_redirect_emails', 'intval' );
     36    register_setting( 'wpdevtool_admin-settings', 'wpdevtool_redirect_email', 'wpdevtool_catch_all_email_eval' );
    3537   
    3638}
    3739add_action( 'admin_init', 'register_wpdevtool_admin_settings' );
     40
     41/**
     42 * Maintenance text validation
     43 *
     44 * @since 0.0.3
     45 * @params string Maintenance text
     46 * @return string Text through wp_kes_post or old value on empty field
     47 */
     48function wpdevtool_maintenance_text_eval( $maintenance_text ) {
     49    if ( empty( $maintenance_text ) ) {
     50        add_settings_error( 'wpdevtool_admin-settings', 'code', __( 'Maintenance text cant be left empty!', 'wpdevtool' ), 'error' );
     51        return get_option( 'wpdevtool_maintenance_message' );
     52    }
     53    return wp_kses_post( $maintenance_text );
     54}
     55
     56/**
     57 * Catch All Email validation
     58 *
     59 * @since 0.0.3
     60 * @params string Maintenance text
     61 * @return string Text through wp_kes_post or old value on empty field
     62 */
     63function wpdevtool_catch_all_email_eval( $email ) {
     64    if ( empty( $email ) || !is_email( $email ) ) {
     65        add_settings_error( 'wpdevtool_admin-settings', 'code', __( 'Something went wrong with the catch all email address', 'wpdevtool' ), 'error' );
     66        return get_option( 'wpdevtool_redirect_email' );
     67    }
     68    return $email;
     69}
    3870
    3971/**
     
    5789 * WpDevTool Main Admin Page
    5890 *
     91 * @uses do_settings_sections('wpdevtool_admin') to add custom fields to the panel
    5992 * @since 0.0.1
    6093 */
     
    78111                    <?php settings_fields( 'wpdevtool_admin-settings' ); ?>
    79112                    <table class="form-table">
     113                        <!-- Enable Maintenance Mode -->
    80114                        <tr valign="top">
    81115                            <th scope="row">
     
    92126                            </td>
    93127                        </tr>
     128                        <!-- Maintenance Page Text -->
    94129                        <tr valign="top" <?php if ( !get_option('wpdevtool_maintenance') ) echo('style="display:none"'); ?>>
    95130                            <th scope="row">
    96                                 <label for="wpdevtool_maintenance_message"><?php _e( 'Maintenance message', 'wpdevtool' ); ?></label>
     131                                <label for="wpdevtool_maintenance_message"><span class="required_field">*</span> <?php _e( 'Maintenance message', 'wpdevtool' ); ?></label>
    97132                                <p class="description"><?php _e( "Shortcodes: <br>[email] Blog email <br>[name] Blog name", 'wpdevtool' ); ?></p>
    98133                            </th>
     
    102137                                        <label for="wpdevtool_maintenance_message"><?php _e( 'Enable maintenance mode', 'wpdevtool' ); ?></label>
    103138                                    </legend>
    104                                     <input name="wpdevtool_maintenance_message" type="text" id="wpdevtool_maintenance_message" value="<?php echo get_option('wpdevtool_maintenance_message'); ?>" class="regular-text code">
    105                                 </fieldset>
    106                             </td>
    107                         </tr>           
     139                                    <input name="wpdevtool_maintenance_message" type="text" id="wpdevtool_maintenance_message" value="<?php echo get_option('wpdevtool_maintenance_message'); ?>" class="long-text code">
     140                                </fieldset>
     141                            </td>
     142                        </tr>
     143                        <!-- Enable Debug bar -->
    108144                        <tr valign="top">
    109145                            <th scope="row">
     
    120156                            </td>
    121157                        </tr>
     158                        <!-- Redirect All Emails -->
     159                        <tr valign="top">
     160                            <th scope="row">
     161                                <label for="wpdevtool_redirect_emails"><?php _e( 'Redirect all emails', 'wpdevtool' ); ?></label>
     162                                <p class="description"><?php _e( 'Redirect all WordPress emails to a single address', 'wpdevtool' ); ?></p>
     163                            </th>
     164                            <td>
     165                                <fieldset>
     166                                    <legend class="screen-reader-text">
     167                                        <label for="wpdevtool_redirect_emails"><?php _e( 'Redirect all emails', 'wpdevtool' ); ?></label>
     168                                    </legend>
     169                                    <input name="wpdevtool_redirect_emails" type="checkbox" id="wpdevtool_redirect_emails" value="1" <?php checked( '1', get_option('wpdevtool_redirect_emails') ); ?>  >
     170                                </fieldset>
     171                            </td>
     172                        </tr>
     173                        <!-- Maintenance Page Text -->
     174                        <tr valign="top" <?php if ( !get_option('wpdevtool_redirect_emails') ) echo('style="display:none"'); ?>>
     175                            <th scope="row">
     176                                <label for="wpdevtool_redirect_email"><span class="required_field">*</span> <?php _e( 'Catch all Email', 'wpdevtool' ); ?></label>
     177                                <p class="description"><?php _e( "Catch all the emails sent through wp_mail()", 'wpdevtool' ); ?></p>
     178                            </th>
     179                            <td>
     180                                <fieldset>
     181                                    <legend class="screen-reader-text">
     182                                        <label for="wpdevtool_redirect_email"><?php _e( 'Catch all Email', 'wpdevtool' ); ?></label>
     183                                    </legend>
     184                                    <input name="wpdevtool_redirect_email" type="text" id="wpdevtool_redirect_email" value="<?php echo get_option('wpdevtool_redirect_email'); ?>" class="long-text code">
     185                                </fieldset>
     186                            </td>
     187                        </tr>
     188                        <!-- Check if WP_DEBUG is set to TRUE -->
    122189                        <tr valign="top">
    123190                            <th scope="row">
     
    134201                            </td>
    135202                        </tr>
     203                        <!-- Check if WP_DEBUG_LOG is set to TRUE -->
    136204                        <tr valign="top">
    137205                            <th scope="row">
  • wpdevtool/trunk/views/error_log.php

    r653225 r654882  
    2828 * WpDevTool Main Admin Page
    2929 *
     30 * @uses apply_filters() Calls 'wpdevtool_error_console_colors' to apply a different log console style
    3031 * @since 0.0.1
    3132 */
  • wpdevtool/trunk/wpdevtool.php

    r653225 r654882  
    22/*
    33Plugin Name: WpDevTool
    4 Plugin URI:
     4Plugin URI: https://github.com/micc83/WpDevTool
    55Description: A simple tool to develop on WordPress platform...
    6 Version: 0.0.2
     6Version: 0.0.3
    77Author: Alessandro Benoit
    88Author URI: http://codeb.it
     
    4545
    4646/**
    47  * Set default option values
     47 * Set default option values on plugin activation
    4848 *
    4949 * @since 0.0.2
     
    5353    if ( !get_option( 'wpdevtool_maintenance_message' ) )
    5454        update_option( 'wpdevtool_maintenance_message', sprintf( __( '%s is under maintenance at the moment. Contact us at %s', 'wpdevtool' ), '[name]', '[email]' ) );
     55   
     56    if ( !get_option( 'wpdevtool_redirect_email' ) ){
     57        $current_user = wp_get_current_user();
     58        update_option( 'wpdevtool_redirect_email', $current_user->user_email );
     59    }
    5560
    5661}
     
    8489add_action( 'init', 'wpdevtool_register' );
    8590
     91/**
     92 * WpDevTool Enqueue Admin Javascript
     93 *
     94 * @since 0.0.2
     95 */
    8696function wpdevtool_enqueue_admin_script() {
    8797   
    88     wp_enqueue_script('WpDevToolScript');
     98    if ( isset( $_GET['page'] ) && ( substr( $_GET['page'], 0, 9 ) === "wpdevtool" ) )
     99        wp_enqueue_script('WpDevToolScript');
    89100   
    90101}
     
    137148 *
    138149 * @since 0.0.1
    139  *
    140150 * @param string $logfilepath Path to the log file
    141  *
     151 * @param string $color_scheme The color scheme applied to console log
    142152 * @return array Log file html formatted content or false on error
    143153 */
     
    182192    }
    183193
    184     return array ( 'result' => str_replace( '<br>', '', $log_file_content), 'count' => count( $log_array ) );
     194    return array ( 'result' => str_replace( '<br>', '', $log_file_content), 'count' => ( count( $log_array ) - 1 ) );
    185195
    186196}
     
    213223
    214224/**
    215  * WpDevTool Debug Bar
    216  *
     225 * WpDevTool Debug Bar Styles
     226 *
     227 * @uses add_action() to display debug bar
    217228 * @since 0.0.1
    218229 */
     
    229240add_action( 'wp_enqueue_scripts', 'wpdevtool_debug_bar_init' );
    230241
     242/**
     243 * WpDevTool Debug Bar
     244 *
     245 * @uses apply_filters() Calls 'wpdevtol_debug_bar_content' to edit the content of debug bar
     246 * @since 0.0.1
     247 */
    231248function wpdevtool_debug_bar() {
    232249   
     
    246263
    247264/**
     265 * Redirects all emails
     266 *
     267 * Redirect all emails sent through wp_mail to a custom address
     268 *
     269 * @since 0.0.3
     270 * @param
     271 */
     272function wpdevtool_redirect_wp_mail( $email ) {
     273   
     274    if ( !get_option( 'wpdevtool_redirect_emails' ) )
     275        return $email;
     276       
     277    $email['to'] = get_option( 'wpdevtool_redirect_email' );
     278   
     279    return $email;
     280}
     281add_filter( 'wp_mail', 'wpdevtool_redirect_wp_mail' );
     282
     283/**
    248284 * Formatted version of var_dump
    249285 *
     286 * @uses apply_filters() Calls 'wpdevtool_dump_style' to edit debug bar css
    250287 * @since 0.0.2
    251288 */
    252289function wdt_dump( $var ) {
    253290   
    254     $style = apply_filters( 'wpdevtool_dump_style', 'background:rgba(0,0,0,0.6);border:3px solid #eee;outline:1px solid #fff;padding: 5px 10px;margin:10px;color:#fff;-moz-box-shadow: inset 0 0 3px #333, 0 0 4px rgba(0,0,0,0.4);-webkit-box-shadow: inset 0 0 3px #333, 0 0 4px rgba(0,0,0,0.4);box-shadow: inset 0 0 3px #333, 0 0 4px rgba(0,0,0,0.4);line-height:20px;z-index:10000;white-space:pre-wrap;overflow: auto;font-size:13px;' );
     291    $style = apply_filters( 'wpdevtool_dump_style', 'background:#111;background:rgba(0,0,0,0.6);border:3px solid #eee;outline:1px solid #fff;padding: 5px 10px;margin:10px;color:#fff;-moz-box-shadow: inset 0 0 3px #333, 0 0 4px rgba(0,0,0,0.4);-webkit-box-shadow: inset 0 0 3px #333, 0 0 4px rgba(0,0,0,0.4);box-shadow: inset 0 0 3px #333, 0 0 4px rgba(0,0,0,0.4);line-height:20px;z-index:10000;white-space:pre-wrap;overflow: auto;font-size:13px;' );
    255292   
    256293    echo('<pre class="wpdevtool_var_dump" style="' . $style . '">');
     
    279316    delete_option( 'wpdevtool_maintenance_message' );
    280317    delete_option( 'wpdevtool_debug_bar' );
     318    delete_option( 'wpdevtool_redirect_emails' );
     319    delete_option( 'wpdevtool_redirect_email' );
    281320
    282321}
Note: See TracChangeset for help on using the changeset viewer.