Changeset 2933413
- Timestamp:
- 07/03/2023 12:36:35 PM (3 years ago)
- Location:
- mass-users-password-reset
- Files:
-
- 43 added
- 7 edited
-
tags/1.9 (added)
-
tags/1.9/admin (added)
-
tags/1.9/admin/index.php (added)
-
tags/1.9/admin/template (added)
-
tags/1.9/admin/template/index.php (added)
-
tags/1.9/admin/template/mupr-admin.php (added)
-
tags/1.9/admin/template/mupr-pro.php (added)
-
tags/1.9/admin/template/user-list.php (added)
-
tags/1.9/assets (added)
-
tags/1.9/assets/css (added)
-
tags/1.9/assets/css/bootstrap-select.css (added)
-
tags/1.9/assets/css/mupr.css (added)
-
tags/1.9/assets/images (added)
-
tags/1.9/assets/images/client-logo1.png (added)
-
tags/1.9/assets/images/client-logo2.png (added)
-
tags/1.9/assets/images/client-logo3.png (added)
-
tags/1.9/assets/images/client-logo4.png (added)
-
tags/1.9/assets/images/client-logo5.png (added)
-
tags/1.9/assets/images/client-logo6.png (added)
-
tags/1.9/assets/images/client-logo7.png (added)
-
tags/1.9/assets/images/client-logo8.png (added)
-
tags/1.9/assets/images/macbook.png (added)
-
tags/1.9/assets/images/mass-user-password-pro-logo.png (added)
-
tags/1.9/assets/images/mupr-logo.png (added)
-
tags/1.9/assets/images/quote-img.png (added)
-
tags/1.9/assets/images/review-ratings.png (added)
-
tags/1.9/assets/images/sort-arrows-couple-pointing-up-and-down.png (added)
-
tags/1.9/assets/images/spinner.gif (added)
-
tags/1.9/assets/images/star.png (added)
-
tags/1.9/assets/images/tick-mark.png (added)
-
tags/1.9/assets/images/tick-mark1.png (added)
-
tags/1.9/assets/js (added)
-
tags/1.9/assets/js/bootstrap-select.js (added)
-
tags/1.9/assets/js/dropdown.js (added)
-
tags/1.9/assets/js/mupr.js (added)
-
tags/1.9/includes (added)
-
tags/1.9/includes/class-mupr.php (added)
-
tags/1.9/includes/index.php (added)
-
tags/1.9/index.php (added)
-
tags/1.9/languages (added)
-
tags/1.9/languages/mass-users-password-reset.pot (added)
-
tags/1.9/mass-users-password-reset.php (added)
-
tags/1.9/readme.txt (added)
-
trunk/admin/template/mupr-admin.php (modified) (4 diffs)
-
trunk/admin/template/user-list.php (modified) (4 diffs)
-
trunk/includes/class-mupr.php (modified) (29 diffs)
-
trunk/includes/index.php (modified) (1 diff)
-
trunk/index.php (modified) (1 diff)
-
trunk/mass-users-password-reset.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
mass-users-password-reset/trunk/admin/template/mupr-admin.php
r2282159 r2933413 1 1 <?php 2 2 $spinner = ''; 3 if ( isset( $_GET[ 'tab' ] ) && 'user-list' !== $_GET[ 'tab'] ) {4 $active_tab = $_GET[ 'tab'];3 if ( isset( $_GET['tab'] ) && 'user-list' !== $_GET['tab'] ) { 4 $active_tab = $_GET['tab']; 5 5 } else { 6 6 $active_tab = 'user-list'; 7 $spinner = '<div class="spinner"></div>';7 $spinner = '<div class="spinner"></div>'; 8 8 } 9 9 ?> … … 22 22 <?php 23 23 $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'] : ''; 28 28 ?> 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> 30 42 <?php endforeach; ?> 31 43 <?php if ( ! class_exists( 'Schedule_Password_Reset\Includes\Schedule_Password_Reset' ) ) : ?> … … 33 45 <?php endif; ?> 34 46 <?php if ( ! function_exists( 'mupr_log_file' ) ) : ?> 35 <a href="<?php echo esc_url( 'https://store.krishaweb.com/p roduct/password-reset-log/' ); ?>" target="_blank" class="nav-tab"><span class="dashicons dashicons-clock"></span> <?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> <?php _e( 'Password Reset Log', 'mass-users-password-reset-pro' ); ?></a> 36 48 <?php endif; ?> 37 49 </div> … … 55 67 <?php 56 68 // 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 } 63 75 ?> 64 76 </div> -
mass-users-password-reset/trunk/admin/template/user-list.php
r2128441 r2933413 32 32 <tbody id="the-list" data-wp-lists="list:user"> 33 33 <?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 ?> 38 38 <tr> 39 39 <td class="column-primary username column-username"> … … 44 44 <td class="email column-email" data-colname="Email"><a href="mailto:<?php echo $user->user_email; ?>"><?php echo $user->user_email; ?></a></td> 45 45 </tr> 46 <?php endforeach; ?>46 <?php endforeach; ?> 47 47 <?php else : ?> 48 48 <tr> … … 60 60 <?php 61 61 $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, 66 70 $disabled 67 71 ); 68 72 /** 69 73 * Add new custom action 74 * 70 75 * @var $user object 71 76 */ 72 77 do_action( 'mupr_custom_action', $users ); 73 ?>78 ?> 74 79 </div> 75 80 <?php … … 77 82 // Count total item 78 83 $total_items = count( $users['pagination']->results ); 79 if ( $total_items > 0 ) {80 // Set pagination81 $this->set_pagination_args(82 array(83 'total_items' => $total_items,84 'per_page' => $this->user_per_page85 )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 } 89 94 ?> 90 95 </div> -
mass-users-password-reset/trunk/includes/class-mupr.php
r2241570 r2933413 1 1 <?php 2 2 // 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' );3 if ( ! class_exists( 'WP_List_Table' ) ) { 4 require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php'; 5 5 } 6 6 // If check class not exists 'Mass_users_password_reset' … … 10 10 /** 11 11 * Show user per page 12 * 12 13 * @param $user_per_page int 13 14 */ … … 16 17 /** 17 18 * Exclude user 19 * 18 20 * @param $exclude array 19 21 */ … … 22 24 /** 23 25 * Set default steps 26 * 24 27 * @var $steps 25 28 */ 26 29 public $steps = array( 27 30 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', 32 35 ), 33 36 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 ), 39 42 ); 40 43 41 44 // Class construct 42 45 function __construct() { … … 47 50 // include in admin menu 48 51 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' ) { 50 53 add_action( 'admin_enqueue_scripts', array( $this, 'include_scripts' ) ); 51 54 add_action( 'admin_init', array( $this, 'mupr_remove_admin_notice' ) ); … … 56 59 add_action( 'wp_ajax_nopriv_mupr_plugin_data', array( $this, 'mupr_plugin_data' ) ); 57 60 // 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' ) ); 59 62 // Plugin meta row. 60 63 add_filter( 'plugin_row_meta', array( $this, 'mass_users_password_reset_plugin_row_meta' ), 10, 4 ); … … 97 100 wp_enqueue_script( 'bootstrap-select', MASS_USERS_PASSWORD_RESET_PLUGIN_URL . 'assets/js/bootstrap-select.js', array( 'jquery' ), false, true ); 98 101 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', 100 105 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() ), 106 111 ) 107 112 ); … … 119 124 */ 120 125 function mupr_user_role_filter() { 121 $filter = '';126 $filter = ''; 122 127 $current_role = isset( $_REQUEST['role_filter'] ) ? $_REQUEST['role_filter'] : ''; 123 128 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>'; 125 130 } 126 131 return $filter; … … 129 134 /** 130 135 * Show user list 136 * 131 137 * @return array all user's 132 138 */ … … 135 141 // Per page 136 142 $users_per_page = $this->user_per_page; 137 $paged = ( isset( $_REQUEST['paged'] ) ? $_REQUEST['paged'] : 1 );143 $paged = ( isset( $_REQUEST['paged'] ) ? $_REQUEST['paged'] : 1 ); 138 144 139 145 $all_users_query = array( 140 'exclude' => $this->exclude 146 'exclude' => $this->exclude, 141 147 ); 142 148 143 // User query149 // User query 144 150 $user_query = array( 145 'exclude' => $this->exclude,146 'number' => $users_per_page,147 'offset' => ( $paged - 1 ) * $users_per_page151 'exclude' => $this->exclude, 152 'number' => $users_per_page, 153 'offset' => ( $paged - 1 ) * $users_per_page, 148 154 ); 149 155 // If check user role filter exists OR not … … 152 158 if ( $role && $role != 'all' ) { 153 159 $user_query['role'] = array( 154 'role' => $role 160 'role' => $role, 155 161 ); 156 162 // Pagination 157 163 $all_users_query['role'] = array( 158 'role' => $role 164 'role' => $role, 159 165 ); 160 166 } 161 167 } 162 $data['list'] = new WP_User_Query( $user_query );168 $data['list'] = new WP_User_Query( $user_query ); 163 169 $data['pagination'] = new WP_User_Query( $all_users_query ); 164 170 return $data; … … 168 174 * Override pagination function 169 175 * 170 * @param string $which The which176 * @param string $which The which 171 177 * 172 178 * @return pagination … … 177 183 } 178 184 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']; 181 187 $infinite_scroll = false; 182 188 if ( isset( $this->_pagination_args['infinite_scroll'] ) ) { … … 190 196 $output = '<span class="displaying-num">' . sprintf( _n( '%s item', '%s items', $total_items ), number_format_i18n( $total_items ) ) . '</span>'; 191 197 192 $current = $this->get_pagenum();198 $current = $this->get_pagenum(); 193 199 $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' ); 197 203 198 204 $current_url = remove_query_arg( $removable_query_args, $current_url ); … … 207 213 if ( $current == 1 ) { 208 214 $disable_first = true; 209 $disable_prev = true;215 $disable_prev = true; 210 216 } 211 217 if ( $current == 2 ) { … … 223 229 $page_links[] = '<span class="tablenav-pages-navspan" aria-hidden="true">«</span>'; 224 230 } 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>", 226 233 esc_url( remove_query_arg( 'paged', $current_url ) ), 227 234 __( 'First page' ), … … 233 240 $page_links[] = '<span class="tablenav-pages-navspan" aria-hidden="true">‹</span>'; 234 241 } 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 ) ), 237 245 __( 'Previous page' ), 238 246 '‹' … … 244 252 $total_pages_before = '<span class="screen-reader-text">' . __( 'Current Page' ) . '</span><span id="table-paging" class="paging-input"><span class="tablenav-paging-text">'; 245 253 } 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'>", 247 256 '<label for="current-page-selector" class="screen-reader-text">' . __( 'Current Page' ) . '</label>', 248 257 $current, … … 251 260 } 252 261 $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; 254 263 255 264 if ( $disable_next ) { 256 265 $page_links[] = '<span class="tablenav-pages-navspan" aria-hidden="true">›</span>'; 257 266 } 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>", 259 269 esc_url( add_query_arg( 'paged', min( $total_pages, $current + 1 ), $current_url ) ), 260 270 __( 'Next page' ), … … 266 276 $page_links[] = '<span class="tablenav-pages-navspan" aria-hidden="true">»</span>'; 267 277 } 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>", 269 280 esc_url( add_query_arg( 'paged', $total_pages, $current_url ) ), 270 281 __( 'Last page' ), … … 297 308 // If check role exists OR not 298 309 if ( isset( $_POST['role'] ) ) { 299 $role = sanitize_text_field( $_POST['role'] );310 $role = sanitize_text_field( $_POST['role'] ); 300 311 $offset = isset( $_POST['offset'] ) ? sanitize_text_field( $_POST['offset'] ) : ''; 301 312 $number = $this->user_per_page; 302 313 // Default query 303 314 $user_query = array( 304 'exclude' => $this->exclude,305 'offset' => $offset,306 'number' => $number315 'exclude' => $this->exclude, 316 'offset' => $offset, 317 'number' => $number, 307 318 ); 308 319 // 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 ); 311 322 } 312 323 // Get all users 313 324 $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 ); 316 327 $get_mupr_users = get_option( 'mupr_users' ) ? get_option( 'mupr_users' ) : 0; 317 328 if ( $get_mupr_users < 100 ) { 318 329 $mail_not_send = false; 319 if ( ! empty ($user_ids ) ) {330 if ( ! empty( $user_ids ) ) { 320 331 $sent_count = 0; 321 foreach ( $user_ids as $user_id ) {332 foreach ( $user_ids as $user_id ) { 322 333 $result = $this->send_email_format( $user_id->ID ); 323 334 if ( $result == 1 ) { … … 329 340 } 330 341 $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 ); 332 343 333 344 $no_mails_send_msg = __( 'There is an error in sending mail, Please check your server configuration.', 'mass-users-password-reset-pro' ); … … 335 346 if ( $result == 1 ) { 336 347 $message = array( 337 'result' =>1,338 'status' =>'continue',339 'message' => $successful_msg348 'result' => 1, 349 'status' => 'continue', 350 'message' => $successful_msg, 340 351 ); 341 352 } 342 353 if ( $mail_not_send == true ) { 343 354 $message = array( 344 'result' =>0,345 'message' => $no_mails_send_msg355 'result' => 0, 356 'message' => $no_mails_send_msg, 346 357 ); 347 358 } … … 349 360 if ( $offset == 0 ) { 350 361 $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' ), 353 364 ); 354 365 } else { 355 366 $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' ), 359 370 ); 360 371 } … … 362 373 } else { 363 374 $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' ) ), 367 378 ); 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 ); 371 385 } 372 386 echo wp_json_encode( $message ); … … 376 390 /** 377 391 * Send email format and reset user password 392 * 378 393 * @param int $user_id User ID. 379 394 * @return bool ( return wp_mail response ); … … 397 412 <p><?php _e( 'Your Password has been changed.', 'mass-users-password-reset' ); ?> </p> 398 413 <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> 400 415 </body> 401 416 </html> 402 417 <?php 403 $to = $user_info->user_email;418 $to = $user_info->user_email; 404 419 $subject = sprintf( __( 'Reset Password of %s', 'mass-users-password-reset' ), get_bloginfo( 'name' ) ); 405 $body = ob_get_clean();420 $body = ob_get_clean(); 406 421 // To send HTML mail, the Content-type header must be set 407 422 // 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' ) . '>' ); 409 424 // Send mail 410 425 $result = wp_mail( $to, $subject, $body, $headers ); … … 412 427 /** 413 428 * After reset action 429 * 414 430 * @var $user_id object 415 431 */ … … 427 443 include_once ABSPATH . '/wp-admin/includes/plugin-install.php'; 428 444 // 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', 431 448 array( 432 'slug' => 'mass-users-password-reset',433 'fields' => array(449 'slug' => 'mass-users-password-reset', 450 'fields' => array( 434 451 'active_installs' => true, 435 'downloaded' => true,436 ) 452 'downloaded' => true, 453 ), 437 454 ) 438 455 ); 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; 442 459 $data['downloaded'] = $plugin_api->downloaded; 443 460 -
mass-users-password-reset/trunk/includes/index.php
r2099572 r2933413 1 <?php // Slience is golden1 <?php // Slience is golden -
mass-users-password-reset/trunk/index.php
r2099572 r2933413 1 <?php // Slience is golden1 <?php // Slience is golden -
mass-users-password-reset/trunk/mass-users-password-reset.php
r2282159 r2933413 4 4 * Plugin URI: https://wordpress.org/plugins/mass-users-password-reset/ 5 5 * 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. 86 * Version: 1.9 7 7 * Author: KrishaWeb 8 8 * Author URI: https://www.krishaweb.com … … 20 20 require_once 'includes/class-mupr.php'; 21 21 22 define( 'MASS_USERS_PASSWORD_RESET_VERSION', '1. 8' );22 define( 'MASS_USERS_PASSWORD_RESET_VERSION', '1.9' ); 23 23 define( 'MASS_USERS_PASSWORD_RESET_REQUIRED_WP_VERSION', '4.3' ); 24 24 define( 'MASS_USERS_PASSWORD_RESET', __FILE__ ); -
mass-users-password-reset/trunk/readme.txt
r2820274 r2933413 6 6 Contributors: manishamakhija, vijaybaria, krishaweb 7 7 Tags: password reset, reset password, password, bulk reset password 8 Requires at least: 4. 19 Tested up to: 6. 110 Stable tag: 1. 811 Copyright: (c) 2012-202 2 KrishaWeb Technologies PVT LTD(info@krishaweb.com)8 Requires at least: 4.3 9 Tested up to: 6.2 10 Stable tag: 1.9 11 Copyright: (c) 2012-2023 KrishaWeb (info@krishaweb.com) 12 12 License: GPLv3 or later 13 13 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 18 18 19 19 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. 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>22 20 23 21 <a href="https://krishaweb.com/docs/mass-users-password-reset/?utm_source=readme&utm_medium=wporg&utm_campaign=MUPR" target="_blank">DOCUMENTATION</a> … … 89 87 When user will choose to generate new password, an email with the new random password will be sent to users. 90 88 89 = I have an idea for a great way to improve this plugin. = 90 91 Great! I’d love to hear from you at <a href="mailto:support@krishaweb.com">support@krishaweb.com</a> 92 91 93 = An email is handeled by the plugin? = 92 94 93 95 No, 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>98 96 99 97 == Screenshots == … … 103 101 104 102 == Changelog == 103 104 = 1.9 = 105 * Compatibility with latest version 105 106 106 107 = 1.8 =
Note: See TracChangeset
for help on using the changeset viewer.