Changeset 37714 for trunk/src/wp-admin/includes/plugin-install.php
- Timestamp:
- 06/15/2016 04:36:07 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/plugin-install.php
r37488 r37714 541 541 542 542 ?> 543 543 <div id="<?php echo $_tab; ?>-content" class='<?php echo $_with_banner; ?>'> 544 544 <div class="fyi"> 545 545 <ul> 546 <?php if ( ! empty( $api->version ) ) { ?> 547 <li><strong><?php _e( 'Version:' ); ?></strong> <?php echo $api->version; ?></li> 548 <?php } if ( ! empty( $api->author ) ) { ?> 549 <li><strong><?php _e( 'Author:' ); ?></strong> <?php echo links_add_target( $api->author, '_blank' ); ?></li> 550 <?php } if ( ! empty( $api->last_updated ) ) { ?> 551 <li><strong><?php _e( 'Last Updated:' ); ?></strong> 552 <?php printf( __( '%s ago' ), human_time_diff( strtotime( $api->last_updated ) ) ); ?> 553 </li> 554 <?php } if ( ! empty( $api->requires ) ) { ?> 555 <li><strong><?php _e( 'Requires WordPress Version:' ); ?></strong> <?php printf( __( '%s or higher' ), $api->requires ); ?></li> 556 <?php } if ( ! empty( $api->tested ) ) { ?> 557 <li><strong><?php _e( 'Compatible up to:' ); ?></strong> <?php echo $api->tested; ?></li> 558 <?php } if ( ! empty( $api->active_installs ) ) { ?> 559 <li><strong><?php _e( 'Active Installs:' ); ?></strong> <?php 560 if ( $api->active_installs >= 1000000 ) { 561 _ex( '1+ Million', 'Active plugin installs' ); 562 } else { 563 echo number_format_i18n( $api->active_installs ) . '+'; 564 } 565 ?></li> 566 <?php } if ( ! empty( $api->slug ) && empty( $api->external ) ) { ?> 567 <li><a target="_blank" href="https://wordpress.org/plugins/<?php echo $api->slug; ?>/"><?php _e( 'WordPress.org Plugin Page »' ); ?></a></li> 568 <?php } if ( ! empty( $api->homepage ) ) { ?> 569 <li><a target="_blank" href="<?php echo esc_url( $api->homepage ); ?>"><?php _e( 'Plugin Homepage »' ); ?></a></li> 570 <?php } if ( ! empty( $api->donate_link ) && empty( $api->contributors ) ) { ?> 571 <li><a target="_blank" href="<?php echo esc_url( $api->donate_link ); ?>"><?php _e( 'Donate to this plugin »' ); ?></a></li> 572 <?php } ?> 546 <?php if ( ! empty( $api->version ) ) { ?> 547 <li><strong><?php _e( 'Version:' ); ?></strong> <?php echo $api->version; ?></li> 548 <?php } if ( ! empty( $api->author ) ) { ?> 549 <li><strong><?php _e( 'Author:' ); ?></strong> <?php echo links_add_target( $api->author, '_blank' ); ?></li> 550 <?php } if ( ! empty( $api->last_updated ) ) { ?> 551 <li><strong><?php _e( 'Last Updated:' ); ?></strong> 552 <?php 553 /* translators: %s: Time since the last update */ 554 printf( __( '%s ago' ), human_time_diff( strtotime( $api->last_updated ) ) ); 555 ?> 556 </li> 557 <?php } if ( ! empty( $api->requires ) ) { ?> 558 <li> 559 <strong><?php _e( 'Requires WordPress Version:' ); ?></strong> 560 <?php 561 /* translators: %s: WordPress version */ 562 printf( __( '%s or higher' ), $api->requires ); 563 ?> 564 </li> 565 <?php } if ( ! empty( $api->tested ) ) { ?> 566 <li><strong><?php _e( 'Compatible up to:' ); ?></strong> <?php echo $api->tested; ?></li> 567 <?php } if ( ! empty( $api->active_installs ) ) { ?> 568 <li><strong><?php _e( 'Active Installs:' ); ?></strong> <?php 569 if ( $api->active_installs >= 1000000 ) { 570 _ex( '1+ Million', 'Active plugin installs' ); 571 } else { 572 echo number_format_i18n( $api->active_installs ) . '+'; 573 } 574 ?></li> 575 <?php } if ( ! empty( $api->slug ) && empty( $api->external ) ) { ?> 576 <li><a target="_blank" href="https://wordpress.org/plugins/<?php echo $api->slug; ?>/"><?php _e( 'WordPress.org Plugin Page »' ); ?></a></li> 577 <?php } if ( ! empty( $api->homepage ) ) { ?> 578 <li><a target="_blank" href="<?php echo esc_url( $api->homepage ); ?>"><?php _e( 'Plugin Homepage »' ); ?></a></li> 579 <?php } if ( ! empty( $api->donate_link ) && empty( $api->contributors ) ) { ?> 580 <li><a target="_blank" href="<?php echo esc_url( $api->donate_link ); ?>"><?php _e( 'Donate to this plugin »' ); ?></a></li> 581 <?php } ?> 573 582 </ul> 574 583 <?php if ( ! empty( $api->rating ) ) { ?> 575 <h3><?php _e( 'Average Rating' ); ?></h3>576 <?php wp_star_rating( array( 'rating' => $api->rating, 'type' => 'percent', 'number' => $api->num_ratings ) ); ?>577 <p aria-hidden="true" class="fyi-description"><?php printf( _n( '(based on %s rating)', '(based on %s ratings)', $api->num_ratings ), number_format_i18n( $api->num_ratings ) ); ?></p>584 <h3><?php _e( 'Average Rating' ); ?></h3> 585 <?php wp_star_rating( array( 'rating' => $api->rating, 'type' => 'percent', 'number' => $api->num_ratings ) ); ?> 586 <p aria-hidden="true" class="fyi-description"><?php printf( _n( '(based on %s rating)', '(based on %s ratings)', $api->num_ratings ), number_format_i18n( $api->num_ratings ) ); ?></p> 578 587 <?php } 579 588 … … 592 601 ?> 593 602 <div class="counter-container"> 594 <span class="counter-label"><a href="https://wordpress.org/support/view/plugin-reviews/<?php echo $api->slug; ?>?filter=<?php echo $key; ?>"595 target="_blank" aria-label="<?php echo $aria_label; ?>"><?php printf( _n( '%d star', '%d stars', $key ), $key ); ?></a></span>596 <span class="counter-back">597 <span class="counter-bar" style="width: <?php echo 92 * $_rating; ?>px;"></span>598 </span>603 <span class="counter-label"><a href="https://wordpress.org/support/view/plugin-reviews/<?php echo $api->slug; ?>?filter=<?php echo $key; ?>" 604 target="_blank" aria-label="<?php echo $aria_label; ?>"><?php printf( _n( '%d star', '%d stars', $key ), $key ); ?></a></span> 605 <span class="counter-back"> 606 <span class="counter-bar" style="width: <?php echo 92 * $_rating; ?>px;"></span> 607 </span> 599 608 <span class="counter-count" aria-hidden="true"><?php echo number_format_i18n( $ratecount ); ?></span> 600 609 </div> … … 629 638 <div id="section-holder" class="wrap"> 630 639 <?php 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 640 if ( ! empty( $api->tested ) && version_compare( substr( $GLOBALS['wp_version'], 0, strlen( $api->tested ) ), $api->tested, '>' ) ) { 641 echo '<div class="notice notice-warning notice-alt"><p>' . __( '<strong>Warning:</strong> This plugin has <strong>not been tested</strong> with your current version of WordPress.' ) . '</p></div>'; 642 } elseif ( ! empty( $api->requires ) && version_compare( substr( $GLOBALS['wp_version'], 0, strlen( $api->requires ) ), $api->requires, '<' ) ) { 643 echo '<div class="notice notice-warning notice-alt"><p>' . __( '<strong>Warning:</strong> This plugin has <strong>not been marked as compatible</strong> with your version of WordPress.' ) . '</p></div>'; 644 } 645 646 foreach ( (array) $api->sections as $section_name => $content ) { 647 $content = links_add_base_url( $content, 'https://wordpress.org/plugins/' . $api->slug . '/' ); 648 $content = links_add_target( $content, '_blank' ); 649 650 $san_section = esc_attr( $section_name ); 651 652 $display = ( $section_name === $section ) ? 'block' : 'none'; 653 654 echo "\t<div id='section-{$san_section}' class='section' style='display: {$display};'>\n"; 655 echo $content; 656 echo "\t</div>\n"; 657 } 649 658 echo "</div>\n"; 650 659 echo "</div>\n"; … … 656 665 case 'install': 657 666 if ( $status['url'] ) { 658 echo '<a class="button button-primary right" href="' . $status['url'] . '" target="_parent">' . __( 'Install Now' ) . '</a>';667 echo '<a data-slug="' . esc_attr( $api->slug ) . '" id="plugin_install_from_iframe" class="button button-primary right" href="' . $status['url'] . '" target="_parent">' . __( 'Install Now' ) . '</a>'; 659 668 } 660 669 break; … … 665 674 break; 666 675 case 'newer_installed': 676 /* translators: %s: Plugin version */ 667 677 echo '<a class="button button-primary right disabled">' . sprintf( __( 'Newer Version (%s) Installed'), $status['version'] ) . '</a>'; 668 678 break;
Note: See TracChangeset
for help on using the changeset viewer.