WordPress.org

Plugin Directory

Changeset 756146


Ignore:
Timestamp:
08/14/13 13:36:49 (8 months ago)
Author:
westi
Message:

Beta Tester: Documentation and Whitespace fixes. Props kpdesign.

See: http://wordpress.org/support/topic/add-new-plugin-favourites

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wordpress-beta-tester/trunk/wp-beta-tester.php

    r752859 r756146  
    99    License: GPL v2 or later 
    1010*/ 
    11 /*  Copyright 2009-2011  Peter Westwood (email : peter.westwood@ftwr.co.uk) 
     11/*  Copyright 2009-2013 Peter Westwood (email : peter.westwood@ftwr.co.uk) 
    1212 
    1313    This program is free software; you can redistribute it and/or modify 
     
    2727    var $real_wp_version; 
    2828    var $real_wpmu_version = false; 
    29      
     29 
    3030    function wp_beta_tester() { 
    3131        add_action('admin_init', array(&$this, 'action_admin_init')); 
     
    3737        add_action('admin_head-update-core.php', array(&$this, 'action_admin_head_plugins_php')); 
    3838    } 
    39      
     39 
    4040    function action_admin_head_plugins_php() { 
    4141        // Workaround the check throttling in wp_version_check() 
     
    4949        if ( $this->check_if_settings_downgrade() ) { 
    5050            ?> 
    51                 <div id="message" class="error"><p><?php printf( __('<strong>Error:</strong> Your current <a href="%1$s">WordPress Beta Tester plugin configuration</a> will downgrade your install to a previous version - Please reconfigure it.', 'wp-beta-tester'), admin_url('tools.php?page=wp_beta_tester') ) ?></p></div> 
     51                <div id="message" class="error"><p><?php printf( __('<strong>Error:</strong> Your current <a href="%1$s">WordPress Beta Tester plugin configuration</a> will downgrade your install to a previous version - please reconfigure it.', 'wp-beta-tester'), admin_url('tools.php?page=wp_beta_tester') ) ?></p></div> 
    5252            <?php 
    5353        } 
    5454    } 
    55      
     55 
    5656    function action_admin_init() { 
    5757        register_setting( 'wp_beta_tester_options', 'wp_beta_tester_stream', array(&$this,'validate_setting') ); 
    5858    } 
    59      
     59 
    6060    function action_admin_menu() { 
    6161        add_management_page(__('Beta Testing WordPress','wp-beta-tester'), __('Beta Testing','wp-beta-tester'), 'update_plugins', 'wp_beta_tester', array(&$this,'display_page')); 
    6262    } 
    63      
     63 
    6464    function action_init() { 
    6565        // Load our textdomain 
    6666        load_plugin_textdomain('wp-beta-tester', false , basename(dirname(__FILE__)).'/languages'); 
    6767    } 
    68      
     68 
    6969    function filter_http_request($result, $args, $url) { 
    7070        if ( $result || isset($args['_beta_tester']) ) 
     
    8282            if ( !empty($wpmu_version) ) // old 2.9.2 WPMU 
    8383                $url = str_replace('wpmu_version=' .  $wpmu_version, 'wpmu_version=' . $this->mangle_wp_version(), $url); 
    84      
     84 
    8585            return wp_remote_get($url, $args); 
    8686        } elseif ( 0 !== strpos( $url, 'https://api.wordpress.org/plugins/' ) ) { 
     
    9292        return $result; 
    9393    } 
    94      
     94 
    9595    function action_update_option_wp_beta_tester_stream() { 
    9696        //Our option has changed so update the cached information pronto. 
    9797        do_action('wp_version_check'); 
    9898    } 
    99      
     99 
    100100    function _get_preferred_from_update_core() { 
    101101        if (!function_exists('get_preferred_from_update_core') ) 
     
    110110        return $preferred; 
    111111    } 
    112      
     112 
    113113    function mangle_wp_version(){ 
    114114        $stream = get_option('wp_beta_tester_stream','point'); 
     
    138138        return $wp_version; 
    139139    } 
    140      
     140 
    141141    function check_if_settings_downgrade() { 
    142142        global $wp_version; 
     
    145145        return version_compare($wp_mangled_version[0], $wp_real_version[0], 'lt'); 
    146146    } 
    147      
     147 
    148148    function validate_setting($setting) { 
    149149        if (!in_array($setting, array('point','unstable'))) 
     
    165165        <h2><?php _e('Beta Testing WordPress','wp-beta-tester')?></h2> 
    166166        <div class="updated fade"> 
    167             <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 maybe updated during the development of a major release.', 'wp-beta-tester'); ?></p>     
     167            <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.', 'wp-beta-tester'); ?></p>  
    168168        </div> 
    169169            <?php if ('development' != $preferred->response) : ?> 
    170170        <div class="updated fade"> 
    171             <p><?php _e('<strong>Please note:</strong> There are no development builds of the beta stream you have choosen available so you will receieve normal update notifications.', 'wp-beta-tester'); ?></p> 
     171            <p><?php _e('<strong>Please note:</strong> There are no development builds of the beta stream you have choosen available, so you will receive normal update notifications.', 'wp-beta-tester'); ?></p> 
    172172        </div> 
    173173            <?php endif;?> 
    174174            <?php $this->action_admin_head_plugins_php(); //Check configuration?> 
    175175        <div> 
    176             <p><?php echo sprintf(__(   'By their nature these releases are unstable and should not be used anyplace where your data is important. So please <a href="%1$s">backup your database</a> before upgrading to a test release. In order to hear about the latest beta releases your best bet is to watch the <a href="%2$s">development blog</a> and the <a href="%3$s">beta forum</a>','wp-beta-tester'), 
     176            <p><?php echo sprintf(__(   'By their nature, these releases are unstable and should not be used anyplace where your data is important. So please <a href="%1$s">back up your database</a> before upgrading to a test release. In order to hear about the latest beta releases, your best bet is to watch the <a href="%2$s">development blog</a> and the <a href="%3$s">beta forum</a>.','wp-beta-tester'), 
    177177                                        _x('http://codex.wordpress.org/Backing_Up_Your_Database', 'Url to database backup instructions', 'wp-beta-tester'), 
    178                                         _x('http://wordpress.org/development/', 'Url to development blog','wp-beta-tester'), 
     178                                        _x('http://make.wordpress.org/core/', 'Url to development blog','wp-beta-tester'), 
    179179                                        _x('http://wordpress.org/support/forum/12', 'Url to beta support forum', 'wp-beta-tester') ); ?></p> 
    180             <p><?php echo sprintf(__(   'Thank you for helping in testing WordPress please <a href="%s">report any bugs you find</a>.', 'wp-beta-tester'), 
    181                                         _x('http://core.trac.wordpress.org/newticket', 'Url to raise a new trac ticket', 'wp-beta-tester') ); ?></p> 
    182      
    183             <p><?php _e('By default your WordPress install uses the stable update stream, to return to this please deactivate this plugin', 'wp-beta-tester'); ?></p> 
     180            <p><?php echo sprintf(__(   'Thank you for helping by testing WordPress. Please <a href="%s">report any bugs you find</a>.', 'wp-beta-tester'), 
     181                                        _x('http://core.trac.wordpress.org/newticket', 'Url to create a new trac ticket', 'wp-beta-tester') ); ?></p> 
     182 
     183            <p><?php _e('By default, your WordPress install uses the stable update stream. To return to this, please deactivate this plugin.', 'wp-beta-tester'); ?></p> 
    184184            <form method="post" action="options.php"><?php settings_fields('wp_beta_tester_options'); ?> 
    185185            <fieldset><legend><?php _e('Please select the update stream you would like this blog to use:','wp-beta-tester')?></legend> 
     
    192192                        id="update-stream-point-nightlies" type="radio" value="point" 
    193193                        class="tog" <?php checked('point', $stream); ?> /><?php _e('Point release nightlies','wp-beta-tester');?></label></th> 
    194                     <td><?php _e('This contains the work that is occuring on a branch in preperation for a x.x.x point release.  This should also be fairly stable but will be available before the branch is ready for beta.','wp-beta-tester'); ?></td> 
     194                    <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.','wp-beta-tester'); ?></td> 
    195195                </tr> 
    196196                <tr> 
     
    205205                value="<?php _e('Save Changes') ?>" /></p> 
    206206            </form> 
    207             <p><?php echo sprintf(__( 'Why don\'t you <a href="%s">head on over and upgrade now</a>.','wp-beta-tester' ), 'update-core.php');  ?></p> 
     207            <p><?php echo sprintf(__( 'Why don\'t you <a href="%s">head on over and upgrade now</a>.','wp-beta-tester' ), 'update-core.php'); ?></p> 
    208208        </div> 
    209209    </div> 
Note: See TracChangeset for help on using the changeset viewer.