Changeset 654882
- Timestamp:
- 01/18/2013 02:18:56 PM (13 years ago)
- Location:
- wpdevtool/trunk
- Files:
-
- 8 edited
-
inc/help.php (modified) (1 diff)
-
langs/wpdevtool-it_IT.mo (modified) (previous)
-
langs/wpdevtool-it_IT.po (modified) (7 diffs)
-
readme.txt (modified) (5 diffs)
-
styles/style.css (modified) (1 diff)
-
views/admin.php (modified) (7 diffs)
-
views/error_log.php (modified) (1 diff)
-
wpdevtool.php (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wpdevtool/trunk/inc/help.php
r653225 r654882 22 22 define( 'WP_DEBUG_DISPLAY', FALSE ); 23 23 @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>" 25 26 ) ); 26 27 break; -
wpdevtool/trunk/langs/wpdevtool-it_IT.po
r653225 r654882 2 2 msgstr "" 3 3 "Project-Id-Version: WpDevTool\n" 4 "POT-Creation-Date: 2013-01-1 5 23:19+0100\n"5 "PO-Revision-Date: 2013-01-1 5 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" 7 7 "Language-Team: Alessandro Benoit <micc83@gmail.com>\n" 8 8 "Language: Italiano\n" … … 28 28 msgstr "%s è in manutenzione al momento. Contattaci all'indirizzo %s" 29 29 30 #: ../wpdevtool.php:1 2630 #: ../wpdevtool.php:137 31 31 msgid "is under maintenance" 32 32 msgstr "è in manutenzione" 33 33 34 #: ../wpdevtool.php:1 2834 #: ../wpdevtool.php:139 35 35 msgid "Maintenance Screen" 36 36 msgstr "Sito in Manutenzione" 37 37 38 #: ../wpdevtool.php:1 7838 #: ../wpdevtool.php:188 39 39 msgid "Something went wrong. Your log file is missing..." 40 40 msgstr "Qualcosa è andato storto. Il tuo file log è mancante..." 41 41 42 #: ../wpdevtool.php:2 0842 #: ../wpdevtool.php:218 43 43 #, php-format 44 44 msgid "Log file has been deleted. <a href=\"%s\">Go back to WpDevTool</a>" 45 45 msgstr "Il file Log è stato eliminato. <a href=\"%s\">Torna a WpDevTool</a>" 46 46 47 #: ../wpdevtool.php:2 3647 #: ../wpdevtool.php:253 48 48 #, php-format 49 49 msgid "%d query in %s secondi, memoria %s Kb" 50 50 msgstr "%d query in %s seconds, memory %s Kb" 51 51 52 #: ../wpdevtool.php:2 39 ../views/admin.php:10 ../views/admin.php:7552 #: ../wpdevtool.php:256 ../views/admin.php:10 ../views/admin.php:108 53 53 msgid "WpDevTool Options" 54 54 msgstr "Opzioni WpDevTool" 55 55 56 #: ../wpdevtool.php:2 4256 #: ../wpdevtool.php:259 57 57 msgid "WordPress Logs" 58 58 msgstr "Log di WordPress" … … 88 88 #: ../inc/credits.php:12 89 89 msgid "WordPress Codex" 90 msgstr " "90 msgstr "Codex di WordPress" 91 91 92 92 #: ../inc/help.php:18 … … 103 103 "sotto" 104 104 105 #: ../views/admin.php:49 105 #: ../inc/help.php:25 106 msgid "" 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." 110 msgstr "" 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 117 msgid "Maintenance text cant be left empty!" 118 msgstr "Il testo della pagina manutenzione non può essere lasciato vuoto!" 119 120 #: ../views/admin.php:65 121 msgid "Something went wrong with the catch all email address" 122 msgstr "Qualcosa è andato storto con l'email inserita" 123 124 #: ../views/admin.php:81 106 125 msgid "Well done!" 107 126 msgstr "Ben fatto!" 108 127 109 #: ../views/admin.php: 64 ../views/error_log.php:35128 #: ../views/admin.php:97 ../views/error_log.php:36 110 129 msgid "You do not have sufficient permissions to access this page." 111 130 msgstr "" 112 131 113 #: ../views/admin.php: 70 ../views/error_log.php:66132 #: ../views/admin.php:103 ../views/error_log.php:67 114 133 msgid "WordPress Development Tool" 115 134 msgstr "Strumenti di sviluppo WordPress" 116 135 117 #: ../views/admin.php: 82 ../views/admin.php:88 ../views/admin.php:102136 #: ../views/admin.php:116 ../views/admin.php:122 ../views/admin.php:137 118 137 msgid "Enable maintenance mode" 119 138 msgstr "Attiva modalità manutenzione" 120 139 121 #: ../views/admin.php: 83140 #: ../views/admin.php:117 122 141 msgid "Return a HTTP RESPONSE 503 (Service Temporary Unavailable) landing page" 123 142 msgstr "" … … 125 144 "Sospeso)" 126 145 127 #: ../views/admin.php: 96146 #: ../views/admin.php:131 128 147 msgid "Maintenance message" 129 148 msgstr "Messaggio manutenzione" 130 149 131 #: ../views/admin.php: 97150 #: ../views/admin.php:132 132 151 msgid "Shortcodes: <br>[email] Blog email <br>[name] Blog name" 133 152 msgstr "Codici supportati: <br>[email] Email del blog <br>[name] Nome del blog" 134 153 135 #: ../views/admin.php:1 10 ../views/admin.php:116154 #: ../views/admin.php:146 ../views/admin.php:152 136 155 msgid "Enable Debug Bar" 137 156 msgstr "Abilita la Debug Bar" 138 157 139 #: ../views/admin.php:1 11158 #: ../views/admin.php:147 140 159 msgid "Show a simple debug bar on the bottom of every template page" 141 160 msgstr "Mostra una semplice barra per il debug nel frontend" 142 161 143 #: ../views/admin.php:124 ../views/admin.php:130 162 #: ../views/admin.php:161 ../views/admin.php:167 163 msgid "Redirect all emails" 164 msgstr "Reindirizza tutte le email" 165 166 #: ../views/admin.php:162 167 msgid "Redirect all WordPress emails to a single address" 168 msgstr "Reindirizza tutte le email di WordPress ad un singolo indirizzo" 169 170 #: ../views/admin.php:176 ../views/admin.php:182 171 msgid "Catch all Email" 172 msgstr "Email" 173 174 #: ../views/admin.php:177 175 msgid "Catch all the emails sent through wp_mail()" 176 msgstr "Qui arrivano tutte le email inviate attraverso wp_mail()" 177 178 #: ../views/admin.php:191 ../views/admin.php:197 144 179 msgid "WP_DEBUG is active" 145 180 msgstr "WB_DEBUG è attivo" 146 181 147 #: ../views/admin.php:1 25182 #: ../views/admin.php:192 148 183 msgid "Check wheter you have set WP_DEBUG to TRUE" 149 184 msgstr "Controlla di aver settato WP_DEBUG a TRUE" 150 185 151 #: ../views/admin.php: 138 ../views/admin.php:144186 #: ../views/admin.php:206 ../views/admin.php:212 152 187 msgid "Logging is enabled" 153 188 msgstr "Il logging è abilitato" 154 189 155 #: ../views/admin.php: 139190 #: ../views/admin.php:207 156 191 msgid "To enable silent logging give a look to Contextual Help" 157 192 msgstr "" … … 159 194 "all'aiuto in linea" 160 195 161 #: ../views/error_log.php:12 ../views/error_log.php:7 1196 #: ../views/error_log.php:12 ../views/error_log.php:72 162 197 msgid "WpDevTool Error Log Console" 163 198 msgstr "WpDevTool Console degli errori" … … 167 202 msgstr "Console Errori" 168 203 169 #: ../views/error_log.php:7 1204 #: ../views/error_log.php:72 170 205 msgid "errors" 171 206 msgstr "errori" 172 207 173 #: ../views/error_log.php:7 8208 #: ../views/error_log.php:79 174 209 msgid "It's your lucky day... Ain't no errors!" 175 210 msgstr "E' il tuo giorno fortunato, non ci sono errori!" 176 211 177 #: ../views/error_log.php:8 8212 #: ../views/error_log.php:89 178 213 msgid "More Options" 179 214 msgstr "Più opzioni" 180 215 181 #: ../views/error_log.php:9 0216 #: ../views/error_log.php:91 182 217 msgid "Clear log file" 183 218 msgstr "Elimina il file log" 184 219 185 #: ../views/error_log.php:9 1220 #: ../views/error_log.php:92 186 221 msgid "Download log file" 187 222 msgstr "Scarica il file log" -
wpdevtool/trunk/readme.txt
r653225 r654882 7 7 Requires at least: 3.0.1 8 8 Tested up to: 3.5 9 Stable tag: 0.0. 29 Stable tag: 0.0.3 10 10 License: GPLv2 or later 11 11 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 20 20 * **Debug bar**: A simple bar which show number of query, timing and memory of current page 21 21 * **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 22 23 * **wdt_dump()**: A formatted version of var_dump() 23 24 … … 53 54 == Changelog == 54 55 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 55 62 = 0.0.2 = 56 63 * Add default options to wpdevtool_activation … … 66 73 == Upgrade Notice == 67 74 75 = 0.0.3 = 76 Fix some issues. Add redirect all email feature. Most important, fix the including of WpDevTool script on every admin page. 77 68 78 = 0.0.1 = 69 79 First release 70 71 == To Do ==72 80 73 81 == To Be == … … 78 86 * Add db table check up 79 87 * Enable advanced error tracking 88 * Add Developer User type 89 * Add hidden test posts 80 90 81 91 == Credits == -
wpdevtool/trunk/styles/style.css
r652874 r654882 7 7 .postbox {margin: 10px 0;} 8 8 .wp-editor-wrap .mceIframeContainer{background: #fff;} 9 label { 10 font-weight: 800; 11 } 12 .required_field { 13 color: #f00; 14 } 15 input.long-text { 16 width: 100%; 17 } 9 18 @media screen and (max-width:1024px) { 10 19 .postbox.left_col, .postbox.right_col {width: 100%;} -
wpdevtool/trunk/views/admin.php
r653225 r654882 31 31 32 32 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' ); 34 34 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' ); 35 37 36 38 } 37 39 add_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 */ 48 function 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 */ 63 function 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 } 38 70 39 71 /** … … 57 89 * WpDevTool Main Admin Page 58 90 * 91 * @uses do_settings_sections('wpdevtool_admin') to add custom fields to the panel 59 92 * @since 0.0.1 60 93 */ … … 78 111 <?php settings_fields( 'wpdevtool_admin-settings' ); ?> 79 112 <table class="form-table"> 113 <!-- Enable Maintenance Mode --> 80 114 <tr valign="top"> 81 115 <th scope="row"> … … 92 126 </td> 93 127 </tr> 128 <!-- Maintenance Page Text --> 94 129 <tr valign="top" <?php if ( !get_option('wpdevtool_maintenance') ) echo('style="display:none"'); ?>> 95 130 <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> 97 132 <p class="description"><?php _e( "Shortcodes: <br>[email] Blog email <br>[name] Blog name", 'wpdevtool' ); ?></p> 98 133 </th> … … 102 137 <label for="wpdevtool_maintenance_message"><?php _e( 'Enable maintenance mode', 'wpdevtool' ); ?></label> 103 138 </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 --> 108 144 <tr valign="top"> 109 145 <th scope="row"> … … 120 156 </td> 121 157 </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 --> 122 189 <tr valign="top"> 123 190 <th scope="row"> … … 134 201 </td> 135 202 </tr> 203 <!-- Check if WP_DEBUG_LOG is set to TRUE --> 136 204 <tr valign="top"> 137 205 <th scope="row"> -
wpdevtool/trunk/views/error_log.php
r653225 r654882 28 28 * WpDevTool Main Admin Page 29 29 * 30 * @uses apply_filters() Calls 'wpdevtool_error_console_colors' to apply a different log console style 30 31 * @since 0.0.1 31 32 */ -
wpdevtool/trunk/wpdevtool.php
r653225 r654882 2 2 /* 3 3 Plugin Name: WpDevTool 4 Plugin URI: 4 Plugin URI: https://github.com/micc83/WpDevTool 5 5 Description: A simple tool to develop on WordPress platform... 6 Version: 0.0. 26 Version: 0.0.3 7 7 Author: Alessandro Benoit 8 8 Author URI: http://codeb.it … … 45 45 46 46 /** 47 * Set default option values 47 * Set default option values on plugin activation 48 48 * 49 49 * @since 0.0.2 … … 53 53 if ( !get_option( 'wpdevtool_maintenance_message' ) ) 54 54 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 } 55 60 56 61 } … … 84 89 add_action( 'init', 'wpdevtool_register' ); 85 90 91 /** 92 * WpDevTool Enqueue Admin Javascript 93 * 94 * @since 0.0.2 95 */ 86 96 function wpdevtool_enqueue_admin_script() { 87 97 88 wp_enqueue_script('WpDevToolScript'); 98 if ( isset( $_GET['page'] ) && ( substr( $_GET['page'], 0, 9 ) === "wpdevtool" ) ) 99 wp_enqueue_script('WpDevToolScript'); 89 100 90 101 } … … 137 148 * 138 149 * @since 0.0.1 139 *140 150 * @param string $logfilepath Path to the log file 141 * 151 * @param string $color_scheme The color scheme applied to console log 142 152 * @return array Log file html formatted content or false on error 143 153 */ … … 182 192 } 183 193 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 ) ); 185 195 186 196 } … … 213 223 214 224 /** 215 * WpDevTool Debug Bar 216 * 225 * WpDevTool Debug Bar Styles 226 * 227 * @uses add_action() to display debug bar 217 228 * @since 0.0.1 218 229 */ … … 229 240 add_action( 'wp_enqueue_scripts', 'wpdevtool_debug_bar_init' ); 230 241 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 */ 231 248 function wpdevtool_debug_bar() { 232 249 … … 246 263 247 264 /** 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 */ 272 function 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 } 281 add_filter( 'wp_mail', 'wpdevtool_redirect_wp_mail' ); 282 283 /** 248 284 * Formatted version of var_dump 249 285 * 286 * @uses apply_filters() Calls 'wpdevtool_dump_style' to edit debug bar css 250 287 * @since 0.0.2 251 288 */ 252 289 function wdt_dump( $var ) { 253 290 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;' ); 255 292 256 293 echo('<pre class="wpdevtool_var_dump" style="' . $style . '">'); … … 279 316 delete_option( 'wpdevtool_maintenance_message' ); 280 317 delete_option( 'wpdevtool_debug_bar' ); 318 delete_option( 'wpdevtool_redirect_emails' ); 319 delete_option( 'wpdevtool_redirect_email' ); 281 320 282 321 }
Note: See TracChangeset
for help on using the changeset viewer.