PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 1.1.2
ShopBuilder – WooCommerce Builder For Elementor v1.1.2
3.4.2 3.4.1 3.4.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 All 63 releases
shopbuilder / app / Controllers / Admin / Notice / Upgrade.php

Upgrade.php in ShopBuilder – WooCommerce Builder For Elementor 1.1.2, at app/Controllers/Admin/Notice/Upgrade.php

109 lines 2.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Main Upgrade class.
4 *
5 * @package RadiusTheme\SB
6 */
7
8 namespace RadiusTheme\SB\Controllers\Admin\Notice;
9
10 use RadiusTheme\SB\Traits\SingletonTrait;
11
12 // Do not allow directly accessing this file.
13 if ( ! defined( 'ABSPATH' ) ) {
14 exit( 'This script cannot be accessed directly.' );
15 }
16
17 /**
18 * Main Upgrade class.
19 */
20 class Upgrade {
21 /**
22 * Singleton Trait.
23 */
24 use SingletonTrait;
25
26 /**
27 * Class Constructor.
28 */
29 private function __construct() {
30 add_action(
31 'in_plugin_update_message-' . RTSB_ACTIVE_FILE_NAME,
32 function ( $plugin_data ) {
33 $this->version_update_warning( RTSB_VERSION, $plugin_data['new_version'] );
34 }
35 );
36 }
37
38 /**
39 * Update message
40 *
41 * @param int $current_version Current Version.
42 * @param int $new_version New Version.
43 *
44 * @return void
45 */
46 public function version_update_warning( $current_version, $new_version ) {
47 $current_version_major = explode( '.', $current_version )[1];
48 $new_version_major = explode( '.', $new_version )[1];
49
50 if ( $current_version_major === $new_version_major ) {
51 return;
52 }
53 ?>
54 <style>
55 .rtsb-major-update-warning {
56 border-top: 2px solid #d63638;
57 padding-top: 15px;
58 margin-top: 15px;
59 margin-bottom: 15px;
60 display: flex;
61 }
62
63 .rtsb-major-update-icon i {
64 color: #d63638;
65 margin-right: 8px;
66 }
67
68 .rtsb-major-update-warning + p {
69 display: none;
70 }
71
72 .rtsb-major-update-title {
73 font-weight: 600;
74 margin-bottom: 10px;
75 }
76
77 .notice-success .rtsb-major-update-warning {
78 border-color: #46b450;
79 }
80
81 .notice-success .rtsb-major-update-icon i {
82 color: #79ba49;
83 }
84 </style>
85 <div class="rtsb-major-update-warning">
86 <div class="rtsb-major-update-icon">
87 <i class="dashicons dashicons-info"></i>
88 </div>
89 <div>
90 <div class="rtsb-major-update-title">
91 <?php
92 printf(
93 '%s%s.',
94 esc_html__( 'Heads up, Please backup before upgrade to version ', 'shopbuilder' ),
95 esc_html( $new_version )
96 );
97 ?>
98 </div>
99 <div class="rtsb-major-update-message">
100 The latest update includes some substantial changes across different areas of the plugin. <br/>We
101 highly recommend you to <b>backup your site before upgrading</b>, and make sure you first update in
102 a staging environment.
103 </div>
104 </div>
105 </div>
106 <?php
107 }
108 }
109