Ticket #2952: 2952.2.patch
File 2952.2.patch, 11.7 KB (added by , 7 years ago) |
---|
-
wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/metabox/class-custom-fields.php
14 14 'stable_tag' => 'Stable Tag', 15 15 'tested' => 'Tested With', 16 16 'requires' => 'Requires', 17 'requires_php' => 'Requires PHP', 17 18 'donate_link' => 'Donate URL', 18 19 'header_plugin_uri' => 'Plugin URI', 19 20 'header_author' => 'Plugin Author', -
wordpress.org/public_html/wp-content/plugins/plugin-directory/api/routes/class-plugin.php
99 99 100 100 $result['requires'] = get_post_meta( $post_id, 'requires', true ) ?: false; 101 101 $result['tested'] = get_post_meta( $post_id, 'tested', true ) ?: false; 102 $result['requires_php'] = get_post_meta( $post_id, 'requires_php', true ) ?: false; 102 103 $result['compatibility'] = array(); 103 104 $result['rating'] = ( get_post_meta( $post_id, 'rating', true ) ?: 0 ) * 20; // Stored as 0.0 ~ 5.0, API outputs as 0..100 104 105 $result['ratings'] = array_map( 'intval', (array) get_post_meta( $post_id, 'ratings', true ) ); -
wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php
367 367 'show_in_rest' => true, 368 368 ) ); 369 369 370 register_meta( 'post', 'requires_php', array( 371 'description' => __( 'The minimum version of PHP the plugin needs to run.', 'wporg-plugins' ), 372 'single' => true, 373 // TODO 'sanitize_callback' => 'absint', 374 'show_in_rest' => true, 375 ) ); 376 370 377 register_meta( 'post', 'stable_tag', array( 371 378 'description' => __( 'Stable version of the plugin.', 'wporg-plugins' ), 372 379 'single' => true, -
wordpress.org/public_html/wp-content/plugins/plugin-directory/cli/class-import.php
25 25 public $readme_fields = array( 26 26 'tested', 27 27 'requires', 28 'requires_php', 28 29 'donate_link', 29 30 'license', 30 31 'license_uri', -
wordpress.org/public_html/wp-content/plugins/plugin-directory/jobs/class-api-update-updater.php
71 71 'plugin_name_san' => sanitize_title_with_dashes( get_post_meta( $post->ID, 'header_name', true ) ), 72 72 'tested' => get_post_meta( $post->ID, 'tested', true ), 73 73 'requires' => get_post_meta( $post->ID, 'requires', true ), 74 'requires_php' => get_post_meta( $post->ID, 'requires_php', true ), 74 75 'upgrade_notice' => '', 75 76 'last_updated' => $post->post_modified, 76 77 ); … … 122 123 `plugin_name_san` varchar(255) NOT NULL DEFAULT '', 123 124 `tested` varchar(128) NOT NULL DEFAULT '', 124 125 `requires` varchar(128) NOT NULL DEFAULT '', 126 `requires_php` varchar(128) NOT NULL DEFAULT '', 125 127 `upgrade_notice` text, 126 128 `last_updated` datetime NOT NULL, 127 129 PRIMARY KEY (`plugin_id`), -
wordpress.org/public_html/wp-content/plugins/plugin-directory/readme/class-parser.php
32 32 public $tested = ''; 33 33 34 34 /** 35 * @var string 36 */ 37 public $requires_php = ''; 38 39 /** 35 40 * @var array 36 41 */ 37 42 public $contributors = array(); … … 117 122 'tested up to' => 'tested', 118 123 'requires' => 'requires', 119 124 'requires at least' => 'requires', 125 'requires php' => 'requires_php', 120 126 'tags' => 'tags', 121 127 'contributors' => 'contributors', 122 128 'donate link' => 'donate_link', … … 227 233 if ( ! empty( $headers['tested'] ) ) { 228 234 $this->tested = $headers['tested']; 229 235 } 236 if ( ! empty( $headers['requires_php'] ) ) { 237 $this->requires_php = $headers['requires_php']; 238 } 230 239 if ( ! empty( $headers['contributors'] ) ) { 231 240 $this->contributors = explode( ',', $headers['contributors'] ); 232 241 $this->contributors = array_map( 'trim', $this->contributors ); -
wordpress.org/public_html/wp-content/plugins/plugin-directory/readme/class-validator.php
75 75 /* Translators: Plugin header tag; */ 76 76 $warnings[] = sprintf( __( '%s is missing.', 'wporg-plugins' ), '<code>Tested up to</code>' ); 77 77 } 78 if ( empty( $readme->requires_php ) ) { 79 /* Translators: Plugin header tag; */ 80 $warnings[] = sprintf( __( '%s is missing.', 'wporg-plugins' ), '<code>Requires PHP</code>' ); 81 } 78 82 if ( empty( $readme->stable_tag ) ) { 79 83 /* Translators: 1: Plugin header tag; 2: SVN directory; 3: Plugin header tag; */ 80 84 $warnings[] = sprintf( __( '%1$s is missing. Hint: If you treat %2$s as stable, put %3$s.', 'wporg-plugins' ), '<code>Stable tag</code>', '<code>/trunk/</code>', '<code>Stable tag: trunk</code>' ); -
wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-upload-handler.php
216 216 'meta_input' => array( 217 217 'tested' => $readme->tested, 218 218 'requires' => $readme->requires, 219 'requires_php' => $readme->requires_php, 219 220 'stable_tag' => $readme->stable_tag, 220 221 'upgrade_notice' => $readme->upgrade_notice, 221 222 'contributors' => $readme->contributors, -
wordpress.org/public_html/wp-content/plugins/plugin-directory/standalone/class-plugins-info-api-request.php
26 26 'ratings' => false, 27 27 'reviews' => false, 28 28 'requires' => false, 29 'requires_php' => false, 29 30 'sections' => false, 30 31 'short_description' => false, 31 32 'tags' => false, … … 45 46 'rating' => true, 46 47 'ratings' => true, 47 48 'requires' => true, 49 'requires_php' => true, 48 50 'sections' => true, 49 51 'tags' => true, 50 52 'tested' => true, … … 62 64 'rating' => true, 63 65 'ratings' => true, 64 66 'requires' => true, 67 'requires_php' => true, 65 68 'sections' => true, 66 69 'short_description' => true, 67 70 'tags' => true, -
wordpress.org/public_html/wp-content/plugins/plugin-directory/tests/phpunit/tests/wporg-plugin-api-performance.php
24 24 'sections' => true, 25 25 'tested' => true, 26 26 'requires' => true, 27 'requires_php' => true, 27 28 'rating' => true, 28 29 'ratings' => true, 29 30 'downloaded' => true, -
wordpress.org/public_html/wp-content/plugins/plugin-directory/tests/phpunit/tests/wporg-plugin-api.php
23 23 'sections' => true, 24 24 'tested' => true, 25 25 'requires' => true, 26 'requires_php' => true, 26 27 'rating' => true, 27 28 'ratings' => true, 28 29 'downloaded' => true, … … 241 242 $this->assertObjectHasAttribute( 'tested', $plugin_info, 'Tested exists' ); 242 243 $this->assertAttributeInternalType( 'string', 'tested', $plugin_info, 'Tested should be a string' ); 243 244 } 245 $this->assertObjectHasAttribute( 'requires_php', $plugin_info, 'Requires PHP exists' ); 244 246 $this->assertObjectHasAttribute( 'compatibility', $plugin_info, 'Compatibility exists' ); 245 247 $this->assertAttributeInternalType( 'array', 'compatibility', $plugin_info, 'Compatibility should be an array' ); 246 248 -
wordpress.org/public_html/wp-content/plugins/plugin-directory/widgets/class-meta.php
49 49 </li> 50 50 <li><?php printf( __( 'Active installs: %s', 'wporg-plugins' ), '<strong>' . Template::active_installs( false ) . '</strong>' ); ?></li> 51 51 52 52 <?php if ( $requires = (string) get_post_meta( $post->ID, 'requires', true ) ) : ?> 53 53 <li><?php 54 54 _e( 'Requires WordPress Version:', 'wporg-plugins' ); 55 55 echo '<strong>' . esc_html( $requires ) . '</strong>'; 56 56 ?></li> 57 57 <?php endif; ?> 58 58 59 60 61 59 <?php if ( $tested_up_to = (string) get_post_meta( $post->ID, 'tested', true ) ) : ?> 62 60 <li><?php printf( __( 'Tested up to: %s', 'wporg-plugins' ), '<strong>' . $tested_up_to . '</strong>' ); ?></li> 63 61 <?php endif; ?> 64 62 63 <?php if ( $requires_php = (string) get_post_meta( $post->ID, 'requires_php', true ) ) : ?> 64 <li><?php 65 _e( 'Requires PHP Version:', 'wporg-plugins' ); 66 echo '<strong>' . esc_html( $requires_php ) . '</strong>'; 67 ?></li> 68 <?php endif; ?> 69 65 70 <?php if ( $tags = get_the_term_list( $post->ID, 'plugin_tags', '<div class="tags">', '', '</div>' ) ) : ?> 66 71 <li class="clear"><?php 67 72 $terms = get_the_terms( $post, 'plugin_tags' );