[wp-trac] [WordPress Trac] #30499: define WP_VERSION, to prevent having to code around plugins which change $wp_version

WordPress Trac noreply at wordpress.org
Tue Nov 25 14:09:15 UTC 2014


#30499: define WP_VERSION, to prevent having to code around plugins which change
$wp_version
---------------------------+-----------------------------
 Reporter:  DavidAnderson  |      Owner:
     Type:  enhancement    |     Status:  new
 Priority:  normal         |  Milestone:  Awaiting Review
Component:  General        |    Version:  trunk
 Severity:  normal         |   Keywords:
  Focuses:                 |
---------------------------+-----------------------------
 There are plugins, like this one - https://wordpress.org/plugins/replace-
 wp-version/ - which over-write $wp_version.

 Allegedly in the name of security (as if an external probe couldn't work
 out the WP version in 101 other ways).

 Unfortunately, their existence means that if another plugin wants to
 _really_ know the WP version, they have to do something ugly, and re-
 include wp-includes/version.php, like so:

 {{{
 global $wp_version;
 include(ABSPATH.WPINC.'/version.php');
 }}}

 The WP version really should not change, and there should be a more
 elegant way to know it is. The PHP way is via a constant; thus, the
 attached patch defines WP_VERSION, in order to provide coders with a
 reliable way of knowing the real WP version without having to use ugly
 work-arounds.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/30499>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list