Skip to content

Commit 5ca7f7d

Browse files
author
Woo
committed
Updates to 6.0.28
1 parent 4fbcfe2 commit 5ca7f7d

File tree

9 files changed

+88
-28
lines changed

9 files changed

+88
-28
lines changed

admin/dashboard-widgets/key-figures.php

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ protected function get_figures() {
2929
}
3030

3131
$optins_count = $this->controller->get_optins_count();
32-
$carts_count = $this->controller->get_active_carts_count();
33-
$guests_count = $this->controller->get_guests_count();
3432
$queued_count = $this->controller->get_queued_count();
3533

3634
$figures[] = [
@@ -39,17 +37,22 @@ protected function get_figures() {
3937
'link' => Admin::page_url( 'queue' ),
4038
];
4139

42-
$figures[] = [
43-
'name' => __( 'active carts', 'automatewoo' ),
44-
'value' => $carts_count,
45-
'link' => Admin::page_url( 'carts' ),
46-
];
47-
48-
$figures[] = [
49-
'name' => __( 'guests captured', 'automatewoo' ),
50-
'value' => $guests_count,
51-
'link' => Admin::page_url( 'guests' ),
52-
];
40+
if ( Options::abandoned_cart_enabled() ) {
41+
$carts_count = $this->controller->get_active_carts_count();
42+
$guests_count = $this->controller->get_guests_count();
43+
44+
$figures[] = [
45+
'name' => __( 'active carts', 'automatewoo' ),
46+
'value' => $carts_count,
47+
'link' => Admin::page_url( 'carts' ),
48+
];
49+
50+
$figures[] = [
51+
'name' => __( 'guests captured', 'automatewoo' ),
52+
'value' => $guests_count,
53+
'link' => Admin::page_url( 'guests' ),
54+
];
55+
}
5356

5457
$figures[] = [
5558
'name' => Options::optin_enabled() ? __( 'opt-ins', 'automatewoo' ) : __( 'opt-outs', 'automatewoo' ),

automatewoo.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: AutomateWoo
44
* Plugin URI: https://automatewoo.com
55
* Description: Powerful marketing automation for your WooCommerce store.
6-
* Version: 6.0.27
6+
* Version: 6.0.28
77
* Author: WooCommerce
88
* Author URI: https://woocommerce.com
99
* License: GPLv3
@@ -37,7 +37,7 @@
3737
defined( 'ABSPATH' ) || exit;
3838

3939
define( 'AUTOMATEWOO_SLUG', 'automatewoo' );
40-
define( 'AUTOMATEWOO_VERSION', '6.0.27' ); // WRCS: DEFINED_VERSION.
40+
define( 'AUTOMATEWOO_VERSION', '6.0.28' ); // WRCS: DEFINED_VERSION.
4141
define( 'AUTOMATEWOO_FILE', __FILE__ );
4242
define( 'AUTOMATEWOO_PATH', __DIR__ );
4343
define( 'AUTOMATEWOO_MIN_PHP_VER', '7.4.0' );

changelog.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
*** AutomateWoo Changelog ***
22

3+
2024-07-02 - version 6.0.28
4+
* Tweak - Hide active carts and guests captured widgets if cart tracking is disabled.
5+
* Tweak - Remove unused scheduled actions and prevent further actions from being scheduled if job is disabled.
6+
37
2024-06-25 - version 6.0.27
48
* Dev - PHPCS for Memberships.
59
* Dev - PHPCS for Send Email actions.

includes/Jobs/AbandonedCarts.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use AutomateWoo\DateTime;
1010
use AutomateWoo\Jobs\Traits\ValidateItemAsIntegerId;
1111
use AutomateWoo\OptionsStore;
12+
use AutomateWoo\Options;
1213
use Exception;
1314

1415
defined( 'ABSPATH' ) || exit;
@@ -129,4 +130,16 @@ protected function process_item( $cart_id, array $args ) {
129130
public function get_interval(): int {
130131
return JobService::TWO_MINUTE_INTERVAL;
131132
}
133+
134+
/**
135+
* If cart tracking is not enabled then disable the job to prevent
136+
* recurring actions from being scheduled.
137+
*
138+
* @since 6.0.28
139+
*
140+
* @return bool
141+
*/
142+
public function is_enabled(): bool {
143+
return Options::abandoned_cart_enabled();
144+
}
132145
}

includes/Jobs/AbstractActionSchedulerJob.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ public function get_process_item_hook() {
6767
*/
6868
public function schedule_recurring() {
6969
$interval = apply_filters( "automatewoo/intervals/{$this->get_name()}", $this->get_interval() );
70+
71+
if ( ! $this->is_enabled() ) {
72+
$this->cancel_recurring();
73+
return;
74+
}
75+
7076
if ( ! $this->get_schedule() ) {
7177
$this->action_scheduler->schedule_recurring_action(
7278
time() + $interval,
@@ -96,4 +102,16 @@ public function cancel_recurring() {
96102
public function get_schedule() {
97103
return $this->action_scheduler->next_scheduled_action( $this->get_schedule_hook() );
98104
}
105+
106+
/**
107+
* If a child class replaces this method and returns `false` then any existing
108+
* scheduled recurring actions will be cancelled and no more will be scheduled.
109+
*
110+
* @since 6.0.28
111+
*
112+
* @return bool
113+
*/
114+
public function is_enabled(): bool {
115+
return true;
116+
}
99117
}

includes/Jobs/CleanInactiveCarts.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace AutomateWoo\Jobs;
44

55
use AutomateWoo\Carts;
6+
use AutomateWoo\Options;
67

78
defined( 'ABSPATH' ) || exit;
89

@@ -41,4 +42,16 @@ protected function process_item( array $item ) {
4142
public function get_interval() {
4243
return JobService::TWO_DAY_INTERVAL;
4344
}
45+
46+
/**
47+
* If cart tracking is not enabled then disable the job to prevent
48+
* recurring actions from being scheduled.
49+
*
50+
* @since 6.0.28
51+
*
52+
* @return bool
53+
*/
54+
public function is_enabled(): bool {
55+
return Options::abandoned_cart_enabled();
56+
}
4457
}

includes/Jobs/RecurringJobInterface.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,11 @@ public function cancel_recurring();
4141
* Get the next scheduled job
4242
*/
4343
public function get_schedule();
44+
45+
/**
46+
* Determine if the job is enabled
47+
*
48+
* @since 6.0.28
49+
*/
50+
public function is_enabled();
4451
}

languages/automatewoo.pot

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
# This file is distributed under the GPLv3.
33
msgid ""
44
msgstr ""
5-
"Project-Id-Version: AutomateWoo 6.0.27\n"
5+
"Project-Id-Version: AutomateWoo 6.0.28\n"
66
"Report-Msgid-Bugs-To: https://woocommerce.com/my-account/contact-support/\n"
77
"Last-Translator: \n"
88
"Language-Team: \n"
99
"MIME-Version: 1.0\n"
1010
"Content-Type: text/plain; charset=UTF-8\n"
1111
"Content-Transfer-Encoding: 8bit\n"
12-
"POT-Creation-Date: 2024-06-25T01:58:52+00:00\n"
12+
"POT-Creation-Date: 2024-07-02T04:39:56+00:00\n"
1313
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1414
"X-Generator: WP-CLI 2.7.1\n"
1515
"X-Domain: automatewoo\n"
@@ -615,23 +615,23 @@ msgstr ""
615615
msgid "clicks"
616616
msgstr ""
617617

618-
#: admin/dashboard-widgets/key-figures.php:37
618+
#: admin/dashboard-widgets/key-figures.php:35
619619
msgid "workflows queued"
620620
msgstr ""
621621

622-
#: admin/dashboard-widgets/key-figures.php:43
622+
#: admin/dashboard-widgets/key-figures.php:45
623623
msgid "active carts"
624624
msgstr ""
625625

626-
#: admin/dashboard-widgets/key-figures.php:49
626+
#: admin/dashboard-widgets/key-figures.php:51
627627
msgid "guests captured"
628628
msgstr ""
629629

630-
#: admin/dashboard-widgets/key-figures.php:55
630+
#: admin/dashboard-widgets/key-figures.php:58
631631
msgid "opt-ins"
632632
msgstr ""
633633

634-
#: admin/dashboard-widgets/key-figures.php:55
634+
#: admin/dashboard-widgets/key-figures.php:58
635635
msgid "opt-outs"
636636
msgstr ""
637637

@@ -3899,6 +3899,7 @@ msgid_plural "Disabled <span class=\"count\">(%s)</span>"
38993899
msgstr[0] ""
39003900
msgstr[1] ""
39013901

3902+
#. translators: placeholder is previous workflow title
39023903
#: includes/Post_Types.php:95
39033904
#: includes/Post_Types.php:98
39043905
#: includes/Post_Types.php:101
@@ -3938,6 +3939,7 @@ msgctxt "used in \"Workflow scheduled for <date>\""
39383939
msgid "M j, Y @ G:i"
39393940
msgstr ""
39403941

3942+
#. translators: php date string, see http://php.net/date
39413943
#: includes/Post_Types.php:106
39423944
msgid "Workflow draft updated."
39433945
msgstr ""

vendor/composer/installed.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
<?php return array(
22
'root' => array(
33
'name' => 'woocommerce/automatewoo',
4-
'pretty_version' => 'dev-release/6.0.27',
5-
'version' => 'dev-release/6.0.27',
6-
'reference' => '932d017e52cf2e2189136f42dff27ef5ab5b8a4d',
4+
'pretty_version' => 'dev-release/6.0.28',
5+
'version' => 'dev-release/6.0.28',
6+
'reference' => '30c3b3418f62897d10a522d94f8feb1264abbc1e',
77
'type' => 'wordpress-plugin',
88
'install_path' => __DIR__ . '/../../',
99
'aliases' => array(),
1010
'dev' => false,
1111
),
1212
'versions' => array(
1313
'woocommerce/automatewoo' => array(
14-
'pretty_version' => 'dev-release/6.0.27',
15-
'version' => 'dev-release/6.0.27',
16-
'reference' => '932d017e52cf2e2189136f42dff27ef5ab5b8a4d',
14+
'pretty_version' => 'dev-release/6.0.28',
15+
'version' => 'dev-release/6.0.28',
16+
'reference' => '30c3b3418f62897d10a522d94f8feb1264abbc1e',
1717
'type' => 'wordpress-plugin',
1818
'install_path' => __DIR__ . '/../../',
1919
'aliases' => array(),

0 commit comments

Comments
 (0)