Changeset 1565499
- Timestamp:
- 12/31/2016 07:21:39 PM (9 years ago)
- Location:
- wordpress-beta-tester
- Files:
-
- 4 edited
- 1 copied
-
tags/1.1.0 (copied) (copied from wordpress-beta-tester/trunk)
-
tags/1.1.0/readme.txt (modified) (5 diffs)
-
tags/1.1.0/wp-beta-tester.php (modified) (13 diffs)
-
trunk/readme.txt (modified) (5 diffs)
-
trunk/wp-beta-tester.php (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wordpress-beta-tester/tags/1.1.0/readme.txt
r1545401 r1565499 1 1 === WordPress Beta Tester === 2 2 Tags: beta, advanced, testing 3 Contributors: westi, mlteal 3 Contributors: westi, mlteal, afragen 4 4 Tested up to: 4.7 5 5 Requires at least: 3.0.5 6 Stable Tag: 1. 0.26 Stable Tag: 1.1.0 7 7 License: GPLv2 8 8 License URI: http://www.opensource.org/licenses/GPL-2.0 … … 13 13 This plugin provides an easy way to get involved with Beta testing WordPress. 14 14 15 Once installed it will enable you to upgrade your blog to the latest Beta or Release candidate at the click of a button using the built in upgrader. 15 Once installed it will enable you to upgrade your blog to the latest Beta or Release candidate at the click of a button using the built in upgrader. 16 16 17 17 By default once enabled it switches your blog onto the point release development track. … … 22 22 23 23 == Changelog == 24 25 = 1.1.0 = 26 * Fixed to work properly under Multisite. 24 27 25 28 = 1.0.2 = … … 75 78 * Added translation files for Albanian and French. 76 79 77 = 0.8 = 80 = 0.8 = 78 81 * Fixed noticed on dashboard after upgrade and before the update api data was refreshed 79 82 * Added translation files for German, Bosnian, Italian, Polish and Romanian. … … 84 87 * Fixed issue with calls to get_preferred_from_update_core() when running on a cron hook. 85 88 86 = 0.6 = 89 = 0.6 = 87 90 * Update the code to validate the returned upgrade url so as to ensure that we only offer to upgrade to builds that exist. 88 91 -
wordpress-beta-tester/tags/1.1.0/wp-beta-tester.php
r1545401 r1565499 5 5 Description: Allows you to easily upgrade to Beta releases. 6 6 Author: Peter Westwood 7 Version: 1.0.2 7 Version: 1.1.0 8 Network: true 8 9 Author URI: http://blog.ftwr.co.uk/ 9 10 Text Domain: wordpress-beta-tester … … 14 15 15 16 This program is free software; you can redistribute it and/or modify 16 it under the terms of the GNU General Public License, version 2, as 17 it under the terms of the GNU General Public License, version 2, as 17 18 published by the Free Software Foundation. 18 19 … … 28 29 29 30 class wp_beta_tester { 30 var $real_wp_version;31 var $real_wpmu_version = false;32 31 33 32 function __construct() { 34 33 add_action( 'admin_init', array( &$this, 'action_admin_init' ) ); 35 if ( is_multisite() ) { 36 add_action( 'network_admin_menu', array( &$this, 'action_admin_menu' ) ); 37 } else { 38 add_action( 'admin_menu', array( &$this, 'action_admin_menu' ) ); 39 } 34 add_action( is_multisite() ? 'network_admin_menu' : 'admin_menu', array( &$this, 'action_admin_menu' ) ); 35 add_action( 'network_admin_edit_wp_beta_tester', array( &$this, 'update_settings' ) ); 40 36 add_action( 'update_option_wp_beta_tester_stream', array( 41 37 &$this, … … 47 43 } 48 44 49 function wp_beta_tester() { 50 wp_beta_tester::__construct(); 45 function update_settings() { 46 if ( isset( $_POST['option_page'] ) ) { 47 if ( 'wp_beta_tester_options' === $_POST['option_page'] ) { 48 update_site_option( 'wp_beta_tester_stream', $this->validate_setting( $_POST['wp_beta_tester_stream'] ) ); 49 } 50 } 51 52 $redirect_url = is_multisite() ? network_admin_url( 'settings.php' ) : admin_url( 'options-general.php' ); 53 $location = add_query_arg( 54 array( 55 'page' => 'wp_beta_tester', 56 'updated' => 'true', 57 ), 58 $redirect_url 59 ); 60 wp_redirect( $location ); 61 exit; 51 62 } 52 63 … … 71 82 function action_admin_init() { 72 83 load_plugin_textdomain( 'wordpress-beta-tester' ); 73 register_setting( 'wp_beta_tester_options', 'wp_beta_tester_stream', array( &$this, 'validate_setting' ) ); 84 register_setting( 85 'wp_beta_tester_options', 86 'wp_beta_tester_stream', 87 array( &$this, 'validate_setting' ) 88 ); 74 89 } 75 90 76 91 function action_admin_menu() { 77 $parent = 'tools.php'; 78 if ( is_multisite() ) { 79 $parent = 'settings.php'; 80 } 92 $parent = is_multisite() ? 'settings.php' : 'tools.php'; 93 $capability = is_multisite() ? 'manage_network' : 'manage_options'; 81 94 82 95 add_submenu_page( … … 84 97 __( 'Beta Testing WordPress', 'wordpress-beta-tester' ), 85 98 __( 'Beta Testing', 'wordpress-beta-tester' ), 86 'update_plugins',99 $capability, 87 100 'wp_beta_tester', 88 101 array( &$this, 'display_page' ) … … 133 146 134 147 function mangle_wp_version() { 135 $stream = get_option( 'wp_beta_tester_stream', 'point' ); 136 $preferred = $this->_get_preferred_from_update_core(); 137 // If we're getting no updates back from get_preferred_from_update_core(), let an HTTP request go through unmangled. 148 $stream = get_site_option( 'wp_beta_tester_stream', 'point' ); 149 $preferred = $this->_get_preferred_from_update_core(); 150 $wp_version = $GLOBALS['wp_version']; 151 152 // If we're getting no updates back from get_preferred_from_update_core(), 153 // let an HTTP request go through unmangled. 138 154 if ( ! isset( $preferred->current ) ) { 139 return $ GLOBALS['wp_version'];155 return $wp_version; 140 156 } 141 157 … … 153 169 $versions[1] = 0; 154 170 } 155 156 171 $wp_version = $versions[0] . '.' . $versions[1] . '-wp-beta-tester'; 157 158 172 break; 159 173 } … … 171 185 172 186 function validate_setting( $setting ) { 173 if ( ! in_array( $setting, array( 'point', 'unstable' ) ) ) { 174 $setting = 'point'; 175 } 176 177 return $setting; 187 return ( in_array( $setting, array( 'point', 'unstable' ) ) ? $setting : 'point' ); 178 188 } 179 189 180 190 function display_page() { 181 if ( ! current_user_can( 'update_plugins' ) ) {182 wp_die( __( 'You do not have sufficient permissions to access this page.', 'wordpress-beta-tester' ) );183 }184 191 $preferred = $this->_get_preferred_from_update_core(); 185 192 186 193 ?> 187 <div class="wrap"><?php screen_icon(); ?> 188 <h2><?php _e( 'Beta Testing WordPress', 'wordpress-beta-tester' ); ?></h2> 194 <div class="wrap"> 195 <h1><?php _e( 'Beta Testing WordPress', 'wordpress-beta-tester' ); ?></h1> 196 <?php if ( isset( $_GET['updated'] ) && true == $_GET['updated'] || 197 isset( $_GET['settings-updated'] ) && true == $_GET['settings-updated'] 198 ): ?> 199 <div class="updated"> 200 <p><?php esc_html_e( 'Saved.', 'wordpress-beta-tester' ); ?></p> 201 </div> 202 <?php endif; ?> 189 203 <div class="updated fade"> 190 204 <p><?php _e( '<strong>Please note:</strong> Once you have switched your blog to one of these beta versions of software, it will not always be possible to downgrade, as the database structure may be updated during the development of a major release.', 'wordpress-beta-tester' ); ?></p> … … 205 219 206 220 <p><?php _e( 'By default, your WordPress install uses the stable update stream. To return to this, please deactivate this plugin.', 'wordpress-beta-tester' ); ?></p> 207 <form method="post" action="options.php"><?php settings_fields( 'wp_beta_tester_options' ); ?> 221 <?php $action = is_multisite() ? 'edit.php?action=wp_beta_tester' : 'options.php'; ?> 222 <form method="post" action="<?php esc_attr_e( $action ); ?>"> 223 <?php settings_fields( 'wp_beta_tester_options' ); ?> 208 224 <fieldset> 209 225 <legend><?php _e( 'Please select the update stream you would like this blog to use:', 'wordpress-beta-tester' ); ?></legend> 210 <?php 211 // in multisite, this option is stored in the primary blog options table 212 $stream = get_option( 'wp_beta_tester_stream', 'point' ); 213 ?> 226 <?php $stream = get_site_option( 'wp_beta_tester_stream', 'point' ); ?> 214 227 <table class="form-table"> 215 228 <tr> 216 229 <th><label><input name="wp_beta_tester_stream" 217 id="update-stream-point-nightlies" type="radio" value="point" 218 class="tog" <?php checked( 'point', $stream ); ?> /><?php _e( 'Point release nightlies', 'wordpress-beta-tester' ); ?> 230 id="update-stream-point-nightlies" type="radio" value="point" 231 class="tog" <?php checked( 'point', $stream ); ?> /> 232 <?php _e( 'Point release nightlies', 'wordpress-beta-tester' ); ?> 219 233 </label></th> 220 234 <td><?php _e( 'This contains the work that is occurring on a branch in preparation for a x.x.x point release. This should also be fairly stable but will be available before the branch is ready for beta.', 'wordpress-beta-tester' ); ?></td> … … 222 236 <tr> 223 237 <th><label><input name="wp_beta_tester_stream" 224 id="update-stream-bleeding-nightlies" type="radio" value="unstable" 225 class="tog" <?php checked( 'unstable', $stream ); ?> /><?php _e( 'Bleeding edge nightlies', 'wordpress-beta-tester' ); ?> 238 id="update-stream-bleeding-nightlies" type="radio" value="unstable" 239 class="tog" <?php checked( 'unstable', $stream ); ?> /> 240 <?php _e( 'Bleeding edge nightlies', 'wordpress-beta-tester' ); ?> 226 241 </label></th> 227 242 <td><?php _e( 'This is the bleeding edge development code which may be unstable at times. <em>Only use this if you really know what you are doing</em>.', 'wordpress-beta-tester' ); ?></td> … … 230 245 </fieldset> 231 246 <p class="submit"><input type="submit" class="button-primary" 232 value="<?php _e( 'Save Changes', 'wordpress-beta-tester' ); ?>"/></p>247 value="<?php _e( 'Save Changes', 'wordpress-beta-tester' ); ?>" /></p> 233 248 </form> 234 249 <p><?php echo sprintf( __( 'Why don\'t you <a href="%s">head on over and upgrade now</a>.', 'wordpress-beta-tester' ), 'update-core.php' ); ?></p> … … 239 254 } 240 255 241 /* Initialise outselves */ 242 add_action( 'plugins_loaded', create_function( '', 'global $wp_beta_tester_instance; $wp_beta_tester_instance = new wp_beta_tester();' ) ); 256 /* Initialise ourselves */ 257 add_action( 'plugins_loaded', function() { 258 global $wp_beta_tester_instance; 259 $wp_beta_tester_instance = new wp_beta_tester(); 260 } ); 243 261 244 262 // Clear down -
wordpress-beta-tester/trunk/readme.txt
r1545401 r1565499 1 1 === WordPress Beta Tester === 2 2 Tags: beta, advanced, testing 3 Contributors: westi, mlteal 3 Contributors: westi, mlteal, afragen 4 4 Tested up to: 4.7 5 5 Requires at least: 3.0.5 6 Stable Tag: 1. 0.26 Stable Tag: 1.1.0 7 7 License: GPLv2 8 8 License URI: http://www.opensource.org/licenses/GPL-2.0 … … 13 13 This plugin provides an easy way to get involved with Beta testing WordPress. 14 14 15 Once installed it will enable you to upgrade your blog to the latest Beta or Release candidate at the click of a button using the built in upgrader. 15 Once installed it will enable you to upgrade your blog to the latest Beta or Release candidate at the click of a button using the built in upgrader. 16 16 17 17 By default once enabled it switches your blog onto the point release development track. … … 22 22 23 23 == Changelog == 24 25 = 1.1.0 = 26 * Fixed to work properly under Multisite. 24 27 25 28 = 1.0.2 = … … 75 78 * Added translation files for Albanian and French. 76 79 77 = 0.8 = 80 = 0.8 = 78 81 * Fixed noticed on dashboard after upgrade and before the update api data was refreshed 79 82 * Added translation files for German, Bosnian, Italian, Polish and Romanian. … … 84 87 * Fixed issue with calls to get_preferred_from_update_core() when running on a cron hook. 85 88 86 = 0.6 = 89 = 0.6 = 87 90 * Update the code to validate the returned upgrade url so as to ensure that we only offer to upgrade to builds that exist. 88 91 -
wordpress-beta-tester/trunk/wp-beta-tester.php
r1545401 r1565499 5 5 Description: Allows you to easily upgrade to Beta releases. 6 6 Author: Peter Westwood 7 Version: 1.0.2 7 Version: 1.1.0 8 Network: true 8 9 Author URI: http://blog.ftwr.co.uk/ 9 10 Text Domain: wordpress-beta-tester … … 14 15 15 16 This program is free software; you can redistribute it and/or modify 16 it under the terms of the GNU General Public License, version 2, as 17 it under the terms of the GNU General Public License, version 2, as 17 18 published by the Free Software Foundation. 18 19 … … 28 29 29 30 class wp_beta_tester { 30 var $real_wp_version;31 var $real_wpmu_version = false;32 31 33 32 function __construct() { 34 33 add_action( 'admin_init', array( &$this, 'action_admin_init' ) ); 35 if ( is_multisite() ) { 36 add_action( 'network_admin_menu', array( &$this, 'action_admin_menu' ) ); 37 } else { 38 add_action( 'admin_menu', array( &$this, 'action_admin_menu' ) ); 39 } 34 add_action( is_multisite() ? 'network_admin_menu' : 'admin_menu', array( &$this, 'action_admin_menu' ) ); 35 add_action( 'network_admin_edit_wp_beta_tester', array( &$this, 'update_settings' ) ); 40 36 add_action( 'update_option_wp_beta_tester_stream', array( 41 37 &$this, … … 47 43 } 48 44 49 function wp_beta_tester() { 50 wp_beta_tester::__construct(); 45 function update_settings() { 46 if ( isset( $_POST['option_page'] ) ) { 47 if ( 'wp_beta_tester_options' === $_POST['option_page'] ) { 48 update_site_option( 'wp_beta_tester_stream', $this->validate_setting( $_POST['wp_beta_tester_stream'] ) ); 49 } 50 } 51 52 $redirect_url = is_multisite() ? network_admin_url( 'settings.php' ) : admin_url( 'options-general.php' ); 53 $location = add_query_arg( 54 array( 55 'page' => 'wp_beta_tester', 56 'updated' => 'true', 57 ), 58 $redirect_url 59 ); 60 wp_redirect( $location ); 61 exit; 51 62 } 52 63 … … 71 82 function action_admin_init() { 72 83 load_plugin_textdomain( 'wordpress-beta-tester' ); 73 register_setting( 'wp_beta_tester_options', 'wp_beta_tester_stream', array( &$this, 'validate_setting' ) ); 84 register_setting( 85 'wp_beta_tester_options', 86 'wp_beta_tester_stream', 87 array( &$this, 'validate_setting' ) 88 ); 74 89 } 75 90 76 91 function action_admin_menu() { 77 $parent = 'tools.php'; 78 if ( is_multisite() ) { 79 $parent = 'settings.php'; 80 } 92 $parent = is_multisite() ? 'settings.php' : 'tools.php'; 93 $capability = is_multisite() ? 'manage_network' : 'manage_options'; 81 94 82 95 add_submenu_page( … … 84 97 __( 'Beta Testing WordPress', 'wordpress-beta-tester' ), 85 98 __( 'Beta Testing', 'wordpress-beta-tester' ), 86 'update_plugins',99 $capability, 87 100 'wp_beta_tester', 88 101 array( &$this, 'display_page' ) … … 133 146 134 147 function mangle_wp_version() { 135 $stream = get_option( 'wp_beta_tester_stream', 'point' ); 136 $preferred = $this->_get_preferred_from_update_core(); 137 // If we're getting no updates back from get_preferred_from_update_core(), let an HTTP request go through unmangled. 148 $stream = get_site_option( 'wp_beta_tester_stream', 'point' ); 149 $preferred = $this->_get_preferred_from_update_core(); 150 $wp_version = $GLOBALS['wp_version']; 151 152 // If we're getting no updates back from get_preferred_from_update_core(), 153 // let an HTTP request go through unmangled. 138 154 if ( ! isset( $preferred->current ) ) { 139 return $ GLOBALS['wp_version'];155 return $wp_version; 140 156 } 141 157 … … 153 169 $versions[1] = 0; 154 170 } 155 156 171 $wp_version = $versions[0] . '.' . $versions[1] . '-wp-beta-tester'; 157 158 172 break; 159 173 } … … 171 185 172 186 function validate_setting( $setting ) { 173 if ( ! in_array( $setting, array( 'point', 'unstable' ) ) ) { 174 $setting = 'point'; 175 } 176 177 return $setting; 187 return ( in_array( $setting, array( 'point', 'unstable' ) ) ? $setting : 'point' ); 178 188 } 179 189 180 190 function display_page() { 181 if ( ! current_user_can( 'update_plugins' ) ) {182 wp_die( __( 'You do not have sufficient permissions to access this page.', 'wordpress-beta-tester' ) );183 }184 191 $preferred = $this->_get_preferred_from_update_core(); 185 192 186 193 ?> 187 <div class="wrap"><?php screen_icon(); ?> 188 <h2><?php _e( 'Beta Testing WordPress', 'wordpress-beta-tester' ); ?></h2> 194 <div class="wrap"> 195 <h1><?php _e( 'Beta Testing WordPress', 'wordpress-beta-tester' ); ?></h1> 196 <?php if ( isset( $_GET['updated'] ) && true == $_GET['updated'] || 197 isset( $_GET['settings-updated'] ) && true == $_GET['settings-updated'] 198 ): ?> 199 <div class="updated"> 200 <p><?php esc_html_e( 'Saved.', 'wordpress-beta-tester' ); ?></p> 201 </div> 202 <?php endif; ?> 189 203 <div class="updated fade"> 190 204 <p><?php _e( '<strong>Please note:</strong> Once you have switched your blog to one of these beta versions of software, it will not always be possible to downgrade, as the database structure may be updated during the development of a major release.', 'wordpress-beta-tester' ); ?></p> … … 205 219 206 220 <p><?php _e( 'By default, your WordPress install uses the stable update stream. To return to this, please deactivate this plugin.', 'wordpress-beta-tester' ); ?></p> 207 <form method="post" action="options.php"><?php settings_fields( 'wp_beta_tester_options' ); ?> 221 <?php $action = is_multisite() ? 'edit.php?action=wp_beta_tester' : 'options.php'; ?> 222 <form method="post" action="<?php esc_attr_e( $action ); ?>"> 223 <?php settings_fields( 'wp_beta_tester_options' ); ?> 208 224 <fieldset> 209 225 <legend><?php _e( 'Please select the update stream you would like this blog to use:', 'wordpress-beta-tester' ); ?></legend> 210 <?php 211 // in multisite, this option is stored in the primary blog options table 212 $stream = get_option( 'wp_beta_tester_stream', 'point' ); 213 ?> 226 <?php $stream = get_site_option( 'wp_beta_tester_stream', 'point' ); ?> 214 227 <table class="form-table"> 215 228 <tr> 216 229 <th><label><input name="wp_beta_tester_stream" 217 id="update-stream-point-nightlies" type="radio" value="point" 218 class="tog" <?php checked( 'point', $stream ); ?> /><?php _e( 'Point release nightlies', 'wordpress-beta-tester' ); ?> 230 id="update-stream-point-nightlies" type="radio" value="point" 231 class="tog" <?php checked( 'point', $stream ); ?> /> 232 <?php _e( 'Point release nightlies', 'wordpress-beta-tester' ); ?> 219 233 </label></th> 220 234 <td><?php _e( 'This contains the work that is occurring on a branch in preparation for a x.x.x point release. This should also be fairly stable but will be available before the branch is ready for beta.', 'wordpress-beta-tester' ); ?></td> … … 222 236 <tr> 223 237 <th><label><input name="wp_beta_tester_stream" 224 id="update-stream-bleeding-nightlies" type="radio" value="unstable" 225 class="tog" <?php checked( 'unstable', $stream ); ?> /><?php _e( 'Bleeding edge nightlies', 'wordpress-beta-tester' ); ?> 238 id="update-stream-bleeding-nightlies" type="radio" value="unstable" 239 class="tog" <?php checked( 'unstable', $stream ); ?> /> 240 <?php _e( 'Bleeding edge nightlies', 'wordpress-beta-tester' ); ?> 226 241 </label></th> 227 242 <td><?php _e( 'This is the bleeding edge development code which may be unstable at times. <em>Only use this if you really know what you are doing</em>.', 'wordpress-beta-tester' ); ?></td> … … 230 245 </fieldset> 231 246 <p class="submit"><input type="submit" class="button-primary" 232 value="<?php _e( 'Save Changes', 'wordpress-beta-tester' ); ?>"/></p>247 value="<?php _e( 'Save Changes', 'wordpress-beta-tester' ); ?>" /></p> 233 248 </form> 234 249 <p><?php echo sprintf( __( 'Why don\'t you <a href="%s">head on over and upgrade now</a>.', 'wordpress-beta-tester' ), 'update-core.php' ); ?></p> … … 239 254 } 240 255 241 /* Initialise outselves */ 242 add_action( 'plugins_loaded', create_function( '', 'global $wp_beta_tester_instance; $wp_beta_tester_instance = new wp_beta_tester();' ) ); 256 /* Initialise ourselves */ 257 add_action( 'plugins_loaded', function() { 258 global $wp_beta_tester_instance; 259 $wp_beta_tester_instance = new wp_beta_tester(); 260 } ); 243 261 244 262 // Clear down
Note: See TracChangeset
for help on using the changeset viewer.