From 8cb6a227a2563e9afd8c77a3fdd2b0ae9c68addd Mon Sep 17 00:00:00 2001 From: Grzegorz Rola <grola@seostudio.pl> Date: Wed, 11 Aug 2021 14:05:17 +0200 Subject: [PATCH] feature(popup): popup --- src/Reminder.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/Reminder.php b/src/Reminder.php index df8e6e0..e1557d7 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'; } } -- GitLab