Skip to content

Commit

Permalink
Extract to constant
Browse files Browse the repository at this point in the history
  • Loading branch information
nerijuszaniauskas committed Jan 23, 2024
1 parent 7d94339 commit abcef86
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions omnisend/class-omnisend-core-bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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 '<div class="notice notice-error">If you want to use <strong>Omnisend for Woo</strong> plugin please contact customer support.</p></div>';
}
}
Expand Down
2 changes: 1 addition & 1 deletion omnisend/module/class-omnisend-core-connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit abcef86

Please sign in to comment.