Plugin Directory

Changeset 1565499


Ignore:
Timestamp:
12/31/2016 07:21:39 PM (9 years ago)
Author:
mlteal
Message:

Releasing version 1.1.0

Location:
wordpress-beta-tester
Files:
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • wordpress-beta-tester/tags/1.1.0/readme.txt

    r1545401 r1565499  
    11=== WordPress Beta Tester  ===
    22Tags: beta, advanced, testing
    3 Contributors: westi, mlteal
     3Contributors: westi, mlteal, afragen
    44Tested up to: 4.7
    55Requires at least: 3.0.5
    6 Stable Tag: 1.0.2
     6Stable Tag: 1.1.0
    77License: GPLv2
    88License URI: http://www.opensource.org/licenses/GPL-2.0
     
    1313This plugin provides an easy way to get involved with Beta testing WordPress.
    1414
    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. 
     15Once 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.
    1616
    1717By default once enabled it switches your blog onto the point release development track.
     
    2222
    2323== Changelog ==
     24
     25= 1.1.0 =
     26* Fixed to work properly under Multisite.
    2427
    2528= 1.0.2 =
     
    7578* Added translation files for Albanian and French.
    7679
    77 = 0.8 = 
     80= 0.8 =
    7881* Fixed noticed on dashboard after upgrade and before the update api data was refreshed
    7982* Added translation files for German, Bosnian, Italian, Polish and Romanian.
     
    8487* Fixed issue with calls to get_preferred_from_update_core() when running on a cron hook.
    8588
    86 = 0.6 = 
     89= 0.6 =
    8790* Update the code to validate the returned upgrade url so as to ensure that we only offer to upgrade to builds that exist.
    8891
  • wordpress-beta-tester/tags/1.1.0/wp-beta-tester.php

    r1545401 r1565499  
    55    Description: Allows you to easily upgrade to Beta releases.
    66    Author: Peter Westwood
    7     Version: 1.0.2
     7    Version: 1.1.0
     8    Network: true
    89    Author URI: http://blog.ftwr.co.uk/
    910    Text Domain: wordpress-beta-tester
     
    1415
    1516    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
    1718    published by the Free Software Foundation.
    1819
     
    2829
    2930class wp_beta_tester {
    30     var $real_wp_version;
    31     var $real_wpmu_version = false;
    3231
    3332    function __construct() {
    3433        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' ) );
    4036        add_action( 'update_option_wp_beta_tester_stream', array(
    4137            &$this,
     
    4743    }
    4844
    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;
    5162    }
    5263
     
    7182    function action_admin_init() {
    7283        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        );
    7489    }
    7590
    7691    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';
    8194
    8295        add_submenu_page(
     
    8497            __( 'Beta Testing WordPress', 'wordpress-beta-tester' ),
    8598            __( 'Beta Testing', 'wordpress-beta-tester' ),
    86             'update_plugins',
     99            $capability,
    87100            'wp_beta_tester',
    88101            array( &$this, 'display_page' )
     
    133146
    134147    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.
    138154        if ( ! isset( $preferred->current ) ) {
    139             return $GLOBALS['wp_version'];
     155            return $wp_version;
    140156        }
    141157
     
    153169                    $versions[1] = 0;
    154170                }
    155 
    156171                $wp_version = $versions[0] . '.' . $versions[1] . '-wp-beta-tester';
    157 
    158172                break;
    159173        }
     
    171185
    172186    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' );
    178188    }
    179189
    180190    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         }
    184191        $preferred = $this->_get_preferred_from_update_core();
    185192
    186193        ?>
    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; ?>
    189203            <div class="updated fade">
    190204                <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>
     
    205219
    206220                <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' ); ?>
    208224                    <fieldset>
    209225                        <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' ); ?>
    214227                        <table class="form-table">
    215228                            <tr>
    216229                                <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' ); ?>
    219233                                    </label></th>
    220234                                <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>
     
    222236                            <tr>
    223237                                <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' ); ?>
    226241                                    </label></th>
    227242                                <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>
     
    230245                    </fieldset>
    231246                    <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>
    233248                </form>
    234249                <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>
     
    239254}
    240255
    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 */
     257add_action( 'plugins_loaded', function() {
     258    global $wp_beta_tester_instance;
     259    $wp_beta_tester_instance = new wp_beta_tester();
     260} );
    243261
    244262// Clear down
  • wordpress-beta-tester/trunk/readme.txt

    r1545401 r1565499  
    11=== WordPress Beta Tester  ===
    22Tags: beta, advanced, testing
    3 Contributors: westi, mlteal
     3Contributors: westi, mlteal, afragen
    44Tested up to: 4.7
    55Requires at least: 3.0.5
    6 Stable Tag: 1.0.2
     6Stable Tag: 1.1.0
    77License: GPLv2
    88License URI: http://www.opensource.org/licenses/GPL-2.0
     
    1313This plugin provides an easy way to get involved with Beta testing WordPress.
    1414
    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. 
     15Once 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.
    1616
    1717By default once enabled it switches your blog onto the point release development track.
     
    2222
    2323== Changelog ==
     24
     25= 1.1.0 =
     26* Fixed to work properly under Multisite.
    2427
    2528= 1.0.2 =
     
    7578* Added translation files for Albanian and French.
    7679
    77 = 0.8 = 
     80= 0.8 =
    7881* Fixed noticed on dashboard after upgrade and before the update api data was refreshed
    7982* Added translation files for German, Bosnian, Italian, Polish and Romanian.
     
    8487* Fixed issue with calls to get_preferred_from_update_core() when running on a cron hook.
    8588
    86 = 0.6 = 
     89= 0.6 =
    8790* Update the code to validate the returned upgrade url so as to ensure that we only offer to upgrade to builds that exist.
    8891
  • wordpress-beta-tester/trunk/wp-beta-tester.php

    r1545401 r1565499  
    55    Description: Allows you to easily upgrade to Beta releases.
    66    Author: Peter Westwood
    7     Version: 1.0.2
     7    Version: 1.1.0
     8    Network: true
    89    Author URI: http://blog.ftwr.co.uk/
    910    Text Domain: wordpress-beta-tester
     
    1415
    1516    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
    1718    published by the Free Software Foundation.
    1819
     
    2829
    2930class wp_beta_tester {
    30     var $real_wp_version;
    31     var $real_wpmu_version = false;
    3231
    3332    function __construct() {
    3433        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' ) );
    4036        add_action( 'update_option_wp_beta_tester_stream', array(
    4137            &$this,
     
    4743    }
    4844
    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;
    5162    }
    5263
     
    7182    function action_admin_init() {
    7283        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        );
    7489    }
    7590
    7691    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';
    8194
    8295        add_submenu_page(
     
    8497            __( 'Beta Testing WordPress', 'wordpress-beta-tester' ),
    8598            __( 'Beta Testing', 'wordpress-beta-tester' ),
    86             'update_plugins',
     99            $capability,
    87100            'wp_beta_tester',
    88101            array( &$this, 'display_page' )
     
    133146
    134147    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.
    138154        if ( ! isset( $preferred->current ) ) {
    139             return $GLOBALS['wp_version'];
     155            return $wp_version;
    140156        }
    141157
     
    153169                    $versions[1] = 0;
    154170                }
    155 
    156171                $wp_version = $versions[0] . '.' . $versions[1] . '-wp-beta-tester';
    157 
    158172                break;
    159173        }
     
    171185
    172186    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' );
    178188    }
    179189
    180190    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         }
    184191        $preferred = $this->_get_preferred_from_update_core();
    185192
    186193        ?>
    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; ?>
    189203            <div class="updated fade">
    190204                <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>
     
    205219
    206220                <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' ); ?>
    208224                    <fieldset>
    209225                        <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' ); ?>
    214227                        <table class="form-table">
    215228                            <tr>
    216229                                <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' ); ?>
    219233                                    </label></th>
    220234                                <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>
     
    222236                            <tr>
    223237                                <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' ); ?>
    226241                                    </label></th>
    227242                                <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>
     
    230245                    </fieldset>
    231246                    <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>
    233248                </form>
    234249                <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>
     
    239254}
    240255
    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 */
     257add_action( 'plugins_loaded', function() {
     258    global $wp_beta_tester_instance;
     259    $wp_beta_tester_instance = new wp_beta_tester();
     260} );
    243261
    244262// Clear down
Note: See TracChangeset for help on using the changeset viewer.