Changeset 694698
- Timestamp:
- 04/09/2013 06:08:58 PM (13 years ago)
- Location:
- developer/trunk
- Files:
-
- 10 edited
-
developer.css (modified) (2 diffs)
-
developer.js (modified) (5 diffs)
-
developer.php (modified) (20 diffs)
-
languages/a8c-developer-fr_FR.mo (modified) (previous)
-
languages/a8c-developer-fr_FR.po (modified) (13 diffs)
-
readme.txt (modified) (2 diffs)
-
screenshot-1.png (modified) (previous)
-
screenshot-2.png (modified) (previous)
-
screenshot-3.png (modified) (previous)
-
screenshot-4.png (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
-
developer/trunk/developer.css
r560881 r694698 1 1 .a8c-developer-dialog { 2 2 margin: 25px; 3 } 4 5 .a8c-developer-dialog .recommended-plugins td { 6 vertical-align: top; 7 padding-bottom: 10px; 3 8 } 4 9 … … 12 17 color: maroon; 13 18 } 19 20 .a8c-developer-action-result.error { 21 color: red; 22 font-style: italic; 23 padding-left: 5px; 24 } -
developer/trunk/developer.js
r592210 r694698 6 6 href: href, 7 7 title: a8c_developer_i18n.lightbox_title, 8 innerWidth: 500,8 innerWidth: 650, 9 9 maxHeight: '100%', 10 10 transition: transition … … 61 61 .success( function( result ) { 62 62 if ( '1' === result ) { 63 $(button).html( a8c_developer_i18n.installed ); 63 $( button ) 64 .html( a8c_developer_i18n.installed ) 65 .nextAll( '.a8c-developer-action-result' ) 66 .remove(); 67 64 68 $(button).unbind('click').prop('disabled', true); 65 69 } else { 66 70 alert( result ); 67 $(button).html( a8c_developer_i18n.error ); 68 } 69 }) 70 .error( function() { 71 $(button).html( a8c_developer_i18n.error ); 71 72 $( button ) 73 .html( a8c_developer_i18n.ERROR ) 74 .nextAll( '.a8c-developer-action-result' ) 75 .remove(); 76 77 $( button ).after( '<span class="a8c-developer-action-result error">' + result + '</span>' ); 78 } 79 }) 80 .error( function( response ) { 81 $( button ) 82 .html( a8c_developer_i18n.ERROR ) 83 .nextAll( '.a8c-developer-action-result' ) 84 .remove(); 85 86 $( button ).after( '<span class="a8c-developer-action-result error">' + response.statusText + ': ' + response.responseText + '</span>' ); 72 87 }) 73 88 ; … … 86 101 .success( function( result ) { 87 102 if ( '1' === result ) { 88 $(button).html( a8c_developer_i18n.activated ); 103 $( button ) 104 .html( a8c_developer_i18n.activated ) 105 .nextAll( '.a8c-developer-action-result' ) 106 .remove(); 107 89 108 $(button).unbind('click').prop('disabled', true); 90 109 } else { 91 110 alert( result ); 92 $(button).html( a8c_developer_i18n.error ); 93 } 94 }) 95 .error( function() { 96 $(button).html( a8c_developer_i18n.error ); 97 }) 98 ; 111 112 $( button ) 113 .html( a8c_developer_i18n.ERROR ) 114 .nextAll( '.a8c-developer-action-result' ) 115 .remove(); 116 117 $( button ).after( '<span class="a8c-developer-action-result error">' + result + '</span>' ); 118 } 119 }) 120 .error( function( response ) { 121 $( button ) 122 .html( a8c_developer_i18n.ERROR ) 123 .nextAll( '.a8c-developer-action-result' ) 124 .remove(); 125 126 $( button ).after( '<span class="a8c-developer-action-result error">' + response.statusText + ': ' + response.responseText + '</span>' ); 127 }) 128 ; 129 }); 130 131 $( '.a8c-developer-button-close' ).on( 'click', function() { 132 $.colorbox.close(); 99 133 }); 100 134 })(jQuery); … … 115 149 .success( function( result ) { 116 150 if ( '1' == result ) { 117 $(button).html( a8c_developer_i18n.INSTALLED ); 118 } else { 119 $(button).html( a8c_developer_i18n.ERROR ); 120 } 121 }) 122 .error( function() { 123 $(button).html( a8c_developer_i18n.ERROR ); 151 $( button ) 152 .nextAll( '.a8c-developer-action-result' ) 153 .remove(); 154 155 $( button ).replaceWith( "<span class='a8c-developer-active'>" + a8c_developer_i18n.ACTIVE + "</span>" ); 156 } else { 157 $( button ) 158 .html( a8c_developer_i18n.ERROR ) 159 .nextAll( '.a8c-developer-action-result' ) 160 .remove(); 161 162 $( button ).after( '<span class="a8c-developer-action-result error">' + result + '</span>' ); 163 } 164 }) 165 .error( function( response ) { 166 $( button ) 167 .html( a8c_developer_i18n.ERROR ) 168 .nextAll( '.a8c-developer-action-result' ) 169 .remove(); 170 171 $( button ).after( '<span class="a8c-developer-action-result error">' + response.statusText + ': ' + response.responseText + '</span>' ); 124 172 }) 125 173 ; … … 140 188 .success( function( result ) { 141 189 if ( '1' == result ) { 142 $(button).replaceWith("<span class='a8c-developer-active'>" + a8c_developer_i18n.ACTIVE + "</span>"); 143 } else { 144 $(button).html( a8c_developer_i18n.ERROR ); 145 } 146 }) 147 .error( function() { 148 $(button).html( a8c_developer_i18n.ERROR ); 190 $( button ) 191 .nextAll( '.a8c-developer-action-result' ) 192 .remove(); 193 194 $( button ).replaceWith( "<span class='a8c-developer-active'>" + a8c_developer_i18n.ACTIVE + "</span>" ); 195 } else { 196 $( button ) 197 .html( a8c_developer_i18n.ERROR ) 198 .nextAll( '.a8c-developer-action-result' ) 199 .remove(); 200 201 $( button ).after( '<span class="a8c-developer-action-result error">' + result + '</span>' ); 202 } 203 }) 204 .error( function( response ) { 205 $( button ) 206 .html( a8c_developer_i18n.ERROR ) 207 .nextAll( '.a8c-developer-action-result' ) 208 .remove(); 209 210 $( button ).after( '<span class="a8c-developer-action-result error">' + response.statusText + ': ' + response.responseText + '</span>' ); 211 149 212 }) 150 213 ; -
developer/trunk/developer.php
r660946 r694698 6 6 Plugin URI: http://wordpress.org/extend/plugins/developer/ 7 7 Description: The first stop for every WordPress developer 8 Version: 1. 1.28 Version: 1.2 9 9 Author: Automattic 10 10 Author URI: http://automattic.com … … 25 25 public $default_settings = array(); 26 26 27 const VERSION = '1.1. 2';27 const VERSION = '1.1.6'; 28 28 const OPTION = 'a8c_developer'; 29 29 const PAGE_SLUG = 'a8c_developer'; … … 82 82 'active' => function_exists( 'zt_add_debug_bar_cron_panel' ), 83 83 ), 84 'debug-bar-extender' => array( 85 'project_type' => 'all', 86 'name' => esc_html__( 'Debug Bar Extender', 'a8c-developer' ), 87 'active' => class_exists( 'Debug_Bar_Extender' ), 88 ), 84 89 'rewrite-rules-inspector' => array( 85 90 'project_type' => 'all', … … 92 97 'active' => class_exists( 'Deprecated_Log' ), 93 98 ), 99 'log-viewer' => array( 100 'project_type' => 'all', 101 'name' => esc_html__( 'Log Viewer', 'a8c-developer' ), 102 'active' => class_exists( 'ciLogViewer' ), 103 ), 94 104 'vip-scanner' => array( 95 105 'project_type' => 'wpcom-vip', … … 97 107 'active' => class_exists( 'VIP_Scanner' ), 98 108 ), 99 /*100 109 'jetpack' => array( 101 110 'project_type' => 'wpcom-vip', … … 103 112 'active' => class_exists( 'Jetpack' ), 104 113 ), 105 /**/106 114 'grunion-contact-form' => array( 107 115 'project_type' => 'wpcom-vip', … … 156 164 'name' => esc_html__( 'Theme Test Drive', 'a8c-developer' ), 157 165 'active' => function_exists( 'TTD_filters' ), 166 'filename' => 'themedrive.php', 158 167 ), 159 168 'theme-check' => array( … … 165 174 166 175 $this->recommended_constants = array( 167 'WP_DEBUG' => __( 'Enables <a href="http://codex.wordpress.org/Debugging_in_WordPress" target="_blank">debug mode</a> which helps identify and resolve issues', 'a8c-developer' ), 168 'SAVEQUERIES' => esc_html__( 'Logs database queries to an array so you can review them. The Debug Bar plugin will list out database queries if you set this constant.', 'a8c-developer' ), 176 'WP_DEBUG' => array( 177 'project_type' => 'all', 178 'description' => __( 'Enables <a href="http://codex.wordpress.org/Debugging_in_WordPress" target="_blank">debug mode</a> which helps identify and resolve issues', 'a8c-developer' ) 179 ), 180 'SAVEQUERIES' => array( 181 'project_type' => 'all', 182 'description' => esc_html__( 'Logs database queries to an array so you can review them. The Debug Bar plugin will list out database queries if you set this constant.', 'a8c-developer' ) 183 ), 184 'JETPACK_DEV_DEBUG' => array( 185 'project_type' => 'wpcom-vip', 186 'description' => __( 'Enables <a href="http://jetpack.me/2013/03/28/jetpack-dev-mode-release/">Development Mode</a> in Jetpack for testing features without a connection to WordPress.com.', 'a8c-developer' ) 187 ) 169 188 ); 170 189 … … 292 311 $to_install_or_enable = 0; 293 312 294 foreach ( $this->recommended_plugins as $plugin_slug => $plugin_details ) { 295 if ( 'all' != $plugin_details['project_type'] && $plugin_details['project_type'] != $this->settings['project_type'] ) 296 continue; 297 313 $recommended_plugins = $this->get_recommended_plugins(); 314 315 foreach ( $recommended_plugins as $plugin_slug => $plugin_details ) { 298 316 if ( ! $plugin_details['active'] ) { 299 317 $to_install_or_enable++; … … 309 327 echo '<p>' . esc_html__( 'We recommend that you also install and activate the following plugins:', 'a8c-developer' ) . '</p>'; 310 328 311 echo '<ul>'; 312 313 foreach ( $this->recommended_plugins as $plugin_slug => $plugin_details ) { 314 if ( 'all' != $plugin_details['project_type'] && $plugin_details['project_type'] != $this->settings['project_type'] ) 315 continue; 316 329 echo '<table class="recommended-plugins">'; 330 331 foreach ( $recommended_plugins as $plugin_slug => $plugin_details ) { 317 332 if ( $plugin_details['active'] ) 318 333 continue; 319 334 335 echo '<tr>'; 336 337 $details = $this->get_plugin_details( $plugin_slug ); 338 339 if ( is_wp_error( $details ) ) 340 $details = array(); 341 342 $plugin_details = array_merge( (array) $details, array( 'slug' => $plugin_slug ), $plugin_details ); 343 344 echo '<td><strong>' . $plugin_details['name'] . '</strong></td>'; 345 346 echo '<td>'; 347 320 348 if ( $this->is_recommended_plugin_installed( $plugin_slug ) ) { 321 349 $path = $this->get_path_for_recommended_plugin( $plugin_slug ); 322 echo '<li>' . $plugin_details['name'] . ' <button type="button" class="a8c-developer-button-activate" data-path="' . esc_attr( $path ) . '" data-nonce="' . wp_create_nonce( 'a8c_developer_activate_plugin_' . $path ) . '">' . esc_html__( 'Activate', 'a8c-developer' ) . '</button></li>'; 350 351 echo '<button type="button" class="a8c-developer-button-activate" data-path="' . esc_attr( $path ) . '" data-nonce="' . wp_create_nonce( 'a8c_developer_activate_plugin_' . $path ) . '">' . esc_html__( 'Activate', 'a8c-developer' ) . '</button>'; 323 352 } else { 324 echo '< li>' . $plugin_details['name'] . ' <button type="button" class="a8c-developer-button-install" data-pluginslug="' . esc_attr( $plugin_slug ) . '" data-nonce="' . wp_create_nonce( 'a8c_developer_install_plugin_' . $plugin_slug ) . '">' . esc_html__( 'Install', 'a8c-developer' ) . '</button></li>';353 echo '<button type="button" class="a8c-developer-button-install" data-pluginslug="' . esc_attr( $plugin_slug ) . '" data-nonce="' . wp_create_nonce( 'a8c_developer_install_plugin_' . $plugin_slug ) . '">' . esc_html__( 'Install', 'a8c-developer' ) . '</button>'; 325 354 } 355 356 if ( ! empty( $plugin_details['short_description'] ) ) 357 echo '<br /><span class="description">' . esc_html__( $plugin_details['short_description'] ) . '</span>'; 358 359 echo '</td>'; 360 361 echo '</tr>'; 326 362 } 327 363 328 echo '</ul>'; 364 echo '<tr><td colspan="2"><button type="button" class="button button-primary a8c-developer-button-close">' . esc_html__( 'Get Developing!', 'a8c-developer' ) . '</button></td></tr>'; 365 366 echo '</table>'; 329 367 330 368 echo '<script type="text/javascript">a8c_developer_bind_events();</script>'; … … 346 384 347 385 if ( is_wp_error( $api ) ) 348 die( sprintf( __( 'ERROR: Error fetching plugin information: %s', 'a8c-developer' ), $api->get_error_message( $api) ) );386 die( sprintf( __( 'ERROR: Error fetching plugin information: %s', 'a8c-developer' ), $api->get_error_message() ) ); 349 387 350 388 $upgrader = new Plugin_Upgrader( new Automattic_Developer_Empty_Upgrader_Skin( array( … … 357 395 358 396 if ( ! $install_result || is_wp_error( $install_result ) ) 359 die( sprintf( __( 'ERROR: Failed to install plugin: %s', 'a8c-developer' ), $install_result->get_error_message( $install_result) ) );397 die( sprintf( __( 'ERROR: Failed to install plugin: %s', 'a8c-developer' ), $install_result->get_error_message() ) ); 360 398 361 399 $activate_result = activate_plugin( $this->get_path_for_recommended_plugin( $_POST['plugin_slug'] ) ); 362 400 363 401 if ( is_wp_error( $activate_result ) ) 364 die( sprintf( __( 'ERROR: Failed to activate plugin: %s', 'a8c-developer' ), $activate_result->get_error_message( $activate_result) ) );402 die( sprintf( __( 'ERROR: Failed to activate plugin: %s', 'a8c-developer' ), $activate_result->get_error_message() ) ); 365 403 366 404 exit( '1' ); … … 378 416 379 417 if ( is_wp_error( $activate_result ) ) 380 die( sprintf( __( 'ERROR: Failed to activate plugin: %s', 'a8c-developer' ), $activate_result->get_error_message( $activate_result) ) );418 die( sprintf( __( 'ERROR: Failed to activate plugin: %s', 'a8c-developer' ), $activate_result->get_error_message() ) ); 381 419 382 420 exit( '1' ); … … 403 441 // Plugins 404 442 add_settings_section( 'a8c_developer_plugins', esc_html__( 'Plugins', 'a8c-developer' ), array( $this, 'settings_section_plugins' ), self::PAGE_SLUG . '_status' ); 405 foreach ( $this->recommended_plugins as $plugin_slug => $plugin_details ) { 406 if ( 'all' != $plugin_details['project_type'] && $plugin_details['project_type'] != $this->settings['project_type'] ) 407 continue; 408 409 $plugin_details = array_merge( array( 'slug' => $plugin_slug ), $plugin_details ); 410 add_settings_field( 'a8c_developer_plugin_' . $plugin_slug, $plugin_details['name'], array( $this, 'settings_field_plugin' ), self::PAGE_SLUG . '_status', 'a8c_developer_plugins', $plugin_details ); 443 444 wp_enqueue_script( 'plugin-install' ); 445 446 add_thickbox(); 447 448 $recommended_plugins = $this->get_recommended_plugins(); 449 450 foreach ( $recommended_plugins as $plugin_slug => $plugin_details ) { 451 $details = $this->get_plugin_details( $plugin_slug ); 452 453 if ( is_wp_error( $details ) ) 454 $details = array(); 455 456 $plugin_details = array_merge( (array) $details, array( 'slug' => $plugin_slug ), $plugin_details ); 457 458 $label = '<strong>' . esc_html( $plugin_details['name'] ) . '</strong>'; 459 460 $label .= '<br /><a href="' . self_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $plugin_slug . 461 '&TB_iframe=true&width=600&height=550' ) . '" class="thickbox" title="' . 462 esc_attr( sprintf( __( 'More information about %s' ), $plugin_details['name'] ) ) . '">' . __( 'Details' ) . '</a>'; 463 464 add_settings_field( 'a8c_developer_plugin_' . $plugin_slug, $label, array( $this, 'settings_field_plugin' ), self::PAGE_SLUG . '_status', 'a8c_developer_plugins', $plugin_details ); 411 465 } 412 466 413 467 // Constants 414 468 add_settings_section( 'a8c_developer_constants', esc_html__( 'Constants', 'a8c-developer' ), array( $this, 'settings_section_constants' ), self::PAGE_SLUG . '_status' ); 415 foreach ( $this->recommended_constants as $constant => $description ) { 469 470 $recommended_constants = $this->get_recommended_constants(); 471 472 foreach ( $recommended_constants as $constant => $constant_details ) { 416 473 add_settings_field( 'a8c_developer_constant_' . $constant, $constant, array( $this, 'settings_field_constant' ), self::PAGE_SLUG . '_status', 'a8c_developer_constants', array( 417 474 'constant' => $constant, 418 'description' => $ description,475 'description' => $constant_details['description'], 419 476 ) ); 420 477 } … … 434 491 435 492 if ( 'wpcom-vip' == $this->settings['project_type'] ) 436 add_settings_field( 'a8c_developer_setting_vip_ lobby', esc_html__( 'VIP Lobby', 'a8c-developer' ), array( $this, 'settings_field_setting_resource_vip_lobby' ), self::PAGE_SLUG . '_status', 'a8c_developer_resources' );493 add_settings_field( 'a8c_developer_setting_vip_docs', esc_html__( 'VIP Docs', 'a8c-developer' ), array( $this, 'settings_field_setting_resource_vip_docs' ), self::PAGE_SLUG . '_status', 'a8c_developer_resources' ); 437 494 438 495 if ( in_array( $this->settings['project_type'], array( 'wporg-theme', 'wpcom-vip' ) ) ) … … 504 561 if ( current_user_can('activate_plugins') ) { 505 562 $path = $this->get_path_for_recommended_plugin( $args['slug'] ); 506 echo '<a class="a8c-developer-notactive a8c-developer-button-activate" href="' . esc_url( wp_nonce_url( admin_url( 'plugins.php?action=activate&plugin=' . $path ), 'activate-plugin_' . $path ) ) . '" data-path="' . esc_attr( $path ) . '" data-nonce="' . wp_create_nonce( 'a8c_developer_activate_plugin_' . $path ) . '" title="' . esc_attr__( 'Click here to activate', 'a8c-developer' ) . '">' . esc_html__( 'INACTIVE', 'a8c-developer' ) . ' </a>';563 echo '<a class="a8c-developer-notactive a8c-developer-button-activate" href="' . esc_url( wp_nonce_url( admin_url( 'plugins.php?action=activate&plugin=' . $path ), 'activate-plugin_' . $path ) ) . '" data-path="' . esc_attr( $path ) . '" data-nonce="' . wp_create_nonce( 'a8c_developer_activate_plugin_' . $path ) . '" title="' . esc_attr__( 'Click here to activate', 'a8c-developer' ) . '">' . esc_html__( 'INACTIVE', 'a8c-developer' ) . ' - <em>' . esc_html__( 'Click to Activate', 'a8c-developer' ) . '</em></a>'; 507 564 } else { 508 565 echo '<span class="a8c-developer-notactive">' . esc_html__( 'INACTIVE', 'a8c-developer' ) . '</span>'; … … 511 568 // Needs to be installed 512 569 if ( current_user_can('install_plugins') ) { 513 echo '<a class="a8c-developer-notactive a8c-developer-button-install" href="' . esc_url( wp_nonce_url( admin_url( 'update.php?action=install-plugin&plugin=' . $args['slug'] ), 'install-plugin_' . $args['slug'] ) ) . '" data-pluginslug="' . esc_attr( $args['slug'] ) . '" data-nonce="' . wp_create_nonce( 'a8c_developer_install_plugin_' . $args['slug'] ) . '" title="' . esc_attr__( 'Click here to install', 'a8c-developer' ) . '">' . esc_html__( 'NOT INSTALLED', 'a8c-developer' ) . ' </a>';570 echo '<a class="a8c-developer-notactive a8c-developer-button-install" href="' . esc_url( wp_nonce_url( admin_url( 'update.php?action=install-plugin&plugin=' . $args['slug'] ), 'install-plugin_' . $args['slug'] ) ) . '" data-pluginslug="' . esc_attr( $args['slug'] ) . '" data-nonce="' . wp_create_nonce( 'a8c_developer_install_plugin_' . $args['slug'] ) . '" title="' . esc_attr__( 'Click here to install', 'a8c-developer' ) . '">' . esc_html__( 'NOT INSTALLED', 'a8c-developer' ) . ' - <em>' . esc_html__( 'Click to Install', 'a8c-developer' ) . '</em></a>'; 514 571 } else { 515 572 echo '<span class="a8c-developer-notactive">' . esc_html__( 'NOT INSTALLED', 'a8c-developer' ) . '</span>'; 516 573 } 517 574 } 575 576 if ( ! empty( $args['short_description'] ) ) 577 echo '<br /><span class="description">' . $args['short_description'] . '</span>'; 518 578 } 519 579 … … 560 620 echo '<span class="a8c-developer-active">' . esc_html__( 'ENABLED', 'a8c-developer' ) . '</span>'; 561 621 } else { 562 echo '<a href="http:// lobby.vip.wordpress.com/getting-started/development-environment/#plugins-and-helper-functions" class="a8c-developer-notactive">' . esc_html__( 'DISABLED', 'a8c-developer' ) . '</a>';622 echo '<a href="http://vip.wordpress.com/documentation/development-environment/#plugins-and-helper-functions" class="a8c-developer-notactive">' . esc_html__( 'DISABLED', 'a8c-developer' ) . '</a>'; 563 623 } 564 624 } … … 570 630 } 571 631 572 public function settings_field_setting_resource_vip_ lobby() {573 _e( "The <a href='http:// lobby.vip.wordpress.com'>VIP Lobby</a> is a technical documentationresource for developing sites on WordPress.com including best practices and helpful tips to help you code better, faster, and stronger.", 'a8c-developer' );632 public function settings_field_setting_resource_vip_docs() { 633 _e( "The <a href='http://vip.wordpress.com/documentation/'>VIP Documentation</a> is a technical resource for developing sites on WordPress.com including best practices and helpful tips to help you code better, faster, and stronger.", 'a8c-developer' ); 574 634 } 575 635 … … 618 678 if ( $this->is_recommended_plugin_active( $slug ) || file_exists( WP_PLUGIN_DIR . '/' . $this->get_path_for_recommended_plugin( $slug ) ) ) 619 679 return true; 680 681 return false; 682 } 683 684 /** 685 * Retrieve plugin information for a given $slug 686 * 687 * Note that this does not use plugins_api(), as the .org api does not return 688 * short descriptions in POST requests (that api endpoint is different from this one) 689 * 690 * @param string $slug The plugin slug 691 * @return object The response object containing plugin details 692 */ 693 public function get_plugin_details( $slug ){ 694 $cache_key = 'a8c_developer_plugin_details_' . $slug; 695 696 if ( false === ( $details = get_transient( $cache_key ) ) ) { 697 $request = wp_remote_get( 'http://api.wordpress.org/plugins/info/1.0/' . esc_url( $slug ), array( 'timeout' => 15 ) ); 698 699 if ( is_wp_error( $request ) ) { 700 $details = new WP_Error('a8c_developer_plugins_api_failed', __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="http://wordpress.org/support/">support forums</a>.' ), $request->get_error_message() ); 701 } else { 702 $details = maybe_unserialize( wp_remote_retrieve_body( $request ) ); 703 704 if ( ! is_object( $details ) && ! is_array( $details ) ) 705 $details = new WP_Error('a8c_developer_plugins_api_failed', __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="http://wordpress.org/support/">support forums</a>.' ), wp_remote_retrieve_body( $request ) ); 706 else 707 set_transient( $cache_key, $details, WEEK_IN_SECONDS ); 708 } 709 } 710 711 return $details; 712 } 713 714 /** 715 * Return an array of all plugins recommended for the current project type 716 * 717 * Only returns plugins that have been recommended for the project type defined 718 * in $this->settings['project_type'] 719 * 720 * @return array An array of plugins recommended for the current project type 721 */ 722 public function get_recommended_plugins() { 723 return $this->get_recommended_plugins_by_type( $this->settings['project_type'] ); 724 } 725 726 /** 727 * Return an array of all plugins recommended for the given project type 728 * 729 * @param string $type The project type to return plugins for 730 * @return array An associative array of plugins for the project type 731 */ 732 public function get_recommended_plugins_by_type( $type ) { 733 $plugins_by_type = array(); 734 735 foreach( $this->recommended_plugins as $plugin_slug => $plugin_details ) { 736 if ( ! $this->plugin_is_recommended_for_project_type( $plugin_slug, $type ) ) 737 continue; 738 739 $plugins_by_type[ $plugin_slug ] = $plugin_details; 740 } 741 742 return $plugins_by_type; 743 } 744 745 /** 746 * Should the given plugin be recommended for the given project type? 747 * 748 * Determines whether or not a given $plugin_slug is recommended for a given $project_type 749 * by checking the project types defined for it 750 * 751 * @param string $plugin_slug The plugin slug to check 752 * @param string $project_type The project type to check the plugin against 753 * @return bool Boolean indicating if the plugin is recommended for the project type 754 */ 755 public function plugin_is_recommended_for_project_type( $plugin_slug, $project_type = null ) { 756 if ( null == $project_type ) 757 $project_type = $this->settings['project_type']; 758 759 $plugin_details = $this->recommended_plugins[ $plugin_slug ]; 760 761 if ( 'all' === $plugin_details['project_type'] || 762 $plugin_details['project_type'] === $project_type || 763 ( is_array( $plugin_details['project_type'] ) && in_array( $project_type, $plugin_details['project_type'] ) ) ) 764 return true; 765 766 return false; 767 } 768 769 /** 770 * Return an array of all constants recommended for the current project type 771 * 772 * Only returns constants that have been recommended for the project type defined 773 * in $this->settings['project_type'] 774 * 775 * @return array An array of constants recommended for the current project type 776 */ 777 public function get_recommended_constants() { 778 return $this->get_recommended_constants_by_type( $this->settings['project_type'] ); 779 } 780 781 /** 782 * Return an array of all constants recommended for the given project type 783 * 784 * @param string $type The project type to return constants for 785 * @return array An associative array of constants for the project type 786 */ 787 public function get_recommended_constants_by_type( $type ) { 788 $constants_by_type = array(); 789 790 foreach( $this->recommended_constants as $constant => $constant_details ) { 791 if ( ! $this->constant_is_recommended_for_project_type( $constant, $type ) ) 792 continue; 793 794 $constants_by_type[ $constant ] = $constant_details; 795 } 796 797 return $constants_by_type; 798 } 799 800 /** 801 * Should the given constant be recommended for the given project type? 802 * 803 * Determines whether or not a given $constant is recommended for a given $project_type 804 * by checking the project types defined for it 805 * 806 * @param string $constant The constant to check 807 * @param string $project_type The project type to check the constant against 808 * @return bool Boolean indicating if the constant is recommended for the project type 809 */ 810 public function constant_is_recommended_for_project_type( $constant, $project_type = null ) { 811 if ( null == $project_type ) 812 $project_type = $this->settings['project_type']; 813 814 $constant_details = $this->recommended_constants[ $constant ]; 815 816 if ( 'all' === $constant_details['project_type'] || 817 $constant_details['project_type'] === $project_type || 818 ( is_array( $constant_details['project_type'] ) && in_array( $project_type, $constant_details['project_type'] ) ) ) 819 return true; 620 820 621 821 return false; -
developer/trunk/languages/a8c-developer-fr_FR.po
r660946 r694698 2 2 msgstr "" 3 3 "Project-Id-Version: Developer\n" 4 "Report-Msgid-Bugs-To: \n"5 "POT-Creation-Date: 2013-01-1 4 08:08+0100\n"6 "PO-Revision-Date: 2013-0 1-15 09:46+0100\n"4 "Report-Msgid-Bugs-To: http://wordpress.org/tag/developer\n" 5 "POT-Creation-Date: 2013-01-13 22:21:53+00:00\n" 6 "PO-Revision-Date: 2013-02-04 15:14+0100\n" 7 7 "Last-Translator: FxB <fx@fxbenard.com>\n" 8 8 "Language-Team: FxB <fx@fxbenard.com>\n" … … 19 19 "X-Poedit-SearchPath-0: .\n" 20 20 21 #: developer.php:7 821 #: developer.php:70 22 22 msgid "Debug Bar" 23 23 msgstr "Debug Bar" 24 24 25 #: developer.php: 8325 #: developer.php:75 26 26 msgid "Debug Bar Cron" 27 27 msgstr "Debug Bar Cron" 28 28 29 #: developer.php:8 829 #: developer.php:80 30 30 msgid "Rewrite Rules Inspector" 31 31 msgstr "Rewrite Rules Inspector" 32 32 33 #: developer.php: 9333 #: developer.php:85 34 34 msgid "Log Deprecated Notices" 35 35 msgstr "Log Deprecated Notices" 36 36 37 #: developer.php:9 837 #: developer.php:90 38 38 msgid "VIP Scanner" 39 39 msgstr "VIP Scanner" 40 40 41 #: developer.php:1 1041 #: developer.php:102 42 42 msgid "Grunion Contact Form" 43 43 msgstr "Grunion Contact Form" 44 44 45 #: developer.php:1 1545 #: developer.php:107 46 46 msgid "Polldaddy Polls & Ratings" 47 47 msgstr "Polldaddy Polls & Ratings" 48 48 49 #: developer.php:1 2049 #: developer.php:112 50 50 msgid "Monster Widget" 51 51 msgstr "Monster Widget" 52 52 53 #: developer.php:1 2553 #: developer.php:117 54 54 msgid "User Switching" 55 55 msgstr "User Switching" 56 56 57 #: developer.php:1 3057 #: developer.php:122 58 58 msgid "Pig Latin" 59 59 msgstr "Pig Latin" 60 60 61 #: developer.php:1 3561 #: developer.php:127 62 62 msgid "Beta Tester" 63 63 msgstr "Beta Tester" 64 64 65 #: developer.php:1 4365 #: developer.php:135 66 66 msgid "RTL Tester" 67 67 msgstr "RTL Tester" 68 68 69 #: developer.php:14 869 #: developer.php:140 70 70 msgid "Regenerate Thumbnails" 71 71 msgstr "Regenerate Thumbnails" 72 72 73 #: developer.php:1 5373 #: developer.php:145 74 74 msgid "Reveal IDs" 75 75 msgstr "Reveal IDs" 76 76 77 #: developer.php:15 877 #: developer.php:150 78 78 msgid "Theme Test Drive" 79 79 msgstr "Theme Test Drive" 80 80 81 #: developer.php:1 6381 #: developer.php:155 82 82 msgid "Theme Check" 83 83 msgstr "Theme Check" 84 84 85 #: developer.php:16 985 #: developer.php:161 86 86 msgid "" 87 87 "Enables <a href=\"http://codex.wordpress.org/Debugging_in_WordPress\" target=" … … 92 92 "problèmes" 93 93 94 #: developer.php:1 7094 #: developer.php:162 95 95 msgid "" 96 96 "Logs database queries to an array so you can review them. The Debug Bar " … … 101 101 "de bases de données si vous définissez cette constante." 102 102 103 #: developer.php:17 9103 #: developer.php:172 104 104 msgid "Developer: Plugin Setup" 105 105 msgstr "Developer : Réglages de l'extension" 106 106 107 #: developer.php:1 80107 #: developer.php:173 108 108 msgid "Saving..." 109 109 msgstr "Enregistrement en cours..." 110 110 111 #: developer.php:1 81111 #: developer.php:174 112 112 msgid "Installing..." 113 113 msgstr "Installation..." 114 114 115 #: developer.php:1 82115 #: developer.php:175 116 116 msgid "Installed" 117 117 msgstr "Installé" 118 118 119 #: developer.php:1 83119 #: developer.php:176 120 120 msgid "Activating..." 121 121 msgstr "Activation..." 122 122 123 #: developer.php:1 84123 #: developer.php:177 124 124 msgid "Activated" 125 125 msgstr "Activé" 126 126 127 #: developer.php:1 85127 #: developer.php:178 128 128 msgid "Error!" 129 129 msgstr "Erreur !" 130 130 131 #: developer.php:1 86 developer.php:503131 #: developer.php:179 developer.php:500 132 132 msgid "ACTIVE" 133 133 msgstr "ACTIVÉ" 134 134 135 #: developer.php:18 7135 #: developer.php:180 136 136 msgid "INSTALLED" 137 137 msgstr "INSTALLÉ" 138 138 139 #: developer.php:18 8139 #: developer.php:181 140 140 msgid "ERROR!" 141 141 msgstr "ERREUR !" 142 142 143 #: developer.php:19 7143 #: developer.php:193 144 144 msgid "Settings saved." 145 145 msgstr "Réglages enregistrés." 146 146 147 #: developer.php: 202147 #: developer.php:199 148 148 msgid "Error saving settings. Please try again." 149 149 msgstr "" … … 151 151 "réessayer plus tard." 152 152 153 #: developer.php:2 11 developer.php:450153 #: developer.php:208 developer.php:447 154 154 msgid "Developer Helper" 155 155 msgstr "Developer Helper" 156 156 157 #: developer.php:211 developer.php:221 157 #. #-#-#-#-# plugin.pot (Developer 1.1.1) #-#-#-#-# 158 #. Plugin Name of the plugin/theme 159 #: developer.php:208 developer.php:218 158 160 msgid "Developer" 159 161 msgstr "Developer" 160 162 161 #: developer.php:22 5163 #: developer.php:222 162 164 msgid "View the Developer Helper settings and status page" 163 165 msgstr "Afficher les réglages et la page d'état de Developer Helper" 164 166 165 #: developer.php:2 51167 #: developer.php:248 166 168 msgid "Thanks for installing the Developer Helper plugin!" 167 169 msgstr "Merci d'avoir installé l'extension Developer Helper !" 168 170 169 #: developer.php:25 3171 #: developer.php:250 170 172 msgid "Before we begin, what type of website are you developing?" 171 173 msgstr "Avant de commencer, quel type de site web developpez-vous ?" 172 174 173 #: developer.php:30 9 developer.php:406175 #: developer.php:306 developer.php:403 174 176 msgid "Plugins" 175 177 msgstr "Extensions" 176 178 177 #: developer.php:3 11179 #: developer.php:308 178 180 msgid "We recommend that you also install and activate the following plugins:" 179 181 msgstr "" … … 181 183 "suivantes :" 182 184 183 #: developer.php:32 4185 #: developer.php:321 184 186 msgid "Activate" 185 187 msgstr "Activer" 186 188 187 #: developer.php:32 6189 #: developer.php:323 188 190 msgid "Install" 189 191 msgstr "Installer" 190 192 191 #: developer.php:33 8 developer.php:372193 #: developer.php:335 developer.php:369 192 194 msgid "ERROR: No slug was passed to the AJAX callback." 193 195 msgstr "ERREUR : Aucun identifiant n'a été passé au rappel AJAX." 194 196 195 #: developer.php:34 3197 #: developer.php:340 196 198 msgid "ERROR: You lack permissions to install and/or activate plugins." 197 199 msgstr "" … … 199 201 "extensions." 200 202 201 #: developer.php:350 202 #, php-format 203 #: developer.php:347 203 204 msgid "ERROR: Error fetching plugin information: %s" 204 205 msgstr "ERREUR : Erreur de récupération des informations de l'extension :%s" 205 206 206 #: developer.php:361 207 #, php-format 207 #: developer.php:358 208 208 msgid "ERROR: Failed to install plugin: %s" 209 209 msgstr "ERREUR : Impossible d'installer l'extension : %s" 210 210 211 #: developer.php:366 developer.php:382 212 #, php-format 211 #: developer.php:363 developer.php:379 213 212 msgid "ERROR: Failed to activate plugin: %s" 214 213 msgstr "ERREUR : Impossible d'activer l'extension : %s" 215 214 216 #: developer.php:37 7215 #: developer.php:374 217 216 msgid "ERROR: You lack permissions to activate plugins." 218 217 msgstr "ERREUR : Vous n'avez pas d'autorisation pour installer des extensions." 219 218 220 #: developer.php:3 92219 #: developer.php:389 221 220 msgid "Main Configuration" 222 221 msgstr "Configuration principale" 223 222 224 #: developer.php:39 3223 #: developer.php:390 225 224 msgid "Project Type" 226 225 msgstr "Type de projet" 227 226 228 #: developer.php:41 6227 #: developer.php:413 229 228 msgid "Constants" 230 229 msgstr "Constantes" 231 230 232 #: developer.php:42 5231 #: developer.php:422 233 232 msgid "Settings" 234 233 msgstr "Réglages" 235 234 236 #: developer.php:42 6235 #: developer.php:423 237 236 msgid "Pretty Permalinks" 238 237 msgstr "Pretty Permalinks" 239 238 240 #: developer.php:42 8239 #: developer.php:425 241 240 msgid "Development Version" 242 241 msgstr "Version de Développement" 243 242 244 #: developer.php:42 9243 #: developer.php:426 245 244 msgid "Shared Plugins" 246 245 msgstr "Extensions partagées" 247 246 248 #: developer.php:43 3247 #: developer.php:430 249 248 msgid "Resources" 250 249 msgstr "Ressources" 251 250 252 #: developer.php:43 5251 #: developer.php:432 253 252 msgid "Codex" 254 253 msgstr "Codex" 255 254 256 #: developer.php:43 8255 #: developer.php:435 257 256 msgid "VIP Lobby" 258 257 msgstr "VIP Lobby" 259 258 260 #: developer.php:4 41259 #: developer.php:438 261 260 msgid "Starter Themes" 262 261 msgstr "Starter Themes" 263 262 264 #: developer.php:49 8263 #: developer.php:495 265 264 msgid "We recommend you have the following plugins installed:" 266 265 msgstr "Nous vous recommandons d'avoir installé les extensions suivantes :" 267 266 268 #: developer.php:50 8267 #: developer.php:505 269 268 msgid "Click here to activate" 270 269 msgstr "Cliquez ici pour activer." 271 270 272 #: developer.php:50 8 developer.php:510271 #: developer.php:505 developer.php:507 273 272 msgid "INACTIVE" 274 273 msgstr "INACTIF" 275 274 276 #: developer.php:51 5275 #: developer.php:512 277 276 msgid "Click here to install" 278 277 msgstr "Cliquez ici pour installer." 279 278 280 #: developer.php:51 5 developer.php:517279 #: developer.php:512 developer.php:514 281 280 msgid "NOT INSTALLED" 282 281 msgstr "NON INSTALLÉ" 283 282 284 #: developer.php:52 3283 #: developer.php:520 285 284 msgid "" 286 285 "We recommend you set the following constants to <code>true</code> in your " … … 292 291 "wordpress.org/Editing_wp-config.php\" target=\"_blank\">Besoin d'aide ?</a>" 293 292 294 #: developer.php:52 8293 #: developer.php:525 295 294 msgid "SET" 296 295 msgstr "DÉFINI" 297 296 298 #: developer.php:5 30297 #: developer.php:527 299 298 msgid "NOT SET" 300 299 msgstr "NON CONFIGURÉ" 301 300 302 #: developer.php:53 9301 #: developer.php:536 303 302 msgid "We recommend the following settings and configurations." 304 303 msgstr "Nous vous recommandons les réglages et configurations suivantes :" 305 304 306 #: developer.php:54 4 developer.php:554 developer.php:562305 #: developer.php:541 developer.php:551 developer.php:559 307 306 msgid "ENABLED" 308 307 msgstr "ACTIVÉ" 309 308 310 #: developer.php:54 6 developer.php:556 developer.php:564309 #: developer.php:543 developer.php:553 developer.php:561 311 310 msgid "DISABLED" 312 311 msgstr "DÉSACTIVÉ" 313 312 314 #: developer.php:54 6313 #: developer.php:543 315 314 msgid "" 316 315 "<a href=\"http://codex.wordpress.org/Using_Permalinks\" target=\"_blank" … … 320 319 "\">Besoin d'aide ?</a>" 321 320 322 #: developer.php:5 71321 #: developer.php:568 323 322 msgid "" 324 323 "The <a href='http://codex.wordpress.org/Developer_Documentation'>Developer " … … 331 330 "étendre ou contribuer à WordPress." 332 331 333 #: developer.php:57 5332 #: developer.php:572 334 333 msgid "" 335 334 "The <a href='http://lobby.vip.wordpress.com'>VIP Lobby</a> is a technical " … … 342 341 "coder mieux et plus vite." 343 342 344 #: developer.php:57 9343 #: developer.php:576 345 344 msgid "" 346 345 "<a href='http://underscores.me'>_s (or underscores)</a>: a starter theme " … … 352 351 "pour créer le plus impressionnant prochain thème pour WordPress." 353 352 354 #: developer.php:62 8353 #: developer.php:625 355 354 msgid "Plugin for a self-hosted WordPress installation" 356 355 msgstr "Extension pour une installation auto-hébergé de WordPress" 357 356 358 #: developer.php:62 9357 #: developer.php:626 359 358 msgid "Theme for a self-hosted WordPress installation" 360 359 msgstr "Thème pour une installation auto-hébergé de WordPress" 361 360 362 #: developer.php:6 30361 #: developer.php:627 363 362 msgid "" 364 363 "Theme for a <a href=\"http://vip.wordpress.com\" target=\"_blank\">WordPress." … … 367 366 "Theme pour un site <a href=\"http://vip.wordpress.com\" target=\"_blank" 368 367 "\">WordPress.com VIP</a>" 368 369 #. Plugin URI of the plugin/theme 370 msgid "http://wordpress.org/extend/plugins/developer/" 371 msgstr "http://wordpress.org/extend/plugins/developer/" 372 373 #. Description of the plugin/theme 374 msgid "The first stop for every WordPress developer" 375 msgstr "La première étape pour tous les développeurs WordPress" 376 377 #. Author of the plugin/theme 378 msgid "Automattic" 379 msgstr "Automattic" 380 381 #. Author URI of the plugin/theme 382 msgid "http://automattic.com" 383 msgstr "http://automattic.com" -
developer/trunk/readme.txt
r694696 r694698 1 1 === Developer === 2 Contributors: automattic, batmoo, Viper007Bond, nbachiyski, tott, danielbachhuber, betzster, nprasath002 2 Contributors: automattic, batmoo, Viper007Bond, nbachiyski, tott, danielbachhuber, betzster, nprasath002, nickdaugherty 3 3 Tags: developer, development, local 4 4 Requires at least: 3.4 5 Tested up to: 3. 5.15 Tested up to: 3.6 6 6 Stable tag: 1.2 7 7 License: GPLv2 or later … … 41 41 == Changelog == 42 42 43 = 1.1.6 (2013-04-08) = 44 * Made purpose of activate/install links on Settings page more obvious 45 * Added link to full plugin details on Settings page (opens in Thickbox) 46 47 = 1.1.5 (2013-04-05) = 48 * Added ability to define multiple project types for plugins 49 * Added ability to define project types for constants 50 * Added Jetpack to recommended plugins and constants 51 52 = 1.1.4 (2013-04-03) = 53 * Added plugin descriptions to installation and settings pages 54 55 = 1.1.3 (2013-04-02) = 56 * Added improved error reporting 57 * Added [Log Viewer](http://wordpress.org/extend/plugins/log-viewer/) to recommended plugins. Props to @rockaut for the suggestion 58 43 59 = 1.1.2 (2013-01-29) = 44 60 * French localization. Props [fxbenard](https://github.com/fxbenard)
Note: See TracChangeset
for help on using the changeset viewer.