Edit File by line
/home/barbar84/www/wp-conte.../plugins/updraftp.../includes
File: updraftplus-notices.php
<?php
[0] Fix | Delete
[1] Fix | Delete
if (!defined('UPDRAFTPLUS_DIR')) die('No direct access allowed');
[2] Fix | Delete
[3] Fix | Delete
if (!class_exists('Updraft_Notices')) require_once(UPDRAFTPLUS_DIR.'/includes/updraft-notices.php');
[4] Fix | Delete
[5] Fix | Delete
class UpdraftPlus_Notices extends Updraft_Notices {
[6] Fix | Delete
[7] Fix | Delete
protected static $_instance = null;
[8] Fix | Delete
[9] Fix | Delete
private $initialized = false;
[10] Fix | Delete
[11] Fix | Delete
protected $notices_content = array();
[12] Fix | Delete
[13] Fix | Delete
protected $self_affiliate_id = 212;
[14] Fix | Delete
[15] Fix | Delete
public static function instance() {
[16] Fix | Delete
if (empty(self::$_instance)) {
[17] Fix | Delete
self::$_instance = new self();
[18] Fix | Delete
}
[19] Fix | Delete
return self::$_instance;
[20] Fix | Delete
}
[21] Fix | Delete
[22] Fix | Delete
protected function populate_notices_content() {
[23] Fix | Delete
[24] Fix | Delete
$parent_notice_content = parent::populate_notices_content();
[25] Fix | Delete
[26] Fix | Delete
$child_notice_content = array(
[27] Fix | Delete
1 => array(
[28] Fix | Delete
'prefix' => __('UpdraftPlus Premium:', 'updraftplus'),
[29] Fix | Delete
'title' => __('Support', 'updraftplus'),
[30] Fix | Delete
'text' => __('Enjoy professional, fast, and friendly help whenever you need it with Premium.', 'updraftplus'),
[31] Fix | Delete
'image' => 'notices/support.png',
[32] Fix | Delete
'button_link' => 'https://updraftplus.com/landing/updraftplus-premium',
[33] Fix | Delete
'campaign' => 'support',
[34] Fix | Delete
'button_meta' => 'updraftplus',
[35] Fix | Delete
'dismiss_time' => 'dismiss_notice',
[36] Fix | Delete
'supported_positions' => $this->dashboard_top_or_report,
[37] Fix | Delete
),
[38] Fix | Delete
2 => array(
[39] Fix | Delete
'prefix' => __('UpdraftPlus Premium:', 'updraftplus'),
[40] Fix | Delete
'title' => __('UpdraftVault storage', 'updraftplus'),
[41] Fix | Delete
'text' => __('The ultimately secure and convenient place to store your backups.', 'updraftplus'),
[42] Fix | Delete
'image' => 'notices/updraft_logo.png',
[43] Fix | Delete
'button_link' => 'https://updraftplus.com/landing/vault',
[44] Fix | Delete
'campaign' => 'vault',
[45] Fix | Delete
'button_meta' => 'updraftplus',
[46] Fix | Delete
'dismiss_time' => 'dismiss_notice',
[47] Fix | Delete
'supported_positions' => $this->dashboard_top_or_report,
[48] Fix | Delete
),
[49] Fix | Delete
3 => array(
[50] Fix | Delete
'prefix' => __('UpdraftPlus Premium:', 'updraftplus'),
[51] Fix | Delete
'title' => __('enhanced remote storage options', 'updraftplus'),
[52] Fix | Delete
'text' => __('Enhanced storage options for Dropbox, Google Drive and S3. Plus many more options.', 'updraftplus'),
[53] Fix | Delete
'image' => 'addons-images/morestorage.png',
[54] Fix | Delete
'button_link' => 'https://updraftplus.com/landing/updraftplus-premium',
[55] Fix | Delete
'campaign' => 'morestorage',
[56] Fix | Delete
'button_meta' => 'updraftplus',
[57] Fix | Delete
'dismiss_time' => 'dismiss_notice',
[58] Fix | Delete
'supported_positions' => $this->dashboard_top_or_report,
[59] Fix | Delete
),
[60] Fix | Delete
4 => array(
[61] Fix | Delete
'prefix' => __('UpdraftPlus Premium:', 'updraftplus'),
[62] Fix | Delete
'title' => __('advanced options', 'updraftplus'),
[63] Fix | Delete
'text' => __('Secure multisite installation, advanced reporting and much more.', 'updraftplus'),
[64] Fix | Delete
'image' => 'addons-images/reporting.png',
[65] Fix | Delete
'button_link' => 'https://updraftplus.com/landing/updraftplus-premium',
[66] Fix | Delete
'campaign' => 'reporting',
[67] Fix | Delete
'button_meta' => 'updraftplus',
[68] Fix | Delete
'dismiss_time' => 'dismiss_notice',
[69] Fix | Delete
'supported_positions' => $this->dashboard_top_or_report,
[70] Fix | Delete
),
[71] Fix | Delete
5 => array(
[72] Fix | Delete
'prefix' => __('UpdraftPlus Premium:', 'updraftplus'),
[73] Fix | Delete
'title' => __('secure your backups', 'updraftplus'),
[74] Fix | Delete
'text' => __('Add SFTP to send your data securely, lock settings and encrypt your database backups for extra security.', 'updraftplus'),
[75] Fix | Delete
'image' => 'addons-images/lockadmin.png',
[76] Fix | Delete
'button_link' => 'https://updraftplus.com/landing/updraftplus-premium',
[77] Fix | Delete
'campaign' => 'lockadmin',
[78] Fix | Delete
'button_meta' => 'updraftplus',
[79] Fix | Delete
'dismiss_time' => 'dismiss_notice',
[80] Fix | Delete
'supported_positions' => $this->dashboard_top_or_report,
[81] Fix | Delete
),
[82] Fix | Delete
6 => array(
[83] Fix | Delete
'prefix' => __('UpdraftPlus Premium:', 'updraftplus'),
[84] Fix | Delete
'title' => __('easily migrate or clone your site in minutes', 'updraftplus'),
[85] Fix | Delete
'text' => __('Copy your site to another domain directly. Includes find-and-replace tool for database references.', 'updraftplus'),
[86] Fix | Delete
'image' => 'addons-images/migrator.png',
[87] Fix | Delete
'button_link' => 'https://updraftplus.com/landing/updraftplus-premium',
[88] Fix | Delete
'campaign' => 'migrator',
[89] Fix | Delete
'button_meta' => 'updraftplus',
[90] Fix | Delete
'dismiss_time' => 'dismiss_notice',
[91] Fix | Delete
'supported_positions' => $this->anywhere,
[92] Fix | Delete
),
[93] Fix | Delete
7 => array(
[94] Fix | Delete
'prefix' => '',
[95] Fix | Delete
'title' => __('Introducing UpdraftCentral', 'updraftplus'),
[96] Fix | Delete
'text' => __('UpdraftCentral is a highly efficient way to manage, update and backup multiple websites from one place.', 'updraftplus'),
[97] Fix | Delete
'image' => 'notices/updraft_logo.png',
[98] Fix | Delete
'button_link' => 'https://updraftcentral.com',
[99] Fix | Delete
'button_meta' => 'updraftcentral',
[100] Fix | Delete
'dismiss_time' => 'dismiss_notice',
[101] Fix | Delete
'supported_positions' => $this->dashboard_top_or_report,
[102] Fix | Delete
),
[103] Fix | Delete
8 => array(
[104] Fix | Delete
'prefix' => '',
[105] Fix | Delete
'title' => __('Do you use UpdraftPlus on multiple sites?', 'updraftplus'),
[106] Fix | Delete
'text' => __('Control all your WordPress installations from one place using UpdraftCentral remote site management!', 'updraftplus'),
[107] Fix | Delete
'image' => 'notices/updraft_logo.png',
[108] Fix | Delete
'button_link' => 'https://updraftcentral.com',
[109] Fix | Delete
'button_meta' => 'updraftcentral',
[110] Fix | Delete
'dismiss_time' => 'dismiss_notice',
[111] Fix | Delete
'supported_positions' => $this->anywhere,
[112] Fix | Delete
),
[113] Fix | Delete
'rate' => array(
[114] Fix | Delete
'text' => __("Hey - We noticed UpdraftPlus has kept your site safe for a while. If you like us, please consider leaving a positive review to spread the word. Or if you have any issues or questions please leave us a support message", 'updraftplus') . ' <a href="https://wordpress.org/support/plugin/updraftplus/" target="_blank">' . __('here', 'updraftplus') . '.</a><br>' . __('Thank you so much!', 'updraftplus') . '<br><br> - <b>' . __('Team Updraft', 'updraftplus') . '</b><br>',
[115] Fix | Delete
'image' => 'notices/ud_smile.png',
[116] Fix | Delete
'button_link' => 'https://wordpress.org/support/plugin/updraftplus/reviews/?rate=5#new-post',
[117] Fix | Delete
'button_meta' => 'review',
[118] Fix | Delete
'dismiss_time' => 'dismiss_review_notice',
[119] Fix | Delete
'supported_positions' => $this->dashboard_top,
[120] Fix | Delete
'validity_function' => 'show_rate_notice'
[121] Fix | Delete
),
[122] Fix | Delete
'translation_needed' => array(
[123] Fix | Delete
'prefix' => '',
[124] Fix | Delete
'title' => 'Can you translate? Want to improve UpdraftPlus for speakers of your language?',
[125] Fix | Delete
'text' => $this->url_start(true, 'updraftplus.com/translate/')."Please go here for instructions - it is easy.".$this->url_end(true, 'updraftplus.com/translate/'),
[126] Fix | Delete
'text_plain' => $this->url_start(false, 'updraftplus.com/translate/')."Please go here for instructions - it is easy.".$this->url_end(false, 'updraftplus.com/translate/'),
[127] Fix | Delete
'image' => 'notices/updraft_logo.png',
[128] Fix | Delete
'button_link' => false,
[129] Fix | Delete
'dismiss_time' => false,
[130] Fix | Delete
'supported_positions' => $this->anywhere,
[131] Fix | Delete
'validity_function' => 'translation_needed',
[132] Fix | Delete
),
[133] Fix | Delete
'social_media' => array(
[134] Fix | Delete
'prefix' => '',
[135] Fix | Delete
'title' => __('UpdraftPlus is on social media - check us out!', 'updraftplus'),
[136] Fix | Delete
'text' => $this->url_start(true, 'twitter.com/updraftplus', true). __('Twitter', 'updraftplus'). $this->url_end(true, 'twitter.com/updraftplus', true).
[137] Fix | Delete
' - '.
[138] Fix | Delete
$this->url_start(true, 'facebook.com/updraftplus', true). __('Facebook', 'updraftplus'). $this->url_end(true, 'facebook.com/updraftplus', true),
[139] Fix | Delete
'text_plain' => $this->url_start(false, 'twitter.com/updraftplus', true). __('Twitter', 'updraftplus'). $this->url_end(false, 'twitter.com/updraftplus', true).
[140] Fix | Delete
' - '.
[141] Fix | Delete
$this->url_start(false, 'facebook.com/updraftplus', true). __('Facebook', 'updraftplus'). $this->url_end(false, 'facebook.com/updraftplus', true),
[142] Fix | Delete
'image' => 'notices/updraft_logo.png',
[143] Fix | Delete
'dismiss_time' => false,
[144] Fix | Delete
'supported_positions' => $this->anywhere,
[145] Fix | Delete
),
[146] Fix | Delete
'newsletter' => array(
[147] Fix | Delete
'prefix' => '',
[148] Fix | Delete
'title' => __('UpdraftPlus Newsletter', 'updraftplus'),
[149] Fix | Delete
'text' => __("Follow this link to sign up for the UpdraftPlus newsletter.", 'updraftplus'),
[150] Fix | Delete
'image' => 'notices/updraft_logo.png',
[151] Fix | Delete
'button_link' => 'https://updraftplus.com/newsletter-signup',
[152] Fix | Delete
'campaign' => 'newsletter',
[153] Fix | Delete
'button_meta' => 'signup',
[154] Fix | Delete
'supported_positions' => $this->anywhere,
[155] Fix | Delete
'dismiss_time' => false
[156] Fix | Delete
),
[157] Fix | Delete
'subscribe_blog' => array(
[158] Fix | Delete
'prefix' => '',
[159] Fix | Delete
'title' => __('UpdraftPlus Blog - get up-to-date news and offers', 'updraftplus'),
[160] Fix | Delete
'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'),
[161] Fix | Delete
'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'),
[162] Fix | Delete
'image' => 'notices/updraft_logo.png',
[163] Fix | Delete
'button_link' => false,
[164] Fix | Delete
'supported_positions' => $this->anywhere,
[165] Fix | Delete
'dismiss_time' => false
[166] Fix | Delete
),
[167] Fix | Delete
'check_out_updraftplus_com' => array(
[168] Fix | Delete
'prefix' => '',
[169] Fix | Delete
'title' => __('UpdraftPlus Blog - get up-to-date news and offers', 'updraftplus'),
[170] Fix | Delete
'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'),
[171] Fix | Delete
'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'),
[172] Fix | Delete
'image' => 'notices/updraft_logo.png',
[173] Fix | Delete
'button_link' => false,
[174] Fix | Delete
'supported_positions' => $this->dashboard_bottom_or_report,
[175] Fix | Delete
'dismiss_time' => false
[176] Fix | Delete
),
[177] Fix | Delete
'autobackup' => array(
[178] Fix | Delete
'prefix' => '',
[179] Fix | Delete
'title' => __('Make updates easy with UpdraftPlus', 'updraftplus'),
[180] Fix | Delete
'text' => __('Be safe', 'updraftplus') . ' - ' . $this->url_start(true, 'updraftplus.com/shop/updraftplus-premium/') . 'UpdraftPlus Premium' . $this->url_end(true, 'updraftplus.com/shop/updraftplus-premium/') . ' ' . __('backs up automatically when you update plugins, themes or core', 'updraftplus'),
[181] Fix | Delete
'text2' => __('Save time', 'updraftplus') . ' - ' . $this->url_start(true, 'wordpress.org/plugins/stops-core-theme-and-plugin-updates/') . 'Easy Updates Manager' . $this->url_end(true, 'wordpress.org/plugins/stops-core-theme-and-plugin-updates/') . ' ' . __('handles updates automatically as you want them', 'updraftplus'),
[182] Fix | Delete
'text3' => __('Many sites?', 'updraftplus') . ' - ' . $this->url_start(true, 'updraftplus.com/updraftcentral/') . 'UpdraftCentral' . $this->url_end(true, 'updraftplus.com/updraftcentral/') . ' ' . __('manages all your WordPress sites at once from one place', 'updraftplus'),
[183] Fix | Delete
'image' => 'addons-images/autobackup.png',
[184] Fix | Delete
'button_link' => 'https://updraftplus.com/landing/updraftplus-premium',
[185] Fix | Delete
'campaign' => 'autobackup',
[186] Fix | Delete
'button_meta' => 'updraftplus',
[187] Fix | Delete
'dismiss_time' => 'dismissautobackup',
[188] Fix | Delete
'supported_positions' => $this->autobackup_bottom_or_report,
[189] Fix | Delete
),
[190] Fix | Delete
'subscriben' => array(
[191] Fix | Delete
'prefix' => '',
[192] Fix | Delete
'title' => 'Subscriben ' .__('by', 'updraftplus'). ' UpdraftPlus',
[193] Fix | Delete
'text' => __("The WordPress subscription extension for WooCommerce store owners.", "updraftplus"),
[194] Fix | Delete
'image' => 'notices/subscriben.png',
[195] Fix | Delete
'button_link' => 'https://subscribenplugin.com',
[196] Fix | Delete
'button_meta' => 'read_more',
[197] Fix | Delete
'dismiss_time' => 'dismiss_notice',
[198] Fix | Delete
'supported_positions' => $this->anywhere,
[199] Fix | Delete
),
[200] Fix | Delete
'wp-optimize' => array(
[201] Fix | Delete
'prefix' => '',
[202] Fix | Delete
'title' => 'WP-Optimize',
[203] Fix | Delete
'text' => __("After you've backed up your database, we recommend you install our WP-Optimize plugin to streamline it for better website performance.", "updraftplus"),
[204] Fix | Delete
'image' => 'notices/wp_optimize_logo.png',
[205] Fix | Delete
'button_link' => 'https://wordpress.org/plugins/wp-optimize/',
[206] Fix | Delete
'button_meta' => 'wp-optimize',
[207] Fix | Delete
'dismiss_time' => 'dismiss_notice',
[208] Fix | Delete
'supported_positions' => $this->anywhere,
[209] Fix | Delete
'validity_function' => 'wp_optimize_installed',
[210] Fix | Delete
),
[211] Fix | Delete
[212] Fix | Delete
// The sale adverts content starts here
[213] Fix | Delete
'blackfriday' => array(
[214] Fix | Delete
'prefix' => '',
[215] Fix | Delete
'title' => __('Black Friday - 20% off UpdraftPlus Premium until November 30th', 'updraftplus'),
[216] Fix | Delete
'text' => __('To benefit, use this discount code:', 'updraftplus').' ',
[217] Fix | Delete
'image' => 'notices/black_friday.png',
[218] Fix | Delete
'button_link' => 'https://updraftplus.com/landing/updraftplus-premium',
[219] Fix | Delete
'campaign' => 'blackfriday',
[220] Fix | Delete
'button_meta' => 'updraftplus',
[221] Fix | Delete
'dismiss_time' => 'dismiss_season',
[222] Fix | Delete
'discount_code' => 'blackfridaysale2022',
[223] Fix | Delete
'valid_from' => '2022-11-20 00:00:00',
[224] Fix | Delete
'valid_to' => '2022-11-30 23:59:59',
[225] Fix | Delete
'supported_positions' => $this->dashboard_top_or_report,
[226] Fix | Delete
),
[227] Fix | Delete
'newyear' => array(
[228] Fix | Delete
'prefix' => '',
[229] Fix | Delete
'title' => __('Happy New Year - 20% off UpdraftPlus Premium until January 14th', 'updraftplus'),
[230] Fix | Delete
'text' => __('To benefit, use this discount code:', 'updraftplus').' ',
[231] Fix | Delete
'image' => 'notices/new_year.png',
[232] Fix | Delete
'button_link' => 'https://updraftplus.com/landing/updraftplus-premium',
[233] Fix | Delete
'campaign' => 'newyear',
[234] Fix | Delete
'button_meta' => 'updraftplus',
[235] Fix | Delete
'dismiss_time' => 'dismiss_season',
[236] Fix | Delete
'discount_code' => 'newyearsale2023',
[237] Fix | Delete
'valid_from' => '2022-12-26 00:00:00',
[238] Fix | Delete
'valid_to' => '2023-01-14 23:59:59',
[239] Fix | Delete
'supported_positions' => $this->dashboard_top_or_report,
[240] Fix | Delete
),
[241] Fix | Delete
'spring' => array(
[242] Fix | Delete
'prefix' => '',
[243] Fix | Delete
'title' => __('Spring sale - 20% off UpdraftPlus Premium until May 31st', 'updraftplus'),
[244] Fix | Delete
'text' => __('To benefit, use this discount code:', 'updraftplus').' ',
[245] Fix | Delete
'image' => 'notices/spring.png',
[246] Fix | Delete
'button_link' => 'https://updraftplus.com/landing/updraftplus-premium',
[247] Fix | Delete
'campaign' => 'spring',
[248] Fix | Delete
'button_meta' => 'updraftplus',
[249] Fix | Delete
'dismiss_time' => 'dismiss_season',
[250] Fix | Delete
'discount_code' => 'springsale2022',
[251] Fix | Delete
'valid_from' => '2022-05-01 00:00:00',
[252] Fix | Delete
'valid_to' => '2022-05-31 23:59:59',
[253] Fix | Delete
'supported_positions' => $this->dashboard_top_or_report,
[254] Fix | Delete
),
[255] Fix | Delete
'summer' => array(
[256] Fix | Delete
'prefix' => '',
[257] Fix | Delete
'title' => __('Summer sale - 20% off UpdraftPlus Premium until July 31st', 'updraftplus'),
[258] Fix | Delete
'text' => __('To benefit, use this discount code:', 'updraftplus').' ',
[259] Fix | Delete
'image' => 'notices/summer.png',
[260] Fix | Delete
'button_link' => 'https://updraftplus.com/landing/updraftplus-premium',
[261] Fix | Delete
'campaign' => 'summer',
[262] Fix | Delete
'button_meta' => 'updraftplus',
[263] Fix | Delete
'dismiss_time' => 'dismiss_season',
[264] Fix | Delete
'discount_code' => 'summersale2022',
[265] Fix | Delete
'valid_from' => '2022-07-01 00:00:00',
[266] Fix | Delete
'valid_to' => '2022-07-31 23:59:59',
[267] Fix | Delete
'supported_positions' => $this->dashboard_top_or_report,
[268] Fix | Delete
),
[269] Fix | Delete
'collection' => array(
[270] Fix | Delete
'prefix' => '',
[271] Fix | Delete
'title' => __('The Updraft Plugin Collection Sale', 'updraftplus'),
[272] Fix | Delete
'text' => __('Get 20% off any of our plugins. But hurry - offer ends 30th September, use this discount code:', 'updraftplus').' ',
[273] Fix | Delete
'image' => 'notices/updraft_logo.png',
[274] Fix | Delete
'button_link' => 'https://teamupdraft.com',
[275] Fix | Delete
'campaign' => 'collection',
[276] Fix | Delete
'button_meta' => 'collection',
[277] Fix | Delete
'dismiss_time' => 'dismiss_season',
[278] Fix | Delete
'discount_code' => 'UDP2022',
[279] Fix | Delete
'valid_from' => '2022-09-01 00:00:00',
[280] Fix | Delete
'valid_to' => '2022-09-30 23:59:59',
[281] Fix | Delete
'supported_positions' => $this->dashboard_top_or_report,
[282] Fix | Delete
)
[283] Fix | Delete
);
[284] Fix | Delete
[285] Fix | Delete
return array_merge($parent_notice_content, $child_notice_content);
[286] Fix | Delete
}
[287] Fix | Delete
[288] Fix | Delete
/**
[289] Fix | Delete
* Call this method to setup the notices
[290] Fix | Delete
*/
[291] Fix | Delete
public function notices_init() {
[292] Fix | Delete
if ($this->initialized) return;
[293] Fix | Delete
$this->initialized = true;
[294] Fix | Delete
// parent::notices_init();
[295] Fix | Delete
$this->notices_content = (defined('UPDRAFTPLUS_NOADS_B') && UPDRAFTPLUS_NOADS_B) ? array() : $this->populate_notices_content();
[296] Fix | Delete
global $updraftplus;
[297] Fix | Delete
$enqueue_version = $updraftplus->use_unminified_scripts() ? $updraftplus->version.'.'.time() : $updraftplus->version;
[298] Fix | Delete
$updraft_min_or_not = $updraftplus->get_updraftplus_file_version();
[299] Fix | Delete
[300] Fix | Delete
wp_enqueue_style('updraftplus-notices-css', UPDRAFTPLUS_URL.'/css/updraftplus-notices'.$updraft_min_or_not.'.css', array(), $enqueue_version);
[301] Fix | Delete
}
[302] Fix | Delete
[303] Fix | Delete
protected function translation_needed($plugin_base_dir = null, $product_name = null) {// phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable, Generic.CodeAnalysis.UnusedFunctionParameter.Found -- Filter use
[304] Fix | Delete
return parent::translation_needed(UPDRAFTPLUS_DIR, 'updraftplus');
[305] Fix | Delete
}
[306] Fix | Delete
[307] Fix | Delete
/**
[308] Fix | Delete
* This function will check if we should display the rate notice or not
[309] Fix | Delete
*
[310] Fix | Delete
* @return boolean - to indicate if we should show the notice or not
[311] Fix | Delete
*/
[312] Fix | Delete
protected function show_rate_notice() {
[313] Fix | Delete
global $updraftplus;
[314] Fix | Delete
[315] Fix | Delete
$backup_history = UpdraftPlus_Backup_History::get_history();
[316] Fix | Delete
[317] Fix | Delete
$backup_dir = $updraftplus->backups_dir_location();
[318] Fix | Delete
// N.B. Not an exact proxy for the installed time; they may have tweaked the expert option to move the directory
[319] Fix | Delete
$installed = @filemtime($backup_dir.'/index.html');// phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged
[320] Fix | Delete
$installed_for = time() - $installed;
[321] Fix | Delete
[322] Fix | Delete
if (!empty($backup_history) && $installed && $installed_for > 28*86400) {
[323] Fix | Delete
return true;
[324] Fix | Delete
}
[325] Fix | Delete
[326] Fix | Delete
return false;
[327] Fix | Delete
}
[328] Fix | Delete
[329] Fix | Delete
protected function wp_optimize_installed($plugin_base_dir = null, $product_name = null) {// phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable -- Filter use
[330] Fix | Delete
if (!function_exists('get_plugins')) include_once(ABSPATH.'wp-admin/includes/plugin.php');
[331] Fix | Delete
$plugins = get_plugins();
[332] Fix | Delete
[333] Fix | Delete
foreach ($plugins as $value) {
[334] Fix | Delete
if ('wp-optimize' == $value['TextDomain']) {
[335] Fix | Delete
return false;
[336] Fix | Delete
}
[337] Fix | Delete
}
[338] Fix | Delete
return true;
[339] Fix | Delete
}
[340] Fix | Delete
[341] Fix | Delete
protected function url_start($html_allowed, $url, $https = false, $website_home = 'updraftplus.com') {
[342] Fix | Delete
return parent::url_start($html_allowed, $url, $https, $website_home);
[343] Fix | Delete
}
[344] Fix | Delete
[345] Fix | Delete
protected function skip_seasonal_notices($notice_data) {
[346] Fix | Delete
global $updraftplus;
[347] Fix | Delete
[348] Fix | Delete
$time_now = defined('UPDRAFTPLUS_NOTICES_FORCE_TIME') ? UPDRAFTPLUS_NOTICES_FORCE_TIME : time();
[349] Fix | Delete
// Do not show seasonal notices to people with an updraftplus.com version and no-addons yet
[350] Fix | Delete
if (!file_exists(UPDRAFTPLUS_DIR.'/udaddons') || $updraftplus->have_addons) {
[351] Fix | Delete
$valid_from = strtotime($notice_data['valid_from']);
[352] Fix | Delete
$valid_to = strtotime($notice_data['valid_to']);
[353] Fix | Delete
$dismiss = $this->check_notice_dismissed($notice_data['dismiss_time']);
[354] Fix | Delete
if (($time_now >= $valid_from && $time_now <= $valid_to) && !$dismiss) {
[355] Fix | Delete
// return true so that we return this notice to be displayed
[356] Fix | Delete
return true;
[357] Fix | Delete
}
[358] Fix | Delete
}
[359] Fix | Delete
[360] Fix | Delete
return false;
[361] Fix | Delete
}
[362] Fix | Delete
[363] Fix | Delete
protected function check_notice_dismissed($dismiss_time) {
[364] Fix | Delete
[365] Fix | Delete
$time_now = defined('UPDRAFTPLUS_NOTICES_FORCE_TIME') ? UPDRAFTPLUS_NOTICES_FORCE_TIME : time();
[366] Fix | Delete
[367] Fix | Delete
$notice_dismiss = ($time_now < UpdraftPlus_Options::get_updraft_option('dismissed_general_notices_until', 0));
[368] Fix | Delete
$review_dismiss = ($time_now < UpdraftPlus_Options::get_updraft_option('dismissed_review_notice', 0));
[369] Fix | Delete
$seasonal_dismiss = ($time_now < UpdraftPlus_Options::get_updraft_option('dismissed_season_notices_until', 0));
[370] Fix | Delete
$autobackup_dismiss = ($time_now < UpdraftPlus_Options::get_updraft_option('updraftplus_dismissedautobackup', 0));
[371] Fix | Delete
[372] Fix | Delete
$dismiss = false;
[373] Fix | Delete
[374] Fix | Delete
if ('dismiss_notice' == $dismiss_time) $dismiss = $notice_dismiss;
[375] Fix | Delete
if ('dismiss_review_notice' == $dismiss_time) $dismiss = $review_dismiss;
[376] Fix | Delete
if ('dismiss_season' == $dismiss_time) $dismiss = $seasonal_dismiss;
[377] Fix | Delete
if ('dismissautobackup' == $dismiss_time) $dismiss = $autobackup_dismiss;
[378] Fix | Delete
[379] Fix | Delete
return $dismiss;
[380] Fix | Delete
}
[381] Fix | Delete
[382] Fix | Delete
protected function render_specified_notice($advert_information, $return_instead_of_echo = false, $position = 'top') {
[383] Fix | Delete
[384] Fix | Delete
if ('bottom' == $position) {
[385] Fix | Delete
$template_file = 'bottom-notice.php';
[386] Fix | Delete
} elseif ('report' == $position) {
[387] Fix | Delete
$template_file = 'report.php';
[388] Fix | Delete
} elseif ('report-plain' == $position) {
[389] Fix | Delete
$template_file = 'report-plain.php';
[390] Fix | Delete
} elseif ('autobackup' == $position) {
[391] Fix | Delete
$template_file = 'autobackup-notice.php';
[392] Fix | Delete
} else {
[393] Fix | Delete
$template_file = 'horizontal-notice.php';
[394] Fix | Delete
}
[395] Fix | Delete
[396] Fix | Delete
/*
[397] Fix | Delete
Check to see if the updraftplus_com_link filter is being used, if it's not then add our tracking to the link.
[398] Fix | Delete
*/
[399] Fix | Delete
[400] Fix | Delete
if (!has_filter('updraftplus_com_link') && isset($advert_information['button_link']) && false !== strpos($advert_information['button_link'], '//updraftplus.com')) {
[401] Fix | Delete
$advert_information['button_link'] = trailingslashit($advert_information['button_link']).'?afref='.$this->self_affiliate_id;
[402] Fix | Delete
if (isset($advert_information['campaign'])) $advert_information['button_link'] .= '&utm_source=updraftplus&utm_medium=banner&utm_campaign='.$advert_information['campaign'];
[403] Fix | Delete
}
[404] Fix | Delete
[405] Fix | Delete
include_once(UPDRAFTPLUS_DIR.'/admin.php');
[406] Fix | Delete
global $updraftplus_admin;
[407] Fix | Delete
return $updraftplus_admin->include_template('wp-admin/notices/'.$template_file, $return_instead_of_echo, $advert_information);
[408] Fix | Delete
}
[409] Fix | Delete
}
[410] Fix | Delete
[411] Fix | Delete
$GLOBALS['updraftplus_notices'] = UpdraftPlus_Notices::instance();
[412] Fix | Delete
[413] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function