Ticket #3010: 3010.2.patch
File 3010.2.patch, 3.0 KB (added by , 7 years ago) |
---|
-
wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/functions.php
259 259 } ); 260 260 261 261 /** 262 * Get current major WP version to check against "Tested up to" value. 263 * 264 * @return string Current major WP version. 265 */ 266 function get_current_major_wp_version() { 267 global $wp_version; 268 269 $current_version = ''; 270 271 // Assume the value stored in a constant (which is set on WP.org), if defined. 272 if ( defined( 'WP_CORE_LATEST_RELEASE' ) && WP_CORE_LATEST_RELEASE ) { 273 $current_version = substr( WP_CORE_LATEST_RELEASE, 0, 3 ); 274 } 275 276 // Otherwise, use the version of the running WP instance. 277 if ( empty( $current_version ) ) { 278 $current_version = substr( $wp_version, 0, 3 ); 279 280 // However, if the running WP instance appears to not be a release 281 // version, assume the latest stable version. 282 if ( false !== strpos( $wp_version, '-' ) ) { 283 $current_version = (string) ( (float) $current_version - 0.1 ); 284 } 285 } 286 287 return $current_version; 288 } 289 290 /** 262 291 * Custom template tags for this theme. 263 292 */ 264 293 require get_template_directory() . '/inc/template-tags.php'; -
wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/template-parts/plugin-single.php
15 15 16 16 $content = Plugin_Directory::instance()->split_post_content_into_pages( get_the_content() ); 17 17 18 $tested_up_to = (string) get_post_meta( $post->ID, 'tested', true ); 19 $version_to_check_against = (string) ( (float) get_current_major_wp_version() - 0.2 ); 18 20 ?><article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 19 21 <?php echo Template::get_plugin_banner( get_post(), 'html' ); ?> 20 22 21 23 <header class="plugin-header"> 22 <?php if ( time() - get_post_modified_time() > 2 * YEAR_IN_SECONDS) : ?>24 <?php if ( version_compare( $version_to_check_against, $tested_up_to, '>' ) ) : ?> 23 25 <div class="plugin-notice notice notice-warning notice-alt"> 24 <p><?php _e( ' This plugin <strong>hasn’t been updated in over 2 years</strong>. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.', 'wporg-plugins' ); ?></p>26 <p><?php _e( '<strong>This plugin hasn’t been tested with the latest 3 major releases of WordPress</strong>. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.', 'wporg-plugins' ); ?></p> 25 27 </div><!-- .plugin-notice --> 26 28 <?php endif; ?> 27 29 <?php if ( 'publish' != get_post()->post_status ) :