PluginProbe ʕ •ᴥ•ʔ
Wp Social Login and Register Social Counter / 3.2.1
Wp Social Login and Register Social Counter v3.2.1
3.2.1 trunk 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.10 1.3.11 1.3.2 1.3.3 1.3.4 1.3.6 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2 1.4.4 1.4.5 1.4.6 1.4.8 1.4.9 1.5.0 1.6.0 1.6.1 1.7.0 1.7.1 1.7.2 1.7.3 1.7.4 1.8.0 1.8.1 1.8.2 1.8.3 1.8.5 1.8.6 1.9.0 2.0.0 2.1.0 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.8 2.2.9 3.0.0 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0
wp-social / app / login-settings.php
wp-social / app Last commit date
api-routes.php 1 week ago avatar.php 5 years ago counter-settings.php 5 years ago legacy.php 5 years ago login-settings.php 1 week ago providers.php 1 week ago route.php 1 week ago settings.php 5 years ago share-settings.php 1 week ago share.php 3 years ago
login-settings.php
329 lines
1 <?php
2
3 namespace WP_Social\App;
4
5 use WP_Social\Traits\Singleton;
6
7 defined('ABSPATH') || exit;
8
9 class Login_Settings {
10
11 use Singleton;
12
13 const OK_GLOBAL = 'xs_global_setting_data';
14 const OK_STYLES = 'xs_style_setting_data';
15 const OK_PROVIDER = 'xs_provider_data';
16 const OK_PROVIDER_ENABLED = 'xs_providers_enabled_login';
17
18
19 private $global;
20 private $providers;
21 private $enabled;
22 private $styles;
23
24 public function __construct() {
25
26 $this->global = get_option(self::OK_GLOBAL, []);
27 $this->enabled = get_option(self::OK_PROVIDER_ENABLED, []);
28 $this->providers = get_option(self::OK_PROVIDER, []);
29 $this->styles = get_option(self::OK_STYLES, []);
30 }
31
32
33 public static function get_login_styles() {
34
35 $free_styles = [
36 'style-1' => [
37 'image' => WSLU_LOGIN_PLUGIN_URL . 'assets/images/screenshort/login/style-1.png',
38 'title' => __('Icon with providers label', 'wp-social'),
39 'package' => 'free',
40 'unlocked' => true,
41 ],
42 'style-2' => [
43 'image' => WSLU_LOGIN_PLUGIN_URL . 'assets/images/screenshort/login/style-2.png',
44 'title' => __('Only social icon', 'wp-social'),
45 'package' => 'free',
46 'unlocked' => true,
47 ],
48 'style-3' => [
49 'image' => WSLU_LOGIN_PLUGIN_URL . 'assets/images/screenshort/login/style-3.png',
50 'title' => __('Only providers label', 'wp-social'),
51 'package' => 'free',
52 'unlocked' => true,
53 ],
54 ];
55
56 if(\WP_Social::is_pro_active()) {
57
58 return apply_filters('wp_social_pro/login/styles/pro_design', $free_styles);
59 }
60
61 $pro_only = [
62 'style-4' => [
63 'image' => WSLU_LOGIN_PLUGIN_URL . 'assets/images/screenshort/login/style-4-pro.png',
64 'title' => __('Icon Overlay', 'wp-social'),
65 'package' => 'pro',
66 'unlocked' => false,
67 ],
68 'style-5' => [
69 'image' => WSLU_LOGIN_PLUGIN_URL . 'assets/images/screenshort/login/style-5-pro.png',
70 'title' => __('Left Slide', 'wp-social'),
71 'package' => 'pro',
72 'unlocked' => false,
73 ],
74 'style-6' => [
75 'image' => WSLU_LOGIN_PLUGIN_URL . 'assets/images/screenshort/login/style-6-pro.png',
76 'title' => __('Circle Blow', 'wp-social'),
77 'package' => 'pro',
78 'unlocked' => false,
79 ],
80
81 'style-7' => [
82 'image' => WSLU_LOGIN_PLUGIN_URL . 'assets/images/screenshort/login/style-7-pro.png',
83 'title' => __('Left Slide Overlay', 'wp-social'),
84 'package' => 'pro',
85 'unlocked' => false,
86 ],
87 'style-8' => [
88 'image' => WSLU_LOGIN_PLUGIN_URL . 'assets/images/screenshort/login/style-8-pro.png',
89 'title' => __('Circle Line Icon', 'wp-social'),
90 'package' => 'pro',
91 'unlocked' => false,
92 ],
93 'style-9' => [
94 'image' => WSLU_LOGIN_PLUGIN_URL . 'assets/images/screenshort/login/style-9-pro.png',
95 'title' => __('Slide to arrow', 'wp-social'),
96 'package' => 'pro',
97 'unlocked' => false,
98 ],
99 'style-10' => [
100 'image' => WSLU_LOGIN_PLUGIN_URL . 'assets/images/screenshort/login/style-10-pro.png',
101 'title' => __('Stroke right radius', 'wp-social'),
102 'package' => 'pro',
103 'unlocked' => false,
104 ],
105 'style-11' => [
106 'image' => WSLU_LOGIN_PLUGIN_URL . 'assets/images/screenshort/login/style-11-pro.png',
107 'title' => __('Gradient Icon', 'wp-social'),
108 'package' => 'pro',
109 'unlocked' => false,
110 ],
111 'style-12' => [
112 'image' => WSLU_LOGIN_PLUGIN_URL . 'assets/images/screenshort/login/style-12-pro.png',
113 'title' => __('Box Style', 'wp-social'),
114 'package' => 'pro',
115 'unlocked' => false,
116 ],
117 'style-13' => [
118 'image' => WSLU_LOGIN_PLUGIN_URL . 'assets/images/screenshort/login/style-13-pro.png',
119 'title' => __('Drop icon', 'wp-social'),
120 'package' => 'pro',
121 'unlocked' => false,
122 ],
123 'style-14' => [
124 'image' => WSLU_LOGIN_PLUGIN_URL . 'assets/images/screenshort/login/style-14-pro.png',
125 'title' => __('Minimal Stack Icons', 'wp-social'),
126 'package' => 'pro',
127 'unlocked' => false,
128 ],
129 'style-15' => [
130 'image' => WSLU_LOGIN_PLUGIN_URL . 'assets/images/screenshort/login/style-15-pro.png',
131 'title' => __('Capsule Icons', 'wp-social'),
132 'package' => 'pro',
133 'unlocked' => false,
134 ],
135 'style-16' => [
136 'image' => WSLU_LOGIN_PLUGIN_URL . 'assets/images/screenshort/login/style-16-pro.png',
137 'title' => __('Dark Dot Icons', 'wp-social'),
138 'package' => 'pro',
139 'unlocked' => false,
140 ],
141 'style-17' => [
142 'image' => WSLU_LOGIN_PLUGIN_URL . 'assets/images/screenshort/login/style-17-pro.png',
143 'title' => __('Dark Card Icons', 'wp-social'),
144 'package' => 'pro',
145 'unlocked' => false,
146 ],
147 'style-18' => [
148 'image' => WSLU_LOGIN_PLUGIN_URL . 'assets/images/screenshort/login/style-18-pro.png',
149 'title' => __('Dark Ghost Icons ', 'wp-social'),
150 'package' => 'pro',
151 'unlocked' => false,
152 ],
153 'style-19' => [
154 'image' => WSLU_LOGIN_PLUGIN_URL . 'assets/images/screenshort/login/style-19-pro.png',
155 'title' => __(' Dark Auth Stack Icons', 'wp-social'),
156 'package' => 'pro',
157 'unlocked' => false,
158 ],
159 'style-20' => [
160 'image' => WSLU_LOGIN_PLUGIN_URL . 'assets/images/screenshort/login/style-20-pro.png',
161 'title' => __('Floating Icons', 'wp-social'),
162 'package' => 'pro',
163 'unlocked' => false,
164 ],
165 'style-21' => [
166 'image' => WSLU_LOGIN_PLUGIN_URL . 'assets/images/screenshort/login/style-21-pro.png',
167 'title' => __('Clean Auth Icons', 'wp-social'),
168 'package' => 'pro',
169 'unlocked' => false,
170 ],
171 'style-22' => [
172 'image' => WSLU_LOGIN_PLUGIN_URL . 'assets/images/screenshort/login/style-22-pro.png',
173 'title' => __('Bubble Icons', 'wp-social'),
174 'package' => 'pro',
175 'unlocked' => false,
176 ],
177 'style-23' => [
178 'image' => WSLU_LOGIN_PLUGIN_URL . 'assets/images/screenshort/login/style-23-pro.png',
179 'title' => __('Bordered Card Icons', 'wp-social'),
180 'package' => 'pro',
181 'unlocked' => false,
182 ],
183 ];
184
185 $all_styles = array_merge($free_styles, $pro_only);
186
187 /**
188 * Hook: wp_social_login_styles_list
189 *
190 * Allows other plugins to access the list of login designs
191 * and their package information (free/pro).
192 *
193 * @param array $all_styles Complete array of all login styles
194 * @param array $free_styles Array of free login styles only
195 * @param array $pro_only Array of pro login styles only
196 *
197 * @since 3.5.0
198 *
199 * Example usage in another plugin:
200 *
201 * add_action('wp_social_login_styles_list', function($all_styles, $free_styles, $pro_styles) {
202 * // Access all styles
203 * foreach($all_styles as $style_key => $style_data) {
204 * error_log("Style: {$style_key}, Package: {$style_data['package']}");
205 * }
206 *
207 * // Get only free styles
208 * $free_style_keys = array_keys($free_styles);
209 *
210 * // Get only pro styles
211 * $pro_style_keys = array_keys($pro_styles);
212 * }, 10, 3);
213 */
214 do_action('wp_social_login_styles_list', $all_styles, $free_styles, $pro_only);
215
216 return $all_styles;
217 }
218
219
220 public function load() {
221
222 if(empty($this->global)) {
223 $this->global = get_option(self::OK_GLOBAL, []);
224 }
225
226 if(empty($this->enabled)) {
227 $this->enabled = get_option(self::OK_PROVIDER_ENABLED, []);
228 }
229
230 if(empty($this->providers)) {
231 $this->providers = get_option(self::OK_PROVIDER, []);
232 }
233
234 if(empty($this->styles)) {
235 $this->styles = get_option(self::OK_STYLES, []);
236 }
237
238 return $this;
239 }
240
241
242 public function get_enabled_providers() {
243
244 return $this->enabled;
245 }
246
247
248 public function update_enabled_providers($val) {
249
250 $this->enabled = $val;
251
252 update_option(self::OK_PROVIDER_ENABLED, $val, true);
253
254 return $this;
255 }
256
257
258 public function get_provider_settings() {
259
260 return $this->providers;
261 }
262
263
264 public function update_provider_settings($val) {
265
266 $this->providers = $val;
267
268 update_option(self::OK_PROVIDER, $val, true);
269
270 return $this;
271 }
272
273
274 public function get_style_settings() {
275
276 return $this->styles;
277 }
278
279
280 public function update_style_settings($val) {
281
282 $this->styles = $val;
283
284 update_option(self::OK_STYLES, $val, true);
285
286 return $this;
287 }
288
289
290 public function get_global_settings() {
291
292 return $this->global;
293 }
294
295
296 public function update_global_settings($val) {
297
298 $this->global = $val;
299
300 update_option(self::OK_GLOBAL, $val, true);
301
302 return $this;
303 }
304
305
306 public function is_custom_url_enabled() {
307
308 return !empty($this->global['custom_login_url']['enable']);
309 }
310
311
312 public function get_custom_url() {
313
314 return empty($this->global['custom_login_url']['data']) ? '#' : $this->global['custom_login_url']['data'];
315 }
316
317
318 public function is_login_page_login_button_enabled() {
319
320 return !empty($this->global['wp_login_page']['enable']);
321 }
322
323
324 public function get_selected_style() {
325
326 return empty($this->styles['login_button_style']) ? 'style-1' : $this->styles['login_button_style'];
327 }
328 }
329