Blocksy Companion - Version 1.8.9.6

Version Description

Download this release

Release Info

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

Code changes from version 1.8.9.5 to 1.8.9.6

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.9.5
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.9.6
7
  Author: CreativeThemes
8
  Author URI: https://creativethemes.com
9
  Text Domain: blocksy-companion
framework/autoload.php CHANGED
@@ -26,6 +26,7 @@ class Autoloader {
26
  'ExtensionsManagerApi' => 'framework/extensions-manager-api.php',
27
  'Dashboard' => 'framework/dashboard.php',
28
  'ThemeIntegration' => 'framework/theme-integration.php',
 
29
  'CacheResetManager' => 'framework/cache-reset-manager.php',
30
 
31
  'GoogleAnalytics' => 'framework/features/google-analytics.php',
26
  'ExtensionsManagerApi' => 'framework/extensions-manager-api.php',
27
  'Dashboard' => 'framework/dashboard.php',
28
  'ThemeIntegration' => 'framework/theme-integration.php',
29
+ 'AccountAuth' => 'framework/features/account-auth.php',
30
  'CacheResetManager' => 'framework/cache-reset-manager.php',
31
 
32
  'GoogleAnalytics' => 'framework/features/google-analytics.php',
framework/cli.php CHANGED
@@ -2,22 +2,17 @@
2
 
3
  namespace Blocksy;
4
 
 
 
 
 
 
 
 
 
 
5
  class Cli {
6
  public function __construct() {
7
- \WP_CLI::add_command('blocksy demo plugins', function ($args) {
8
- $plugins = [
9
- 'coblocks',
10
- 'elementor',
11
- 'contact-form-7',
12
- 'woocommerce'
13
- ];
14
-
15
- foreach ($plugins as $plugin) {
16
- \WP_CLI::runcommand('plugin install ' . $plugin, [] );
17
- \WP_CLI::runcommand('plugin activate ' . $plugin, [] );
18
- }
19
- });
20
-
21
  \WP_CLI::add_command('blocksy demo options', function ($args) {
22
  $options = new DemoInstallOptionsInstaller([
23
  'has_streaming' => false,
@@ -77,6 +72,104 @@ class Cli {
77
 
78
  $options->import();
79
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
80
  }
81
  }
82
 
2
 
3
  namespace Blocksy;
4
 
5
+ add_action('blocksy:customizer:load:before', function () {
6
+ $_REQUEST['wp_customize'] = 'on';
7
+ _wp_customize_include();
8
+
9
+ global $wp_customize;
10
+
11
+ $wp_customize->wp_loaded();
12
+ });
13
+
14
  class Cli {
15
  public function __construct() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  \WP_CLI::add_command('blocksy demo options', function ($args) {
17
  $options = new DemoInstallOptionsInstaller([
18
  'has_streaming' => false,
72
 
73
  $options->import();
74
  });
75
+
76
+ \WP_CLI::add_command('blocksy demo import:start', function ($cli_argv) {
77
+ $args = $this->get_demo_args($cli_argv);
78
+
79
+ Plugin::instance()->demo->set_current_demo(
80
+ $args['demo'] . ':' . $args['builder']
81
+ );
82
+
83
+ $demo_data = Plugin::instance()->demo->fetch_single_demo([
84
+ 'demo' => $args['demo'],
85
+ 'builder' => $args['builder']
86
+ ]);
87
+
88
+ print_r($demo_data);
89
+ });
90
+
91
+ \WP_CLI::add_command('blocksy demo import:plugins', function ($cli_argv) {
92
+ $args = $this->get_demo_args($cli_argv);
93
+
94
+ $demo_data = Plugin::instance()->demo->fetch_single_demo([
95
+ 'demo' => $args['demo'],
96
+ 'builder' => $args['builder']
97
+ ]);
98
+
99
+ $plugins = new DemoInstallPluginsInstaller([
100
+ 'has_streaming' => false,
101
+ 'plugins' => implode(':', $demo_data['plugins'])
102
+ ]);
103
+
104
+ $plugins->import();
105
+ });
106
+
107
+ \WP_CLI::add_command('blocksy demo import:options', function ($cli_argv) {
108
+ $args = $this->get_demo_args($cli_argv);
109
+
110
+ $options = new DemoInstallOptionsInstaller([
111
+ 'has_streaming' => false,
112
+ 'demo_name' => $args['demo'] . ':' . $args['builder']
113
+ ]);
114
+
115
+ $options->import();
116
+ });
117
+
118
+ \WP_CLI::add_command('blocksy demo import:widgets', function ($cli_argv) {
119
+ $args = $this->get_demo_args($cli_argv);
120
+
121
+ $widgets = new DemoInstallWidgetsInstaller([
122
+ 'has_streaming' => false,
123
+ 'demo_name' => $args['demo'] . ':' . $args['builder']
124
+ ]);
125
+
126
+ $widgets->import();
127
+ });
128
+
129
+ \WP_CLI::add_command('blocksy demo import:content', function ($cli_argv) {
130
+ $args = $this->get_demo_args($cli_argv);
131
+
132
+ $content = new DemoInstallContentInstaller([
133
+ 'has_streaming' => false,
134
+ 'demo_name' => $args['demo'] . ':' . $args['builder']
135
+ ]);
136
+
137
+ $content->import();
138
+ });
139
+
140
+ \WP_CLI::add_command('blocksy demo clean', function ($cli_argv) {
141
+ update_option('blocksy_ext_demos_current_demo', null);
142
+
143
+ $eraser = new DemoInstallContentEraser([
144
+ 'has_streaming' => false
145
+ ]);
146
+
147
+ $eraser->import();
148
+ });
149
+
150
+ \WP_CLI::add_command('blocksy demo import:finish', function ($args) {
151
+ $finish = new DemoInstallFinalActions([
152
+ 'has_streaming' => false
153
+ ]);
154
+
155
+ $finish->import();
156
+ });
157
+ }
158
+
159
+ private function get_demo_args($cli_argv) {
160
+ if (empty($cli_argv)) {
161
+ echo 'Please provide demo name.';
162
+ exit;
163
+ }
164
+
165
+ if (! isset($cli_argv[1])) {
166
+ $cli_argv[1] = '';
167
+ }
168
+
169
+ return [
170
+ 'demo' => $cli_argv[0],
171
+ 'builder' => $cli_argv[1]
172
+ ];
173
  }
174
  }
175
 
framework/dashboard.php CHANGED
@@ -105,7 +105,7 @@ class Dashboard {
105
  }
106
 
107
  $result = [
108
- 'is_pro' => blc_fs()->is__premium_only(),
109
  'is_anonymous' => $is_anonymous,
110
  'connect_template' => $connect_template
111
  ];
105
  }
106
 
107
  $result = [
108
+ 'is_pro' => blc_fs()->can_use_premium_code__premium_only(),
109
  'is_anonymous' => $is_anonymous,
110
  'connect_template' => $connect_template
111
  ];
framework/extensions/cookies-consent/static/bundle/main.min.css CHANGED
@@ -1,5 +1,5 @@
1
  /**
2
- * - v1.8.9.5
3
  *
4
  * Copyright (c) 2021
5
  * Licensed GPLv2+
1
  /**
2
+ * - v1.8.9.6
3
  *
4
  * Copyright (c) 2021
5
  * Licensed GPLv2+
framework/extensions/newsletter-subscribe/static/bundle/main.min.css CHANGED
@@ -1,5 +1,5 @@
1
  /**
2
- * - v1.8.9.5
3
  *
4
  * Copyright (c) 2021
5
  * Licensed GPLv2+
1
  /**
2
+ * - v1.8.9.6
3
  *
4
  * Copyright (c) 2021
5
  * Licensed GPLv2+
framework/extensions/product-reviews/static/bundle/main-admin.min.css CHANGED
@@ -1,5 +1,5 @@
1
  /**
2
- * - v1.8.9.5
3
  *
4
  * Copyright (c) 2021
5
  * Licensed GPLv2+
1
  /**
2
+ * - v1.8.9.6
3
  *
4
  * Copyright (c) 2021
5
  * Licensed GPLv2+
framework/extensions/product-reviews/static/bundle/main.min.css CHANGED
@@ -1,5 +1,5 @@
1
  /**
2
- * - v1.8.9.5
3
  *
4
  * Copyright (c) 2021
5
  * Licensed GPLv2+
1
  /**
2
+ * - v1.8.9.6
3
  *
4
  * Copyright (c) 2021
5
  * Licensed GPLv2+
framework/extensions/trending/customizer.php CHANGED
@@ -263,8 +263,7 @@ $options = [
263
  ],
264
  ],
265
 
266
- blc_fs()->is__premium_only() ? [
267
-
268
  'trending_block_location' => [
269
  'label' => __('Display Location', 'blocksy-companion'),
270
  'type' => 'ct-select',
263
  ],
264
  ],
265
 
266
+ blc_fs()->can_use_premium_code__premium_only() ? [
 
267
  'trending_block_location' => [
268
  'label' => __('Display Location', 'blocksy-companion'),
269
  'type' => 'ct-select',
framework/extensions/trending/static/bundle/main.min.css CHANGED
@@ -1,5 +1,5 @@
1
  /**
2
- * - v1.8.9.5
3
  *
4
  * Copyright (c) 2021
5
  * Licensed GPLv2+
1
  /**
2
+ * - v1.8.9.6
3
  *
4
  * Copyright (c) 2021
5
  * Licensed GPLv2+
framework/extensions/widgets/static/bundle/main.min.css CHANGED
@@ -1,5 +1,5 @@
1
  /**
2
- * - v1.8.9.5
3
  *
4
  * Copyright (c) 2021
5
  * Licensed GPLv2+
1
  /**
2
+ * - v1.8.9.6
3
  *
4
  * Copyright (c) 2021
5
  * Licensed GPLv2+
framework/features/account-auth.php ADDED
@@ -0,0 +1,205 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Blocksy;
4
+
5
+ class AccountAuth {
6
+ public function __construct() {
7
+ add_action(
8
+ 'wp_ajax_blc_implement_user_registration',
9
+ [$this, 'blc_implement_user_registration']
10
+ );
11
+
12
+ add_action(
13
+ 'wp_ajax_nopriv_blc_implement_user_registration',
14
+ [$this, 'blc_implement_user_registration']
15
+ );
16
+
17
+ add_action(
18
+ 'wp_ajax_blc_implement_user_lostpassword',
19
+ [$this, 'blc_implement_user_lostpassword']
20
+ );
21
+
22
+ add_action(
23
+ 'wp_ajax_nopriv_blc_implement_user_lostpassword',
24
+ [$this, 'blc_implement_user_lostpassword']
25
+ );
26
+ }
27
+
28
+ public function blc_implement_user_lostpassword() {
29
+ ob_start();
30
+ require_once ABSPATH . 'wp-login.php';
31
+ $res = ob_get_clean();
32
+
33
+ $errors = [];
34
+ $success = false;
35
+
36
+ if (class_exists('WC_Shortcode_My_Account')) {
37
+ $success = \WC_Shortcode_My_Account::retrieve_password();
38
+
39
+ if (! $success) {
40
+ $errors = new \WP_Error();
41
+ $notices = wc_get_notices();
42
+
43
+ if (isset($notices['error'])) {
44
+ foreach ($notices['error'] as $notice) {
45
+ $errors->add(
46
+ 'invalidcombo',
47
+ sprintf(
48
+ __('<strong>Error</strong>: %s'),
49
+ $notice['notice']
50
+ )
51
+ );
52
+ }
53
+ }
54
+ }
55
+ } else {
56
+ $errors = retrieve_password();
57
+ $success = ! is_wp_error($errors);
58
+ }
59
+
60
+ if ($success) {
61
+ $errors = new \WP_Error();
62
+
63
+ $errors->add(
64
+ 'confirm',
65
+ sprintf(
66
+ /* translators: %s: Link to the login page. */
67
+ __(
68
+ 'Check your email for the confirmation link, then visit the <a href="%s">login page</a>.',
69
+ 'blocksy-companion'
70
+ ),
71
+ wp_login_url()
72
+ ),
73
+ 'message'
74
+ );
75
+
76
+ $redirect_to = admin_url();
77
+ $errors = apply_filters('wp_login_errors', $errors, $redirect_to);
78
+
79
+ login_header(__('Check your email', 'blocksy-companion'), '', $errors);
80
+
81
+ wp_die();
82
+ }
83
+
84
+ /**
85
+ * Fires before the lost password form.
86
+ *
87
+ * @since 1.5.1
88
+ * @since 5.1.0 Added the `$errors` parameter.
89
+ *
90
+ * @param WP_Error $errors A `WP_Error` object containing any errors generated by using invalid
91
+ * credentials. Note that the error object may not contain any errors.
92
+ */
93
+ do_action( 'lost_password', $errors );
94
+
95
+ login_header(
96
+ __( 'Lost Password' ),
97
+ '<p class="message">' . __( 'Please enter your username or email address. You will receive an email message with instructions on how to reset your password.' ) . '</p>',
98
+ $errors
99
+ );
100
+ }
101
+
102
+ public function blc_implement_user_registration() {
103
+ ob_start();
104
+ require_once ABSPATH . 'wp-login.php';
105
+ $res = ob_get_clean();
106
+
107
+ $_POST['woocommerce-register-nonce'] = '~';
108
+
109
+ $users_can_register = get_option('users_can_register');
110
+
111
+ if (get_option('woocommerce_enable_myaccount_registration') === 'yes') {
112
+ $users_can_register = true;
113
+ }
114
+
115
+ if (! $users_can_register) {
116
+ exit;
117
+ }
118
+
119
+ $user_login = '';
120
+ $user_email = '';
121
+ $user_pass = '';
122
+
123
+ if (isset($_POST['user_login']) && is_string($_POST['user_login'])) {
124
+ $user_login = wp_unslash($_POST['user_login']);
125
+ }
126
+
127
+ if (isset($_POST['user_email']) && is_string($_POST['user_email'])) {
128
+ $user_email = wp_unslash($_POST['user_email']);
129
+ }
130
+
131
+ if (isset($_POST['user_pass']) && is_string($_POST['user_pass'])) {
132
+ $user_pass = wp_unslash($_POST['user_pass']);
133
+ }
134
+
135
+ if (function_exists('wc_create_new_customer')) {
136
+ $validation_error = new \WP_Error();
137
+ $validation_error = apply_filters(
138
+ 'woocommerce_process_registration_errors',
139
+ $validation_error,
140
+ $user_login,
141
+ $user_pass,
142
+ $user_email
143
+ );
144
+
145
+ $errors = wc_create_new_customer(
146
+ sanitize_email($user_email),
147
+ wc_clean($user_login),
148
+ $user_pass
149
+ );
150
+ } else {
151
+ $errors = register_new_user($user_login, $user_email);
152
+ }
153
+
154
+ if (! is_wp_error($errors)) {
155
+ $errors = new \WP_Error();
156
+
157
+ if (function_exists('wc_create_new_customer')) {
158
+ $error_message = sprintf(
159
+ __(
160
+ 'Your account was created successfully. Your login details have been sent to your email address. Please visit the <a href="%s">login page</a>.',
161
+ 'blocksy-companion'
162
+ ),
163
+ wp_login_url()
164
+ );
165
+
166
+ if ( 'yes' === get_option( 'woocommerce_registration_generate_password' ) ) {
167
+ $error_message = sprintf(
168
+ __(
169
+ 'Your account was created successfully and a password has been sent to your email address. Please visit the <a href="%s">login page</a>.',
170
+ 'blocksy-companion'
171
+ ),
172
+ wp_login_url()
173
+ );
174
+ }
175
+
176
+ $errors->add('registered', $error_message, 'message');
177
+ } else {
178
+ $errors->add(
179
+ 'registered',
180
+ sprintf(
181
+ /* translators: %s: Link to the login page. */
182
+ __( 'Registration complete. Please check your email, then visit the <a href="%s">login page</a>.' ),
183
+ wp_login_url()
184
+ ),
185
+ 'message'
186
+ );
187
+ }
188
+
189
+ $redirect_to = admin_url();
190
+ $errors = apply_filters('wp_login_errors', $errors, $redirect_to);
191
+
192
+ login_header(__('Check your email', 'blocksy-companion'), '', $errors);
193
+
194
+ wp_die();
195
+ }
196
+
197
+ login_header(
198
+ __('Registration Form', 'blocksy-companion'),
199
+ '<p class="message register">' . __('Register For This Site', 'blocksy-companion') . '</p>',
200
+ $errors
201
+ );
202
+
203
+ wp_die();
204
+ }
205
+ }
framework/features/demo-install/content-eraser.php CHANGED
@@ -3,8 +3,20 @@
3
  namespace Blocksy;
4
 
5
  class DemoInstallContentEraser {
 
 
 
 
 
 
 
 
 
 
6
  public function import() {
7
- Plugin::instance()->demo->start_streaming();
 
 
8
 
9
  if (! current_user_can('edit_theme_options')) {
10
  /*
@@ -24,19 +36,23 @@ class DemoInstallContentEraser {
24
  $this->reset_previous_terms();
25
  $this->reset_menus();
26
 
27
- Plugin::instance()->demo->emit_sse_message([
28
- 'action' => 'complete',
29
- 'error' => false,
30
- ]);
 
31
 
32
- exit;
 
33
  }
34
 
35
  private function reset_previous_posts() {
36
- Plugin::instance()->demo->emit_sse_message([
37
- 'action' => 'erase_previous_posts',
38
- 'error' => false,
39
- ]);
 
 
40
 
41
  global $wpdb;
42
 
@@ -54,10 +70,12 @@ class DemoInstallContentEraser {
54
  }
55
 
56
  private function reset_previous_terms() {
57
- Plugin::instance()->demo->emit_sse_message([
58
- 'action' => 'erase_previous_terms',
59
- 'error' => false,
60
- ]);
 
 
61
 
62
  global $wpdb;
63
 
@@ -79,10 +97,12 @@ class DemoInstallContentEraser {
79
  }
80
 
81
  private function erase_default_pages() {
82
- Plugin::instance()->demo->emit_sse_message([
83
- 'action' => 'erase_default_pages',
84
- 'error' => false,
85
- ]);
 
 
86
 
87
  $sample_page = get_page_by_path('sample-page', OBJECT, 'page');
88
  $hello_world_post = get_page_by_path('hello-world', OBJECT, 'post');
@@ -99,10 +119,12 @@ class DemoInstallContentEraser {
99
  private function reset_customizer() {
100
  global $wp_customize;
101
 
102
- Plugin::instance()->demo->emit_sse_message([
103
- 'action' => 'erase_customizer_settings',
104
- 'error' => false,
105
- ]);
 
 
106
 
107
  if (! $wp_customize) {
108
  return;
@@ -115,15 +137,17 @@ class DemoInstallContentEraser {
115
  continue;
116
  }
117
 
118
- remove_theme_mod( $single_setting->id );
119
  }
120
  }
121
 
122
  private function reset_widgets_data() {
123
- Plugin::instance()->demo->emit_sse_message([
124
- 'action' => 'erase_widgets_data',
125
- 'error' => false,
126
- ]);
 
 
127
 
128
  $sidebars_widgets = get_option('sidebars_widgets', array());
129
 
@@ -176,4 +200,3 @@ class DemoInstallContentEraser {
176
  }
177
  }
178
 
179
-
3
  namespace Blocksy;
4
 
5
  class DemoInstallContentEraser {
6
+ protected $has_streaming = true;
7
+
8
+ public function __construct($args = []) {
9
+ $args = wp_parse_args($args, [
10
+ 'has_streaming' => true
11
+ ]);
12
+
13
+ $this->has_streaming = $args['has_streaming'];
14
+ }
15
+
16
  public function import() {
17
+ if ($this->has_streaming) {
18
+ Plugin::instance()->demo->start_streaming();
19
+ }
20
 
21
  if (! current_user_can('edit_theme_options')) {
22
  /*
36
  $this->reset_previous_terms();
37
  $this->reset_menus();
38
 
39
+ if ($this->has_streaming) {
40
+ Plugin::instance()->demo->emit_sse_message([
41
+ 'action' => 'complete',
42
+ 'error' => false,
43
+ ]);
44
 
45
+ exit;
46
+ }
47
  }
48
 
49
  private function reset_previous_posts() {
50
+ if ($this->has_streaming) {
51
+ Plugin::instance()->demo->emit_sse_message([
52
+ 'action' => 'erase_previous_posts',
53
+ 'error' => false,
54
+ ]);
55
+ }
56
 
57
  global $wpdb;
58
 
70
  }
71
 
72
  private function reset_previous_terms() {
73
+ if ($this->has_streaming) {
74
+ Plugin::instance()->demo->emit_sse_message([
75
+ 'action' => 'erase_previous_terms',
76
+ 'error' => false,
77
+ ]);
78
+ }
79
 
80
  global $wpdb;
81
 
97
  }
98
 
99
  private function erase_default_pages() {
100
+ if ($this->has_streaming) {
101
+ Plugin::instance()->demo->emit_sse_message([
102
+ 'action' => 'erase_default_pages',
103
+ 'error' => false,
104
+ ]);
105
+ }
106
 
107
  $sample_page = get_page_by_path('sample-page', OBJECT, 'page');
108
  $hello_world_post = get_page_by_path('hello-world', OBJECT, 'post');
119
  private function reset_customizer() {
120
  global $wp_customize;
121
 
122
+ if ($this->has_streaming) {
123
+ Plugin::instance()->demo->emit_sse_message([
124
+ 'action' => 'erase_customizer_settings',
125
+ 'error' => false,
126
+ ]);
127
+ }
128
 
129
  if (! $wp_customize) {
130
  return;
137
  continue;
138
  }
139
 
140
+ remove_theme_mod($single_setting->id);
141
  }
142
  }
143
 
144
  private function reset_widgets_data() {
145
+ if ($this->has_streaming) {
146
+ Plugin::instance()->demo->emit_sse_message([
147
+ 'action' => 'erase_widgets_data',
148
+ 'error' => false,
149
+ ]);
150
+ }
151
 
152
  $sidebars_widgets = get_option('sidebars_widgets', array());
153
 
200
  }
201
  }
202
 
 
framework/features/demo-install/install-finish.php CHANGED
@@ -3,15 +3,27 @@
3
  namespace Blocksy;
4
 
5
  class DemoInstallFinalActions {
6
- public function import() {
7
- Plugin::instance()->demo->start_streaming();
8
 
9
- if (! current_user_can('edit_theme_options')) {
10
- Plugin::instance()->demo->emit_sse_message([
11
- 'action' => 'complete',
12
- 'error' => false,
13
- ]);
14
- exit;
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  }
16
 
17
  $wpforms_settings = get_option('wpforms_settings', []);
@@ -20,11 +32,14 @@ class DemoInstallFinalActions {
20
 
21
  $this->replace_urls();
22
 
 
23
  do_action('blocksy:dynamic-css:refresh-caches');
24
  Plugin::instance()->cache_manager->run_cache_purge();
25
 
26
  if (class_exists('WC_REST_System_Status_Tools_V2_Controller')) {
27
- define('WP_CLI', true);
 
 
28
 
29
  $s = new \WC_REST_System_Status_Tools_V2_Controller();
30
 
@@ -62,11 +77,13 @@ class DemoInstallFinalActions {
62
  }
63
  }
64
 
65
- Plugin::instance()->demo->emit_sse_message([
66
- 'action' => 'complete',
67
- 'error' => false,
68
- ]);
69
- exit;
 
 
70
  }
71
 
72
  /**
3
  namespace Blocksy;
4
 
5
  class DemoInstallFinalActions {
6
+ protected $has_streaming = true;
 
7
 
8
+ public function __construct($args = []) {
9
+ $args = wp_parse_args($args, [
10
+ 'has_streaming' => true
11
+ ]);
12
+
13
+ $this->has_streaming = $args['has_streaming'];
14
+ }
15
+
16
+ public function import() {
17
+ if ($this->has_streaming) {
18
+ Plugin::instance()->demo->start_streaming();
19
+
20
+ if (! current_user_can('edit_theme_options')) {
21
+ Plugin::instance()->demo->emit_sse_message([
22
+ 'action' => 'complete',
23
+ 'error' => false,
24
+ ]);
25
+ exit;
26
+ }
27
  }
28
 
29
  $wpforms_settings = get_option('wpforms_settings', []);
32
 
33
  $this->replace_urls();
34
 
35
+ do_action('customize_save_after');
36
  do_action('blocksy:dynamic-css:refresh-caches');
37
  Plugin::instance()->cache_manager->run_cache_purge();
38
 
39
  if (class_exists('WC_REST_System_Status_Tools_V2_Controller')) {
40
+ if (! defined('WP_CLI')) {
41
+ define('WP_CLI', true);
42
+ }
43
 
44
  $s = new \WC_REST_System_Status_Tools_V2_Controller();
45
 
77
  }
78
  }
79
 
80
+ if ($this->has_streaming) {
81
+ Plugin::instance()->demo->emit_sse_message([
82
+ 'action' => 'complete',
83
+ 'error' => false,
84
+ ]);
85
+ exit;
86
+ }
87
  }
88
 
89
  /**
framework/features/demo-install/required-plugins.php CHANGED
@@ -70,6 +70,7 @@ class DemoInstallPluginsInstaller {
70
  }
71
 
72
  $plugins_manager->prepare_install($single_plugin);
 
73
  echo $single_plugin;
74
 
75
  if ($this->has_streaming) {
70
  }
71
 
72
  $plugins_manager->prepare_install($single_plugin);
73
+
74
  echo $single_plugin;
75
 
76
  if ($this->has_streaming) {
framework/features/header.php CHANGED
@@ -551,15 +551,29 @@ class HeaderAdditions {
551
 
552
  $body = json_decode(file_get_contents('php://input'), true);
553
 
 
 
 
 
 
 
554
  if ($body && isset($body['current_url'])) {
555
  $url = $body['current_url'];
556
  }
557
 
 
 
 
 
 
 
558
  $html = blc_call_fn(
559
  ['fn' => 'blocksy_render_view'],
560
  dirname(__FILE__) . '/header/account-modal.php',
561
  [
562
- 'current_url' => $url
 
 
563
  ]
564
  );
565
 
551
 
552
  $body = json_decode(file_get_contents('php://input'), true);
553
 
554
+ $header_id = null;
555
+
556
+ if (isset($_REQUEST['header_id'])) {
557
+ $header_id = $_REQUEST['header_id'];
558
+ }
559
+
560
  if ($body && isset($body['current_url'])) {
561
  $url = $body['current_url'];
562
  }
563
 
564
+ $render = new \Blocksy_Header_Builder_Render([
565
+ 'current_section_id' => $header_id
566
+ ]);
567
+
568
+ $atts = $render->get_item_data_for('account');
569
+
570
  $html = blc_call_fn(
571
  ['fn' => 'blocksy_render_view'],
572
  dirname(__FILE__) . '/header/account-modal.php',
573
  [
574
+ 'current_url' => $url,
575
+ 'header_id' => $header_id,
576
+ 'atts' => $atts
577
  ]
578
  );
579
 
framework/features/header/account-modal.php CHANGED
@@ -28,11 +28,13 @@ foreach ($form_views as $form_key => $value) {
28
  );
29
  }
30
 
 
 
31
  ?>
32
 
33
  <div id="account-modal" class="ct-panel" data-behaviour="modal">
34
  <div class="ct-panel-actions">
35
- <span class="ct-close-button">
36
  <svg class="ct-icon" width="12" height="12" viewBox="0 0 15 15">
37
  <path d="M1 15a1 1 0 01-.71-.29 1 1 0 010-1.41l5.8-5.8-5.8-5.8A1 1 0 011.7.29l5.8 5.8 5.8-5.8a1 1 0 011.41 1.41l-5.8 5.8 5.8 5.8a1 1 0 01-1.41 1.41l-5.8-5.8-5.8 5.8A1 1 0 011 15z"/>
38
  </svg>
@@ -73,4 +75,3 @@ foreach ($form_views as $form_key => $value) {
73
  </div>
74
  </div>
75
  </div>
76
-
28
  );
29
  }
30
 
31
+ $close_button_type = blocksy_akg('account_close_button_type', $atts, 'type-1');
32
+
33
  ?>
34
 
35
  <div id="account-modal" class="ct-panel" data-behaviour="modal">
36
  <div class="ct-panel-actions">
37
+ <span class="ct-close-button" data-type="<?php echo $close_button_type ?>">
38
  <svg class="ct-icon" width="12" height="12" viewBox="0 0 15 15">
39
  <path d="M1 15a1 1 0 01-.71-.29 1 1 0 010-1.41l5.8-5.8-5.8-5.8A1 1 0 011.7.29l5.8 5.8 5.8-5.8a1 1 0 011.41 1.41l-5.8 5.8 5.8 5.8a1 1 0 01-1.41 1.41l-5.8-5.8-5.8 5.8A1 1 0 011 15z"/>
40
  </svg>
75
  </div>
76
  </div>
77
  </div>
 
framework/features/header/items/account/dynamic-styles.php CHANGED
@@ -541,6 +541,7 @@ if ($forms_type !== 'classic-forms' || is_customize_preview()) {
541
  ]);
542
  }
543
 
 
544
 
545
  blocksy_output_colors([
546
  'value' => blocksy_akg('account_close_button_color', $atts),
@@ -581,41 +582,87 @@ blocksy_output_colors([
581
  ],
582
  ]);
583
 
584
- blocksy_output_colors([
585
- 'value' => blocksy_akg('account_close_button_shape_color', $atts),
586
- 'default' => [
587
- 'default' => [ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT') ],
588
- 'hover' => [ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT') ],
589
- ],
590
- 'css' => $css,
591
 
592
- 'variables' => [
 
 
593
  'default' => [
594
- 'selector' => blc_call_fn([
595
- 'fn' => 'blocksy_assemble_selector',
596
- 'default' => $root_selector
597
- ], blc_call_fn([
598
- 'fn' => 'blocksy_mutate_selector',
599
- ], [
600
- 'selector' => [$root_selector[0]],
601
- 'operation' => 'suffix',
602
- 'to_add' => '#account-modal .ct-close-button'
603
- ])),
604
- 'variable' => 'closeButtonBackground'
605
  ],
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
606
 
607
- 'hover' => [
608
- 'selector' => blc_call_fn([
609
- 'fn' => 'blocksy_assemble_selector',
610
- 'default' => $root_selector
611
- ], blc_call_fn([
612
- 'fn' => 'blocksy_mutate_selector',
613
- ], [
614
- 'selector' => [$root_selector[0]],
615
- 'operation' => 'suffix',
616
- 'to_add' => '#account-modal .ct-close-button'
617
- ])),
618
- 'variable' => 'closeButtonHoverBackground'
619
- ]
620
- ],
621
- ]);
541
  ]);
542
  }
543
 
544
+ $close_button_type = blocksy_akg('account_close_button_type', $atts, 'type-1');
545
 
546
  blocksy_output_colors([
547
  'value' => blocksy_akg('account_close_button_color', $atts),
582
  ],
583
  ]);
584
 
 
 
 
 
 
 
 
585
 
586
+ if (is_customize_preview() || $close_button_type === 'type-2') {
587
+ blocksy_output_colors([
588
+ 'value' => blocksy_akg('account_close_button_border_color', $atts),
589
  'default' => [
590
+ 'default' => [ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT') ],
591
+ 'hover' => [ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT') ],
 
 
 
 
 
 
 
 
 
592
  ],
593
+ 'css' => $css,
594
+
595
+ 'variables' => [
596
+ 'default' => [
597
+ 'selector' => blc_call_fn([
598
+ 'fn' => 'blocksy_assemble_selector',
599
+ 'default' => $root_selector
600
+ ], blc_call_fn([
601
+ 'fn' => 'blocksy_mutate_selector',
602
+ ], [
603
+ 'selector' => [$root_selector[0]],
604
+ 'operation' => 'suffix',
605
+ 'to_add' => '#account-modal .ct-close-button'
606
+ ])),
607
+ 'variable' => 'close-button-border-color'
608
+ ],
609
+
610
+ 'hover' => [
611
+ 'selector' => blc_call_fn([
612
+ 'fn' => 'blocksy_assemble_selector',
613
+ 'default' => $root_selector
614
+ ], blc_call_fn([
615
+ 'fn' => 'blocksy_mutate_selector',
616
+ ], [
617
+ 'selector' => [$root_selector[0]],
618
+ 'operation' => 'suffix',
619
+ 'to_add' => '#account-modal .ct-close-button'
620
+ ])),
621
+ 'variable' => 'close-button-hover-border-color'
622
+ ]
623
+ ],
624
+ ]);
625
+ }
626
+
627
+ if (is_customize_preview() || $close_button_type === 'type-3') {
628
+
629
+ blocksy_output_colors([
630
+ 'value' => blocksy_akg('account_close_button_shape_color', $atts),
631
+ 'default' => [
632
+ 'default' => [ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT') ],
633
+ 'hover' => [ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT') ],
634
+ ],
635
+ 'css' => $css,
636
+
637
+ 'variables' => [
638
+ 'default' => [
639
+ 'selector' => blc_call_fn([
640
+ 'fn' => 'blocksy_assemble_selector',
641
+ 'default' => $root_selector
642
+ ], blc_call_fn([
643
+ 'fn' => 'blocksy_mutate_selector',
644
+ ], [
645
+ 'selector' => [$root_selector[0]],
646
+ 'operation' => 'suffix',
647
+ 'to_add' => '#account-modal .ct-close-button'
648
+ ])),
649
+ 'variable' => 'close-button-background'
650
+ ],
651
+
652
+ 'hover' => [
653
+ 'selector' => blc_call_fn([
654
+ 'fn' => 'blocksy_assemble_selector',
655
+ 'default' => $root_selector
656
+ ], blc_call_fn([
657
+ 'fn' => 'blocksy_mutate_selector',
658
+ ], [
659
+ 'selector' => [$root_selector[0]],
660
+ 'operation' => 'suffix',
661
+ 'to_add' => '#account-modal .ct-close-button'
662
+ ])),
663
+ 'variable' => 'close-button-hover-background'
664
+ ]
665
+ ],
666
+ ]);
667
+ }
668
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
framework/features/header/items/account/options.php CHANGED
@@ -935,6 +935,36 @@ $options = [
935
  ],
936
  ],
937
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
938
  'account_form_shadow' => [
939
  'label' => __( 'Modal Shadow', 'blocksy-companion' ),
940
  'type' => 'ct-box-shadow',
@@ -954,11 +984,27 @@ $options = [
954
  ])
955
  ],
956
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
957
  'account_close_button_color' => [
958
- 'label' => __( 'Close Icon Color', 'blocksy-companion' ),
959
  'type' => 'ct-color-picker',
960
  'design' => 'inline',
961
- 'divider' => 'top',
962
  'setting' => [ 'transport' => 'postMessage' ],
963
 
964
  'value' => [
@@ -986,65 +1032,87 @@ $options = [
986
  ],
987
  ],
988
 
989
- 'account_close_button_shape_color' => [
990
- 'label' => __( 'Close Icon Background', 'blocksy-companion' ),
991
- 'type' => 'ct-color-picker',
992
- 'design' => 'inline',
993
- 'setting' => [ 'transport' => 'postMessage' ],
994
 
995
- 'value' => [
996
- 'default' => [
997
- 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
998
- ],
 
999
 
1000
- 'hover' => [
1001
- 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
1002
- ],
1003
- ],
1004
 
1005
- 'pickers' => [
1006
- [
1007
- 'title' => __( 'Initial', 'blocksy-companion' ),
1008
- 'id' => 'default',
1009
- 'inherit' => 'rgba(0, 0, 0, 0.5)'
1010
- ],
1011
 
1012
- [
1013
- 'title' => __( 'Hover', 'blocksy-companion' ),
1014
- 'id' => 'hover',
1015
- 'inherit' => 'rgba(0, 0, 0, 0.5)'
 
 
 
 
 
 
 
 
 
1016
  ],
 
1017
  ],
1018
  ],
1019
 
1020
- 'accountHeaderFormBackground' => [
1021
- 'label' => __( 'Modal Background', 'blocksy-companion' ),
1022
- 'type' => 'ct-background',
1023
- 'design' => 'inline',
1024
- 'divider' => 'top',
1025
- 'setting' => [ 'transport' => 'postMessage' ],
1026
- 'value' => blocksy_background_default_value([
1027
- 'backgroundColor' => [
1028
- 'default' => [
1029
- 'color' => '#ffffff'
 
 
 
 
 
 
 
 
 
1030
  ],
1031
- ],
1032
- ])
1033
- ],
1034
 
1035
- 'accountHeaderBackground' => [
1036
- 'label' => __( 'Modal Backdrop', 'blocksy-companion' ),
1037
- 'type' => 'ct-background',
1038
- 'design' => 'inline',
1039
- 'divider' => 'top',
1040
- 'setting' => [ 'transport' => 'postMessage' ],
1041
- 'value' => blocksy_background_default_value([
1042
- 'backgroundColor' => [
1043
- 'default' => [
1044
- 'color' => 'rgba(18, 21, 25, 0.6)'
 
 
1045
  ],
1046
  ],
1047
- ])
 
 
 
 
 
 
1048
  ],
1049
 
1050
  ],
935
  ],
936
  ],
937
 
938
+ 'accountHeaderFormBackground' => [
939
+ 'label' => __( 'Modal Background', 'blocksy-companion' ),
940
+ 'type' => 'ct-background',
941
+ 'design' => 'inline',
942
+ 'divider' => 'top',
943
+ 'setting' => [ 'transport' => 'postMessage' ],
944
+ 'value' => blocksy_background_default_value([
945
+ 'backgroundColor' => [
946
+ 'default' => [
947
+ 'color' => '#ffffff'
948
+ ],
949
+ ],
950
+ ])
951
+ ],
952
+
953
+ 'accountHeaderBackground' => [
954
+ 'label' => __( 'Modal Backdrop', 'blocksy-companion' ),
955
+ 'type' => 'ct-background',
956
+ 'design' => 'inline',
957
+ 'divider' => 'top',
958
+ 'setting' => [ 'transport' => 'postMessage' ],
959
+ 'value' => blocksy_background_default_value([
960
+ 'backgroundColor' => [
961
+ 'default' => [
962
+ 'color' => 'rgba(18, 21, 25, 0.6)'
963
+ ],
964
+ ],
965
+ ])
966
+ ],
967
+
968
  'account_form_shadow' => [
969
  'label' => __( 'Modal Shadow', 'blocksy-companion' ),
970
  'type' => 'ct-box-shadow',
984
  ])
985
  ],
986
 
987
+ 'account_close_button_type' => [
988
+ 'label' => __('Close Button Type', 'blocksy-companion'),
989
+ 'type' => 'ct-select',
990
+ 'value' => 'type-1',
991
+ 'view' => 'text',
992
+ 'design' => 'inline',
993
+ 'divider' => 'top',
994
+ 'setting' => [ 'transport' => 'postMessage' ],
995
+ 'choices' => blocksy_ordered_keys(
996
+ [
997
+ 'type-1' => __( 'Simple', 'blocksy-companion' ),
998
+ 'type-2' => __( 'Border', 'blocksy-companion' ),
999
+ 'type-3' => __( 'Background', 'blocksy-companion' ),
1000
+ ]
1001
+ ),
1002
+ ],
1003
+
1004
  'account_close_button_color' => [
1005
+ 'label' => __( 'Icon Color', 'blocksy-companion' ),
1006
  'type' => 'ct-color-picker',
1007
  'design' => 'inline',
 
1008
  'setting' => [ 'transport' => 'postMessage' ],
1009
 
1010
  'value' => [
1032
  ],
1033
  ],
1034
 
1035
+ blocksy_rand_md5() => [
1036
+ 'type' => 'ct-condition',
1037
+ 'condition' => [ 'account_close_button_type' => 'type-2' ],
1038
+ 'options' => [
 
1039
 
1040
+ 'account_close_button_border_color' => [
1041
+ 'label' => __( 'Border Color', 'blocksy-companion' ),
1042
+ 'type' => 'ct-color-picker',
1043
+ 'design' => 'inline',
1044
+ 'setting' => [ 'transport' => 'postMessage' ],
1045
 
1046
+ 'value' => [
1047
+ 'default' => [
1048
+ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
1049
+ ],
1050
 
1051
+ 'hover' => [
1052
+ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
1053
+ ],
1054
+ ],
 
 
1055
 
1056
+ 'pickers' => [
1057
+ [
1058
+ 'title' => __( 'Initial', 'blocksy-companion' ),
1059
+ 'id' => 'default',
1060
+ 'inherit' => 'rgba(0, 0, 0, 0.5)'
1061
+ ],
1062
+
1063
+ [
1064
+ 'title' => __( 'Hover', 'blocksy-companion' ),
1065
+ 'id' => 'hover',
1066
+ 'inherit' => 'rgba(0, 0, 0, 0.5)'
1067
+ ],
1068
+ ],
1069
  ],
1070
+
1071
  ],
1072
  ],
1073
 
1074
+ blocksy_rand_md5() => [
1075
+ 'type' => 'ct-condition',
1076
+ 'condition' => [ 'account_close_button_type' => 'type-3' ],
1077
+ 'options' => [
1078
+
1079
+ 'account_close_button_shape_color' => [
1080
+ 'label' => __( 'Background Color', 'blocksy-companion' ),
1081
+ 'type' => 'ct-color-picker',
1082
+ 'design' => 'inline',
1083
+ 'setting' => [ 'transport' => 'postMessage' ],
1084
+
1085
+ 'value' => [
1086
+ 'default' => [
1087
+ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
1088
+ ],
1089
+
1090
+ 'hover' => [
1091
+ 'color' => Blocksy_Css_Injector::get_skip_rule_keyword('DEFAULT'),
1092
+ ],
1093
  ],
 
 
 
1094
 
1095
+ 'pickers' => [
1096
+ [
1097
+ 'title' => __( 'Initial', 'blocksy-companion' ),
1098
+ 'id' => 'default',
1099
+ 'inherit' => 'rgba(0, 0, 0, 0.5)'
1100
+ ],
1101
+
1102
+ [
1103
+ 'title' => __( 'Hover', 'blocksy-companion' ),
1104
+ 'id' => 'hover',
1105
+ 'inherit' => 'rgba(0, 0, 0, 0.5)'
1106
+ ],
1107
  ],
1108
  ],
1109
+
1110
+ ],
1111
+ ],
1112
+
1113
+ blocksy_rand_md5() => [
1114
+ 'type' => 'ct-spacer',
1115
+ 'height' => 50
1116
  ],
1117
 
1118
  ],
framework/features/header/items/account/sync.js CHANGED
@@ -153,16 +153,30 @@ ctEvents.on(
153
  },
154
  ],
155
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
156
  account_close_button_shape_color: [
157
  {
158
  selector: '#account-modal .ct-close-button',
159
- variable: 'closeButtonBackground',
160
  type: 'color:default',
161
  },
162
 
163
  {
164
  selector: '#account-modal .ct-close-button',
165
- variable: 'closeButtonHoverBackground',
166
  type: 'color:hover',
167
  },
168
  ],
@@ -417,4 +431,26 @@ ctEvents.on('ct:header:sync:item:account', ({ optionId, optionValue }) => {
417
  { onlyView: 'mobile' }
418
  )
419
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
420
  })
153
  },
154
  ],
155
 
156
+ account_close_button_border_color: [
157
+ {
158
+ selector: '#account-modal .ct-close-button',
159
+ variable: 'close-button-border-color',
160
+ type: 'color:default',
161
+ },
162
+
163
+ {
164
+ selector: '#account-modal .ct-close-button',
165
+ variable: 'close-button-hover-border-color',
166
+ type: 'color:hover',
167
+ },
168
+ ],
169
+
170
  account_close_button_shape_color: [
171
  {
172
  selector: '#account-modal .ct-close-button',
173
+ variable: 'close-button-background',
174
  type: 'color:default',
175
  },
176
 
177
  {
178
  selector: '#account-modal .ct-close-button',
179
+ variable: 'close-button-hover-background',
180
  type: 'color:hover',
181
  },
182
  ],
431
  { onlyView: 'mobile' }
432
  )
433
  }
434
+
435
+ if (optionId === 'account_close_button_type') {
436
+ let offcanvasModalClose = document.querySelector(
437
+ '#account-modal .ct-close-button'
438
+ )
439
+
440
+ setTimeout(() => {
441
+ offcanvasModalClose.classList.add('ct-disable-transitions')
442
+
443
+ requestAnimationFrame(() => {
444
+ if (offcanvasModalClose) {
445
+ offcanvasModalClose.dataset.type = optionValue
446
+ }
447
+
448
+ setTimeout(() => {
449
+ offcanvasModalClose.classList.remove(
450
+ 'ct-disable-transitions'
451
+ )
452
+ })
453
+ })
454
+ }, 300)
455
+ }
456
  })
framework/features/header/modal/login.php CHANGED
@@ -1,50 +1,71 @@
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
  ?>
11
 
12
- <form name="loginform" id="loginform" action="<?php echo wp_login_url() ?>" method="post">
13
- <?php do_action('woocommerce_login_form_start'); ?>
14
- <?php do_action('blocksy:account:modal:login:start'); ?>
 
 
 
 
 
 
15
 
16
  <p class="login-username">
17
- <label for="user_login"><?php echo __('Email Address', 'blocksy-companion') ?></label>
 
 
18
  <input type="text" name="log" id="user_login" class="input" value="" size="20">
19
  </p>
20
 
21
  <p class="login-password">
22
- <label for="user_pass"><?php echo __('Password', 'blocksy-companion') ?></label>
 
 
23
  <input type="password" name="pwd" id="user_pass" class="input" value="" size="20">
24
  </p>
25
 
26
  <p class="login-remember col-2">
27
  <label>
28
  <input name="rememberme" type="checkbox" id="rememberme" class="ct-checkbox" value="forever">
29
- <?php echo __('Remember Me', 'blocksy-companion') ?>
 
 
30
  </label>
31
 
32
- <a href="<?php echo wp_lostpassword_url() ?>" class="ct-forgot-password">
33
- <?php echo __('Forgot Password?', 'blocksy-companion') ?>
 
 
 
 
34
  </a>
35
  </p>
36
 
37
- <?php do_action('login_form') ?>
 
 
38
 
39
  <p class="login-submit">
40
  <button name="wp-submit" class="ct-button">
41
- <?php echo __('Log In', 'blocksy-companion') ?>
 
 
42
  </button>
43
 
44
- <input type="hidden" name="redirect_to" value="<?php echo $redirect_to_url ?>">
 
 
45
  </p>
46
 
47
- <?php do_action('blocksy:account:modal:login:end'); ?>
48
- <?php do_action('woocommerce_login_form_end'); ?>
 
 
 
 
49
  </form>
50
 
1
  <?php
2
 
3
  // wp_login_form([]);
4
+ $redirect_to_url = apply_filters( 'blocksy:account:modal:login:redirect_to', $current_url );
 
 
 
 
 
5
  ?>
6
 
7
+ <form name="loginform" id="loginform" action="<?php
8
+ echo wp_login_url() ;
9
+ ?>" method="post">
10
+ <?php
11
+ do_action( 'woocommerce_login_form_start' );
12
+ ?>
13
+ <?php
14
+ do_action( 'blocksy:account:modal:login:start' );
15
+ ?>
16
 
17
  <p class="login-username">
18
+ <label for="user_login"><?php
19
+ echo __( 'Email Address', 'blocksy-companion' ) ;
20
+ ?></label>
21
  <input type="text" name="log" id="user_login" class="input" value="" size="20">
22
  </p>
23
 
24
  <p class="login-password">
25
+ <label for="user_pass"><?php
26
+ echo __( 'Password', 'blocksy-companion' ) ;
27
+ ?></label>
28
  <input type="password" name="pwd" id="user_pass" class="input" value="" size="20">
29
  </p>
30
 
31
  <p class="login-remember col-2">
32
  <label>
33
  <input name="rememberme" type="checkbox" id="rememberme" class="ct-checkbox" value="forever">
34
+ <?php
35
+ echo __( 'Remember Me', 'blocksy-companion' ) ;
36
+ ?>
37
  </label>
38
 
39
+ <a href="<?php
40
+ echo wp_lostpassword_url() ;
41
+ ?>" class="ct-forgot-password">
42
+ <?php
43
+ echo __( 'Forgot Password?', 'blocksy-companion' ) ;
44
+ ?>
45
  </a>
46
  </p>
47
 
48
+ <?php
49
+ do_action( 'login_form' );
50
+ ?>
51
 
52
  <p class="login-submit">
53
  <button name="wp-submit" class="ct-button">
54
+ <?php
55
+ echo __( 'Log In', 'blocksy-companion' ) ;
56
+ ?>
57
  </button>
58
 
59
+ <input type="hidden" name="redirect_to" value="<?php
60
+ echo $redirect_to_url ;
61
+ ?>">
62
  </p>
63
 
64
+ <?php
65
+ do_action( 'blocksy:account:modal:login:end' );
66
+ ?>
67
+ <?php
68
+ do_action( 'woocommerce_login_form_end' );
69
+ ?>
70
  </form>
71
 
framework/features/header/modal/lostpassword.php CHANGED
@@ -6,6 +6,8 @@
6
  <input type="text" name="user_login" id="user_login_forgot" class="input" value="" size="20" autocapitalize="off" required>
7
  </p>
8
 
 
 
9
  <p>
10
  <button name="wp-submit" class="ct-button">
11
  <?php echo __('Get New Password', 'blocksy-companion') ?>
6
  <input type="text" name="user_login" id="user_login_forgot" class="input" value="" size="20" autocapitalize="off" required>
7
  </p>
8
 
9
+ <?php do_action('lostpassword_form'); ?>
10
+
11
  <p>
12
  <button name="wp-submit" class="ct-button">
13
  <?php echo __('Get New Password', 'blocksy-companion') ?>
framework/features/header/modal/register.php CHANGED
@@ -1,32 +1,89 @@
1
- <form name="registerform" id="registerform" action="<?php echo wp_registration_url() ?>" method="post" novalidate="novalidate">
2
- <?php do_action('woocommerce_register_form_start') ?>
3
- <?php do_action('blocksy:account:modal:register:start'); ?>
4
 
5
- <p>
6
- <label for="user_login_register"><?php echo __('Username', 'blocksy-companion') ?></label>
7
- <input type="text" name="user_login" id="user_login_register" class="input" value="" size="20" autocapitalize="off">
8
- </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
 
10
  <p>
11
- <label for="user_email"><?php echo __('Email', 'blocksy-companion') ?></label>
 
 
12
  <input type="email" name="user_email" id="user_email" class="input" value="" size="25">
13
  </p>
14
 
15
- <?php do_action('register_form') ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
 
17
  <p id="reg_passmail">
18
- <?php echo __('Registration confirmation will be emailed to you', 'blocksy-companion') ?>
 
 
19
  </p>
20
 
21
  <p>
22
  <button name="wp-submit" class="ct-button">
23
- <?php echo __('Register', 'blocksy-companion') ?>
 
 
24
  </button>
25
 
26
- <!-- <input type="hidden" name="redirect_to" value="<?php echo blocksy_current_url() ?>"> -->
 
 
27
  </p>
28
 
29
- <?php do_action('blocksy:account:modal:register:end'); ?>
30
- <?php do_action('woocommerce_register_form_end') ?>
 
 
 
 
31
  </form>
32
 
1
+ <?php
 
 
2
 
3
+ $has_username = true;
4
+ $has_password = false;
5
+ if ( function_exists( 'wc_create_new_customer' ) && 'no' !== get_option( 'woocommerce_registration_generate_username' ) ) {
6
+ $has_username = false;
7
+ }
8
+ if ( function_exists( 'wc_create_new_customer' ) && 'no' === get_option( 'woocommerce_registration_generate_password' ) ) {
9
+ $has_password = true;
10
+ }
11
+ ?>
12
+
13
+ <form name="registerform" id="registerform" action="<?php
14
+ echo wp_registration_url() ;
15
+ ?>" method="post" novalidate="novalidate">
16
+ <?php
17
+ do_action( 'woocommerce_register_form_start' );
18
+ ?>
19
+ <?php
20
+ do_action( 'blocksy:account:modal:register:start' );
21
+ ?>
22
+
23
+ <?php
24
+
25
+ if ( $has_username ) {
26
+ ?>
27
+ <p>
28
+ <label for="user_login_register"><?php
29
+ echo __( 'Username', 'blocksy-companion' ) ;
30
+ ?></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
+
36
+ ?>
37
 
38
  <p>
39
+ <label for="user_email"><?php
40
+ echo __( 'Email', 'blocksy-companion' ) ;
41
+ ?></label>
42
  <input type="email" name="user_email" id="user_email" class="input" value="" size="25">
43
  </p>
44
 
45
+ <?php
46
+
47
+ if ( $has_password ) {
48
+ ?>
49
+ <p>
50
+ <label for="user_pass_register"><?php
51
+ echo __( 'Password', 'blocksy-companion' ) ;
52
+ ?></label>
53
+ <input type="password" name="user_pass" id="user_pass_register" class="input" value="" size="20" autocapitalize="off" autocomplete="new-password">
54
+ </p>
55
+ <?php
56
+ }
57
+
58
+ ?>
59
+
60
+ <?php
61
+ do_action( 'register_form' );
62
+ ?>
63
 
64
  <p id="reg_passmail">
65
+ <?php
66
+ echo __( 'Registration confirmation will be emailed to you', 'blocksy-companion' ) ;
67
+ ?>
68
  </p>
69
 
70
  <p>
71
  <button name="wp-submit" class="ct-button">
72
+ <?php
73
+ echo __( 'Register', 'blocksy-companion' ) ;
74
+ ?>
75
  </button>
76
 
77
+ <!-- <input type="hidden" name="redirect_to" value="<?php
78
+ echo blocksy_current_url() ;
79
+ ?>"> -->
80
  </p>
81
 
82
+ <?php
83
+ do_action( 'blocksy:account:modal:register:end' );
84
+ ?>
85
+ <?php
86
+ do_action( 'woocommerce_register_form_end' );
87
+ ?>
88
  </form>
89
 
framework/helpers/blocksy-integration.php CHANGED
@@ -169,7 +169,7 @@ if (! function_exists('blocksy_attr_to_html')) {
169
  continue;
170
  }
171
 
172
- $html_attr .= $attr_name . '="' . htmlspecialchars($attr_val) . '" ';
173
  }
174
 
175
  return $html_attr;
169
  continue;
170
  }
171
 
172
+ $html_attr .= $attr_name . '="' . $attr_val . '" ';
173
  }
174
 
175
  return $html_attr;
framework/theme-integration.php CHANGED
@@ -4,16 +4,6 @@ namespace Blocksy;
4
 
5
  class ThemeIntegration {
6
  public function __construct() {
7
- add_action(
8
- 'wp_ajax_blc_implement_user_registration',
9
- [$this, 'blc_implement_user_registration']
10
- );
11
-
12
- add_action(
13
- 'wp_ajax_nopriv_blc_implement_user_registration',
14
- [$this, 'blc_implement_user_registration']
15
- );
16
-
17
  add_filter('blocksy:frontend:dynamic-js-chunks', function ($chunks) {
18
  $chunks[] = [
19
  'id' => 'blocksy_account',
@@ -365,7 +355,7 @@ class ThemeIntegration {
365
  }
366
 
367
  if (
368
- blc_fs()->is__premium_only()
369
  &&
370
  BLOCKSY_PATH . '/framework/premium/changelog.txt'
371
  ) {
@@ -454,66 +444,5 @@ class ThemeIntegration {
454
  'orientation' => ($width > $height) ? 'landscape' : 'portrait'
455
  );
456
  }
457
-
458
- public function blc_implement_user_registration() {
459
- ob_start();
460
- require_once ABSPATH . 'wp-login.php';
461
- $res = ob_get_clean();
462
-
463
- $users_can_register = get_option('users_can_register');
464
-
465
- if (get_option('woocommerce_enable_myaccount_registration') === 'yes') {
466
- $users_can_register = true;
467
- }
468
-
469
- if (! $users_can_register) {
470
- exit;
471
- }
472
-
473
- $user_login = '';
474
- $user_email = '';
475
-
476
- if (
477
- isset($_POST['user_login'])
478
- &&
479
- is_string($_POST['user_login'])
480
- ) {
481
- $user_login = wp_unslash( $_POST['user_login'] );
482
- }
483
-
484
- if (isset($_POST['user_email']) && is_string($_POST['user_email'])) {
485
- $user_email = wp_unslash( $_POST['user_email'] );
486
- }
487
-
488
- $errors = register_new_user($user_login, $user_email);
489
-
490
- if (! is_wp_error($errors)) {
491
- $errors = new \WP_Error();
492
-
493
- $errors->add(
494
- 'registered',
495
- sprintf(
496
- /* translators: %s: Link to the login page. */
497
- __( 'Registration complete. Please check your email, then visit the <a href="%s">login page</a>.' ),
498
- wp_login_url()
499
- ),
500
- 'message'
501
- );
502
-
503
- $redirect_to = admin_url();
504
- $errors = apply_filters('wp_login_errors', $errors, $redirect_to);
505
-
506
- login_header(__('Check your email', 'blocksy-companion'), '', $errors);
507
-
508
- wp_die();
509
- }
510
-
511
- login_header(
512
- __('Registration Form', 'blocksy-companion'),
513
- '<p class="message register">' . __('Register For This Site', 'blocksy-companion') . '</p>',
514
- $errors
515
- );
516
-
517
- wp_die();
518
- }
519
  }
 
4
 
5
  class ThemeIntegration {
6
  public function __construct() {
 
 
 
 
 
 
 
 
 
 
7
  add_filter('blocksy:frontend:dynamic-js-chunks', function ($chunks) {
8
  $chunks[] = [
9
  'id' => 'blocksy_account',
355
  }
356
 
357
  if (
358
+ blc_fs()->can_use_premium_code__premium_only()
359
  &&
360
  BLOCKSY_PATH . '/framework/premium/changelog.txt'
361
  ) {
444
  'orientation' => ($width > $height) ? 'landscape' : 'portrait'
445
  );
446
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
447
  }
448
+
freemius/includes/class-freemius.php CHANGED
@@ -1,25364 +1,25395 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.0.3
7
- */
8
- if ( ! defined( 'ABSPATH' ) ) {
9
- exit;
10
- }
11
-
12
- // "final class"
13
- class Freemius extends Freemius_Abstract {
14
- /**
15
- * SDK Version
16
- *
17
- * @var string
18
- */
19
- public $version = WP_FS__SDK_VERSION;
20
-
21
- #region Plugin Info
22
-
23
- /**
24
- * @since 1.0.1
25
- *
26
- * @var string
27
- */
28
- private $_slug;
29
-
30
- /**
31
- * @since 1.0.0
32
- *
33
- * @var string
34
- */
35
- private $_plugin_basename;
36
- /**
37
- * @since 2.2.1
38
- *
39
- * @var string
40
- */
41
- private $_premium_plugin_basename;
42
- /**
43
- * @since 1.0.0
44
- *
45
- * @var string
46
- */
47
- private $_free_plugin_basename;
48
- /**
49
- * @since 1.0.0
50
- *
51
- * @var string
52
- */
53
- private $_plugin_dir_path;
54
- /**
55
- * @since 1.0.0
56
- *
57
- * @var string
58
- */
59
- private $_plugin_dir_name;
60
- /**
61
- * @since 1.0.0
62
- *
63
- * @var string
64
- */
65
- private $_plugin_main_file_path;
66
- /**
67
- * @var string[]
68
- */
69
- private $_plugin_data;
70
- /**
71
- * @since 1.0.9
72
- *
73
- * @var string
74
- */
75
- private $_plugin_name;
76
- /**
77
- * @since 1.2.2
78
- *
79
- * @var string
80
- */
81
- private $_module_type;
82
-
83
- #endregion Plugin Info
84
-
85
- /**
86
- * @since 1.0.9
87
- *
88
- * @var bool If false, don't turn Freemius on.
89
- */
90
- private $_is_on;
91
-
92
- /**
93
- * @since 1.1.3
94
- *
95
- * @var bool If false, don't turn Freemius on.
96
- */
97
- private $_is_anonymous;
98
-
99
- /**
100
- * @since 1.0.9
101
- * @var bool If false, issues with connectivity to Freemius API.
102
- */
103
- private $_has_api_connection;
104
-
105
- /**
106
- * @since 1.0.9
107
- * @since 2.0.0 Default to true since we need the property during the instance construction, prior to the dynamic_init() execution.
108
- * @var bool Hints the SDK if plugin can support anonymous mode (if skip connect is visible).
109
- */
110
- private $_enable_anonymous = true;
111
-
112
- /**
113
- * @since 1.1.7.5
114
- * @var bool Hints the SDK if plugin should run in anonymous mode (only adds feedback form).
115
- */
116
- private $_anonymous_mode;
117
-
118
- /**
119
- * @since 1.1.9
120
- * @var bool Hints the SDK if plugin have any free plans.
121
- */
122
- private $_is_premium_only;
123
-
124
- /**
125
- * @since 1.2.1.6
126
- * @var bool Hints the SDK if plugin have premium code version at all.
127
- */
128
- private $_has_premium_version;
129
-
130
- /**
131
- * @since 1.2.1.6
132
- * @var bool Hints the SDK if plugin should ignore pending mode by simulating a skip.
133
- */
134
- private $_ignore_pending_mode;
135
-
136
- /**
137
- * @since 1.0.8
138
- * @var bool Hints the SDK if the plugin has any paid plans.
139
- */
140
- private $_has_paid_plans;
141
-
142
- /**
143
- * @since 1.2.1.5
144
- * @var int Hints the SDK if the plugin offers a trial period. If negative, no trial, if zero - has a trial but
145
- * without a specified period, if positive - the number of trial days.
146
- */
147
- private $_trial_days = - 1;
148
-
149
- /**
150
- * @since 1.2.1.5
151
- * @var bool Hints the SDK if the trial requires a payment method or not.
152
- */
153
- private $_is_trial_require_payment = false;
154
-
155
- /**
156
- * @since 1.0.7
157
- * @var bool Hints the SDK if the plugin is WordPress.org compliant.
158
- */
159
- private $_is_org_compliant;
160
-
161
- /**
162
- * @since 1.0.7
163
- * @var bool Hints the SDK if the plugin is has add-ons.
164
- */
165
- private $_has_addons;
166
-
167
- /**
168
- * @since 2.4.5
169
- * @var string Navigation type: 'menu' or 'tabs'.
170
- */
171
- private $_navigation;
172
-
173
- const NAVIGATION_MENU = 'menu';
174
- const NAVIGATION_TABS = 'tabs';
175
-
176
- /**
177
- * @since 1.1.6
178
- * @var string[]bool.
179
- */
180
- private $_permissions;
181
-
182
- /**
183
- * @var FS_Storage
184
- */
185
- private $_storage;
186
-
187
- /**
188
- * @since 1.2.2.7
189
- * @var FS_Cache_Manager
190
- */
191
- private $_cache;
192
-
193
- /**
194
- * @since 1.0.0
195
- *
196
- * @var FS_Logger
197
- */
198
- private $_logger;
199
- /**
200
- * @since 1.0.4
201
- *
202
- * @var FS_Plugin
203
- */
204
- private $_plugin = false;
205
- /**
206
- * @since 1.0.4
207
- *
208
- * @var FS_Plugin|false
209
- */
210
- private $_parent_plugin = false;
211
- /**
212
- * @since 1.1.1
213
- *
214
- * @var Freemius
215
- */
216
- private $_parent = false;
217
- /**
218
- * @since 1.0.1
219
- *
220
- * @var FS_User
221
- */
222
- private $_user = false;
223
- /**
224
- * @since 1.0.1
225
- *
226
- * @var FS_Site
227
- */
228
- private $_site = false;
229
- /**
230
- * @since 1.0.1
231
- *
232
- * @var FS_Plugin_License
233
- */
234
- private $_license;
235
- /**
236
- * @since 1.0.2
237
- *
238
- * @var FS_Plugin_Plan[]
239
- */
240
- private $_plans = false;
241
- /**
242
- * @var FS_Plugin_License[]
243
- * @since 1.0.5
244
- */
245
- private $_licenses = false;
246
-
247
- /**
248
- * @since 1.0.1
249
- *
250
- * @var FS_Admin_Menu_Manager
251
- */
252
- private $_menu;
253
-
254
- /**
255
- * @var FS_Admin_Notices
256
- */
257
- private $_admin_notices;
258
-
259
- /**
260
- * @since 1.1.6
261
- *
262
- * @var FS_Admin_Notices
263
- */
264
- private static $_global_admin_notices;
265
-
266
- /**
267
- * @var FS_Logger
268
- * @since 1.0.0
269
- */
270
- private static $_static_logger;
271
-
272
- /**
273
- * @var FS_Options
274
- * @since 1.0.2
275
- */
276
- private static $_accounts;
277
-
278
- /**
279
- * @since 1.2.2
280
- *
281
- * @var number
282
- */
283
- private $_module_id;
284
-
285
- /**
286
- * @var Freemius[]
287
- */