'.$user_message.''; return $code; } public static function dismiss_notice() { //update_option('essb3-activate-notice', 'true'); set_transient('essb3-activate-notice', 'true', 336 * HOUR_IN_SECONDS); } public static function notice_activate() { if (ESSBActivationManager::isThemeIntegrated()) { return; } $options_slug = essb_show_welcome() ? 'essb_redirect_social' : 'essb_options'; $dismiss_url = esc_url_raw(add_query_arg(array('dismissactivate' => 'true'), admin_url ("admin.php?page=".$options_slug))); //$update_url = esc_url_raw(admin_url ("admin.php?page=essb_redirect_update&tab=update")); $dismiss_addons_button = ' ' . __ ( 'Close this message', 'essb' ) . ''; echo '
'; ESSBOptionsFramework::draw_hint(__('Activate Easy Social Share Buttons for WordPress', 'essb'), sprintf('Hello! Would you like to receive automatic updates, access to free extensions library, access to ready made presents and unlock premium support? Please activate your copy of Easy Social Share Buttons for WordPress %1$s', $dismiss_addons_button), 'fa fa-lock', 'status essb-status-activate'); echo '
'; } public static function notice_manager() { $dismiss_translate = isset($_REQUEST['dismiss_translate']) ? $_REQUEST['dismiss_translate'] : ''; if ($dismiss_translate == 'true') { self::dismiss_notice_translate(); } $dismiss_subscribe = isset($_REQUEST['dismiss_subscribe']) ? $_REQUEST['dismiss_subscribe'] : ''; if ($dismiss_subscribe == 'true') { //self::dismiss_notice_subscribe(); } // notice display if (self::should_display_notice_translate()) { self::notice_translate(); } if (self::should_display_notice_subscribe()) { //self::notice_subscribe(); } } public static function should_display_notice_translate() { return false; /*$notice_dismissed = get_option('essb3-translate-notice'); if ($notice_dismissed === false) { return true; } else { return false; }*/ } public static function dismiss_notice_translate() { update_option('essb3-translate-notice', 'true'); } public static function notice_translate() { $dismiss_url = esc_url_raw(add_query_arg(array('dismiss_translate' => 'true'), admin_url ("admin.php?page=essb_options"))); $dismiss_addons_button = ' ' . __ ( 'Close this message', 'essb' ) . ''; echo '
'; ESSBOptionsFramework::draw_hint(__('Help us make Easy Social Share Buttons speak in your language', 'essb'), sprintf('Version 4 of Easy Social Share Buttons for WordPress has fully translatable admin panel. Help up us and our customers by translating plugin in your language. Please view translate instructions and see how easy is. %1$s', $dismiss_addons_button), 'fa fa-language', 'status'); echo '
'; } public static function should_display_notice_subscribe() { return false; /*$notice_dismissed = get_option('essb3-subscribe-notice'); if ($notice_dismissed === false) { return true; } else { return false; }*/ } public static function dismiss_notice_subscribe() { update_option('essb3-subscribe-notice', 'true'); } public static function notice_subscribe() { $code = '
'; $code .= '
'; $code .= '
'; //print ''; $code .= ''; $code .= ''; $code .= '
'; $code .= '
'; $code .= '
'; $dismiss_url = esc_url_raw(add_query_arg(array('dismiss_subscribe' => 'true'), admin_url ("admin.php?page=essb_options"))); $dismiss_addons_button = ' ' . __ ( 'Close this message', 'essb' ) . ''; echo '
'; ESSBOptionsFramework::draw_hint(__('Join our list and be the first to know of what we are working on (including useful social media and WordPress tips)', 'essb'), sprintf('%2$s %1$s', $dismiss_addons_button, $code), 'fa fa-envelope-o', 'status'); echo '
'; } public static function notice_new_addons() { if (ESSB3_ADDONS_ACTIVE && class_exists('ESSBAddonsHelper')) { $addons = ESSBAddonsHelper::get_instance(); $new_addons = $addons->get_new_addons(); $new_addons_count = $addons->get_new_addons_count(); if ($new_addons_count > 0) { $dismiss_keys = ""; $new_addons_list = ""; $cnt = 0; foreach ($new_addons as $key => $data) { if ($dismiss_keys != "") { $dismiss_keys .= ','; } $dismiss_keys .= $key; $cnt++; if ($new_addons_list != '') { $new_addons_list .= ', '; } $new_addons_list .= sprintf('%1$s', $data['title'], admin_url ("admin.php?page=essb_addons")); } $single_text = __('New extension for Easy Social Share Buttons for WordPress is available!', 'essb'); $plural_text = __('New extensions for Easy Social Share Buttons for WordPress are available! ', 'essb'); $display_text = ($cnt > 1) ? $plural_text : $single_text; $display_text = $cnt. ' '.$display_text; if (essb_show_welcome()) { $dismiss_url = esc_url_raw(add_query_arg(array('dismiss' => 'true', 'addon' => $dismiss_keys), admin_url ("admin.php?page=essb_redirect_social&tab=social"))); } else { $dismiss_url = esc_url_raw(add_query_arg(array('dismiss' => 'true', 'addon' => $dismiss_keys), admin_url ("admin.php?page=essb_options"))); } $all_addons_button = ' ' . __ ( 'View list of all extensions', 'essb' ) . ''; $dismiss_addons_button = ' '.__('Hide message', 'essb').''; $buttons_container = '
'.$all_addons_button.$dismiss_addons_button.'
'; //printf ( '
%1$s%2$s
%3$s
', $display_text, $new_addons_list, $dismiss_addons_button, '95%', '5%' ); echo '
'; ESSBOptionsFramework::draw_hint($display_text, sprintf('%1$s %2$s', $new_addons_list, $buttons_container), 'dashicons dashicons-admin-plugins', 'status essb-status-addon fade essb-status-global-addons'); echo '
'; } } } } ?>