New User Approve - Version 1.7.5

Version Description

  • Fixed: User status filter in admin was not using database prefix
    • Courtesy of Oizopower
    • https://github.com/picklewagon/new-user-approve/pull/50
  • Fixed: Optimize user status list so it can be used with many users
  • Fixed: Updated transient to populate with user counts instead of user list
  • Updated: Modify output of user counts on dashboard
  • Updated: Polish translations
    • Courtesy of pik256
  • Added: Missing string to translation file
    • Courtesy of spaszs
  • Added: Bulgarian translation
    • Courtesy of spaszs
Download this release

Release Info

Developer picklewagon
Plugin Icon 128x128 New User Approve
Version 1.7.5
Comparing to
See all releases

Code changes from version 1.7.4 to 1.7.5

includes/admin-approve.php CHANGED
@@ -34,7 +34,7 @@ class pw_new_user_approve_admin_approve {
34
  add_action( 'admin_init', array( $this, 'process_input' ) );
35
  add_action( 'admin_notices', array( $this, 'admin_notice' ) );
36
  add_action( 'admin_init', array( $this, 'notice_ignore' ) );
37
- add_action( 'admin_init', array( $this, 'add_meta_boxes' ) );
38
  }
39
 
40
  /**
@@ -216,7 +216,7 @@ class pw_new_user_approve_admin_approve {
216
  wp_enqueue_script( 'post' );
217
  }
218
 
219
- public function add_meta_boxes() {
220
  add_meta_box( 'nua-approve-admin', __( 'Approve Users', 'new-user-approve' ), array( $this, 'metabox_main' ), 'users_page_new-user-approve-admin', 'main', 'high' );
221
  add_meta_box( 'nua-updates', __( 'Updates', 'new-user-approve' ), array( $this, 'metabox_updates' ), 'users_page_new-user-approve-admin', 'side', 'default' );
222
  add_meta_box( 'nua-support', __( 'Support', 'new-user-approve' ), array( $this, 'metabox_support' ), 'users_page_new-user-approve-admin', 'side', 'default' );
@@ -285,15 +285,6 @@ elseif ( $active_tab == 'denied_users' ) : ?>
285
  <?php
286
  }
287
 
288
- public function metabox_ajax( $post, $metabox = array() ) {
289
- $response = wp_remote_get( $metabox['args']['url'] );
290
- if ( wp_remote_retrieve_response_code( $response ) == 200 ) {
291
- $body = wp_remote_retrieve_body( $response );
292
- $details = json_decode( $body );
293
- print $details->content;
294
- }
295
- }
296
-
297
  }
298
 
299
  function pw_new_user_approve_admin_approve() {
34
  add_action( 'admin_init', array( $this, 'process_input' ) );
35
  add_action( 'admin_notices', array( $this, 'admin_notice' ) );
36
  add_action( 'admin_init', array( $this, 'notice_ignore' ) );
37
+ add_action( 'admin_init', array( $this, '_add_meta_boxes' ) );
38
  }
39
 
40
  /**
216
  wp_enqueue_script( 'post' );
217
  }
218
 
219
+ public function _add_meta_boxes() {
220
  add_meta_box( 'nua-approve-admin', __( 'Approve Users', 'new-user-approve' ), array( $this, 'metabox_main' ), 'users_page_new-user-approve-admin', 'main', 'high' );
221
  add_meta_box( 'nua-updates', __( 'Updates', 'new-user-approve' ), array( $this, 'metabox_updates' ), 'users_page_new-user-approve-admin', 'side', 'default' );
222
  add_meta_box( 'nua-support', __( 'Support', 'new-user-approve' ), array( $this, 'metabox_support' ), 'users_page_new-user-approve-admin', 'side', 'default' );
285
  <?php
286
  }
287
 
 
 
 
 
 
 
 
 
 
288
  }
289
 
290
  function pw_new_user_approve_admin_approve() {
includes/plugins.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Contains all functionality to make the New User Approve plugin
4
+ * compatible with all plugins.
5
+ */
6
+
7
+ /*
8
+ * Don't show the error if the s2member plugin is active
9
+ */
10
+ function nua_c2member_dismiss_membership_notice( $show_notice ) {
11
+ if ( class_exists( 'c_ws_plugin__s2member_constants' ) ) {
12
+ $show_notice = false;
13
+ }
14
+
15
+ return $show_notice;
16
+ }
17
+ add_filter( 'new_user_approve_show_membership_notice', 'nua_c2member_dismiss_membership_notice' );
includes/user-list.php CHANGED
@@ -171,10 +171,8 @@ class pw_new_user_approve_user_list {
171
  <label class="screen-reader-text" for="<?php echo $id ?>"><?php _e( 'View all users', 'new-user-approve' ); ?></label>
172
  <select id="<?php echo $id ?>" name="<?php echo $id ?>" style="float: none; margin: 0 0 0 15px;">
173
  <option value=""><?php _e( 'View all users', 'new-user-approve' ); ?></option>
174
- <?php foreach ( pw_new_user_approve()->get_user_statuses() as $status => $users ) : ?>
175
- <?php if ( count( $users ) ) : ?>
176
  <option value="<?php echo esc_attr( $status ); ?>"<?php selected( $status, $filtered_status ); ?>><?php echo esc_html( $status ); ?></option>
177
- <?php endif; ?>
178
  <?php endforeach; ?>
179
  </select>
180
  <?php echo apply_filters( 'new_user_approve_filter_button', $filter_button ); ?>
@@ -193,7 +191,7 @@ class pw_new_user_approve_user_list {
193
  * @uses pre_user_query
194
  * @param $query
195
  */
196
- public function filter_by_status( $query ) {
197
  global $wpdb;
198
 
199
  if ( !is_admin() ) {
@@ -208,14 +206,14 @@ class pw_new_user_approve_user_list {
208
  if ( $this->selected_status() != null ) {
209
  $filter = $this->selected_status();
210
 
211
- $query->query_from .= " INNER JOIN {$wpdb->usermeta} ON ( {$wpdb->users}.ID = wp_usermeta.user_id )";
212
 
213
  if ( 'approved' == $filter ) {
214
  $query->query_fields = "DISTINCT SQL_CALC_FOUND_ROWS {$wpdb->users}.ID";
215
  $query->query_from .= " LEFT JOIN {$wpdb->usermeta} AS mt1 ON ({$wpdb->users}.ID = mt1.user_id AND mt1.meta_key = 'pw_user_status')";
216
- $query->query_where .= " AND ( ( wp_usermeta.meta_key = 'pw_user_status' AND CAST(wp_usermeta.meta_value AS CHAR) = 'approved' ) OR mt1.user_id IS NULL )";
217
  } else {
218
- $query->query_where .= " AND ( (wp_usermeta.meta_key = 'pw_user_status' AND CAST(wp_usermeta.meta_value AS CHAR) = '{$filter}') )";
219
  }
220
  }
221
  }
@@ -420,10 +418,10 @@ class pw_new_user_approve_user_list {
420
  public function pending_users_bubble() {
421
  global $menu;
422
 
423
- $users = pw_new_user_approve()->get_user_statuses();
424
 
425
- // Count Number of Pending Members
426
- $pending_users = count( $users['pending'] );
427
 
428
  // Make sure there are pending members
429
  if ( $pending_users > 0 ) {
171
  <label class="screen-reader-text" for="<?php echo $id ?>"><?php _e( 'View all users', 'new-user-approve' ); ?></label>
172
  <select id="<?php echo $id ?>" name="<?php echo $id ?>" style="float: none; margin: 0 0 0 15px;">
173
  <option value=""><?php _e( 'View all users', 'new-user-approve' ); ?></option>
174
+ <?php foreach ( pw_new_user_approve()->get_valid_statuses() as $status ) : ?>
 
175
  <option value="<?php echo esc_attr( $status ); ?>"<?php selected( $status, $filtered_status ); ?>><?php echo esc_html( $status ); ?></option>
 
176
  <?php endforeach; ?>
177
  </select>
178
  <?php echo apply_filters( 'new_user_approve_filter_button', $filter_button ); ?>
191
  * @uses pre_user_query
192
  * @param $query
193
  */
194
+ public function filter_by_status( $query ) {
195
  global $wpdb;
196
 
197
  if ( !is_admin() ) {
206
  if ( $this->selected_status() != null ) {
207
  $filter = $this->selected_status();
208
 
209
+ $query->query_from .= " INNER JOIN {$wpdb->usermeta} ON ( {$wpdb->users}.ID = $wpdb->usermeta.user_id )";
210
 
211
  if ( 'approved' == $filter ) {
212
  $query->query_fields = "DISTINCT SQL_CALC_FOUND_ROWS {$wpdb->users}.ID";
213
  $query->query_from .= " LEFT JOIN {$wpdb->usermeta} AS mt1 ON ({$wpdb->users}.ID = mt1.user_id AND mt1.meta_key = 'pw_user_status')";
214
+ $query->query_where .= " AND ( ( $wpdb->usermeta.meta_key = 'pw_user_status' AND CAST($wpdb->usermeta.meta_value AS CHAR) = 'approved' ) OR mt1.user_id IS NULL )";
215
  } else {
216
+ $query->query_where .= " AND ( ($wpdb->usermeta.meta_key = 'pw_user_status' AND CAST($wpdb->usermeta.meta_value AS CHAR) = '{$filter}') )";
217
  }
218
  }
219
  }
418
  public function pending_users_bubble() {
419
  global $menu;
420
 
421
+ $users = pw_new_user_approve()->get_count_of_user_statuses();
422
 
423
+ // Get the number of pending users
424
+ $pending_users = $users['pending'];
425
 
426
  // Make sure there are pending members
427
  if ( $pending_users > 0 ) {
localization/new-user-approve-bg_BG.mo ADDED
Binary file
localization/new-user-approve-bg_BG.po ADDED
@@ -0,0 +1,328 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # New User Approve WordPress plugin
2
+ # Copyright (C) 2013 Josh Harrison
3
+ # This file is distributed under the same license as the parent package.
4
+ # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5
+ #
6
+ msgid ""
7
+ msgstr ""
8
+ "Project-Id-Version: New User Approve\n"
9
+ "Report-Msgid-Bugs-To: http://wordpress.org/tag/new-user-approve\n"
10
+ "POT-Creation-Date: 2017-05-20 01:20+0300\n"
11
+ "PO-Revision-Date: 2017-05-23 11:37+0300\n"
12
+ "Language-Team: Picklewagon <josh@picklewagon.com>\n"
13
+ "MIME-Version: 1.0\n"
14
+ "Content-Type: text/plain; charset=UTF-8\n"
15
+ "Content-Transfer-Encoding: 8bit\n"
16
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
17
+ "X-Generator: Poedit 2.0.2\n"
18
+ "X-Poedit-SourceCharset: UTF-8\n"
19
+ "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c\n"
20
+ "X-Poedit-Basepath: .\n"
21
+ "Last-Translator: Spas Zdravkov Spasov [WP: @spaszs] <spas.z.spasov@gmail."
22
+ "com>\n"
23
+ "Language: bg_BG\n"
24
+ "X-Poedit-SearchPath-0: ..\n"
25
+ "X-Poedit-SearchPath-1: ../includes\n"
26
+
27
+ #: ../new-user-approve.php:98
28
+ #, php-format
29
+ msgid "New User Approve requires WordPress %s or newer."
30
+ msgstr ""
31
+ "New User Approve (Одобри нови потребители) изисква WordPress %s или по-нова "
32
+ "версия."
33
+
34
+ #: ../new-user-approve.php:145
35
+ #, php-format
36
+ msgid ""
37
+ "The Membership setting must be turned on in order for the New User Approve "
38
+ "to work correctly. <a href=\"%1$s\">Update in settings</a>. | <a href=\"%2$s"
39
+ "\">Hide Notice</a>"
40
+ msgstr ""
41
+ "За да работи New User Approve коректно е необходимо отметката Всеки може да "
42
+ "се регистрира (раздел Членство, меню Настройки) да бъде включена. <a href="
43
+ "\"%1$s\">Актуализирай настройките</a>. | <a href=\"%2$s\">Скрий известието</"
44
+ "a>."
45
+
46
+ #: ../new-user-approve.php:257
47
+ msgid "<strong>ERROR</strong>: Your account is still pending approval."
48
+ msgstr "<strong>Грешка</strong>: Вашата потребителска сметка очаква одобрение."
49
+
50
+ #: ../new-user-approve.php:260
51
+ msgid ""
52
+ "<strong>ERROR</strong>: Your account has been denied access to this site."
53
+ msgstr ""
54
+ "<strong>Грешка</strong>: Достъпъпа на вашата потребителска сметка до тази "
55
+ "страница е забранен."
56
+
57
+ #: ../new-user-approve.php:362
58
+ msgid "Users"
59
+ msgstr "Потребители"
60
+
61
+ #: ../new-user-approve.php:392
62
+ #, php-format
63
+ msgid "[%s] User Approval"
64
+ msgstr "Потребителя [%s] е одобрен."
65
+
66
+ #: ../new-user-approve.php:454
67
+ #, php-format
68
+ msgid ""
69
+ "<strong>ERROR</strong>: Couldn&#8217;t register you... please contact the <a "
70
+ "href=\"mailto:%s\">webmaster</a> !"
71
+ msgstr ""
72
+ "<strong>Грешка</strong>: Меуспешна регистрация... моля сържете с <a href="
73
+ "\"mailto:%s\">уеб администатора</a> !"
74
+
75
+ #: ../new-user-approve.php:520
76
+ #, php-format
77
+ msgid "[%s] Registration Approved"
78
+ msgstr "[%s] Регострацията е одобрена"
79
+
80
+ #: ../new-user-approve.php:550
81
+ #, php-format
82
+ msgid "[%s] Registration Denied"
83
+ msgstr "[%s] Регистрацията е отказана"
84
+
85
+ #: ../new-user-approve.php:614
86
+ msgid "Registration successful."
87
+ msgstr "Успешна регистрация."
88
+
89
+ #: ../new-user-approve.php:617
90
+ msgid "Pending Approval"
91
+ msgstr "Очаква Одобрение"
92
+
93
+ #: ../admin/templates/approve.php:6
94
+ msgid "User successfully updated."
95
+ msgstr "Потребителят е обновен успешно."
96
+
97
+ #: ../admin/templates/approve.php:11
98
+ msgid "User Registration Approval"
99
+ msgstr "Одобряване на регистрация на потребител"
100
+
101
+ # "Approve New Users" must be translated as "Одобри нови потребители" but it is too long for a menu element, so the translation is "Нови потребители", which means "New users"
102
+ #: ../includes/admin-approve.php:50
103
+ msgid "Approve New Users"
104
+ msgstr "Нови потребители"
105
+
106
+ #: ../includes/admin-approve.php:82
107
+ msgid "Username"
108
+ msgstr "Потребителско име"
109
+
110
+ #: ../includes/admin-approve.php:83
111
+ msgid "Name"
112
+ msgstr "Име"
113
+
114
+ #: ../includes/admin-approve.php:84
115
+ msgid "E-mail"
116
+ msgstr "Е-поща"
117
+
118
+ #: ../includes/admin-approve.php:86 ../includes/admin-approve.php:88
119
+ msgid "Actions"
120
+ msgstr "Действия"
121
+
122
+ #: ../includes/admin-approve.php:129
123
+ msgid "email:"
124
+ msgstr "е-поща:"
125
+
126
+ #: ../includes/admin-approve.php:133 ../includes/user-list.php:97
127
+ #: ../includes/user-list.php:223 ../includes/user-list.php:224
128
+ msgid "Approve"
129
+ msgstr "Одобри"
130
+
131
+ #: ../includes/admin-approve.php:138 ../includes/user-list.php:98
132
+ #: ../includes/user-list.php:226 ../includes/user-list.php:227
133
+ msgid "Deny"
134
+ msgstr "Откажи"
135
+
136
+ #: ../includes/admin-approve.php:154
137
+ msgid "approved"
138
+ msgstr "одобрен"
139
+
140
+ #: ../includes/admin-approve.php:156
141
+ msgid "denied"
142
+ msgstr "отказан"
143
+
144
+ #: ../includes/admin-approve.php:158
145
+ msgid "pending"
146
+ msgstr "необработен"
147
+
148
+ #: ../includes/admin-approve.php:161
149
+ #, php-format
150
+ msgid "There are no users with a status of %s"
151
+ msgstr "Няма потребители със статус %s"
152
+
153
+ #: ../includes/admin-approve.php:197
154
+ #, php-format
155
+ msgid ""
156
+ "You can now update user status on the <a href=\"%1$s\">users admin page</a>. "
157
+ "| <a href=\"%2$s\">Hide Notice</a>"
158
+ msgstr ""
159
+ "Сега можете да обновите потребителския статус в <a href=\"%1$s\">страницата "
160
+ "администриране на потребители</a>. | <a href=\"%2$s\">Скрий известието</a>"
161
+
162
+ #: ../includes/admin-approve.php:220
163
+ msgid "Approve Users"
164
+ msgstr "Одобри Потребители"
165
+
166
+ #: ../includes/admin-approve.php:221
167
+ msgid "Updates"
168
+ msgstr "Обновления"
169
+
170
+ #: ../includes/admin-approve.php:222
171
+ msgid "Support"
172
+ msgstr "Поддръжка"
173
+
174
+ #: ../includes/admin-approve.php:223
175
+ msgid "Feedback"
176
+ msgstr "Обратна връзка"
177
+
178
+ #: ../includes/admin-approve.php:231
179
+ msgid "Users Pending Approval"
180
+ msgstr "Потребители Очакващи Одобрение"
181
+
182
+ #: ../includes/admin-approve.php:233
183
+ msgid "Approved Users"
184
+ msgstr "Одобрени Потребители"
185
+
186
+ #: ../includes/admin-approve.php:235
187
+ msgid "Denied Users"
188
+ msgstr "Отхвърлени Потребители"
189
+
190
+ #: ../includes/email-tags.php:235
191
+ msgid "The user's username on the site as well as the Username label"
192
+ msgstr ""
193
+ "Потребителското име на потребителя в сайта също както етикет Потребителско "
194
+ "име"
195
+
196
+ #: ../includes/email-tags.php:241
197
+ msgid "The user's email address"
198
+ msgstr "Е-поща на потребителя"
199
+
200
+ #: ../includes/email-tags.php:247
201
+ msgid "Your site name"
202
+ msgstr "Името на вашия сайт"
203
+
204
+ #: ../includes/email-tags.php:253
205
+ msgid "Your site URL"
206
+ msgstr "Адревсът на вашия сайт"
207
+
208
+ #: ../includes/email-tags.php:259
209
+ msgid "The URL to approve/deny users"
210
+ msgstr "Адсресът за одобрение/отказ на потребителски заявки"
211
+
212
+ #: ../includes/email-tags.php:265
213
+ msgid "The URL to login to the site"
214
+ msgstr "Адрессът за влизане в сайта"
215
+
216
+ #: ../includes/email-tags.php:271
217
+ msgid "Generates the password for the user to add to the email"
218
+ msgstr "Генерира паролата на потребителя, която ще бъде вмъкната в е-писмото"
219
+
220
+ #: ../includes/email-tags.php:299
221
+ #, php-format
222
+ msgid "Username: %s"
223
+ msgstr "Нова заявка за потребителско име: %s"
224
+
225
+ #: ../includes/email-tags.php:390
226
+ #, php-format
227
+ msgid "Password: %s"
228
+ msgstr "Парола: %s"
229
+
230
+ #: ../includes/messages.php:9
231
+ msgid "You have been approved to access {sitename}"
232
+ msgstr "Вашето запитване за достъп до {sitename} беше одобрено."
233
+
234
+ #: ../includes/messages.php:12
235
+ msgid "To set or reset your password, visit the following address:"
236
+ msgstr "За да зададете или промените вашата парола, посетете следния адрес:"
237
+
238
+ #: ../includes/messages.php:25
239
+ msgid "You have been denied access to {sitename}."
240
+ msgstr "Вашето запитване за достъп до {sitename} беше отказано."
241
+
242
+ #: ../includes/messages.php:38
243
+ msgid ""
244
+ "An email has been sent to the site administrator. The administrator will "
245
+ "review the information that has been submitted and either approve or deny "
246
+ "your request."
247
+ msgstr ""
248
+ "Беше изпратено е-писмо до администратора. Той ще прегледа информацията, "
249
+ "която е изпратена и ще одобри или ще откаже вашето запитване."
250
+
251
+ #: ../includes/messages.php:40
252
+ msgid ""
253
+ "You will receive an email with instructions on what you will need to do "
254
+ "next. Thanks for your patience."
255
+ msgstr ""
256
+ "Вие ще получите е-писмо с инструкции за това, което следва да направите. "
257
+ "Благодарим за търпението."
258
+
259
+ #: ../includes/messages.php:53
260
+ msgid ""
261
+ "Welcome to {sitename}. This site is accessible to approved users only. To be "
262
+ "approved, you must first register."
263
+ msgstr ""
264
+ "Добре дошли в {sitename}. Тази страница е достъпна само за одобрени "
265
+ "потребители. За да бъдете одобрен първо трябва да се регистрирате."
266
+
267
+ #: ../includes/messages.php:66
268
+ msgid "{username} ({user_email}) has requested a username at {sitename}"
269
+ msgstr ""
270
+ "{username} ({user_email}) изпрати запитване за потребителско име в "
271
+ "{sitename}:"
272
+
273
+ #: ../includes/messages.php:68
274
+ msgid "To approve or deny this user access to {sitename} go to"
275
+ msgstr ""
276
+ "За да одобрите или откажете тази потребителска сметка в {sitename}, отидете "
277
+ "на адрес:"
278
+
279
+ #: ../includes/messages.php:83
280
+ msgid ""
281
+ "After you register, your request will be sent to the site administrator for "
282
+ "approval. You will then receive an email with further instructions."
283
+ msgstr ""
284
+ "След вашата регистрация, вашето запитване ще бъде препратено за одобрение до "
285
+ "администратора на сайта. След това ще получите е-писмо с последващи "
286
+ "инстукции."
287
+
288
+ #: ../includes/user-list.php:120
289
+ msgid "Status"
290
+ msgstr "Статус"
291
+
292
+ #: ../includes/user-list.php:156
293
+ msgid "Filter"
294
+ msgstr "Филтър"
295
+
296
+ #: ../includes/user-list.php:161 ../includes/user-list.php:163
297
+ msgid "View all users"
298
+ msgstr "Виж всички потребители"
299
+
300
+ #: ../includes/user-list.php:320
301
+ #, php-format
302
+ msgid "User denied."
303
+ msgid_plural "%s users denied."
304
+ msgstr[0] "Потребителят е отказан."
305
+ msgstr[1] "Потребителите %s са отказани."
306
+
307
+ #: ../includes/user-list.php:325
308
+ #, php-format
309
+ msgid "User approved."
310
+ msgid_plural "%s users approved."
311
+ msgstr[0] "Потребителят е обновен."
312
+ msgstr[1] "Потребителите %s са одобрени."
313
+
314
+ #: ../includes/user-list.php:349
315
+ msgid "Access Status"
316
+ msgstr "Статус на Достъп"
317
+
318
+ #: ../includes/user-list.php:354
319
+ msgid "-- Status --"
320
+ msgstr "-- Статус --"
321
+
322
+ #: ../includes/user-list.php:362
323
+ msgid "If user has access to sign in or not."
324
+ msgstr "Ако потребителя има достъп за влисване, или ако няма."
325
+
326
+ #: ../includes/user-list.php:365
327
+ msgid "Current user status is <strong>pending</strong>."
328
+ msgstr "Текущият потребителси статис е <strong>Необработен</strong>."
localization/new-user-approve-pl_PL.mo CHANGED
Binary file
localization/new-user-approve-pl_PL.po CHANGED
@@ -5,10 +5,10 @@
5
  #
6
  msgid ""
7
  msgstr ""
8
- "Project-Id-Version: PACKAGE VERSION\n"
9
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/new-user-approve\n"
10
- "POT-Creation-Date: 2014-10-08 23:50-0700\n"
11
- "PO-Revision-Date: 2014-12-31 00:55-0700\n"
12
  "Last-Translator: Josh Harrison <josh@picklewagon.com>\n"
13
  "Language-Team: Piotr Kubala <pik256@gmail.com>\n"
14
  "Language: pl_PL\n"
@@ -16,12 +16,14 @@ msgstr ""
16
  "Content-Type: text/plain; charset=utf-8\n"
17
  "Content-Transfer-Encoding: 8bit\n"
18
  "X-Poedit-SourceCharset: utf-8\n"
19
- "X-Generator: Poedit 1.5.7\n"
 
 
20
 
21
  #: ../new-user-approve.php:98
22
  #, php-format
23
  msgid "New User Approve requires WordPress %s or newer."
24
- msgstr ""
25
 
26
  #: ../new-user-approve.php:145
27
  #, php-format
@@ -30,15 +32,22 @@ msgid ""
30
  "to work correctly. <a href=\"%1$s\">Update in settings</a>. | <a href=\"%2$s"
31
  "\">Hide Notice</a>"
32
  msgstr ""
 
 
 
33
 
34
  #: ../new-user-approve.php:257
35
  msgid "<strong>ERROR</strong>: Your account is still pending approval."
36
  msgstr ""
 
 
37
 
38
  #: ../new-user-approve.php:260
39
  msgid ""
40
  "<strong>ERROR</strong>: Your account has been denied access to this site."
41
  msgstr ""
 
 
42
 
43
  #: ../new-user-approve.php:362
44
  msgid "Users"
@@ -55,6 +64,8 @@ msgid ""
55
  "<strong>ERROR</strong>: Couldn&#8217;t register you... please contact the <a "
56
  "href=\"mailto:%s\">webmaster</a> !"
57
  msgstr ""
 
 
58
 
59
  #: ../new-user-approve.php:520
60
  #, php-format
@@ -84,7 +95,7 @@ msgstr "Przyjmowanie rejestracji"
84
 
85
  #: ../includes/admin-approve.php:50
86
  msgid "Approve New Users"
87
- msgstr "Zatwierdanie użytkowników"
88
 
89
  #: ../includes/admin-approve.php:82
90
  msgid "Username"
@@ -139,23 +150,24 @@ msgid ""
139
  "You can now update user status on the <a href=\"%1$s\">users admin page</a>. "
140
  "| <a href=\"%2$s\">Hide Notice</a>"
141
  msgstr ""
 
 
142
 
143
  #: ../includes/admin-approve.php:220
144
- #, fuzzy
145
  msgid "Approve Users"
146
- msgstr "Użytkownicy przyjęci"
147
 
148
  #: ../includes/admin-approve.php:221
149
  msgid "Updates"
150
- msgstr ""
151
 
152
  #: ../includes/admin-approve.php:222
153
  msgid "Support"
154
- msgstr ""
155
 
156
  #: ../includes/admin-approve.php:223
157
  msgid "Feedback"
158
- msgstr ""
159
 
160
  #: ../includes/admin-approve.php:231
161
  msgid "Users Pending Approval"
@@ -171,31 +183,31 @@ msgstr "Użytkownicy odrzuceni"
171
 
172
  #: ../includes/email-tags.php:235
173
  msgid "The user's username on the site as well as the Username label"
174
- msgstr ""
175
 
176
  #: ../includes/email-tags.php:241
177
  msgid "The user's email address"
178
- msgstr ""
179
 
180
  #: ../includes/email-tags.php:247
181
  msgid "Your site name"
182
- msgstr ""
183
 
184
  #: ../includes/email-tags.php:253
185
  msgid "Your site URL"
186
- msgstr ""
187
 
188
  #: ../includes/email-tags.php:259
189
  msgid "The URL to approve/deny users"
190
- msgstr ""
191
 
192
  #: ../includes/email-tags.php:265
193
  msgid "The URL to login to the site"
194
- msgstr ""
195
 
196
  #: ../includes/email-tags.php:271
197
  msgid "Generates the password for the user to add to the email"
198
- msgstr ""
199
 
200
  #: ../includes/email-tags.php:299
201
  #, php-format
@@ -208,16 +220,14 @@ msgid "Password: %s"
208
  msgstr "Hasło: %s"
209
 
210
  #: ../includes/messages.php:9
211
- #, fuzzy
212
  msgid "You have been approved to access {sitename}"
213
- msgstr "Zostałeś przyjęty na %s"
214
 
215
  #: ../includes/messages.php:25
216
- #, fuzzy
217
  msgid "You have been denied access to {sitename}."
218
  msgstr ""
219
- "Twoja rejestracja na %s została odrzucona. Przepraszamy: być może podałeś "
220
- "błędne lub niepełne informacje w trakcie rejestracji."
221
 
222
  #: ../includes/messages.php:38
223
  msgid ""
@@ -236,23 +246,21 @@ msgstr ""
236
  "Oczekuj emaila z instrukcjami, co robić dalej. Dziękujemy za cierpliwość."
237
 
238
  #: ../includes/messages.php:53
239
- #, fuzzy
240
  msgid ""
241
  "Welcome to {sitename}. This site is accessible to approved users only. To be "
242
  "approved, you must first register."
243
  msgstr ""
244
- "Witaj na %s. Część tej witryny dostępna jest tylko dla zaakceptowanych "
245
- "użytkowników. Aby zostać zaakceptowanym, musisz wpierw się zarejestrować."
 
246
 
247
  #: ../includes/messages.php:66
248
- #, fuzzy
249
  msgid "{username} ({user_email}) has requested a username at {sitename}"
250
- msgstr "%1$s (%2$s) zażądał konta na %3$s"
251
 
252
  #: ../includes/messages.php:68
253
- #, fuzzy
254
  msgid "To approve or deny this user access to {sitename} go to"
255
- msgstr "Aby zaakceptować lub odrzucić to żądanie na %s przejdź do"
256
 
257
  #: ../includes/messages.php:83
258
  msgid ""
@@ -264,33 +272,35 @@ msgstr ""
264
 
265
  #: ../includes/user-list.php:120
266
  msgid "Status"
267
- msgstr ""
268
 
269
  #: ../includes/user-list.php:156
270
  msgid "Filter"
271
- msgstr ""
272
 
273
  #: ../includes/user-list.php:161 ../includes/user-list.php:163
274
  msgid "View all users"
275
- msgstr ""
276
 
277
  #: ../includes/user-list.php:320
278
- #, fuzzy, php-format
279
  msgid "User denied."
280
  msgid_plural "%s users denied."
281
- msgstr[0] "odrzucony"
282
- msgstr[1] "odrzucony"
 
283
 
284
  #: ../includes/user-list.php:325
285
- #, fuzzy, php-format
286
  msgid "User approved."
287
  msgid_plural "%s users approved."
288
- msgstr[0] "Akceptacja nowego użytkownika"
289
- msgstr[1] "Akceptacja nowego użytkownika"
 
290
 
291
  #: ../includes/user-list.php:349
292
  msgid "Access Status"
293
- msgstr ""
294
 
295
  #: ../includes/user-list.php:354
296
  msgid "-- Status --"
@@ -298,11 +308,11 @@ msgstr ""
298
 
299
  #: ../includes/user-list.php:362
300
  msgid "If user has access to sign in or not."
301
- msgstr ""
302
 
303
  #: ../includes/user-list.php:365
304
  msgid "Current user status is <strong>pending</strong>."
305
- msgstr ""
306
 
307
  #~ msgid "Settings"
308
  #~ msgstr "Ustawienia"
5
  #
6
  msgid ""
7
  msgstr ""
8
+ "Project-Id-Version: \n"
9
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/new-user-approve\n"
10
+ "POT-Creation-Date: 2017-06-12 14:39+0200\n"
11
+ "PO-Revision-Date: 2017-06-12 15:00+0200\n"
12
  "Last-Translator: Josh Harrison <josh@picklewagon.com>\n"
13
  "Language-Team: Piotr Kubala <pik256@gmail.com>\n"
14
  "Language: pl_PL\n"
16
  "Content-Type: text/plain; charset=utf-8\n"
17
  "Content-Transfer-Encoding: 8bit\n"
18
  "X-Poedit-SourceCharset: utf-8\n"
19
+ "X-Generator: Poedit 2.0.2\n"
20
+ "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
21
+ "|| n%100>=20) ? 1 : 2);\n"
22
 
23
  #: ../new-user-approve.php:98
24
  #, php-format
25
  msgid "New User Approve requires WordPress %s or newer."
26
+ msgstr "Wtyczka New User Approve wymaga WordPressa %s lub nowszego."
27
 
28
  #: ../new-user-approve.php:145
29
  #, php-format
32
  "to work correctly. <a href=\"%1$s\">Update in settings</a>. | <a href=\"%2$s"
33
  "\">Hide Notice</a>"
34
  msgstr ""
35
+ "Ustawienie \"każdy może się zarejestrować\" musi zostać włączone aby wtyczka "
36
+ "New User Approve działała poprawnie. <a href=\"%1$s\">zaktualizuj</a>. | <a "
37
+ "href=\"%2$s\">Ukryj powiadomienie</a>"
38
 
39
  #: ../new-user-approve.php:257
40
  msgid "<strong>ERROR</strong>: Your account is still pending approval."
41
  msgstr ""
42
+ "<strong>BŁĄD</strong>: Twoje konto wciąż oczekuje na przyjęcie do logowania "
43
+ "się na tej witrynie."
44
 
45
  #: ../new-user-approve.php:260
46
  msgid ""
47
  "<strong>ERROR</strong>: Your account has been denied access to this site."
48
  msgstr ""
49
+ "<strong>BŁĄD</strong>: Twoje konto nie uzyskało akceptacji do logowania się "
50
+ "na tej witrynie."
51
 
52
  #: ../new-user-approve.php:362
53
  msgid "Users"
64
  "<strong>ERROR</strong>: Couldn&#8217;t register you... please contact the <a "
65
  "href=\"mailto:%s\">webmaster</a> !"
66
  msgstr ""
67
+ "<strong>BŁĄD</strong>: Nie można Cię zarejestrować... skontaktuj się z <a "
68
+ "href=\"mailto:%s\">webmasterem</a> !"
69
 
70
  #: ../new-user-approve.php:520
71
  #, php-format
95
 
96
  #: ../includes/admin-approve.php:50
97
  msgid "Approve New Users"
98
+ msgstr "Zatwierdzanie użytkowników"
99
 
100
  #: ../includes/admin-approve.php:82
101
  msgid "Username"
150
  "You can now update user status on the <a href=\"%1$s\">users admin page</a>. "
151
  "| <a href=\"%2$s\">Hide Notice</a>"
152
  msgstr ""
153
+ "Możesz teraz aktualizować status użytkowników na <a href=\"%1$s\">stronie "
154
+ "użytkowników</a>. | <a href=\"%2$s\">Ukryj to powiadomienie</a>"
155
 
156
  #: ../includes/admin-approve.php:220
 
157
  msgid "Approve Users"
158
+ msgstr "Zatwierdź użytkowników"
159
 
160
  #: ../includes/admin-approve.php:221
161
  msgid "Updates"
162
+ msgstr "Aktualizacje"
163
 
164
  #: ../includes/admin-approve.php:222
165
  msgid "Support"
166
+ msgstr "Wsparcie"
167
 
168
  #: ../includes/admin-approve.php:223
169
  msgid "Feedback"
170
+ msgstr "Informacja zwrotna"
171
 
172
  #: ../includes/admin-approve.php:231
173
  msgid "Users Pending Approval"
183
 
184
  #: ../includes/email-tags.php:235
185
  msgid "The user's username on the site as well as the Username label"
186
+ msgstr "Nazwa użytkownika na witrynie oraz jego widoczna etykietka"
187
 
188
  #: ../includes/email-tags.php:241
189
  msgid "The user's email address"
190
+ msgstr "Adres email użytkownika"
191
 
192
  #: ../includes/email-tags.php:247
193
  msgid "Your site name"
194
+ msgstr "Nazwa twojej strony"
195
 
196
  #: ../includes/email-tags.php:253
197
  msgid "Your site URL"
198
+ msgstr "Twój adres URL"
199
 
200
  #: ../includes/email-tags.php:259
201
  msgid "The URL to approve/deny users"
202
+ msgstr "Adres URL do przyjmowania/odrzucania użytkowników"
203
 
204
  #: ../includes/email-tags.php:265
205
  msgid "The URL to login to the site"
206
+ msgstr "Adres URL do logowania się do witryny"
207
 
208
  #: ../includes/email-tags.php:271
209
  msgid "Generates the password for the user to add to the email"
210
+ msgstr "Generuje hasło dla użytkownika w celu dodania do emaila"
211
 
212
  #: ../includes/email-tags.php:299
213
  #, php-format
220
  msgstr "Hasło: %s"
221
 
222
  #: ../includes/messages.php:9
 
223
  msgid "You have been approved to access {sitename}"
224
+ msgstr "Zostałeś przyjęty na {sitename}"
225
 
226
  #: ../includes/messages.php:25
 
227
  msgid "You have been denied access to {sitename}."
228
  msgstr ""
229
+ "Twoja rejestracja na {sitename} została odrzucona. Przepraszamy: być może "
230
+ "podałeś błędne lub niepełne informacje w trakcie rejestracji."
231
 
232
  #: ../includes/messages.php:38
233
  msgid ""
246
  "Oczekuj emaila z instrukcjami, co robić dalej. Dziękujemy za cierpliwość."
247
 
248
  #: ../includes/messages.php:53
 
249
  msgid ""
250
  "Welcome to {sitename}. This site is accessible to approved users only. To be "
251
  "approved, you must first register."
252
  msgstr ""
253
+ "Witaj na {sitename}. Część tej witryny dostępna jest tylko dla "
254
+ "zaakceptowanych użytkowników. Aby zostać zaakceptowanym, musisz najpierw się "
255
+ "zarejestrować."
256
 
257
  #: ../includes/messages.php:66
 
258
  msgid "{username} ({user_email}) has requested a username at {sitename}"
259
+ msgstr "{username} ({user_email}) zażądał konta na {sitename}"
260
 
261
  #: ../includes/messages.php:68
 
262
  msgid "To approve or deny this user access to {sitename} go to"
263
+ msgstr "Aby zaakceptować lub odrzucić dostęp do {sitename}, przejdź do"
264
 
265
  #: ../includes/messages.php:83
266
  msgid ""
272
 
273
  #: ../includes/user-list.php:120
274
  msgid "Status"
275
+ msgstr "Status"
276
 
277
  #: ../includes/user-list.php:156
278
  msgid "Filter"
279
+ msgstr "Filtruj"
280
 
281
  #: ../includes/user-list.php:161 ../includes/user-list.php:163
282
  msgid "View all users"
283
+ msgstr "Zobacz wszystkich użytkowników"
284
 
285
  #: ../includes/user-list.php:320
286
+ #, php-format
287
  msgid "User denied."
288
  msgid_plural "%s users denied."
289
+ msgstr[0] "Użytkownik odrzucony."
290
+ msgstr[1] "%s użytkownicy odrzuceni."
291
+ msgstr[2] "%s użytkowników odrzuconych."
292
 
293
  #: ../includes/user-list.php:325
294
+ #, php-format
295
  msgid "User approved."
296
  msgid_plural "%s users approved."
297
+ msgstr[0] "Użytkownik został zaakceptowany."
298
+ msgstr[1] "% użytkownicy zaakceptowani."
299
+ msgstr[2] "% użytkowników zaakceptowanych."
300
 
301
  #: ../includes/user-list.php:349
302
  msgid "Access Status"
303
+ msgstr "Status dostępu"
304
 
305
  #: ../includes/user-list.php:354
306
  msgid "-- Status --"
308
 
309
  #: ../includes/user-list.php:362
310
  msgid "If user has access to sign in or not."
311
+ msgstr "Czy użytkownik może się zalogować, czy nie"
312
 
313
  #: ../includes/user-list.php:365
314
  msgid "Current user status is <strong>pending</strong>."
315
+ msgstr "Aktualny status: <strong>oczekuje na akceptację</strong>."
316
 
317
  #~ msgid "Settings"
318
  #~ msgstr "Ustawienia"
localization/new-user-approve.pot CHANGED
@@ -215,6 +215,10 @@ msgstr ""
215
  msgid "You have been approved to access {sitename}"
216
  msgstr ""
217
 
 
 
 
 
218
  #: ../includes/messages.php:25
219
  msgid "You have been denied access to {sitename}."
220
  msgstr ""
215
  msgid "You have been approved to access {sitename}"
216
  msgstr ""
217
 
218
+ #: ../includes/messages.php:12
219
+ msgid "To set or reset your password, visit the following address:"
220
+ msgstr ""
221
+
222
  #: ../includes/messages.php:25
223
  msgid "You have been denied access to {sitename}."
224
  msgstr ""
new-user-approve.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin URI: http://www.picklewagon.com/wordpress/new-user-approve/
5
  Description: Allow administrators to approve users once they register. Only approved users will be allowed to access the site. For support, please go to the <a href="http://wordpress.org/support/plugin/new-user-approve">support forums</a> on wordpress.org.
6
  Author: Josh Harrison
7
- Version: 1.7.4
8
  Author URI: http://picklewagon.com/
9
  */
10
 
@@ -129,18 +129,23 @@ class pw_new_user_approve {
129
  public function admin_notices() {
130
  $user_id = get_current_user_id();
131
 
 
 
 
 
 
132
  // update the setting for the current user
133
  if ( isset( $_GET['new-user-approve-settings-notice'] ) && '1' == $_GET['new-user-approve-settings-notice'] ) {
134
  add_user_meta( $user_id, 'pw_new_user_approve_settings_notice', '1', true );
135
  }
136
 
137
- // Don't show the error if the s2member plugin is active
138
- if ( class_exists( 'c_ws_plugin__s2member_constants' ) ) {
139
- return;
140
- }
141
 
142
  // Check that the user hasn't already clicked to ignore the message
143
- if ( ! get_user_meta( $user_id, 'pw_new_user_approve_settings_notice' ) ) {
144
  echo '<div class="error"><p>';
145
  printf( __( 'The Membership setting must be turned on in order for the New User Approve to work correctly. <a href="%1$s">Update in settings</a>. | <a href="%2$s">Hide Notice</a>', 'new-user-approve' ), admin_url( 'options-general.php' ), add_query_arg( array( 'new-user-approve-settings-notice' => 1 ) ) );
146
  echo "</p></div>";
@@ -298,34 +303,75 @@ class pw_new_user_approve {
298
  return $message;
299
  }
300
 
301
- public function _get_user_statuses() {
302
  $statuses = array();
303
 
304
  foreach ( $this->get_valid_statuses() as $status ) {
305
  // Query the users table
306
  if ( $status != 'approved' ) {
307
  // Query the users table
308
- $query = array( 'meta_key' => 'pw_user_status', 'meta_value' => $status, );
309
- $wp_user_search = new WP_User_Query( $query );
310
- } else {
311
- // get all approved users and any user without a status
312
- $query = array( 'meta_query' => array( 'relation' => 'OR', array( 'key' => 'pw_user_status', 'value' => 'approved', 'compare' => '=' ), array( 'key' => 'pw_user_status', 'value' => '', 'compare' => 'NOT EXISTS' ), ), );
313
- $wp_user_search = new WP_User_Query( $query );
314
- }
315
-
316
- $statuses[$status] = $wp_user_search->get_results();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
317
  }
318
 
319
  return $statuses;
320
  }
321
- /**
322
- * Get a status of all the users and save them using a transient
323
- */
 
 
 
 
 
 
 
 
 
 
 
 
324
  public function get_user_statuses() {
325
  $user_statuses = get_transient( 'new_user_approve_user_statuses' );
326
 
327
  if ( false === $user_statuses ) {
328
- $user_statuses = $this->_get_user_statuses();
329
  set_transient( 'new_user_approve_user_statuses', $user_statuses );
330
  }
331
 
@@ -355,13 +401,15 @@ class pw_new_user_approve {
355
  * @uses rightnow_end
356
  */
357
  public function dashboard_stats() {
358
- $user_status = $this->get_user_statuses();
359
  ?>
360
  <div>
361
- <p><span style="font-weight:bold;"><a
362
- href="<?php echo apply_filters( 'new_user_approve_dashboard_link', 'users.php' ); ?>"><?php _e( 'Users', 'new-user-approve' ); ?></a></span>:
363
- <?php foreach ( $user_status as $status => $users ) :
364
- print count( $users ) . " " . __( $status, 'new-user-approve' ) . "&nbsp;&nbsp;&nbsp;";
 
 
365
  endforeach; ?>
366
  </p>
367
  </div>
@@ -578,7 +626,6 @@ class pw_new_user_approve {
578
 
579
  $headers = array(
580
  "From: \"{$from_name}\" <{$admin_email}>\n",
581
- "Content-Type: text/plain; charset=\"" . get_option( 'blog_charset' ) . "\"\n",
582
  );
583
 
584
  $headers = apply_filters( 'new_user_approve_email_header', $headers );
@@ -690,6 +737,9 @@ class pw_new_user_approve {
690
  if ( isset( $_REQUEST['action'] ) && 'createuser' == $_REQUEST['action'] ) {
691
  $status = 'approved';
692
  }
 
 
 
693
  update_user_meta( $user_id, 'pw_user_status', $status );
694
  }
695
 
4
  Plugin URI: http://www.picklewagon.com/wordpress/new-user-approve/
5
  Description: Allow administrators to approve users once they register. Only approved users will be allowed to access the site. For support, please go to the <a href="http://wordpress.org/support/plugin/new-user-approve">support forums</a> on wordpress.org.
6
  Author: Josh Harrison
7
+ Version: 1.7.5
8
  Author URI: http://picklewagon.com/
9
  */
10
 
129
  public function admin_notices() {
130
  $user_id = get_current_user_id();
131
 
132
+ // if the user isn't an admin, definitely don't show the notice
133
+ if ( ! current_user_can( 'manage_options' ) ) {
134
+ return;
135
+ }
136
+
137
  // update the setting for the current user
138
  if ( isset( $_GET['new-user-approve-settings-notice'] ) && '1' == $_GET['new-user-approve-settings-notice'] ) {
139
  add_user_meta( $user_id, 'pw_new_user_approve_settings_notice', '1', true );
140
  }
141
 
142
+ $show_notice = get_user_meta( $user_id, 'pw_new_user_approve_settings_notice' );
143
+
144
+ // one last chance to show the update
145
+ $show_notice = apply_filters( 'new_user_approve_show_membership_notice', $show_notice, $user_id );
146
 
147
  // Check that the user hasn't already clicked to ignore the message
148
+ if ( ! $show_notice ) {
149
  echo '<div class="error"><p>';
150
  printf( __( 'The Membership setting must be turned on in order for the New User Approve to work correctly. <a href="%1$s">Update in settings</a>. | <a href="%2$s">Hide Notice</a>', 'new-user-approve' ), admin_url( 'options-general.php' ), add_query_arg( array( 'new-user-approve-settings-notice' => 1 ) ) );
151
  echo "</p></div>";
303
  return $message;
304
  }
305
 
306
+ public function _get_user_statuses($count = true) {
307
  $statuses = array();
308
 
309
  foreach ( $this->get_valid_statuses() as $status ) {
310
  // Query the users table
311
  if ( $status != 'approved' ) {
312
  // Query the users table
313
+ $query = array(
314
+ 'meta_key' => 'pw_user_status',
315
+ 'meta_value' => $status,
316
+ 'count_total' => true,
317
+ 'number' => 1,
318
+ );
319
+ } else {
320
+ // get all approved users and any user without a status
321
+ $query = array(
322
+ 'meta_query' => array(
323
+ 'relation' => 'OR',
324
+ array(
325
+ 'key' => 'pw_user_status',
326
+ 'value' => 'approved',
327
+ 'compare' => '=',
328
+ ),
329
+ array(
330
+ 'key' => 'pw_user_status',
331
+ 'value' => '',
332
+ 'compare' => 'NOT EXISTS',
333
+ ),
334
+ ),
335
+ 'count_total' => true,
336
+ 'number' => 1,
337
+ );
338
+ }
339
+
340
+ if ($count === false) {
341
+ unset($query['count_total']);
342
+ unset($query['number']);
343
+ }
344
+ $wp_user_search = new WP_User_Query( $query );
345
+
346
+ if ($count === true) {
347
+ $statuses[$status] = $wp_user_search->get_total();
348
+ } else {
349
+ $statuses[$status] = $wp_user_search->get_results();
350
+ }
351
  }
352
 
353
  return $statuses;
354
  }
355
+
356
+ /**
357
+ * Get a list of statuses with a count of users with that status and save them using a transient
358
+ */
359
+ public function get_count_of_user_statuses() {
360
+ $user_statuses = get_transient( 'new_user_approve_user_statuses_count' );
361
+
362
+ if ( false === $user_statuses ) {
363
+ $user_statuses = $this->_get_user_statuses();
364
+ set_transient( 'new_user_approve_user_statuses_count', $user_statuses );
365
+ }
366
+
367
+ return $user_statuses;
368
+ }
369
+
370
  public function get_user_statuses() {
371
  $user_statuses = get_transient( 'new_user_approve_user_statuses' );
372
 
373
  if ( false === $user_statuses ) {
374
+ $user_statuses = $this->_get_user_statuses(false);
375
  set_transient( 'new_user_approve_user_statuses', $user_statuses );
376
  }
377
 
401
  * @uses rightnow_end
402
  */
403
  public function dashboard_stats() {
404
+ $user_status = $this->get_count_of_user_statuses();
405
  ?>
406
  <div>
407
+ <p>
408
+ <span style="font-weight:bold;">
409
+ <a href="<?php echo apply_filters( 'new_user_approve_dashboard_link', 'users.php' ); ?>"><?php _e( 'Users', 'new-user-approve' ); ?></a>
410
+ </span>:
411
+ <?php foreach ( $user_status as $status => $count ) :
412
+ print __( ucwords($status), 'new-user-approve' ) . "(" .$count . ")&nbsp;&nbsp;&nbsp;";
413
  endforeach; ?>
414
  </p>
415
  </div>
626
 
627
  $headers = array(
628
  "From: \"{$from_name}\" <{$admin_email}>\n",
 
629
  );
630
 
631
  $headers = apply_filters( 'new_user_approve_email_header', $headers );
737
  if ( isset( $_REQUEST['action'] ) && 'createuser' == $_REQUEST['action'] ) {
738
  $status = 'approved';
739
  }
740
+
741
+ $status = apply_filters( 'new_user_approve_default_status', $status, $user_id );
742
+
743
  update_user_meta( $user_id, 'pw_user_status', $status );
744
  }
745
 
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: picklewagon
3
  Donate link: http://picklewagon.com/wordpress/new-user-approve/donate
4
  Tags: users, registration, sign up, user management, login
5
  Requires at least: 3.5.1
6
- Tested up to: 4.6.1
7
- Stable tag: 1.7.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -102,6 +102,20 @@ as they have their username and passwords.
102
 
103
  == Changelog ==
104
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
  = 1.7.4 =
106
  * Fixed: Corrected erroneous SQL query when filtering users
107
  * Fixed: User filters
@@ -328,6 +342,7 @@ When sending me your translation files, please send me your wordpress.org userna
328
 
329
  * Belarussian translation by [Fat Cow](http://www.fatcow.com/)
330
  * Brazilian Portuguese translation by [leogermani](http://profiles.wordpress.org/leogermani/)
 
331
  * Catalan translation by [xoanet](http://profiles.wordpress.org/xoanet/)
332
  * Croatian translation by Nik
333
  * Czech translation by [GazikT](http://profiles.wordpress.org/gazikt/)
3
  Donate link: http://picklewagon.com/wordpress/new-user-approve/donate
4
  Tags: users, registration, sign up, user management, login
5
  Requires at least: 3.5.1
6
+ Tested up to: 4.8.1
7
+ Stable tag: 1.7.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
102
 
103
  == Changelog ==
104
 
105
+ = 1.7.5 =
106
+ * Fixed: User status filter in admin was not using database prefix
107
+ * Courtesy of [Oizopower](https://github.com/Oizopower)
108
+ * https://github.com/picklewagon/new-user-approve/pull/50
109
+ * Fixed: Optimize user status list so it can be used with many users
110
+ * Fixed: Updated transient to populate with user counts instead of user list
111
+ * Updated: Modify output of user counts on dashboard
112
+ * Updated: Polish translations
113
+ * Courtesy of [pik256](http://wordpress.org/support/profile/1271256)
114
+ * Added: Missing string to translation file
115
+ * Courtesy of [spaszs](https://profiles.wordpress.org/spaszs/)
116
+ * Added: Bulgarian translation
117
+ * Courtesy of [spaszs](https://profiles.wordpress.org/spaszs/)
118
+
119
  = 1.7.4 =
120
  * Fixed: Corrected erroneous SQL query when filtering users
121
  * Fixed: User filters
342
 
343
  * Belarussian translation by [Fat Cow](http://www.fatcow.com/)
344
  * Brazilian Portuguese translation by [leogermani](http://profiles.wordpress.org/leogermani/)
345
+ * Bulgarian translation by [spaszs](https://profiles.wordpress.org/spaszs/)
346
  * Catalan translation by [xoanet](http://profiles.wordpress.org/xoanet/)
347
  * Croatian translation by Nik
348
  * Czech translation by [GazikT](http://profiles.wordpress.org/gazikt/)
tests/test-users.php CHANGED
@@ -66,7 +66,7 @@ class NewUserApproveUserTest extends WP_UnitTestCase {
66
  $statuses = pw_new_user_approve()->_get_user_statuses();
67
 
68
  $this->assertTrue( is_array( $statuses ) );
69
- $this->assertEquals( count($statuses), count( $valids ) );
70
  }
71
  }
72
 
66
  $statuses = pw_new_user_approve()->_get_user_statuses();
67
 
68
  $this->assertTrue( is_array( $statuses ) );
69
+ $this->assertEquals( $statuses, count( $valids ) );
70
  }
71
  }
72