WP-Members Membership Plugin - Version 3.0.3

Version Description

  • Bug fix recaptcha v2 decode json response on validation.
  • Bug fix typo in $wpmem object name in admin/user-profile.php.
  • Bug fix message string variable in wpmem_msg_dialog_arr filter.
  • Fix register form shortcode redirect_to parameter.
  • Admin forms now use submit_button() function to generate submit button.
  • Changed localization to load on init action which will allow for more flexibility with filtering custom language files.
  • Added wpmem_localization_file and wpmem_localization_dir filters.
  • Localization checks for file in /wp-content/ language directory first, then loads plugin default.
Download this release

Release Info

Developer cbutlerjr
Plugin Icon 128x128 WP-Members Membership Plugin
Version 3.0.3
Comparing to
See all releases

Code changes from version 3.0.2 to 3.0.3

README.md DELETED
@@ -1,14 +0,0 @@
1
- # WP-Members #
2
-
3
- WP-Members™ is a free membership management framework for WordPress® that restricts content to registered users.
4
-
5
- ## Description ##
6
-
7
- This is the development repository for the WP-Members plugin for WordPress.
8
-
9
- ## Usage Information ##
10
-
11
- Keep in mind that the branch here is a development branch, so it should be tested prior to loading to a production site.
12
-
13
- If you are looking for a production ready version of the plugin, use the version hosted here:
14
- http://wordpress.org/extend/plugins/wp-members/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/tab-captcha.php CHANGED
@@ -95,19 +95,12 @@ function wpmem_a_build_captcha_options() {
95
  $private_key = ( isset( $wpmem_captcha['recaptcha'] ) ) ? $wpmem_captcha['recaptcha']['private'] : '';
96
  $public_key = ( isset( $wpmem_captcha['recaptcha'] ) ) ? $wpmem_captcha['recaptcha']['public'] : '';
97
  ?>
98
- <tr>
99
- <td colspan="2">
100
- <p><?php _e( 'reCAPTCHA is a free, accessible CAPTCHA service that helps to digitize books while blocking spam on your blog.', 'wp-members' ); ?></p>
101
- <p><?php printf( __( 'reCAPTCHA asks commenters to retype two words scanned from a book to prove that they are a human. This verifies that they are not a spambot while also correcting the automatic scans of old books. So you get less spam, and the world gets accurately digitized books. Everybody wins! For details, visit the %s reCAPTCHA website%s', 'wp-members' ), '<a href="http://www.google.com/recaptcha/intro/index.html" target="_blank">', '</a>' ); ?>.</p>
102
- <p>
103
- </td>
104
- </tr>
105
  <tr valign="top">
106
  <th scope="row"><?php _e( 'reCAPTCHA Keys', 'wp-members' ); ?></th>
107
  <td>
108
- <?php printf( __( 'reCAPTCHA requires an API key, consisting of a "public" and a "private" key. You can sign up for a %s free reCAPTCHA key%s', 'wp-members' ), "<a href=\"https://www.google.com/recaptcha/admin#whyrecaptcha\" target=\"_blank\">", '</a>' ); ?>.<br />
109
- <?php _e( 'Public Key', 'wp-members' ); ?>:&nbsp;&nbsp;<input type="text" name="wpmem_captcha_publickey" size="50" value="<?php echo $public_key; ?>" /><br />
110
- <?php _e( 'Private Key', 'wp-members' ); ?>:&nbsp;<input type="text" name="wpmem_captcha_privatekey" size="50" value="<?php echo $private_key; ?>" />
111
  </td>
112
  </tr>
113
  <?php
@@ -204,7 +197,7 @@ function wpmem_a_build_captcha_options() {
204
  <td>
205
  <input type="hidden" name="wpmem_recaptcha_type" value="<?php echo $captcha_type ?>" />
206
  <input type="hidden" name="wpmem_admin_a" value="update_captcha" />
207
- <input type="submit" name="save" class="button-primary" value="<?php _e( 'Update CAPTCHA Settings', 'wp-members' ); ?> &raquo;" />
208
  </td>
209
  </tr>
210
  <?php } ?>
95
  $private_key = ( isset( $wpmem_captcha['recaptcha'] ) ) ? $wpmem_captcha['recaptcha']['private'] : '';
96
  $public_key = ( isset( $wpmem_captcha['recaptcha'] ) ) ? $wpmem_captcha['recaptcha']['public'] : '';
97
  ?>
 
 
 
 
 
 
 
98
  <tr valign="top">
99
  <th scope="row"><?php _e( 'reCAPTCHA Keys', 'wp-members' ); ?></th>
100
  <td>
101
+ <?php printf( __( 'reCAPTCHA requires an API key, consisting of a "site" and a "secret" key. You can sign up for a %s free reCAPTCHA key%s', 'wp-members' ), "<a href=\"https://www.google.com/recaptcha/admin#whyrecaptcha\" target=\"_blank\">", '</a>' ); ?>.<br />
102
+ <?php _e( 'Site Key', 'wp-members' ); ?>:&nbsp;&nbsp;<input type="text" name="wpmem_captcha_publickey" size="50" value="<?php echo $public_key; ?>" /><br />
103
+ <?php _e( 'Secret Key', 'wp-members' ); ?>:&nbsp;<input type="text" name="wpmem_captcha_privatekey" size="50" value="<?php echo $private_key; ?>" />
104
  </td>
105
  </tr>
106
  <?php
197
  <td>
198
  <input type="hidden" name="wpmem_recaptcha_type" value="<?php echo $captcha_type ?>" />
199
  <input type="hidden" name="wpmem_admin_a" value="update_captcha" />
200
+ <?php submit_button( __( 'Update CAPTCHA Settings', 'wp-members' ) ); ?>
201
  </td>
202
  </tr>
203
  <?php } ?>
admin/tab-dialogs.php CHANGED
@@ -77,7 +77,7 @@ function wpmem_a_build_dialogs() {
77
  <th scope="row">&nbsp;</th>
78
  <td>
79
  <input type="hidden" name="wpmem_admin_a" value="update_dialogs" />
80
- <input type="submit" name="save" class="button-primary" value="<?php _e( 'Update Dialogs', 'wp-members' ); ?> &raquo;" />
81
  </td>
82
  </tr>
83
  </table>
77
  <th scope="row">&nbsp;</th>
78
  <td>
79
  <input type="hidden" name="wpmem_admin_a" value="update_dialogs" />
80
+ <?php submit_button( __( 'Update Dialogs', 'wp-members' ) ); ?>
81
  </td>
82
  </tr>
83
  </table>
admin/tab-emails.php CHANGED
@@ -106,7 +106,7 @@ function wpmem_a_build_emails() {
106
  <th scope="row">&nbsp;</th>
107
  <td>
108
  <input type="hidden" name="wpmem_admin_a" value="update_emails" />
109
- <input type="submit" name="save" class="button-primary" value="<?php _e( 'Update Emails', 'wp-members' ); ?> &raquo;" />
110
  </td>
111
  </tr>
112
  </table>
106
  <th scope="row">&nbsp;</th>
107
  <td>
108
  <input type="hidden" name="wpmem_admin_a" value="update_emails" />
109
+ <?php submit_button( __( 'Update Emails', 'wp-members' ) ); ?>
110
  </td>
111
  </tr>
112
  </table>
admin/tab-fields.php CHANGED
@@ -420,7 +420,8 @@ Last Row|last_row<?php } } ?></textarea>
420
  </ul><br />
421
  <?php if ( $mode == 'edit' ) { ?><input type="hidden" name="field_arr" value="<?php echo $field_arr[2]; ?>" /><?php } ?>
422
  <input type="hidden" name="wpmem_admin_a" value="<?php echo ( $mode == 'edit' ) ? 'edit_field' : 'add_field'; ?>" />
423
- <input type="submit" name="save" class="button-primary" value="<?php echo ( $mode == 'edit' ) ? __( 'Edit Field', 'wp-members' ) : __( 'Add Field', 'wp-members' ); ?> &raquo;" />
 
424
  </form>
425
  </div>
426
  </div>
@@ -560,7 +561,7 @@ function wpmem_a_field_table( $wpmem_fields ) {
560
  <?php } ?>
561
  </table><br />
562
  <input type="hidden" name="wpmem_admin_a" value="update_fields" />
563
- <input type="submit" name="save" class="button-primary" value="<?php _e( 'Update Fields', 'wp-members' ); ?> &raquo;" />
564
  </form>
565
  </div><!-- .inside -->
566
  </div>
420
  </ul><br />
421
  <?php if ( $mode == 'edit' ) { ?><input type="hidden" name="field_arr" value="<?php echo $field_arr[2]; ?>" /><?php } ?>
422
  <input type="hidden" name="wpmem_admin_a" value="<?php echo ( $mode == 'edit' ) ? 'edit_field' : 'add_field'; ?>" />
423
+ <?php $text = ( $mode == 'edit' ) ? __( 'Edit Field', 'wp-members' ) : __( 'Add Field', 'wp-members' ); ?>
424
+ <?php submit_button( $text ); ?>
425
  </form>
426
  </div>
427
  </div>
561
  <?php } ?>
562
  </table><br />
563
  <input type="hidden" name="wpmem_admin_a" value="update_fields" />
564
+ <?php submit_button( __( 'Update Fields', 'wp-members' ) ); ?>
565
  </form>
566
  </div><!-- .inside -->
567
  </div>
admin/tab-options.php CHANGED
@@ -220,7 +220,7 @@ function wpmem_a_build_options() {
220
  </div>
221
  <br /></br />
222
  <input type="hidden" name="wpmem_admin_a" value="update_settings">
223
- <input type="submit" name="UpdateSettings" class="button-primary" value="<?php _e( 'Update Settings', 'wp-members' ); ?> &raquo;" />
224
  </ul>
225
  </form>
226
  </div><!-- .inside -->
220
  </div>
221
  <br /></br />
222
  <input type="hidden" name="wpmem_admin_a" value="update_settings">
223
+ <?php submit_button( __( 'Update Settings', 'wp-members' ) ); ?>
224
  </ul>
225
  </form>
226
  </div><!-- .inside -->
admin/user-profile.php CHANGED
@@ -136,7 +136,7 @@ function wpmem_admin_fields() {
136
  * if user is not active yet.
137
  */
138
  if ( $wpmem->use_exp == 1 ) {
139
- if ( ( $wpmem->mod_reg == 1 && get_user_meta( $user_id, 'active', true ) == 1 ) || ( $wpmwm->mod_reg != 1 ) ) {
140
  wpmem_a_extenduser( $user_id );
141
  }
142
  } ?>
136
  * if user is not active yet.
137
  */
138
  if ( $wpmem->use_exp == 1 ) {
139
+ if ( ( $wpmem->mod_reg == 1 && get_user_meta( $user_id, 'active', true ) == 1 ) || ( $wpmem->mod_reg != 1 ) ) {
140
  wpmem_a_extenduser( $user_id );
141
  }
142
  } ?>
inc/dialogs.php CHANGED
@@ -13,6 +13,13 @@
13
  * @subpackage WP-Members
14
  * @author Chad Butler
15
  * @copyright 2006-2015
 
 
 
 
 
 
 
16
  */
17
 
18
 
@@ -142,7 +149,7 @@ function wpmem_inc_regmessage( $toggle, $msg = '' ) {
142
  // Merge $args with defaults.
143
  $args = wp_parse_args( $args, $defaults );
144
 
145
- $str = $args['div_before'] . $args['p_before'] . stripslashes( $msg ) . $args['p_after'] . $args['div_after'];
146
 
147
  /**
148
  * Filter the message.
@@ -383,4 +390,4 @@ function wpmem_page_user_edit( $wpmem_regchk, $content ) {
383
  }
384
  endif;
385
 
386
- /** End of File **/
13
  * @subpackage WP-Members
14
  * @author Chad Butler
15
  * @copyright 2006-2015
16
+ *
17
+ * Functions Included:
18
+ * - wpmem_inc_loginfailed
19
+ * - wpmem_inc_regmessage
20
+ * - wpmem_inc_memberlinks
21
+ * - wpmem_page_pwd_reset
22
+ * - wpmem_page_user_edit
23
  */
24
 
25
 
149
  // Merge $args with defaults.
150
  $args = wp_parse_args( $args, $defaults );
151
 
152
+ $str = $args['div_before'] . $args['p_before'] . stripslashes( $args['msg'] ) . $args['p_after'] . $args['div_after'];
153
 
154
  /**
155
  * Filter the message.
390
  }
391
  endif;
392
 
393
+ // End of file.
inc/forms.php CHANGED
@@ -487,7 +487,7 @@ if ( ! function_exists( 'wpmem_inc_registration' ) ):
487
  * @global array $userdata Used to get the user's registration data if they are logged in (user profile edit).
488
  * @return string $form The HTML for the entire form as a string.
489
  */
490
- function wpmem_inc_registration( $toggle = 'new', $heading = '' ) {
491
 
492
  global $wpmem, $wpmem_regchk, $userdata;
493
 
@@ -801,9 +801,12 @@ function wpmem_inc_registration( $toggle = 'new', $heading = '' ) {
801
 
802
  // create hidden fields
803
  $var = ( $toggle == 'edit' ) ? 'update' : 'register';
804
- $redirect_to = ( isset( $_REQUEST['redirect_to'] ) ) ? esc_url( $_REQUEST['redirect_to'] ) : get_permalink();
805
  $hidden = '<input name="a" type="hidden" value="' . $var . '" />' . $n;
806
  $hidden .= '<input name="redirect_to" type="hidden" value="' . $redirect_to . '" />' . $n;
 
 
 
807
  $hidden = ( isset( $hidden_tos ) ) ? $hidden . $hidden_tos . $n : $hidden;
808
 
809
  /**
@@ -865,7 +868,8 @@ function wpmem_inc_registration( $toggle = 'new', $heading = '' ) {
865
 
866
  // apply form wrapper
867
  $enctype = ( $enctype == 'multipart/form-data' ) ? ' enctype="multipart/form-data"' : '';
868
- $form = '<form name="form" method="post"' . $enctype . ' action="' . get_permalink() . '" id="' . $form_id . '" class="' . $form_class . '">' . $n . $form. $n . '</form>';
 
869
 
870
  // apply anchor
871
  $form = '<a name="register"></a>' . $n . $form;
487
  * @global array $userdata Used to get the user's registration data if they are logged in (user profile edit).
488
  * @return string $form The HTML for the entire form as a string.
489
  */
490
+ function wpmem_inc_registration( $toggle = 'new', $heading = '', $redirect_to = null ) {
491
 
492
  global $wpmem, $wpmem_regchk, $userdata;
493
 
801
 
802
  // create hidden fields
803
  $var = ( $toggle == 'edit' ) ? 'update' : 'register';
804
+ $redirect_to = ( isset( $_REQUEST['redirect_to'] ) ) ? esc_url( $_REQUEST['redirect_to'] ) : ( ( $redirect_to ) ? $redirect_to : get_permalink() );
805
  $hidden = '<input name="a" type="hidden" value="' . $var . '" />' . $n;
806
  $hidden .= '<input name="redirect_to" type="hidden" value="' . $redirect_to . '" />' . $n;
807
+ if ( $redirect_to != get_permalink() ) {
808
+ $hidden.= '<input name="wpmem_reg_page" type="hidden" value="' . get_permalink() . '" />' . $n;
809
+ }
810
  $hidden = ( isset( $hidden_tos ) ) ? $hidden . $hidden_tos . $n : $hidden;
811
 
812
  /**
868
 
869
  // apply form wrapper
870
  $enctype = ( $enctype == 'multipart/form-data' ) ? ' enctype="multipart/form-data"' : '';
871
+ $post_to = ( $redirect_to ) ? $redirect_to : get_permalink();
872
+ $form = '<form name="form" method="post"' . $enctype . ' action="' . $post_to . '" id="' . $form_id . '" class="' . $form_class . '">' . $n . $form. $n . '</form>';
873
 
874
  // apply anchor
875
  $form = '<a name="register"></a>' . $n . $form;
inc/register.php CHANGED
@@ -210,6 +210,9 @@ function wpmem_registration( $toggle ) {
210
  // Validate the captcha.
211
  $response = file_get_contents( "https://www.google.com/recaptcha/api/siteverify?secret=" . $privatekey . "&response=" . $captcha . "&remoteip=" . $_SERVER['REMOTE_ADDR'] );
212
 
 
 
 
213
  // If captcha validation was unsuccessful.
214
  if ( $response['success'] == false ) {
215
  $wpmem_themsg = __( 'CAPTCHA was not valid.', 'wp-members' );
@@ -224,7 +227,7 @@ function wpmem_registration( $toggle ) {
224
  $fields['user_registered'] = gmdate( 'Y-m-d H:i:s' );
225
  $fields['user_role'] = get_option( 'default_role' );
226
  $fields['wpmem_reg_ip'] = $_SERVER['REMOTE_ADDR'];
227
- $fields['wpmem_reg_url'] = $_REQUEST['redirect_to'];
228
 
229
  /*
230
  * These native fields are not installed by default, but if they
210
  // Validate the captcha.
211
  $response = file_get_contents( "https://www.google.com/recaptcha/api/siteverify?secret=" . $privatekey . "&response=" . $captcha . "&remoteip=" . $_SERVER['REMOTE_ADDR'] );
212
 
213
+ // Decode the json response.
214
+ $response = json_decode( $response, true );
215
+
216
  // If captcha validation was unsuccessful.
217
  if ( $response['success'] == false ) {
218
  $wpmem_themsg = __( 'CAPTCHA was not valid.', 'wp-members' );
227
  $fields['user_registered'] = gmdate( 'Y-m-d H:i:s' );
228
  $fields['user_role'] = get_option( 'default_role' );
229
  $fields['wpmem_reg_ip'] = $_SERVER['REMOTE_ADDR'];
230
+ $fields['wpmem_reg_url'] = ( isset( $_REQUEST['wpmem_reg_page'] ) ) ? $_REQUEST['wpmem_reg_page'] : $_REQUEST['redirect_to'];
231
 
232
  /*
233
  * These native fields are not installed by default, but if they
inc/shortcodes.php CHANGED
@@ -13,6 +13,15 @@
13
  * @subpackage WP-Members
14
  * @author Chad Butler
15
  * @copyright 2006-2015
 
 
 
 
 
 
 
 
 
16
  */
17
 
18
 
@@ -86,7 +95,7 @@ function wpmem_sc_forms( $atts, $content = null, $tag = 'wpmem_form' ) {
86
  $wpmem_themsg = __( 'There was an error with the CAPTCHA form.' ) . '<br /><br />' . $wpmem_captcha_err;
87
  }
88
  $content = ( $wpmem_themsg || $wpmem->regchk == 'success' ) ? wpmem_inc_regmessage( $wpmem->regchk, $wpmem_themsg ) : '';
89
- $content .= ( $wpmem->regchk == 'success' ) ? wpmem_inc_login() : wpmem_inc_registration();
90
  }
91
  break;
92
 
@@ -512,4 +521,4 @@ function wpmem_sc_user_count( $atts, $content = null ) {
512
  return ( $do_query ) ? $atts['label'] . $user_meta_query : '';
513
  }
514
 
515
- /** End of File **/
13
  * @subpackage WP-Members
14
  * @author Chad Butler
15
  * @copyright 2006-2015
16
+ *
17
+ * Functions Included:
18
+ * - wpmem_sc_forms
19
+ * - wpmem_sc_logged_in
20
+ * - wpmem_sc_logged_out
21
+ * - wpmem_shortcode
22
+ * - wpmem_do_sc_pages
23
+ * - wpmem_do_sc_pages
24
+ * - wpmem_sc_user_count
25
  */
26
 
27
 
95
  $wpmem_themsg = __( 'There was an error with the CAPTCHA form.' ) . '<br /><br />' . $wpmem_captcha_err;
96
  }
97
  $content = ( $wpmem_themsg || $wpmem->regchk == 'success' ) ? wpmem_inc_regmessage( $wpmem->regchk, $wpmem_themsg ) : '';
98
+ $content .= ( $wpmem->regchk == 'success' ) ? wpmem_inc_login() : wpmem_inc_registration( 'new', '', $redirect_to );
99
  }
100
  break;
101
 
521
  return ( $do_query ) ? $atts['label'] . $user_meta_query : '';
522
  }
523
 
524
+ // End of file.
lang/wp-members.pot CHANGED
@@ -200,22 +200,6 @@ msgstr ""
200
  msgid "Manage reCAPTCHA Options"
201
  msgstr ""
202
 
203
- #: admin/tab-captcha.php:63
204
- msgid ""
205
- "reCAPTCHA is a free, accessible CAPTCHA service that helps to digitize books "
206
- "while blocking spam on your blog."
207
- msgstr ""
208
-
209
- #: admin/tab-captcha.php:64
210
- #, php-format
211
- msgid ""
212
- "reCAPTCHA asks commenters to retype two words scanned from a book to prove "
213
- "that they are a human. This verifies that they are not a spambot while also "
214
- "correcting the automatic scans of old books. So you get less spam, and the "
215
- "world gets accurately digitized books. Everybody wins! For details, visit "
216
- "the %s reCAPTCHA website%s"
217
- msgstr ""
218
-
219
  #: admin/tab-captcha.php:69
220
  msgid "reCAPTCHA Keys"
221
  msgstr ""
@@ -223,16 +207,16 @@ msgstr ""
223
  #: admin/tab-captcha.php:71
224
  #, php-format
225
  msgid ""
226
- "reCAPTCHA requires an API key, consisting of a \"public\" and a \"private\" "
227
  "key. You can sign up for a %s free reCAPTCHA key%s"
228
  msgstr ""
229
 
230
  #: admin/tab-captcha.php:72
231
- msgid "Public Key"
232
  msgstr ""
233
 
234
  #: admin/tab-captcha.php:73
235
- msgid "Private Key"
236
  msgstr ""
237
 
238
  #: admin/tab-captcha.php:77
200
  msgid "Manage reCAPTCHA Options"
201
  msgstr ""
202
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
203
  #: admin/tab-captcha.php:69
204
  msgid "reCAPTCHA Keys"
205
  msgstr ""
207
  #: admin/tab-captcha.php:71
208
  #, php-format
209
  msgid ""
210
+ "reCAPTCHA requires an API key, consisting of a \"site\" and a \"secret\" "
211
  "key. You can sign up for a %s free reCAPTCHA key%s"
212
  msgstr ""
213
 
214
  #: admin/tab-captcha.php:72
215
+ msgid "Site Key"
216
  msgstr ""
217
 
218
  #: admin/tab-captcha.php:73
219
+ msgid "Secret Key"
220
  msgstr ""
221
 
222
  #: admin/tab-captcha.php:77
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
- === WP-Members: WordPress Membership Framework ===
2
  Contributors: cbutlerjr
3
  Tags: access, authentication, content, login, member, membership, password, protect, register, registration, restriction, subscriber
4
  Requires at least: 3.1
5
  Tested up to: 4.3
6
- Stable tag: 3.0.2
7
  License: GPLv2
8
 
9
  WP-Members&trade; is a free membership management framework for WordPress&reg; that restricts content to registered users.
@@ -111,7 +111,7 @@ Premium priority support is available at the plugin's site [RocketGeek.com](http
111
 
112
  == Upgrade Notice ==
113
 
114
- WP-Members 3.0.2 is feature and fix release. See the change log for detail.
115
  WP-Members 3.0.0 is a major version release. Please be sure you have reviewed the changelog before upgrading. http://rkt.bz/v30
116
 
117
  == Screenshots ==
@@ -135,6 +135,17 @@ WP-Members 3.0.0 is a major version release. Please be sure you have reviewed th
135
 
136
  == Changelog ==
137
 
 
 
 
 
 
 
 
 
 
 
 
138
  = 3.0.2 =
139
 
140
  * Added reCAPTCHA version 2 as an option. v1 will remain available for now, to be fully deprecated later.
1
+ === WP-Members: Membership Framework ===
2
  Contributors: cbutlerjr
3
  Tags: access, authentication, content, login, member, membership, password, protect, register, registration, restriction, subscriber
4
  Requires at least: 3.1
5
  Tested up to: 4.3
6
+ Stable tag: 3.0.3
7
  License: GPLv2
8
 
9
  WP-Members&trade; is a free membership management framework for WordPress&reg; that restricts content to registered users.
111
 
112
  == Upgrade Notice ==
113
 
114
+ WP-Members 3.0.3 is feature and fix release. See the change log for detail.
115
  WP-Members 3.0.0 is a major version release. Please be sure you have reviewed the changelog before upgrading. http://rkt.bz/v30
116
 
117
  == Screenshots ==
135
 
136
  == Changelog ==
137
 
138
+ = 3.0.3 =
139
+
140
+ * Bug fix recaptcha v2 decode json response on validation.
141
+ * Bug fix typo in $wpmem object name in admin/user-profile.php.
142
+ * Bug fix message string variable in wpmem_msg_dialog_arr filter.
143
+ * Fix register form shortcode redirect_to parameter.
144
+ * Admin forms now use submit_button() function to generate submit button.
145
+ * Changed localization to load on init action which will allow for more flexibility with filtering custom language files.
146
+ * Added wpmem_localization_file and wpmem_localization_dir filters.
147
+ * Localization checks for file in /wp-content/ language directory first, then loads plugin default.
148
+
149
  = 3.0.2 =
150
 
151
  * Added reCAPTCHA version 2 as an option. v1 will remain available for now, to be fully deprecated later.
wp-members.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP-Members
4
  Plugin URI: http://rocketgeek.com
5
  Description: WP access restriction and user registration. For more information on plugin features, refer to <a href="http://rocketgeek.com/plugins/wp-members/users-guide/">the online Users Guide</a>. A <a href="http://rocketgeek.com/plugins/wp-members/quick-start-guide/">Quick Start Guide</a> is also available. WP-Members(tm) is a trademark of butlerblog.com.
6
- Version: 3.0.2
7
  Author: Chad Butler
8
  Author URI: http://butlerblog.com/
9
  License: GPLv2
@@ -60,13 +60,13 @@ License: GPLv2
60
 
61
 
62
  // Initialize constants.
63
- define( 'WPMEM_VERSION', '3.0.2' );
64
  define( 'WPMEM_DEBUG', false );
65
  define( 'WPMEM_DIR', plugin_dir_url ( __FILE__ ) );
66
  define( 'WPMEM_PATH', plugin_dir_path( __FILE__ ) );
67
 
68
  // Localization.
69
- add_action( 'plugins_loaded', 'wpmem_load_textdomain' );
70
 
71
  // Initialize the plugin.
72
  add_action( 'after_setup_theme', 'wpmem_init', 10 );
@@ -281,6 +281,11 @@ function wpmem_mu_new_site( $blog_id, $user_id, $domain, $path, $site_id, $meta
281
  */
282
  function wpmem_load_textdomain() {
283
 
 
 
 
 
 
284
  /**
285
  * Filter translation file.
286
  *
@@ -288,11 +293,22 @@ function wpmem_load_textdomain() {
288
  *
289
  * @param string $file The translation file to load.
290
  */
291
- $file = apply_filters( 'wpmem_localization_file', dirname( plugin_basename( __FILE__ ) ) . '/lang/' );
292
-
293
- // Load the localization file.
294
- load_plugin_textdomain( 'wp-members', false, $file );
295
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
296
  return;
297
  }
298
 
3
  Plugin Name: WP-Members
4
  Plugin URI: http://rocketgeek.com
5
  Description: WP access restriction and user registration. For more information on plugin features, refer to <a href="http://rocketgeek.com/plugins/wp-members/users-guide/">the online Users Guide</a>. A <a href="http://rocketgeek.com/plugins/wp-members/quick-start-guide/">Quick Start Guide</a> is also available. WP-Members(tm) is a trademark of butlerblog.com.
6
+ Version: 3.0.3
7
  Author: Chad Butler
8
  Author URI: http://butlerblog.com/
9
  License: GPLv2
60
 
61
 
62
  // Initialize constants.
63
+ define( 'WPMEM_VERSION', '3.0.3' );
64
  define( 'WPMEM_DEBUG', false );
65
  define( 'WPMEM_DIR', plugin_dir_url ( __FILE__ ) );
66
  define( 'WPMEM_PATH', plugin_dir_path( __FILE__ ) );
67
 
68
  // Localization.
69
+ add_action( 'init', 'wpmem_load_textdomain' ); //add_action( 'plugins_loaded', 'wpmem_load_textdomain' );
70
 
71
  // Initialize the plugin.
72
  add_action( 'after_setup_theme', 'wpmem_init', 10 );
281
  */
282
  function wpmem_load_textdomain() {
283
 
284
+ // @todo See: https://ulrich.pogson.ch/load-theme-plugin-translations for notes on changes.
285
+
286
+ $domain = 'wp-members';
287
+ $locale = apply_filters( 'plugin_locale', get_locale(), $domain );
288
+
289
  /**
290
  * Filter translation file.
291
  *
293
  *
294
  * @param string $file The translation file to load.
295
  */
296
+ $file = apply_filters( 'wpmem_localization_file', trailingslashit( WP_LANG_DIR ) . $domain . '/' . $domain . '-' . $locale . '.mo' );
 
 
 
297
 
298
+ if ( $loaded = load_textdomain( $domain, $file ) ) {
299
+ return $loaded;
300
+ } else {
301
+
302
+ /**
303
+ * Filter translation directory.
304
+ *
305
+ * @since 3.0.3
306
+ *
307
+ * @param string $dir The translation directory.
308
+ */
309
+ $dir = apply_filters( 'wpmem_localization_dir', dirname( plugin_basename( __FILE__ ) ) . '/lang/' );
310
+ load_plugin_textdomain( $domain, FALSE, $dir );
311
+ }
312
  return;
313
  }
314