Skip to content

Commit

Permalink
v2.3.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
seb86 committed Aug 4, 2024
1 parent 5b7fd0d commit f1bb451
Show file tree
Hide file tree
Showing 15 changed files with 1,617 additions and 1,746 deletions.
19 changes: 12 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# Changelog for CoCart Beta Tester

## v2.3.0 - 5th August, 2024

* Switch Version: Changelogs linked per version now link to the next changelog if the version is not stable.
* Misc: Various stuff like links updated and fixed.

## v2.2.0 - 25th January, 2023

* Enhancement - Channel selection updated; Now you can choose to receive nightly builds.
* Enhancement: Channel selection updated; Now you can choose to receive nightly builds.

## v2.1.0 - 21st January, 2022

Expand All @@ -12,12 +17,12 @@

## v2.0.0 - 20th October, 2021

* Enhancement - Channel selection; choose to receive RC or beta versions.
* Enhancement - Admin bar item shows version information, and offers shortcuts to functionality.
* Enhancement - Shortcut to log GitHub issues.
* Enhancement - Version switcher; choose which release or prerelease to switch to.
* Enhancement - Setting to enable auto-updates.
* Enhancement: Channel selection; choose to receive RC or beta versions.
* Enhancement: Admin bar item shows version information, and offers shortcuts to functionality.
* Enhancement: Shortcut to log GitHub issues.
* Enhancement: Version switcher; choose which release or prerelease to switch to.
* Enhancement: Setting to enable auto-updates.

## v1.0.0 - 8th August, 2020

* Initial release.
* Initial release.
4 changes: 2 additions & 2 deletions cocart-beta-tester.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function _ccbt_load_text_domain() {
*/
function cocart_beta_tester() {
if ( ! defined( 'COCART_VERSION' ) ) {
add_action( 'admin_notices', function() {
add_action( 'admin_notices', function () {
include_once untrailingslashit( plugin_dir_path( COCART_BETA_TESTER_FILE ) ) . '/includes/views/html-admin-notice-missing-cocart.php';
} );
} elseif ( ! class_exists( 'CoCart_Beta_Tester' ) ) {
Expand All @@ -59,7 +59,7 @@ function cocart_beta_tester() {
}
}

add_action( 'plugins_loaded', function(){
add_action( 'plugins_loaded', function () {
cocart_beta_tester();
}, 99 );
}
29 changes: 17 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "co-cart/cocart-beta-tester",
"name": "cocart-headless/cocart-beta-tester",
"description": "Easily update to prerelease versions of CoCart Lite for testing and development purposes.",
"homepage": "https://cocart.xyz",
"homepage": "https://cocartapi.com",
"type": "wordpress-plugin",
"keywords": [
"wordpress",
Expand All @@ -15,27 +15,26 @@
"minimum-stability": "stable",
"authors": [
{
"name": "Sébastien Dumont",
"email": "mailme@sebastiendumont.com",
"homepage": "https://sebastiendumont.com",
"role": "Developer"
"name": "CoCart Headless, LLC",
"email": "support@cocartapi.com",
"homepage": "https://cocartapi.com",
"role": "Owner"
}
],
"support": {
"issues": "https://github.com/co-cart/cocart-beta-tester/issues"
"issues": "https://github.com/cocart-headless/cocart-beta-tester/issues"
},
"autoload": {
"classmap": [
"includes/"
]
},
"require": {
"composer/installers": "1.11.0",
"co-cart/cocart-sniffs": "0.0.2"
"composer/installers": "^2.0"
},
"require-dev": {
"wp-cli/i18n-command": "2.2.9",
"squizlabs/php_codesniffer": "3.6.0"
"cocart-headless/cocart-sniffs": "0.0.3",
"automattic/vipwpcs": "^3.0"
},
"scripts": {
"phpcs": [
Expand All @@ -53,5 +52,11 @@
"phpcs": "Analyze code against the WordPress coding standards with PHP_CodeSniffer",
"phpcbf": "Fix coding standards warnings/errors automatically with PHP Code Beautifier"
}
},
"config": {
"allow-plugins": {
"composer/installers": true,
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
}
1 change: 0 additions & 1 deletion includes/class-cocart-beta-tester-admin-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ public function admin_scripts() {
wp_enqueue_script( 'cc-beta-tester-version-picker' );
}
} // END admin_scripts()

} // END class

return new CoCart_Beta_Tester_Admin_Assets();
1 change: 0 additions & 1 deletion includes/class-cocart-beta-tester-admin-menus.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ public function hide_from_menus() {
}
}
} // END hide_from_menus()

} // END class

return new CoCart_Beta_Tester_Admin_Menus();
11 changes: 5 additions & 6 deletions includes/class-cocart-beta-tester-channel.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function update_section_html( $args ) {

<p><?php esc_html_e( 'By their nature, if not using the stable channel, these releases are unstable and should not be used anyplace where your data is important. We strongly recommend you perform the test on a staging site and create a complete backup of your WordPress files and database prior to performing a version switch. We are not responsible for any misuse, deletions, white screens, fatal errors, or any other issue arising from using this plugin.', 'cocart-beta-tester' ); ?></p>

<p><?php echo sprintf( __( 'In order to hear about the latest beta releases, your best bet is to watch the %1$sdevelopment blog%2$s.', 'cocart-beta-tester' ), '<a href="https://cocart.dev/news/" target="_blank">', '</a>' ); ?></p>
<p><?php printf( __( 'In order to hear about the latest beta releases, your best bet is to watch the %1$sdevelopment blog%2$s.', 'cocart-beta-tester' ), '<a href="https://cocart.dev/news/" target="_blank">', '</a>' ); ?></p>
<?php
} // END update_section_html()

Expand All @@ -88,19 +88,19 @@ public function version_select_html( $args ) {
$settings = CoCart_Beta_Tester::get_settings();

$channels = array(
'nightly' => array(
'nightly' => array(
'name' => __( 'Nightly Releases', 'cocart-beta-tester' ),
'description' => __( 'Nightly releases contain experimental functionality for testing purposes only. This channel will include features that are unstable and may not move forward into a beta release.', 'cocart-beta-tester' ),
),
'beta' => array(
'beta' => array(
'name' => __( 'Beta Releases', 'cocart-beta-tester' ),
'description' => __( 'Beta releases contain upcoming features for testing purposes only. This channel will also include RC and stable releases if more current.', 'cocart-beta-tester' ),
),
'rc' => array(
'rc' => array(
'name' => __( 'Release Candidates', 'cocart-beta-tester' ),
'description' => __( 'Release candidates are released to ensure any critical problems have not gone undetected. This channel will also include stable releases if more current.', 'cocart-beta-tester' ),
),
'stable' => array(
'stable' => array(
'name' => __( 'Stable Releases', 'cocart-beta-tester' ),
'description' => __( 'This is the default behavior in WordPress.', 'cocart-beta-tester' ),
),
Expand Down Expand Up @@ -178,7 +178,6 @@ public function settings_page_html() {
</div>
<?php
} // END settings_page_html()

} // END class

new CoCart_Beta_Tester_Settings();
8 changes: 4 additions & 4 deletions includes/class-cocart-beta-tester-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@
*/
class CoCart_Beta_Tester_Core extends CoCart_Beta_Tester_Plugin_Update {

public $plugin_file = 'cart-rest-api-for-woocommerce/cart-rest-api-for-woocommerce.php';

public $plugin_slug = 'cart-rest-api-for-woocommerce';

/**
* Constructor.
*
* @access public
*/
public function __construct() {
$this->plugin_file = 'cart-rest-api-for-woocommerce/cart-rest-api-for-woocommerce.php';
$this->plugin_slug = 'cart-rest-api-for-woocommerce';

parent::__construct( $this->plugin_file, $this->plugin_slug );
} // END__construct()

} // END class

return new CoCart_Beta_Tester_Core();
45 changes: 25 additions & 20 deletions includes/class-cocart-beta-tester-plugin-update.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ class CoCart_Beta_Tester_Plugin_Update {
*/
public $api_url;

/**
* Plugin Data
*
* @var string
*/
public $plugin_data;

/**
* Constructor.
*
Expand Down Expand Up @@ -135,7 +142,7 @@ public function api_check( $transient ) {
'slug' => $plugin_slug,
'plugin' => $filename,
'new_version' => $version,
'url' => 'https://cocart.xyz',
'url' => 'https://cocartapi.com',
'package' => '',
'icons' => array(
'2x' => esc_url( 'https://raw.githubusercontent.com/co-cart/co-cart/trunk/.wordpress-org/icon-256x256.png' ),
Expand Down Expand Up @@ -335,7 +342,6 @@ public function get_latest_channel_release() {
$tagged_version = get_site_transient( md5( $this->plugin_slug ) . '_latest_tag' );

if ( $this->overrule_transients() || empty( $tagged_version ) ) {

$versions = $this->get_data();
$versions = $this->sort_release_order( $versions, true );
$channel = CoCart_Beta_Tester::get_settings()->channel;
Expand Down Expand Up @@ -391,7 +397,7 @@ public function sort_release_order( $versions, $reverse_order = false ) {
$new_order[ $version->tag_name ] = $version;
}

usort( $new_order, function( $a, $b ) {
usort( $new_order, function ( $a, $b ) {
return -1 * version_compare( $a->tag_name, $b->tag_name );
});

Expand Down Expand Up @@ -540,123 +546,123 @@ public function get_plugin_data() {
/**
* Return true if version string is a nightly version.
*
* @access protected
* @access public
*
* @static
*
* @param string $version_str Version string.
*
* @return bool
*/
protected static function is_nightly_version( $version_str ) {
public static function is_nightly_version( $version_str ) {
return strpos( $version_str, 'nightly' ) !== false || strpos( $version_str, 'nb' ) !== false || strpos( $version_str, 'night-build' ) !== false;
} // END is_nightly_version()

/**
* Return true if version string is a beta version.
*
* @access protected
* @access public
*
* @static
*
* @param string $version_str Version string.
*
* @return bool
*/
protected static function is_beta_version( $version_str ) {
public static function is_beta_version( $version_str ) {
return strpos( $version_str, 'beta' ) !== false;
} // END is_beta_version()

/**
* Return true if version string is a Release Candidate.
*
* @access protected
* @access public
*
* @static
*
* @param string $version_str Version string.
*
* @return bool
*/
protected static function is_rc_version( $version_str ) {
public static function is_rc_version( $version_str ) {
return strpos( $version_str, 'rc' ) !== false || strpos( $version_str, 'RC' ) !== false;
} // END is_rc_version()

/**
* Return true if version string is a stable version.
*
* @access protected
* @access public
*
* @static
*
* @param string $version_str Version string.
*
* @return bool
*/
protected static function is_stable_version( $version_str ) {
public static function is_stable_version( $version_str ) {
return ! self::is_beta_version( $version_str ) && ! self::is_nightly_version( $version_str ) && ! self::is_rc_version( $version_str );
} // END is_stable_version()

/**
* Return true if release's version string belongs to beta channel, i.e.
* if it's beta, rc or stable release.
*
* @access protected
* @access public
*
* @static
*
* @param string $version_str Version string of the release.
*
* @return bool
*/
protected static function is_in_beta_channel( $version_str ) {
public static function is_in_beta_channel( $version_str ) {
return self::is_beta_version( $version_str ) || self::is_rc_version( $version_str ) || self::is_stable_version( $version_str );
} // END is_in_beta_channel()

/**
* Return true if release's version string belongs to nightly channel.
*
* @access protected
* @access public
*
* @static
*
* @param string $version_str Version string of the release.
*
* @return bool
*/
protected static function is_in_nightly_channel( $version_str ) {
public static function is_in_nightly_channel( $version_str ) {
return self::is_nightly_version( $version_str );
} // END is_in_nightly_channel()

/**
* Return true if release's version string belongs to release candidate channel, i.e.
* if it's rc or stable release.
*
* @access protected
* @access public
*
* @static
*
* @param string $version_str Version string of the release.
*
* @return bool
*/
protected static function is_in_rc_channel( $version_str ) {
public static function is_in_rc_channel( $version_str ) {
return self::is_rc_version( $version_str ) || self::is_stable_version( $version_str );
} // END is_in_rc_channel()

/**
* Return true if release's version string belongs to stable channel, i.e.
* if it's stable release and not a beta or rc.
*
* @access protected
* @access public
*
* @static
*
* @param string $version_str Version string of the release.
*
* @return bool
*/
protected static function is_in_stable_channel( $version_str ) {
public static function is_in_stable_channel( $version_str ) {
return self::is_stable_version( $version_str );
} // END is_in_stable_channel()

Expand Down Expand Up @@ -702,5 +708,4 @@ public function get_tags( $channel = 'all' ) {

return $tags;
} // END get_tags()

} // END class
1 change: 0 additions & 1 deletion includes/class-cocart-beta-tester-plugin-upgrader.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,4 @@ public function switch_version( $plugin, $args = array() ) {

return true;
} // END switch_version()

} // END class
Loading

0 comments on commit f1bb451

Please sign in to comment.