| 1 |
<?php |
| 2 |
|
| 3 |
if (!defined('UPDRAFTPLUS_DIR')) die('No direct access allowed'); |
| 4 |
|
| 5 |
if (!class_exists('Updraft_Notices')) require_once(UPDRAFTPLUS_DIR.'/includes/updraft-notices.php'); |
| 6 |
|
| 7 |
class UpdraftPlus_Notices extends Updraft_Notices { |
| 8 |
|
| 9 |
protected static $_instance = null; |
| 10 |
|
| 11 |
private $initialized = false; |
| 12 |
|
| 13 |
protected $notices_content = array(); |
| 14 |
|
| 15 |
protected $self_affiliate_id = 212; |
| 16 |
|
| 17 |
public static function instance() { |
| 18 |
if (empty(self::$_instance)) { |
| 19 |
self::$_instance = new self(); |
| 20 |
} |
| 21 |
return self::$_instance; |
| 22 |
} |
| 23 |
|
| 24 |
protected function populate_notices_content() { |
| 25 |
|
| 26 |
$parent_notice_content = parent::populate_notices_content(); |
| 27 |
|
| 28 |
$child_notice_content = array( |
| 29 |
1 => array( |
| 30 |
'prefix' => __('UpdraftPlus Premium:', 'updraftplus'), |
| 31 |
'title' => __('Support', 'updraftplus'), |
| 32 |
'text' => __('Enjoy professional, fast, and friendly help whenever you need it with Premium.', 'updraftplus'), |
| 33 |
'image' => 'notices/support.png', |
| 34 |
'button_link' => 'https://updraftplus.com/landing/updraftplus-premium', |
| 35 |
'campaign' => 'support', |
| 36 |
'button_meta' => 'updraftplus', |
| 37 |
'dismiss_time' => 'dismiss_notice', |
| 38 |
'supported_positions' => $this->dashboard_top_or_report, |
| 39 |
), |
| 40 |
2 => array( |
| 41 |
'prefix' => __('UpdraftPlus Premium:', 'updraftplus'), |
| 42 |
'title' => __('UpdraftVault storage', 'updraftplus'), |
| 43 |
'text' => __('The ultimately secure and convenient place to store your backups.', 'updraftplus'), |
| 44 |
'image' => 'notices/updraft_logo.png', |
| 45 |
'button_link' => 'https://updraftplus.com/landing/vault', |
| 46 |
'campaign' => 'vault', |
| 47 |
'button_meta' => 'updraftplus', |
| 48 |
'dismiss_time' => 'dismiss_notice', |
| 49 |
'supported_positions' => $this->dashboard_top_or_report, |
| 50 |
), |
| 51 |
3 => array( |
| 52 |
'prefix' => __('UpdraftPlus Premium:', 'updraftplus'), |
| 53 |
'title' => __('enhanced remote storage options', 'updraftplus'), |
| 54 |
'text' => __('Enhanced storage options for Dropbox, Google Drive and S3. Plus many more options.', 'updraftplus'), |
| 55 |
'image' => 'addons-images/morestorage.png', |
| 56 |
'button_link' => 'https://updraftplus.com/landing/updraftplus-premium', |
| 57 |
'campaign' => 'morestorage', |
| 58 |
'button_meta' => 'updraftplus', |
| 59 |
'dismiss_time' => 'dismiss_notice', |
| 60 |
'supported_positions' => $this->dashboard_top_or_report, |
| 61 |
), |
| 62 |
4 => array( |
| 63 |
'prefix' => __('UpdraftPlus Premium:', 'updraftplus'), |
| 64 |
'title' => __('advanced options', 'updraftplus'), |
| 65 |
'text' => __('Secure multisite installation, advanced reporting and much more.', 'updraftplus'), |
| 66 |
'image' => 'addons-images/reporting.png', |
| 67 |
'button_link' => 'https://updraftplus.com/landing/updraftplus-premium', |
| 68 |
'campaign' => 'reporting', |
| 69 |
'button_meta' => 'updraftplus', |
| 70 |
'dismiss_time' => 'dismiss_notice', |
| 71 |
'supported_positions' => $this->dashboard_top_or_report, |
| 72 |
), |
| 73 |
5 => array( |
| 74 |
'prefix' => __('UpdraftPlus Premium:', 'updraftplus'), |
| 75 |
'title' => __('secure your backups', 'updraftplus'), |
| 76 |
'text' => __('Add SFTP to send your data securely, lock settings and encrypt your database backups for extra security.', 'updraftplus'), |
| 77 |
'image' => 'addons-images/lockadmin.png', |
| 78 |
'button_link' => 'https://updraftplus.com/landing/updraftplus-premium', |
| 79 |
'campaign' => 'lockadmin', |
| 80 |
'button_meta' => 'updraftplus', |
| 81 |
'dismiss_time' => 'dismiss_notice', |
| 82 |
'supported_positions' => $this->dashboard_top_or_report, |
| 83 |
), |
| 84 |
6 => array( |
| 85 |
'prefix' => __('UpdraftPlus Premium:', 'updraftplus'), |
| 86 |
'title' => __('easily migrate or clone your site in minutes', 'updraftplus'), |
| 87 |
'text' => __('Copy your site to another domain directly. Includes find-and-replace tool for database references.', 'updraftplus'), |
| 88 |
'image' => 'addons-images/migrator.png', |
| 89 |
'button_link' => 'https://updraftplus.com/landing/updraftplus-premium', |
| 90 |
'campaign' => 'migrator', |
| 91 |
'button_meta' => 'updraftplus', |
| 92 |
'dismiss_time' => 'dismiss_notice', |
| 93 |
'supported_positions' => $this->anywhere, |
| 94 |
), |
| 95 |
7 => array( |
| 96 |
'prefix' => '', |
| 97 |
'title' => __('Introducing UpdraftCentral', 'updraftplus'), |
| 98 |
'text' => __('UpdraftCentral is a highly efficient way to manage, update and backup multiple websites from one place.', 'updraftplus'), |
| 99 |
'image' => 'notices/updraft_logo.png', |
| 100 |
'button_link' => 'https://updraftcentral.com', |
| 101 |
'button_meta' => 'updraftcentral', |
| 102 |
'dismiss_time' => 'dismiss_notice', |
| 103 |
'supported_positions' => $this->dashboard_top_or_report, |
| 104 |
), |
| 105 |
8 => array( |
| 106 |
'prefix' => '', |
| 107 |
'title' => __('Do you use UpdraftPlus on multiple sites?', 'updraftplus'), |
| 108 |
'text' => __('Control all your WordPress installations from one place using UpdraftCentral remote site management!', 'updraftplus'), |
| 109 |
'image' => 'notices/updraft_logo.png', |
| 110 |
'button_link' => 'https://updraftcentral.com', |
| 111 |
'button_meta' => 'updraftcentral', |
| 112 |
'dismiss_time' => 'dismiss_notice', |
| 113 |
'supported_positions' => $this->anywhere, |
| 114 |
), |
| 115 |
'rate' => array( |
| 116 |
'prefix' => '', |
| 117 |
'title' => __('Like UpdraftPlus and can spare one minute?', 'updraftplus'), |
| 118 |
'text' => __('Please help UpdraftPlus by giving a positive review at wordpress.org.', 'updraftplus'), |
| 119 |
'image' => 'notices/updraft_logo.png', |
| 120 |
'button_link' => 'https://wordpress.org/support/plugin/updraftplus/reviews/?rate=5#new-post', |
| 121 |
'button_meta' => 'review', |
| 122 |
'dismiss_time' => 'dismiss_notice', |
| 123 |
'supported_positions' => $this->anywhere, |
| 124 |
), |
| 125 |
'translation_needed' => array( |
| 126 |
'prefix' => '', |
| 127 |
'title' => 'Can you translate? Want to improve UpdraftPlus for speakers of your language?', |
| 128 |
'text' => $this->url_start(true, 'updraftplus.com/translate/')."Please go here for instructions - it is easy.".$this->url_end(true, 'updraftplus.com/translate/'), |
| 129 |
'text_plain' => $this->url_start(false, 'updraftplus.com/translate/')."Please go here for instructions - it is easy.".$this->url_end(false, 'updraftplus.com/translate/'), |
| 130 |
'image' => 'notices/updraft_logo.png', |
| 131 |
'button_link' => false, |
| 132 |
'dismiss_time' => false, |
| 133 |
'supported_positions' => $this->anywhere, |
| 134 |
'validity_function' => 'translation_needed', |
| 135 |
), |
| 136 |
'social_media' => array( |
| 137 |
'prefix' => '', |
| 138 |
'title' => __('UpdraftPlus is on social media - check us out!', 'updraftplus'), |
| 139 |
'text' => $this->url_start(true, 'twitter.com/updraftplus', true).__('Twitter', 'updraftplus').$this->url_end(true, 'twitter.com/updraftplus', true).' - '.$this->url_start(true, 'facebook.com/updraftplus', true).__('Facebook', 'updraftplus').$this->url_end(true, 'facebook.com/updraftplus', true).' - '.$this->url_start(true, 'plus.google.com/u/0/b/112313994681166369508/112313994681166369508/about', true).__('Google+', 'updraftplus').$this->url_end(true, 'plus.google.com/u/0/b/112313994681166369508/112313994681166369508/about', true).' - '.$this->url_start(true, 'www.linkedin.com/company/updraftplus', true).__('LinkedIn', 'updraftplus').$this->url_end(true, 'www.linkedin.com/company/updraftplus', true), |
| 140 |
'text_plain' => $this->url_start(false, 'twitter.com/updraftplus', true).__('Twitter', 'updraftplus').$this->url_end(false, 'twitter.com/updraftplus', true).' - '.$this->url_start(false, 'facebook.com/updraftplus', true).__('Facebook', 'updraftplus').$this->url_end(false, 'facebook.com/updraftplus', true).' - '.$this->url_start(false, 'plus.google.com/u/0/b/112313994681166369508/112313994681166369508/about', true).__('Google+', 'updraftplus').$this->url_end(false, 'plus.google.com/u/0/b/112313994681166369508/112313994681166369508/about', true).' - '.$this->url_start(false, 'www.linkedin.com/company/updraftplus', true).__('LinkedIn', 'updraftplus').$this->url_end(false, 'www.linkedin.com/company/updraftplus', true), |
| 141 |
'image' => 'notices/updraft_logo.png', |
| 142 |
'dismiss_time' => false, |
| 143 |
'supported_positions' => $this->anywhere, |
| 144 |
), |
| 145 |
'newsletter' => array( |
| 146 |
'prefix' => '', |
| 147 |
'title' => __('UpdraftPlus Newsletter', 'updraftplus'), |
| 148 |
'text' => __("Follow this link to sign up for the UpdraftPlus newsletter.", 'updraftplus'), |
| 149 |
'image' => 'notices/updraft_logo.png', |
| 150 |
'button_link' => 'https://updraftplus.com/newsletter-signup', |
| 151 |
'campaign' => 'newsletter', |
| 152 |
'button_meta' => 'signup', |
| 153 |
'supported_positions' => $this->anywhere, |
| 154 |
'dismiss_time' => false |
| 155 |
), |
| 156 |
'subscribe_blog' => array( |
| 157 |
'prefix' => '', |
| 158 |
'title' => __('UpdraftPlus Blog - get up-to-date news and offers', 'updraftplus'), |
| 159 |
'text' => $this->url_start(true, 'updraftplus.com/news/').__("Blog link", 'updraftplus').$this->url_end(true, 'updraftplus.com/news/').' - '.$this->url_start(true, 'feeds.feedburner.com/UpdraftPlus').__("RSS link", 'updraftplus').$this->url_end(true, 'feeds.feedburner.com/UpdraftPlus'), |
| 160 |
'text_plain' => $this->url_start(false, 'updraftplus.com/news/').__("Blog link", 'updraftplus').$this->url_end(false, 'updraftplus.com/news/').' - '.$this->url_start(false, 'feeds.feedburner.com/UpdraftPlus').__("RSS link", 'updraftplus').$this->url_end(false, 'feeds.feedburner.com/UpdraftPlus'), |
| 161 |
'image' => 'notices/updraft_logo.png', |
| 162 |
'button_link' => false, |
| 163 |
'supported_positions' => $this->anywhere, |
| 164 |
'dismiss_time' => false |
| 165 |
), |
| 166 |
'check_out_updraftplus_com' => array( |
| 167 |
'prefix' => '', |
| 168 |
'title' => __('UpdraftPlus Blog - get up-to-date news and offers', 'updraftplus'), |
| 169 |
'text' => $this->url_start(true, 'updraftplus.com/news/').__("Blog link", 'updraftplus').$this->url_end(true, 'updraftplus.com/news/').' - '.$this->url_start(true, 'feeds.feedburner.com/UpdraftPlus').__("RSS link", 'updraftplus').$this->url_end(true, 'feeds.feedburner.com/UpdraftPlus'), |
| 170 |
'text_plain' => $this->url_start(false, 'updraftplus.com/news/').__("Blog link", 'updraftplus').$this->url_end(false, 'updraftplus.com/news/').' - '.$this->url_start(false, 'feeds.feedburner.com/UpdraftPlus').__("RSS link", 'updraftplus').$this->url_end(false, 'feeds.feedburner.com/UpdraftPlus'), |
| 171 |
'image' => 'notices/updraft_logo.png', |
| 172 |
'button_link' => false, |
| 173 |
'supported_positions' => $this->dashboard_bottom_or_report, |
| 174 |
'dismiss_time' => false |
| 175 |
), |
| 176 |
'autobackup' => array( |
| 177 |
'prefix' => '', |
| 178 |
'title' => __('Be safe with an automatic backup', 'updraftplus'), |
| 179 |
'text' => __('UpdraftPlus Premium can automatically backup your plugins/themes/database before you update, without you needing to remember.', 'updraftplus'), |
| 180 |
'image' => 'addons-images/autobackup.png', |
| 181 |
'button_link' => 'https://updraftplus.com/landing/updraftplus-premium', |
| 182 |
'button_meta' => 'updraftplus', |
| 183 |
'dismiss_time' => 'dismissautobackup', |
| 184 |
'supported_positions' => $this->autobackup_bottom_or_report, |
| 185 |
), |
| 186 |
'wp-optimize' => array( |
| 187 |
'prefix' => '', |
| 188 |
'title' => 'WP-Optimize', |
| 189 |
'text' => __("After you've backed up your database, we recommend you install our WP-Optimize plugin to streamline it for better website performance.", "updraftplus"), |
| 190 |
'image' => 'notices/wp_optimize_logo.png', |
| 191 |
'button_link' => 'https://wordpress.org/plugins/wp-optimize/', |
| 192 |
'button_meta' => 'wp-optimize', |
| 193 |
'dismiss_time' => 'dismiss_notice', |
| 194 |
'supported_positions' => $this->anywhere, |
| 195 |
'validity_function' => 'wp_optimize_installed', |
| 196 |
), |
| 197 |
'keyy' => array( |
| 198 |
'prefix' => '', |
| 199 |
'title' => 'Keyy', |
| 200 |
'text' => __("Instant and secure logon with a wave of your phone.", "updraftplus") . ' ' . $this->url_start(true, 'getkeyy.com') . __("No more forgotten passwords. Find out more about our revolutionary new WordPress plugin", 'updraftplus') . $this->url_end(true, 'getkeyy.com'), |
| 201 |
'image' => 'notices/keyy_logo.png', |
| 202 |
'dismiss_time' => 'dismiss_notice', |
| 203 |
'supported_positions' => $this->anywhere, |
| 204 |
'validity_function' => 'keyy_installed', |
| 205 |
), |
| 206 |
'metaslider' => array( |
| 207 |
'prefix' => '', |
| 208 |
'title' => "MetaSlider: The world's #1 slider plugin from the makers of UpdraftPlus", |
| 209 |
'text' => __("With Metaslider, you can easily add style and flare with beautifully-designed sliders.", "updraftplus") . ' ' . $this->url_start(true, 'metaslider.com'), |
| 210 |
'image' => 'notices/metaslider_logo.png', |
| 211 |
'dismiss_time' => 'dismiss_notice', |
| 212 |
'supported_positions' => $this->anywhere, |
| 213 |
'validity_function' => 'metaslider_installed', |
| 214 |
), |
| 215 |
|
| 216 |
// The sale adverts content starts here |
| 217 |
'blackfriday' => array( |
| 218 |
'prefix' => '', |
| 219 |
'title' => __('Black Friday - 20% off UpdraftPlus Premium until November 30th', 'updraftplus'), |
| 220 |
'text' => __('To benefit, use this discount code:', 'updraftplus').' ', |
| 221 |
'image' => 'notices/black_friday.png', |
| 222 |
'button_link' => 'https://updraftplus.com/landing/updraftplus-premium', |
| 223 |
'campaign' => 'blackfriday', |
| 224 |
'button_meta' => 'updraftplus', |
| 225 |
'dismiss_time' => 'dismiss_season', |
| 226 |
'discount_code' => 'blackfridaysale2018', |
| 227 |
'valid_from' => '2018-11-20 00:00:00', |
| 228 |
'valid_to' => '2018-11-30 23:59:59', |
| 229 |
'supported_positions' => $this->dashboard_top_or_report, |
| 230 |
), |
| 231 |
'christmas' => array( |
| 232 |
'prefix' => '', |
| 233 |
'title' => __('Christmas sale - 20% off UpdraftPlus Premium until December 25th', 'updraftplus'), |
| 234 |
'text' => __('To benefit, use this discount code:', 'updraftplus').' ', |
| 235 |
'image' => 'notices/christmas.png', |
| 236 |
'button_link' => 'https://updraftplus.com/landing/updraftplus-premium', |
| 237 |
'campaign' => 'christmas', |
| 238 |
'button_meta' => 'updraftplus', |
| 239 |
'dismiss_time' => 'dismiss_season', |
| 240 |
'discount_code' => 'christmassale2018', |
| 241 |
'valid_from' => '2018-12-01 00:00:00', |
| 242 |
'valid_to' => '2018-12-25 23:59:59', |
| 243 |
'supported_positions' => $this->dashboard_top_or_report, |
| 244 |
), |
| 245 |
'newyear' => array( |
| 246 |
'prefix' => '', |
| 247 |
'title' => __('Happy New Year - 20% off UpdraftPlus Premium until January 14th', 'updraftplus'), |
| 248 |
'text' => __('To benefit, use this discount code:', 'updraftplus').' ', |
| 249 |
'image' => 'notices/new_year.png', |
| 250 |
'button_link' => 'https://updraftplus.com/landing/updraftplus-premium', |
| 251 |
'campaign' => 'newyear', |
| 252 |
'button_meta' => 'updraftplus', |
| 253 |
'dismiss_time' => 'dismiss_season', |
| 254 |
'discount_code' => 'newyearsale2019', |
| 255 |
'valid_from' => '2018-12-26 00:00:00', |
| 256 |
'valid_to' => '2019-01-14 23:59:59', |
| 257 |
'supported_positions' => $this->dashboard_top_or_report, |
| 258 |
), |
| 259 |
'spring' => array( |
| 260 |
'prefix' => '', |
| 261 |
'title' => __('Spring sale - 20% off UpdraftPlus Premium until April 30th', 'updraftplus'), |
| 262 |
'text' => __('To benefit, use this discount code:', 'updraftplus').' ', |
| 263 |
'image' => 'notices/spring.png', |
| 264 |
'button_link' => 'https://updraftplus.com/landing/updraftplus-premium', |
| 265 |
'campaign' => 'spring', |
| 266 |
'button_meta' => 'updraftplus', |
| 267 |
'dismiss_time' => 'dismiss_season', |
| 268 |
'discount_code' => 'springsale2019', |
| 269 |
'valid_from' => '2019-04-01 00:00:00', |
| 270 |
'valid_to' => '2019-04-30 23:59:59', |
| 271 |
'supported_positions' => $this->dashboard_top_or_report, |
| 272 |
), |
| 273 |
'summer' => array( |
| 274 |
'prefix' => '', |
| 275 |
'title' => __('Summer sale - 20% off UpdraftPlus Premium until July 31st', 'updraftplus'), |
| 276 |
'text' => __('To benefit, use this discount code:', 'updraftplus').' ', |
| 277 |
'image' => 'notices/summer.png', |
| 278 |
'button_link' => 'https://updraftplus.com/landing/updraftplus-premium', |
| 279 |
'campaign' => 'summer', |
| 280 |
'button_meta' => 'updraftplus', |
| 281 |
'dismiss_time' => 'dismiss_season', |
| 282 |
'discount_code' => 'summersale2019', |
| 283 |
'valid_from' => '2019-07-01 00:00:00', |
| 284 |
'valid_to' => '2019-07-31 23:59:59', |
| 285 |
'supported_positions' => $this->dashboard_top_or_report, |
| 286 |
) |
| 287 |
); |
| 288 |
|
| 289 |
return array_merge($parent_notice_content, $child_notice_content); |
| 290 |
} |
| 291 |
|
| 292 |
/** |
| 293 |
* Call this method to setup the notices |
| 294 |
*/ |
| 295 |
public function notices_init() { |
| 296 |
if ($this->initialized) return; |
| 297 |
$this->initialized = true; |
| 298 |
// parent::notices_init(); |
| 299 |
$this->notices_content = (defined('UPDRAFTPLUS_NOADS_B') && UPDRAFTPLUS_NOADS_B) ? array() : $this->populate_notices_content(); |
| 300 |
global $updraftplus; |
| 301 |
$enqueue_version = $updraftplus->use_unminified_scripts() ? $updraftplus->version.'.'.time() : $updraftplus->version; |
| 302 |
$min_or_not = $updraftplus->use_unminified_scripts() ? '' : '.min'; |
| 303 |
|
| 304 |
wp_enqueue_style('updraftplus-notices-css', UPDRAFTPLUS_URL.'/css/updraftplus-notices'.$min_or_not.'.css', array(), $enqueue_version); |
| 305 |
} |
| 306 |
|
| 307 |
protected function translation_needed($plugin_base_dir = null, $product_name = null) {// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.Found -- Filter use |
| 308 |
return parent::translation_needed(UPDRAFTPLUS_DIR, 'updraftplus'); |
| 309 |
} |
| 310 |
|
| 311 |
protected function wp_optimize_installed($plugin_base_dir = null, $product_name = null) {// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.Found -- Filter use |
| 312 |
$wp_optimize_file = false; |
| 313 |
if (!function_exists('get_plugins')) include_once(ABSPATH.'wp-admin/includes/plugin.php'); |
| 314 |
$plugins = get_plugins(); |
| 315 |
|
| 316 |
foreach ($plugins as $key => $value) { |
| 317 |
if ('wp-optimize' == $value['TextDomain']) { |
| 318 |
return false; |
| 319 |
} |
| 320 |
} |
| 321 |
return true; |
| 322 |
} |
| 323 |
|
| 324 |
protected function keyy_installed($plugin_base_dir = null, $product_name = null) {// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.Found -- Filter use |
| 325 |
$wp_optimize_file = false; |
| 326 |
if (!function_exists('get_plugins')) include_once(ABSPATH.'wp-admin/includes/plugin.php'); |
| 327 |
$plugins = get_plugins(); |
| 328 |
|
| 329 |
foreach ($plugins as $key => $value) { |
| 330 |
if ('keyy' == $value['TextDomain']) { |
| 331 |
return false; |
| 332 |
} |
| 333 |
} |
| 334 |
return true; |
| 335 |
} |
| 336 |
|
| 337 |
protected function metaslider_installed($plugin_base_dir = null, $product_name = null) {// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.Found -- Filter use |
| 338 |
if (!function_exists('get_plugins')) include_once(ABSPATH.'wp-admin/includes/plugin.php'); |
| 339 |
$plugins = get_plugins(); |
| 340 |
|
| 341 |
foreach ($plugins as $key => $value) { |
| 342 |
if ('ml-slider' == $value['TextDomain']) { |
| 343 |
return false; |
| 344 |
} |
| 345 |
} |
| 346 |
return true; |
| 347 |
} |
| 348 |
|
| 349 |
protected function clef_2fa_installed($plugin_base_dir = null, $product_name = null) {// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.Found -- Filter use |
| 350 |
|
| 351 |
if (!function_exists('get_plugins')) include_once(ABSPATH.'wp-admin/includes/plugin.php'); |
| 352 |
|
| 353 |
$plugins = get_plugins(); |
| 354 |
$clef_found = false; |
| 355 |
|
| 356 |
foreach ($plugins as $key => $value) { |
| 357 |
if ('wpclef' == $value['TextDomain']) { |
| 358 |
$clef_found = true; |
| 359 |
} elseif ('two-factor-authentication' == $value['TextDomain'] || 'two-factor-authentication-premium' == $value['TextDomain']) { |
| 360 |
return false; |
| 361 |
} |
| 362 |
} |
| 363 |
|
| 364 |
return $clef_found; |
| 365 |
|
| 366 |
} |
| 367 |
|
| 368 |
protected function url_start($html_allowed = false, $url, $https = false, $website_home = 'updraftplus.com') { |
| 369 |
return parent::url_start($html_allowed, $url, $https, $website_home); |
| 370 |
} |
| 371 |
|
| 372 |
protected function skip_seasonal_notices($notice_data) { |
| 373 |
global $updraftplus; |
| 374 |
|
| 375 |
$time_now = defined('UPDRAFTPLUS_NOTICES_FORCE_TIME') ? UPDRAFTPLUS_NOTICES_FORCE_TIME : time(); |
| 376 |
// Do not show seasonal notices to people with an updraftplus.com version and no-addons yet |
| 377 |
if (!file_exists(UPDRAFTPLUS_DIR.'/udaddons') || $updraftplus->have_addons) { |
| 378 |
$valid_from = strtotime($notice_data['valid_from']); |
| 379 |
$valid_to = strtotime($notice_data['valid_to']); |
| 380 |
$dismiss = $this->check_notice_dismissed($notice_data['dismiss_time']); |
| 381 |
if (($time_now >= $valid_from && $time_now <= $valid_to) && !$dismiss) { |
| 382 |
// return true so that we return this notice to be displayed |
| 383 |
return true; |
| 384 |
} |
| 385 |
} |
| 386 |
|
| 387 |
return false; |
| 388 |
} |
| 389 |
|
| 390 |
protected function check_notice_dismissed($dismiss_time) { |
| 391 |
|
| 392 |
$time_now = defined('UPDRAFTPLUS_NOTICES_FORCE_TIME') ? UPDRAFTPLUS_NOTICES_FORCE_TIME : time(); |
| 393 |
|
| 394 |
$notice_dismiss = ($time_now < UpdraftPlus_Options::get_updraft_option('dismissed_general_notices_until', 0)); |
| 395 |
$seasonal_dismiss = ($time_now < UpdraftPlus_Options::get_updraft_option('dismissed_season_notices_until', 0)); |
| 396 |
$autobackup_dismiss = ($time_now < UpdraftPlus_Options::get_updraft_option('updraftplus_dismissedautobackup', 0)); |
| 397 |
|
| 398 |
$dismiss = false; |
| 399 |
|
| 400 |
if ('dismiss_notice' == $dismiss_time) $dismiss = $notice_dismiss; |
| 401 |
if ('dismiss_season' == $dismiss_time) $dismiss = $seasonal_dismiss; |
| 402 |
if ('dismissautobackup' == $dismiss_time) $dismiss = $autobackup_dismiss; |
| 403 |
|
| 404 |
return $dismiss; |
| 405 |
} |
| 406 |
|
| 407 |
protected function render_specified_notice($advert_information, $return_instead_of_echo = false, $position = 'top') { |
| 408 |
|
| 409 |
if ('bottom' == $position) { |
| 410 |
$template_file = 'bottom-notice.php'; |
| 411 |
} elseif ('report' == $position) { |
| 412 |
$template_file = 'report.php'; |
| 413 |
} elseif ('report-plain' == $position) { |
| 414 |
$template_file = 'report-plain.php'; |
| 415 |
} else { |
| 416 |
$template_file = 'horizontal-notice.php'; |
| 417 |
} |
| 418 |
|
| 419 |
/* |
| 420 |
Check to see if the updraftplus_com_link filter is being used, if it's not then add our tracking to the link. |
| 421 |
*/ |
| 422 |
|
| 423 |
if (!has_filter('updraftplus_com_link') && isset($advert_information['button_link']) && false !== strpos($advert_information['button_link'], '//updraftplus.com')) { |
| 424 |
$advert_information['button_link'] = trailingslashit($advert_information['button_link']).'?afref='.$this->self_affiliate_id; |
| 425 |
if (isset($advert_information['campaign'])) $advert_information['button_link'] .= '?utm_source=updraftplus&utm_medium=banner&utm_campaign='.$advert_information['campaign'].'&utm_term=New&utm_content='.$advert_information['campaign']; |
| 426 |
} |
| 427 |
|
| 428 |
include_once(UPDRAFTPLUS_DIR.'/admin.php'); |
| 429 |
global $updraftplus_admin; |
| 430 |
return $updraftplus_admin->include_template('wp-admin/notices/'.$template_file, $return_instead_of_echo, $advert_information); |
| 431 |
} |
| 432 |
} |
| 433 |
|
| 434 |
$GLOBALS['updraftplus_notices'] = UpdraftPlus_Notices::instance(); |
| 435 |
|