PluginProbe
Adminify – White Label, Admin Menu Editor, Login Customizer / 4.0.5.4
Adminify – White Label, Admin Menu Editor, Login Customizer v4.0.5.4
4.3.2 4.3.1 4.3.0 4.2.26 4.2.25 4.2.24 4.2.23 4.2.22 4.2.21 4.2.20 4.2.19 4.2.18 4.2.17 4.2.16 4.2.15 4.2.14 4.2.13 4.2.12 4.2.11 4.2.10 4.2.9 4.2.8 4.2.7 4.2.6 4.2.5 All 165 releases
← All changes | Inc/Admin/Options/Security.php +45 -106 4.2.104.0.5.4 View file →
@@ -1,10 +1,10 @@
1 1 <?php
2 2
3 -namespace PXLBSAdminify\Inc\Admin\Options;
3 +namespace WPAdminify\Inc\Admin\Options;
4 4
5 -use PXLBSAdminify\Inc\Utils;
6 -use PXLBSAdminify\Inc\Admin\AdminSettingsModel;
5 +use WPAdminify\Inc\Utils;
6 +use WPAdminify\Inc\Admin\AdminSettingsModel;
7 7
8 8
9 9 if ( ! defined( 'ABSPATH' ) ) {
10 10 die;
@@ -16,51 +16,10 @@
16 16 public $defaults = [];
17 17
18 18 public function __construct() {
19 19 $this->tweak_settings();
20 - add_action('admin_footer', [$this, 'redirect_url_auto_fill_script']);
21 20 }
22 21
23 - /**
24 - * Auto-fill New Register URL placeholder based on New Login URL
25 - */
26 - public function redirect_url_auto_fill_script() {
27 - $screen = get_current_screen();
28 - if (!$screen || strpos($screen->id, 'wp-adminify') === false) {
29 - return;
30 - }
31 - ?>
32 - <script>
33 - jQuery(document).ready(function($) {
34 - // Find the login URL and register URL fields
35 - var $loginField = $('input[data-depend-id="new_login_url"]');
36 - var $registerField = $('input[data-depend-id="new_register_url"]');
37 -
38 - if ($loginField.length && $registerField.length) {
39 - // Update placeholder when login URL changes (not actual value)
40 - $loginField.on('input change', function() {
41 - var loginValue = $(this).val().trim();
42 -
43 - if (loginValue) {
44 - // Update placeholder to suggest the register URL format
45 - $registerField.attr('placeholder', loginValue + '/?action=register');
46 - } else {
47 - // Reset to default placeholder
48 - $registerField.attr('placeholder', 'wp-login.php?action=register');
49 - }
50 - });
51 -
52 - // Also update placeholder on page load if login has value
53 - var initialLogin = $loginField.val().trim();
54 - if (initialLogin) {
55 - $registerField.attr('placeholder', initialLogin + '/?action=register');
56 - }
57 - }
58 - });
59 - </script>
60 - <?php
61 - }
62 -
63 22 protected function get_defaults() {
64 23 return [
65 24 'security_head' => [
66 25 'enable_security_head' => false,
@@ -108,20 +67,22 @@
108 67 'redirect_admin_url' => '',
109 68 'new_register_url' => '',
110 69 'new_logout_url' => '',
111 70 'login_redirects' => [
112 - 'user_types' => '',
113 - 'redirect_user' => '',
114 - 'redirect_role' => '',
115 - 'redirect_cap' => '',
116 - 'redirect_url' => '',
71 + 'user_types' => 'user_role',
72 + 'redirect_user' => 'user_role',
73 + 'redirect_role' => '',
74 + 'redirect_cap' => '',
75 + 'redirect_url' => '',
76 + // 'redirect_order' => 10,
117 77 ],
118 78 'logout_redirects' => [
119 - 'user_types' => '',
120 - 'redirect_user' => '',
121 - 'redirect_role' => '',
122 - 'redirect_cap' => '',
123 - 'redirect_url' => '',
79 + 'user_types' => 'user_role',
80 + 'redirect_user' => 'user_role',
81 + 'redirect_role' => '',
82 + 'redirect_cap' => '',
83 + 'redirect_url' => '',
84 + // 'redirect_order' => 10,
124 85 ]
125 86 ],
126 87 ],
127 88 ]
@@ -176,9 +137,9 @@
176 137 'fields' => [
177 138 [
178 139 'id' => 'enable_security_head',
179 140 'type' => 'switcher',
180 - 'title' => '',
141 + 'title' => __('', 'adminify'),
181 142 'class' => 'adminify-pl-0 adminify-pt-0',
182 143 'text_on' => __('Show', 'adminify'),
183 144 'text_off' => __('Hide', 'adminify'),
184 145 'text_width' => 80,
@@ -187,9 +148,9 @@
187 148 [
188 149 'id' => 'security_head_data',
189 150 'type' => 'checkbox',
190 151 'class' => 'adminify-one-col',
191 - 'title' => '',
152 + 'title' => __('', 'adminify'),
192 153 'options' => $security_head,
193 154 'default' => $this->get_default_field('security_head')['security_head_data'],
194 155 'dependency' => ['enable_security_head', '==', 'true', 'true']
195 156 ],
@@ -240,10 +201,9 @@
240 201
241 202 $redirect_urls = [
242 203 [
243 204 'id' => 'redirect_urls_fields',
244 - /* translators: %s: Pro upgrade badge HTML */
245 - 'title' => sprintf(__('Redirect URLs %s', 'adminify'), Utils::upgrade_pro_badge()),
205 + 'title' => sprintf(__('Redirect URLs %s', 'adminify'), Utils::adminify_upgrade_pro_badge()),
246 206 'class' => 'adminify-pro-fieldset',
247 207 'subtitle' => __('Login and logout redirects based on user roles. Customize URLs for administrators, editors, or subscribers etc.', 'adminify'),
248 208 'type' => 'fieldset',
249 209 'fields' => [
@@ -258,9 +218,9 @@
258 218 ],
259 219 [
260 220 'id' => 'redirect_urls_options',
261 221 'type' => 'fieldset',
262 - 'title' => ' ',
222 + 'title' => __(' ', 'adminify'),
263 223 'class' => 'adminify-pt-0 adminify-pl-0 adminify-one-col adminify-tabs-content adminify-pro-notice',
264 224 'fields' => [
265 225 [
266 226 'id' => 'redirect_urls_tabs',
@@ -294,13 +254,9 @@
294 254 'id' => 'new_login_url',
295 255 'type' => 'text',
296 256 'class' => 'new-login-url',
297 257 'title' => __('New Login URL', 'adminify'),
298 - 'desc' => sprintf(
299 - /* translators: %s: wp-login.php URL of the site */
300 - __('Change the login URL and prevent access to the wp-admin and %s page directly.', 'adminify'),
301 - '<code>' . esc_html( wp_login_url() ) . '</code>'
302 - ),
258 + 'desc' => __('Change the login URL and prevent access to the wp-admin and <code>' . wp_login_url() . '</code> page directly.', 'adminify'),
303 259 'placeholder' => 'login',
304 260 'before' => \get_site_url() . '/',
305 261 // 'after' => '/',
306 262 'default' => $this->get_default_field('redirect_urls_fields')['redirect_urls_options']['redirect_urls_tabs']['new_login_url'],
@@ -310,13 +266,9 @@
310 266 'id' => 'redirect_admin_url',
311 267 'type' => 'text',
312 268 'class' => 'new-login-url redirect-admin-url',
313 269 'title' => __('Redirect Admin', 'adminify'),
314 - 'desc' => sprintf(
315 - /* translators: %s: site admin URL */
316 - __('Redirect users those are not logged in and trying to access %s', 'adminify'),
317 - '<code>' . esc_html( get_admin_url() ) . '</code>'
318 - ),
270 + 'desc' => __('Redirect users those are not logged in and trying to access <code>' . get_admin_url() . '</code>', 'adminify'),
319 271 'placeholder' => '404',
320 272 'default' => $this->get_default_field('redirect_urls_fields')['redirect_urls_options']['redirect_urls_tabs']['redirect_admin_url'],
321 273 'before' => \get_site_url() . '/',
322 274 // 'after' => '/',
@@ -326,15 +278,10 @@
326 278 'id' => 'new_register_url',
327 279 'type' => 'text',
328 280 'class' => 'new-login-url new-register-url',
329 281 'title' => __('New Register URL', 'adminify'),
330 - 'subtitle' => __('Use default registration: leave empty.', 'adminify'),
331 - 'desc' => sprintf(
332 - /* translators: %s: opening anchor tag pointing to Settings > General, closed by </a> in the next placeholder */
333 - __('For default enable <strong>"Membership: Anyone can register"</strong> in %1$sSettings → General.%2$s To use custom registration: Create a Page, then paste its permalink here (e.g. /register).', 'adminify'),
334 - '<a href="' . esc_url( admin_url('options-general.php#users_can_register') ) . '" style="color: var(--adminify-primary);">',
335 - '</a>'
336 - ),
282 + 'subtitle' => __('Enable <a href="' . admin_url('options-general.php#users_can_register') . '"><b>Membership: "Anyone can register"</b></a> checkbox from Settings.', 'adminify'),
283 + 'desc' => __('Change the Register URL, to setup the custom designed registration page.', 'adminify'),
337 284 'placeholder' => 'wp-login.php?action=register',
338 285 'before' => \get_site_url() . '/',
339 286 // 'after' => '/',
340 287 'default' => $this->get_default_field('redirect_urls_fields')['redirect_urls_options']['redirect_urls_tabs']['new_register_url'],
@@ -457,9 +404,9 @@
457 404 'id' => 'redirect_cap',
458 405 'type' => 'select',
459 406 'title' => __('Capability', 'adminify'),
460 407 'placeholder' => __('Select a Capability', 'adminify'),
461 - 'options' => '\PXLBSAdminify\Inc\Classes\Helper::get_capability_options',
408 + 'options' => '\WPAdminify\Inc\Classes\Helper::get_capability_options',
462 409 'default' => $this->get_default_field('redirect_urls_fields')['redirect_urls_options']['redirect_urls_tabs']['login_redirects']['redirect_cap'],
463 410 'dependency' => ['user_types', '==', 'user_cap'],
464 411 ];
465 412
@@ -469,10 +416,10 @@
469 416 'id' => 'redirect_url',
470 417 'type' => 'text',
471 418 'class' => 'new-login-url',
472 419 'title' => __('Redirect URL', 'adminify'),
473 - 'placeholder' => __('e.g., my-dashboard or https://example.com/page', 'adminify'),
474 - 'desc' => __('Enter a page slug (e.g., my-dashboard) or full URL. For multisite, use full URLs for cross-site redirects.', 'adminify'),
420 + // 'before' => \get_site_url() . '/',
421 + 'desc' => __('Note: Full URL here. Change the URL for a User or User Roles.', 'adminify'),
475 422 'default' => $this->get_default_field('redirect_urls_fields')['redirect_urls_options']['redirect_urls_tabs']['login_redirects']['redirect_url'],
476 423 ];
477 424
478 425 // // Redirect Order
@@ -534,9 +481,9 @@
534 481 'id' => 'redirect_cap',
535 482 'type' => 'select',
536 483 'title' => __('Capability', 'adminify'),
537 484 'placeholder' => __('Select a Capability', 'adminify'),
538 - 'options' => '\PXLBSAdminify\Inc\Classes\Helper::get_capability_options',
485 + 'options' => '\WPAdminify\Inc\Classes\Helper::get_capability_options',
539 486 'default' => $this->get_default_field('redirect_urls_fields')['redirect_urls_options']['redirect_urls_tabs']['logout_redirects']['redirect_cap'],
540 487 'dependency' => ['user_types', '==', 'user_cap'],
541 488 ];
542 489
@@ -546,10 +493,10 @@
546 493 'id' => 'redirect_url',
547 494 'type' => 'text',
548 495 'class' => 'new-login-url',
549 496 'title' => __('Redirect URL', 'adminify'),
550 - 'placeholder' => __('e.g., goodbye or https://example.com/page', 'adminify'),
551 - 'desc' => __('Enter a page slug (e.g., goodbye) or full URL. For multisite, use full URLs for cross-site redirects.', 'adminify'),
497 + 'before' => \get_site_url() . '/',
498 + 'desc' => __('Change the URL for a User or User Roles.', 'adminify'),
552 499 'default' => $this->get_default_field('redirect_urls_fields')['redirect_urls_options']['redirect_urls_tabs']['logout_redirects']['redirect_url'],
553 500 ];
554 501
555 502 // Redirect Order
@@ -573,9 +520,8 @@
573 520 'text_on' => __('Show', 'adminify'),
574 521 'text_off' => __('Hide', 'adminify'),
575 522 'text_width' => 80,
576 523 'title' => __('Username Change', 'adminify'),
577 - /* translators: %s: URL to the documentation page */
578 524 'subtitle' => sprintf(__('Remove Comments for Media attachment Template <a href="%s">More Details</a> ', 'adminify'), esc_url('https://wpadminify.com/docs')),
579 525 'default' => $this->get_default_field('users_security')['change_username'],
580 526 ];
581 527 $users_settings[] = [
@@ -584,9 +530,8 @@
584 530 'text_on' => __('Show', 'adminify'),
585 531 'text_off' => __('Hide', 'adminify'),
586 532 'text_width' => 80,
587 533 'title' => __('Limit Login Attempts', 'adminify'),
588 - /* translators: %s: URL to the documentation page */
589 534 'subtitle' => sprintf(__('Prevent brute force attacks by limiting the number of failed login attempts per IP address. <a href="%s">More Details</a> ', 'adminify'), esc_url('https://wpadminify.com/docs')),
590 535 'default' => $this->get_default_field('users_security')['limit_logins'],
591 536 ];
592 537
@@ -618,9 +563,9 @@
618 563 [
619 564 'id' => 'security_rest_api_enable',
620 565 'type' => 'switcher',
621 566 'class' => 'adminify-pl-0 adminify-pt-0',
622 - 'title' => '',
567 + 'title' => __('', 'adminify'),
623 568 'text_on' => __('Show', 'adminify'),
624 569 'text_off' => __('Hide', 'adminify'),
625 570 'text_width' => 80,
626 571 'default' => $this->get_default_field('security_rest_api')['security_rest_api_enable'],
@@ -627,9 +572,9 @@
627 572 ],
628 573 [
629 574 'id' => 'security_rest_api_data',
630 575 'type' => 'checkbox',
631 - 'title' => '',
576 + 'title' => __('', 'adminify'),
632 577 'class' => 'adminify-one-col',
633 578 'options' => $json_api_fields_data,
634 579 'default' => $this->get_default_field('security_rest_api')['security_rest_api_data'],
635 580 'dependency' => ['security_rest_api_enable', '==', 'true', true],
@@ -671,9 +616,9 @@
671 616 'fields' => [
672 617 [
673 618 'id' => 'post_archives_enable',
674 619 'type' => 'switcher',
675 - 'title' => '',
620 + 'title' => __('', 'adminify'),
676 621 'text_on' => __('Show', 'adminify'),
677 622 'text_off' => __('Hide', 'adminify'),
678 623 'text_width' => 80,
679 624 'class' => 'adminify-pl-0 adminify-pt-0',
@@ -682,9 +627,9 @@
682 627 [
683 628 'id' => 'post_archives_data',
684 629 'type' => 'checkbox',
685 630 'class' => 'adminify-one-col',
686 - 'title' => '',
631 + 'title' => __('', 'adminify'),
687 632 'options' => $archive_fields_data,
688 633 'default' => $this->get_default_field('post_archives')['post_archives_data'],
689 634 'dependency' => ['post_archives_enable', '==', 'true', true],
690 635 ],
@@ -709,9 +654,8 @@
709 654 'id' => 'enable',
710 655 'type' => 'switcher',
711 656 'title' => '',
712 657 'class' => 'adminify-pt-0 adminify-pl-0 adminify-col-fit',
713 - /* translators: %s: URL to the Discussion settings page */
714 658 'label' => sprintf(__('Add your Custom Gravatar Images for Comments. Select Avatar Image from <a href="%s">Settings>Discussion>Default Avatar</a>.', 'adminify'), esc_url(admin_url('options-discussion.php'))),
715 659 'text_on' => __('Yes', 'adminify'),
716 660 'text_off' => __('No', 'adminify'),
717 661 'text_width' => 80,
@@ -759,10 +703,9 @@
759 703 $fields[] = [
760 704 'id' => 'disable_automatic_emails',
761 705 'type' => 'switcher',
762 706 'class' => 'adminify-pro-fieldset adminify-pro-notice',
763 - /* translators: %s: Pro upgrade badge HTML */
764 - 'title' => sprintf(__('Disable Automatic Updates Emails %s', 'adminify'), Utils::upgrade_pro_badge()),
707 + 'title' => sprintf(__('Disable Automatic Updates Emails %s', 'adminify'), Utils::adminify_upgrade_pro_badge()),
765 708 'subtitle' => __('Stop getting emails about automatic updates on your WordPress site.', 'adminify'),
766 709 'text_on' => __('Yes', 'adminify'),
767 710 'text_off' => __('No', 'adminify'),
768 711 'text_width' => 80,
@@ -772,10 +715,9 @@
772 715 $fields[] = [
773 716 'id' => 'disable_language_switcher_login',
774 717 'type' => 'switcher',
775 718 'class' => 'adminify-pro-fieldset adminify-pro-notice',
776 - /* translators: %s: Pro upgrade badge HTML */
777 - 'title' => sprintf(__('Disable Login Screen Language Switcher %s', 'adminify'), Utils::upgrade_pro_badge()),
719 + 'title' => sprintf(__('Disable Login Screen Language Switcher %s', 'adminify'), Utils::adminify_upgrade_pro_badge()),
778 720 'subtitle' => __('Hide the Language Switcher on the default WordPress login screen.', 'adminify'),
779 721 'text_on' => __('Yes', 'adminify'),
780 722 'text_off' => __('No', 'adminify'),
781 723 'text_width' => 80,
@@ -800,14 +742,11 @@
800 742 'discussion_menu' => __('Remove Discussion Menu from "Settings>Discussion" Sub Menu', 'adminify'),
801 743 'close_front' => __('Close Comments from front-end', 'adminify'),
802 744 'comments_notes' => __('Remove "Your email address will not be published..." from comment form template', 'adminify'),
803 745 'comments_url_field' => __('Remove website Field (URL) from comment form template', 'adminify'),
804 - /* translators: %s: Pro upgrade badge CSS class */
805 - 'replace_author_link' => sprintf(__('Remove Link from comment "Author Name" & replace to JavaScript? %s', 'adminify'), Utils::upgrade_pro_class()),
806 - /* translators: %s: Pro upgrade badge CSS class */
807 - 'replace_comment_link' => sprintf(__('Comments Content disable auto linking, display comments links as plain text, replace Comment Links to JavaScript? %s', 'adminify'), Utils::upgrade_pro_class()),
808 - /* translators: %s: Pro upgrade badge CSS class */
809 - 'hide_existing' => sprintf(__('Hide Existing Comments from Frontend? %s', 'adminify'), Utils::upgrade_pro_class()),
746 + 'replace_author_link' => sprintf(__('Remove Link from comment "Author Name" & replace to JavaScript? %s'), Utils::adminify_upgrade_pro_class()),
747 + 'replace_comment_link' => sprintf(__('Comments Content disable auto linking, display comments links as plain text, replace Comment Links to JavaScript? %s', 'adminify'), Utils::adminify_upgrade_pro_class()),
748 + 'hide_existing' => sprintf(__('Hide Existing Comments from Frontend? %s', 'adminify'), Utils::adminify_upgrade_pro_class()),
810 749 ];
811 750
812 751 // check if WP_Widget_Recent_Comments is used
813 752 // $recentcomments = [];
@@ -824,9 +763,9 @@
824 763 'fields' => [
825 764 [
826 765 'id' => 'enable_disable_comments',
827 766 'type' => 'switcher',
828 - 'title' => '',
767 + 'title' => __('', 'adminify'),
829 768 'class' => 'adminify-pl-0 adminify-pt-0',
830 769 'text_on' => __('Show', 'adminify'),
831 770 'text_off' => __('Hide', 'adminify'),
832 771 'text_width' => 80,
@@ -836,9 +775,9 @@
836 775 'id' => 'post_types',
837 776 'type' => 'checkbox',
838 777 'title' => __('for Post Types', 'adminify'),
839 778 'subtitle' => __('Check for enable Post Types', 'adminify'),
840 - 'options' => 'PXLBSAdminify\Inc\Admin\Options\Productivity::get_all_post_types',
779 + 'options' => 'WPAdminify\Inc\Admin\Options\Productivity::get_all_post_types',
841 780 'default' => $this->get_default_field('disable_comments')['post_types'],
842 781 'dependency' => ['enable_disable_comments', '==', 'true', true],
843 782 ],
844 783 // [
@@ -844,9 +783,9 @@
844 783 // [
845 784 // 'id' => 'disable_comments_post_types',
846 785 // 'type' => 'notice',
847 786 // 'style' => 'warning',
848 - // 'content' => Utils::upgrade_pro_notice(),
787 + // 'content' => Utils::adminify_upgrade_pro(),
849 788 // 'dependency' => [
850 789 // [ 'post_types', 'not-any', 'post,page', 'true' ],
851 790 // [ 'post_types', '!=', '', 'true' ],
852 791 // ],
@@ -853,9 +792,9 @@
853 792 // ],
854 793 [
855 794 'id' => 'apply_for',
856 795 'type' => 'checkbox',
857 - 'title' => '',
796 + 'title' => __('', 'adminify'),
858 797 'class' => 'adminify-one-col',
859 798 'options' => $disable_comments_for,
860 799 'default' => $this->get_default_field('disable_comments')['apply_for'],
861 800 'dependency' => ['enable_disable_comments', '==', 'true', true],
@@ -875,14 +814,14 @@
875 814
876 815 $fields[] = [
877 816 'id' => 'security_subheading',
878 817 'type' => 'subheading',
879 - 'content' => Utils::help_urls(
818 + 'content' => Utils::adminfiy_help_urls(
880 819 __('"WordPress" White Label Settings', 'adminify'),
881 820 'https://wpadminify.com/docs/security/',
882 821 '',
883 822 'https://www.facebook.com/groups/jeweltheme',
884 - \PXLBSAdminify\Inc\Admin\AdminSettings::support_url()
823 + \WPAdminify\Inc\Admin\AdminSettings::support_url()
885 824 )
886 825 ];
887 826
888 827 $this->security_redirect_urls( $fields );
@@ -895,9 +834,9 @@
895 834 // $this->security_others( $fields );
896 835
897 836 $this->security_custom_gravatar( $fields );
898 837
899 - $fields = apply_filters('pxlbsadminify_settings/security', $fields, $this);
838 + $fields = apply_filters('adminify_settings/security', $fields, $this);
900 839
901 840 // Tweaks Section
902 841 \ADMINIFY::createSection(
903 842 $this->prefix,