| @@ -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; |
| @@ -176,9 +176,9 @@ | ||
| 176 | 176 | 'fields' => [ |
| 177 | 177 | [ |
| 178 | 178 | 'id' => 'enable_security_head', |
| 179 | 179 | 'type' => 'switcher', |
| 180 | - 'title' => '', | |
| 180 | + 'title' => __('', 'adminify'), | |
| 181 | 181 | 'class' => 'adminify-pl-0 adminify-pt-0', |
| 182 | 182 | 'text_on' => __('Show', 'adminify'), |
| 183 | 183 | 'text_off' => __('Hide', 'adminify'), |
| 184 | 184 | 'text_width' => 80, |
| @@ -187,9 +187,9 @@ | ||
| 187 | 187 | [ |
| 188 | 188 | 'id' => 'security_head_data', |
| 189 | 189 | 'type' => 'checkbox', |
| 190 | 190 | 'class' => 'adminify-one-col', |
| 191 | - 'title' => '', | |
| 191 | + 'title' => __('', 'adminify'), | |
| 192 | 192 | 'options' => $security_head, |
| 193 | 193 | 'default' => $this->get_default_field('security_head')['security_head_data'], |
| 194 | 194 | 'dependency' => ['enable_security_head', '==', 'true', 'true'] |
| 195 | 195 | ], |
| @@ -240,10 +240,9 @@ | ||
| 240 | 240 | |
| 241 | 241 | $redirect_urls = [ |
| 242 | 242 | [ |
| 243 | 243 | 'id' => 'redirect_urls_fields', |
| 244 | - /* translators: %s: Pro upgrade badge HTML */ | |
| 245 | - 'title' => sprintf(__('Redirect URLs %s', 'adminify'), Utils::upgrade_pro_badge()), | |
| 244 | + 'title' => sprintf(__('Redirect URLs %s', 'adminify'), Utils::adminify_upgrade_pro_badge()), | |
| 246 | 245 | 'class' => 'adminify-pro-fieldset', |
| 247 | 246 | 'subtitle' => __('Login and logout redirects based on user roles. Customize URLs for administrators, editors, or subscribers etc.', 'adminify'), |
| 248 | 247 | 'type' => 'fieldset', |
| 249 | 248 | 'fields' => [ |
| @@ -258,9 +257,9 @@ | ||
| 258 | 257 | ], |
| 259 | 258 | [ |
| 260 | 259 | 'id' => 'redirect_urls_options', |
| 261 | 260 | 'type' => 'fieldset', |
| 262 | - 'title' => ' ', | |
| 261 | + 'title' => __(' ', 'adminify'), | |
| 263 | 262 | 'class' => 'adminify-pt-0 adminify-pl-0 adminify-one-col adminify-tabs-content adminify-pro-notice', |
| 264 | 263 | 'fields' => [ |
| 265 | 264 | [ |
| 266 | 265 | 'id' => 'redirect_urls_tabs', |
| @@ -294,13 +293,9 @@ | ||
| 294 | 293 | 'id' => 'new_login_url', |
| 295 | 294 | 'type' => 'text', |
| 296 | 295 | 'class' => 'new-login-url', |
| 297 | 296 | '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 | - ), | |
| 297 | + 'desc' => __('Change the login URL and prevent access to the wp-admin and <code>' . wp_login_url() . '</code> page directly.', 'adminify'), | |
| 303 | 298 | 'placeholder' => 'login', |
| 304 | 299 | 'before' => \get_site_url() . '/', |
| 305 | 300 | // 'after' => '/', |
| 306 | 301 | 'default' => $this->get_default_field('redirect_urls_fields')['redirect_urls_options']['redirect_urls_tabs']['new_login_url'], |
| @@ -310,13 +305,9 @@ | ||
| 310 | 305 | 'id' => 'redirect_admin_url', |
| 311 | 306 | 'type' => 'text', |
| 312 | 307 | 'class' => 'new-login-url redirect-admin-url', |
| 313 | 308 | '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 | - ), | |
| 309 | + 'desc' => __('Redirect users those are not logged in and trying to access <code>' . get_admin_url() . '</code>', 'adminify'), | |
| 319 | 310 | 'placeholder' => '404', |
| 320 | 311 | 'default' => $this->get_default_field('redirect_urls_fields')['redirect_urls_options']['redirect_urls_tabs']['redirect_admin_url'], |
| 321 | 312 | 'before' => \get_site_url() . '/', |
| 322 | 313 | // 'after' => '/', |
| @@ -327,14 +318,9 @@ | ||
| 327 | 318 | 'type' => 'text', |
| 328 | 319 | 'class' => 'new-login-url new-register-url', |
| 329 | 320 | 'title' => __('New Register URL', 'adminify'), |
| 330 | 321 | '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 | - ), | |
| 322 | + 'desc' => __('For default enable <strong>"Membership: Anyone can register"</strong> in <a href="' . admin_url('options-general.php#users_can_register') . '" style="color: var(--adminify-primary);">Settings → General.</a> To use custom registration: Create a Page, then paste its permalink here (e.g. /register).', 'adminify'), | |
| 337 | 323 | 'placeholder' => 'wp-login.php?action=register', |
| 338 | 324 | 'before' => \get_site_url() . '/', |
| 339 | 325 | // 'after' => '/', |
| 340 | 326 | 'default' => $this->get_default_field('redirect_urls_fields')['redirect_urls_options']['redirect_urls_tabs']['new_register_url'], |
| @@ -457,9 +443,9 @@ | ||
| 457 | 443 | 'id' => 'redirect_cap', |
| 458 | 444 | 'type' => 'select', |
| 459 | 445 | 'title' => __('Capability', 'adminify'), |
| 460 | 446 | 'placeholder' => __('Select a Capability', 'adminify'), |
| 461 | - 'options' => '\PXLBSAdminify\Inc\Classes\Helper::get_capability_options', | |
| 447 | + 'options' => '\WPAdminify\Inc\Classes\Helper::get_capability_options', | |
| 462 | 448 | 'default' => $this->get_default_field('redirect_urls_fields')['redirect_urls_options']['redirect_urls_tabs']['login_redirects']['redirect_cap'], |
| 463 | 449 | 'dependency' => ['user_types', '==', 'user_cap'], |
| 464 | 450 | ]; |
| 465 | 451 | |
| @@ -534,9 +520,9 @@ | ||
| 534 | 520 | 'id' => 'redirect_cap', |
| 535 | 521 | 'type' => 'select', |
| 536 | 522 | 'title' => __('Capability', 'adminify'), |
| 537 | 523 | 'placeholder' => __('Select a Capability', 'adminify'), |
| 538 | - 'options' => '\PXLBSAdminify\Inc\Classes\Helper::get_capability_options', | |
| 524 | + 'options' => '\WPAdminify\Inc\Classes\Helper::get_capability_options', | |
| 539 | 525 | 'default' => $this->get_default_field('redirect_urls_fields')['redirect_urls_options']['redirect_urls_tabs']['logout_redirects']['redirect_cap'], |
| 540 | 526 | 'dependency' => ['user_types', '==', 'user_cap'], |
| 541 | 527 | ]; |
| 542 | 528 | |
| @@ -573,9 +559,8 @@ | ||
| 573 | 559 | 'text_on' => __('Show', 'adminify'), |
| 574 | 560 | 'text_off' => __('Hide', 'adminify'), |
| 575 | 561 | 'text_width' => 80, |
| 576 | 562 | 'title' => __('Username Change', 'adminify'), |
| 577 | - /* translators: %s: URL to the documentation page */ | |
| 578 | 563 | 'subtitle' => sprintf(__('Remove Comments for Media attachment Template <a href="%s">More Details</a> ', 'adminify'), esc_url('https://wpadminify.com/docs')), |
| 579 | 564 | 'default' => $this->get_default_field('users_security')['change_username'], |
| 580 | 565 | ]; |
| 581 | 566 | $users_settings[] = [ |
| @@ -584,9 +569,8 @@ | ||
| 584 | 569 | 'text_on' => __('Show', 'adminify'), |
| 585 | 570 | 'text_off' => __('Hide', 'adminify'), |
| 586 | 571 | 'text_width' => 80, |
| 587 | 572 | 'title' => __('Limit Login Attempts', 'adminify'), |
| 588 | - /* translators: %s: URL to the documentation page */ | |
| 589 | 573 | '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 | 574 | 'default' => $this->get_default_field('users_security')['limit_logins'], |
| 591 | 575 | ]; |
| 592 | 576 | |
| @@ -618,9 +602,9 @@ | ||
| 618 | 602 | [ |
| 619 | 603 | 'id' => 'security_rest_api_enable', |
| 620 | 604 | 'type' => 'switcher', |
| 621 | 605 | 'class' => 'adminify-pl-0 adminify-pt-0', |
| 622 | - 'title' => '', | |
| 606 | + 'title' => __('', 'adminify'), | |
| 623 | 607 | 'text_on' => __('Show', 'adminify'), |
| 624 | 608 | 'text_off' => __('Hide', 'adminify'), |
| 625 | 609 | 'text_width' => 80, |
| 626 | 610 | 'default' => $this->get_default_field('security_rest_api')['security_rest_api_enable'], |
| @@ -627,9 +611,9 @@ | ||
| 627 | 611 | ], |
| 628 | 612 | [ |
| 629 | 613 | 'id' => 'security_rest_api_data', |
| 630 | 614 | 'type' => 'checkbox', |
| 631 | - 'title' => '', | |
| 615 | + 'title' => __('', 'adminify'), | |
| 632 | 616 | 'class' => 'adminify-one-col', |
| 633 | 617 | 'options' => $json_api_fields_data, |
| 634 | 618 | 'default' => $this->get_default_field('security_rest_api')['security_rest_api_data'], |
| 635 | 619 | 'dependency' => ['security_rest_api_enable', '==', 'true', true], |
| @@ -671,9 +655,9 @@ | ||
| 671 | 655 | 'fields' => [ |
| 672 | 656 | [ |
| 673 | 657 | 'id' => 'post_archives_enable', |
| 674 | 658 | 'type' => 'switcher', |
| 675 | - 'title' => '', | |
| 659 | + 'title' => __('', 'adminify'), | |
| 676 | 660 | 'text_on' => __('Show', 'adminify'), |
| 677 | 661 | 'text_off' => __('Hide', 'adminify'), |
| 678 | 662 | 'text_width' => 80, |
| 679 | 663 | 'class' => 'adminify-pl-0 adminify-pt-0', |
| @@ -682,9 +666,9 @@ | ||
| 682 | 666 | [ |
| 683 | 667 | 'id' => 'post_archives_data', |
| 684 | 668 | 'type' => 'checkbox', |
| 685 | 669 | 'class' => 'adminify-one-col', |
| 686 | - 'title' => '', | |
| 670 | + 'title' => __('', 'adminify'), | |
| 687 | 671 | 'options' => $archive_fields_data, |
| 688 | 672 | 'default' => $this->get_default_field('post_archives')['post_archives_data'], |
| 689 | 673 | 'dependency' => ['post_archives_enable', '==', 'true', true], |
| 690 | 674 | ], |
| @@ -709,9 +693,8 @@ | ||
| 709 | 693 | 'id' => 'enable', |
| 710 | 694 | 'type' => 'switcher', |
| 711 | 695 | 'title' => '', |
| 712 | 696 | 'class' => 'adminify-pt-0 adminify-pl-0 adminify-col-fit', |
| 713 | - /* translators: %s: URL to the Discussion settings page */ | |
| 714 | 697 | '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 | 698 | 'text_on' => __('Yes', 'adminify'), |
| 716 | 699 | 'text_off' => __('No', 'adminify'), |
| 717 | 700 | 'text_width' => 80, |
| @@ -759,10 +742,9 @@ | ||
| 759 | 742 | $fields[] = [ |
| 760 | 743 | 'id' => 'disable_automatic_emails', |
| 761 | 744 | 'type' => 'switcher', |
| 762 | 745 | '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()), | |
| 746 | + 'title' => sprintf(__('Disable Automatic Updates Emails %s', 'adminify'), Utils::adminify_upgrade_pro_badge()), | |
| 765 | 747 | 'subtitle' => __('Stop getting emails about automatic updates on your WordPress site.', 'adminify'), |
| 766 | 748 | 'text_on' => __('Yes', 'adminify'), |
| 767 | 749 | 'text_off' => __('No', 'adminify'), |
| 768 | 750 | 'text_width' => 80, |
| @@ -772,10 +754,9 @@ | ||
| 772 | 754 | $fields[] = [ |
| 773 | 755 | 'id' => 'disable_language_switcher_login', |
| 774 | 756 | 'type' => 'switcher', |
| 775 | 757 | '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()), | |
| 758 | + 'title' => sprintf(__('Disable Login Screen Language Switcher %s', 'adminify'), Utils::adminify_upgrade_pro_badge()), | |
| 778 | 759 | 'subtitle' => __('Hide the Language Switcher on the default WordPress login screen.', 'adminify'), |
| 779 | 760 | 'text_on' => __('Yes', 'adminify'), |
| 780 | 761 | 'text_off' => __('No', 'adminify'), |
| 781 | 762 | 'text_width' => 80, |
| @@ -800,14 +781,11 @@ | ||
| 800 | 781 | 'discussion_menu' => __('Remove Discussion Menu from "Settings>Discussion" Sub Menu', 'adminify'), |
| 801 | 782 | 'close_front' => __('Close Comments from front-end', 'adminify'), |
| 802 | 783 | 'comments_notes' => __('Remove "Your email address will not be published..." from comment form template', 'adminify'), |
| 803 | 784 | '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()), | |
| 785 | + 'replace_author_link' => sprintf(__('Remove Link from comment "Author Name" & replace to JavaScript? %s'), Utils::adminify_upgrade_pro_class()), | |
| 786 | + '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()), | |
| 787 | + 'hide_existing' => sprintf(__('Hide Existing Comments from Frontend? %s', 'adminify'), Utils::adminify_upgrade_pro_class()), | |
| 810 | 788 | ]; |
| 811 | 789 | |
| 812 | 790 | // check if WP_Widget_Recent_Comments is used |
| 813 | 791 | // $recentcomments = []; |
| @@ -824,9 +802,9 @@ | ||
| 824 | 802 | 'fields' => [ |
| 825 | 803 | [ |
| 826 | 804 | 'id' => 'enable_disable_comments', |
| 827 | 805 | 'type' => 'switcher', |
| 828 | - 'title' => '', | |
| 806 | + 'title' => __('', 'adminify'), | |
| 829 | 807 | 'class' => 'adminify-pl-0 adminify-pt-0', |
| 830 | 808 | 'text_on' => __('Show', 'adminify'), |
| 831 | 809 | 'text_off' => __('Hide', 'adminify'), |
| 832 | 810 | 'text_width' => 80, |
| @@ -836,9 +814,9 @@ | ||
| 836 | 814 | 'id' => 'post_types', |
| 837 | 815 | 'type' => 'checkbox', |
| 838 | 816 | 'title' => __('for Post Types', 'adminify'), |
| 839 | 817 | 'subtitle' => __('Check for enable Post Types', 'adminify'), |
| 840 | - 'options' => 'PXLBSAdminify\Inc\Admin\Options\Productivity::get_all_post_types', | |
| 818 | + 'options' => 'WPAdminify\Inc\Admin\Options\Productivity::get_all_post_types', | |
| 841 | 819 | 'default' => $this->get_default_field('disable_comments')['post_types'], |
| 842 | 820 | 'dependency' => ['enable_disable_comments', '==', 'true', true], |
| 843 | 821 | ], |
| 844 | 822 | // [ |
| @@ -844,9 +822,9 @@ | ||
| 844 | 822 | // [ |
| 845 | 823 | // 'id' => 'disable_comments_post_types', |
| 846 | 824 | // 'type' => 'notice', |
| 847 | 825 | // 'style' => 'warning', |
| 848 | - // 'content' => Utils::upgrade_pro_notice(), | |
| 826 | + // 'content' => Utils::adminify_upgrade_pro(), | |
| 849 | 827 | // 'dependency' => [ |
| 850 | 828 | // [ 'post_types', 'not-any', 'post,page', 'true' ], |
| 851 | 829 | // [ 'post_types', '!=', '', 'true' ], |
| 852 | 830 | // ], |
| @@ -853,9 +831,9 @@ | ||
| 853 | 831 | // ], |
| 854 | 832 | [ |
| 855 | 833 | 'id' => 'apply_for', |
| 856 | 834 | 'type' => 'checkbox', |
| 857 | - 'title' => '', | |
| 835 | + 'title' => __('', 'adminify'), | |
| 858 | 836 | 'class' => 'adminify-one-col', |
| 859 | 837 | 'options' => $disable_comments_for, |
| 860 | 838 | 'default' => $this->get_default_field('disable_comments')['apply_for'], |
| 861 | 839 | 'dependency' => ['enable_disable_comments', '==', 'true', true], |
| @@ -875,14 +853,14 @@ | ||
| 875 | 853 | |
| 876 | 854 | $fields[] = [ |
| 877 | 855 | 'id' => 'security_subheading', |
| 878 | 856 | 'type' => 'subheading', |
| 879 | - 'content' => Utils::help_urls( | |
| 857 | + 'content' => Utils::adminfiy_help_urls( | |
| 880 | 858 | __('"WordPress" White Label Settings', 'adminify'), |
| 881 | 859 | 'https://wpadminify.com/docs/security/', |
| 882 | 860 | '', |
| 883 | 861 | 'https://www.facebook.com/groups/jeweltheme', |
| 884 | - \PXLBSAdminify\Inc\Admin\AdminSettings::support_url() | |
| 862 | + \WPAdminify\Inc\Admin\AdminSettings::support_url() | |
| 885 | 863 | ) |
| 886 | 864 | ]; |
| 887 | 865 | |
| 888 | 866 | $this->security_redirect_urls( $fields ); |
| @@ -895,9 +873,9 @@ | ||
| 895 | 873 | // $this->security_others( $fields ); |
| 896 | 874 | |
| 897 | 875 | $this->security_custom_gravatar( $fields ); |
| 898 | 876 | |
| 899 | - $fields = apply_filters('pxlbsadminify_settings/security', $fields, $this); | |
| 877 | + $fields = apply_filters('adminify_settings/security', $fields, $this); | |
| 900 | 878 | |
| 901 | 879 | // Tweaks Section |
| 902 | 880 | \ADMINIFY::createSection( |
| 903 | 881 | $this->prefix, |