Blocksy Companion - Version 1.8.31

Version Description

Download this release

Release Info

Developer creativethemeshq
Plugin Icon wp plugin Blocksy Companion
Version 1.8.31
Comparing to
See all releases

Code changes from version 1.8.30 to 1.8.31

blocksy-companion.php CHANGED
@@ -3,7 +3,7 @@
3
  /*
4
  Plugin Name: Blocksy Companion
5
  Description: This plugin is the companion for the Blocksy theme, it runs and adds its enhacements only if the Blocksy theme is installed and active.
6
- Version: 1.8.30
7
  Author: CreativeThemes
8
  Author URI: https://creativethemes.com
9
  Text Domain: blocksy-companion
3
  /*
4
  Plugin Name: Blocksy Companion
5
  Description: This plugin is the companion for the Blocksy theme, it runs and adds its enhacements only if the Blocksy theme is installed and active.
6
+ Version: 1.8.31
7
  Author: CreativeThemes
8
  Author URI: https://creativethemes.com
9
  Text Domain: blocksy-companion
framework/dashboard.php CHANGED
@@ -107,7 +107,7 @@ class Dashboard {
107
  }
108
 
109
  $result = [
110
- 'is_pro' => blc_fs()->can_use_premium_code__premium_only(),
111
  'is_anonymous' => $is_anonymous,
112
  'connect_template' => $connect_template
113
  ];
107
  }
108
 
109
  $result = [
110
+ 'is_pro' => blc_fs()->can_use_premium_code(),
111
  'is_anonymous' => $is_anonymous,
112
  'connect_template' => $connect_template
113
  ];
framework/extensions-manager.php CHANGED
@@ -2,414 +2,494 @@
2
 
3
  namespace Blocksy;
4
 
5
- class ExtensionsManager
6
- {
7
- /**
8
- * Collection of all the activated extensions.
9
- *
10
- * @var array The array of all the extension objects.
11
- */
12
- private $extensions = array() ;
13
- private function get_option_name()
14
- {
15
- return 'blocksy_active_extensions';
16
- }
17
-
18
- public function get( $id, $args = array() )
19
- {
20
- $args = wp_parse_args( $args, [
21
- 'type' => 'regular',
22
- ] );
23
- if ( !isset( $this->extensions[$id] ) ) {
24
- return null;
25
- }
26
-
27
- if ( $args['type'] === 'preboot' ) {
28
- if ( !isset( $this->extensions[$id]['__object_preboot'] ) ) {
29
- return null;
30
- }
31
- return $this->extensions[$id]['__object_preboot'];
32
- }
33
-
34
- if ( !isset( $this->extensions[$id]['__object'] ) ) {
35
- return null;
36
- }
37
- return $this->extensions[$id]['__object'];
38
- }
39
-
40
- /**
41
- * Collect all available extensions and activate the ones that have to be so.
42
- */
43
- public function __construct()
44
- {
45
- $this->read_installed_extensions();
46
- if ( $this->is_dashboard_page() ) {
47
- $this->do_extensions_preboot();
48
- }
49
- foreach ( $this->get_activated_extensions() as $single_id ) {
50
- $this->boot_activated_extension_for( $single_id );
51
- }
52
- add_action( 'activate_blocksy-companion/blocksy-companion.php', [ $this, 'handle_activation' ], 11 );
53
- add_action( 'deactivate_blocksy-companion/blocksy-companion.php', [ $this, 'handle_deactivation' ], 11 );
54
- }
55
-
56
- public function handle_activation()
57
- {
58
- ob_start();
59
- foreach ( $this->get_activated_extensions() as $id ) {
60
- if ( method_exists( $this->get_class_name_for( $id ), "onActivation" ) ) {
61
- call_user_func( [ $this->get_class_name_for( $id ), 'onActivation' ] );
62
- }
63
- }
64
- ob_get_clean();
65
- }
66
-
67
- public function handle_deactivation()
68
- {
69
- foreach ( $this->get_activated_extensions() as $id ) {
70
- if ( method_exists( $this->get_class_name_for( $id ), "onDeactivation" ) ) {
71
- call_user_func( [ $this->get_class_name_for( $id ), 'onDeactivation' ] );
72
- }
73
- }
74
- }
75
-
76
- public function do_extensions_preboot()
77
- {
78
- foreach ( array_keys( $this->get_extensions() ) as $single_id ) {
79
- $this->maybe_do_extension_preboot( $single_id );
80
- }
81
- }
82
-
83
- private function is_dashboard_page()
84
- {
85
- global $pagenow ;
86
- $is_ct_settings = isset( $_GET['page'] ) && 'ct-dashboard' === $_GET['page'];
87
- return $is_ct_settings;
88
- }
89
-
90
- public function get_extensions( $args = array() )
91
- {
92
- $args = wp_parse_args( $args, [
93
- 'forced_reread' => false,
94
- ] );
95
-
96
- if ( $args['forced_reread'] ) {
97
- foreach ( $this->extensions as $id => $extension ) {
98
- $this->extensions[$id]['config'] = $this->read_config_for( $extension['path'] );
99
- $this->extensions[$id]['readme'] = $this->read_readme_for( $extension['path'] );
100
- }
101
- $this->register_fake_extensions();
102
- }
103
-
104
- return $this->extensions;
105
- }
106
-
107
- public function can( $capability = 'install_plugins' )
108
- {
109
- $user = wp_get_current_user();
110
- // return array_intersect(['administrator'], $user->roles );
111
-
112
- if ( is_multisite() ) {
113
- // Only network admin can change files that affects the entire network.
114
- $can = current_user_can_for_blog( get_current_blog_id(), $capability );
115
- } else {
116
- $can = current_user_can( $capability );
117
- }
118
-
119
- if ( $can ) {
120
- // Also you can use this method to get the capability.
121
- $can = $capability;
122
- }
123
- return $can;
124
- }
125
-
126
- public function activate_extension( $id )
127
- {
128
- if ( !isset( $this->extensions[$id] ) ) {
129
- return;
130
- }
131
- if ( !$this->extensions[$id]['path'] ) {
132
- return;
133
- }
134
- $activated = $this->get_activated_extensions();
135
-
136
- if ( !in_array( strtolower( $id ), $activated ) ) {
137
- $path = $this->extensions[$id]['path'];
138
- require_once $path . '/extension.php';
139
- if ( method_exists( $this->get_class_name_for( $id ), "onActivation" ) ) {
140
- call_user_func( [ $this->get_class_name_for( $id ), 'onActivation' ] );
141
- }
142
- $class = $this->get_class_name_for( $id );
143
- // Init extension right away.
144
- new $class();
145
- }
146
-
147
- $activated[] = strtolower( $id );
148
- update_option( $this->get_option_name(), array_unique( $activated ) );
149
- do_action( 'blocksy:dynamic-css:refresh-caches' );
150
- }
151
-
152
- public function deactivate_extension( $id )
153
- {
154
- if ( !isset( $this->extensions[$id] ) ) {
155
- return;
156
- }
157
- if ( !$this->extensions[$id]['path'] ) {
158
- return;
159
- }
160
- $activated = $this->get_activated_extensions();
161
- if ( in_array( strtolower( $id ), $activated ) ) {
162
- if ( method_exists( $this->get_class_name_for( $id ), "onDeactivation" ) ) {
163
- call_user_func( [ $this->get_class_name_for( $id ), 'onDeactivation' ] );
164
- }
165
- }
166
- update_option( $this->get_option_name(), array_diff( $activated, [ $id ] ) );
167
- do_action( 'blocksy:dynamic-css:refresh-caches' );
168
- }
169
-
170
- private function read_installed_extensions()
171
- {
172
- $paths_to_look_for_extensions = apply_filters( 'blocksy_extensions_paths', [ BLOCKSY_PATH . 'framework/extensions' ] );
173
- foreach ( $paths_to_look_for_extensions as $single_path ) {
174
- $all_extensions = glob( $single_path . '/*', GLOB_ONLYDIR );
175
- foreach ( $all_extensions as $single_extension ) {
176
- $this->register_extension_for( $single_extension );
177
- }
178
- }
179
- $this->register_fake_extensions();
180
- }
181
-
182
- private function register_fake_extensions()
183
- {
184
- $this->extensions['adobe-typekit'] = [
185
- 'path' => null,
186
- '__object' => null,
187
- 'config' => [
188
- 'name' => __( 'Adobe Typekit', 'blocksy-companion' ),
189
- 'description' => __( 'Connect your Typekit account and use your fonts in any typography option.', 'blocksy-companion' ),
190
- 'pro' => true,
191
- ],
192
- 'readme' => '',
193
- 'data' => null,
194
- ];
195
- $this->extensions['custom-code-snippets'] = [
196
- 'path' => null,
197
- '__object' => null,
198
- 'config' => [
199
- 'name' => __( 'Custom Code Snippets', 'blocksy-companion' ),
200
- 'description' => __( 'Add custom code snippets in your header and footer, globally and per post or page individually.', 'blocksy-companion' ),
201
- 'pro' => true,
202
- ],
203
- 'readme' => '',
204
- 'data' => null,
205
- ];
206
- $this->extensions['custom-fonts'] = [
207
- 'path' => null,
208
- '__object' => null,
209
- 'config' => [
210
- 'name' => __( 'Custom Fonts', 'blocksy-companion' ),
211
- 'description' => __( 'Upload unlimited number of custom fonts or variable fonts and use them in any typography option.', 'blocksy-companion' ),
212
- 'pro' => true,
213
- ],
214
- 'readme' => '',
215
- 'data' => null,
216
- ];
217
- $this->extensions['local-google-fonts'] = [
218
- 'path' => null,
219
- '__object' => null,
220
- 'config' => [
221
- 'name' => __( 'Local Google Fonts', 'blocksy-companion' ),
222
- 'description' => __( 'Serve Google Fonts from your own server for full GDPR compliancy.', 'blocksy-companion' ),
223
- 'pro' => true,
224
- ],
225
- 'readme' => '',
226
- 'data' => null,
227
- ];
228
- $this->extensions['advanced-menu'] = [
229
- 'path' => null,
230
- '__object' => null,
231
- 'config' => [
232
- 'name' => __( 'Advanced Menu', 'blocksy-companion' ),
233
- 'description' => __( 'Create beautiful mega menus, assign icons add badges to menu items, and content blocks inside menu items.', 'blocksy-companion' ),
234
- 'pro' => true,
235
- ],
236
- 'readme' => '',
237
- 'data' => null,
238
- ];
239
- $this->extensions['shortcuts-bar'] = [
240
- 'path' => null,
241
- '__object' => null,
242
- 'config' => [
243
- 'name' => __( 'Shortcuts Bar', 'blocksy-companion' ),
244
- 'description' => __( 'Transform your website into a app like by displaying a neat shortcuts bar at the bottom of the vieport.', 'blocksy-companion' ),
245
- 'pro' => true,
246
- ],
247
- 'readme' => '',
248
- 'data' => null,
249
- ];
250
- $this->extensions['multiple-sidebars'] = [
251
- 'path' => null,
252
- '__object' => null,
253
- 'config' => [
254
- 'name' => __( 'Multiple Sidebars', 'blocksy-companion' ),
255
- 'description' => __( 'Create unlimited number of sidebars and display them conditionaly on any page or post.', 'blocksy-companion' ),
256
- 'pro' => true,
257
- ],
258
- 'readme' => '',
259
- 'data' => null,
260
- ];
261
- $this->extensions['white-label'] = [
262
- 'path' => null,
263
- '__object' => null,
264
- 'config' => [
265
- 'name' => __( 'White Label (Agency Package)', 'blocksy-companion' ),
266
- 'description' => __( 'Change the theme and companion plugin branding to your own custom one.', 'blocksy-companion' ),
267
- 'pro' => true,
268
- ],
269
- 'readme' => '',
270
- 'data' => null,
271
- ];
272
- $this->extensions['woocommerce-extra'] = [
273
- 'path' => null,
274
- '__object' => null,
275
- 'config' => [
276
- 'name' => __( 'WooCommerce Extra', 'blocksy-companion' ),
277
- 'description' => __( 'Increase the conversion rate by adding a product quick view modal, a floating cart. Control the single product gallery/slider and the layout, add a wishlits page.', 'blocksy-companion' ),
278
- 'pro' => true,
279
- ],
280
- 'readme' => '',
281
- 'data' => null,
282
- ];
283
- }
284
-
285
- private function register_extension_for( $path )
286
- {
287
- $id = str_replace( '_', '-', basename( $path ) );
288
- if ( isset( $this->extensions[$id] ) ) {
289
- return;
290
- }
291
- $this->extensions[$id] = [
292
- 'path' => $path,
293
- '__object' => null,
294
- 'config' => $this->read_config_for( $path ),
295
- 'readme' => $this->read_readme_for( $path ),
296
- 'data' => null,
297
- ];
298
- }
299
-
300
- private function maybe_do_extension_preboot( $id )
301
- {
302
- if ( !isset( $this->extensions[$id] ) ) {
303
- return false;
304
- }
305
- if ( isset( $this->extensions[$id]['__object_preboot'] ) ) {
306
- return;
307
- }
308
- $class_name = explode( '-', $id );
309
- $class_name = array_map( 'ucfirst', $class_name );
310
- $class_name = 'BlocksyExtension' . implode( '', $class_name ) . 'PreBoot';
311
- $path = $this->extensions[$id]['path'];
312
- if ( !$path ) {
313
- return;
314
- }
315
- if ( !@is_readable( $path . '/pre-boot.php' ) ) {
316
- return;
317
- }
318
- if ( !file_exists( $path . '/pre-boot.php' ) ) {
319
- return;
320
- }
321
- require_once $path . '/pre-boot.php';
322
- $this->extensions[$id]['__object_preboot'] = new $class_name();
323
- if ( method_exists( $this->extensions[$id]['__object_preboot'], 'ext_data' ) ) {
324
- $this->extensions[$id]['data'] = $this->extensions[$id]['__object_preboot']->ext_data();
325
- }
326
- }
327
-
328
- private function boot_activated_extension_for( $id )
329
- {
330
- if ( !isset( $this->extensions[$id] ) ) {
331
- return false;
332
- }
333
- if ( !isset( $this->extensions[$id]['path'] ) ) {
334
- return false;
335
- }
336
- if ( !$this->extensions[$id]['path'] ) {
337
- return false;
338
- }
339
- if ( isset( $this->extensions[$id]['config']['hidden'] ) && $this->extensions[$id]['config']['hidden'] ) {
340
- return;
341
- }
342
- if ( isset( $this->extensions[$id]['__object'] ) ) {
343
- return;
344
- }
345
- $class_name = explode( '-', $id );
346
- $class_name = array_map( 'ucfirst', $class_name );
347
- $class_name = 'BlocksyExtension' . implode( '', $class_name );
348
- $path = $this->extensions[$id]['path'];
349
- if ( !$path ) {
350
- return;
351
- }
352
- if ( !@is_readable( $path . '/extension.php' ) ) {
353
- return;
354
- }
355
- if ( !file_exists( $path . '/extension.php' ) ) {
356
- return;
357
- }
358
- require_once $path . '/extension.php';
359
- $this->extensions[$id]['__object'] = new $class_name();
360
- }
361
-
362
- private function get_class_name_for( $id )
363
- {
364
- $class_name = explode( '-', $id );
365
- $class_name = array_map( 'ucfirst', $class_name );
366
- return 'BlocksyExtension' . implode( '', $class_name );
367
- }
368
-
369
- private function read_readme_for( $path )
370
- {
371
- $readme = '';
372
- ob_start();
373
- if ( is_readable( $path . '/readme.php' ) ) {
374
- require $path . '/readme.php';
375
- }
376
- $readme = ob_get_clean();
377
- if ( empty(trim( $readme )) ) {
378
- return null;
379
- }
380
- return trim( $readme );
381
- }
382
-
383
- private function read_config_for( $file_path )
384
- {
385
- $_extract_variables = [
386
- 'config' => [],
387
- ];
388
-
389
- if ( is_readable( $file_path . '/config.php' ) ) {
390
- require $file_path . '/config.php';
391
- foreach ( $_extract_variables as $variable_name => $default_value ) {
392
- if ( isset( ${$variable_name} ) ) {
393
- $_extract_variables[$variable_name] = ${$variable_name};
394
- }
395
- }
396
- }
397
-
398
- $name = explode( '-', basename( $file_path ) );
399
- $name = array_map( 'ucfirst', $name );
400
- $name = implode( ' ', $name );
401
- $_extract_variables['config'] = array_merge( [
402
- 'name' => $name,
403
- 'description' => '',
404
- 'pro' => false,
405
- 'hidden' => false,
406
- ], $_extract_variables['config'] );
407
- return $_extract_variables['config'];
408
- }
409
-
410
- private function get_activated_extensions()
411
- {
412
- return get_option( $this->get_option_name(), [] );
413
- }
414
-
415
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  namespace Blocksy;
4
 
5
+ class ExtensionsManager {
6
+ /**
7
+ * Collection of all the activated extensions.
8
+ *
9
+ * @var array The array of all the extension objects.
10
+ */
11
+ private $extensions = [];
12
+
13
+ private function get_option_name() {
14
+ return 'blocksy_active_extensions';
15
+ }
16
+
17
+ public function get($id, $args = []) {
18
+ $args = wp_parse_args($args, [
19
+ // regular | preboot
20
+ 'type' => 'regular',
21
+ ]);
22
+
23
+ if (! isset($this->extensions[$id])) {
24
+ return null;
25
+ }
26
+
27
+ if ($args['type'] === 'preboot') {
28
+ if (! isset($this->extensions[$id]['__object_preboot'])) {
29
+ return null;
30
+ }
31
+
32
+ return $this->extensions[$id]['__object_preboot'];
33
+ }
34
+
35
+ if (! isset($this->extensions[$id]['__object'])) {
36
+ return null;
37
+ }
38
+
39
+ return $this->extensions[$id]['__object'];
40
+ }
41
+
42
+ /**
43
+ * Collect all available extensions and activate the ones that have to be so.
44
+ */
45
+ public function __construct() {
46
+ $this->read_installed_extensions();
47
+
48
+ if ($this->is_dashboard_page()) {
49
+ $this->do_extensions_preboot();
50
+ }
51
+
52
+ foreach ($this->get_activated_extensions() as $single_id) {
53
+ $this->boot_activated_extension_for($single_id);
54
+ }
55
+
56
+ add_action(
57
+ 'activate_blocksy-companion/blocksy-companion.php',
58
+ [$this, 'handle_activation'],
59
+ 11
60
+ );
61
+
62
+ add_action(
63
+ 'deactivate_blocksy-companion/blocksy-companion.php',
64
+ [$this, 'handle_deactivation'],
65
+ 11
66
+ );
67
+ }
68
+
69
+ public function handle_activation() {
70
+ ob_start();
71
+
72
+ foreach ($this->get_activated_extensions() as $id) {
73
+ if (method_exists($this->get_class_name_for($id), "onActivation")) {
74
+ call_user_func([
75
+ $this->get_class_name_for($id),
76
+ 'onActivation'
77
+ ]);
78
+ }
79
+ }
80
+
81
+ ob_get_clean();
82
+ }
83
+
84
+ public function handle_deactivation() {
85
+ foreach ($this->get_activated_extensions() as $id) {
86
+ if (method_exists($this->get_class_name_for($id), "onDeactivation")) {
87
+ call_user_func([
88
+ $this->get_class_name_for($id),
89
+ 'onDeactivation'
90
+ ]);
91
+ }
92
+ }
93
+ }
94
+
95
+ public function do_extensions_preboot() {
96
+ foreach (array_keys($this->get_extensions()) as $single_id) {
97
+ $this->maybe_do_extension_preboot($single_id);
98
+ }
99
+ }
100
+
101
+ private function is_dashboard_page() {
102
+ global $pagenow;
103
+
104
+ $is_ct_settings =
105
+ // 'themes.php' === $pagenow &&
106
+ isset( $_GET['page'] ) && 'ct-dashboard' === $_GET['page'];
107
+
108
+ return $is_ct_settings;
109
+ }
110
+
111
+ public function get_extensions($args = []) {
112
+ $args = wp_parse_args($args, [
113
+ 'forced_reread' => false,
114
+ ]);
115
+
116
+ if ($args['forced_reread']) {
117
+ foreach ($this->extensions as $id => $extension) {
118
+ $this->extensions[$id]['config'] = $this->read_config_for(
119
+ $extension['path']
120
+ );
121
+
122
+ $this->extensions[$id]['readme'] = $this->read_readme_for(
123
+ $extension['path']
124
+ );
125
+ }
126
+
127
+ $this->register_fake_extensions();
128
+ }
129
+
130
+ return $this->extensions;
131
+ }
132
+
133
+ public function can( $capability = 'install_plugins' ) {
134
+ $user = wp_get_current_user();
135
+
136
+ // return array_intersect(['administrator'], $user->roles );
137
+
138
+ if ( is_multisite() ) {
139
+ // Only network admin can change files that affects the entire network.
140
+ $can = current_user_can_for_blog( get_current_blog_id(), $capability );
141
+ } else {
142
+ $can = current_user_can( $capability );
143
+ }
144
+
145
+ if ( $can ) {
146
+ // Also you can use this method to get the capability.
147
+ $can = $capability;
148
+ }
149
+
150
+ return $can;
151
+ }
152
+
153
+ public function activate_extension($id) {
154
+ if (! isset($this->extensions[$id])) {
155
+ return;
156
+ }
157
+
158
+ if (! $this->extensions[$id]['path']) {
159
+ return;
160
+ }
161
+
162
+ $activated = $this->get_activated_extensions();
163
+
164
+ if (! in_array(strtolower($id), $activated)) {
165
+ $path = $this->extensions[$id]['path'];
166
+ require_once($path . '/extension.php');
167
+
168
+ if (method_exists($this->get_class_name_for($id), "onActivation")) {
169
+ call_user_func([
170
+ $this->get_class_name_for($id),
171
+ 'onActivation'
172
+ ]);
173
+ }
174
+
175
+ $class = $this->get_class_name_for($id);
176
+
177
+ // Init extension right away.
178
+ new $class;
179
+ }
180
+
181
+ $activated[] = strtolower($id);
182
+
183
+
184
+ update_option($this->get_option_name(), array_unique($activated));
185
+
186
+ do_action('blocksy:dynamic-css:refresh-caches');
187
+ }
188
+
189
+ public function deactivate_extension($id) {
190
+ if (! isset($this->extensions[$id])) {
191
+ return;
192
+ }
193
+
194
+ if (! $this->extensions[$id]['path']) {
195
+ return;
196
+ }
197
+
198
+ $activated = $this->get_activated_extensions();
199
+
200
+ if (in_array(strtolower($id), $activated)) {
201
+ if (method_exists($this->get_class_name_for($id), "onDeactivation")) {
202
+ call_user_func([
203
+ $this->get_class_name_for($id),
204
+ 'onDeactivation'
205
+ ]);
206
+ }
207
+ }
208
+
209
+ update_option($this->get_option_name(), array_diff(
210
+ $activated,
211
+ [$id]
212
+ ));
213
+
214
+ do_action('blocksy:dynamic-css:refresh-caches');
215
+ }
216
+
217
+ private function read_installed_extensions() {
218
+ $paths_to_look_for_extensions = apply_filters(
219
+ 'blocksy_extensions_paths',
220
+ [
221
+ BLOCKSY_PATH . 'framework/extensions'
222
+ ]
223
+ );
224
+
225
+ foreach ($paths_to_look_for_extensions as $single_path) {
226
+ $all_extensions = glob($single_path . '/*', GLOB_ONLYDIR);
227
+
228
+ foreach ($all_extensions as $single_extension) {
229
+ $this->register_extension_for($single_extension);
230
+ }
231
+ }
232
+
233
+ $this->register_fake_extensions();
234
+ }
235
+
236
+ private function register_fake_extensions() {
237
+ if (blc_fs()->can_use_premium_code()) {
238
+ return;
239
+ }
240
+
241
+ $this->extensions['adobe-typekit'] = [
242
+ 'path' => null,
243
+ '__object' => null,
244
+ 'config' => [
245
+ 'name' => __('Adobe Typekit', 'blocksy-companion'),
246
+ 'description' => __('Connect your Typekit account and use your fonts in any typography option.', 'blocksy-companion'),
247
+ 'pro' => true
248
+ ],
249
+ 'readme' => '',
250
+ 'data' => null
251
+ ];
252
+
253
+ $this->extensions['custom-code-snippets'] = [
254
+ 'path' => null,
255
+ '__object' => null,
256
+ 'config' => [
257
+ 'name' => __('Custom Code Snippets', 'blocksy-companion'),
258
+ 'description' => __('Add custom code snippets in your header and footer, globally and per post or page individually.', 'blocksy-companion'),
259
+ 'pro' => true
260
+ ],
261
+ 'readme' => '',
262
+ 'data' => null
263
+ ];
264
+
265
+ $this->extensions['custom-fonts'] = [
266
+ 'path' => null,
267
+ '__object' => null,
268
+ 'config' => [
269
+ 'name' => __('Custom Fonts', 'blocksy-companion'),
270
+ 'description' => __('Upload unlimited number of custom fonts or variable fonts and use them in any typography option.', 'blocksy-companion'),
271
+ 'pro' => true
272
+ ],
273
+ 'readme' => '',
274
+ 'data' => null
275
+ ];
276
+
277
+ $this->extensions['local-google-fonts'] = [
278
+ 'path' => null,
279
+ '__object' => null,
280
+ 'config' => [
281
+ 'name' => __('Local Google Fonts', 'blocksy-companion'),
282
+ 'description' => __('Serve Google Fonts from your own server for full GDPR compliancy.', 'blocksy-companion'),
283
+ 'pro' => true
284
+ ],
285
+ 'readme' => '',
286
+ 'data' => null
287
+ ];
288
+
289
+ $this->extensions['advanced-menu'] = [
290
+ 'path' => null,
291
+ '__object' => null,
292
+ 'config' => [
293
+ 'name' => __('Advanced Menu', 'blocksy-companion'),
294
+ 'description' => __('Create beautiful mega menus, assign icons add badges to menu items, and content blocks inside menu items.', 'blocksy-companion'),
295
+ 'pro' => true
296
+ ],
297
+ 'readme' => '',
298
+ 'data' => null
299
+ ];
300
+
301
+ $this->extensions['shortcuts-bar'] = [
302
+ 'path' => null,
303
+ '__object' => null,
304
+ 'config' => [
305
+ 'name' => __('Shortcuts Bar', 'blocksy-companion'),
306
+ 'description' => __('Transform your website into a app like by displaying a neat shortcuts bar at the bottom of the vieport.', 'blocksy-companion'),
307
+ 'pro' => true
308
+ ],
309
+ 'readme' => '',
310
+ 'data' => null
311
+ ];
312
+
313
+ $this->extensions['multiple-sidebars'] = [
314
+ 'path' => null,
315
+ '__object' => null,
316
+ 'config' => [
317
+ 'name' => __('Multiple Sidebars', 'blocksy-companion'),
318
+ 'description' => __('Create unlimited number of sidebars and display them conditionaly on any page or post.', 'blocksy-companion'),
319
+ 'pro' => true
320
+ ],
321
+ 'readme' => '',
322
+ 'data' => null
323
+ ];
324
+
325
+ $this->extensions['white-label'] = [
326
+ 'path' => null,
327
+ '__object' => null,
328
+ 'config' => [
329
+ 'name' => __('White Label (Agency Package)', 'blocksy-companion'),
330
+ 'description' => __('Change the theme and companion plugin branding to your own custom one.', 'blocksy-companion'),
331
+ 'pro' => true
332
+ ],
333
+ 'readme' => '',
334
+ 'data' => null
335
+ ];
336
+
337
+ $this->extensions['woocommerce-extra'] = [
338
+ 'path' => null,
339
+ '__object' => null,
340
+ 'config' => [
341
+ 'name' => __('WooCommerce Extra', 'blocksy-companion'),
342
+ 'description' => __('Increase the conversion rate by adding a product quick view modal, a floating cart. Control the single product gallery/slider and the layout, add a wishlits page.', 'blocksy-companion'),
343
+ 'pro' => true
344
+ ],
345
+ 'readme' => '',
346
+ 'data' => null
347
+ ];
348
+ }
349
+
350
+ private function register_extension_for($path) {
351
+ $id = str_replace('_', '-', basename($path));
352
+
353
+ if (isset($this->extensions[$id])) return;
354
+
355
+ $this->extensions[$id] = [
356
+ 'path' => $path,
357
+ '__object' => null,
358
+ 'config' => $this->read_config_for($path),
359
+ 'readme' => $this->read_readme_for($path),
360
+ 'data' => null
361
+ ];
362
+ }
363
+
364
+ private function maybe_do_extension_preboot($id) {
365
+ if (! isset($this->extensions[$id])) return false;
366
+ if (isset($this->extensions[$id]['__object_preboot'])) return;
367
+
368
+ $class_name = explode( '-', $id );
369
+ $class_name = array_map( 'ucfirst', $class_name );
370
+ $class_name = 'BlocksyExtension' . implode( '', $class_name ) . 'PreBoot';
371
+
372
+ $path = $this->extensions[$id]['path'];
373
+
374
+ if (! $path) {
375
+ return;
376
+ }
377
+
378
+ if (! @is_readable($path . '/pre-boot.php')) {
379
+ return;
380
+ }
381
+
382
+ if (! file_exists($path . '/pre-boot.php')) {
383
+ return;
384
+ }
385
+
386
+ require_once($path . '/pre-boot.php');
387
+
388
+ $this->extensions[$id]['__object_preboot'] = new $class_name();
389
+
390
+ if (method_exists(
391
+ $this->extensions[$id]['__object_preboot'], 'ext_data'
392
+ )) {
393
+ $this->extensions[$id]['data'] = $this->extensions[
394
+ $id
395
+ ]['__object_preboot']->ext_data();
396
+ }
397
+ }
398
+
399
+ private function boot_activated_extension_for($id) {
400
+ if (! isset($this->extensions[$id])) return false;
401
+ if (! isset($this->extensions[$id]['path'])) return false;
402
+ if (! $this->extensions[$id]['path']) return false;
403
+
404
+ if (
405
+ isset($this->extensions[$id]['config']['hidden'])
406
+ &&
407
+ $this->extensions[$id]['config']['hidden']
408
+ ) {
409
+ return;
410
+ }
411
+
412
+ if (isset($this->extensions[$id]['__object'])) return;
413
+
414
+ $class_name = explode( '-', $id );
415
+ $class_name = array_map( 'ucfirst', $class_name );
416
+ $class_name = 'BlocksyExtension' . implode( '', $class_name );
417
+
418
+ $path = $this->extensions[$id]['path'];
419
+
420
+ if (! $path) {
421
+ return;
422
+ }
423
+
424
+ if (! @is_readable($path . '/extension.php')) {
425
+ return;
426
+ }
427
+
428
+ if (! file_exists($path . '/extension.php')) {
429
+ return;
430
+ }
431
+
432
+ require_once($path . '/extension.php');
433
+
434
+ $this->extensions[$id]['__object'] = new $class_name();
435
+ }
436
+
437
+ private function get_class_name_for($id) {
438
+ $class_name = explode( '-', $id );
439
+ $class_name = array_map( 'ucfirst', $class_name );
440
+ return 'BlocksyExtension' . implode( '', $class_name );
441
+ }
442
+
443
+ private function read_readme_for($path) {
444
+ $readme = '';
445
+
446
+ ob_start();
447
+
448
+ if (is_readable($path . '/readme.php')) {
449
+ require $path . '/readme.php';
450
+ }
451
+
452
+ $readme = ob_get_clean();
453
+
454
+ if (empty(trim($readme))) {
455
+ return null;
456
+ }
457
+
458
+ return trim($readme);
459
+ }
460
+
461
+ private function read_config_for( $file_path ) {
462
+ $_extract_variables = [ 'config' => [] ];
463
+
464
+ if (is_readable($file_path . '/config.php')) {
465
+ require $file_path . '/config.php';
466
+
467
+ foreach ($_extract_variables as $variable_name => $default_value) {
468
+ if (isset($$variable_name)) {
469
+ $_extract_variables[ $variable_name ] = $$variable_name;
470
+ }
471
+ }
472
+ }
473
+
474
+ $name = explode('-', basename($file_path));
475
+ $name = array_map('ucfirst', $name);
476
+ $name = implode(' ', $name);
477
+
478
+ $_extract_variables['config'] = array_merge(
479
+ [
480
+ 'name' => $name,
481
+ 'description' => '',
482
+ 'pro' => false,
483
+ 'hidden' => false
484
+ ],
485
+ $_extract_variables['config']
486
+ );
487
+
488
+ return $_extract_variables['config'];
489
+ }
490
+
491
+ private function get_activated_extensions() {
492
+ return get_option($this->get_option_name(), []);
493
+ }
494
+ }
495
+
framework/extensions/cookies-consent/static/bundle/main.min.css CHANGED
@@ -1,5 +1,5 @@
1
  /**
2
- * - v1.8.30
3
  *
4
  * Copyright (c) 2022
5
  * Licensed GPLv2+
1
  /**
2
+ * - v1.8.31
3
  *
4
  * Copyright (c) 2022
5
  * Licensed GPLv2+
framework/extensions/newsletter-subscribe/static/bundle/main.min.css CHANGED
@@ -1,5 +1,5 @@
1
  /**
2
- * - v1.8.30
3
  *
4
  * Copyright (c) 2022
5
  * Licensed GPLv2+
1
  /**
2
+ * - v1.8.31
3
  *
4
  * Copyright (c) 2022
5
  * Licensed GPLv2+
framework/extensions/product-reviews/static/bundle/main-admin.min.css CHANGED
@@ -1,5 +1,5 @@
1
  /**
2
- * - v1.8.30
3
  *
4
  * Copyright (c) 2022
5
  * Licensed GPLv2+
1
  /**
2
+ * - v1.8.31
3
  *
4
  * Copyright (c) 2022
5
  * Licensed GPLv2+
framework/extensions/product-reviews/static/bundle/main.min.css CHANGED
@@ -1,5 +1,5 @@
1
  /**
2
- * - v1.8.30
3
  *
4
  * Copyright (c) 2022
5
  * Licensed GPLv2+
1
  /**
2
+ * - v1.8.31
3
  *
4
  * Copyright (c) 2022
5
  * Licensed GPLv2+
framework/extensions/trending/customizer.php CHANGED
@@ -283,7 +283,7 @@ $options = [
283
  ],
284
  ],
285
 
286
- blc_fs()->can_use_premium_code__premium_only() ? [
287
  'trending_block_location' => [
288
  'label' => __('Display Location', 'blocksy-companion'),
289
  'type' => 'ct-select',
283
  ],
284
  ],
285
 
286
+ blc_fs()->can_use_premium_code() ? [
287
  'trending_block_location' => [
288
  'label' => __('Display Location', 'blocksy-companion'),
289
  'type' => 'ct-select',
framework/extensions/trending/extension.php CHANGED
@@ -1,79 +1,123 @@
1
  <?php
2
 
3
- require_once dirname( __FILE__ ) . '/helpers.php';
4
- class BlocksyExtensionTrending
5
- {
6
- public function __construct()
7
- {
8
- add_action( 'wp_enqueue_scripts', function () {
9
- if ( !function_exists( 'get_plugin_data' ) ) {
10
- require_once ABSPATH . 'wp-admin/includes/plugin.php';
11
- }
12
- $data = get_plugin_data( BLOCKSY__FILE__ );
13
- if ( is_admin() ) {
14
- return;
15
- }
16
- wp_enqueue_style(
17
- 'blocksy-ext-trending-styles',
18
- BLOCKSY_URL . 'framework/extensions/trending/static/bundle/main.min.css',
19
- [ 'ct-main-styles' ],
20
- $data['Version']
21
- );
22
- }, 50 );
23
- add_filter( 'blocksy:frontend:dynamic-js-chunks', function ( $chunks ) {
24
- $chunks[] = [
25
- 'id' => 'blocksy_ext_trending',
26
- 'selector' => '.ct-trending-block [class*="ct-arrow"]',
27
- 'url' => blc_call_fn( [
28
- 'fn' => 'blocksy_cdn_url',
29
- 'default' => BLOCKSY_URL . 'framework/extensions/trending/static/bundle/main.js',
30
- ], BLOCKSY_URL . 'framework/extensions/trending/static/bundle/main.js' ),
31
- 'trigger' => 'click',
32
- ];
33
- return $chunks;
34
- } );
35
- add_filter( 'blocksy_extensions_customizer_options', function ( $opts ) {
36
- $opts['trending_posts_ext'] = blc_call_fn(
37
- [
38
- 'fn' => 'blocksy_get_options',
39
- 'default' => 'array',
40
- ],
41
- dirname( __FILE__ ) . '/customizer.php',
42
- [],
43
- false
44
- );
45
- return $opts;
46
- } );
47
- add_action( 'wp', function () {
48
- $location = 'blocksy:template:after';
49
- add_action( $location, function () {
50
- echo blc_get_trending_block() ;
51
- }, 50 );
52
- } );
53
- add_action( 'customize_preview_init', function () {
54
- if ( !function_exists( 'get_plugin_data' ) ) {
55
- require_once ABSPATH . 'wp-admin/includes/plugin.php';
56
- }
57
- $data = get_plugin_data( BLOCKSY__FILE__ );
58
- wp_enqueue_script(
59
- 'blocksy-trending-customizer-sync',
60
- BLOCKSY_URL . 'framework/extensions/trending/static/bundle/sync.js',
61
- [ 'customize-preview', 'ct-scripts', 'ct-customizer' ],
62
- $data['Version'],
63
- true
64
- );
65
- } );
66
- add_action(
67
- 'blocksy:global-dynamic-css:enqueue',
68
- function ( $args ) {
69
- blocksy_theme_get_dynamic_styles( array_merge( [
70
- 'path' => dirname( __FILE__ ) . '/global.php',
71
- 'chunk' => 'global',
72
- ], $args ) );
73
- },
74
- 10,
75
- 3
76
- );
77
- }
78
-
79
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
 
3
+ require_once dirname(__FILE__) . '/helpers.php';
4
+
5
+ class BlocksyExtensionTrending {
6
+ public function __construct() {
7
+ add_action('wp_enqueue_scripts', function () {
8
+ if (! function_exists('get_plugin_data')) {
9
+ require_once(ABSPATH . 'wp-admin/includes/plugin.php');
10
+ }
11
+
12
+ $data = get_plugin_data(BLOCKSY__FILE__);
13
+
14
+ if (is_admin()) {
15
+ return;
16
+ }
17
+
18
+ wp_enqueue_style(
19
+ 'blocksy-ext-trending-styles',
20
+ BLOCKSY_URL . 'framework/extensions/trending/static/bundle/main.min.css',
21
+ ['ct-main-styles'],
22
+ $data['Version']
23
+ );
24
+ }, 50);
25
+
26
+ add_filter('blocksy:frontend:dynamic-js-chunks', function ($chunks) {
27
+ $chunks[] = [
28
+ 'id' => 'blocksy_ext_trending',
29
+ 'selector' => '.ct-trending-block [class*="ct-arrow"]',
30
+ 'url' => blc_call_fn(
31
+ [
32
+ 'fn' => 'blocksy_cdn_url',
33
+ 'default' => BLOCKSY_URL . 'framework/extensions/trending/static/bundle/main.js'
34
+ ],
35
+ BLOCKSY_URL . 'framework/extensions/trending/static/bundle/main.js'
36
+ ),
37
+ 'trigger' => 'click'
38
+ ];
39
+
40
+ return $chunks;
41
+ });
42
+
43
+ add_filter(
44
+ 'blocksy_extensions_customizer_options',
45
+ function ($opts) {
46
+ $opts['trending_posts_ext'] = blc_call_fn(
47
+ [
48
+ 'fn' => 'blocksy_get_options',
49
+ 'default' => 'array'
50
+ ],
51
+ dirname(__FILE__) . '/customizer.php',
52
+ [], false
53
+ );
54
+
55
+ return $opts;
56
+ }
57
+ );
58
+
59
+ add_action('wp', function () {
60
+ $location = 'blocksy:template:after';
61
+
62
+ if (blc_fs()->can_use_premium_code()) {
63
+ $location = get_theme_mod(
64
+ 'trending_block_location',
65
+ 'blocksy:content:bottom'
66
+ );
67
+ }
68
+
69
+ add_action(
70
+ $location,
71
+ function () {
72
+ if (blc_fs()->can_use_premium_code()) {
73
+ $conditions = get_theme_mod(
74
+ 'trending_block_conditions',
75
+ [
76
+ [
77
+ 'type' => 'include',
78
+ 'rule' => 'everywhere',
79
+ ]
80
+ ]
81
+ );
82
+
83
+ $conditions_manager = new \Blocksy\ConditionsManager();
84
+
85
+ if (! $conditions_manager->condition_matches($conditions)) {
86
+ return;
87
+ }
88
+ }
89
+
90
+ echo blc_get_trending_block();
91
+ },
92
+ 50
93
+ );
94
+ });
95
+
96
+
97
+ add_action(
98
+ 'customize_preview_init',
99
+ function () {
100
+ if (! function_exists('get_plugin_data')) {
101
+ require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
102
+ }
103
+
104
+ $data = get_plugin_data(BLOCKSY__FILE__);
105
+
106
+ wp_enqueue_script(
107
+ 'blocksy-trending-customizer-sync',
108
+ BLOCKSY_URL . 'framework/extensions/trending/static/bundle/sync.js',
109
+ ['customize-preview', 'ct-scripts', 'ct-customizer'],
110
+ $data['Version'],
111
+ true
112
+ );
113
+ }
114
+ );
115
+
116
+ add_action('blocksy:global-dynamic-css:enqueue', function ($args) {
117
+ blocksy_theme_get_dynamic_styles(array_merge([
118
+ 'path' => dirname( __FILE__ ) . '/global.php',
119
+ 'chunk' => 'global'
120
+ ], $args));
121
+ }, 10, 3);
122
+ }
123
+ }
framework/extensions/trending/static/bundle/main.min.css CHANGED
@@ -1,5 +1,5 @@
1
  /**
2
- * - v1.8.30
3
  *
4
  * Copyright (c) 2022
5
  * Licensed GPLv2+
1
  /**
2
+ * - v1.8.31
3
  *
4
  * Copyright (c) 2022
5
  * Licensed GPLv2+
framework/extensions/widgets/static/bundle/main.min.css CHANGED
@@ -1,5 +1,5 @@
1
  /**
2
- * - v1.8.30
3
  *
4
  * Copyright (c) 2022
5
  * Licensed GPLv2+
1
  /**
2
+ * - v1.8.31
3
  *
4
  * Copyright (c) 2022
5
  * Licensed GPLv2+
framework/features/header/modal/login.php CHANGED
@@ -1,76 +1,69 @@
1
  <?php
2
 
3
  // wp_login_form([]);
4
- $redirect_to_url = apply_filters( 'blocksy:account:modal:login:redirect_to', $current_url );
5
- $forgot_password_inline = apply_filters( 'blocksy:account:modal:login:forgot-password-inline', true );
 
 
 
 
 
 
 
 
 
6
  $forgot_pass_class = 'ct-forgot-password';
7
- if ( !$forgot_password_inline ) {
8
- $forgot_pass_class .= '-static';
 
9
  }
 
10
  ?>
11
 
12
  <form name="loginform" id="loginform" action="#" method="post">
13
- <?php
14
- do_action( 'woocommerce_login_form_start' );
15
- ?>
16
- <?php
17
- do_action( 'blocksy:account:modal:login:start' );
18
- ?>
19
 
20
  <p class="login-username">
21
- <label for="user_login"><?php
22
- echo __( 'Username or Email Address', 'blocksy-companion' ) ;
23
- ?></label>
24
  <input type="text" name="log" id="user_login" class="input" value="" size="20">
25
  </p>
26
 
27
  <p class="login-password">
28
- <label for="user_pass"><?php
29
- echo __( 'Password', 'blocksy-companion' ) ;
30
- ?></label>
31
  <input type="password" name="pwd" id="user_pass" class="input" value="" size="20">
32
  </p>
33
 
34
  <p class="login-remember col-2">
35
  <span>
36
  <input name="rememberme" type="checkbox" id="rememberme" class="ct-checkbox" value="forever">
37
- <label for="rememberme"><?php
38
- echo __( 'Remember Me', 'blocksy-companion' ) ;
39
- ?></label>
40
  </span>
41
 
42
- <a href="<?php
43
- echo wp_lostpassword_url() ;
44
- ?>" class="<?php
45
- echo $forgot_pass_class ;
46
- ?>">
47
- <?php
48
- echo __( 'Forgot Password?', 'blocksy-companion' ) ;
49
- ?>
50
  </a>
51
  </p>
52
 
53
- <?php
54
- do_action( 'login_form' );
55
- ?>
 
 
 
 
 
 
56
 
57
  <p class="login-submit">
58
  <button name="wp-submit" class="ct-button">
59
- <?php
60
- echo __( 'Log In', 'blocksy-companion' ) ;
61
- ?>
62
  </button>
63
 
64
- <input type="hidden" name="redirect_to" value="<?php
65
- echo $redirect_to_url ;
66
- ?>">
67
  </p>
68
 
69
- <?php
70
- do_action( 'blocksy:account:modal:login:end' );
71
- ?>
72
- <?php
73
- do_action( 'woocommerce_login_form_end' );
74
- ?>
75
  </form>
76
 
1
  <?php
2
 
3
  // wp_login_form([]);
4
+
5
+ $redirect_to_url = apply_filters(
6
+ 'blocksy:account:modal:login:redirect_to',
7
+ $current_url
8
+ );
9
+
10
+ $forgot_password_inline = apply_filters(
11
+ 'blocksy:account:modal:login:forgot-password-inline',
12
+ true
13
+ );
14
+
15
  $forgot_pass_class = 'ct-forgot-password';
16
+
17
+ if (! $forgot_password_inline) {
18
+ $forgot_pass_class .= '-static';
19
  }
20
+
21
  ?>
22
 
23
  <form name="loginform" id="loginform" action="#" method="post">
24
+ <?php do_action('woocommerce_login_form_start'); ?>
25
+ <?php do_action('blocksy:account:modal:login:start'); ?>
 
 
 
 
26
 
27
  <p class="login-username">
28
+ <label for="user_login"><?php echo __('Username or Email Address', 'blocksy-companion') ?></label>
 
 
29
  <input type="text" name="log" id="user_login" class="input" value="" size="20">
30
  </p>
31
 
32
  <p class="login-password">
33
+ <label for="user_pass"><?php echo __('Password', 'blocksy-companion') ?></label>
 
 
34
  <input type="password" name="pwd" id="user_pass" class="input" value="" size="20">
35
  </p>
36
 
37
  <p class="login-remember col-2">
38
  <span>
39
  <input name="rememberme" type="checkbox" id="rememberme" class="ct-checkbox" value="forever">
40
+ <label for="rememberme"><?php echo __('Remember Me', 'blocksy-companion') ?></label>
 
 
41
  </span>
42
 
43
+ <a href="<?php echo wp_lostpassword_url() ?>" class="<?php echo $forgot_pass_class ?>">
44
+ <?php echo __('Forgot Password?', 'blocksy-companion') ?>
 
 
 
 
 
 
45
  </a>
46
  </p>
47
 
48
+ <?php
49
+ if (blc_fs()->can_use_premium_code()) {
50
+ if (class_exists('NextendSocialLogin')) {
51
+ \NextendSocialLogin::addLoginFormButtons();
52
+ }
53
+ }
54
+
55
+ do_action('login_form')
56
+ ?>
57
 
58
  <p class="login-submit">
59
  <button name="wp-submit" class="ct-button">
60
+ <?php echo __('Log In', 'blocksy-companion') ?>
 
 
61
  </button>
62
 
63
+ <input type="hidden" name="redirect_to" value="<?php echo $redirect_to_url ?>">
 
 
64
  </p>
65
 
66
+ <?php do_action('blocksy:account:modal:login:end'); ?>
67
+ <?php do_action('woocommerce_login_form_end'); ?>
 
 
 
 
68
  </form>
69
 
framework/features/header/modal/register.php CHANGED
@@ -2,89 +2,72 @@
2
 
3
  $has_username = true;
4
  $has_password = false;
5
- if ( \Blocksy\Plugin::instance()->account_auth->has_woo_register_flow() && 'no' !== get_option( 'woocommerce_registration_generate_username' ) ) {
6
- $has_username = false;
 
 
 
 
 
7
  }
8
- if ( \Blocksy\Plugin::instance()->account_auth->has_woo_register_flow() && 'no' === get_option( 'woocommerce_registration_generate_password' ) ) {
9
- $has_password = true;
 
 
 
 
 
10
  }
11
- ?>
12
 
13
- <form name="registerform" id="registerform" action="#" method="post" novalidate="novalidate">
14
- <?php
15
- do_action( 'woocommerce_register_form_start' );
16
- ?>
17
- <?php
18
- do_action( 'blocksy:account:modal:register:start' );
19
  ?>
20
 
21
- <?php
 
 
22
 
23
- if ( $has_username ) {
24
- ?>
25
  <p>
26
- <label for="user_login_register"><?php
27
- echo __( 'Username', 'blocksy-companion' ) ;
28
- ?></label>
29
  <input type="text" name="user_login" id="user_login_register" class="input" value="" size="20" autocapitalize="off">
30
  </p>
31
- <?php
32
- }
33
-
34
- ?>
35
 
36
  <p>
37
- <label for="user_email"><?php
38
- echo __( 'Email', 'blocksy-companion' ) ;
39
- ?></label>
40
  <input type="email" name="user_email" id="user_email" class="input" value="" size="25">
41
  </p>
42
 
43
- <?php
44
-
45
- if ( $has_password ) {
46
- ?>
47
  <p>
48
- <label for="user_pass_register"><?php
49
- echo __( 'Password', 'blocksy-companion' ) ;
50
- ?></label>
51
  <input type="password" name="user_pass" id="user_pass_register" class="input" value="" size="20" autocapitalize="off" autocomplete="new-password">
52
  </p>
53
- <?php
54
- }
55
 
56
- ?>
 
 
 
 
 
57
 
58
- <?php
59
- do_action( 'register_form' );
60
- ?>
61
 
62
  <p id="reg_passmail">
63
- <?php
64
- echo __( 'Registration confirmation will be emailed to you', 'blocksy-companion' ) ;
65
- ?>
66
  </p>
67
 
68
  <p>
69
  <button name="wp-submit" class="ct-button">
70
- <?php
71
- echo __( 'Register', 'blocksy-companion' ) ;
72
- ?>
73
  </button>
74
 
75
- <!-- <input type="hidden" name="redirect_to" value="<?php
76
- echo blocksy_current_url() ;
77
- ?>"> -->
78
  </p>
79
 
80
- <?php
81
- do_action( 'blocksy:account:modal:register:end' );
82
- ?>
83
- <?php
84
- do_action( 'woocommerce_register_form_end' );
85
- ?>
86
- <?php
87
- wp_nonce_field( 'blocksy-register', 'blocksy-register-nonce' );
88
- ?>
89
  </form>
90
 
2
 
3
  $has_username = true;
4
  $has_password = false;
5
+
6
+ if (
7
+ \Blocksy\Plugin::instance()->account_auth->has_woo_register_flow()
8
+ &&
9
+ 'no' !== get_option('woocommerce_registration_generate_username')
10
+ ) {
11
+ $has_username = false;
12
  }
13
+
14
+ if (
15
+ \Blocksy\Plugin::instance()->account_auth->has_woo_register_flow()
16
+ &&
17
+ 'no' === get_option('woocommerce_registration_generate_password')
18
+ ) {
19
+ $has_password = true;
20
  }
 
21
 
 
 
 
 
 
 
22
  ?>
23
 
24
+ <form name="registerform" id="registerform" action="#" method="post" novalidate="novalidate">
25
+ <?php do_action('woocommerce_register_form_start') ?>
26
+ <?php do_action('blocksy:account:modal:register:start'); ?>
27
 
28
+ <?php if ($has_username) { ?>
 
29
  <p>
30
+ <label for="user_login_register"><?php echo __('Username', 'blocksy-companion') ?></label>
 
 
31
  <input type="text" name="user_login" id="user_login_register" class="input" value="" size="20" autocapitalize="off">
32
  </p>
33
+ <?php } ?>
 
 
 
34
 
35
  <p>
36
+ <label for="user_email"><?php echo __('Email', 'blocksy-companion') ?></label>
 
 
37
  <input type="email" name="user_email" id="user_email" class="input" value="" size="25">
38
  </p>
39
 
40
+ <?php if ($has_password) { ?>
 
 
 
41
  <p>
42
+ <label for="user_pass_register"><?php echo __('Password', 'blocksy-companion') ?></label>
 
 
43
  <input type="password" name="user_pass" id="user_pass_register" class="input" value="" size="20" autocapitalize="off" autocomplete="new-password">
44
  </p>
45
+ <?php } ?>
 
46
 
47
+ <?php
48
+ if (blc_fs()->can_use_premium_code()) {
49
+ if (class_exists('NextendSocialLogin')) {
50
+ \NextendSocialLogin::addRegisterFormButtons();
51
+ }
52
+ }
53
 
54
+ do_action('register_form')
55
+ ?>
 
56
 
57
  <p id="reg_passmail">
58
+ <?php echo __('Registration confirmation will be emailed to you', 'blocksy-companion') ?>
 
 
59
  </p>
60
 
61
  <p>
62
  <button name="wp-submit" class="ct-button">
63
+ <?php echo __('Register', 'blocksy-companion') ?>
 
 
64
  </button>
65
 
66
+ <!-- <input type="hidden" name="redirect_to" value="<?php echo blocksy_current_url() ?>"> -->
 
 
67
  </p>
68
 
69
+ <?php do_action('blocksy:account:modal:register:end'); ?>
70
+ <?php do_action('woocommerce_register_form_end') ?>
71
+ <?php wp_nonce_field('blocksy-register', 'blocksy-register-nonce'); ?>
 
 
 
 
 
 
72
  </form>
73
 
framework/theme-integration.php CHANGED
@@ -393,7 +393,7 @@ class ThemeIntegration {
393
  }
394
 
395
  if (
396
- blc_fs()->can_use_premium_code__premium_only()
397
  &&
398
  BLOCKSY_PATH . '/framework/premium/changelog.txt'
399
  ) {
393
  }
394
 
395
  if (
396
+ blc_fs()->can_use_premium_code()
397
  &&
398
  BLOCKSY_PATH . '/framework/premium/changelog.txt'
399
  ) {
plugin.php CHANGED
@@ -2,143 +2,201 @@
2
 
3
  namespace Blocksy;
4
 
5
- class Plugin
6
- {
7
- /**
8
- * Blocksy instance.
9
- *
10
- * Holds the blocksy plugin instance.
11
- *
12
- * @var Plugin
13
- */
14
- private static $instance = null ;
15
- /**
16
- * Blocksy extensions manager.
17
- *
18
- * @var ExtensionsManager
19
- */
20
- public $extensions = null ;
21
- public $extensions_api = null ;
22
- public $premium = null ;
23
- public $dashboard = null ;
24
- public $theme_integration = null ;
25
- public $cli = null ;
26
- public $cache_manager = null ;
27
- // Features
28
- public $feat_google_analytics = null ;
29
- public $demo = null ;
30
- public $dynamic_css = null ;
31
- public $header = null ;
32
- public $account_auth = null ;
33
- private $is_blocksy = '__NOT_SET__' ;
34
- private $desired_blocksy_version = '1.7.18' ;
35
- /**
36
- * Instance.
37
- *
38
- * Ensures only one instance of the plugin class is loaded or can be loaded.
39
- *
40
- * @static
41
- *
42
- * @return Plugin An instance of the class.
43
- */
44
- public static function instance()
45
- {
46
- if ( is_null( self::$instance ) ) {
47
- self::$instance = new self();
48
- }
49
- return self::$instance;
50
- }
51
-
52
- public function init()
53
- {
54
- if ( !$this->check_if_blocksy_is_activated() ) {
55
- return;
56
- }
57
- add_action( 'widgets_init', [ 'BlocksyWidgetFactory', 'register_all_widgets' ] );
58
- add_action( 'admin_enqueue_scripts', function () {
59
- $locale_data_ct = blc_call_fn( [
60
- 'fn' => 'blocksy_get_jed_locale_data',
61
- 'default' => [],
62
- ], 'blocksy-companion' );
63
- wp_add_inline_script( 'wp-i18n', 'wp.i18n.setLocaleData( ' . wp_json_encode( $locale_data_ct ) . ', "blocksy-companion" );' );
64
- } );
65
- $this->cache_manager = new CacheResetManager();
66
- $this->extensions_api = new ExtensionsManagerApi();
67
- $this->theme_integration = new ThemeIntegration();
68
- $this->demo = new DemoInstall();
69
- $this->dynamic_css = new DynamicCss();
70
- $this->account_auth = new AccountAuth();
71
- new CustomizerOptionsManager();
72
- }
73
-
74
- /**
75
- * Init components that need early access to the system.
76
- *
77
- * @access private
78
- */
79
- public function early_init()
80
- {
81
- if ( !$this->check_if_blocksy_is_activated() ) {
82
- return;
83
- }
84
- $this->extensions = new ExtensionsManager();
85
- $this->dashboard = new Dashboard();
86
- $this->header = new HeaderAdditions();
87
- $this->feat_google_analytics = new GoogleAnalytics();
88
- new OpenGraphMetaData();
89
- if ( defined( 'WP_CLI' ) && WP_CLI ) {
90
- $this->cli = new Cli();
91
- }
92
- }
93
-
94
- /**
95
- * Register autoloader.
96
- *
97
- * Blocksy autoloader loads all the classes needed to run the plugin.
98
- *
99
- * @access private
100
- */
101
- private function register_autoloader()
102
- {
103
- require BLOCKSY_PATH . '/framework/autoload.php';
104
- Autoloader::run();
105
- }
106
-
107
- /**
108
- * Plugin constructor.
109
- *
110
- * Initializing Blocksy plugin.
111
- *
112
- * @access private
113
- */
114
- private function __construct()
115
- {
116
- require BLOCKSY_PATH . '/framework/helpers/blocksy-integration.php';
117
- require BLOCKSY_PATH . '/framework/helpers/helpers.php';
118
- $this->register_autoloader();
119
- $this->early_init();
120
- add_action( 'init', [ $this, 'init' ], 0 );
121
- }
122
-
123
- public function check_if_blocksy_is_activated( $forced = false )
124
- {
125
- if ( !$forced ) {
126
- return true;
127
- }
128
-
129
- if ( $this->is_blocksy === '__NOT_SET__' ) {
130
- $theme = wp_get_theme( get_template() );
131
- $is_correct_theme = strpos( $theme->get( 'Name' ), 'Blocksy' ) !== false;
132
- $is_correct_version = version_compare( $theme->get( 'Version' ), $this->desired_blocksy_version ) > -1;
133
- $another_theme_in_preview = false;
134
- if ( (isset( $_REQUEST['theme'] ) && strpos( strtolower( $_REQUEST['theme'] ), 'blocksy' ) === false || isset( $_REQUEST['customize_theme'] ) && strpos( strtolower( $_REQUEST['customize_theme'] ), 'blocksy' ) === false) && strpos( $_SERVER['REQUEST_URI'], 'customize' ) !== false ) {
135
- $another_theme_in_preview = true;
136
- }
137
- $this->is_blocksy = $is_correct_theme && $is_correct_version && !$another_theme_in_preview;
138
- }
139
-
140
- return !!$this->is_blocksy;
141
- }
142
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
143
  }
144
- Plugin::instance();
 
 
2
 
3
  namespace Blocksy;
4
 
5
+ class Plugin {
6
+ /**
7
+ * Blocksy instance.
8
+ *
9
+ * Holds the blocksy plugin instance.
10
+ *
11
+ * @var Plugin
12
+ */
13
+ private static $instance = null;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
 
15
+ /**
16
+ * Blocksy extensions manager.
17
+ *
18
+ * @var ExtensionsManager
19
+ */
20
+ public $extensions = null;
21
+ public $extensions_api = null;
22
+ public $premium = null;
23
+
24
+ public $dashboard = null;
25
+ public $theme_integration = null;
26
+
27
+ public $cli = null;
28
+ public $cache_manager = null;
29
+
30
+ // Features
31
+ public $feat_google_analytics = null;
32
+ public $demo = null;
33
+ public $dynamic_css = null;
34
+ public $header = null;
35
+ public $account_auth = null;
36
+
37
+ private $is_blocksy = '__NOT_SET__';
38
+ private $desired_blocksy_version = '1.7.18';
39
+
40
+ /**
41
+ * Instance.
42
+ *
43
+ * Ensures only one instance of the plugin class is loaded or can be loaded.
44
+ *
45
+ * @static
46
+ *
47
+ * @return Plugin An instance of the class.
48
+ */
49
+ public static function instance() {
50
+ if (is_null(self::$instance)) {
51
+ self::$instance = new self();
52
+ }
53
+
54
+ return self::$instance;
55
+ }
56
+
57
+ public function init() {
58
+ if (! $this->check_if_blocksy_is_activated()) {
59
+ return;
60
+ }
61
+
62
+ add_action('widgets_init', [
63
+ 'BlocksyWidgetFactory',
64
+ 'register_all_widgets',
65
+ ]);
66
+
67
+ add_action('admin_enqueue_scripts', function () {
68
+ $locale_data_ct = blc_call_fn(
69
+ [
70
+ 'fn' => 'blocksy_get_jed_locale_data',
71
+ 'default' => []
72
+ ],
73
+ 'blocksy-companion'
74
+ );
75
+
76
+ wp_add_inline_script(
77
+ 'wp-i18n',
78
+ 'wp.i18n.setLocaleData( ' . wp_json_encode($locale_data_ct) . ', "blocksy-companion" );'
79
+ );
80
+ });
81
+
82
+ $this->cache_manager = new CacheResetManager();
83
+
84
+ $this->extensions_api = new ExtensionsManagerApi();
85
+ $this->theme_integration = new ThemeIntegration();
86
+ $this->demo = new DemoInstall();
87
+ $this->dynamic_css = new DynamicCss();
88
+
89
+ $this->account_auth = new AccountAuth();
90
+
91
+ new CustomizerOptionsManager();
92
+ }
93
+
94
+ /**
95
+ * Init components that need early access to the system.
96
+ *
97
+ * @access private
98
+ */
99
+ public function early_init() {
100
+ if (! $this->check_if_blocksy_is_activated()) {
101
+ return;
102
+ }
103
+
104
+ if (blc_fs()->can_use_premium_code()) {
105
+ $this->premium = new Premium();
106
+ }
107
+
108
+ $this->extensions = new ExtensionsManager();
109
+
110
+ $this->dashboard = new Dashboard();
111
+ $this->header = new HeaderAdditions();
112
+
113
+ $this->feat_google_analytics = new GoogleAnalytics();
114
+ new OpenGraphMetaData();
115
+
116
+ if (defined('WP_CLI') && WP_CLI) {
117
+ $this->cli = new Cli();
118
+ }
119
+ }
120
+
121
+ /**
122
+ * Register autoloader.
123
+ *
124
+ * Blocksy autoloader loads all the classes needed to run the plugin.
125
+ *
126
+ * @access private
127
+ */
128
+ private function register_autoloader() {
129
+ require BLOCKSY_PATH . '/framework/autoload.php';
130
+
131
+ Autoloader::run();
132
+ }
133
+
134
+ /**
135
+ * Plugin constructor.
136
+ *
137
+ * Initializing Blocksy plugin.
138
+ *
139
+ * @access private
140
+ */
141
+ private function __construct() {
142
+ require BLOCKSY_PATH . '/framework/helpers/blocksy-integration.php';
143
+ require BLOCKSY_PATH . '/framework/helpers/helpers.php';
144
+
145
+ $this->register_autoloader();
146
+ $this->early_init();
147
+
148
+ add_action('init', [$this, 'init'], 0);
149
+ }
150
+
151
+ public function check_if_blocksy_is_activated($forced = false) {
152
+ if (! $forced) {
153
+ return true;
154
+ }
155
+
156
+ if ($this->is_blocksy === '__NOT_SET__') {
157
+ $theme = wp_get_theme(get_template());
158
+
159
+ $is_correct_theme = strpos(
160
+ $theme->get('Name'), 'Blocksy'
161
+ ) !== false;
162
+
163
+ $is_correct_version = version_compare(
164
+ $theme->get('Version'),
165
+ $this->desired_blocksy_version
166
+ ) > -1;
167
+
168
+ $another_theme_in_preview = false;
169
+
170
+ if (
171
+ (
172
+ (
173
+ isset(
174
+ $_REQUEST['theme']
175
+ ) && strpos(strtolower($_REQUEST['theme']), 'blocksy') === false
176
+ ||
177
+ isset(
178
+ $_REQUEST['customize_theme']
179
+ ) && strpos(strtolower($_REQUEST['customize_theme']), 'blocksy') === false
180
+ )
181
+ &&
182
+ strpos($_SERVER['REQUEST_URI'], 'customize') !== false
183
+ )
184
+ ) {
185
+ $another_theme_in_preview = true;
186
+ }
187
+
188
+ $this->is_blocksy = (
189
+ $is_correct_theme
190
+ &&
191
+ $is_correct_version
192
+ &&
193
+ !$another_theme_in_preview
194
+ );
195
+ }
196
+
197
+ return !!$this->is_blocksy;
198
+ }
199
  }
200
+
201
+ Plugin::instance();
202
+
readme.txt CHANGED
@@ -5,7 +5,7 @@ Requires PHP: 7.0
5
  Tested up to: 5.9
6
  License: GPLv2 or later
7
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
- Stable tag: 1.8.30
9
 
10
  == Description ==
11
 
@@ -23,6 +23,9 @@ It runs and adds its enhancements only if the Blocksy theme is installed and act
23
  2. Activate the plugin by going to **Plugins** page in WordPress admin and clicking on **Activate** link.
24
 
25
  == Changelog ==
 
 
 
26
  1.8.30: 2022-05-11
27
  - Improvement: General fixes and improvements
28
 
5
  Tested up to: 5.9
6
  License: GPLv2 or later
7
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ Stable tag: 1.8.31
9
 
10
  == Description ==
11
 
23
  2. Activate the plugin by going to **Plugins** page in WordPress admin and clicking on **Activate** link.
24
 
25
  == Changelog ==
26
+ 1.8.31: 2022-05-11
27
+ - Improvement: General fixes and improvements
28
+
29
  1.8.30: 2022-05-11
30
  - Improvement: General fixes and improvements
31
 
static/bundle/account-lazy.min.css CHANGED
@@ -1,5 +1,5 @@
1
  /**
2
- * - v1.8.30
3
  *
4
  * Copyright (c) 2022
5
  * Licensed GPLv2+
1
  /**
2
+ * - v1.8.31
3
  *
4
  * Copyright (c) 2022
5
  * Licensed GPLv2+
static/bundle/dashboard.min.css CHANGED
@@ -1,5 +1,5 @@
1
  /**
2
- * - v1.8.30
3
  *
4
  * Copyright (c) 2022
5
  * Licensed GPLv2+
1
  /**
2
+ * - v1.8.31
3
  *
4
  * Copyright (c) 2022
5
  * Licensed GPLv2+
static/bundle/options.min.css CHANGED
@@ -1,5 +1,5 @@
1
  /**
2
- * - v1.8.30
3
  *
4
  * Copyright (c) 2022
5
  * Licensed GPLv2+
1
  /**
2
+ * - v1.8.31
3
  *
4
  * Copyright (c) 2022
5
  * Licensed GPLv2+