From abcef8671cdfc19697f81f2a5116d28b0d3dc0ad Mon Sep 17 00:00:00 2001 From: Nerijus Zaniauskas Date: Tue, 23 Jan 2024 14:43:33 +0200 Subject: [PATCH] Extract to constant --- omnisend/class-omnisend-core-bootstrap.php | 7 +++++-- omnisend/module/class-omnisend-core-connection.php | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/omnisend/class-omnisend-core-bootstrap.php b/omnisend/class-omnisend-core-bootstrap.php index ffaa1c2..9332301 100644 --- a/omnisend/class-omnisend-core-bootstrap.php +++ b/omnisend/class-omnisend-core-bootstrap.php @@ -23,12 +23,15 @@ define( 'OMNISEND_CORE_PLUGIN_VERSION', '1.0.0' ); define( 'OMNISEND_CORE_SETTINGS_PAGE', 'omnisend' ); define( 'OMNISEND_CORE_PLUGIN_NAME', 'Omnisend' ); -define( 'OMNISEND_CORE_WOOCOMMERCE_PLUGIN_NAME', 'Email Marketing for WooCommerce by Omnisend' ); // Change for different environment. define( 'OMNISEND_CORE_API_V3', 'https://api.omnisend.com/v3' ); define( 'OMNISEND_CORE_SNIPPET_URL', 'https://omnisnippet1.com/inshop/launcher-v2.js' ); +// Omnisend for Woo plugin. +define( 'OMNISEND_CORE_WOOCOMMERCE_PLUGIN_NAME', 'Email Marketing for WooCommerce by Omnisend' ); +define( 'OMNISEND_CORE_WOOCOMMERCE_PLUGIN_API_KEY_OPTION', 'omnisend_api_key' ); + require_once 'module/class-omnisend-core-connection.php'; require_once 'module/class-omnisend-core-options.php'; require_once 'module/class-omnisend-core-snippet.php'; @@ -80,7 +83,7 @@ public static function add_admin_menu() { public static function admin_notices() { - if ( Omnisend_Core_Options::is_connected() && self::is_omnisend_woocommerce_plugin_active() && ! get_option( 'omnisend_api_key' ) ) { + if ( Omnisend_Core_Options::is_connected() && self::is_omnisend_woocommerce_plugin_active() && ! get_option( OMNISEND_CORE_WOOCOMMERCE_PLUGIN_API_KEY_OPTION ) ) { echo '
If you want to use Omnisend for Woo plugin please contact customer support.

'; } } diff --git a/omnisend/module/class-omnisend-core-connection.php b/omnisend/module/class-omnisend-core-connection.php index 3825d2f..8b5f181 100644 --- a/omnisend/module/class-omnisend-core-connection.php +++ b/omnisend/module/class-omnisend-core-connection.php @@ -113,7 +113,7 @@ public static function connect_with_omnisend_for_woo_plugin() { return; } - $api_key = get_option( 'omnisend_api_key' ); + $api_key = get_option( OMNISEND_CORE_WOOCOMMERCE_PLUGIN_API_KEY_OPTION ); if ( ! $api_key ) { return; }