Plugin Directory

Changeset 2933413


Ignore:
Timestamp:
07/03/2023 12:36:35 PM (3 years ago)
Author:
krishaweb
Message:

Release v1.9

Location:
mass-users-password-reset
Files:
43 added
7 edited

Legend:

Unmodified
Added
Removed
  • mass-users-password-reset/trunk/admin/template/mupr-admin.php

    r2282159 r2933413  
    11<?php
    22$spinner = '';
    3 if( isset( $_GET[ 'tab' ] ) && 'user-list' !== $_GET[ 'tab' ] ) {
    4     $active_tab = $_GET[ 'tab' ];
     3if ( isset( $_GET['tab'] ) && 'user-list' !== $_GET['tab'] ) {
     4    $active_tab = $_GET['tab'];
    55} else {
    66    $active_tab = 'user-list';
    7     $spinner = '<div class="spinner"></div>';
     7    $spinner    = '<div class="spinner"></div>';
    88}
    99?>
     
    2222                    <?php
    2323                        $steps = apply_filters( 'mupr_steps', $this->steps );
    24                         foreach ( $steps as $step ) :
    25                             $tab_name = isset( $step['key'] ) ? $step['key'] : '';
    26                             $tab_icon = isset( $step['icon'] ) ? ' ' . $step['icon'] : '';
    27                             $template = isset( $step['template'] ) ? ' ' . $step['template'] : '';
     24                    foreach ( $steps as $step ) :
     25                        $tab_name = isset( $step['key'] ) ? $step['key'] : '';
     26                        $tab_icon = isset( $step['icon'] ) ? ' ' . $step['icon'] : '';
     27                        $template = isset( $step['template'] ) ? ' ' . $step['template'] : '';
    2828                        ?>
    29                         <a href="<?php echo esc_url( add_query_arg( array( 'page' => 'mass_users_password_reset_options', 'tab' => $tab_name ), admin_url( 'users.php' ) ) ); ?>" class="nav-tab<?php echo esc_attr( $active_tab == $tab_name ? ' active' : '' ); ?>"><span class="dashicons<?php echo esc_attr( $tab_icon ); ?>"></span> <?php _e( isset( $step['label'] ) ? $step['label'] : '' ); ?></a>
     29                        <a href="
     30                        <?php
     31                        echo esc_url(
     32                            add_query_arg(
     33                                array(
     34                                    'page' => 'mass_users_password_reset_options',
     35                                    'tab'  => $tab_name,
     36                                ),
     37                                admin_url( 'users.php' )
     38                            )
     39                        );
     40                        ?>
     41                                    " class="nav-tab<?php echo esc_attr( $active_tab == $tab_name ? ' active' : '' ); ?>"><span class="dashicons<?php echo esc_attr( $tab_icon ); ?>"></span> <?php _e( isset( $step['label'] ) ? $step['label'] : '' ); ?></a>
    3042                    <?php endforeach; ?>
    3143                    <?php if ( ! class_exists( 'Schedule_Password_Reset\Includes\Schedule_Password_Reset' ) ) : ?>
     
    3345                    <?php endif; ?>
    3446                    <?php if ( ! function_exists( 'mupr_log_file' ) ) : ?>
    35                         <a href="<?php echo esc_url( 'https://store.krishaweb.com/product/password-reset-log/' ); ?>" target="_blank" class="nav-tab"><span class="dashicons dashicons-clock"></span>&nbsp;<?php _e( 'Password Reset Log', 'mass-users-password-reset-pro' ); ?></a>
     47                        <a href="<?php echo esc_url( 'https://store.krishaweb.com/password-reset-log/' ); ?>" target="_blank" class="nav-tab"><span class="dashicons dashicons-clock"></span>&nbsp;<?php _e( 'Password Reset Log', 'mass-users-password-reset-pro' ); ?></a>
    3648                    <?php endif; ?>
    3749                </div>
     
    5567            <?php
    5668                // Require files.
    57                 $current = array_search( $active_tab, array_column( $steps, 'key' ) );
    58                 $current = $current ? $current : 0;
    59                 $current_step = $steps[$current];
    60                 if ( isset( $current_step['template'] ) && file_exists( $current_step['template'] ) ) {
    61                     require_once $current_step['template'];
    62                 }
     69                $current      = array_search( $active_tab, array_column( $steps, 'key' ) );
     70                $current      = $current ? $current : 0;
     71                $current_step = $steps[ $current ];
     72            if ( isset( $current_step['template'] ) && file_exists( $current_step['template'] ) ) {
     73                require_once $current_step['template'];
     74            }
    6375            ?>
    6476        </div>
  • mass-users-password-reset/trunk/admin/template/user-list.php

    r2128441 r2933413  
    3232        <tbody id="the-list" data-wp-lists="list:user">
    3333            <?php
    34                 if ( $users['list']->results ) :
    35                     foreach ( $users['list']->results as $user ) :
    36                         $username = ! empty( $user->first_name ) && ! empty( $user->last_name ) ? wp_sprintf( '%s %s', $user->first_name, $user->last_name ) : '—';
    37             ?>
     34            if ( $users['list']->results ) :
     35                foreach ( $users['list']->results as $user ) :
     36                    $username = ! empty( $user->first_name ) && ! empty( $user->last_name ) ? wp_sprintf( '%s %s', $user->first_name, $user->last_name ) : '—';
     37                    ?>
    3838                    <tr>
    3939                        <td class="column-primary username column-username">
     
    4444                        <td class="email column-email" data-colname="Email"><a href="mailto:<?php echo $user->user_email; ?>"><?php echo $user->user_email; ?></a></td>
    4545                    </tr>
    46                 <?php endforeach; ?>
     46            <?php endforeach; ?>
    4747            <?php else : ?>
    4848                <tr>
     
    6060        <?php
    6161            $disabled = array();
    62             if ( empty( $users['list']->results ) ) {
    63                 $disabled['disabled'] = 'disabled';
    64             }
    65             submit_button( __( 'Reset Password', 'mass-users-password-reset' ), 'button mupr-btn', 'reset', false,
     62        if ( empty( $users['list']->results ) ) {
     63            $disabled['disabled'] = 'disabled';
     64        }
     65            submit_button(
     66                __( 'Reset Password', 'mass-users-password-reset' ),
     67                'button mupr-btn',
     68                'reset',
     69                false,
    6670                $disabled
    6771            );
    6872            /**
    6973             * Add new custom action
     74             *
    7075             * @var $user object
    7176             */
    7277            do_action( 'mupr_custom_action', $users );
    73         ?>
     78            ?>
    7479    </div>
    7580    <?php
     
    7782        // Count total item
    7883        $total_items = count( $users['pagination']->results );
    79         if ( $total_items > 0 ) {
    80             // Set pagination
    81             $this->set_pagination_args(
    82                 array(
    83                     'total_items' => $total_items,
    84                     'per_page'    => $this->user_per_page
    85                 )
    86             );
    87             echo $this->pagination( 'bottom' );
    88         }
     84    if ( $total_items > 0 ) {
     85        // Set pagination
     86        $this->set_pagination_args(
     87            array(
     88                'total_items' => $total_items,
     89                'per_page'    => $this->user_per_page,
     90            )
     91        );
     92        echo $this->pagination( 'bottom' );
     93    }
    8994    ?>
    9095</div>
  • mass-users-password-reset/trunk/includes/class-mupr.php

    r2241570 r2933413  
    11<?php
    22// If check class exists 'WP_List_Table'
    3 if( ! class_exists( 'WP_List_Table' ) ) {
    4     require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
     3if ( ! class_exists( 'WP_List_Table' ) ) {
     4    require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
    55}
    66// If check class not exists 'Mass_users_password_reset'
     
    1010        /**
    1111         * Show user per page
     12         *
    1213         * @param $user_per_page int
    1314         */
     
    1617        /**
    1718         * Exclude user
     19         *
    1820         * @param $exclude array
    1921         */
     
    2224        /**
    2325         * Set default steps
     26         *
    2427         * @var $steps
    2528         */
    2629        public $steps = array(
    2730            array(
    28                 'label' => 'User List',
    29                 'key'   => 'user-list',
    30                 'icon'  => 'dashicons-admin-users',
    31                 'template'  => MASS_USERS_PASSWORD_RESET_PLUGIN_DIR . 'admin/template/user-list.php'
     31                'label'    => 'User List',
     32                'key'      => 'user-list',
     33                'icon'     => 'dashicons-admin-users',
     34                'template' => MASS_USERS_PASSWORD_RESET_PLUGIN_DIR . 'admin/template/user-list.php',
    3235            ),
    3336            array(
    34                 'label' => 'Advanced Features',
    35                 'key'   => 'mupr-pro',
    36                 'icon'  => 'dashicons-unlock',
    37                 'template'  => MASS_USERS_PASSWORD_RESET_PLUGIN_DIR . 'admin/template/mupr-pro.php'
    38             )
     37                'label'    => 'Advanced Features',
     38                'key'      => 'mupr-pro',
     39                'icon'     => 'dashicons-unlock',
     40                'template' => MASS_USERS_PASSWORD_RESET_PLUGIN_DIR . 'admin/template/mupr-pro.php',
     41            ),
    3942        );
    40        
     43
    4144        // Class construct
    4245        function __construct() {
     
    4750            // include in admin menu
    4851            add_action( 'admin_menu', array( $this, 'mass_users_password_reset_menu' ) );
    49             if( isset( $_GET['page'] ) && $_GET['page'] == 'mass_users_password_reset_options' ) {
     52            if ( isset( $_GET['page'] ) && $_GET['page'] == 'mass_users_password_reset_options' ) {
    5053                add_action( 'admin_enqueue_scripts', array( $this, 'include_scripts' ) );
    5154                add_action( 'admin_init', array( $this, 'mupr_remove_admin_notice' ) );
     
    5659            add_action( 'wp_ajax_nopriv_mupr_plugin_data', array( $this, 'mupr_plugin_data' ) );
    5760            // Add upgrade link on plugin action.
    58             add_filter( 'plugin_action_links_' . basename( dirname( MASS_USERS_PASSWORD_RESET) ) . '/' . basename( MASS_USERS_PASSWORD_RESET ), array( $this, 'mass_users_password_reset_add_upgrade_link' ) );
     61            add_filter( 'plugin_action_links_' . basename( dirname( MASS_USERS_PASSWORD_RESET ) ) . '/' . basename( MASS_USERS_PASSWORD_RESET ), array( $this, 'mass_users_password_reset_add_upgrade_link' ) );
    5962            // Plugin meta row.
    6063            add_filter( 'plugin_row_meta', array( $this, 'mass_users_password_reset_plugin_row_meta' ), 10, 4 );
     
    97100            wp_enqueue_script( 'bootstrap-select', MASS_USERS_PASSWORD_RESET_PLUGIN_URL . 'assets/js/bootstrap-select.js', array( 'jquery' ), false, true );
    98101            wp_enqueue_script( 'jquery-dropdown', MASS_USERS_PASSWORD_RESET_PLUGIN_URL . 'assets/js/dropdown.js', array( 'jquery' ), false, true );
    99             wp_localize_script( 'mupr', 'MUPR_FREE',
     102            wp_localize_script(
     103                'mupr',
     104                'MUPR_FREE',
    100105                array(
    101                     'ajax_url'      => admin_url( 'admin-ajax.php' ),
    102                     'nonce_error'   => __( 'Something went wrong please try again', 'mass-users-password-reset' ),
    103                     'reset_nonce'   => wp_create_nonce( 'mupr_free_reset_' . get_current_user_id() ),
    104                     'per_page'                      => $this->user_per_page,
    105                     'plugin_nonce'  => wp_create_nonce( 'mupr_get_details_' . get_current_user_id() )
     106                    'ajax_url'     => admin_url( 'admin-ajax.php' ),
     107                    'nonce_error'  => __( 'Something went wrong please try again', 'mass-users-password-reset' ),
     108                    'reset_nonce'  => wp_create_nonce( 'mupr_free_reset_' . get_current_user_id() ),
     109                    'per_page'     => $this->user_per_page,
     110                    'plugin_nonce' => wp_create_nonce( 'mupr_get_details_' . get_current_user_id() ),
    106111                )
    107112            );
     
    119124         */
    120125        function mupr_user_role_filter() {
    121             $filter = '';
     126            $filter       = '';
    122127            $current_role = isset( $_REQUEST['role_filter'] ) ? $_REQUEST['role_filter'] : '';
    123128            foreach ( get_editable_roles() as $role_name => $role_info ) {
    124                 $filter .='<option value="' . $role_name . '" ' . selected( $role_name, $current_role , false ) . '>' . $role_info['name'] . '</option>';
     129                $filter .= '<option value="' . $role_name . '" ' . selected( $role_name, $current_role, false ) . '>' . $role_info['name'] . '</option>';
    125130            }
    126131            return $filter;
     
    129134        /**
    130135         * Show user list
     136         *
    131137         * @return array all user's
    132138         */
     
    135141            // Per page
    136142            $users_per_page = $this->user_per_page;
    137             $paged = ( isset( $_REQUEST['paged'] ) ? $_REQUEST['paged'] : 1 );
     143            $paged          = ( isset( $_REQUEST['paged'] ) ? $_REQUEST['paged'] : 1 );
    138144
    139145            $all_users_query = array(
    140                 'exclude' => $this->exclude
     146                'exclude' => $this->exclude,
    141147            );
    142148
    143             //User query
     149            // User query
    144150            $user_query = array(
    145                 'exclude'       => $this->exclude,
    146                 'number'        => $users_per_page,
    147                 'offset'        => ( $paged - 1 ) * $users_per_page
     151                'exclude' => $this->exclude,
     152                'number'  => $users_per_page,
     153                'offset'  => ( $paged - 1 ) * $users_per_page,
    148154            );
    149155            // If check user role filter exists OR not
     
    152158                if ( $role && $role != 'all' ) {
    153159                    $user_query['role'] = array(
    154                         'role' => $role
     160                        'role' => $role,
    155161                    );
    156162                    // Pagination
    157163                    $all_users_query['role'] = array(
    158                         'role' => $role
     164                        'role' => $role,
    159165                    );
    160166                }
    161167            }
    162             $data['list'] = new WP_User_Query( $user_query );
     168            $data['list']       = new WP_User_Query( $user_query );
    163169            $data['pagination'] = new WP_User_Query( $all_users_query );
    164170            return $data;
     
    168174         * Override pagination function
    169175         *
    170          * @param string  $which  The which
     176         * @param string $which  The which
    171177         *
    172178         * @return pagination
     
    177183            }
    178184
    179             $total_items = $this->_pagination_args['total_items'];
    180             $total_pages = $this->_pagination_args['total_pages'];
     185            $total_items     = $this->_pagination_args['total_items'];
     186            $total_pages     = $this->_pagination_args['total_pages'];
    181187            $infinite_scroll = false;
    182188            if ( isset( $this->_pagination_args['infinite_scroll'] ) ) {
     
    190196            $output = '<span class="displaying-num">' . sprintf( _n( '%s item', '%s items', $total_items ), number_format_i18n( $total_items ) ) . '</span>';
    191197
    192             $current = $this->get_pagenum();
     198            $current              = $this->get_pagenum();
    193199            $removable_query_args = wp_removable_query_args();
    194             $current_protocol = (stripos($_SERVER['SERVER_PROTOCOL'],'https') === true ? 'https://' : 'http://');
    195             $current_url = set_url_scheme( $current_protocol . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
    196             $str_pos = strpos($current_url,'admin-ajax.php');
     200            $current_protocol     = ( stripos( $_SERVER['SERVER_PROTOCOL'], 'https' ) === true ? 'https://' : 'http://' );
     201            $current_url          = set_url_scheme( $current_protocol . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
     202            $str_pos              = strpos( $current_url, 'admin-ajax.php' );
    197203
    198204            $current_url = remove_query_arg( $removable_query_args, $current_url );
     
    207213            if ( $current == 1 ) {
    208214                $disable_first = true;
    209                 $disable_prev = true;
     215                $disable_prev  = true;
    210216            }
    211217            if ( $current == 2 ) {
     
    223229                $page_links[] = '<span class="tablenav-pages-navspan" aria-hidden="true">&laquo;</span>';
    224230            } else {
    225                 $page_links[] = sprintf( "<a class='first-page' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
     231                $page_links[] = sprintf(
     232                    "<a class='first-page' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
    226233                    esc_url( remove_query_arg( 'paged', $current_url ) ),
    227234                    __( 'First page' ),
     
    233240                $page_links[] = '<span class="tablenav-pages-navspan" aria-hidden="true">&lsaquo;</span>';
    234241            } else {
    235                 $page_links[] = sprintf( "<a class='prev-page' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
    236                     esc_url( add_query_arg( 'paged', max( 1, $current-1 ), $current_url ) ),
     242                $page_links[] = sprintf(
     243                    "<a class='prev-page' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
     244                    esc_url( add_query_arg( 'paged', max( 1, $current - 1 ), $current_url ) ),
    237245                    __( 'Previous page' ),
    238246                    '&lsaquo;'
     
    244252                $total_pages_before = '<span class="screen-reader-text">' . __( 'Current Page' ) . '</span><span id="table-paging" class="paging-input"><span class="tablenav-paging-text">';
    245253            } else {
    246                 $html_current_page = sprintf( "%s<input class='current-page' id='current-page-selector' type='text' name='paged' value='%s' size='%d' aria-describedby='table-paging' /><span class='tablenav-paging-text'>",
     254                $html_current_page = sprintf(
     255                    "%s<input class='current-page' id='current-page-selector' type='text' name='paged' value='%s' size='%d' aria-describedby='table-paging' /><span class='tablenav-paging-text'>",
    247256                    '<label for="current-page-selector" class="screen-reader-text">' . __( 'Current Page' ) . '</label>',
    248257                    $current,
     
    251260            }
    252261            $html_total_pages = sprintf( "<span class='total-pages'>%s</span>", number_format_i18n( $total_pages ) );
    253             $page_links[] = $total_pages_before . sprintf( _x( '%1$s of %2$s', 'paging' ), $html_current_page, $html_total_pages ) . $total_pages_after;
     262            $page_links[]     = $total_pages_before . sprintf( _x( '%1$s of %2$s', 'paging' ), $html_current_page, $html_total_pages ) . $total_pages_after;
    254263
    255264            if ( $disable_next ) {
    256265                $page_links[] = '<span class="tablenav-pages-navspan" aria-hidden="true">&rsaquo;</span>';
    257266            } else {
    258                 $page_links[] = sprintf( "<a class='next-page' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
     267                $page_links[] = sprintf(
     268                    "<a class='next-page' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
    259269                    esc_url( add_query_arg( 'paged', min( $total_pages, $current + 1 ), $current_url ) ),
    260270                    __( 'Next page' ),
     
    266276                $page_links[] = '<span class="tablenav-pages-navspan" aria-hidden="true">&raquo;</span>';
    267277            } else {
    268                 $page_links[] = sprintf( "<a class='last-page' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
     278                $page_links[] = sprintf(
     279                    "<a class='last-page' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
    269280                    esc_url( add_query_arg( 'paged', $total_pages, $current_url ) ),
    270281                    __( 'Last page' ),
     
    297308            // If check role exists OR not
    298309            if ( isset( $_POST['role'] ) ) {
    299                 $role = sanitize_text_field( $_POST['role'] );
     310                $role   = sanitize_text_field( $_POST['role'] );
    300311                $offset = isset( $_POST['offset'] ) ? sanitize_text_field( $_POST['offset'] ) : '';
    301312                $number = $this->user_per_page;
    302313                // Default query
    303314                $user_query = array(
    304                     'exclude'       => $this->exclude,
    305                     'offset'        => $offset,
    306                     'number'        => $number
     315                    'exclude' => $this->exclude,
     316                    'offset'  => $offset,
     317                    'number'  => $number,
    307318                );
    308319                // If check role empty OR not
    309                 if ( $role != "" && $role != 'all' ) {
    310                     $user_query['role'] = array( 'role' =>  $role );
     320                if ( $role != '' && $role != 'all' ) {
     321                    $user_query['role'] = array( 'role' => $role );
    311322                }
    312323                // Get all users
    313324                $all_users_list = new WP_User_Query( $user_query );
    314                 $user_ids = $all_users_list->get_results();
    315                 $count_users = count( $user_ids );
     325                $user_ids       = $all_users_list->get_results();
     326                $count_users    = count( $user_ids );
    316327                $get_mupr_users = get_option( 'mupr_users' ) ? get_option( 'mupr_users' ) : 0;
    317328                if ( $get_mupr_users < 100 ) {
    318329                    $mail_not_send = false;
    319                     if ( ! empty ($user_ids ) ) {
     330                    if ( ! empty( $user_ids ) ) {
    320331                        $sent_count = 0;
    321                         foreach( $user_ids as $user_id ) {
     332                        foreach ( $user_ids as $user_id ) {
    322333                            $result = $this->send_email_format( $user_id->ID );
    323334                            if ( $result == 1 ) {
     
    329340                        }
    330341                        $users_count_till_now = $offset + $sent_count;
    331                         $successful_msg = sprintf( _n( '%s user password has been reset successfully','%s users password have been reset successfully', $users_count_till_now,'mass-users-password-reset-pro' ), $users_count_till_now );
     342                        $successful_msg       = sprintf( _n( '%s user password has been reset successfully', '%s users password have been reset successfully', $users_count_till_now, 'mass-users-password-reset-pro' ), $users_count_till_now );
    332343
    333344                        $no_mails_send_msg = __( 'There is an error in sending mail, Please check your server configuration.', 'mass-users-password-reset-pro' );
     
    335346                        if ( $result == 1 ) {
    336347                            $message = array(
    337                                 'result'        =>  1,
    338                                 'status'        =>  'continue',
    339                                 'message'   => $successful_msg
     348                                'result'  => 1,
     349                                'status'  => 'continue',
     350                                'message' => $successful_msg,
    340351                            );
    341352                        }
    342353                        if ( $mail_not_send == true ) {
    343354                            $message = array(
    344                                 'result'        =>  0,
    345                                 'message'   => $no_mails_send_msg
     355                                'result'  => 0,
     356                                'message' => $no_mails_send_msg,
    346357                            );
    347358                        }
     
    349360                        if ( $offset == 0 ) {
    350361                            $message = array(
    351                                 'result'    =>  0,
    352                                 'message'   =>  __( 'No users.', 'mass-users-password-reset-pro' )
     362                                'result'  => 0,
     363                                'message' => __( 'No users.', 'mass-users-password-reset-pro' ),
    353364                            );
    354365                        } else {
    355366                            $message = array(
    356                                 'result'    =>  1,
    357                                 'status'    =>  'end',
    358                                 'message'   => __( 'All users password have been reset successfully.','mass-users-password-reset-pro' )
     367                                'result'  => 1,
     368                                'status'  => 'end',
     369                                'message' => __( 'All users password have been reset successfully.', 'mass-users-password-reset-pro' ),
    359370                            );
    360371                        }
     
    362373                } else {
    363374                    $message = array(
    364                         'result'    =>  2,
    365                         'status'    =>  'end',
    366                         'message'   => wp_sprintf( __( 'You have reached the maximum user limit. Upgrade to pro to get more features <a href="%s" target="_blank" class="button button-primary">%s</a>', 'mass-users-password-reset' ), esc_url( 'https://codecanyon.net/item/mass-users-password-reset/20809350' ), __( 'Upgrade Now', 'mass-users-password-reset' ) )
     375                        'result'  => 2,
     376                        'status'  => 'end',
     377                        'message' => wp_sprintf( __( 'You have reached the maximum user limit. Upgrade to pro to get more features <a href="%1$s" target="_blank" class="button button-primary">%2$s</a>', 'mass-users-password-reset' ), esc_url( 'https://codecanyon.net/item/mass-users-password-reset/20809350' ), __( 'Upgrade Now', 'mass-users-password-reset' ) ),
    367378                    );
    368                 }
    369             } else {
    370                 $message = array( 'result' => 0, 'message' => __( 'Unauthorized Access', 'mass-users-password-reset' )  );
     379                }
     380            } else {
     381                $message = array(
     382                    'result'  => 0,
     383                    'message' => __( 'Unauthorized Access', 'mass-users-password-reset' ),
     384                );
    371385            }
    372386            echo wp_json_encode( $message );
     
    376390        /**
    377391         * Send email format and reset user password
     392         *
    378393         * @param  int $user_id User ID.
    379394         * @return bool ( return wp_mail response );
     
    397412                <p><?php _e( 'Your Password has been changed.', 'mass-users-password-reset' ); ?> </p>
    398413                <p><?php printf( esc_html__( 'Your new password is : %s', 'mass-users-password-reset' ), $new_password ); ?></p>
    399                 <p><?php printf( esc_html__( 'To reset your password, log in to %s','mass-users-password-reset' ), get_site_url() . '/wp-admin/profile.php' ); ?></p>
     414                <p><?php printf( esc_html__( 'To reset your password, log in to %s', 'mass-users-password-reset' ), get_site_url() . '/wp-admin/profile.php' ); ?></p>
    400415            </body>
    401416            </html>
    402417            <?php
    403             $to = $user_info->user_email;
     418            $to      = $user_info->user_email;
    404419            $subject = sprintf( __( 'Reset Password of %s', 'mass-users-password-reset' ), get_bloginfo( 'name' ) );
    405             $body = ob_get_clean();
     420            $body    = ob_get_clean();
    406421            // To send HTML mail, the Content-type header must be set
    407422            // Additional headers
    408             $headers = array( 'Content-Type: text/html; charset=UTF-8', 'From: ' . get_bloginfo( 'name' ) . ' <' . get_option( 'admin_email' ) . '>');
     423            $headers = array( 'Content-Type: text/html; charset=UTF-8', 'From: ' . get_bloginfo( 'name' ) . ' <' . get_option( 'admin_email' ) . '>' );
    409424            // Send mail
    410425            $result = wp_mail( $to, $subject, $body, $headers );
     
    412427            /**
    413428             * After reset action
     429             *
    414430             * @var $user_id object
    415431             */
     
    427443            include_once ABSPATH . '/wp-admin/includes/plugin-install.php';
    428444            // Get active installtion
    429             $data = array( 'result' => 0 );
    430             $plugin_api = plugins_api( 'plugin_information',
     445            $data       = array( 'result' => 0 );
     446            $plugin_api = plugins_api(
     447                'plugin_information',
    431448                array(
    432                     'slug'      => 'mass-users-password-reset',
    433                     'fields'    => array(
     449                    'slug'   => 'mass-users-password-reset',
     450                    'fields' => array(
    434451                        'active_installs' => true,
    435                         'downloaded' => true,
    436                     )
     452                        'downloaded'      => true,
     453                    ),
    437454                )
    438455            );
    439             if( ! is_wp_error( $plugin_api ) ) {
    440                 $data['result'] = 1;
    441                 $data['active'] = $plugin_api->active_installs;
     456            if ( ! is_wp_error( $plugin_api ) ) {
     457                $data['result']     = 1;
     458                $data['active']     = $plugin_api->active_installs;
    442459                $data['downloaded'] = $plugin_api->downloaded;
    443460
  • mass-users-password-reset/trunk/includes/index.php

    r2099572 r2933413  
    1 <?php //Slience is golden
     1<?php // Slience is golden
  • mass-users-password-reset/trunk/index.php

    r2099572 r2933413  
    1 <?php //Slience is golden
     1<?php // Slience is golden
  • mass-users-password-reset/trunk/mass-users-password-reset.php

    r2282159 r2933413  
    44 * Plugin URI: https://wordpress.org/plugins/mass-users-password-reset/
    55 * Description: MASS Users Password Reset is a WordPress Plugin that lets you resets the password of all users. It can group the users according to their role and resets password of that group.
    6  * Version: 1.8
     6 * Version: 1.9
    77 * Author: KrishaWeb
    88 * Author URI: https://www.krishaweb.com
     
    2020require_once 'includes/class-mupr.php';
    2121
    22 define( 'MASS_USERS_PASSWORD_RESET_VERSION', '1.8' );
     22define( 'MASS_USERS_PASSWORD_RESET_VERSION', '1.9' );
    2323define( 'MASS_USERS_PASSWORD_RESET_REQUIRED_WP_VERSION', '4.3' );
    2424define( 'MASS_USERS_PASSWORD_RESET', __FILE__ );
  • mass-users-password-reset/trunk/readme.txt

    r2820274 r2933413  
    66Contributors: manishamakhija, vijaybaria, krishaweb
    77Tags: password reset, reset password, password, bulk reset password
    8 Requires at least: 4.1
    9 Tested up to: 6.1
    10 Stable tag: 1.8
    11 Copyright: (c) 2012-2022 KrishaWeb Technologies PVT LTD (info@krishaweb.com)
     8Requires at least: 4.3
     9Tested up to: 6.2
     10Stable tag: 1.9
     11Copyright: (c) 2012-2023 KrishaWeb (info@krishaweb.com)
    1212License: GPLv3 or later
    1313License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    1818
    1919MASS Users Password Reset is a WordPress Plugin that lets you resets the password of all users. It can group the users according to their role and resets password of that group. It sends notification email to users about their new randomly generated password.
    20 
    21 <a href="https://store.krishaweb.com/wordpress-5-7-vs-mass-users-password-reset" rel="noopener" target="_blank">View the comparison between MUPR and WordPress password reset</a>
    2220
    2321<a href="https://krishaweb.com/docs/mass-users-password-reset/?utm_source=readme&utm_medium=wporg&utm_campaign=MUPR" target="_blank">DOCUMENTATION</a>
     
    8987When user will choose to generate new password, an email with the new random password will be sent to users.
    9088
     89= I have an idea for a great way to improve this plugin. =
     90
     91Great! I’d love to hear from you at <a href="mailto:support@krishaweb.com">support@krishaweb.com</a>
     92
    9193= An email is handeled by the plugin? =
    9294
    9395No, the plugin uses wp_mail function to send the email. If an email is not sent from your site, you can use any SMTP plugin.
    94 
    95 = I have an idea for a great way to improve this plugin. =
    96 
    97 Great! I’d love to hear from you at <a href="mailto:support@krishaweb.com">support@krishaweb.com</a>
    9896
    9997== Screenshots ==
     
    103101
    104102== Changelog ==
     103
     104= 1.9 =
     105* Compatibility with latest version
    105106
    106107= 1.8 =
Note: See TracChangeset for help on using the changeset viewer.