Title: [Plugin: Better WP Security] Random version number tweak strips all script query parameter
Last modified: August 20, 2016

---

# [Plugin: Better WP Security] Random version number tweak strips all script query parameter

 *  [MrGamgee](https://wordpress.org/support/users/mrgamgee/)
 * (@mrgamgee)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-better-wp-security-random-version-number-tweak-strips-all-script-query-parameter/)
 * The System Tweak “Display random version number to all non-administrative users”
   is an obscurity feature which strips the version number on scripts in the front-
   end header.
 * However, it does this by (lazily) removing _all_ query parameters from _all_ 
   script source links. This of course breaks any scripts which have parameters 
   other than a version number. For example,
      `http://fonts.googleapis.com/css?
   family=Open+Sans:400italic,700italic,400,700|Shadows+Into+Light+Two` becomes `
   http://fonts.googleapis.com/css` And   `http://maps.googleapis.com/maps/api/js?
   sensor=false` becomes   `http://maps.googleapis.com/maps/api/js`
 * Basically, **it will break any Google API script**.
 * The function to blame is **remove_script_version()** on line 825 of _better-wp-
   security/inc/secure.php_
 * **Function as is:**
 * >     ```
   >     function remove_script_version( $src ){
   >       $parts = explode( '?', $src );
   >       return $parts[0];
   >     }
   >     ```
   > 
 * **My improved version:**
 * >     ```
   >     function remove_script_version( $src ){
   >       $parts = explode( '?ver=', $src, 2 );
   >       if ( count($parts) == 1 ) {
   >         $parts = explode( '&ver=', $src, 2 );
   >       }
   >       return $parts[0];
   >     }
   >     ```
   > 
 * It would be great if this could be fixed in the next release.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Lab Lover](https://wordpress.org/support/users/peterscaffidi/)
 * (@peterscaffidi)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-better-wp-security-random-version-number-tweak-strips-all-script-query-parameter/#post-3097211)
 * I am modifying my secure.php, as per your suggestion, to see if it makes a difference.
 * Thanks for your post.
 *  [Collin](https://wordpress.org/support/users/collinmbarrett/)
 * (@collinmbarrett)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/plugin-better-wp-security-random-version-number-tweak-strips-all-script-query-parameter/#post-3097295)
 * YES! That fixed it! Thanks for figuring that out! Please incorporate this into
   the next release.
 *  [Juliette Reinders Folmer](https://wordpress.org/support/users/jrf/)
 * (@jrf)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/plugin-better-wp-security-random-version-number-tweak-strips-all-script-query-parameter/#post-3097297)
 * +1

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘[Plugin: Better WP Security] Random version number tweak strips all script
query parameter’ is closed to new replies.

 * ![](https://ps.w.org/better-wp-security/assets/icon.svg?rev=3529351)
 * [Kadence Security – Password, Two Factor Authentication, and Brute Force Protection](https://wordpress.org/plugins/better-wp-security/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/better-wp-security/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/better-wp-security/)
 * [Active Topics](https://wordpress.org/support/plugin/better-wp-security/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/better-wp-security/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/better-wp-security/reviews/)

 * 3 replies
 * 4 participants
 * Last reply from: [Juliette Reinders Folmer](https://wordpress.org/support/users/jrf/)
 * Last activity: [13 years, 6 months ago](https://wordpress.org/support/topic/plugin-better-wp-security-random-version-number-tweak-strips-all-script-query-parameter/#post-3097297)
 * Status: not resolved