Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions includes/Framework/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ abstract class Plugin {
/** @var AdminNoticeHandler the admin notice handler class */
private $admin_notice_handler;

/** @var BatchLogHandler the batch log handler class */
private $batch_log_handler;

/** @var ErrorLogHandler the error log handler class */
private $error_log_handler;

Expand Down Expand Up @@ -123,6 +126,9 @@ public function __construct( $id, $version, $args = [] ) {
// add the action & filter hooks
$this->add_hooks();

// build the batch log handler instance
$this->init_batch_log_handler();

// build the error log handler instance
$this->init_error_log_handler();
}
Expand Down Expand Up @@ -183,6 +189,15 @@ protected function init_lifecycle_handler() {
$this->lifecycle_handler = new \WooCommerce\Facebook\Lifecycle( $this );
}

/**
* Builds the batch log handler instance.
*
* @since 3.5.0
*/
protected function init_batch_log_handler() {
$this->batch_log_handler = new BatchLogHandler();
}

/**
* Builds the error log handler instance.
*
Expand Down
4 changes: 2 additions & 2 deletions includes/Handlers/PluginRender.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class PluginRender {
private \WC_Facebookcommerce $plugin;

/** @var string opt out plugin version action */
const ALL_PRODUCTS_PLUGIN_VERSION = '3.5.2';
const ALL_PRODUCTS_PLUGIN_VERSION = '3.5.1';

/** @var string opt out sync action */
const ACTION_OPT_OUT_OF_SYNC = 'wc_facebook_opt_out_of_sync';
Expand Down Expand Up @@ -88,7 +88,7 @@ public function should_show_banners() {
$current_version = $this->plugin->get_version();
/**
* Case when current version is less or equal to latest
* but latest is below 3.5.2
* but latest is below 3.5.1
* Should show the opt in/ opt out banner
*/
if ( version_compare( $current_version, self::ALL_PRODUCTS_PLUGIN_VERSION, '<' ) ) {
Expand Down