Skip to content

Commit

Permalink
add README, change constant prefix to more easily identify source
Browse files Browse the repository at this point in the history
  • Loading branch information
afragen committed Dec 4, 2018
1 parent 9ef02d9 commit ad38394
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 3 deletions.
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# WordPress Beta Tester
* Tags: beta, advanced, testing
* Contributors: [westi](https://github.com/westi), [mlteal](https://github.com/mlteal), [afragen](https://github.com/afragen)
* Tested up to: 5.0
* Requires at least: 3.1
* Stable Tag: master
* License: GPLv2
* License URI: https://www.opensource.org/licenses/GPL-2.0
* Requires PHP: 5.2.4

Allows you to easily upgrade to Beta releases.

## Description
This plugin provides an easy way to get involved with Beta testing WordPress.

Once installed it will enable you to upgrade your website to the latest Beta or Release candidate at the click of a button using the built in upgrader.

By default once enabled it switches your website onto the point release development track.

For the more adventurous there is the option to switch to the bleeding edge (trunk) of development.

Don't forget to backup before you start!

In the **Extra Settings** tab are choices for testing features in trunk that may require constants to be set. A checked feature will add a constant to the user's `wp-config.php` file in the format as follows:

`define( 'WP_BETA_TESTER_{$feature}', true );`

Unchecking the feature will remove the constant.

If no settings are present there is no testing to be done that requires this feature.

PRs are welcome on [GitHub](https://github.com/afragen/wordpress-beta-tester).
4 changes: 2 additions & 2 deletions src/WPBT_Extras.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,15 @@ private function update_constants( $old, $new ) {
// Use class WPConfigTransformer to add constant.
$config_transformer = new WPConfigTransformer( ABSPATH . 'wp-config.php' );
foreach ( array_keys( $add ) as $constant ) {
$feature_flag = strtoupper( 'feature_' . $constant );
$feature_flag = strtoupper( 'wp_beta_tester_' . $constant );
$config_transformer->add( 'constant', $feature_flag, 'true', array( 'raw' => true ) );
}
}
if ( ! empty( $remove ) ) {
// Use class WPConfigTransformer to remove constant.
$config_transformer = new WPConfigTransformer( ABSPATH . 'wp-config.php' );
foreach ( array_keys( $remove ) as $constant ) {
$feature_flag = strtoupper( 'feature_' . $constant );
$feature_flag = strtoupper( 'wp_beta_tester_' . $constant );
$config_transformer->remove( 'constant', $feature_flag );
}
}
Expand Down
2 changes: 1 addition & 1 deletion wp-beta-tester.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* Plugin URI: https://wordpress.org/plugins/wordpress-beta-tester/
* Description: Allows you to easily upgrade to Beta releases.
* Author: Peter Westwood, Andy Fragen
* Version: 1.2.6.7
* Version: 1.2.6.8
* Network: true
* Author URI: https://blog.ftwr.co.uk/
* Text Domain: wordpress-beta-tester
Expand Down

0 comments on commit ad38394

Please sign in to comment.