Plugin Directory

Changeset 3201795


Ignore:
Timestamp:
12/03/2024 03:06:54 PM (13 months ago)
Author:
shinephp
Message:
  • Update: Marked as compatible with WordPress 6.7.1
  • Fix: PHP Notice: "Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the <code>user-role-editor</code> domain was triggered too early." was fixed (shown only for those who used own .mo translation file installed).
  • Fix: Miscellaneous translation functionality (l18n) usage enhancements were applied.
Location:
user-role-editor/trunk
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • user-role-editor/trunk/changelog.txt

    r3037617 r3201795  
    11CHANGES LOG (full version).
    22===========================
     3
     4= [4.64.3] 03.12.2024 =
     5* Update: Marked as compatible with WordPress 6.7.1
     6* Fix: PHP Notice:  "Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the <code>user-role-editor</code> domain was triggered too early." was fixed (shown only for those who used own .mo translation file installed).
     7* Fix: Miscellaneous translation functionality (l18n) usage enhancements were applied.
    38
    49= [4.64.2] 19.02.2024 =
  • user-role-editor/trunk/includes/classes/capabilities.php

    r2834853 r3201795  
    5454        $cap = array();
    5555        $cap['inner'] = $cap_id;
    56         $cap['human'] = esc_html__( $this->convert_cap_to_readable( $cap_id ) , 'user-role-editor' );
     56        $cap['human'] = $this->convert_cap_to_readable( $cap_id );
    5757        if ( isset( $this->built_in_wp_caps[$cap_id] ) ) {
    5858            $cap['wp_core'] = true;
  • user-role-editor/trunk/includes/classes/capability.php

    r2834853 r3201795  
    108108            $wp_roles->use_db = $use_db;
    109109            $response['result'] = 'success';
     110            // translators: placeholder %s is replaced by added user capability id string value
    110111            $response['message'] = sprintf( esc_html__( 'Capability %s was added successfully', 'user-role-editor' ), $cap_id );
    111112        } else {
     113            // translators: placeholder %s is replaced by existed user capability id string value
    112114            $response['message']  = sprintf( esc_html__( 'Capability %s exists already', 'user-role-editor' ), $cap_id );
    113115        }
     
    220222       
    221223        if ( count( $caps )==1 ) {
     224            // translators: placeholder %s is replaced by removed user capability id string value
    222225            $mess = sprintf( esc_html__( 'Capability %s was removed successfully', 'user-role-editor' ), $caps[0] );
    223226        } else {
  • user-role-editor/trunk/includes/classes/editor.php

    r2982954 r3201795  
    10291029        $wp_roles = wp_roles();       
    10301030        if ( isset( $wp_roles->roles[$role_id] ) ) {
    1031             $response['message'] = sprintf( 'Error! ' . esc_html__( 'Role %s exists already', 'user-role-editor' ), $role_id );
     1031            // translators: placeholder %s is replaced by existed user role id string value
     1032            $response['message'] = 'Error! ' . sprintf( esc_html__( 'Role %s exists already', 'user-role-editor' ), $role_id );
    10321033            return $response;
    10331034        }
     
    10351036        $role_name = $this->lib->get_request_var( 'user_role_name', 'post' );
    10361037        if ( empty( $role_name ) ) {
    1037             $role_name = $role_id;  // as user role name is empty, use user role ID instead as a default value
     1038            // as user role name is empty, use user role ID instead as a default value
     1039            $role_name = $role_id; 
    10381040        }
    10391041        $this->current_role = $role_id;
     
    10431045            $capabilities = $this->remove_caps_not_allowed_for_single_admin( $role->capabilities );
    10441046        } else {
    1045             $capabilities = array('read' => true, 'level_0' => true);   // Use subscriber role permissions as a default value
     1047            // Use subscriber role permissions as a default value
     1048            $capabilities = array('read' => true, 'level_0' => true);   
    10461049        }       
    10471050        // add new role to the roles array     
     
    10551058        $response['role_id'] = $role_id;
    10561059        $response['role_name'] = $role_name;
    1057         $response['message'] = sprintf(esc_html__('Role %s is created successfully', 'user-role-editor'), $role_name );
     1060        // translators: placeholder %s is replaced by created user role id string value
     1061        $response['message'] = sprintf( esc_html__('Role %s is created successfully', 'user-role-editor'), $role_name );
    10581062               
    10591063       
     
    11471151        $wp_roles = wp_roles();
    11481152        if ( !isset( $wp_roles->roles[$role_id] ) ) {
    1149             $response['message'] = sprintf('Error! ' . esc_html__('Role %s does not exists', 'user-role-editor'), $role_id);
     1153            // translators: placeholder %s is replaced by not existed user role id string value
     1154            $response['message'] = 'Error! '. sprintf( esc_html__('Role %s does not exists', 'user-role-editor'), $role_id );
    11501155            return $response;
    11511156        }
     
    11601165       
    11611166        $response['result'] = 'success';
    1162         $response['message'] = sprintf( esc_html__('Role %s is renamed to %s successfully', 'user-role-editor'), $old_role_name, $new_role_name );
     1167        // translators: 1st placeholder %s is replaced by original user role name, 2nd placehoder is replaced by new user role name
     1168        $response['message'] = sprintf( esc_html__('Role %1$s is renamed to %2$s successfully', 'user-role-editor'), $old_role_name, $new_role_name );
    11631169        $response['role_id'] = $role_id;
    11641170        $response['role_name'] = $new_role_name;
     
    12941300                $response['message'] = esc_html__( 'Unused roles are deleted successfully', 'user-role-editor' );
    12951301            } else {
     1302                // translators: placeholder %s is replaced by not deleted user role id string value
    12961303                $response['message'] = sprintf( esc_html__( 'Role %s is deleted successfully', 'user-role-editor' ), $role_id );
    12971304            }
     
    13381345            $this->wp_default_role = get_option( 'default_role' );
    13391346            if ($this->wp_default_role===$role_id) {
    1340                 $mess = sprintf(esc_html__('Default role for new users is set to %s successfully', 'user-role-editor'), $wp_roles->role_names[$role_id]);
     1347                // translators: placeholder %s is replaced by default user role name
     1348                $mess = sprintf( esc_html__('Default role for new users is set to %s successfully', 'user-role-editor'), $wp_roles->role_names[$role_id] );
    13411349            } else {
    13421350                $mess = 'Error! ' . esc_html__('Error encountered during default role change operation', 'user-role-editor');
     
    13451353            $mess = 'Error! ' . esc_html__('Can not set Administrator role as a default one', 'user-role-editor');
    13461354        } else {
    1347             $mess = 'Error! ' . esc_html__('This role does not exist - ', 'user-role-editor') . esc_html($role_id);
     1355            $mess = 'Error! ' . esc_html__('This role does not exist - ', 'user-role-editor') . esc_html( $role_id );
    13481356        }
    13491357       
     
    14801488        ?>
    14811489        <div class="wrap">
    1482             <h1><?php _e('User Role Editor', 'user-role-editor'); ?></h1>
     1490            <h1><?php esc_html_e('User Role Editor', 'user-role-editor'); ?></h1>
    14831491            <div id="ure_container">               
    14841492                <div id="user_role_editor" class="ure-table-cell" >
  • user-role-editor/trunk/includes/classes/grant-roles.php

    r3037617 r3201795  
    376376?>       
    377377        <span style="font-weight: bold;">
    378             <?php esc_html_e('Primary Role: ', 'role-editor');?>
     378            <?php esc_html_e('Primary Role: ', 'user-role-editor');?>
    379379        </span>
    380380        <select name="primary_role" id="primary_role">
     
    382382        // print the full list of roles with the primary one selected.
    383383        wp_dropdown_roles('');
    384         echo '<option value="'. self::NO_ROLE_FOR_THIS_SITE .'">' . esc_html__('&mdash; No role for this site &mdash;') . '</option>'. PHP_EOL;
     384        echo '<option value="'. self::NO_ROLE_FOR_THIS_SITE .'">' . esc_html__('&mdash; No role for this site &mdash;', 'user-role-editor') . '</option>'. PHP_EOL;
    385385?>       
    386386        </select>
     
    396396            <span style="font-weight: bold;">
    397397<?php         
    398         esc_html_e('Other Roles: ', 'role-editor');
     398        esc_html_e('Other Roles: ', 'user-role-editor');
    399399?>       
    400400        </span><br>
    401401<?php       
     402        // Is PolyLang plugin active?
     403        $use_pll = function_exists('pll__');   
     404       
    402405        $show_admin_role = $this->lib->show_admin_role_allowed();       
    403406        $roles = $this->lib->get_all_editable_roles();
     
    406409                continue;
    407410            }
     411            $role_name = $use_pll ? pll__( $role['name'] ) : $role['name'];
    408412            echo '<label for="wp_role_' . $role_id . '"><input type="checkbox"  id="wp_role_' . $role_id .
    409413                 '" name="ure_roles[]" value="' . $role_id . '" />&nbsp;' .
    410             esc_html__($role['name'], 'user-role-editor') .' ('. $role_id .')</label><br />'. PHP_EOL;           
     414            esc_html( $role_name ) .' ('. $role_id .')</label><br />'. PHP_EOL;
    411415        }
    412416?>
  • user-role-editor/trunk/includes/classes/lib.php

    r3037617 r3201795  
    387387           
    388388            <strong><?php esc_html_e('Version:', 'user-role-editor');?></strong> <?php echo URE_VERSION; ?><br/><br/>
    389             <a class="ure_rsb_link" style="background-image:url(<?php echo URE_PLUGIN_URL . 'images/vladimir.png'; ?>);" target="_blank" href="http://www.shinephp.com/"><?php _e("Author's website", 'user-role-editor'); ?></a><br/>
    390             <a class="ure_rsb_link" style="background-image:url(<?php echo URE_PLUGIN_URL . 'images/user-role-editor-icon.png'; ?>);" target="_blank" href="https://www.role-editor.com"><?php _e('Plugin webpage', 'user-role-editor'); ?></a><br/>
    391             <a class="ure_rsb_link" style="background-image:url(<?php echo URE_PLUGIN_URL . 'images/user-role-editor-icon.png'; ?>);" target="_blank" href="https://www.role-editor.com/download-plugin"><?php _e('Plugin download', 'user-role-editor'); ?></a><br/>
    392             <a class="ure_rsb_link" style="background-image:url(<?php echo URE_PLUGIN_URL . 'images/changelog-icon.png'; ?>);" target="_blank" href="https://www.role-editor.com/changelog"><?php _e('Changelog', 'user-role-editor'); ?></a><br/>
    393             <a class="ure_rsb_link" style="background-image:url(<?php echo URE_PLUGIN_URL . 'images/faq-icon.png'; ?>);" target="_blank" href="http://www.shinephp.com/user-role-editor-wordpress-plugin/#faq"><?php _e('FAQ', 'user-role-editor'); ?></a><br/>
    394 <?php
    395 /*
    396             <hr />
    397                 <div style="text-align: center;">
    398                     <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
    399                         <input type="hidden" name="cmd" value="_s-xclick">
    400                         <input type="hidden" name="encrypted"
    401                                value="-----BEGIN PKCS7-----MIIHZwYJKoZIhvcNAQcEoIIHWDCCB1QCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNA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CwcQ0iq77wd0alnWoknvhBBoFC/U0yJ3XmA3Hkgrcu6yhVijY/Odmf6WWcz79/uLGkvBSECbjTY0GLxvhRlsh2nAioCfxAr1cFo-----END PKCS7-----">
    402                         <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
    403                         <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">                       
    404                     </form>                       
    405                 </div>
    406 */
    407 ?>
    408            
     389            <a class="ure_rsb_link" style="background-image:url(<?php echo URE_PLUGIN_URL . 'images/vladimir.png'; ?>);" target="_blank" href="http://www.shinephp.com/"><?php esc_html_e("Author's website", 'user-role-editor'); ?></a><br/>
     390            <a class="ure_rsb_link" style="background-image:url(<?php echo URE_PLUGIN_URL . 'images/user-role-editor-icon.png'; ?>);" target="_blank" href="https://www.role-editor.com"><?php esc_html_e('Plugin webpage', 'user-role-editor'); ?></a><br/>
     391            <a class="ure_rsb_link" style="background-image:url(<?php echo URE_PLUGIN_URL . 'images/user-role-editor-icon.png'; ?>);" target="_blank" href="https://www.role-editor.com/download-plugin"><?php esc_html_e('Plugin download', 'user-role-editor'); ?></a><br/>
     392            <a class="ure_rsb_link" style="background-image:url(<?php echo URE_PLUGIN_URL . 'images/changelog-icon.png'; ?>);" target="_blank" href="https://www.role-editor.com/changelog"><?php esc_html_e('Changelog', 'user-role-editor'); ?></a><br/>
     393            <a class="ure_rsb_link" style="background-image:url(<?php echo URE_PLUGIN_URL . 'images/faq-icon.png'; ?>);" target="_blank" href="http://www.shinephp.com/user-role-editor-wordpress-plugin/#faq"><?php esc_html_e('FAQ', 'user-role-editor'); ?></a><br/>           
    409394<?php         
    410395    }
  • user-role-editor/trunk/includes/classes/role-view.php

    r2982954 r3201795  
    66 * @subpackage Admin
    77 * @author     Vladimir Garagulya <[email protected]>
    8  * @copyright  Copyright (c) 2010 - 2016, Vladimir Garagulya
     8 * @copyright  Copyright (c) 2010 - 2024, Vladimir Garagulya
    99 **/
    1010class URE_Role_View extends URE_View {
     
    4545            $disabled = ($key==='administrator' && $caps_access_restrict_for_simple_admin && !$this->lib->is_super_admin()) ? 'disabled' : '';
    4646            if ($show_admin_role || $key != 'administrator') {
    47                 $this->role_default_html .= '<option value="' . $key . '" ' . $selected .' '. $disabled .'>'. $value['name'] .' (' . $key . ')</option>';
     47                $this->role_default_html .= '<option value="' . $key . '" ' . $selected .' '. $disabled .'>'. esc_html( $value['name'] ) .' (' . $key . ')</option>';
    4848            }
    4949        }
     
    7676            $disabled = ( $key==='administrator' && $caps_access_restrict_for_simple_admin && !$this->lib->is_super_admin()) ? 'disabled' : '';
    7777            if ( $show_admin_role || $key != 'administrator' ) {
    78                 $role_name = $value['name'] .' (' . $key . ')';
     78                $role_name = esc_html( $value['name'] ) .' (' . $key . ')';
    7979                $this->role_select_html .= '<option value="' . $key . '" ' . $selected1 .' '. $disabled .'>' . $role_name . '</option>';
    8080                $this->role_to_copy_html .= '<option value="' . $key .'" '. $disabled .'>' . $role_name . '</option>';
     
    9494            $this->role_delete_html = '<select id="del_user_role" name="del_user_role" width="250" style="width: 250px">';
    9595            foreach ($roles_can_delete as $key => $value) {
    96                 $this->role_delete_html .= '<option value="' . $key . '">' . esc_html__($value, 'user-role-editor') . '</option>';
     96                $this->role_delete_html .= '<option value="' . $key . '">' . esc_html( $value ) . '</option>';
    9797            }
    9898            $this->role_delete_html .= '<option value="-1" style="color: red;">' . esc_html__('Delete All Unused Roles', 'user-role-editor') . '</option>';
     
    367367        }
    368368        if ($multisite && $active_for_network && !is_network_admin() && is_main_site(get_current_blog_id()) && $this->lib->is_super_admin()) {
    369             $hint = esc_html__('If checked, then apply action to ALL sites of this Network');
     369            $hint = esc_html__( 'If checked, then apply action to ALL sites of this Network', 'user-role-editor' );
    370370            $apply_to_all = $this->editor->get('apply_to_all');
    371371            if ($apply_to_all) {
  • user-role-editor/trunk/includes/classes/screen-help.php

    r2265379 r3201795  
    1313            <p>
    1414            <ul>
    15             <li><strong>' . esc_html__('Show Administrator role at User Role Editor', 'user-role-editor').'</strong> - ' .
    16                 esc_html__('turn this option on in order to make the "Administrator" role available at the User Role Editor '
    17                         . 'roles selection drop-down list. It is hidden by default for security reasons.','user-role-editor') . '</li>
     15            <li><strong>' . esc_html__('Show Administrator role at User Role Editor', 'user-role-editor') .'</strong> - ' .
     16                esc_html__('turn this option on in order to make the "Administrator" role available at the User Role Editor roles selection drop-down list.', 'user-role-editor') .' '.
     17                esc_html__('It is hidden by default for security reasons.','user-role-editor') . '</li>
    1818            <li><strong>' . esc_html__('Show capabilities in the human readable form','user-role-editor').'</strong> - ' .
    19                 esc_html__('automatically converts capability names from the technical form for internal use like '
    20                         . '"edit_others_posts" to more user friendly form, e.g. "Edit others posts".','user-role-editor') . '</li>
    21             <li><strong>' . esc_html__('Show deprecated capabilities','user-role-editor').'</strong> - '.
    22                 esc_html__('Capabilities like "level_0", "level_1" are deprecated and are not used by WordPress. '
    23                         . 'They are left at the user roles for the compatibility purpose with old themes and plugins code. '
    24                         . 'Turning on this option will show those deprecated capabilities.', 'user-role-editor') . '</li>
     19                esc_html__('automatically converts capability names from the technical form for internal use like "edit_others_posts" to more user friendly form, e.g. "Edit others posts".','user-role-editor') . '</li>
     20            <li><strong>' . esc_html__('Show deprecated capabilities','user-role-editor') .'</strong> - '.
     21                esc_html__('Capabilities like "level_0", "level_1" are deprecated and are not used by WordPress.','user-role-editor') .' '.
     22                esc_html__('They are left at the user roles for the compatibility purpose with old themes and plugins code.','user-role-editor') .' '.
     23                esc_html__('Turning on this option will show those deprecated capabilities.', 'user-role-editor') . '</li>
    2524            <li><strong>' . esc_html__('Confirm role update','user-role-editor').'</strong> - ' .
    26                 esc_html__('Show confirmation dialog before save changes made to a current role.') . '</li>
    27             <li><strong>' . esc_html__('Edit user capabilities','user-role-editor').'</strong> - '.
    28                 esc_html__('If turned off - capabilities section of selected user is shown in readonly mode. '
    29                         . 'Administrator can not assign capabilities to the user directly. '
    30                         . 'He should do it using roles only.', 'user-role-editor') . '</li>';
     25                esc_html__('Show confirmation dialog before save changes made to a current role.', 'user-role-editor') . '</li>
     26            <li><strong>' . esc_html__('Edit user capabilities','user-role-editor') .'</strong> - '.
     27                esc_html__('If turned off - capabilities section of selected user is shown in readonly mode.','user-role-editor'). ' '.
     28                esc_html__('Administrator can not assign capabilities to the user directly.','user-role-editor'). ' '.
     29                esc_html__('He should do it using roles only.', 'user-role-editor') . '</li>';
    3130
    3231        $text = apply_filters('ure_get_settings_general_tab_help', $text);
     
    4544            <ul>';
    4645        if (!is_multisite()) {
    47             $text .= '<li><strong>' . esc_html__('Count users without role', 'user-role-editor').'</strong> - ' .
    48                      esc_html__('Show at the "Users" page a quant of users without role. Module allows to assign all of them '.
    49                      'an empty role "No rights", in order to look on the users list with role "No rights" at the separate tab then.','user-role-editor') . '</li>';       
     46            $text .= '<li><strong>' . esc_html__('Count users without role', 'user-role-editor') .'</strong> - ' .
     47                     esc_html__('Show at the "Users" page a quant of users without role. Module allows to assign all of them ', 'user-role-editor') .' '.
     48                     esc_html__('an empty role "No rights", in order to look on the users list with role "No rights" at the separate tab then.','user-role-editor') .
     49                    '</li>';       
    5050        }
    5151        $text = apply_filters('ure_get_settings_additional_modules_tab_help', $text);
     
    6363            <p>
    6464            <ul>
    65             <li><strong>' . esc_html__('Other default roles for new registered user', 'user-role-editor').'</strong> - ' .
    66                 esc_html__('select roles below to assign them to the new user automatically as an addition to the primary role. '.
    67                 'Note for multisite environment: take into account that other default roles should exist at the site, '.
    68                 'in order to be assigned to the new registered users.','user-role-editor') . '</li>';       
     65            <li><strong>' . esc_html__('Other default roles for new registered user', 'user-role-editor') .'</strong> - ' .
     66                esc_html__('select roles below to assign them to the new user automatically as an addition to the primary role.', 'user-role-editor') .' '.
     67                esc_html__('Note for multisite environment: take into account that other default roles should exist at the site,', 'user-role-editor') .' '.
     68                esc_html__('in order to be assigned to the new registered users.','user-role-editor') . '</li>';
    6969       
    7070        $text = apply_filters('ure_get_settings_default_roles_tab_help', $text);
     
    8282            <p>
    8383            <ul>
    84                 <li><strong>' . esc_html__( 'Allow non super-administrators to create, edit and delete users', 'user-role-editor' ).'</strong> - '.
    85                 esc_html__( 'Super administrator only may create, edit and delete users under WordPress multi-site by default. '.
    86                                                                                                                 'Turn this option on in order to remove this limitation.','user-role-editor' ) .'</li>';
     84                <li><strong>' . esc_html__( 'Allow non super-administrators to create, edit and delete users', 'user-role-editor' ) .'</strong> - '.
     85                esc_html__( 'Super administrator only may create, edit and delete users under WordPress multi-site by default.', 'user-role-editor' ) .' '.
     86                esc_html__('Turn this option on in order to remove this limitation.','user-role-editor' ) .'</li>';
    8787       
    8888        $text = apply_filters('ure_get_settings_multisite_tab_help', $text);
    8989        $text .='
    9090            </ul>
    91                 </p>';
     91            </p>';
    9292       
    9393        return $text;
  • user-role-editor/trunk/includes/classes/user-other-roles.php

    r3037617 r3201795  
    216216        $output = '';
    217217        foreach ($user->caps as $cap => $value) {
    218             if (!$wp_roles->is_role($cap)) {
    219                 if ('' != $output) {
    220                     $output .= ', ';
    221                 }
    222                 $output .= $value ? $cap : sprintf(__('Denied: %s'), $cap);
    223             }
     218            if ( $wp_roles->is_role( $cap ) ) {
     219                continue;
     220            }
     221            if ('' !== $output) {
     222                $output .= ', ';
     223            }
     224            // translators: placeholder %s is replaced by denied user capability id string value
     225            $output .= $value ? $cap : sprintf(__('Denied: %s', 'user-role-editor'), $cap);
    224226        }
    225227       
  • user-role-editor/trunk/includes/classes/user-role-editor.php

    r3037617 r3201795  
    117117       
    118118        add_action( 'admin_init', array($this, 'plugin_init'), 1 );
    119 
    120         // Add the translation function after the plugins loaded hook.
    121         add_action('plugins_loaded', array($this, 'load_translation'));
     119        add_action('init', array($this, 'load_translation'));
    122120
    123121        // add own submenu
     
    482480
    483481    /**
    484      * Load plugin translation files - linked to the 'plugins_loaded' action
     482     * Load plugin translation files - linked to the 'init' action
    485483     *
    486484     */
     
    945943     *
    946944     */
    947     function translate_custom_roles( $roles ) {               
    948        
     945    function translate_custom_roles( $roles ) {
     946
     947        $use_pll = function_exists('pll__');
     948
    949949        foreach ($roles as $key => $value) {
    950             $translated_name = esc_html__( $value['name'], 'user-role-editor' );  // get translation from URE language file, if exists
    951             if ( $translated_name === $value['name'] ) {
    952                 if ( $this->lib->is_wp_built_in_role( $key ) ) {
    953                     // get WordPress internal translation
    954                     $translated_name = translate_user_role( $translated_name );
    955                 } elseif ( function_exists('pll_register_string') ) {   
    956                     // Integration with PolyLang plugin (https://wordpress.org/plugins/polylang/)                       
    957                     $translated_name = pll__( $translated_name );
    958                 }
     950            $role_name = $value['name'];
     951            if ($this->lib->is_wp_built_in_role($key)) {
     952                // get WordPress internal translation
     953                $translated_name = translate_user_role( $role_name );
     954            } elseif ($use_pll) {
     955                // Integration with PolyLang plugin (https://wordpress.org/plugins/polylang/)                        
     956                $translated_name = pll__($role_name);
     957            } else {    // translation is not available
     958                $translated_name = $role_name;
    959959            }
    960             $roles[$key]['name'] = $translated_name;
    961         }
    962        
     960            $roles[$key]['name'] = esc_html( $translated_name );
     961        }
     962
    963963        $roles = apply_filters('ure_editable_roles', $roles );
    964        
     964
    965965        return $roles;
    966     } 
     966    }
    967967    // end of translate_custom_roles()
    968968   
  • user-role-editor/trunk/includes/classes/user-view.php

    r2949187 r3201795  
    5757            if (class_exists('user_switching') && current_user_can('switch_to_user', $this->user_to_edit->ID)) {
    5858                $switch_to_user_link = user_switching::switch_to_url($this->user_to_edit);
    59                 $switch_to_user = '<a href="' . esc_url($switch_to_user_link) . '">' . esc_html__('Switch&nbsp;To', 'user-switching') . '</a>';
     59                $switch_to_user = '<a href="' . esc_url($switch_to_user_link) . '">' . esc_html__('Switch&nbsp;To', 'user-role-editor') . '</a>';
    6060            }
    6161        } else {
     
    9494        // print the 'no role' option. Make it selected if the user has no role yet.       
    9595        $selected = ( empty($user_primary_role) ) ? 'selected="selected"' : '';
    96         echo '<option value="" '. $selected.'>' . esc_html__('&mdash; No role for this site &mdash;') . '</option>';
     96        echo '<option value="" '. $selected.'>' . esc_html__('&mdash; No role for this site &mdash;', 'user-role-editor') . '</option>';
    9797?>
    9898        </select>
     
    106106        $values = array_values($this->user_to_edit->roles);
    107107        $primary_role = array_shift($values);  // get 1st element from roles array
     108       
     109        // Is PolyLang plugin active?
     110        $use_pll = function_exists('pll__');   
     111       
    108112        $roles = $this->editor->get('roles');
    109113        foreach ($roles as $role_id => $role) {
    110114            if (($show_admin_role || $role_id != 'administrator') && ($role_id !== $primary_role)) {
    111                 if ($this->editor->user_can($role_id)) {
     115                if ( $this->editor->user_can( $role_id ) ) {
    112116                    $checked = 'checked="checked"';
    113117                } else {
    114118                    $checked = '';
    115119                }
     120                $role_name = $use_pll ? pll__( $role['name'] ) : $role['name'];
    116121                echo '<label for="wp_role_' . $role_id . '"><input type="checkbox"  id="wp_role_' . $role_id .
    117122                     '" name="wp_role_' . $role_id . '" value="' . $role_id . '"' . $checked . ' />&nbsp;' .
    118                 esc_html__($role['name'], 'user-role-editor') . '</label><br />';
     123                esc_html( $role_name ) . '</label><br />';
    119124            }
    120125        }
  • user-role-editor/trunk/includes/classes/view.php

    r2949187 r3201795  
    207207                $cap_ind_alt = 'human';
    208208            }
    209             $cap_html .= '<label for="' . $cap_id_esc . '" id="' . $cap_id_esc . '_label" title="' . $capability[$cap_ind_alt] . '" ' . $label_style . ' >'.
    210                  $capability[$cap_ind] . '</label> </div>';
     209            $cap_html .= '<label for="' . $cap_id_esc . '" id="' . $cap_id_esc . '_label" title="' . esc_html( $capability[$cap_ind_alt] ) . '" ' . $label_style . ' >'.
     210                 esc_html( $capability[$cap_ind] ) . '</label> </div>';
    211211           
    212212            $output .= $cap_html;
  • user-role-editor/trunk/readme.txt

    r3186827 r3201795  
    33Tags: user, role, editor, security, access
    44Requires at least: 4.4
    5 Tested up to: 6.7
     5Tested up to: 6.7.1
    66Stable tag: 4.64.2
    77Requires PHP: 7.3
     
    8383== Changelog =
    8484
     85= [4.64.3] 03.12.2024 =
     86* Update: Marked as compatible with WordPress 6.7.1
     87* Fix: PHP Notice:  "Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the <code>user-role-editor</code> domain was triggered too early." was fixed (shown only for those who used own .mo translation file installed).
     88* Fix: Miscellaneous translation functionality (l18n) usage enhancements were applied.
     89
    8590= [4.64.2] 19.02.2024 =
    8691* Update: Marked as compatible with WordPress 6.4.3
  • user-role-editor/trunk/user-role-editor.php

    r3037617 r3201795  
    44Plugin URI: https://www.role-editor.com
    55Description: Change/add/delete WordPress user roles and capabilities.
    6 Version: 4.64.2
     6Version: 4.64.3
    77Author: Vladimir Garagulya
    88Author URI: https://www.role-editor.com
     
    3030}
    3131
    32 define( 'URE_VERSION', '4.64.2' );
     32define( 'URE_VERSION', '4.64.3' );
    3333define( 'URE_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
    3434define( 'URE_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
Note: See TracChangeset for help on using the changeset viewer.