diff --git a/src/Reminder.php b/src/Reminder.php index df8e6e02b4188169d68bb7260ec5d00f14d82e7e..e1557d7aab9c5e2af933fb184098ca25b8cd576e 100644 --- a/src/Reminder.php +++ b/src/Reminder.php @@ -12,7 +12,7 @@ class Reminder { } public function enqueue_reminder_script() { - if ( get_option( 'api_plugin-dir_activated', '' ) !== 'Activated' ) { + if ( ! $this->is_plugin_activated() ) { wp_register_script( 'wpdesk-activation-reminder', plugins_url( 'popup-javascript-file' ), @@ -33,11 +33,17 @@ class Reminder { } public function display_html_element() { - $logo_url = plugins_url( 'plugin-dir' . '/' . $this->logo_url ); - $cookie_name = md5( site_url() ); - $subscriptions_url = admin_url( 'admin.php?page=wpdesk-licenses' ); - $read_more_url = 'https://flexibleshipping.com'; - echo "<span class=\"wpdesk-activation-reminder\" data-plugin_title=\"plugin-title\" data-plugin_dir=\"plugin-dir\" data-logo_url=\"$logo_url\" data-cookie_name=\"$cookie_name\" data-subscriptions_url=\"$subscriptions_url\" data-buy_plugin_url=\"buy-plugin-url\" data-read_more_url=\"$read_more_url\"></span>"; + if ( ! $this->is_plugin_activated() ) { + $logo_url = plugins_url( 'plugin-dir' . '/' . $this->logo_url ); + $cookie_name = md5( site_url() ); + $subscriptions_url = admin_url( 'admin.php?page=wpdesk-licenses' ); + $read_more_url = 'https://flexibleshipping.com'; + echo "<span class=\"wpdesk-activation-reminder\" data-plugin_title=\"plugin-title\" data-plugin_dir=\"plugin-dir\" data-logo_url=\"$logo_url\" data-cookie_name=\"$cookie_name\" data-subscriptions_url=\"$subscriptions_url\" data-buy_plugin_url=\"buy-plugin-url\" data-read_more_url=\"$read_more_url\"></span>"; + } + } + + private function is_plugin_activated() { + return get_option( 'api_plugin-dir_activated', '' ) === 'Activated'; } }