Skip to content

Commit deabf6d

Browse files
committed
Merge branch 'develop' into ver/7.0.0
2 parents 4ea9943 + 42225d5 commit deabf6d

20 files changed

+1339
-793
lines changed

shoppingfeed.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@
4444
* Plugin bootstrap function.shopping-feed/src/ShoppingFeed.php
4545
*/
4646
function init() {
47-
load_plugin_textdomain( 'shopping-feed', false, plugin_basename( dirname( __FILE__ ) ) . '/languages' );
48-
4947
ShoppingFeed::get_instance();
5048

5149
if ( ! defined( 'WP_CLI' ) ) {
@@ -58,6 +56,16 @@ function init() {
5856

5957
\add_action( 'plugins_loaded', __NAMESPACE__ . '\\init', 100 );
6058

59+
/**
60+
* Load plugin translations.
61+
*
62+
* @return void
63+
*/
64+
function load_translations(): void {
65+
load_plugin_textdomain( 'shopping-feed', false, plugin_basename( dirname( __FILE__ ) ) . '/languages' );
66+
}
67+
\add_action( 'init', __NAMESPACE__ . '\\load_translations' );
68+
6169
// Declare the plugin compatibility with High Performance Order Storage
6270
\add_action(
6371
'before_woocommerce_init',

src/Actions/Actions.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ class Actions {
2424
* Register new action to generate feed
2525
*/
2626
public static function register_feed_generation() {
27+
if ( as_has_scheduled_action( 'sf_generate_feed_action', array(), self::FEED_GROUP ) ) {
28+
as_unschedule_action( 'sf_generate_feed_action', array(), self::FEED_GROUP );
29+
}
30+
2731
as_schedule_recurring_action(
2832
time() + 60,
2933
ShoppingFeedHelper::get_sf_feed_generation_frequency(),
@@ -37,6 +41,10 @@ public static function register_feed_generation() {
3741
* Register new action to get orders
3842
*/
3943
public static function register_get_orders() {
44+
if ( ShoppingFeedHelper::is_order_import_disable() ) {
45+
return;
46+
}
47+
4048
$sf_accounts = ShoppingFeedHelper::get_sf_account_options();
4149
if ( empty( $sf_accounts ) ) {
4250
ShoppingFeedHelper::get_logger()->error(

0 commit comments

Comments
 (0)