PluginProbe
Adminify – White Label, Admin Menu Editor, Login Customizer / 4.0.1.2
Adminify – White Label, Admin Menu Editor, Login Customizer v4.0.1.2
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 +64 -112 4.2.94.0.1.2 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 ]
@@ -136,9 +97,9 @@
136 97 */
137 98 public function security_head_fields( &$head_fields ) {
138 99 $security_head = [
139 100 'xmlrpc' => __( 'Disable XML-RPC', 'adminify' ),
140 - 'generator_wp_version' => __( 'Remove WordPress Generator Version from front end', 'adminify' ),
101 + 'generator_wp_version' => __( 'Remove WordPress Generator Version from fornt end', 'adminify' ),
141 102 'rsd' => __( 'Remove "<link rel=\'EditURI\'..." from head section', 'adminify' ),
142 103 'shortlink' => __( 'Remove "<link rel=\'shortlink\'..." from head section', 'adminify' ),
143 104 'canonical' => __( 'Remove &lt;link rel="canonical" href="https://www.site.com/some-url" /&gt; from head section', 'adminify' ),
144 105 'self_ping' => __('Disable self-ping, i.e., from your site to your site when writing posts.', 'adminify'),
@@ -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 ],
@@ -237,13 +198,24 @@
237 198 // $logout_redirects = [];
238 199 $this->login_register_url_fields($settings_fields);
239 200 $this->roles_redirect_tabs($login_redirects);
240 201
202 + $redirect_urls[] = [
203 + 'id' => 'security_subheading',
204 + 'type' => 'subheading',
205 + 'content' => Utils::adminfiy_help_urls(
206 + __('"WordPress" White Label Settings', 'adminify'),
207 + 'https://wpadminify.com/kb/security/',
208 + '',
209 + 'https://www.facebook.com/groups/jeweltheme',
210 + 'https://wpadminify.com/support/'
211 + )
212 + ];
213 +
241 214 $redirect_urls = [
242 215 [
243 216 'id' => 'redirect_urls_fields',
244 - /* translators: %s: Pro upgrade badge HTML */
245 - 'title' => sprintf(__('Redirect URLs %s', 'adminify'), Utils::upgrade_pro_badge()),
217 + 'title' => sprintf(__('Redirect URLs %s', 'adminify'), Utils::adminify_upgrade_pro_badge()),
246 218 'class' => 'adminify-pro-fieldset',
247 219 'subtitle' => __('Login and logout redirects based on user roles. Customize URLs for administrators, editors, or subscribers etc.', 'adminify'),
248 220 'type' => 'fieldset',
249 221 'fields' => [
@@ -258,9 +230,9 @@
258 230 ],
259 231 [
260 232 'id' => 'redirect_urls_options',
261 233 'type' => 'fieldset',
262 - 'title' => ' ',
234 + 'title' => __(' ', 'adminify'),
263 235 'class' => 'adminify-pt-0 adminify-pl-0 adminify-one-col adminify-tabs-content adminify-pro-notice',
264 236 'fields' => [
265 237 [
266 238 'id' => 'redirect_urls_tabs',
@@ -294,13 +266,9 @@
294 266 'id' => 'new_login_url',
295 267 'type' => 'text',
296 268 'class' => 'new-login-url',
297 269 '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 - ),
270 + 'desc' => __('Change the login URL and prevent access to the wp-admin and <code>' . wp_login_url() . '</code> page directly.', 'adminify'),
303 271 'placeholder' => 'login',
304 272 'before' => \get_site_url() . '/',
305 273 // 'after' => '/',
306 274 'default' => $this->get_default_field('redirect_urls_fields')['redirect_urls_options']['redirect_urls_tabs']['new_login_url'],
@@ -310,13 +278,9 @@
310 278 'id' => 'redirect_admin_url',
311 279 'type' => 'text',
312 280 'class' => 'new-login-url redirect-admin-url',
313 281 '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 - ),
282 + 'desc' => __('Redirect users those are not logged in and trying to access <code>' . get_admin_url() . '</code>', 'adminify'),
319 283 'placeholder' => '404',
320 284 'default' => $this->get_default_field('redirect_urls_fields')['redirect_urls_options']['redirect_urls_tabs']['redirect_admin_url'],
321 285 'before' => \get_site_url() . '/',
322 286 // 'after' => '/',
@@ -326,15 +290,10 @@
326 290 'id' => 'new_register_url',
327 291 'type' => 'text',
328 292 'class' => 'new-login-url new-register-url',
329 293 '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 - ),
294 + 'subtitle' => __('Enable <a href="' . admin_url('options-general.php#users_can_register') . '"><b>Membership: "Anyone can register"</b></a> checkbox from Settings.', 'adminify'),
295 + 'desc' => __('Change the Register URL, to setup the custom designed registration page.', 'adminify'),
337 296 'placeholder' => 'wp-login.php?action=register',
338 297 'before' => \get_site_url() . '/',
339 298 // 'after' => '/',
340 299 'default' => $this->get_default_field('redirect_urls_fields')['redirect_urls_options']['redirect_urls_tabs']['new_register_url'],
@@ -457,9 +416,9 @@
457 416 'id' => 'redirect_cap',
458 417 'type' => 'select',
459 418 'title' => __('Capability', 'adminify'),
460 419 'placeholder' => __('Select a Capability', 'adminify'),
461 - 'options' => '\PXLBSAdminify\Inc\Classes\Helper::get_capability_options',
420 + 'options' => '\WPAdminify\Inc\Classes\Helper::get_capability_options',
462 421 'default' => $this->get_default_field('redirect_urls_fields')['redirect_urls_options']['redirect_urls_tabs']['login_redirects']['redirect_cap'],
463 422 'dependency' => ['user_types', '==', 'user_cap'],
464 423 ];
465 424
@@ -469,10 +428,10 @@
469 428 'id' => 'redirect_url',
470 429 'type' => 'text',
471 430 'class' => 'new-login-url',
472 431 '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'),
432 + // 'before' => \get_site_url() . '/',
433 + 'desc' => __('Note: Full URL here. Change the URL for a User or User Roles.', 'adminify'),
475 434 'default' => $this->get_default_field('redirect_urls_fields')['redirect_urls_options']['redirect_urls_tabs']['login_redirects']['redirect_url'],
476 435 ];
477 436
478 437 // // Redirect Order
@@ -534,9 +493,9 @@
534 493 'id' => 'redirect_cap',
535 494 'type' => 'select',
536 495 'title' => __('Capability', 'adminify'),
537 496 'placeholder' => __('Select a Capability', 'adminify'),
538 - 'options' => '\PXLBSAdminify\Inc\Classes\Helper::get_capability_options',
497 + 'options' => '\WPAdminify\Inc\Classes\Helper::get_capability_options',
539 498 'default' => $this->get_default_field('redirect_urls_fields')['redirect_urls_options']['redirect_urls_tabs']['logout_redirects']['redirect_cap'],
540 499 'dependency' => ['user_types', '==', 'user_cap'],
541 500 ];
542 501
@@ -546,10 +505,10 @@
546 505 'id' => 'redirect_url',
547 506 'type' => 'text',
548 507 'class' => 'new-login-url',
549 508 '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'),
509 + 'before' => \get_site_url() . '/',
510 + 'desc' => __('Change the URL for a User or User Roles.', 'adminify'),
552 511 'default' => $this->get_default_field('redirect_urls_fields')['redirect_urls_options']['redirect_urls_tabs']['logout_redirects']['redirect_url'],
553 512 ];
554 513
555 514 // Redirect Order
@@ -573,9 +532,8 @@
573 532 'text_on' => __('Show', 'adminify'),
574 533 'text_off' => __('Hide', 'adminify'),
575 534 'text_width' => 80,
576 535 'title' => __('Username Change', 'adminify'),
577 - /* translators: %s: URL to the documentation page */
578 536 'subtitle' => sprintf(__('Remove Comments for Media attachment Template <a href="%s">More Details</a> ', 'adminify'), esc_url('https://wpadminify.com/docs')),
579 537 'default' => $this->get_default_field('users_security')['change_username'],
580 538 ];
581 539 $users_settings[] = [
@@ -584,9 +542,8 @@
584 542 'text_on' => __('Show', 'adminify'),
585 543 'text_off' => __('Hide', 'adminify'),
586 544 'text_width' => 80,
587 545 'title' => __('Limit Login Attempts', 'adminify'),
588 - /* translators: %s: URL to the documentation page */
589 546 '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 547 'default' => $this->get_default_field('users_security')['limit_logins'],
591 548 ];
592 549
@@ -618,9 +575,9 @@
618 575 [
619 576 'id' => 'security_rest_api_enable',
620 577 'type' => 'switcher',
621 578 'class' => 'adminify-pl-0 adminify-pt-0',
622 - 'title' => '',
579 + 'title' => __('', 'adminify'),
623 580 'text_on' => __('Show', 'adminify'),
624 581 'text_off' => __('Hide', 'adminify'),
625 582 'text_width' => 80,
626 583 'default' => $this->get_default_field('security_rest_api')['security_rest_api_enable'],
@@ -627,9 +584,9 @@
627 584 ],
628 585 [
629 586 'id' => 'security_rest_api_data',
630 587 'type' => 'checkbox',
631 - 'title' => '',
588 + 'title' => __('', 'adminify'),
632 589 'class' => 'adminify-one-col',
633 590 'options' => $json_api_fields_data,
634 591 'default' => $this->get_default_field('security_rest_api')['security_rest_api_data'],
635 592 'dependency' => ['security_rest_api_enable', '==', 'true', true],
@@ -671,9 +628,9 @@
671 628 'fields' => [
672 629 [
673 630 'id' => 'post_archives_enable',
674 631 'type' => 'switcher',
675 - 'title' => '',
632 + 'title' => __('', 'adminify'),
676 633 'text_on' => __('Show', 'adminify'),
677 634 'text_off' => __('Hide', 'adminify'),
678 635 'text_width' => 80,
679 636 'class' => 'adminify-pl-0 adminify-pt-0',
@@ -682,9 +639,9 @@
682 639 [
683 640 'id' => 'post_archives_data',
684 641 'type' => 'checkbox',
685 642 'class' => 'adminify-one-col',
686 - 'title' => '',
643 + 'title' => __('', 'adminify'),
687 644 'options' => $archive_fields_data,
688 645 'default' => $this->get_default_field('post_archives')['post_archives_data'],
689 646 'dependency' => ['post_archives_enable', '==', 'true', true],
690 647 ],
@@ -709,9 +666,8 @@
709 666 'id' => 'enable',
710 667 'type' => 'switcher',
711 668 'title' => '',
712 669 'class' => 'adminify-pt-0 adminify-pl-0 adminify-col-fit',
713 - /* translators: %s: URL to the Discussion settings page */
714 670 '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 671 'text_on' => __('Yes', 'adminify'),
716 672 'text_off' => __('No', 'adminify'),
717 673 'text_width' => 80,
@@ -759,10 +715,9 @@
759 715 $fields[] = [
760 716 'id' => 'disable_automatic_emails',
761 717 'type' => 'switcher',
762 718 '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()),
719 + 'title' => sprintf(__('Disable Automatic Updates Emails %s', 'adminify'), Utils::adminify_upgrade_pro_badge()),
765 720 'subtitle' => __('Stop getting emails about automatic updates on your WordPress site.', 'adminify'),
766 721 'text_on' => __('Yes', 'adminify'),
767 722 'text_off' => __('No', 'adminify'),
768 723 'text_width' => 80,
@@ -772,10 +727,9 @@
772 727 $fields[] = [
773 728 'id' => 'disable_language_switcher_login',
774 729 'type' => 'switcher',
775 730 '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()),
731 + 'title' => sprintf(__('Disable Login Screen Language Switcher %s', 'adminify'), Utils::adminify_upgrade_pro_badge()),
778 732 'subtitle' => __('Hide the Language Switcher on the default WordPress login screen.', 'adminify'),
779 733 'text_on' => __('Yes', 'adminify'),
780 734 'text_off' => __('No', 'adminify'),
781 735 'text_width' => 80,
@@ -800,14 +754,11 @@
800 754 'discussion_menu' => __('Remove Discussion Menu from "Settings>Discussion" Sub Menu', 'adminify'),
801 755 'close_front' => __('Close Comments from front-end', 'adminify'),
802 756 'comments_notes' => __('Remove "Your email address will not be published..." from comment form template', 'adminify'),
803 757 '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()),
758 + 'replace_author_link' => sprintf(__('Remove Link from comment "Author Name" & replace to JavaScript? %s'), Utils::adminify_upgrade_pro_class()),
759 + '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()),
760 + 'hide_existing' => sprintf(__('Hide Existing Comments from Frontend? %s', 'adminify'), Utils::adminify_upgrade_pro_class()),
810 761 ];
811 762
812 763 // check if WP_Widget_Recent_Comments is used
813 764 // $recentcomments = [];
@@ -824,9 +775,9 @@
824 775 'fields' => [
825 776 [
826 777 'id' => 'enable_disable_comments',
827 778 'type' => 'switcher',
828 - 'title' => '',
779 + 'title' => __('', 'adminify'),
829 780 'class' => 'adminify-pl-0 adminify-pt-0',
830 781 'text_on' => __('Show', 'adminify'),
831 782 'text_off' => __('Hide', 'adminify'),
832 783 'text_width' => 80,
@@ -836,9 +787,9 @@
836 787 'id' => 'post_types',
837 788 'type' => 'checkbox',
838 789 'title' => __('for Post Types', 'adminify'),
839 790 'subtitle' => __('Check for enable Post Types', 'adminify'),
840 - 'options' => 'PXLBSAdminify\Inc\Admin\Options\Productivity::get_all_post_types',
791 + 'options' => 'WPAdminify\Inc\Admin\Options\Productivity::get_all_post_types',
841 792 'default' => $this->get_default_field('disable_comments')['post_types'],
842 793 'dependency' => ['enable_disable_comments', '==', 'true', true],
843 794 ],
844 795 // [
@@ -844,9 +795,9 @@
844 795 // [
845 796 // 'id' => 'disable_comments_post_types',
846 797 // 'type' => 'notice',
847 798 // 'style' => 'warning',
848 - // 'content' => Utils::upgrade_pro_notice(),
799 + // 'content' => Utils::adminify_upgrade_pro(),
849 800 // 'dependency' => [
850 801 // [ 'post_types', 'not-any', 'post,page', 'true' ],
851 802 // [ 'post_types', '!=', '', 'true' ],
852 803 // ],
@@ -853,9 +804,9 @@
853 804 // ],
854 805 [
855 806 'id' => 'apply_for',
856 807 'type' => 'checkbox',
857 - 'title' => '',
808 + 'title' => __('', 'adminify'),
858 809 'class' => 'adminify-one-col',
859 810 'options' => $disable_comments_for,
860 811 'default' => $this->get_default_field('disable_comments')['apply_for'],
861 812 'dependency' => ['enable_disable_comments', '==', 'true', true],
@@ -873,19 +824,20 @@
873 824
874 825 $fields = [];
875 826
876 827 $fields[] = [
877 - 'id' => 'security_subheading',
828 + 'id' => 'security_sub_heading',
878 829 'type' => 'subheading',
879 - 'content' => Utils::help_urls(
880 - __('"WordPress" White Label Settings', 'adminify'),
881 - 'https://wpadminify.com/docs/security/',
882 - '',
830 + 'content' => Utils::adminfiy_help_urls(
831 + __('<span></span>', 'adminify'),
832 + 'https://wpadminify.com/kb/disable-admin-notice-in-wordpress-dashboard/',
833 + 'https://www.youtube.com/playlist?list=PLqpMw0NsHXV-EKj9Xm1DMGa6FGniHHly8',
883 834 'https://www.facebook.com/groups/jeweltheme',
884 - \PXLBSAdminify\Inc\Admin\AdminSettings::support_url()
885 - )
835 + 'https://wpadminify.com/support/'
836 + ),
886 837 ];
887 838
839 +
888 840 $this->security_redirect_urls( $fields );
889 841 // $this->security_user_security( $fields );
890 842 $this->security_head_fields( $fields );
891 843 $this->security_feed_fields( $fields );
@@ -895,9 +847,9 @@
895 847 // $this->security_others( $fields );
896 848
897 849 $this->security_custom_gravatar( $fields );
898 850
899 - $fields = apply_filters('pxlbsadminify_settings/security', $fields, $this);
851 + $fields = apply_filters('adminify_settings/security', $fields, $this);
900 852
901 853 // Tweaks Section
902 854 \ADMINIFY::createSection(
903 855 $this->prefix,