Skip to content

Commit

Permalink
Updates to 6.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Woo committed Dec 4, 2024
1 parent 3603ec0 commit bea5e11
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 31 deletions.
48 changes: 32 additions & 16 deletions automatewoo.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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' );
Expand Down Expand Up @@ -125,21 +125,34 @@ public static function load_textdomain() {
public static function check() {
$passed = true;

/* translators: Plugin name. */
$inactive_text = '<strong>' . sprintf( __( '%s is inactive.', 'automatewoo' ), __( 'AutomateWoo', 'automatewoo' ) ) . '</strong>';

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 = '<strong>' . sprintf( __( '%s is inactive.', 'automatewoo' ), __( 'AutomateWoo', 'automatewoo' ) ) . '</strong>';
/* 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 = '<strong>' . sprintf( __( '%s is inactive.', 'automatewoo' ), __( 'AutomateWoo', 'automatewoo' ) ) . '</strong>';
/* 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 = '<strong>' . sprintf( __( '%s is inactive.', 'automatewoo' ), __( 'AutomateWoo', 'automatewoo' ) ) . '</strong>';
/* 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;
Expand Down Expand Up @@ -180,9 +193,12 @@ public static function admin_notices() {
if ( empty( self::$errors ) ) {
return;
}
echo '<div class="notice notice-error"><p>';
echo wp_kses_post( implode( '<br>', self::$errors ) );
echo '</p></div>';

foreach ( self::$errors as $error ) {
echo '<div class="notice notice-error"><p>';
echo wp_kses_post( $error() );
echo '</p></div>';
}
}

/**
Expand Down
3 changes: 3 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
4 changes: 4 additions & 0 deletions includes/Workflows/Presets/Parser/PresetParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
20 changes: 11 additions & 9 deletions languages/automatewoo.pot
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down Expand Up @@ -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 ""

Expand Down Expand Up @@ -3823,7 +3827,6 @@ msgid_plural "Disabled <span class=\"count\">(%s)</span>"
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
Expand Down Expand Up @@ -3863,7 +3866,6 @@ msgctxt "used in \"Workflow scheduled for <date>\""
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 ""
Expand Down
12 changes: 6 additions & 6 deletions vendor/composer/installed.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<?php return array(
'root' => 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(),
'dev' => false,
),
'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(),
Expand Down

0 comments on commit bea5e11

Please sign in to comment.