PluginProbe
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance / 4.7.0
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance v4.7.0
4.7.0 4.6.1 4.6.0 4.5.5 4.5.4 4.5.3 4.5.2 3.2.20 3.2.21 3.2.22 3.2.3 3.2.5 3.2.6 3.2.7 3.2.9 3.3.0 3.3.1 3.3.2 3.4.0 3.4.1 3.4.2 3.5.0 3.6.0 3.7.0 3.7.1 All 111 releases
← All changes | includes/class-wp-optimize-notices.php +78 -139 3.2.9 → 4.7.0 View file →
@@ -1,11 +1,11 @@
1 1 <?php
2 2
3 -if (!defined('WPO_PLUGIN_MAIN_PATH')) die('No direct access allowed');
3 +if (!defined('ABSPATH')) die('No direct access allowed');
4 4
5 -if (!class_exists('Updraft_Notices_1_2')) require_once(WPO_PLUGIN_MAIN_PATH.'/vendor/team-updraft/common-libs/src/updraft-notices/updraft-notices.php');
5 +if (!class_exists('Updraft_Notices_1_3')) require_once(WPO_PLUGIN_MAIN_PATH.'vendor/team-updraft/common-libs/src/updraft-notices/updraft-notices.php');
6 6
7 -class WP_Optimize_Notices extends Updraft_Notices_1_2 {
7 +class WP_Optimize_Notices extends Updraft_Notices_1_3 {
8 8
9 9 private $initialized = false;
10 10
11 11 protected $self_affiliate_id = 216;
@@ -27,19 +27,30 @@
27 27
28 28 /**
29 29 * This method gets any parent notices and adds its own notices to the notice array
30 30 *
31 - * @return Array returns an array of notices
31 + * @return array returns an array of notices
32 32 */
33 33 protected function populate_notices_content() {
34 34
35 35 $parent_notice_content = parent::populate_notices_content();
36 36
37 + // translators: %1$s are bold html tags to make some of the text bold, %2$s are closing tags
38 + $sale_description = sprintf(__('Make your site even %1$s faster with Premium %2$s.', 'wp-optimize'), '<b>', '</b>') . ' ';
39 + // translators: %1$s are bold html tags to make some of the text bold, %2$s are closing tags
40 + $sale_description .= sprintf(__('Identify orphaned images, load pages faster and get %1$s premium support %2$s.', 'wp-optimize'), '<b>', '</b>') . ' ';
41 + $sale_description .= __('Get advanced options, like the ability to optimize your site using WP-CLI.', 'wp-optimize') . ' ';
42 + // translators: %1$s are bold html tags to make some of the text bold, %2$s are closing tags
43 + $sale_description .= sprintf(__('Premium is %1$s compatible with WordPress multisite, WooCommerce and other add-ons %2$s, including multilingual and multi-currency WordPress plugins.', 'wp-optimize'), '<b>', '</b>');
44 + $sale_description .= '<br>';
45 +
46 + $bf_checkout_html = '<b><a href="https://teamupdraft.com/plugin-black-friday/?utm_source=udp-plugin&utm_medium=referral&utm_campaign=bf25-udp-plugin-banner&utm_content=bf-sale&utm_creative_format=advert" target="_blank">'.__('Save 20% with code blackfridaysale2025', 'wp-optimize').'</a></b>';
47 +
37 48 $child_notice_content = array(
38 49 'updraftplus' => array(
39 50 'prefix' => '',
40 51 'title' => __('Make sure you backup before you optimize your database', 'wp-optimize'),
41 - 'text' => __("UpdraftPlus is the world's most trusted backup plugin from the owners of WP-Optimize", 'wp-optimize'),
52 + 'text' => __("UpdraftPlus is the world's most trusted backup plugin, from the owners of WP-Optimize.", 'wp-optimize'),
42 53 'image' => 'notices/updraft_logo.png',
43 54 'button_link' => 'https://wordpress.org/plugins/updraftplus/',
44 55 'button_meta' => 'updraftplus',
45 56 'dismiss_time' => 'dismiss_page_notice_until',
@@ -47,12 +58,12 @@
47 58 'validity_function' => 'is_updraftplus_installed',
48 59 ),
49 60 'updraftcentral' => array(
50 61 'prefix' => '',
51 - 'title' => __('Save Time and Money. Manage multiple WordPress sites from one location.', 'wp-optimize'),
52 - 'text' => __('UpdraftCentral is a highly efficient way to take backup, update and manage multiple WP sites from one location.', 'wp-optimize'),
53 - 'image' => 'notices/updraft_logo.png',
54 - 'button_link' => 'https://updraftcentral.com',
62 + 'title' => __('Save time and money.', 'wp-optimize') . ' ' . __('Manage multiple sites from one location.', 'wp-optimize'),
63 + 'text' => __('Back up, update and manage multiple WordPress websites centrally.', 'wp-optimize'),
64 + 'image' => 'notices/updraft_central_logo.png',
65 + 'button_link' => 'https://teamupdraft.com/updraftcentral/?utm_source=wpo-plugin&utm_medium=referral&utm_campaign=paac&utm_content=updraftcentral&utm_creative_format=advert',
55 66 'button_meta' => 'updraftcentral',
56 67 'dismiss_time' => 'dismiss_page_notice_until',
57 68 'supported_positions' => $this->dashboard_top_or_report,
58 69 'validity_function' => 'is_updraftcentral_installed',
@@ -57,10 +68,11 @@
57 68 'supported_positions' => $this->dashboard_top_or_report,
58 69 'validity_function' => 'is_updraftcentral_installed',
59 70 ),
60 71 'rate_plugin' => array(
61 - 'text' => __("Hey - We noticed WP-Optimize has kept your site running fast 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", 'wp-optimize') . ' <a href="https://wordpress.org/support/plugin/wp-optimize/" target="_blank">' . __('here', 'wp-optimize') . '.</a><br>' . __('Thank you so much!', 'wp-optimize') . ' - <b>WP-Optimize</b><br>',
62 - 'image' => 'notices/ud_smile.png',
72 + // translators: %1$s is an anchor tag to WP-Optimize support forum, %2$s is closing tags
73 + 'text' => __("We noticed WP-Optimize has kept your site running fast for a while.", 'wp-optimize') . ' ' . __('If you like us, please consider leaving us a positive review.', 'wp-optimize') . ' ' . sprintf(__('If you have any issues or questions please contact %1$s support. %2$s', 'wp-optimize'), '<a href="https://wordpress.org/support/plugin/wp-optimize/" target="_blank">', '</a><br>') . __('Thank you so much!', 'wp-optimize'),
74 + 'image' => 'notices/wp_optimize_logo.png',
63 75 'button_link' => 'https://wordpress.org/support/plugin/wp-optimize/reviews/?rate=5#new-post',
64 76 'button_meta' => 'review',
65 77 'dismiss_time' => 'dismiss_review_notice',
66 78 'supported_positions' => $this->dashboard_top,
@@ -67,13 +79,13 @@
67 79 'validity_function' => 'show_rate_notice'
68 80 ),
69 81 'translation_needed' => array(
70 82 'prefix' => '',
71 - 'title' => 'Can you translate? Want to improve WP-Optimize for speakers of your language?',
72 - 'text' => $this->url_start(true, 'translate.wordpress.org/projects/wp-plugins/wp-optimize')."Please go here for instructions - it is easy.".$this->url_end(true, 'translate.wordpress.org/projects/wp-plugins/wp-optimize'),
73 - 'text_plain' => $this->url_start(false, 'translate.wordpress.org/projects/wp-plugins/wp-optimize')."Please go here for instructions - it is easy.".$this->url_end(false, 'translate.wordpress.org/projects/wp-plugins/wp-optimize'),
83 + 'title' => 'Can you translate?',
84 + 'text' => __("Want to improve WP-Optimize for speakers of your language? Go here for instructions", 'wp-optimize'),
74 85 'image' => 'notices/wp_optimize_logo.png',
75 - 'button_link' => false,
86 + 'button_link' => 'https://teamupdraft.com/translate-for-us?utm_source=wpo-plugin&utm_medium=referral&utm_campaign=paac&utm_content=translate&utm_creative_format=advert',
87 + 'button_meta' => 'translate',
76 88 'dismiss_time' => false,
77 89 'supported_positions' => $this->anywhere,
78 90 'validity_function' => 'translation_needed',
79 91 ),
@@ -79,11 +91,11 @@
79 91 ),
80 92 'wpo-premium' => array(
81 93 'prefix' => '',
82 94 'title' => __("Perform optimizations while your visitors sleep", "wp-optimize"),
83 - 'text' => __("WP-Optimize Premium features an advanced scheduling system that allows you to run optimizations at the quietest time of day (or night).", "wp-optimize"),
95 + 'text' => __("Schedule optimizations for set times e.g. overnight when server resources are high.", "wp-optimize"),
84 96 'image' => 'notices/wp_optimize_logo.png',
85 - 'button_link' => 'https://getwpo.com',
97 + 'button_link' => 'https://teamupdraft.com/wp-optimize/features?utm_source=wpo-plugin&utm_medium=referral&utm_campaign=paac&utm_content=while-they-sleep&utm_creative_format=advert',
86 98 'button_meta' => 'wpo-premium',
87 99 'dismiss_time' => 'dismiss_notice',
88 100 'supported_positions' => $this->anywhere,
89 101 'validity_function' => 'is_wpo_premium_installed',
@@ -89,132 +101,56 @@
89 101 'validity_function' => 'is_wpo_premium_installed',
90 102 ),
91 103 'wpo-premium-multisite' => array(
92 104 'prefix' => '',
93 - 'title' => __("Manage a multisite installation? Need extra control?", "wp-optimize"),
94 - 'text' => __("WP-Optimize Premium's multisite feature includes a locking system that restricts optimization commands to users with the right permissions.", "wp-optimize"),
105 + 'title' => __("Manage a multisite installation?", "wp-optimize"),
106 + 'text' => __("Optimize any site (or combination of sites) on the multisite network.", "wp-optimize") . ' ' . __("Give the right permissions to the right users.", "wp-optimize"),
95 107 'image' => 'notices/wp_optimize_logo.png',
96 - 'button_link' => 'https://getwpo.com',
108 + 'button_link' => 'https://teamupdraft.com/wp-optimize/features?utm_source=wpo-plugin&utm_medium=referral&utm_campaign=paac&utm_content=multisite&utm_creative_format=advert',
97 109 'button_meta' => 'wpo-premium',
98 110 'dismiss_time' => 'dismiss_notice',
99 111 'supported_positions' => $this->anywhere,
100 112 'validity_function' => 'is_wpo_premium_installed',
101 113 ),
102 - 'wpo-premium2' => array(
103 - 'prefix' => '',
104 - 'title' => __("WP-Optimize Premium offers unparalleled choice and flexibility", "wp-optimize"),
105 - 'text' => __("Upgrade today to combine over a dozen optimization options.", "wp-optimize"),
106 - 'image' => 'notices/wp_optimize_logo.png',
107 - 'button_link' => 'https://getwpo.com',
108 - 'button_meta' => 'wpo-premium',
109 - 'dismiss_time' => 'dismiss_notice',
110 - 'supported_positions' => $this->anywhere,
111 - 'validity_function' => 'is_wpo_premium_installed',
112 - ),
113 114 'wpo-premium3' => array(
114 115 'prefix' => '',
115 116 'title' => __("Remove unwanted images for better site performance.", "wp-optimize"),
116 117 'text' => __("WP-Optimize Premium comes with a feature to easily remove orphaned images, or images that exceed a certain size from your website.", "wp-optimize"),
117 118 'image' => 'notices/wp_optimize_logo.png',
118 - 'button_link' => 'https://getwpo.com',
119 + 'button_link' => 'https://teamupdraft.com/wp-optimize/features?utm_source=wpo-plugin&utm_medium=referral&utm_campaign=paac&utm_content=unwanted-images&utm_creative_format=advert',
119 120 'button_meta' => 'wpo-premium',
120 121 'dismiss_time' => 'dismiss_notice',
121 122 'supported_positions' => $this->anywhere,
122 123 'validity_function' => 'is_wpo_premium_installed',
123 124 ),
124 - 'wpo-power-tweaks' => array(
125 + 'aios' => array(
125 126 'prefix' => '',
126 - 'title' => __("Power tweaks for advanced users and better site performance.", "wp-optimize"),
127 - 'text' => __("WP-Optimize Premium comes with the power tweaks that will enable you to improve performance by targeting specific weak points, either in WordPress Core, or in popular plugins.", "wp-optimize"),
128 - 'image' => 'notices/wp_optimize_logo.png',
129 - 'button_link' => 'https://getwpo.com/faqs/#Power-tweaks-2-',
130 - 'button_meta' => 'wpo-premium',
127 + 'title' => __('Secure your site', 'wp-optimize'),
128 + // translators: %1$s is the name of plugin and %2$s is the name of the team
129 + 'text' => sprintf(__('The %1$s plugin from %2$s.', 'wp-optimize'), '"All-In-One" Security', 'TeamUpdraft'),
130 + 'image' => 'notices/aios_logo.png',
131 + 'button_link' => 'https://teamupdraft.com/all-in-one-security/?utm_source=wpo-plugin&utm_medium=referral&utm_campaign=paac&utm_content=aios&utm_creative_format=advert',
132 + 'button_meta' => 'aios',
131 133 'dismiss_time' => 'dismiss_notice',
132 134 'supported_positions' => $this->anywhere,
133 - 'validity_function' => 'is_wpo_premium_installed',
134 135 ),
135 - 'subscriben' => array(
136 - 'prefix' => '',
137 - 'title' => 'Subscriben ' .__('by', 'wp-optimize'). ' UpdraftPlus',
138 - 'text' => __("The WordPress subscription extension for WooCommerce store owners.", "wp-optimize"),
139 - 'image' => 'notices/subscriben.png',
140 - 'button_link' => 'https://subscribenplugin.com',
141 - 'button_meta' => 'read_more',
142 - 'dismiss_time' => 'dismiss_notice',
143 - 'supported_positions' => $this->anywhere,
144 - ),
145 136
146 137 // The sale adverts content starts here
147 138 'blackfriday' => array(
148 139 'prefix' => '',
149 - 'title' => __('Black Friday - 20% off WP-Optimize Premium until November 30th', 'wp-optimize'),
150 - 'text' => __('To benefit, use this discount code:', 'wp-optimize').' ',
151 - 'image' => 'notices/black_friday.png',
152 - 'button_link' => 'https://getwpo.com',
153 - 'button_meta' => 'wp-optimize',
140 + 'title' => __('20% off - Black Friday Sale', 'wp-optimize'),
141 + // translators: %s is a link to pricing/check out page
142 + 'text' => $sale_description . '<br>' . sprintf(__('%s at checkout.', 'wp-optimize'), $bf_checkout_html) . ' <b>' . __('Hurry, offer ends 2 December.', 'wp-optimize') . '</b>',
143 + 'image' => 'notices/wpo_sale_icon.png',
144 + 'button_link' => 'https://teamupdraft.com/plugin-black-friday/?utm_source=udp-plugin&utm_medium=referral&utm_campaign=bf25-udp-plugin-banner&utm_content=bf-sale&utm_creative_format=advert',
145 + 'button_meta' => 'no-button',
154 146 'dismiss_time' => 'dismiss_season',
155 - 'discount_code' => 'blackfridaysale2022',
156 - 'valid_from' => '2022-11-20 00:00:00',
157 - 'valid_to' => '2022-11-30 23:59:59',
147 + // 'discount_code' => 'blackfridaysale2022',
148 + 'valid_from' => '2025-11-14 00:00:00',
149 + 'valid_to' => '2025-12-02 23:59:59',
158 150 'supported_positions' => $this->dashboard_top_or_report,
159 151 'validity_function' => 'is_wpo_premium_installed',
160 152 ),
161 - 'newyear' => array(
162 - 'prefix' => '',
163 - 'title' => __('Happy New Year - 20% off WP-Optimize Premium until January 14th', 'wp-optimize'),
164 - 'text' => __('To benefit, use this discount code:', 'wp-optimize').' ',
165 - 'image' => 'notices/new_year.png',
166 - 'button_link' => 'https://getwpo.com',
167 - 'button_meta' => 'wp-optimize',
168 - 'dismiss_time' => 'dismiss_season',
169 - 'discount_code' => 'newyearsale2023',
170 - 'valid_from' => '2022-12-26 00:00:00',
171 - 'valid_to' => '2023-01-14 23:59:59',
172 - 'supported_positions' => $this->dashboard_top_or_report,
173 - 'validity_function' => 'is_wpo_premium_installed',
174 - ),
175 - 'spring' => array(
176 - 'prefix' => '',
177 - 'title' => __('Spring sale - 20% off WP-Optimize Premium until May 31st', 'wp-optimize'),
178 - 'text' => __('To benefit, use this discount code:', 'wp-optimize').' ',
179 - 'image' => 'notices/spring.png',
180 - 'button_link' => 'https://getwpo.com',
181 - 'button_meta' => 'wp-optimize',
182 - 'dismiss_time' => 'dismiss_season',
183 - 'discount_code' => 'springsale2022',
184 - 'valid_from' => '2022-05-01 00:00:00',
185 - 'valid_to' => '2022-05-31 23:59:59',
186 - 'supported_positions' => $this->dashboard_top_or_report,
187 - 'validity_function' => 'is_wpo_premium_installed',
188 - ),
189 - 'summer' => array(
190 - 'prefix' => '',
191 - 'title' => __('Summer sale - 20% off WP-Optimize Premium until July 31st', 'wp-optimize'),
192 - 'text' => __('To benefit, use this discount code:', 'wp-optimize').' ',
193 - 'image' => 'notices/summer.png',
194 - 'button_link' => 'https://getwpo.com',
195 - 'button_meta' => 'wp-optimize',
196 - 'dismiss_time' => 'dismiss_season',
197 - 'discount_code' => 'summersale2022',
198 - 'valid_from' => '2022-07-01 00:00:00',
199 - 'valid_to' => '2022-07-31 23:59:59',
200 - 'supported_positions' => $this->dashboard_top_or_report,
201 - 'validity_function' => 'is_wpo_premium_installed',
202 - ),
203 - 'collection' => array(
204 - 'prefix' => '',
205 - 'title' => __('The Updraft Plugin Collection Sale', 'wp-optimize'),
206 - 'text' => __('Get 20% off any of our plugins. But hurry - offer ends 30th September, use this discount code:', 'wp-optimize').' ',
207 - 'image' => 'notices/wp_optimize_logo.png',
208 - 'button_link' => 'https://teamupdraft.com',
209 - 'campaign' => 'collection',
210 - 'button_meta' => 'collection',
211 - 'dismiss_time' => 'dismiss_season',
212 - 'discount_code' => 'WPO2022',
213 - 'valid_from' => '2022-09-01 00:00:00',
214 - 'valid_to' => '2022-09-30 23:59:59',
215 - 'supported_positions' => $this->dashboard_top_or_report,
216 - )
217 153 );
218 154
219 155 return array_merge($parent_notice_content, $child_notice_content);
220 156 }
@@ -219,9 +155,9 @@
219 155 return array_merge($parent_notice_content, $child_notice_content);
220 156 }
221 157
222 158 /**
223 - * Call this method to setup the notices
159 + * Call this method to set up the notices
224 160 */
225 161 public function notices_init() {
226 162 if ($this->initialized) return;
227 163 $this->initialized = true;
@@ -250,9 +186,9 @@
250 186 return parent::is_plugin_installed($product, $also_require_active);
251 187 }
252 188
253 189 /**
254 - * This method will call the is premium function in the WPO object to check if this install is premium and if it is we won't display the notice
190 + * This method will call the is premium function in the WPO object to check if this installation is premium and if it is we won't display the notice
255 191 *
256 192 * @return boolean a bool to indicate if we should display the notice or not
257 193 */
258 194 protected function is_wpo_premium_installed() {
@@ -265,13 +201,13 @@
265 201
266 202 /**
267 203 * This method will check to see if a number of different backup plugins are installed and if they are we won't display the notice
268 204 *
269 - * @param String $product the plugin slug
270 - * @param boolean $also_require_active a bool to indicate if the plugin should be active or not
271 - * @return boolean a bool to indicate if the notice should be displayed or not
205 + * @param ?string $product the plugin slug
206 + * @param boolean $also_require_active a bool to indicate if the plugin should be active or not
207 + * @return boolean a bool to indicate if the notice should be displayed or not
272 208 */
273 - public function is_backup_plugin_installed($product = null, $also_require_active = false) {
209 + public function is_backup_plugin_installed(?string $product = null, bool $also_require_active = false): bool {
274 210 $backup_plugins = array('updraftplus' => 'UpdraftPlus', 'backwpup' => 'BackWPup', 'backupwordpress' => 'BackupWordPress', 'vaultpress' => 'VaultPress', 'wp-db-backup' => 'WP-DB-Backup', 'backupbuddy' => 'BackupBuddy');
275 211
276 212 foreach ($backup_plugins as $slug => $title) {
277 213 if (!parent::is_plugin_installed($slug, $also_require_active)) {
@@ -300,15 +236,15 @@
300 236 return false;
301 237 }
302 238
303 239 /**
304 - * This method calls the parent verson and will work out if the user is using a non english language and if so returns true so that they can see the translation advert.
240 + * This method calls the parent version and will work out if the user is using a non english language and if so returns true so that they can see the translation advert.
305 241 *
306 - * @param String $plugin_base_dir the plugin base directory
307 - * @param String $product_name the name of the plugin
308 - * @return Boolean returns true if the user is using a non english language and could translate otherwise false
242 + * @param ?string $plugin_base_dir the plugin base directory
243 + * @param ?string $product_name the name of the plugin
244 + * @return boolean returns true if the user is using a non english language and could translate otherwise false
309 245 */
310 - protected function translation_needed($plugin_base_dir = null, $product_name = null) {// phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
246 + protected function translation_needed($plugin_base_dir = null, $product_name = null) {// phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable -- using this because of parent class method signature
311 247 return parent::translation_needed(WPO_PLUGIN_MAIN_PATH, 'wp-optimize');
312 248 }
313 249
314 250 /**
@@ -313,15 +249,15 @@
313 249
314 250 /**
315 251 * This method is used to generate the correct URL output for the start of the URL
316 252 *
317 - * @param Boolean $html_allowed a boolean value to indicate if HTML can be used or not
318 - * @param String $url the url to use
319 - * @param Boolean $https a boolean value to indicate if https should be used or not
320 - * @param String $website_home a string to be displayed
321 - * @return String returns a string of the completed url
253 + * @param boolean $html_allowed a boolean value to indicate if HTML can be used or not
254 + * @param string $url the url to use
255 + * @param boolean $https a boolean value to indicate if https should be used or not
256 + * @param string $website_home a string to be displayed
257 + * @return string returns a string of the completed url
322 258 */
323 - protected function url_start($html_allowed, $url, $https = false, $website_home = 'getwpo.com') {
259 + protected function url_start($html_allowed, $url, $https = false, $website_home = 'teamupdraft.com/wp-optimize/') {
324 260 return parent::url_start($html_allowed, $url, $https, $website_home);
325 261 }
326 262
327 263 /**
@@ -326,10 +262,10 @@
326 262
327 263 /**
328 264 * This method checks to see if the notices dismiss_time parameter has been dismissed
329 265 *
330 - * @param String $dismiss_time a string containing the dimiss time ID
331 - * @return Boolean returns true if the notice has been dismissed and shouldn't be shown otherwise display it
266 + * @param string $dismiss_time a string containing the dismiss time ID
267 + * @return boolean returns true if the notice has been dismissed and shouldn't be shown otherwise display it
332 268 */
333 269 protected function check_notice_dismissed($dismiss_time) {
334 270
335 271 $time_now = (defined('WP_OPTIMIZE_NOTICES_FORCE_TIME') ? WP_OPTIMIZE_NOTICES_FORCE_TIME : time());
@@ -365,20 +301,20 @@
365 301
366 302 /**
367 303 * This method will create the chosen notice and the template to use and depending on the parameters either echo it to the page or return it
368 304 *
369 - * @param Array $advert_information an array with the notice information in
370 - * @param Boolean $return_instead_of_echo a bool value to indicate if the notice should be printed to page or returned
371 - * @param String $position a string to indicate what template should be used
372 - * @return String a notice to display
305 + * @param array $advert_information an array with the notice information in
306 + * @param boolean $return_instead_of_echo a bool value to indicate if the notice should be printed to page or returned
307 + * @param string $position a string to indicate what template should be used
308 + * @return ?string a notice to display
373 309 */
374 310 protected function render_specified_notice($advert_information, $return_instead_of_echo = false, $position = 'top') {
375 311
376 - if ('bottom' == $position) {
312 + if ('bottom' === $position) {
377 313 $template_file = 'bottom-notice.php';
378 - } elseif ('report' == $position) {
314 + } elseif ('report' === $position) {
379 315 $template_file = 'report.php';
380 - } elseif ('report-plain' == $position) {
316 + } elseif ('report-plain' === $position) {
381 317 $template_file = 'report-plain.php';
382 318 } else {
383 319 $template_file = 'horizontal-notice.php';
384 320 }
@@ -385,8 +321,11 @@
385 321
386 322 $extract_variables = array_merge($advert_information, array('wp_optimize_notices' => $this));
387 323
388 324 return WP_Optimize()->include_template('notices/'.$template_file, $return_instead_of_echo, $extract_variables);
325 + }
326 +
327 + protected function widget_enqueue() {
389 328 }
390 329 }
391 330
392 331 $GLOBALS['wp_optimize_notices'] = WP_Optimize_Notices::instance();