PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 2.6.4
ShopBuilder – WooCommerce Builder For Elementor v2.6.4
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
← All changes | app/Controllers/Admin/AdminInit.php +24 -93 3.4.22.6.4 View file →
@@ -1,22 +1,14 @@
1 1 <?php
2 -/**
3 - * Admin Init.
4 - *
5 - * @package RadiusTheme\SB
6 - */
7 2
8 3 namespace RadiusTheme\SB\Controllers\Admin;
9 4
10 5 defined( 'ABSPATH' ) || exit();
11 6
7 +use RadiusTheme\SB\Controllers\Admin\Ajax as Ajax;
12 8 use RadiusTheme\SB\Helpers\Fns;
13 9 use RadiusTheme\SB\Traits\SingletonTrait;
14 -use RadiusTheme\SB\Controllers\Admin\Ajax as Ajax;
15 10
16 -/**
17 - * Admin Init.
18 - */
19 11 class AdminInit {
20 12 /**
21 13 * Parent Menu Page Slug
22 14 */
@@ -31,15 +23,14 @@
31 23 * Parent Menu Hook
32 24 *
33 25 * @var string
34 26 */
35 - public static $parent_menu_hook = '';
27 + static $parent_menu_hook = '';
36 28
29 + // private $menu_link_part;
30 +
37 31 use SingletonTrait;
38 32
39 - /**
40 - * Class constructor.
41 - */
42 33 public function __construct() {
43 34 $this->init();
44 35 $this->ajax_actions();
45 36 $this->upgrade();
@@ -65,32 +56,18 @@
65 56 * @return void
66 57 */
67 58 public function upgrade() {
68 59 Notice\Upgrade::instance();
69 - // phpcs:ignore Squiz.PHP.CommentedOutCode.Found
70 - // Notice\BFDiscount::instance();.
71 - // phpcs:ignore Squiz.PHP.CommentedOutCode.Found
72 - // Notice\BlackFridayV2::instance();.
60 + Notice\BFDiscount::instance();
73 61 Notice\Review::instance();
74 - Notice\CachePermission::instance();
75 62 }
76 63
77 - /**
78 - * Init.
79 - *
80 - * @return void
81 - */
82 64 public function init() {
83 65 add_action( 'admin_menu', [ $this, 'add_menu' ], 25 );
84 66 add_action( 'in_admin_header', [ $this, 'in_admin_header_functionality' ], 1000 );
85 - // PluginRow registered earlier in ShopBuilder::init() so it survives dependency failures.
67 + PluginRow::instance();
86 68 }
87 69
88 - /**
89 - * Add menu.
90 - *
91 - * @return void
92 - */
93 70 public function add_menu() {
94 71 self::$parent_menu_hook = add_menu_page(
95 72 esc_html__( 'ShopBuilder', 'shopbuilder' ),
96 73 esc_html__( 'ShopBuilder', 'shopbuilder' ),
@@ -118,10 +95,10 @@
118 95 [ $this, 'get_help_page' ],
119 96 );
120 97 add_submenu_page(
121 98 self::MENU_PAGE_SLUG,
122 - esc_html__( 'Themes', 'shopbuilder' ),
123 - esc_html__( 'Themes', 'shopbuilder' ),
99 + esc_html__( 'Themes & Apps', 'shopbuilder' ),
100 + esc_html__( 'Themes & Apps', 'shopbuilder' ),
124 101 self::MENU_CAPABILITY,
125 102 'rtsb-themes',
126 103 [ $this, 'get_themes_page' ],
127 104 );
@@ -126,26 +103,17 @@
126 103 [ $this, 'get_themes_page' ],
127 104 );
128 105 do_action( 'rtsb/add/more/submenu', self::MENU_PAGE_SLUG, self::MENU_CAPABILITY );
129 106
130 - // Remove Parent Submenu.
107 + // Remove Parent Submenu
131 108 remove_submenu_page( self::MENU_PAGE_SLUG, self::MENU_PAGE_SLUG );
132 109 }
133 110
134 - /**
135 - * Redirect to content.
136 - *
137 - * @return void
138 - */
139 - public function redirect_to_content() {
140 - wp_redirect( admin_url( 'admin.php?page=rtsb-settings' ) ); // phpcs:ignore WordPress.Security.SafeRedirect.wp_redirect_wp_redirect
111 + function redirect_to_content() {
112 + wp_redirect( admin_url( 'admin.php?page=rtsb-settings' ) );
141 113 }
142 114
143 - /**
144 - * Settings Page.
145 - *
146 - * @return void
147 - */
115 +
148 116 public function settings_page() {
149 117 ?>
150 118 <div class="wrap rtsb-admin-wrap">
151 119 <div id="rtsb-admin-app"></div>
@@ -152,22 +120,12 @@
152 120 </div>
153 121 <?php
154 122 }
155 123
156 - /**
157 - * Help Page.
158 - *
159 - * @return void
160 - */
161 124 public function get_help_page() {
162 125 Fns::renderView( 'help' );
163 126 }
164 127
165 - /**
166 - * Themes Page.
167 - *
168 - * @return void
169 - */
170 128 public function get_themes_page() {
171 129 Fns::renderView( 'themes' );
172 130 }
173 131
@@ -187,48 +145,21 @@
187 145 if ( $isBuilderTemplate || $isSettingsPage ) {
188 146 remove_all_actions( 'admin_notices' );
189 147 remove_all_actions( 'all_admin_notices' );
190 148 }
191 -
192 - $load_elementor_scripts = Fns::should_load_elementor_scripts();
193 -
194 - if ( $isBuilderTemplate ) {
195 - if ( ! defined( 'ELEMENTOR_VERSION' ) && $load_elementor_scripts ) {
196 - ?>
197 - <div class='rtsb-message-for-elementor-missing'>
198 - <div class="rtsb-builder-notice-content">
199 - <?php
200 - echo sprintf(
201 - /* translators: %s: Elementor */
202 - esc_html__( 'To build your WooCommerce pages, please Install and Activate the %s Plugin.', 'shopbuilder' ),
203 - '<a href="' . esc_url( admin_url( 'plugin-install.php?s=elementor&tab=search&type=term' ) ) . '" target="_blank">' . esc_html__( 'Elementor Website Builder', 'shopbuilder' ) . '</a>'
204 - );
205 - ?>
206 - </div>
207 - </div>
208 - <?php
209 - } elseif ( defined( 'ELEMENTOR_VERSION' ) && ! $load_elementor_scripts ) {
210 - ?>
211 - <div class='rtsb-message-for-elementor-missing'>
212 - <div class="rtsb-builder-notice-content">
213 - <?php esc_html_e( 'Elementor is installed, but script loading is disabled. Please enable "Load Elementor Scripts" in the Advanced Optimization Settings.', 'shopbuilder' ); ?>
214 - </div>
215 - </div>
216 - <?php
217 - } elseif ( ! defined( 'ELEMENTOR_VERSION' ) && ! $load_elementor_scripts ) {
218 - ?>
219 - <div class='rtsb-message-for-elementor-missing'>
220 - <div class="rtsb-builder-notice-content">
221 - <?php
222 - echo sprintf(
149 + if ( ! defined( 'ELEMENTOR_VERSION' ) && $isBuilderTemplate ) {
150 + ?>
151 + <div class='rtsb-message-for-elementor-missing'>
152 + <div class="rtsb-builder-notice-content">
153 + <?php
154 + echo sprintf(
223 155 /* translators: %s: Elementor */
224 - esc_html__( 'To build your WooCommerce pages, please Install and Activate the %s Plugin.', 'shopbuilder' ),
225 - '<a href="' . esc_url( admin_url( 'plugin-install.php?s=Elementor%2520Website%2520Builder&tab=search&type=term' ) ) . '" target="_blank">' . esc_html__( 'Elementor Website Builder', 'shopbuilder' ) . '</a>'
226 - );
227 - ?>
228 - </div>
156 + esc_html__( 'To build your WooCommerce pages, please Install and Activate the %s Plugin.', 'shopbuilder' ),
157 + '<a href="' . esc_url( admin_url( 'plugin-install.php?s=elementor&tab=search&type=term' ) ) . '" target="_blank">' . esc_html__( 'Elementor Website Builder', 'shopbuilder' ) . '</a>'
158 + );
159 + ?>
229 160 </div>
230 - <?php
231 - }
161 + </div>
162 + <?php
232 163 }
233 164 }
234 165 }