PluginProbe ʕ •ᴥ•ʔ
10Web Booster – Website speed optimization, Cache & Page Speed optimizer / trunk
10Web Booster – Website speed optimization, Cache & Page Speed optimizer vtrunk
2.33.0 2.30.5 2.30.7 2.30.9 2.31.10 2.31.8 2.32.11 2.32.21 2.32.3 2.32.4 2.32.7 2.6.31 2.6.40 2.6.42 2.6.7 2.7.37 2.7.44 2.7.47 2.8.18 2.8.19 2.8.32 2.8.34 2.8.35 2.9.23 2.9.24 2.9.25 2.9.27 v2.27.4 trunk 2.0.10 2.0.11 2.0.12 2.0.13 2.0.14 2.0.15 2.0.17 2.0.18 2.0.21 2.0.22 2.0.25 2.0.26 2.0.27 2.0.3 2.0.7 2.0.9 2.10.46 2.10.65 2.10.66 2.10.68 2.11.41 2.11.42 2.11.43 2.12.15 2.12.21 2.12.22 2.12.23 2.12.26 2.13.37 2.13.40 2.13.41 2.13.42 2.13.44 2.13.45 2.13.47 2.14.49 2.14.50 2.15.18 2.17.21 2.17.23 2.18.17 2.19.44 2.19.45 2.19.46 2.19.49 2.2.12 2.2.15 2.2.16 2.2.18 2.2.8 2.20.31 2.20.32 2.20.33 2.21.11 2.21.12 2.21.16 2.21.25 2.22.32 2.23.13 2.23.15 2.23.16 2.23.18 2.24.12 2.24.14 2.24.18 2.25.14 2.26.6 2.28.10 2.28.13 2.28.14 2.28.7 2.29.1 2.29.2 2.29.3 2.3.0 2.3.1 2.3.2 2.3.3 2.30.18
tenweb-speed-optimizer / includes / OptimizerBanner.php
tenweb-speed-optimizer / includes Last commit date
WebPageCache 7 months ago external 2 months ago ExcludeJsFromDelay.php 2 years ago OptimizerBanner.php 11 months ago OptimizerBase.php 2 years ago OptimizerCSSMin.php 2 years ago OptimizerCache.php 1 year ago OptimizerCacheStructure.php 2 years ago OptimizerCriticalCss.php 1 year ago OptimizerElementor.php 2 years ago OptimizerFonts.php 2 years ago OptimizerImages.php 1 year ago OptimizerLogger.php 1 year ago OptimizerMain.php 2 months ago OptimizerOnInit.php 11 months ago OptimizerScripts.php 2 years ago OptimizerSettings.php 2 months ago OptimizerStyles.php 2 years ago OptimizerUrl.php 1 year ago OptimizerUtils.php 2 months ago OptimizerWhiteLabel.php 2 years ago
OptimizerBanner.php
94 lines
1 <?php
2
3 namespace TenWebOptimizer;
4
5 class OptimizerBanner
6 {
7 private $autoUpdateBanner = false;
8
9 public function __construct()
10 {
11 $this->setArgs();
12 }
13
14 public function printBanners()
15 {
16 if ($this->autoUpdateBanner) {
17 $this->AutoUpdateBanner();
18 }
19 }
20
21 private function setArgs()
22 {
23 global $pagenow;
24 $auto_update_banner_array = ['plugins.php', 'edit.php'];
25 $this->autoUpdateBanner = empty(get_option('two_auto_update_banner_was_shown'))
26 && in_array($pagenow, $auto_update_banner_array)
27 && \TenWebOptimizer\OptimizerUtils::is_tenweb_booster_connected();
28 }
29
30 private function enqueueMainScripts()
31 {
32 wp_enqueue_style(
33 'two_banner_css',
34 TENWEB_SO_URL . '/assets/css/banner_main.css',
35 [],
36 TENWEB_SO_VERSION
37 );
38 wp_enqueue_script(
39 'banner_main_js',
40 TENWEB_SO_URL . '/assets/js/banner_main.js',
41 ['jquery', 'two_speed_js'],
42 TENWEB_SO_VERSION
43 );
44 }
45
46 private function enqueueAutoUpdateScripts()
47 {
48 $this->enqueueMainScripts();
49 wp_enqueue_style(
50 'two_autoupdate_banner_css',
51 TENWEB_SO_URL . '/assets/css/autoupdate_banner.css',
52 ['two_banner_css'],
53 TENWEB_SO_VERSION
54 );
55
56 wp_enqueue_script(
57 'two_autoupdate_banner_js',
58 TENWEB_SO_URL . '/assets/js/autoupdate_banner.js',
59 ['jquery', 'two_speed_js', 'banner_main_js'],
60 TENWEB_SO_VERSION
61 );
62 }
63
64 private function AutoUpdateBanner()
65 {
66 if (strtolower(TWO_SO_ORGANIZATION_NAME) == '10web') {
67 $this->enqueueAutoUpdateScripts();
68 require_once TENWEB_SO_PLUGIN_DIR . '/views/autoupdate_banner.php';
69 }
70 }
71
72 public static function two_set_autoupdate_from_banner()
73 {
74 $nonce = isset($_POST['nonce']) ? sanitize_text_field($_POST['nonce']) : '';
75
76 if (!wp_verify_nonce($nonce, 'two_ajax_nonce') || !OptimizerUtils::check_admin_capabilities()) {
77 die('Permission Denied.');
78 }
79 $auto_update = isset($_POST['auto_update']) ? sanitize_text_field($_POST['auto_update']) : '';
80
81 if ($auto_update == 'enable') {
82 global $TwoSettings;
83 $TwoSettings->update_setting('two_enable_plugin_autoupdate', 'on');
84 }
85 add_option( //show autoupdate banner only once and don/t delete this option even on disconnect
86 'two_auto_update_banner_was_shown',
87 1,
88 false
89 );
90
91 wp_send_json_success(['status' => 'success']);
92 }
93 }
94