Fixed conflicts

This commit is contained in:
Claudio Sanches 2021-03-13 02:11:01 -03:00
commit 6ce34ae126
17 changed files with 482 additions and 175 deletions

View File

@ -0,0 +1,17 @@
.distignore
.editorconfig
.gitignore
.travis.yml
.git/
.wordpress-org/
composer.json
composer.lock
package-lock.json
package.json
phpcs.xml
# build files
woocommerce-beta-tester.zip
node_modules/
build/
bin/

View File

@ -1,2 +1,4 @@
vendor/
node_modules/
build/
woocommerce-beta-tester.zip

View File

@ -0,0 +1,3 @@
.plugins_page_wc-beta-tester-version-picker .wc-backbone-modal-main .wc-backbone-modal-header h1 {
margin: 0 35px 0 0;
}

View File

@ -0,0 +1,28 @@
#!/bin/sh
PLUGIN_SLUG="woocommerce-beta-tester"
PROJECT_PATH=$(pwd)
BUILD_PATH="${PROJECT_PATH}/build"
DEST_PATH="$BUILD_PATH/$PLUGIN_SLUG"
echo "Generating build directory..."
rm -rf "$BUILD_PATH"
mkdir -p "$DEST_PATH"
echo "Installing PHP and JS dependencies..."
npm install
echo "Running JS Build..."
npm run uglify
echo "Syncing files..."
rsync -rc --exclude-from="$PROJECT_PATH/.distignore" "$PROJECT_PATH/" "$DEST_PATH/" --delete --delete-excluded
echo "Generating zip file..."
cd "$BUILD_PATH" || exit
zip -q -r "${PLUGIN_SLUG}.zip" "$PLUGIN_SLUG/"
cd "$PROJECT_PATH" || exit
mv "$BUILD_PATH/${PLUGIN_SLUG}.zip" "$PROJECT_PATH"
echo "${PLUGIN_SLUG}.zip file generated!"
echo "Build done!"

View File

@ -1,113 +0,0 @@
#!/bin/sh
echo "-------------------------------------------------------"
echo " WOOCOMMERCE BETA TESTER RELEASER "
echo "-------------------------------------------------------"
# TEST USER SETTINGS
if [ -r $HOME/.wc-deploy ]; then
echo "User config file read successfully!"
. $HOME/.wc-deploy
else
echo "You need create a ~/.wc-deploy file with your GITHUB_ACCESS_TOKEN settings."
echo "Deploy aborted!"
exit
fi
if [ -z $GITHUB_ACCESS_TOKEN ]; then
echo "You need set the GITHUB_ACCESS_TOKEN in your ~/.wc-deploy file."
echo "Deploy aborted!"
exit
fi
# ASK INFO
read -p "VERSION: " VERSION
read -p "BRANCH: " BRANCH
echo "-------------------------------------------"
read -p "PRESS [ENTER] TO RELEASE VERSION ${VERSION} USING BRANCH ${BRANCH}"
# VARS
BUILD_PATH=$(pwd)"/build"
PRODUCT_NAME="woocommerce-beta-tester"
PRODUCT_NAME_GIT=${PRODUCT_NAME}"-git"
PRODUCT_NAME_SVN=${PRODUCT_NAME}"-svn"
SVN_REPO="http://plugins.svn.wordpress.org/woocommerce-beta-tester/"
GIT_REPO="https://github.com/woocommerce/woocommerce-beta-tester.git"
SVN_PATH="$BUILD_PATH/$PRODUCT_NAME_SVN"
GIT_PATH="$BUILD_PATH/$PRODUCT_NAME_GIT"
# Create build directory if does not exists
if [ ! -d $BUILD_PATH ]; then
mkdir -p $BUILD_PATH
fi
# CHECKOUT SVN DIR IF NOT EXISTS
if [ ! -d $SVN_PATH ]; then
echo "No SVN directory found, will do a checkout"
svn checkout $SVN_REPO $SVN_PATH
fi
# DELETE OLD GIT DIR
rm -Rf $GIT_PATH
# CLONE GIT DIR
echo "Cloning GIT repo"
git clone $GIT_REPO $GIT_PATH --branch ${BRANCH} --single-branch
# MOVE INTO SVN DIR
cd $SVN_PATH
# UPDATE SVN
echo "Updating SVN"
svn update
# COPY GIT DIR TO TRUNK
cd $GIT_PATH
# rsync ./ $SVN_PATH/tags/${VERSION}/ --recursive --verbose --delete --delete-excluded \
rsync ./ $SVN_PATH/trunk/ --recursive --verbose --delete --delete-excluded \
--exclude=".*/" \
--exclude="*.md" \
--exclude=".*" \
--exclude="composer.*" \
--exclude="*.lock" \
--exclude=/vendor/ \
--exclude=apigen.neon \
--exclude=apigen/ \
--exclude=bin/ \
--exclude=CHANGELOG.txt \
--exclude=Gruntfile.js \
--exclude=node_modules/ \
--exclude=package.json \
--exclude=package-lock.json \
--exclude=phpcs.xml \
--exclude=phpunit.xml \
--exclude=phpunit.xml.dist \
--exclude=README.md \
--exclude=tests/
cd $SVN_PATH
# DO THE REMOVE ALL DELETED FILES UNIX COMMAND
svn rm $( svn status | sed -e '/^!/!d' -e 's/^!//' )
# DO THE ADD ALL NOT KNOWN FILES UNIX COMMAND
svn add --force * --auto-props --parents --depth infinity -q
# COPY TRUNK TO TAGS/$VERSION
svn copy trunk tags/${VERSION}
# REMOVE THE GIT DIR
echo "Removing GIT dir"
rm -Rf $GIT_PATH
# CREATE THE GITHUB RELEASE
echo "Creating GITHUB release"
API_JSON=$(printf '{"tag_name": "%s","target_commitish": "%s","name": "%s","body": "Release of version %s","draft": false,"prerelease": false}' $VERSION $BRANCH $VERSION $VERSION)
curl --data "$API_JSON" https://api.github.com/repos/woocommerce/${PRODUCT_NAME}/releases?access_token=${GITHUB_ACCESS_TOKEN}
# DO SVN COMMIT
svn status
echo "svn commit -m \"Release "${VERSION}", see readme.txt for changelog.\""
# DONE, BYE
echo "RELEASER DONE"

View File

@ -0,0 +1 @@
== Changelog ==

View File

@ -23,16 +23,19 @@ class WC_Beta_Tester_Admin_Assets {
* Enqueue scripts.
*/
public function admin_scripts() {
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
$screen = get_current_screen();
$screen_id = $screen ? $screen->id : '';
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
$version = WC_VERSION;
// Need admin styles for the modal.
wp_enqueue_style( 'woocommerce_admin_styles' );
wp_register_style( 'wc-beta-tester-admin', WC_Beta_Tester::instance()->plugin_url() . '/assets/css/admin.css', array( 'woocommerce_admin_styles' ) );
// Register scripts.
wp_register_script( 'wc-beta-tester-version-info', WC_Beta_Tester::instance()->plugin_url() . '/assets/js/version-information' . $suffix . '.js', array( 'wc-backbone-modal' ), WC_BETA_TESTER_VERSION );
wp_register_script( 'wc-beta-tester-version-picker', WC_Beta_Tester::instance()->plugin_url() . '/assets/js/version-picker' . $suffix . '.js', array( 'wc-backbone-modal' ), WC_BETA_TESTER_VERSION );
$version = WC_VERSION;
wp_localize_script(
'wc-beta-tester-version-info',
'wc_beta_tester_version_info_params',
@ -51,8 +54,11 @@ class WC_Beta_Tester_Admin_Assets {
)
);
wp_enqueue_script( 'wc-beta-tester-version-info' );
wp_enqueue_script( 'wc-beta-tester-version-picker' );
if ( in_array( $screen_id, array( 'woocommerce_page_wc-beta-tester', 'woocommerce_page_wc-beta-tester-version-picker' ) ) ) {
wp_enqueue_style( 'wc-beta-tester-admin' );
wp_enqueue_script( 'wc-beta-tester-version-info' );
wp_enqueue_script( 'wc-beta-tester-version-picker' );
}
}
}

View File

@ -20,6 +20,7 @@ class WC_Beta_Tester_Admin_Menus {
add_action( 'admin_bar_menu', array( $this, 'admin_bar_menus' ), 50 );
}
add_action( 'admin_footer', array( $this, 'version_information_template' ) );
add_action( 'admin_head', array( $this, 'hide_from_menus' ) );
}
/**
@ -152,16 +153,20 @@ Copy and paste the system status report from **WooCommerce > System Status** in
* @return string
*/
protected function construct_ssr() {
if ( version_compare( WC()->version, '3.6', '<' ) ) {
return '';
}
$transient_name = 'wc-beta-tester-ssr';
$ssr = get_transient( $transient_name );
if ( false === $ssr ) {
// When running WC 3.6 or greater it is necessary to manually load the REST API classes.
if ( version_compare( WC()->version, '3.6', '>=' ) && ! did_action( 'rest_api_init' ) ) {
if ( ! did_action( 'rest_api_init' ) ) {
WC()->api->rest_api_includes();
}
if ( ! class_exists( 'WC_REST_System_Status_Controller', false ) ) {
if ( ! class_exists( 'WC_REST_System_Status_Controller' ) ) {
return '';
}
@ -184,10 +189,7 @@ Copy and paste the system status report from **WooCommerce > System Status** in
$ssr = '';
foreach ( $response['environment'] as $key => $value ) {
$index = $key;
// @todo remove this hack after fix schema in WooCommerce, and Claudio never let you folks forget that need to write schema first, and review after every change, schema is the most important part of the REST API.
if ( 'version' === $index ) {
$index = 'wc_version';
} elseif ( 'external_object_cache' === $index ) {
if ( 'external_object_cache' === $index ) {
$ssr .= sprintf( "%s: %s\n", 'External object cache', wc_bool_to_string( $value ) );
continue;
}
@ -285,6 +287,12 @@ Copy and paste the system status report from **WooCommerce > System Status** in
'title' => sprintf( __( 'Channel: %s', 'woocommerce-beta-tester' ), $current_channel ),
'href' => admin_url( 'plugins.php?page=wc-beta-tester' ),
),
array(
'parent' => 'wc-beta-tester',
'id' => 'import-export-settings',
'title' => __( 'Import/Export Settings', 'woocommerce-beta-tester' ),
'href' => admin_url( 'admin.php?page=wc-beta-tester-settings' ),
),
array(
'parent' => 'wc-beta-tester',
'id' => 'show-version-info',
@ -315,6 +323,22 @@ Copy and paste the system status report from **WooCommerce > System Status** in
}
}
/**
* Hide menu items from view so the pages exist, but the menu items do not.
*/
public function hide_from_menus() {
global $submenu;
$items_to_remove = array( 'wc-beta-tester-settings', 'wc-beta-tester-version-picker', 'wc-beta-tester' );
if ( isset( $submenu['plugins.php'] ) ) {
foreach ( $submenu['plugins.php'] as $key => $menu ) {
if ( in_array( $menu[2], $items_to_remove ) ) {
unset( $submenu['plugins.php'][ $key ] );
}
}
}
}
/**
* Template for version information.
*/

View File

@ -0,0 +1,213 @@
<?php
/**
* Beta Tester settings export class
*
* @package WC_Beta_Tester
*/
defined( 'ABSPATH' ) || exit;
/**
* WC_Beta_Tester_Settings_Export Main Class.
*/
class WC_Beta_Tester_Import_Export {
/**
* @var string WordPress ajax hook
*/
protected const AJAX_HOOK = 'wc_beta_tester_export_settings';
/**
* @var string WordPress nonce action
*/
protected const NONCE_ACTION = 'wc-beta-tester-import-settings';
/**
* @var string WordPress import action
*/
protected const IMPORT_ACTION = 'wc-beta-tester-import';
/**
* @var string WordPress import capability
*/
protected const IMPORT_CAP = 'install_plugins';
/**
* @var string WordPress import file name
*/
protected const IMPORT_FILENAME = 'woocommerce-settings-json';
/**
* @var array Import status message
*/
protected $message;
/**
* Class constructor.
*/
public function __construct() {
$this->add_hooks();
}
/**
* Hook into WordPress.
*/
public function add_hooks() {
add_action( 'admin_menu', array( $this, 'add_to_menu' ), 55 );
add_action( 'wp_ajax_' . static::AJAX_HOOK, array( $this, 'export_settings' ) );
}
/**
* Add options page to menu
*/
public function add_to_menu() {
add_submenu_page( 'plugins.php', __( 'WC Beta Tester Import/Export', 'woocommerce-beta-tester' ), __( 'WC Import/Export', 'woocommerce-beta-tester' ), static::IMPORT_CAP, 'wc-beta-tester-settings', array( $this, 'settings_page_html' ) );
}
/**
* Output settings HTML
*/
public function settings_page_html() {
if ( ! current_user_can( static::IMPORT_CAP ) ) {
return;
}
$export_url = wp_nonce_url( admin_url( 'admin-ajax.php?action=wc_beta_tester_export_settings' ), static::NONCE_ACTION );
$this->maybe_import_settings();
// show error/update messages.
if ( ! empty( $this->message ) ) {
?>
<div class="notice <?php
echo ! empty( $this->message['type'] ) ? esc_attr( $this->message['type'] ) : '';
?>"><?php echo esc_html( $this->message['message'] ); ?></div>
<?php
}
?>
<div class="wrap">
<h1><?php echo esc_html( get_admin_page_title() ); ?></h1>
<p><?php esc_html_e( 'Export your WooCommerce Settings. The export file should not contain any fields that identify your site or reveal secrets (eg. API keys).', 'woocommerce-beta-tester' ); ?></p>
<a href="<?php echo esc_url( $export_url ) ?>" class="button-primary"><?php
/* translators Export WooCommerce settings button text. */
esc_html_e( 'Export WooCommerce Settings', 'woocommerce-beta-tester' );
?></a>
<hr />
<form method="POST" enctype="multipart/form-data">
<?php wp_nonce_field( static::NONCE_ACTION ); ?>
<input type="hidden" name="action" value="<?php echo static::IMPORT_ACTION; ?>" />
<p><?php esc_html_e( 'Import WooCommerce Settings exported with this tool. Some settings like store address, payment gateways, etc. will need to be configured manually.', 'woocommerce-beta-tester' ); ?></p>
<button type="submit" class="button-primary"><?php
/* translators Import WooCommerce settings button text. */
esc_html_e( 'Import WooCommerce Settings', 'woocommerce-beta-tester' );
?></button>
<input type="file" name="<?php echo static::IMPORT_FILENAME; ?>" />
</form>
</div>
<?php
}
/**
* Export settings in json format.
*/
public function export_settings() {
if ( ! wp_verify_nonce( $_REQUEST['_wpnonce'], static::NONCE_ACTION ) ) {
header( 'HTTP/1.1 403 Forbidden' );
exit;
}
$filename = sprintf( 'woocommerce-settings-%s.json', gmdate( 'Ymdgi' ) );
wc_set_time_limit( 0 );
wc_nocache_headers();
header( 'Content-Type: text/csv; charset=utf-8' );
header( 'Content-Disposition: attachment; filename=' . $filename );
header( 'Pragma: no-cache' );
header( 'Expires: 0' );
echo wp_json_encode( $this->get_settings() );
exit;
}
/**
* Import settings in json format if submitted.
*/
public function maybe_import_settings() {
if ( empty( $_POST ) || empty( $_POST['action'] ) || $_POST['action'] !== static::IMPORT_ACTION ) {
return;
}
if ( ! wp_verify_nonce( $_POST['_wpnonce'], static::NONCE_ACTION ) ) {
$this->add_message( __( 'Invalid submission', 'woocommerce-beta-tester' ) );
return;
}
if ( empty( $_FILES[ static::IMPORT_FILENAME ] ) ) {
$this->add_message( __( 'No file uploaded.', 'woocommerce-beta-tester' ) );
return;
}
$tmp_file = $_FILES[ static::IMPORT_FILENAME ]['tmp_name'];
if ( empty( $tmp_file ) ) {
$this->add_message( __( 'No file uploaded.', 'woocommerce-beta-tester' ) );
return;
}
if ( ! is_readable( $tmp_file ) ) {
$this->add_message( __( 'File could not be read.', 'woocommerce-beta-tester' ) );
return;
}
$maybe_json = file_get_contents( $tmp_file );
$settings = json_decode( $maybe_json, true );
if ( $settings !== null ) {
foreach ( $this->get_setting_list() as $option_name ) {
if ( ! isset( $settings[ $option_name ] ) ) {
continue;
}
$setting = maybe_unserialize( $settings[ $option_name ] );
if ( is_null( $setting ) ) {
delete_option( $option_name );
} else {
update_option( $option_name, $setting );
}
}
$this->add_message( __( 'Settings Imported', 'woocommerce-beta-tester' ), 'updated' );
} else {
$this->add_message( __( 'File did not contain well formed JSON.', 'woocommerce-beta-tester' ) );
}
}
/**
* Get an array of the WooCommerce related settings.
*/
protected function get_settings() {
$settings = array();
if ( current_user_can( 'manage_woocommerce' ) ) {
foreach ( $this->get_setting_list() as $option_name ) {
$setting = get_option( $option_name );
if ( false === $setting ) {
$setting = null;
}
$settings[ $option_name ] = is_string( $setting ) ? $setting : serialize( $setting );
}
}
return $settings;
}
/**
* Add a settings import status message.
*
* @param string $message Message string.
* @param string $type Message type. Optional. Default 'error'.
*/
protected function add_message( $message, $type = 'error' ) {
$this->message = array(
'message' => $message,
'type' => $type
);
}
/**
* Get the WooCommerce settings list keys.
*/
private function get_setting_list() {
require_once( dirname(__FILE__ ) . '/wc-beta-tester-settings-list.php');
return wc_beta_tester_setting_list();
}
}

View File

@ -24,7 +24,6 @@ class WC_Beta_Tester_Version_Picker {
*/
public function __construct() {
add_action( 'admin_menu', array( $this, 'add_to_menus' ) );
add_action( 'admin_head', array( $this, 'hide_from_menus' ) );
add_action( 'admin_init', array( $this, 'handle_version_switch' ) );
}
@ -112,21 +111,6 @@ class WC_Beta_Tester_Version_Picker {
);
}
/**
* Hide menu items from view so the pages exist, but the menu items do not.
*/
public function hide_from_menus() {
global $submenu;
if ( isset( $submenu['plugins.php'] ) ) {
foreach ( $submenu['plugins.php'] as $key => $menu ) {
if ( 'wc-beta-tester-version-picker' === $menu[2] || 'wc-beta-tester' === $menu[2] ) {
unset( $submenu['plugins.php'][ $key ] );
}
}
}
}
/**
* Return HTML code representation of list of WooCommerce versions for the selected channel.
*

View File

@ -86,7 +86,7 @@ class WC_Beta_Tester {
);
add_filter( "plugin_action_links_{$this->plugin_name}", array( $this, 'plugin_action_links' ), 10, 1 );
add_filter( 'auto_update_plugin', 'auto_update_woocommerce', 100, 2 );
add_filter( 'auto_update_plugin', array( $this, 'auto_update_woocommerce' ), 100, 2 );
if ( 'stable' !== $this->get_settings()->channel ) {
add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'api_check' ) );
@ -106,7 +106,7 @@ class WC_Beta_Tester {
}
/**
* Check wether or not the transients need to be overruled and API needs to be called for every single page load
* Check whether or not the transients need to be overruled and API needs to be called for every single page load
*
* @return bool overrule or not
*/
@ -343,7 +343,7 @@ class WC_Beta_Tester {
* @return bool
*/
public function auto_update_woocommerce( $update, $plugin ) {
if ( true === $this->get_settings()->auto_update && 'woocommerce' === $item->slug ) {
if ( true === $this->get_settings()->auto_update && 'woocommerce' === $plugin->slug ) {
return true;
} else {
return $update;
@ -426,6 +426,11 @@ class WC_Beta_Tester {
unset( $releases['trunk'] );
$releases = array_keys( $releases );
foreach ( $releases as $index => $version ) {
if ( version_compare( $version, '3.6', '<' ) ) {
unset( $releases[ $index ] );
}
}
if ( 'beta' === $channel ) {
$releases = array_filter( $releases, array( __CLASS__, 'is_in_beta_channel' ) );

View File

@ -19,7 +19,12 @@ defined( 'ABSPATH' ) || exit;
<?php if ( ! is_plugin_active( 'woocommerce/woocommerce.php' ) && current_user_can( 'activate_plugin', 'woocommerce/woocommerce.php' ) ) : ?>
<p>
<?php
$installed_plugins = get_plugins();
if ( isset( $installed_plugins['woocommerce/woocommerce.php'] ) ) :
?>
<a href="<?php echo esc_url( wp_nonce_url( self_admin_url( 'plugins.php?action=activate&plugin=woocommerce/woocommerce.php&plugin_status=active' ), 'activate-plugin_woocommerce/woocommerce.php' ) ); ?>" class="button button-primary"><?php esc_html_e( 'Activate WooCommerce', 'woocommerce-beta-tester' ); ?></a>
<?php endif; ?>
<?php if ( current_user_can( 'deactivate_plugin', 'woocommerce-beta-tester/woocommerce-beta-tester.php' ) ) : ?>
<a href="<?php echo esc_url( wp_nonce_url( 'plugins.php?action=deactivate&plugin=woocommerce-beta-tester/woocommerce-beta-tester.php&plugin_status=inactive', 'deactivate-plugin_woocommerce-beta-tester/woocommerce-beta-tester.php' ) ); ?>" class="button button-secondary"><?php esc_html_e( 'Turn off Beta Tester plugin', 'woocommerce-beta-tester' ); ?></a>
<?php endif; ?>

View File

@ -0,0 +1,128 @@
<?php
/**
* List of settings to be exported.
*/
function wc_beta_tester_setting_list() {
$settings_list = array(
'date_format',
'gmt_offset',
'permalink_structure',
'posts_per_page',
'shop_catalog_image_size',
'shop_single_image_size',
'time_format',
'timezone_string',
'woocommerce_all_except_countries',
'woocommerce_allowed_countries',
'woocommerce_api_enabled',
'woocommerce_calc_discounts_sequentially',
'woocommerce_calc_shipping',
'woocommerce_calc_taxes',
'woocommerce_cart_redirect_after_add',
'woocommerce_catalog_columns',
'woocommerce_catalog_rows',
'woocommerce_category_archive_display',
'woocommerce_checkout_address_2_field',
'woocommerce_checkout_company_field',
'woocommerce_checkout_highlight_required_fields',
'woocommerce_checkout_order_received_endpoint',
'woocommerce_checkout_pay_endpoint',
'woocommerce_checkout_phone_field',
'woocommerce_currency',
'woocommerce_currency_pos',
'woocommerce_db_version',
'woocommerce_default_catalog_orderby',
'woocommerce_default_country',
'woocommerce_default_customer_address',
'woocommerce_delete_inactive_accounts',
'woocommerce_dimension_unit',
'woocommerce_downloads_add_hash_to_filename',
'woocommerce_downloads_grant_access_after_payment',
'woocommerce_downloads_require_login',
'woocommerce_enable_ajax_add_to_cart',
'woocommerce_enable_coupons',
'woocommerce_enable_guest_checkout',
'woocommerce_enable_myaccount_registration',
'woocommerce_enable_order_comments',
'woocommerce_enable_review_rating',
'woocommerce_enable_reviews',
'woocommerce_enable_shipping_calc',
'woocommerce_enable_signup_and_login_from_checkout',
'woocommerce_erasure_request_removes_download_data',
'woocommerce_erasure_request_removes_order_data',
'woocommerce_file_download_method',
'woocommerce_force_ssl_checkout',
'woocommerce_hide_out_of_stock_items',
'woocommerce_hide_products_when_showing_subcategories',
'woocommerce_hold_stock_minutes',
'woocommerce_local_tax_rates',
'woocommerce_logout_endpoint',
'woocommerce_manage_stock',
'woocommerce_myaccount_add_payment_method_endpoint',
'woocommerce_myaccount_delete_payment_method_endpoint',
'woocommerce_myaccount_downloads_endpoint',
'woocommerce_myaccount_edit_account_endpoint',
'woocommerce_myaccount_edit_address_endpoint',
'woocommerce_myaccount_lost_password_endpoint',
'woocommerce_myaccount_orders_endpoint',
'woocommerce_myaccount_payment_methods_endpoint',
'woocommerce_myaccount_set_default_payment_method_endpoint',
'woocommerce_myaccount_view_order_endpoint',
'woocommerce_new_order_settings',
'woocommerce_notify_low_stock',
'woocommerce_notify_low_stock_amount',
'woocommerce_notify_no_stock',
'woocommerce_notify_no_stock_amount',
'woocommerce_permalinks',
'woocommerce_placeholder_image',
'woocommerce_prepend_category_to_products',
'woocommerce_prepend_shop_page_to_products',
'woocommerce_prepend_shop_page_to_urls',
'woocommerce_price_decimal_sep',
'woocommerce_price_display_suffix',
'woocommerce_price_num_decimals',
'woocommerce_price_thousand_sep',
'woocommerce_prices_include_tax',
'woocommerce_product_category_slug',
'woocommerce_product_slug',
'woocommerce_product_tag_slug',
'woocommerce_product_type',
'woocommerce_registration_generate_password',
'woocommerce_registration_generate_username',
'woocommerce_review_rating_required',
'woocommerce_ship_to_billing',
'woocommerce_ship_to_billing_address_only',
'woocommerce_ship_to_countries',
'woocommerce_ship_to_destination',
'woocommerce_shipping_cost_requires_address',
'woocommerce_shipping_debug_mode',
'woocommerce_shipping_tax_class',
'woocommerce_shop_page_display',
'woocommerce_shop_show_subcategories',
'woocommerce_show_marketplace_suggestions',
'woocommerce_show_subcategories',
'woocommerce_single_image_width',
'woocommerce_specific_allowed_countries',
'woocommerce_specific_ship_to_countries',
'woocommerce_stock_format',
'woocommerce_tax_based_on',
'woocommerce_tax_classes',
'woocommerce_tax_display_cart',
'woocommerce_tax_display_shop',
'woocommerce_tax_rates',
'woocommerce_tax_round_at_subtotal',
'woocommerce_tax_total_display',
'woocommerce_thumbnail_cropping',
'woocommerce_thumbnail_cropping_custom_height',
'woocommerce_thumbnail_cropping_custom_width',
'woocommerce_thumbnail_image_width',
'woocommerce_trash_cancelled_orders',
'woocommerce_trash_failed_orders',
'woocommerce_trash_pending_orders',
'woocommerce_unforce_ssl_checkout',
'woocommerce_version',
'woocommerce_weight_unit'
);
return apply_filters( 'wc_beta_tester_setting_list', $settings_list );
}

View File

@ -7,7 +7,7 @@
"url": "git://github.com/woocommerce/woocommerce-beta-tester.git"
},
"title": "WooCommerce Beta Tester",
"version": "1.0.0",
"version": "2.0.2",
"homepage": "http://github.com/woocommerce/woocommerce-beta-tester",
"devDependencies": {
"eslint": "5.16.0",
@ -22,7 +22,8 @@
}
},
"scripts": {
"build": "npm run lint:js && npm run uglify",
"build": "./bin/build-zip.sh",
"build:dev": "npm run lint:js && npm run uglify",
"preuglify": "rm -f $npm_package_assets_js_min",
"uglify": "for f in $npm_package_assets_js_js; do file=${f%.js}; node_modules/.bin/uglifyjs $f -c -m > $file.min.js; done",
"lint:js": "eslint assets/js --ext=js"
@ -50,5 +51,8 @@
"ignore": [
"*.min.js"
]
},
"config": {
"wp_org_slug": "woocommerce-beta-tester"
}
}

View File

@ -1,55 +1,45 @@
=== WooCommerce Beta Tester ===
Contributors: automattic, bor0, claudiosanches, claudiulodro, kloon, mikejolley, peterfabian1000, rodrigosprimo
Contributors: automattic, bor0, claudiosanches, claudiulodro, kloon, mikejolley, peterfabian1000, rodrigosprimo, wpmuguru
Tags: woocommerce, woo commerce, beta, beta tester, bleeding edge, testing
Requires at least: 4.7
Tested up to: 5.1
Stable tag: 2.0.1
Tested up to: 5.6
Stable tag: 2.0.2
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Easily update to prerelease versions of WooCommerce for testing and development
purposes.
Easily update to prerelease versions of WooCommerce for testing and development purposes.
== Description ==
**WooCommerce Beta Tester** allows you to try out new versions of WooCommerce
before they are officially released.
**WooCommerce Beta Tester** allows you to try out new versions of WooCommerce before they are officially released.
**Use with caution, not on production sites. Beta releases may not be stable.**
After activation, you'll be able to choose an update channel:
1. Beta - Update to beta releases, RC, or stable, depending on what is newest.
2. Release Candidate - Update to RC releases or stable, depending on what is
newest.
2. Release Candidate - Update to RC releases or stable, depending on what is newest.
3. Stable - No beta updates. Default WordPress behavior.
These will surface pre-releases via automatic updates in WordPress. Updates will
replace your installed version of WooCommerce.
These will surface pre-releases via automatic updates in WordPress. Updates will replace your installed version of WooCommerce.
**Note**, this will not check for updates on every admin page load unless you
explicitly tell it to. You can do this by clicking the "Check Again" button from
the WordPress updates screen or you can set the `WC_BETA_TESTER_FORCE_UPDATE` to
true in your `wp-config.php` file.
**Note**, this will not check for updates on every admin page load unless you explicitly tell it to. You can do this by clicking the "Check Again" button from the WordPress updates screen or you can set the `WC_BETA_TESTER_FORCE_UPDATE` to true in your `wp-config.php` file.
== Frequently Asked Questions ==
= Does this allow me to install multiple versions of WooCommerce at the same
time?
= Does this allow me to install multiple versions of WooCommerce at the same time?
No; updates will replace your currently installed version of WooCommerce. You
can switch to any version from this plugin via the interface however.
No; updates will replace your currently installed version of WooCommerce. You can switch to any version from this plugin via the interface however.
= Where do updates come from? =
Updates are downloaded from the WordPress.org SVN repository where we tag
prerelease versions specifically for this purpose.
Updates are downloaded from the WordPress.org SVN repository where we tag prerelease versions specifically for this purpose.
= Does this rollback my data? =
This plugin does not rollback or update data on your store automatically.
Database updates are manually ran like after regular updates. If you downgrade,
data will not be modified. We don't recommend using this in production.
Database updates are manually ran like after regular updates. If you downgrade, data will not be modified. We don't recommend using this in production.
= Where can I report bugs or contribute to WooCommerce Beta Tester? =
@ -63,6 +53,14 @@ See our [contributing guidelines here](https://github.com/woocommerce/woocommerc
== Changelog ==
= 2.0.2 =
* Fix notice for undefined `item`
* Fix auto_update_plugin filter reference
* Fix including SSR in bug report
* Fix style in version modal header
* Add check for WooCommerce installed in default location
= 2.0.1 =
* Changes to make this plugin compatible with the upcoming WooCommerce 3.6

View File

@ -3,13 +3,13 @@
* Plugin Name: WooCommerce Beta Tester
* Plugin URI: https://github.com/woocommerce/woocommerce-beta-tester
* Description: Run bleeding edge versions of WooCommerce. This will replace your installed version of WooCommerce with the latest tagged release - use with caution, and not on production sites.
* Version: 2.0.1
* Version: 2.0.2
* Author: WooCommerce
* Author URI: http://woocommerce.com/
* Requires at least: 4.4
* Tested up to: 4.9
* WC requires at least: 3.0.0
* WC tested up to: 3.5.0
* Tested up to: 5.6
* WC requires at least: 3.6.0
* WC tested up to: 4.8.0
* Text Domain: woocommerce-beta-tester
*
* @package WC_Beta_Tester
@ -23,7 +23,7 @@ if ( ! defined( 'WC_BETA_TESTER_FILE' ) ) {
}
if ( ! defined( 'WC_BETA_TESTER_VERSION' ) ) {
define( 'WC_BETA_TESTER_VERSION', '2.0.1' );
define( 'WC_BETA_TESTER_VERSION', '2.0.2' );
}
/**
@ -51,7 +51,9 @@ function _wc_beta_tester_bootstrap() {
} elseif ( ! class_exists( 'WC_Beta_Tester' ) ) {
include dirname( __FILE__ ) . '/includes/class-wc-beta-tester.php';
// Settings.
include dirname( __FILE__ ) . '/includes/class-wc-beta-tester-settings.php';
include dirname( __FILE__ ) . '/includes/class-wc-beta-tester-channel.php';
include dirname( __FILE__ ) . '/includes/class-wc-beta-tester-import-export.php';
new WC_Beta_Tester_Import_Export();
// Tools.
include dirname( __FILE__ ) . '/includes/class-wc-beta-tester-version-picker.php';