From bea5e119c55f2baa3e099241447dc2e63bad5826 Mon Sep 17 00:00:00 2001 From: Woo Date: Wed, 4 Dec 2024 10:26:07 +0000 Subject: [PATCH] Updates to 6.1.3 --- automatewoo.php | 48 ++++++++++++------- changelog.txt | 3 ++ .../Workflows/Presets/Parser/PresetParser.php | 4 ++ languages/automatewoo.pot | 20 ++++---- vendor/composer/installed.php | 12 ++--- 5 files changed, 56 insertions(+), 31 deletions(-) diff --git a/automatewoo.php b/automatewoo.php index 4934db5..9c819ef 100644 --- a/automatewoo.php +++ b/automatewoo.php @@ -3,7 +3,7 @@ * Plugin Name: AutomateWoo * Plugin URI: https://automatewoo.com * Description: Powerful marketing automation for your WooCommerce store. - * Version: 6.1.2 + * Version: 6.1.3 * Author: WooCommerce * Author URI: https://woocommerce.com * License: GPLv3 @@ -37,7 +37,7 @@ defined( 'ABSPATH' ) || exit; define( 'AUTOMATEWOO_SLUG', 'automatewoo' ); -define( 'AUTOMATEWOO_VERSION', '6.1.2' ); // WRCS: DEFINED_VERSION. +define( 'AUTOMATEWOO_VERSION', '6.1.3' ); // WRCS: DEFINED_VERSION. define( 'AUTOMATEWOO_FILE', __FILE__ ); define( 'AUTOMATEWOO_PATH', __DIR__ ); define( 'AUTOMATEWOO_MIN_PHP_VER', '7.4.0' ); @@ -125,21 +125,34 @@ public static function load_textdomain() { public static function check() { $passed = true; - /* translators: Plugin name. */ - $inactive_text = '' . sprintf( __( '%s is inactive.', 'automatewoo' ), __( 'AutomateWoo', 'automatewoo' ) ) . ''; - if ( version_compare( phpversion(), AUTOMATEWOO_MIN_PHP_VER, '<' ) ) { - /* translators: %1$s inactive plugin text, %2$s minimum PHP version */ - self::$errors[] = sprintf( __( '%1$s The plugin requires PHP version %2$s or newer.', 'automatewoo' ), $inactive_text, AUTOMATEWOO_MIN_PHP_VER ); $passed = false; - } elseif ( ! self::is_woocommerce_version_ok() ) { - /* translators: %1$s inactive plugin text, %2$s minimum WooCommerce version */ - self::$errors[] = sprintf( __( '%1$s The plugin requires WooCommerce version %2$s or newer.', 'automatewoo' ), $inactive_text, AUTOMATEWOO_MIN_WC_VER ); + self::$errors[] = function () { + /* translators: Plugin name. */ + $inactive_text = '' . sprintf( __( '%s is inactive.', 'automatewoo' ), __( 'AutomateWoo', 'automatewoo' ) ) . ''; + /* translators: %1$s inactive plugin text, %2$s minimum PHP version */ + return sprintf( __( '%1$s The plugin requires PHP version %2$s or newer.', 'automatewoo' ), $inactive_text, AUTOMATEWOO_MIN_PHP_VER ); + }; + } + + if ( ! self::is_woocommerce_version_ok() ) { $passed = false; - } elseif ( ! self::is_wp_version_ok() ) { - /* translators: %1$s inactive plugin text, %2$s minimum WordPress version */ - self::$errors[] = sprintf( __( '%1$s The plugin requires WordPress version %2$s or newer.', 'automatewoo' ), $inactive_text, AUTOMATEWOO_MIN_WP_VER ); + self::$errors[] = function () { + /* translators: Plugin name. */ + $inactive_text = '' . sprintf( __( '%s is inactive.', 'automatewoo' ), __( 'AutomateWoo', 'automatewoo' ) ) . ''; + /* translators: %1$s inactive plugin text, %2$s minimum WooCommerce version */ + return sprintf( __( '%1$s The plugin requires WooCommerce version %2$s or newer.', 'automatewoo' ), $inactive_text, AUTOMATEWOO_MIN_WC_VER ); + }; + } + + if ( ! self::is_wp_version_ok() ) { $passed = false; + self::$errors[] = function () { + /* translators: Plugin name. */ + $inactive_text = '' . sprintf( __( '%s is inactive.', 'automatewoo' ), __( 'AutomateWoo', 'automatewoo' ) ) . ''; + /* translators: %1$s inactive plugin text, %2$s minimum WordPress version */ + return sprintf( __( '%1$s The plugin requires WordPress version %2$s or newer.', 'automatewoo' ), $inactive_text, AUTOMATEWOO_MIN_WP_VER ); + }; } return $passed; @@ -180,9 +193,12 @@ public static function admin_notices() { if ( empty( self::$errors ) ) { return; } - echo '

'; - echo wp_kses_post( implode( '
', self::$errors ) ); - echo '

'; + + foreach ( self::$errors as $error ) { + echo '

'; + echo wp_kses_post( $error() ); + echo '

'; + } } /** diff --git a/changelog.txt b/changelog.txt index 9b91ab0..6e84f72 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,8 @@ *** AutomateWoo Changelog *** +2024-12-03 - version 6.1.3 +* Fix - Prevent translations from being called early. + 2024-11-19 - version 6.1.2 * Fix - Default email styles for hiding screen reader text. diff --git a/includes/Workflows/Presets/Parser/PresetParser.php b/includes/Workflows/Presets/Parser/PresetParser.php index 1c9bb78..c5a1d21 100644 --- a/includes/Workflows/Presets/Parser/PresetParser.php +++ b/includes/Workflows/Presets/Parser/PresetParser.php @@ -185,6 +185,10 @@ protected function extract_workflow_timing( $timing_options ) { break; case WorkflowTimingFixed::TYPE: + if ( empty( $timing_options['fixed_date'] ) || empty( $timing_options['fixed_time'] ) ) { + throw new ParserException( 'Missing date and/or time!' ); + } + try { $date_string = sprintf( '%sT%s', $timing_options['fixed_date'], $timing_options['fixed_time'] ); $fixed_date = new DateTime( $date_string ); diff --git a/languages/automatewoo.pot b/languages/automatewoo.pot index ec4a6b5..8463cef 100644 --- a/languages/automatewoo.pot +++ b/languages/automatewoo.pot @@ -2,14 +2,14 @@ # This file is distributed under the GPLv3. msgid "" msgstr "" -"Project-Id-Version: AutomateWoo 6.1.2\n" +"Project-Id-Version: AutomateWoo 6.1.3\n" "Report-Msgid-Bugs-To: https://woocommerce.com/my-account/contact-support/\n" "Last-Translator: \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2024-11-19T21:49:17+01:00\n" +"POT-Creation-Date: 2024-12-03T12:12:57+00:00\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "X-Generator: WP-CLI 2.7.1\n" "X-Domain: automatewoo\n" @@ -21,7 +21,9 @@ msgstr "" #: admin/admin.php:746 #: admin/coupons-list.php:42 #: admin/WCAdminConnectPages.php:59 -#: automatewoo.php:129 +#: automatewoo.php:132 +#: automatewoo.php:142 +#: automatewoo.php:152 #: includes/Actions/Change_Workflow_Status.php:18 #: includes/Actions/Clear_Queued_Events.php:17 #: includes/Installer.php:248 @@ -2008,22 +2010,24 @@ msgid "Manual" msgstr "" #. translators: Plugin name. -#: automatewoo.php:129 +#: automatewoo.php:132 +#: automatewoo.php:142 +#: automatewoo.php:152 msgid "%s is inactive." msgstr "" #. translators: %1$s inactive plugin text, %2$s minimum PHP version -#: automatewoo.php:133 +#: automatewoo.php:134 msgid "%1$s The plugin requires PHP version %2$s or newer." msgstr "" #. translators: %1$s inactive plugin text, %2$s minimum WooCommerce version -#: automatewoo.php:137 +#: automatewoo.php:144 msgid "%1$s The plugin requires WooCommerce version %2$s or newer." msgstr "" #. translators: %1$s inactive plugin text, %2$s minimum WordPress version -#: automatewoo.php:141 +#: automatewoo.php:154 msgid "%1$s The plugin requires WordPress version %2$s or newer." msgstr "" @@ -3823,7 +3827,6 @@ msgid_plural "Disabled (%s)" msgstr[0] "" msgstr[1] "" -#. translators: placeholder is previous workflow title #: includes/Post_Types.php:90 #: includes/Post_Types.php:93 #: includes/Post_Types.php:96 @@ -3863,7 +3866,6 @@ msgctxt "used in \"Workflow scheduled for \"" msgid "M j, Y @ G:i" msgstr "" -#. translators: php date string, see http://php.net/date #: includes/Post_Types.php:101 msgid "Workflow draft updated." msgstr "" diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index b3cee74..fe7e9bc 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -1,9 +1,9 @@ array( 'name' => 'woocommerce/automatewoo', - 'pretty_version' => 'dev-release/6.1.2', - 'version' => 'dev-release/6.1.2', - 'reference' => 'a02483975756af1a39f56cc18f011fe1a9a95cb1', + 'pretty_version' => 'dev-release/6.1.3', + 'version' => 'dev-release/6.1.3', + 'reference' => '88c99e2d6ecd6884db4085ebe60ead958429ca50', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -11,9 +11,9 @@ ), 'versions' => array( 'woocommerce/automatewoo' => array( - 'pretty_version' => 'dev-release/6.1.2', - 'version' => 'dev-release/6.1.2', - 'reference' => 'a02483975756af1a39f56cc18f011fe1a9a95cb1', + 'pretty_version' => 'dev-release/6.1.3', + 'version' => 'dev-release/6.1.3', + 'reference' => '88c99e2d6ecd6884db4085ebe60ead958429ca50', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(),