WP-Members Membership Plugin - Version 3.1.2

Version Description

  • Minimum WordPress version increased to 3.6.
  • Added user counts to user screen links (set as transient).
  • Added redirect_to parameter to wpmem_login_url().
  • Added action parameter to wpmem_profile_url().
  • Added echo argument to wpmem_gettext().
  • Added api function wpmem_user_pages() to return an array of the login, register, and profile page urls.
  • Added shortcode [wpmem_tos] for Terms of Service page url (replaces [wp-members page=tos url=http://mysite.com/path/to/tos/]).
  • Added wpmem_write_log() function for writing notices to the WP error log.
  • Added hide registration form parameter to wpmem_profile shortcode: [wpmem_profile register=hide].
  • Added $defaults to wpmem_sidebar_status_args. Now can pass $user_login to be used in filters.
  • Moved wpmem_login_status() to api.php.
  • Deprecated [wp-members] shortcode, all other shortcodes no longer rely on wpmem_shortcode().
  • Fixed issue with pre-selected dropdown values to not select empty (separator) rows.
  • Fixed field and custom shortcodes in email not being parsed.
Download this release

Release Info

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

Code changes from version 3.1.1 to 3.1.2

admin/admin.php CHANGED
@@ -80,9 +80,10 @@ function wpmem_admin_plugin_links( $links, $file ) {
80
  * Loads the admin javascript and css files.
81
  *
82
  * @since 2.5.1
83
- * @deprecated 3.0.6
84
  */
85
  function wpmem_load_admin_js() {
 
86
  // Queue up admin ajax and styles.
87
  wp_enqueue_script( 'wpmem-admin-js', WPMEM_DIR . 'admin/js/admin.js', '', WPMEM_VERSION );
88
  wp_enqueue_style ( 'wpmem-admin-css', WPMEM_DIR . 'admin/css/admin.css', '', WPMEM_VERSION );
80
  * Loads the admin javascript and css files.
81
  *
82
  * @since 2.5.1
83
+ * @deprecated 3.0.6 Replaced by wpmem_admin_enqueue_scripts().
84
  */
85
  function wpmem_load_admin_js() {
86
+ wpmem_write_log( "wpmem_load_admin_js() is deprecated as of WP-Members 3.0.6" );
87
  // Queue up admin ajax and styles.
88
  wp_enqueue_script( 'wpmem-admin-js', WPMEM_DIR . 'admin/js/admin.js', '', WPMEM_VERSION );
89
  wp_enqueue_style ( 'wpmem-admin-css', WPMEM_DIR . 'admin/css/admin.css', '', WPMEM_VERSION );
admin/includes/class-wp-members-admin-api.php CHANGED
@@ -63,6 +63,7 @@ class WP_Members_Admin_API {
63
  * Load dependencies.
64
  *
65
  * @since 3.1.0
 
66
  */
67
  function load_dependencies() {
68
  if ( is_multisite() && current_user_can( 'edit_theme_options' ) ) {
63
  * Load dependencies.
64
  *
65
  * @since 3.1.0
66
+ * @since 3.1.1 Added tab-about.php.
67
  */
68
  function load_dependencies() {
69
  if ( is_multisite() && current_user_can( 'edit_theme_options' ) ) {
admin/tab-about.php CHANGED
@@ -49,6 +49,13 @@ function wpmem_a_build_about_tab() { ?>
49
  <div id="post-body">
50
  <div id="post-body-content">
51
  <div class="postbox">
 
 
 
 
 
 
 
52
  <h3><?php _e( 'About WP-Members', 'wp-members' ); ?></h3>
53
  <div class="inside">
54
  <p>WP-Members is a WordPress membership plugin that is simple to use but incorporates a powerful framework for customization.
@@ -62,8 +69,8 @@ function wpmem_a_build_about_tab() { ?>
62
  You make this plugin possible.)</p>
63
  <p>Introduced in 2006, WP-Members was the first WordPress Membership plugin and through support of the WP community it continues to grow
64
  and be developed. Why put your trust in an unknown? WP-Members has a 10 year track record of active development and support.</p>
65
- <p><strong><a href="http://rkt.bz/KB">Free User Guide</a></strong> |
66
- <strong><a href="http://rkt.bz/about">Support Site Membership</a></strong> |
67
  <strong><a href="http://rkt.bz/join">Join Today!</a></strong></p>
68
  </div>
69
  <h3>Premium Extensions</h3>
49
  <div id="post-body">
50
  <div id="post-body-content">
51
  <div class="postbox">
52
+ <div style="width:20%;max-width:300px;min-width:200px;padding:10px;margin:10px;border:#c4c4c4 1px solid;float:right;">
53
+ <h4><a href="https://wordpress.org/plugins/wordpass/">WordPass</a></h4>
54
+ <p>Default random passwords can be difficult to for users to use. WordPass simplifies this process by using words to create passwords. Passwords will be generated in the style of 2*Kayak29, 2Bigcranium2#, or %36POTATOE6.
55
+ </p>
56
+ <p>This plugin works with WordPress as well as with any plugin that uses the WordPress password generation function.</p>
57
+ <p><strong><a href="https://wordpress.org/plugins/wordpass/">Try WordPass Free!</a></strong></p>
58
+ </div>
59
  <h3><?php _e( 'About WP-Members', 'wp-members' ); ?></h3>
60
  <div class="inside">
61
  <p>WP-Members is a WordPress membership plugin that is simple to use but incorporates a powerful framework for customization.
69
  You make this plugin possible.)</p>
70
  <p>Introduced in 2006, WP-Members was the first WordPress Membership plugin and through support of the WP community it continues to grow
71
  and be developed. Why put your trust in an unknown? WP-Members has a 10 year track record of active development and support.</p>
72
+ <p><strong><a href="http://rkt.bz/KB">Plugin Documentation</a></strong> |
73
+ <strong><a href="http://rkt.bz/about">Premium Support</a></strong> |
74
  <strong><a href="http://rkt.bz/join">Join Today!</a></strong></p>
75
  </div>
76
  <h3>Premium Extensions</h3>
admin/tab-fields.php CHANGED
@@ -355,11 +355,11 @@ function wpmem_a_field_edit( $mode, $wpmem_fields = null, $field = null ) {
355
  </li>
356
  <li>
357
  <label><?php _e( 'Display?', 'wp-members' ); ?></label>
358
- <input type="checkbox" name="add_display" value="y" <?php echo ( $mode == 'edit' ) ? wpmem_selected( 'y', $field_arr[4] ) : false; ?> />
359
  </li>
360
  <li>
361
  <label><?php _e( 'Required?', 'wp-members' ); ?></label>
362
- <input type="checkbox" name="add_required" value="y" <?php echo ( $mode == 'edit' ) ? wpmem_selected( 'y', $field_arr[5] ) : false; ?> />
363
  </li>
364
  <?php if ( $mode == 'add' || ( $mode == 'edit' && ( $field_arr[3] == 'file' || $field_arr[3] == 'image' ) ) ) { ?>
365
  <?php echo ( $mode == 'add' ) ? '<div id="wpmem_file_info">' : ''; ?>
@@ -383,7 +383,7 @@ function wpmem_a_field_edit( $mode, $wpmem_fields = null, $field = null ) {
383
  </li>
384
  <li>
385
  <label><?php _e( 'Checked by default?', 'wp-members' ); ?></label>
386
- <input type="checkbox" name="add_checked_default" value="y" <?php echo ( $mode == 'edit' && $field_arr[3] == 'checkbox' ) ? wpmem_selected( 'y', $field_arr[8] ) : false; ?> />
387
  </li>
388
  <li>
389
  <label><?php _e( 'Stored value if checked:', 'wp-members' ); ?></label>
355
  </li>
356
  <li>
357
  <label><?php _e( 'Display?', 'wp-members' ); ?></label>
358
+ <input type="checkbox" name="add_display" value="y" <?php echo ( $mode == 'edit' ) ? checked( 'y', $field_arr[4] ) : false; ?> />
359
  </li>
360
  <li>
361
  <label><?php _e( 'Required?', 'wp-members' ); ?></label>
362
+ <input type="checkbox" name="add_required" value="y" <?php echo ( $mode == 'edit' ) ? checked( 'y', $field_arr[5] ) : false; ?> />
363
  </li>
364
  <?php if ( $mode == 'add' || ( $mode == 'edit' && ( $field_arr[3] == 'file' || $field_arr[3] == 'image' ) ) ) { ?>
365
  <?php echo ( $mode == 'add' ) ? '<div id="wpmem_file_info">' : ''; ?>
383
  </li>
384
  <li>
385
  <label><?php _e( 'Checked by default?', 'wp-members' ); ?></label>
386
+ <input type="checkbox" name="add_checked_default" value="y" <?php echo ( $mode == 'edit' && $field_arr[3] == 'checkbox' ) ? checked( 'y', $field_arr[8] ) : false; ?> />
387
  </li>
388
  <li>
389
  <label><?php _e( 'Stored value if checked:', 'wp-members' ); ?></label>
admin/tab-options.php CHANGED
@@ -550,7 +550,7 @@ function wpmem_admin_page_list( $val, $show_custom_url = true ) {
550
 
551
  foreach ( $pages as $page ) {
552
  $selected = ( get_page_link( $page->ID ) == $val ) ? true : $selected; echo "VAL: " . $val . ' PAGE LINK: ' . get_page_link( $page->ID );
553
- $option = '<option value="' . $page->ID . '"' . wpmem_selected( get_page_link( $page->ID ), $val, 'select' ) . '>';
554
  $option .= $page->post_title;
555
  $option .= '</option>';
556
  echo $option;
550
 
551
  foreach ( $pages as $page ) {
552
  $selected = ( get_page_link( $page->ID ) == $val ) ? true : $selected; echo "VAL: " . $val . ' PAGE LINK: ' . get_page_link( $page->ID );
553
+ $option = '<option value="' . $page->ID . '"' . selected( get_page_link( $page->ID ), $val, 'select' ) . '>';
554
  $option .= $page->post_title;
555
  $option .= '</option>';
556
  echo $option;
admin/user-profile.php CHANGED
@@ -108,7 +108,7 @@ function wpmem_admin_fields() {
108
  $input = wpmem_create_formfield( $meta[2], $meta[3], $values, $valtochk );
109
  } elseif( 'multicheckbox' == $meta[3] || 'multiselect' == $meta[3] ) {
110
  $delimiter = ( isset( $meta[8] ) ) ? $meta[8] : '|';
111
- $input = $wpmem->forms->create_form_field( array( 'name'=>$meta[2], 'type'=>$meta[3], 'value'=>$values, 'valtochk'=>$valtochk, 'delimiter'=>$delimiter ) );
112
  }else {
113
  $input = wpmem_create_formfield( $meta[2], $meta[3], $val, $valtochk );
114
  }
108
  $input = wpmem_create_formfield( $meta[2], $meta[3], $values, $valtochk );
109
  } elseif( 'multicheckbox' == $meta[3] || 'multiselect' == $meta[3] ) {
110
  $delimiter = ( isset( $meta[8] ) ) ? $meta[8] : '|';
111
+ $input = $wpmem->forms->create_form_field( array( 'name'=>$meta[2], 'type'=>$meta[3], 'value'=>$values, 'compare'=>$valtochk, 'delimiter'=>$delimiter ) );
112
  }else {
113
  $input = wpmem_create_formfield( $meta[2], $meta[3], $val, $valtochk );
114
  }
admin/users.php CHANGED
@@ -236,13 +236,70 @@ function wpmem_users_admin_notices() {
236
  * Function to add user views to the top list.
237
  *
238
  * @since 2.8.2
 
239
  *
240
- * @param array $views
241
- * @return array $views
 
 
242
  */
243
  function wpmem_users_views( $views ) {
244
-
245
  global $wpmem;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
246
 
247
  $arr = array();
248
  if ( defined( 'WPMEM_EXP_MODULE' ) && $wpmem->use_exp == 1 ) {
@@ -274,6 +331,7 @@ function wpmem_users_views( $views ) {
274
 
275
  if ( $echolink ) {
276
  $views[$lcas] = "<a href=\"$link\" $curr>$arr[$row] <span class=\"count\"></span></a>";
 
277
  }
278
  }
279
 
236
  * Function to add user views to the top list.
237
  *
238
  * @since 2.8.2
239
+ * @since 3.1.2 Added user view counts as transient.
240
  *
241
+ * @global object $wpdb
242
+ * @global object $wpmem
243
+ * @param array $views
244
+ * @return array $views
245
  */
246
  function wpmem_users_views( $views ) {
247
+
248
  global $wpmem;
249
+
250
+ // Get the cached user counts.
251
+ $user_counts = get_transient( 'wpmem_user_counts' );
252
+
253
+ // check to see if data was successfully retrieved from the cache
254
+ if ( false === $user_counts ) {
255
+
256
+ // @todo For now, 30 seconds. We'll see how things go.
257
+ $transient_expires = 30; // Value in seconds, 1 day: ( 60 * 60 * 24 );
258
+
259
+ global $wpdb;
260
+
261
+ // We need a count of total users.
262
+ // @todo - need a more elegant way of this entire process.
263
+ $sql = "SELECT COUNT(*) FROM " . $wpdb->prefix . "users";
264
+ $users = $wpdb->get_var( $sql );
265
+
266
+ // What needs to be counted?
267
+ $count_metas = array();
268
+ if ( defined( 'WPMEM_EXP_MODULE' ) && $wpmem->use_exp == 1 ) {
269
+ $count_metas['pending'] = 'pending';
270
+ }
271
+ if ( $wpmem->use_trial == 1 ) {
272
+ $count_metas['trial'] = 'trial';
273
+ }
274
+ if ( defined( 'WPMEM_EXP_MODULE' ) && $wpmem->use_exp == 1 ) {
275
+ $count_metas['subscription'] = 'subscription';
276
+ $count_metas['expired'] = 'expired';
277
+ }
278
+ if ( $wpmem->mod_reg == 1 ) {
279
+ $count_metas['notactive'] = 'active';
280
+ }
281
+ $count_metas['notexported'] = 'exported';
282
+
283
+ // Handle various counts.
284
+ $user_counts = array();
285
+ foreach ( $count_metas as $key => $meta_key ) {
286
+ if ( 'notactive' == $key || 'notexported' == $key ) {
287
+ $users_with_meta = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->usermeta WHERE meta_key='$meta_key' AND meta_value=1" );
288
+ $count = $users - $users_with_meta;
289
+ }
290
+ if ( 'trial' == $key || 'subscription' == $key ) {
291
+ $count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->usermeta WHERE meta_key = 'exp_type' AND meta_value = \"$key\"" );
292
+ }
293
+ if ( 'pending' == $key ) {
294
+ $count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->usermeta WHERE meta_key = 'exp_type' AND meta_value = \"$key\"" );
295
+ }
296
+ if ( 'expired' == $key ) {
297
+ $count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->usermeta WHERE meta_key = 'expires' AND STR_TO_DATE( meta_value, '%m/%d/%Y' ) < CURDATE() AND meta_value != '01/01/1970'" );
298
+ }
299
+ $user_counts[ $key ] = $count;
300
+ }
301
+ set_transient( 'wpmem_user_counts', $user_counts, $transient_expires );
302
+ }
303
 
304
  $arr = array();
305
  if ( defined( 'WPMEM_EXP_MODULE' ) && $wpmem->use_exp == 1 ) {
331
 
332
  if ( $echolink ) {
333
  $views[$lcas] = "<a href=\"$link\" $curr>$arr[$row] <span class=\"count\"></span></a>";
334
+ $views[$lcas].= ( isset( $user_counts[ $lcas ] ) ) ? ' (' . $user_counts[ $lcas ] . ')' : '';
335
  }
336
  }
337
 
changelog.txt CHANGED
@@ -1,745 +1,832 @@
1
- = 3.0.8 =
2
-
3
- * Added process for forgotten username retrieval.
4
- * Removed last remaining instances of extract function.
5
- * Updated settings for special pages (login|register|user-profile) to store only the numeric primary key ID. This will eliminate the need to update these settings if the site is moved (from a dev to live site, for example). Legacy full URL settings will still be compatible without needing to be updated, but will be automatically updated when main options are saved.
6
-
7
- = 3.0.7 =
8
-
9
- * Fix for use of display_name on profile update.
10
- * Fix for newer installs (post WP 4.0) where WPLANG is not defined and reCAPTCHA is used.
11
- * Fix in wpmem_form shortcode to skp if no additional tag exists.
12
- * Fix to plugin_basename.
13
- * Changes in core to use fields from WP_Members class (preparing for new form field process).
14
- * Reviews and updates to code standards and inline documentation.
15
- * Fix for password reset (typo in object name checking for moderated registration)
16
- * Fix for PayPal extension (http://rkt.bz/r3); added logic to avoid errors if the PayPal extension is disabled but the main option setting remained turned on.
17
-
18
- = 3.0.6 =
19
-
20
- * Updates to localization function - documented plugin_locale filter, wpmem_localization_file filter, and improved load_textdomain logic.
21
- * Added /lang domain path to plugin header.
22
- * Fixed a bug in the user export function that broke CSV columns when moderated registration was turned on.
23
- * Improved current page retrieval in wpmem_redirect_to_login() function.
24
- * Fixed admin enqueued scripts (post/page screen hook did not load from new location).
25
-
26
- = 3.0.5 =
27
-
28
- * Updated wpmem_pwd_change and wpmem_pwd_reset action hooks to include password as a parameter.
29
- * Stylesheet updates for 2015, 2014, and generic (both float and no float).
30
- * Fix to TinyMCE shortcode button, should now load button on new post/page editor.
31
- * Added [WP-Members] to the TinyMCE shortcode button for clarity as to what it is.
32
- * Moved admin js and css files to /admin/js/ and /admin/css/
33
- * Moved admin class files to /admin/includes/
34
- * Updated and verified all directories contain an index.php file to prevent directory browsing.
35
-
36
- = 3.0.4 =
37
-
38
- * Reintroduced the global action variable $wpmem_a for backward compatibility with certain add-ons, most notably the WP-Members MailChimp extension ( see http://rkt.bz/3b ). Users of this extension should upgrade. This variable had been replaced with the new WP-Members object class introduced in 3.0. However, users of older extensions and those that may have customziations with logic may be using this variable, so rather than force updating and upgrading, it is being added back in.
39
- * Change to the priority of functions hooked to the the_content filter. Lowering the priority should better integrate the plugin with various builder plugins and other processes that currently filter the_content after WP-Members since the content will now be filtered later in the process. This also should improve situations where in the past the on-the-fly texturization shortcode for the WP-Members forms might remain unparsed.
40
-
41
- = 3.0.3 =
42
-
43
- * Bug fix recaptcha v2 decode json response on validation.
44
- * Bug fix typo in $wpmem object name in admin/user-profile.php.
45
- * Bug fix message string variable in wpmem_msg_dialog_arr filter.
46
- * Fix register form shortcode redirect_to parameter.
47
- * Admin forms now use submit_button() function to generate submit button.
48
- * Changed localization to load on init action which will allow for more flexibility with filtering custom language files.
49
- * Added wpmem_localization_file and wpmem_localization_dir filters.
50
- * Localization checks for file in /wp-content/ language directory first, then loads plugin default.
51
-
52
- = 3.0.2 =
53
-
54
- * Added reCAPTCHA version 2 as an option. v1 will remain available for now, to be fully deprecated later.
55
- * Fixed widget to use __construct for WP 4.3 compatibility.
56
- * Added error checking for WP reserved names when adding new custom fields.
57
- * Added wpmem_wp_reserved_terms filter for overriding reserved terms list.
58
- * Added trim whitespace to password reset and password change form validation.
59
-
60
- = 3.0.1 =
61
-
62
- * Fixed use of wp_signon() for ssl.
63
- * Fixed [wpmem_msurl] email shortcode.
64
- * Fixed admin js and css load (removed unnecessary slash).
65
- * Fixed autoexcerpt to use setting from object and not wpmemembers_autoex option.
66
- * Added filter to remove comments array if content is blocked.
67
-
68
- = 3.0.0 =
69
-
70
- This release makes significant changes to the plugin's main options in the way they are stored. While care has been taken to make sure that you can roll back to a previous version, you may need to resave settings in the plugin's main options tab when attempting to roll back. It is advised that you test this update prior upgrading an existing install on a production site.
71
-
72
- If you have any custom functions hooked to filters and actions that call any file includes directly from the plugin, please note that several file names have changed.
73
-
74
- * New settings and new plugin class WP_Members.
75
- * New settings now natively support Custom Post Types, both setting defaults and individual post blocking.
76
- * Settings constants removed in favor of using the $wpmem object class.
77
- * Added new|edit toggle to wpmem-register_data filter hook.
78
- * wpmem_settings_loaded action added.
79
- * Securify comments changed to use comments_open instead of comments_template (with a blank template).
80
- * New wpmem_securify_comments filter hook to customize whether comments load or not.
81
- * Registration clear form button defaults to false.
82
- * Removed wp_set_auth_cookie from login function; it is already done as part of wp_signon.
83
- * Post meta box title filter is now for all post types wpmem_admin_{post type}_meta_title.
84
- * New filter for Really Simple Captcha folder location: wpmem_rs_captcha_folder.
85
- * New shortcodes [wpmem_form] added.
86
- * Shortcode dropdown selector added to tinymce toolbar in Post/Page editor.
87
- * Added redirect_to as a function argument if calling wpmem_logout() directly.
88
-
89
- = 2.9.9 =
90
- * Code standards in wp-members-email.php
91
- * Rebuilt admin notification email to follow new regular email structure with more filters in wp-members-email.com
92
- * Added $toggle to headers filter that is used in both emails so that headers could be filtered based on the email being sent (i.e. sending plain text for admin notification vs html for others. in wp-members-email.php
93
- * Added redirect_to parameter as a widget entry in wp-members-sidebar.php
94
- * Corrected flaws in error checking for adding new fields in /admin/tab-fields.php
95
- * Added functions for updating user_status in wp_users table in /admin/users.php
96
- * Fixed get_user_meta 'true' error in wp-members-core.php, users.php, /admin/users.php, /admin/user-profile.php
97
- * Added dummy comments template to protect comments without post password.
98
- * Added new action for deactivting a user (opposite of wpmem_user_activated).
99
- * Added check to remove password, confirm_password, and confirm_email from export (data for these was already skipped, but the field space was there).
100
- * Added wpmem_status_msg_args and wpmem_login_links_args filters.
101
- * Corrected Really Simple Captcha, added field wrapper and should not display on user profile edit.
102
-
103
- = 2.9.8 =
104
- * Fixed bug in settings update that caused the stored version number to be erased.
105
- * Fixed bug with new email function that causes the wpmem_email_newreg not to apply any filtered changes to the email body.
106
- * Major updates to wpmem_block logic, changing to universal _wpmem_block from two separate metas (block & unblock).
107
- * Fixed bug in the page bulk action that caused the result to end up on the posts page.
108
- * Added wpmem_use_ssl utility function.
109
- * Added use of wpmem_use_ssl function to reCAPTCHA to load correctly (previously handled ssl directly).
110
- * Added use of wpmem_use_ssl function for default input text for custom register page, user profile page, and custom stylesheet settings inputs.
111
- * Added new redirect_to parameter to login page shortcode.
112
- * Fixed checkbox for checked by default on the add new user screen.
113
- * Fixed "admin only" fields to display on the add new user screen.
114
- * Added underscores parameter to the fields shortcode to strip underscores. Defaults to off.
115
- * Updated excerpt logic to not show excerpts on multipage posts if not the first page.
116
- * Added new 2015 stylesheets (currently available, but subject to changes/updates)
117
-
118
- = 2.9.7 =
119
- * Fixed comparison for the checkbox CSS class in wpmem_create_formfield.
120
- * Corrected wp native registration function for use on localized sites.
121
- * Rebuilt export function, merges the two previous functions into one (export selected and export all) and will allow for calling custom exports.
122
- * Rebuilt user email function.
123
- * Added default "from" headers to email.
124
- * Added new filter wpmem_export_args.
125
- * Added new filter wpmem_email_filter.
126
- * Added a redirect_to parameter to the registration form similar to the login.
127
- * Fixed plugin admin page load for multisite, if user has theme options edit capabilities.
128
-
129
- = 2.9.6 =
130
- * Updated admin.js to show/hide custom url fields for User Profile page, Register page, and Stylesheet settings.
131
- * Updated options panel to show/hide custom url fields mentioned above.
132
- * Updated admin.js to show/hide checkbox and dropdown extra settings when adding a custom field in Fields.
133
- * Updated fields panel to show/hide extra fields mentioned above.
134
- * Updated reCAPTCHA to automatically change language if the language is (1) set as WPLANG and (2) used by reCAPTCHA.
135
- * Added error checking if Really Simple CAPTCHA is enabled but not installed.
136
- * Updated registration function for improved operation when used with popular cache plugins.
137
-
138
- = 2.9.5 =
139
-
140
- * Added support for Really Simple CAPTCHA (Really Simple CAPTCHA must also be installed).
141
- * Added support for custom field meta keys as shortcodes in emails.
142
- * Added support for default permalinks when using wpmem_logout shortcode.
143
- * Improved admin notification email to skip metas defined as excluded meta.
144
- * Fixed activation function for activations from user profile omitting passwords (see 2.9.4 bug fix for moderated password registration).
145
-
146
- = 2.9.4 =
147
-
148
- * Bug fix for moderated password registration (changes in 2.9.3 introduced a bug that caused moderated registration to send a blank password).
149
- * Bug fix for premium PayPal Subscription extension showing expired users, improved user query.
150
- * Fixed user profile update so that wp_update_user is called only once.
151
- * Added [wpmem_logged_out] shortcode to show content to logged out users. Same as [wp-members status="out"] shortcode but can be used on blocked content without changing security status.
152
- * Removed checkbox for adding password and confirmation fields to the User Screen since these are not stored data.
153
-
154
- = 2.9.3 =
155
-
156
- * Fixed a backend user profile update and create new user issue introduced with some 2.9.2 code improvements. The issue caused the additional fields not to save.
157
- * Added a confirm password and confirm email field to the default install, as well as automatic form validation when used.
158
- * Updated all functions that store/read user data to skip these fields as there is not need to store them, they are simply form validation fields.
159
- * Improved error checking in the admin Fields tab when attempting to add an option name that already exists.
160
- * Added separate registration validation for multisite (refers to WP-Members front end registration only). Multisite has different username requirements and the existing error message was valid, the wording did not fit well for multisite making it confusing. The multisite validation returns the WP error message rather than a custom error message. I may be updating other validation messages in the plugin to utilize this method (while allowing them to be filtered for customization).
161
- * Added a separate install for multisite.
162
- * Updated the template for all localization files (some strings still need translation).
163
-
164
- = 2.9.2 =
165
-
166
- * Added user ID parameter to wpmem_login_redirect filter.
167
- * Added new action hooks
168
- * Added logout shortcode
169
- * Added wpmem_msg_dialog_arr filter
170
- * Improvements to registration function
171
- * Admin panel updates for smaller screens
172
- * Added bulk block/unblock for posts and pages
173
-
174
- = 2.9.1 =
175
-
176
- This is primarily a cleanup and fix update with a few new features.
177
-
178
- * Added WP-Members registration fields to WordPress Users > Add New screen.
179
- * Fixed wpmem_test_shortcode error for TOS.
180
- * Plugin options tab - lists notify address for notify admin setting
181
- * Updated default password change success message - removed need to re-login string.
182
- * Make dropdown values in wpmem_create_formfield function translatable strings for localization
183
- * Changed "logout" to "log out"
184
- * Update to register function to check for unset values for WP native fields.
185
- * Moved the path constants to be defined earlier.
186
- * Added $action parameter to most of the login form filters, allows more direct filtering based on form state (login, password reset, password change).
187
-
188
- = 2.9.0 =
189
-
190
- This is a major update focusing on upgrades to the form building functions, but also includes a number of other changes and improvements.
191
-
192
- Major updates
193
-
194
- * New form building functions include new hooks and a more customizable form building process.
195
- * Form functions moved from wp-members-dialogs.php to new file forms.php
196
- * Sidebar login form also rebuilt in the same way the login and register forms were changed.
197
- * Legacy (old table based) forms completely removed in 2.9
198
- * Updates to error and dialog messages, removed unnecessary html tags
199
-
200
- Changes in wp-members-core.php
201
-
202
- * updated calling of wpmem_test_shortcode, now it works like has_shortcode, put off deprecating at this time.
203
- * updated shortcode to include tos page, allow for new tags (wpmem_field, wpmem_logged_in) (added new shortcode calls in wp-members.php), and accept id attribute for fields. Added $tag argument, can use shortcode_atts_{$shortcode} filter
204
- * moved wpmem_test_shortcode to utilities.php
205
- * added new action hooks: wpmem_pwd_change and wpmem_pwd_reset
206
- * added new filter hook: wpmem_regchk
207
-
208
- Changes in wp-members.php
209
-
210
- * a pretty major overhaul of this file. Moved all but four declarations that weren't already in functions into the init function. Only two constants are declared before the function. This initialization comes after the theme is setup, so pre-initilization needs, such as loading pluggable functions can be declared in the theme's functions.php file. Pluggable functions do not need to be loaded only from the wp-members-pluggable.php file.
211
- * The file name of the wp-members-pluggable.php file is loaded in a filter hook, wpmem_plugins_file, so you could call it something else or load it from another location.
212
- * New action hooks: wpmem_pre_init, wpmem_after_init, wpmem_pre_admin_init, wpmem_after_admin_init
213
- * New filter hook: wpmem_settings
214
-
215
- Miscellaneous Changes
216
-
217
- * Updates to the html for some of the admin to better fit the new WP admin layout. Old html was compatible, but the new works better.
218
- * Updates to the options tab to better group options
219
- * Updates to native (wp-login.php) registration to include require field indication
220
- * Review of output, localized a few missed strings
221
- * Implementation of changes in localization of field names. English values are now stored in the db (except for custom fields that would be whatever language the user creates the field as). Fields are then translated when displayed, rather than stored as translated strings.
222
- * Updated user profile to fix some issues with checkbox and required fields in users.php
223
- * Updated user export to include wp_users table fields user_url, user_nicename, and display_name fields
224
- * Code cleanup in wpmem_block function
225
- * Updated autoexcerpt function
226
- * New filter hooks for post editor meta box titles: wpmem_admin_post_meta_title, wpmem_admin_page_meta_title
227
- * Some updates to existing stylesheets
228
- * Added new stylesheets, including two with non-floated elements. Generic, non-floated stylesheet new default for fresh installs
229
-
230
- = 2.8.10 =
231
-
232
- This is a security update the closes 2 reported XSS vulnerabilities. This update also includes a fix for using SSL with reCAPTCHA.
233
-
234
- = 2.8.9 =
235
-
236
- This is an interim update with some changes that need to get done prior to the 2.9 release. Note: This is the last version that will be compatible with WordPress 3.1. Also, this will be the last version to contain the legacy table based forms. These have been deprecated since version 2.8.0.
237
-
238
- * Added a Twenty Fourteen stylesheet based on the new WP default theme.
239
- * Twenty Fourteen installs as the default stylesheet with a new install
240
- * User export fix - the new user export functions from 2.8.7 were inadvertenly incompatible with PHP 5.2.4 (WP minimum requirements)
241
- * Admin options tab style/layout updates to work better with new WP (3.8) admin theme
242
- * Moved the plugin's texurize process into wpmem_securify rather than in the form functions. This is going to happen in 2.9, and doing it as an interim update will allow users to test 2.9 with pluggable functions.
243
- * Added the texturize process to the shortcode function for the same reason as above, plus this runs on the User List extension as well.
244
- * Made the shortcode function pluggable
245
- * Improved the auto excerpt function
246
-
247
- = 2.8.8 =
248
-
249
- * Updated no password reset for non-activated users to use get_user_by('email')
250
- * Fixed undefined variable $sendback in users.php
251
- * Fixed undefined user object in wpmem_check_activated function
252
- * Set a column width for the WP-Members column in the All Posts and All Pages admin panels, load admin.css
253
- * Added wpmem_admin_after_block_meta and wpmem_admin_block_meta_save actions
254
-
255
- = 2.8.7 =
256
-
257
- * Upgraded the user export process. Eliminates the need for directly loading an export file as in past versions. This also eliminates the need for wp-load.php.
258
- * All user management functions that were in the Users > WP-Members menu are now included under Users > All Users. The Users > WP-Members menu is fully deprecated and removed.
259
- * Corrected some undefined variable notices.
260
- * New filter for the widget title wpmem_widget_title
261
- * Further enhancements to the native WP registration. Even though the plugin was intended to put the registration process into the front end of your WP site, there are always users that either (a) prefer to use the backend native registration or (b) don't read or follow installation and usage instructions. So in an earlier version, I went ahead and added the WP-Members custom fields to the backend registration if it is turned on. This version finishes that process with proper support for dropdown select fields, checkboxes, and text area fields. It also cleans up the error checking and CSS styling for that process.
262
-
263
- = 2.8.6 =
264
-
265
- * Continued updating the stylesheets, this update includes some minor changes to 2010, 2011, 2012, and 2013 to clean up the .noinput class (used in the User Profile update) and the reCAPTCHA area.
266
- * Added responsive elements to the Twenty Twelve stylesheet (remains the plugin's default)
267
- * Changed from PHP_SELF to REQUEST_URI for elements where the plugin forms need to post back to themselves and no other URL exists
268
- * Changed from "siteurl" to "home" for getting the home page link - corrects problems for users who have WP installed in a different directory
269
-
270
- = 2.8.5 =
271
-
272
- * Improved the Twenty Eleven and Twenty Twelve stylesheets (Twenty Twelve remains the plugin default).
273
- * Added a responsive stylesheet based on Twenty Thirteen theme.
274
- * Added a new filter hook for password reset args wpmem_pwdreset_args. This will allow mods for single stage reset (username only or email only).
275
- * Corrected update_user_meta during registration use the filtered value of the user's IP and registration URL.
276
-
277
- = 2.8.4 =
278
-
279
- * Fixed a small bug on admin-side user profile that caused checkboxes to not update correctly
280
- * Added optional small "powered by" attribution link at the bottom of the registration form.
281
-
282
- = 2.8.3 =
283
-
284
- Feature Updates
285
-
286
- * Allows native fields display_name, nicename, and nickname to be removed from the field manager.
287
- * New filter wpmem_logout_link filters all logout links.
288
- * Added default registration via wp-login page (backend). This of course can be disabled by unchecking "anyone can register" in the WP settings.
289
- * Completion of user admin panel implementation. Added screens for non-active and non-exported users.
290
- * Added a custom column to page/post tables to indicate if a post/page is blocked/unblocked opposite the chosen default setting.
291
-
292
- Fixes
293
-
294
- * Fixed bug in admin/post.php that caused an error due a typo in the selected capability.
295
- * Applied the patch for the users table custom columns that didn't return non-WP-Members custom column values.
296
- * Fixed the use of the nonce constant to check if the constant is defined.
297
- * Applied patch to the utilities file that left some debugging code artifacts in the 2.8.2 release.
298
-
299
- Improvements
300
-
301
- * Updated dashboard widget to either superadmin or not display for multisite.
302
- * Added a div tag to the "Required Field" text in the registration form - NOTE: if you run any filters on the registration form, you may need to test them and update accordingly.
303
- * Updated the included stylesheets for the addition of req-text class for the "Required Field" text in the registration form.
304
- * Added Portugese translation files (Thanks Joana!)
305
-
306
- = 2.8.2 =
307
-
308
- Feature Updates
309
-
310
- * Added WP user fields user_nicename, display_name, and nickname to the $fields array, defaults to $username for backward compatibility.
311
- * Updated field manager process to allow user_nicename, display_name, and nickname to be added via the fields manager as WP native fields
312
- * Added wpmem_register_data filter for $fields to allow filtering of all fields prior to new user insertion, including above new fields (added updates to registration function to make better use of the filter).
313
- * Added wpmem_pre_validate_form for $fields to allow filtering fields prior to default form field validation.
314
- * Begin implementation of moving bulk user management features into Users > All Users. Users > All Users screen can now activate and export users, and will show additional fields as selected in the fields manager.
315
- * Added wpmem_admin_profile_heading, wpmem_admin_profile_field, and wpmem_admin_profile_update filters. These filters are all part of the user profile section.
316
-
317
- Fixes, Patches, & Code Improvements
318
-
319
- * Fixed the conversion of update-profile to members-area shortcode. The bug renders all page shortcodes as members-area.
320
- * Fixed the activate user process for user defined passwords, a bug from 2.8.0/2.8.1.
321
- * Fixed a bug that can cause the sidebar login widget to not post to the correct url when a static front page is used.
322
- * Fixed user profile update (updates with custom checkbox don't stay checked), an issue from 2.8.0.
323
- * Patch correcting the front-side registration form nonce. This patch should improve reliability while still using nonces for security.
324
- * Patch for the dropdown field for users running < PHP 5.3.
325
- * Made front-side nonce optional, defaults to off.
326
- * Moved utility functions out of core.php to utility file utilities.php.
327
- * Moved the location of the wpmem_email_notify hook so the filter comes after shortcodes are parsed.
328
- * Updated the registration function to rely on the values contain in $fields, allowing for the array values to be filtered.
329
- * Updated the registration form to accommodate registration function updates.
330
- * Improved auto excerpt function screens for unclosed common html tags and provides a closing tag if none exists.
331
- * Improved export process to wrap fields with double quotes - fixes issues if field contains a comma.
332
-
333
- = 2.8.1 =
334
-
335
- Security update release: 2.8.1 primarily closes some potential security holes. This update is highly recommended.
336
-
337
- Security Updates:
338
-
339
- * Closed potential cross site scripting exploit
340
- * Added nonces to front-side registration
341
- * Updated nonces in admin form submission
342
- * Security evaluation and updates to other areas
343
-
344
- Feature Updates:
345
-
346
- * Added dropdown option for User Profile (members-area) and Register page location
347
- * Updated dropdown field to accommodate commas in the values (ex: 1,000)
348
-
349
- Other Updates:
350
-
351
- * Updated TOS shortcode to be case-insensitive for the shortcode parameter (TOS/tos)
352
- * Begin deprecating members-area parameter to be replaced with user-profile
353
- * Separated User Profile functions from wp-members-core.php file
354
- * Applied post 2.8.0 patches and corrected missing files
355
-
356
- = 2.8.0 =
357
-
358
- New Feature release: 2.8.0 offers the beginning of a major rebuild of the admin panels with a few front-side features slipped in along the way.
359
-
360
- Security Improvements:
361
-
362
- * Added a dummy index.php file in all plugin directories. This is a security improvement and disallows direct access to a directory (in case your server allows directory browsing).
363
-
364
- Code Improvements:
365
-
366
- * Added new constants WPMEM_DIR and WPMEM_PATH. This will allow you to grab the directory of the plugin directly in action and filter functions.
367
- * Broke up the admin file wp-members-admin.php into multiple files based on function. These are all now moved into an /admin/ directory.
368
- * Added the password field to the fields array in the registration function so that this can be used in the registration hooks and filters.
369
- * Updated the logout process to use wp_clear_auth_cookie. The previous wp_clearcookie was deprecated and was causing header errors in some instances.
370
- * Improved the TOS shortcode. This should eliminate some of the parsing errors some users experienced in previous releases.
371
-
372
- Admin Panel Updates:
373
-
374
- * New admin look updates the tabs to the WP format. This also was built to allow extensible tabs so you can hook in and create your own tabs and panels.
375
- * Add field dialog was updated and improved.
376
- * Added an admin process to edit existing fields.
377
- * Added new option in the plugin options to load one of the predefined stylesheets from a dropdown.
378
- * Block/Unblock post meta box added to the post/page editor – no need to use custom fields anymore (this feature actually updates the custom fields accordingly, so you can use custom fields if you want to).
379
- * Added dropdown selector for preloaded stylesheets - no need to enter the location of the preloaded stylesheets to use them.
380
-
381
- New Filters:
382
-
383
- * wpmem_admin_tabs - allows developers to hook into the admin tabs to add additional tabs.
384
- * wpmem_admin_style_list - allows developers to hook into the dropdown list of stylesheets to add additional stylesheets.
385
- * wpmem_auto_excerpt - filters the automatically generated excerpt. Allows you to customize a 'read more' link.
386
- * wpmem_post_password - filters the automatically generated post password that blocks comments on blocked posts/pages.
387
- * wpmem_forgot_link - filters the forgot password link that shows in the login forms.
388
- * wpmem_reg_link - filters the register link that shows in the login forms.
389
-
390
- Other Updates:
391
-
392
- * Added a new pre-loaded stylesheet for Twenty Twelve theme. New installs will default to this style. Note: with the addition of the new style selector in the admin panel, you can easily toggle between the preloaded stylesheets. You can also add your own using the new wpmem_admin_style_list filter, enter the URL location in the Custom Stylesheet field, or load one using wp_enqueue_scripts.
393
-
394
- = 2.7.7 =
395
-
396
- New Features:
397
-
398
- * Added a new filter hook wpmem_securify. This hook applies a filter to the $content variable at the end of the wpmem_securify function. The primary reason for this hook is to be able to run filters on $content that would give you the ability to block content even if the user is logged in (the wpmem_block filter only works for non-logged in state). This will bring in the ability to block users from content based on defined criteria such as content is for members of "group A" but the user is does not have access to "group A" content.
399
- * Added wpmem_email_headers filter hook. This will allow you to easily filter the headers for the email process of the plugin giving you the ability to send HTML email without modifying the plugin.
400
- * Added wpmem_user_activated action hook. This hook will give you the ability to run actions at the end of user activation. For sites that moderate registration, this gives you the ability to hook in actions that you might not want to do before approval of the registration (such as would normally be done with wpmem_post_register_data).
401
- * Added new shortcode for creating a user list/member directory. __This shortcode requires installation of the premium add-on module WP-Members User List [available to rocketgeek.com members](http://rocketgeek.com/about/site-membership-subscription/)__. The shortcode has parameters for including a member search function as well as filter hooks for filtering the layout of the directory elements.
402
- * Added new shortcode for protecting inline content with the __premium add-on module WP-Members PayPal Subscription [available to rocketgeek.com members](http://rocketgeek.com/about/site-membership-subscription/)__.
403
-
404
- Bug Fix:
405
-
406
- * Fixed a bug where the reCAPTCHA error messages do not display on the [shortcode pages "register" and "members-area"](http://rocketgeek.com/plugins/wp-members/users-guide/shortcodes/page-shortcodes/).
407
-
408
- Code Improvement:
409
-
410
- * Completed a rebuild of the login function wpmem_login. Updated the cookie process to switch from [wp_setcookie](http://codex.wordpress.org/Function_Reference/wp_setcookie) (which is deprecated) to [wp_set_auth_cookie](http://codex.wordpress.org/Function_Reference/wp_set_auth_cookie). Also, the [wpmem_login_redirect hook](http://rocketgeek.com/plugins/wp-members/users-guide/filter-hooks/wpmem_login_redirect/) was moved to after the login credentials have been validated and the user is logged in. This allows the hook to access user data without the need to validate the user within the filter.
411
-
412
- = 2.7.6 =
413
-
414
- This release has some new features and some code updates
415
-
416
- * Added ability to use same redirect_to querystring that WP uses in the wp-login form. This allows more seamless replacement of the wp-login.
417
- * Added a new page shortcode for password reset/change [wp-members page="password"]. If the user is logged out, it works the reset forgotten password functionality. If the user is logged in, it will offer the change password functionality. These functions do also remain in the members-area page shortcode as well, but now can be placed in a stand-alone location as well.
418
- * Added a new page shortcode for the user edit page [wp-members page="user-edit"]. This needs to be used if the user is logged in and can be used with the login status shortcode.
419
- * Removed $content global from the page shortcode function. This should correct the double form issue when used with plugins/themes that filter $content.
420
- * Added do_shortcode to the page shortcode call. This should allow the page shortcodes to be used in conjuction with other shortcodes on the page (although this is not necessarily recommended).
421
- * Added translations for Russian, Slovak, and Hindi.
422
- * Moved _OLD forms to wp-members-deprecated.php. These forms can still be used, but will be deprecated in a future version. It is highly recommended that users still using legacy forms begin converting to the _NEW forms.
423
-
424
- = 2.7.5 =
425
-
426
- This is a new feature release (see [release announcement](http://wp.me/p1zYcs-xf) for full details.)
427
-
428
- * Added 5 new filter hooks
429
- * Final deprecation of the old style shortcodes for special pages (<!--members-area-->, <!--reg-area-->). If you are using these you need simply need to update to the modern shortcodes such as [wp-members page="members-area"]
430
- * Added a check for the error message variable immediately following the wpmem_pre_register_data and wpmem_pre_update_data action hooks. This will allow for use of these hooks to include your own custom validation and still be able to return a relevant error message.
431
- * Added a check to see if the TOS field is not being used and thus don't display it on the User Profile for the admin.
432
- * Fixed a bug that showed the incorrect heading on the User Edit page when there is an empty field error.
433
- * Added completely updated .pot file for translations
434
- * Updated all .po/.mo translation files from the new .pot (still need some strings translated for some languages).
435
- * Added all .po/.mo files to the download package.
436
-
437
- = 2.7.4 =
438
-
439
- This is a new feature release (see [release announcement](http://wp.me/p1zYcs-wQ) for full details.)
440
-
441
- * Added 14 new filter hooks
442
- * Added full user export function
443
- * Force email in password reset to be non-case sensitive (changes to wpmem_reset_password in wp-members-core.php)
444
- * Changed "Existing users Login" to "Existing Users Login" in wpmem_inc_login in wp-members-dialogs.php
445
-
446
- = 2.7.3 =
447
-
448
- This is a code improvement release (see [release announcement](http://wp.me/p1zYcs-wD) for full details.)
449
-
450
- * Improved a number of functions in various files for improved functionality.
451
- * Added p tag with class .noinput to the username field when updating profile, added property definition to the stylesheet as well to better align the username.
452
- * Added css property to better align checkboxes in the reg form (a change to wp-members.css).
453
- * Added a class to captcha, and a cooresponding css property in wp-members.css for top/bottom margin of captcha form.
454
-
455
- New features (shortcodes and hooks):
456
-
457
- * Added 'field' shortcode for displaying user data with a shortcode - currently considered experimental and subject to changes.
458
- * Added wpmem_restricted_msg filter hook to filter the restricted post message.
459
- * Added wpmem_login_failed filter hook to filter the login failed message (includes filtering display markup).
460
- * Added wpmem_login_failed_sb filter hook to filter the login failed message in the sidebar (filters message only, not formatting).
461
-
462
- = 2.7.2 =
463
-
464
- This is primarily a bug fix release (see [release announcement](http://wp.me/p1zYcs-vW) for full details.)
465
-
466
- * Fixed a bug where, when using moderated registration, updating a user's backend profile deactivates the user.
467
- * Improved the login error message for login via wp-login.php.
468
- * Added wpmem_pre_register_data action hook.
469
- * Added wpmem_post_register_data action hook.
470
- * Added wpmem_pre_update_data action hook.
471
- * Added wpmem_post_update_data action hook.
472
-
473
- = 2.7.1 =
474
-
475
- This release contains some new features that didn't get completed for 2.7.0 and some fixes (see [release announcement](http://wp.me/p1zYcs-vq) for full details.)
476
-
477
- New features:
478
-
479
- * Deactivate/reactivate users
480
- * Registration moderation added for user defined passwords
481
- * Include an optional stylesheet based on TwentyEleven Theme
482
- * Include an optional stylesheet based on Kubrick (for narrower content areas)
483
- * Added wpmem_register_redirect action hook
484
- * Added wpmem_login_redirect filter hook
485
- * Added wpmem_logout_redirect filter hook
486
- * Added wpmem_sidebar_status filter hook
487
- * Added wpmem_register_links filter hook
488
- * Added wpmem_member_links filter hook
489
- * Added wpmem_login_links filter hook
490
-
491
-
492
- Fixes:
493
-
494
- * rebuilt default email install function
495
- * skip password in [fields] shortcode (changes in wpmem_notify_admin)
496
- * fixed widget sidebar div tag (changes in class widget_wpmemwidget)
497
- * fixed form field validation for invalid email still registered user (changes in wpmem_registration)
498
- * fixed rememberme in login process (changes in wpmem_login)
499
- * moved send from filters to just the wp-members email processes (changes in wpmem_inc_regemail && wpmem_notify_admin)
500
-
501
-
502
- = 2.7.0 =
503
-
504
- This is new feature release with the following features and improvements (see :
505
-
506
- * Email messages can be customized via the plugin admin panel.
507
- * Dropdown fields can be added via the field managment panel.
508
- * Moved location of pluggable file load so that constants may be used without loading twice.
509
- * Registration stores the url the user registered on for all registrations, not just if registration is moderated.
510
- * Trim trailing whitespace on members area, register, and custom css urls.
511
- * Added wp_specialchars_decode to blogname in emails to decode any special characters (such as &amp;) in the title.
512
- * Registration function is now pluggable.
513
- * Updated sidebar widget to be multi-widget compatible.
514
- * TOS can be stored in dialogs OR be a WP page (set in dialogs with a shortcode).
515
- * Plugin can be set up for users to select their own passwords at registration (cannot be used with moderated registration).
516
-
517
- = 2.6.6 =
518
- Bug fix release
519
-
520
- * Fixes as bug where admin side user fields are cleared when a user updates their registration info.
521
-
522
- = 2.6.5 =
523
-
524
- * Rewrite of the reCAPTCHA script to address IE compatibility issues.
525
- * Expansion of the wptexturize fix in 2.6.4, now wraps all of the login and registration forms.
526
- * Fix for the user profile edit so that the admin can see his own additional fields
527
- * Fix so users can edit additional fields through the user profile page.
528
- * WPMEM_REGURL no longer sent to wpmem_chk_qstr as it is a direct URL.
529
-
530
- = 2.6.4 =
531
- Bug fix release with the following changes:
532
-
533
- * Fixes the activate user bug, rolling back from wp_update_user to $wpdb->update.
534
- * Added back wpmem_generatePassword (although this is no longer used, a lot of users are still using this in the comments template.
535
- * Added an override in the login form for the wptexturize function so as to remove the <br> tag that WP puts into the generated form.
536
-
537
- = 2.6.3 =
538
- This is primarily a code improvement release
539
-
540
- * Localized "Clear Form" and "Submit" buttons for translation
541
- * Updated reCAPTCHA noscript (for loading when the browser has js turned off)
542
- * Fixed front-end error messages that did not have stripslashes
543
- * Updated bulk user management to paginate users when displaying all users
544
- * Introduced dropdown support (must be added programmatically at this time)
545
- * Cleaned up unused globals from the registration forms
546
- * Updated the location of the pluggable function file to be outside the plugin folder
547
-
548
- = 2.6.2 =
549
- This is a bug fix release with some additional improvements.
550
-
551
- Bug fixes
552
-
553
- * Fixed checkbox that is set to be checked by default remains checked in the update user settings front end even if the user unchecked it.
554
- * Fixed legacy form password reset bug
555
-
556
- Improvements
557
-
558
- * Registration fields that are not selected to be displayed on the front end will still display on the admin side and be exported. This provides fields that can be used by the admin only for additional user information.
559
- * Checkbox field can be edited in the Manage Fields panel to be checked by default or not.
560
- * Keep the active tab active when editing various plugin settings.
561
-
562
- = 2.6.1 =
563
- Bug fix release
564
-
565
- * Corrected the settings link in the WP installed plugins panel.
566
- * Fixed the view menu links for the bulk user management.
567
- * Fixed ignore warning messages on the WP-Members settings.
568
- * Fixed bulk activate users so already activated users would not be inadvertently reactivated.
569
- * Deactivated auto-excerpt function (was not to be activated in 2.6 production version).
570
-
571
- = 2.6.0 =
572
- This version is a feature release that also includes some rebuilt functions and other code improvements.
573
-
574
- New Features:
575
-
576
- * Front-end now uses enqueue_style to load CSS, so advanced users can directly load their own styles for the plugin without using the plugin settings.
577
- * Improved use of shortcodes. Old-style HTML comment shortcodes will continue to work in certain instances, but will no longer be supported in future versions. Upgrade to the new shortcodes. Major rewrite of the way WP-Members handles the_content() so that it will return a value rather than echo it. Working to better integrate with other shortcodes so they are propery parsed. New WP-Members shortcodes will added in future versions.
578
- * Registration fields can now be customized via the admin panel. This includes adding new fields and deleting non-native fields, and also changing the field order.
579
-
580
- Code Improvements
581
-
582
- * eliminated unused globals
583
- * updated certain functions to use more up-to-date native WP functions.
584
- * core now checks to see if the action variable 'a' is set before requesting it.
585
- * wpmem_securify now scans for 'more' tag so that it will not truncate if the work "more" exists in the excerpt.
586
- * updated email validation/error message to registration process to use is_email().
587
-
588
- = 2.5.4 =
589
- This is a bug fix release. 2.5.3 introduced a bug where the random password sent to a new user was invalid. While the fix is simple, the nature of the bug related to the functionality of the plugin dictates a full update so that users unaware of the bug will be notified via their WP admin panel.
590
-
591
- = 2.5.3 =
592
- This is primarily a bug fix release.
593
-
594
- Bug fixes:
595
-
596
- * Fixed reCAPTCHA from trying to validate on the User Edit page even though reCAPTCHA is not used on this page.
597
- * Added validation to change password page to not allow double empty fields.
598
- * Added additional username validation to prevent invalid (non-alphanumeric) characters in the username.
599
- * Fixed comments reply link which did not allow a registered user to reply on an unblocked page/post.
600
-
601
- Other changes:
602
-
603
- * Rebuild of registration function
604
- * Review of comments process
605
- * Added stripslashes to front-end user registration validation
606
-
607
- = 2.5.2 =
608
- This is predominately a release of fixes and improvements:
609
-
610
- * Fixed the admin menus so that the user menu isn't open by default.
611
- * Fixed the "ignore warning messages" that was broken in 2.5.1.
612
- * Corrected the CAPTCHA to not show up on members settings update.
613
- * Plugin checks to see if the reCAPTCHA library is already loaded to be compatible with other reCAPTCHA plugins.
614
- * Fixed activate user function for bulk activation - checks to see if the user is already activated and if so, skips that user so we don't accidentally activate users that are already activated in bulk mode, thus resetting their passwords.
615
- * Updated login process to use wp_signon (wp_login is deprecated).
616
- * Updated sidebar widget include a new css class #wp-members .err for login error message
617
- * Updated sidebar widget to use the appropriate `<li>` tag into the sidebar area. This should only be a factor for users that customized css. In this case, you'll need to update your stylesheet for ID #wpmem_login_side to #wp-members.
618
- * Updated the sidebar login to better direct the user upon successful login (previously working fine on individual posts and pages, but not on categories).
619
- * *Strictly Experimental* - Introducing pluggable functions - laying the ground work, won't be official yet, so some functions may be deprecated and/or modified.
620
-
621
- = 2.5.1 =
622
- Exanding on the features added in 2.5.0, this release adds setting for the register page, new tableless forms, and custom CSS
623
-
624
- New Features
625
-
626
- * Changed the "turn off registration" feature to allow for a registration page
627
- * Specify registration page location (so we can have a register link in the login form)
628
- * New tableless forms, can still toggle legacy forms
629
- * Specify custom CSS for tableless forms
630
-
631
- Fixes and Code Improvements
632
-
633
- * Removed focus call in the reCAPTCHA that put the cursor focus immediately on the CAPTCHA
634
- * Updated to wp_enqueue_script & _style for admin css and ajax.
635
- * Fixed some typos.
636
- * Fixed some security issues.
637
-
638
- = 2.5.0 =
639
- WP-Members&trade; 2.5 is essentially a pre-3.0 release and extention of the 2.4 release, which was only released as a public beta. In addition to the list below, see the list of features, improvements, and fixes for 2.4.0.
640
-
641
- New Features
642
-
643
- * added shortcode support for login only page
644
- * added support for checkboxes in the registration fields
645
- * added setting for members area/settings page url (so we can have "forgot password" link anywhere)
646
- * added a "change your password" link in the email if members area/settings page url is set
647
-
648
- Bug Fixes
649
-
650
- * corrected a bug introduced in the 2.3.x widget update that caused the widget to be undraggable in certain instances
651
-
652
- = 2.4.0 =
653
- This was never a full production release, but was released as a public beta. The production completion of this project was 2.5
654
-
655
- New Features
656
-
657
- * added reCAPTCHA support for registration
658
- * added Terms of Service (TOS) checkbox and popup
659
- * added shortcode support for members area and register pages
660
- * added custom user management panel for bulk user edits
661
- * added user list export
662
- * localization support (beginning)
663
- * contextual help in admin panels (beginning)
664
-
665
- Code Improvements
666
-
667
- * updated the registration process so that unused fields are not put into the user_meta table
668
- * updated emails for moderated registration to send user the url they signed up on
669
- * capture user's IP address at registration
670
- * sets logged in admin as activated (prevents admin from accidentally being locked out)
671
- * added toggle to force clean install of settings
672
- * improvements to uninstall process
673
-
674
- Bug Fixes
675
-
676
- * added stripslashes to dialogs (accommodates the use of apostrophes/quotation marks)
677
- * fixed sidebar login for non-widget use (bug from 2.3.x)
678
-
679
- = 2.3.2 =
680
- Bug Fix Release
681
-
682
- * fixed login failed message for sidebar widget
683
- * fixed login failed message for members area page
684
- * fixed email to include user_url field properly
685
- * changed cell alignment for 'textarea' field type in reg form
686
-
687
- = 2.3.1 =
688
- Code Improvements
689
-
690
- * updated deprecated call get_usermeta to get_user_meta, update_usermeta to update_user_meta
691
- * completed update of deprecated call get_settings changed to get_option
692
- * removed deprecated functions wpmem_register() and wpmem_update(), both of these are now handled by wpmem_registration
693
- * $redirect_to in wpmem_login changed to $_POST
694
- * fixed password reset link issue
695
- * changed wp-members-admin.php to load for 'edit_users' capabilities, down from 'manage_options'.
696
- * changes to admin form posts for use with WP Multisite (still need additional testing with Multisite for full compatibility)
697
-
698
- New Features
699
-
700
- * added direct link to edit user in notify admin email
701
- * added optional registration page
702
-
703
- = 2.3.0 =
704
- Adds a number of features put off from the 2.2 release
705
-
706
- * option to notify admin of new user registrations
707
- * option to hold new registrations for admin approval
708
- * option to turn registration off (for admins that want to control registrations in some other way)
709
- * option to show excerpt on pages/posts
710
- * updated widget calls to wp_register_sidebar_ (register_sidebar_ is deprecated)
711
- * updated certain API calls known to be deprecated
712
- * broke out email related functions to separate file; only loads when needed
713
- * broke out core and dialog functions to separate files
714
-
715
- = 2.2.2 =
716
- This release is all code-side cleanup to make the plugin more efficient:
717
-
718
- * Rewrote _securify function to remove redundancies
719
- * Merged Login, Password Change, and Password Reset forms into _login_form
720
- * Added uninstall/delete process to empty settings from database on plugin deletion
721
- * Broke out install and admin scripts to separate file only loaded when needed
722
- * Continued improvement of admin functions
723
-
724
- = 2.2.1 =
725
- * Change password bug fix
726
- * Merged registration and user update functions to eliminate redundancy
727
- * Added nonce security to the options admin
728
-
729
- = 2.2.0 =
730
- The #1 request with the plugin is to simply be able to change the required fields. I have greatly simplified the process so it can be managed from within the WP admin panel. Additionally, I added the ability to determine what fields will show in the registration form (both native WP fields, and additional WP-Members&trade; fields). Also, the error/dialog messages can now be managed from with the admin panel as well.
731
-
732
- * Added new customization features and an admin panel
733
- * Can set fields that will display
734
- * Can set fields to be required
735
- * Can manage error/dialog messages from admin
736
-
737
- = 2.1.2 =
738
- * Added fix to set new registrations as the default role
739
-
740
- = 2.1.1 =
741
- * Udates for the 2.1.0 release that were not completed.
742
- * updated variables for some function calls.
743
- * eliminated unnecessary $table_prefix globals.
744
- * updated some queries to better utilize the $wpdb class.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
745
  * custom fields admin is now managed as an array (cuts the lines of code by 75%, and makes way for user defined custom fields).
1
+ = 3.1.2 =
2
+
3
+ * Minimum WordPress version increased to 3.6.
4
+ * Added user counts to user screen links (set as transient)
5
+ * Added redirect_to parameter to wpmem_login_url()
6
+ * Added action parameter to wpmem_profile_url()
7
+ * Added api function wpmem_user_pages() to return an array of the login, register, and profile page urls.
8
+ * Added shortcode [wpmem_tos] for Terms of Service page url (replaces [wp-members page=tos url=http://mysite.com/path/to/tos/]).
9
+ * Added wpmem_write_log() function for writing notices to the WP error log.
10
+ * Deprecated [wp-members] shortcode, all other shortcodes no longer rely on wpmem_shortcode().
11
+ * Fixed issue with pre-selected dropdown values to not select empty (separator) rows.
12
+ * Fixed email shortcodes for field and custom shortcodes not being parsed.
13
+
14
+ = 3.1.1 =
15
+
16
+ * Added downgrade function (currently runs on deactivation) to allow for version rollbacks.
17
+ * Added new dialogs functions to admin api, allows for custom dialogs to be added.
18
+ * Added $user_id and $row to wpmem_admin_profile_field and wpmem_user_profile_field filters.
19
+ * Added new api class and api functions.
20
+ * Added [wpmem_loginout] shortcode.
21
+ * Added support for new field types to native registration and users > add new (except file/image fields).
22
+ * Updated users > add new so that user can be activated when added.
23
+ * Updated [wpmem_logged_in] shortcode so that content is not shown on on a user profile page action.
24
+ * Updated email settings to only save new from/name if changed.
25
+ * Updated admin warning messges.
26
+ * Updated multiselect and multicheckbox fields to allow user selected delimiter (defaults to pipe "|").
27
+ * Fixes issue with profile update when file/image field is required.
28
+ * Fixes image field edit in fields tab to include file type.
29
+ * Fixes attribution setting for 3.0 settings array.
30
+ * Fixes for PHP7.
31
+
32
+ = 3.1.0 =
33
+
34
+ This package contains several fixes, some new filters, new field types and other functional improvements.
35
+
36
+ * Some general code cleanup, reviewing inline documentation and comments.
37
+ * Fixed issue for sidebar with redirect_to parameter set in widget settings.
38
+ * Fixed issue for custom error messages and email comparison error for profile update (so that errors show in form update state and not on links page).
39
+ * Fixed main options tab where checkbox may not display correct setting if unchecked.
40
+ * Fixed translation issue for required field error where all of the message except the field name was translated.
41
+ * Fixed issue for register shortcode page where if a user has registered, and is logging in but the login fails, display the login error message.
42
+ * Fixed register shortcode redirect parameter.
43
+ * Fixed confirm_password to bypass sanitize_text_field (which breaks password comparison if certain characters are used).
44
+ * Added logic so that user_pages are not blocked (login, register, user_profile).
45
+ * Added after_wrapper array value for wpmem_{$page}_links_args filters
46
+ * Added a new admin api class, utilities object class, and forms object class.
47
+ * Added user facing strings as an array in the main $wpmem object class.
48
+ * Added wpmem_default_text_strings filter for user facing text strings.
49
+ * Added new wpmem_sidebar_status_args filter hook.
50
+ * Added new container in main object for email from and from name settings.
51
+ * Added file upload functions.
52
+ * Added new field types: multiple checkbox, multiple select, radio, file, image, email, url.
53
+ * Added "values" key to the register form rows array to hold possible values (i.e. select, multiple select, multiple checkbox, and radio group) and the actual value to be in the "value" key.
54
+ * Added the ability for dropdown/select fields to have a default value other than the first value.
55
+ * Added filter wpmem_user_upload_dir for filtering the location of user uploaded files.
56
+ * Added wpmem_register_form_rows_admin and wpmem_register_form_rows_profile filter hooks.
57
+ * Deprecated use of wpmem_chk_qstr() function, use add_query_arg() instead.
58
+ * Deprecated use of get_currentuserinfo() (deprecated in WP 4.5), use wp_get_current_user() instead.
59
+ * Email function updates, added 'footer' as an array value in the main wpmem_email_filter filter.
60
+ * Changed install to set email/confirm_email and user_url as HTML5 field types "email" and "url" (now supported).
61
+ * Changed get_action call from init action to template_redirect action.
62
+ * Changed username in register form from log to user_login to match wp native registration form.
63
+ * Changed [wp-members page="user-profile"] shortcode to [wpmem_profile] (old shortcode will still work).
64
+ * Removed redirect parameter from register shortcode in shortcode menu.
65
+ * Removed kubrick stylesheet from selector (still packaged with download, shows as custom url if used).
66
+ * Changed all _update_ functions in install package to _upgrade_.
67
+ * Fixes an issue with PayPal extension where users may be set to pending if moderated registration is enabled after the user already has an expiration date.
68
+ * Update wpmem_do_sidebar to use use add_query_arg() if on a search query.
69
+
70
+ = 3.0.9 =
71
+
72
+ * Added Custom Post Type support.
73
+ * Added wpmem_member_links_args and wpmem_register_links_args filters.
74
+ * Added $link parameter to wpmem_forgot_link_str and wpmem_reg_link_str filters (gives just the link as an available parameter).
75
+ * Added new wpmem_sb_reg_link_str and wpmem_sb_forgot_link_str filters (same format as above).
76
+ * Added [email] and [user-profile] shortcodes to the new user registration email.
77
+ * Added label_text key to wpmem_register_form_rows filter.
78
+ * Added new auto excerpt settings, can now be set by post type.
79
+ * Added new auto excerpt features including new wpmem_auto_excerpt_args filter.
80
+ * Added forgot username retrieveal link (included on forgot password reset form).
81
+ * Added wpmem_username_link and wpmem_username_link_str for filtering forgot username retrieval link.
82
+ * Added new upgrade process to WP_Members object class.
83
+ * Fixed handling of post bulk actions to keep current screen (if one is used).
84
+ * Fixed handling of updates to the user pages in the options tab.
85
+ * Fixed handling of empty post object in is_blocked() function.
86
+ * Improved email functions to eliminate get_user_meta() calls when not needed.
87
+
88
+ = 3.0.8 =
89
+
90
+ * Added process for forgotten username retrieval.
91
+ * Removed last remaining instances of extract function.
92
+ * Updated settings for special pages (login|register|user-profile) to store only the numeric primary key ID. This will eliminate the need to update these settings if the site is moved (from a dev to live site, for example). Legacy full URL settings will still be compatible without needing to be updated, but will be automatically updated when main options are saved.
93
+
94
+ = 3.0.7 =
95
+
96
+ * Fix for use of display_name on profile update.
97
+ * Fix for newer installs (post WP 4.0) where WPLANG is not defined and reCAPTCHA is used.
98
+ * Fix in wpmem_form shortcode to skp if no additional tag exists.
99
+ * Fix to plugin_basename.
100
+ * Changes in core to use fields from WP_Members class (preparing for new form field process).
101
+ * Reviews and updates to code standards and inline documentation.
102
+ * Fix for password reset (typo in object name checking for moderated registration)
103
+ * Fix for PayPal extension (http://rkt.bz/r3); added logic to avoid errors if the PayPal extension is disabled but the main option setting remained turned on.
104
+
105
+ = 3.0.6 =
106
+
107
+ * Updates to localization function - documented plugin_locale filter, wpmem_localization_file filter, and improved load_textdomain logic.
108
+ * Added /lang domain path to plugin header.
109
+ * Fixed a bug in the user export function that broke CSV columns when moderated registration was turned on.
110
+ * Improved current page retrieval in wpmem_redirect_to_login() function.
111
+ * Fixed admin enqueued scripts (post/page screen hook did not load from new location).
112
+
113
+ = 3.0.5 =
114
+
115
+ * Updated wpmem_pwd_change and wpmem_pwd_reset action hooks to include password as a parameter.
116
+ * Stylesheet updates for 2015, 2014, and generic (both float and no float).
117
+ * Fix to TinyMCE shortcode button, should now load button on new post/page editor.
118
+ * Added [WP-Members] to the TinyMCE shortcode button for clarity as to what it is.
119
+ * Moved admin js and css files to /admin/js/ and /admin/css/
120
+ * Moved admin class files to /admin/includes/
121
+ * Updated and verified all directories contain an index.php file to prevent directory browsing.
122
+
123
+ = 3.0.4 =
124
+
125
+ * Reintroduced the global action variable $wpmem_a for backward compatibility with certain add-ons, most notably the WP-Members MailChimp extension ( see http://rkt.bz/3b ). Users of this extension should upgrade. This variable had been replaced with the new WP-Members object class introduced in 3.0. However, users of older extensions and those that may have customziations with logic may be using this variable, so rather than force updating and upgrading, it is being added back in.
126
+ * Change to the priority of functions hooked to the the_content filter. Lowering the priority should better integrate the plugin with various builder plugins and other processes that currently filter the_content after WP-Members since the content will now be filtered later in the process. This also should improve situations where in the past the on-the-fly texturization shortcode for the WP-Members forms might remain unparsed.
127
+
128
+ = 3.0.3 =
129
+
130
+ * Bug fix recaptcha v2 decode json response on validation.
131
+ * Bug fix typo in $wpmem object name in admin/user-profile.php.
132
+ * Bug fix message string variable in wpmem_msg_dialog_arr filter.
133
+ * Fix register form shortcode redirect_to parameter.
134
+ * Admin forms now use submit_button() function to generate submit button.
135
+ * Changed localization to load on init action which will allow for more flexibility with filtering custom language files.
136
+ * Added wpmem_localization_file and wpmem_localization_dir filters.
137
+ * Localization checks for file in /wp-content/ language directory first, then loads plugin default.
138
+
139
+ = 3.0.2 =
140
+
141
+ * Added reCAPTCHA version 2 as an option. v1 will remain available for now, to be fully deprecated later.
142
+ * Fixed widget to use __construct for WP 4.3 compatibility.
143
+ * Added error checking for WP reserved names when adding new custom fields.
144
+ * Added wpmem_wp_reserved_terms filter for overriding reserved terms list.
145
+ * Added trim whitespace to password reset and password change form validation.
146
+
147
+ = 3.0.1 =
148
+
149
+ * Fixed use of wp_signon() for ssl.
150
+ * Fixed [wpmem_msurl] email shortcode.
151
+ * Fixed admin js and css load (removed unnecessary slash).
152
+ * Fixed autoexcerpt to use setting from object and not wpmemembers_autoex option.
153
+ * Added filter to remove comments array if content is blocked.
154
+
155
+ = 3.0.0 =
156
+
157
+ This release makes significant changes to the plugin's main options in the way they are stored. While care has been taken to make sure that you can roll back to a previous version, you may need to resave settings in the plugin's main options tab when attempting to roll back. It is advised that you test this update prior upgrading an existing install on a production site.
158
+
159
+ If you have any custom functions hooked to filters and actions that call any file includes directly from the plugin, please note that several file names have changed.
160
+
161
+ * New settings and new plugin class WP_Members.
162
+ * New settings now natively support Custom Post Types, both setting defaults and individual post blocking.
163
+ * Settings constants removed in favor of using the $wpmem object class.
164
+ * Added new|edit toggle to wpmem-register_data filter hook.
165
+ * wpmem_settings_loaded action added.
166
+ * Securify comments changed to use comments_open instead of comments_template (with a blank template).
167
+ * New wpmem_securify_comments filter hook to customize whether comments load or not.
168
+ * Registration clear form button defaults to false.
169
+ * Removed wp_set_auth_cookie from login function; it is already done as part of wp_signon.
170
+ * Post meta box title filter is now for all post types wpmem_admin_{post type}_meta_title.
171
+ * New filter for Really Simple Captcha folder location: wpmem_rs_captcha_folder.
172
+ * New shortcodes [wpmem_form] added.
173
+ * Shortcode dropdown selector added to tinymce toolbar in Post/Page editor.
174
+ * Added redirect_to as a function argument if calling wpmem_logout() directly.
175
+
176
+ = 2.9.9 =
177
+ * Code standards in wp-members-email.php
178
+ * Rebuilt admin notification email to follow new regular email structure with more filters in wp-members-email.com
179
+ * Added $toggle to headers filter that is used in both emails so that headers could be filtered based on the email being sent (i.e. sending plain text for admin notification vs html for others. in wp-members-email.php
180
+ * Added redirect_to parameter as a widget entry in wp-members-sidebar.php
181
+ * Corrected flaws in error checking for adding new fields in /admin/tab-fields.php
182
+ * Added functions for updating user_status in wp_users table in /admin/users.php
183
+ * Fixed get_user_meta 'true' error in wp-members-core.php, users.php, /admin/users.php, /admin/user-profile.php
184
+ * Added dummy comments template to protect comments without post password.
185
+ * Added new action for deactivting a user (opposite of wpmem_user_activated).
186
+ * Added check to remove password, confirm_password, and confirm_email from export (data for these was already skipped, but the field space was there).
187
+ * Added wpmem_status_msg_args and wpmem_login_links_args filters.
188
+ * Corrected Really Simple Captcha, added field wrapper and should not display on user profile edit.
189
+
190
+ = 2.9.8 =
191
+ * Fixed bug in settings update that caused the stored version number to be erased.
192
+ * Fixed bug with new email function that causes the wpmem_email_newreg not to apply any filtered changes to the email body.
193
+ * Major updates to wpmem_block logic, changing to universal _wpmem_block from two separate metas (block & unblock).
194
+ * Fixed bug in the page bulk action that caused the result to end up on the posts page.
195
+ * Added wpmem_use_ssl utility function.
196
+ * Added use of wpmem_use_ssl function to reCAPTCHA to load correctly (previously handled ssl directly).
197
+ * Added use of wpmem_use_ssl function for default input text for custom register page, user profile page, and custom stylesheet settings inputs.
198
+ * Added new redirect_to parameter to login page shortcode.
199
+ * Fixed checkbox for checked by default on the add new user screen.
200
+ * Fixed "admin only" fields to display on the add new user screen.
201
+ * Added underscores parameter to the fields shortcode to strip underscores. Defaults to off.
202
+ * Updated excerpt logic to not show excerpts on multipage posts if not the first page.
203
+ * Added new 2015 stylesheets (currently available, but subject to changes/updates)
204
+
205
+ = 2.9.7 =
206
+ * Fixed comparison for the checkbox CSS class in wpmem_create_formfield.
207
+ * Corrected wp native registration function for use on localized sites.
208
+ * Rebuilt export function, merges the two previous functions into one (export selected and export all) and will allow for calling custom exports.
209
+ * Rebuilt user email function.
210
+ * Added default "from" headers to email.
211
+ * Added new filter wpmem_export_args.
212
+ * Added new filter wpmem_email_filter.
213
+ * Added a redirect_to parameter to the registration form similar to the login.
214
+ * Fixed plugin admin page load for multisite, if user has theme options edit capabilities.
215
+
216
+ = 2.9.6 =
217
+ * Updated admin.js to show/hide custom url fields for User Profile page, Register page, and Stylesheet settings.
218
+ * Updated options panel to show/hide custom url fields mentioned above.
219
+ * Updated admin.js to show/hide checkbox and dropdown extra settings when adding a custom field in Fields.
220
+ * Updated fields panel to show/hide extra fields mentioned above.
221
+ * Updated reCAPTCHA to automatically change language if the language is (1) set as WPLANG and (2) used by reCAPTCHA.
222
+ * Added error checking if Really Simple CAPTCHA is enabled but not installed.
223
+ * Updated registration function for improved operation when used with popular cache plugins.
224
+
225
+ = 2.9.5 =
226
+
227
+ * Added support for Really Simple CAPTCHA (Really Simple CAPTCHA must also be installed).
228
+ * Added support for custom field meta keys as shortcodes in emails.
229
+ * Added support for default permalinks when using wpmem_logout shortcode.
230
+ * Improved admin notification email to skip metas defined as excluded meta.
231
+ * Fixed activation function for activations from user profile omitting passwords (see 2.9.4 bug fix for moderated password registration).
232
+
233
+ = 2.9.4 =
234
+
235
+ * Bug fix for moderated password registration (changes in 2.9.3 introduced a bug that caused moderated registration to send a blank password).
236
+ * Bug fix for premium PayPal Subscription extension showing expired users, improved user query.
237
+ * Fixed user profile update so that wp_update_user is called only once.
238
+ * Added [wpmem_logged_out] shortcode to show content to logged out users. Same as [wp-members status="out"] shortcode but can be used on blocked content without changing security status.
239
+ * Removed checkbox for adding password and confirmation fields to the User Screen since these are not stored data.
240
+
241
+ = 2.9.3 =
242
+
243
+ * Fixed a backend user profile update and create new user issue introduced with some 2.9.2 code improvements. The issue caused the additional fields not to save.
244
+ * Added a confirm password and confirm email field to the default install, as well as automatic form validation when used.
245
+ * Updated all functions that store/read user data to skip these fields as there is not need to store them, they are simply form validation fields.
246
+ * Improved error checking in the admin Fields tab when attempting to add an option name that already exists.
247
+ * Added separate registration validation for multisite (refers to WP-Members front end registration only). Multisite has different username requirements and the existing error message was valid, the wording did not fit well for multisite making it confusing. The multisite validation returns the WP error message rather than a custom error message. I may be updating other validation messages in the plugin to utilize this method (while allowing them to be filtered for customization).
248
+ * Added a separate install for multisite.
249
+ * Updated the template for all localization files (some strings still need translation).
250
+
251
+ = 2.9.2 =
252
+
253
+ * Added user ID parameter to wpmem_login_redirect filter.
254
+ * Added new action hooks
255
+ * Added logout shortcode
256
+ * Added wpmem_msg_dialog_arr filter
257
+ * Improvements to registration function
258
+ * Admin panel updates for smaller screens
259
+ * Added bulk block/unblock for posts and pages
260
+
261
+ = 2.9.1 =
262
+
263
+ This is primarily a cleanup and fix update with a few new features.
264
+
265
+ * Added WP-Members registration fields to WordPress Users > Add New screen.
266
+ * Fixed wpmem_test_shortcode error for TOS.
267
+ * Plugin options tab - lists notify address for notify admin setting
268
+ * Updated default password change success message - removed need to re-login string.
269
+ * Make dropdown values in wpmem_create_formfield function translatable strings for localization
270
+ * Changed "logout" to "log out"
271
+ * Update to register function to check for unset values for WP native fields.
272
+ * Moved the path constants to be defined earlier.
273
+ * Added $action parameter to most of the login form filters, allows more direct filtering based on form state (login, password reset, password change).
274
+
275
+ = 2.9.0 =
276
+
277
+ This is a major update focusing on upgrades to the form building functions, but also includes a number of other changes and improvements.
278
+
279
+ Major updates
280
+
281
+ * New form building functions include new hooks and a more customizable form building process.
282
+ * Form functions moved from wp-members-dialogs.php to new file forms.php
283
+ * Sidebar login form also rebuilt in the same way the login and register forms were changed.
284
+ * Legacy (old table based) forms completely removed in 2.9
285
+ * Updates to error and dialog messages, removed unnecessary html tags
286
+
287
+ Changes in wp-members-core.php
288
+
289
+ * updated calling of wpmem_test_shortcode, now it works like has_shortcode, put off deprecating at this time.
290
+ * updated shortcode to include tos page, allow for new tags (wpmem_field, wpmem_logged_in) (added new shortcode calls in wp-members.php), and accept id attribute for fields. Added $tag argument, can use shortcode_atts_{$shortcode} filter
291
+ * moved wpmem_test_shortcode to utilities.php
292
+ * added new action hooks: wpmem_pwd_change and wpmem_pwd_reset
293
+ * added new filter hook: wpmem_regchk
294
+
295
+ Changes in wp-members.php
296
+
297
+ * a pretty major overhaul of this file. Moved all but four declarations that weren't already in functions into the init function. Only two constants are declared before the function. This initialization comes after the theme is setup, so pre-initilization needs, such as loading pluggable functions can be declared in the theme's functions.php file. Pluggable functions do not need to be loaded only from the wp-members-pluggable.php file.
298
+ * The file name of the wp-members-pluggable.php file is loaded in a filter hook, wpmem_plugins_file, so you could call it something else or load it from another location.
299
+ * New action hooks: wpmem_pre_init, wpmem_after_init, wpmem_pre_admin_init, wpmem_after_admin_init
300
+ * New filter hook: wpmem_settings
301
+
302
+ Miscellaneous Changes
303
+
304
+ * Updates to the html for some of the admin to better fit the new WP admin layout. Old html was compatible, but the new works better.
305
+ * Updates to the options tab to better group options
306
+ * Updates to native (wp-login.php) registration to include require field indication
307
+ * Review of output, localized a few missed strings
308
+ * Implementation of changes in localization of field names. English values are now stored in the db (except for custom fields that would be whatever language the user creates the field as). Fields are then translated when displayed, rather than stored as translated strings.
309
+ * Updated user profile to fix some issues with checkbox and required fields in users.php
310
+ * Updated user export to include wp_users table fields user_url, user_nicename, and display_name fields
311
+ * Code cleanup in wpmem_block function
312
+ * Updated autoexcerpt function
313
+ * New filter hooks for post editor meta box titles: wpmem_admin_post_meta_title, wpmem_admin_page_meta_title
314
+ * Some updates to existing stylesheets
315
+ * Added new stylesheets, including two with non-floated elements. Generic, non-floated stylesheet new default for fresh installs
316
+
317
+ = 2.8.10 =
318
+
319
+ This is a security update the closes 2 reported XSS vulnerabilities. This update also includes a fix for using SSL with reCAPTCHA.
320
+
321
+ = 2.8.9 =
322
+
323
+ This is an interim update with some changes that need to get done prior to the 2.9 release. Note: This is the last version that will be compatible with WordPress 3.1. Also, this will be the last version to contain the legacy table based forms. These have been deprecated since version 2.8.0.
324
+
325
+ * Added a Twenty Fourteen stylesheet based on the new WP default theme.
326
+ * Twenty Fourteen installs as the default stylesheet with a new install
327
+ * User export fix - the new user export functions from 2.8.7 were inadvertenly incompatible with PHP 5.2.4 (WP minimum requirements)
328
+ * Admin options tab style/layout updates to work better with new WP (3.8) admin theme
329
+ * Moved the plugin's texurize process into wpmem_securify rather than in the form functions. This is going to happen in 2.9, and doing it as an interim update will allow users to test 2.9 with pluggable functions.
330
+ * Added the texturize process to the shortcode function for the same reason as above, plus this runs on the User List extension as well.
331
+ * Made the shortcode function pluggable
332
+ * Improved the auto excerpt function
333
+
334
+ = 2.8.8 =
335
+
336
+ * Updated no password reset for non-activated users to use get_user_by('email')
337
+ * Fixed undefined variable $sendback in users.php
338
+ * Fixed undefined user object in wpmem_check_activated function
339
+ * Set a column width for the WP-Members column in the All Posts and All Pages admin panels, load admin.css
340
+ * Added wpmem_admin_after_block_meta and wpmem_admin_block_meta_save actions
341
+
342
+ = 2.8.7 =
343
+
344
+ * Upgraded the user export process. Eliminates the need for directly loading an export file as in past versions. This also eliminates the need for wp-load.php.
345
+ * All user management functions that were in the Users > WP-Members menu are now included under Users > All Users. The Users > WP-Members menu is fully deprecated and removed.
346
+ * Corrected some undefined variable notices.
347
+ * New filter for the widget title wpmem_widget_title
348
+ * Further enhancements to the native WP registration. Even though the plugin was intended to put the registration process into the front end of your WP site, there are always users that either (a) prefer to use the backend native registration or (b) don't read or follow installation and usage instructions. So in an earlier version, I went ahead and added the WP-Members custom fields to the backend registration if it is turned on. This version finishes that process with proper support for dropdown select fields, checkboxes, and text area fields. It also cleans up the error checking and CSS styling for that process.
349
+
350
+ = 2.8.6 =
351
+
352
+ * Continued updating the stylesheets, this update includes some minor changes to 2010, 2011, 2012, and 2013 to clean up the .noinput class (used in the User Profile update) and the reCAPTCHA area.
353
+ * Added responsive elements to the Twenty Twelve stylesheet (remains the plugin's default)
354
+ * Changed from PHP_SELF to REQUEST_URI for elements where the plugin forms need to post back to themselves and no other URL exists
355
+ * Changed from "siteurl" to "home" for getting the home page link - corrects problems for users who have WP installed in a different directory
356
+
357
+ = 2.8.5 =
358
+
359
+ * Improved the Twenty Eleven and Twenty Twelve stylesheets (Twenty Twelve remains the plugin default).
360
+ * Added a responsive stylesheet based on Twenty Thirteen theme.
361
+ * Added a new filter hook for password reset args wpmem_pwdreset_args. This will allow mods for single stage reset (username only or email only).
362
+ * Corrected update_user_meta during registration use the filtered value of the user's IP and registration URL.
363
+
364
+ = 2.8.4 =
365
+
366
+ * Fixed a small bug on admin-side user profile that caused checkboxes to not update correctly
367
+ * Added optional small "powered by" attribution link at the bottom of the registration form.
368
+
369
+ = 2.8.3 =
370
+
371
+ Feature Updates
372
+
373
+ * Allows native fields display_name, nicename, and nickname to be removed from the field manager.
374
+ * New filter wpmem_logout_link filters all logout links.
375
+ * Added default registration via wp-login page (backend). This of course can be disabled by unchecking "anyone can register" in the WP settings.
376
+ * Completion of user admin panel implementation. Added screens for non-active and non-exported users.
377
+ * Added a custom column to page/post tables to indicate if a post/page is blocked/unblocked opposite the chosen default setting.
378
+
379
+ Fixes
380
+
381
+ * Fixed bug in admin/post.php that caused an error due a typo in the selected capability.
382
+ * Applied the patch for the users table custom columns that didn't return non-WP-Members custom column values.
383
+ * Fixed the use of the nonce constant to check if the constant is defined.
384
+ * Applied patch to the utilities file that left some debugging code artifacts in the 2.8.2 release.
385
+
386
+ Improvements
387
+
388
+ * Updated dashboard widget to either superadmin or not display for multisite.
389
+ * Added a div tag to the "Required Field" text in the registration form - NOTE: if you run any filters on the registration form, you may need to test them and update accordingly.
390
+ * Updated the included stylesheets for the addition of req-text class for the "Required Field" text in the registration form.
391
+ * Added Portugese translation files (Thanks Joana!)
392
+
393
+ = 2.8.2 =
394
+
395
+ Feature Updates
396
+
397
+ * Added WP user fields user_nicename, display_name, and nickname to the $fields array, defaults to $username for backward compatibility.
398
+ * Updated field manager process to allow user_nicename, display_name, and nickname to be added via the fields manager as WP native fields
399
+ * Added wpmem_register_data filter for $fields to allow filtering of all fields prior to new user insertion, including above new fields (added updates to registration function to make better use of the filter).
400
+ * Added wpmem_pre_validate_form for $fields to allow filtering fields prior to default form field validation.
401
+ * Begin implementation of moving bulk user management features into Users > All Users. Users > All Users screen can now activate and export users, and will show additional fields as selected in the fields manager.
402
+ * Added wpmem_admin_profile_heading, wpmem_admin_profile_field, and wpmem_admin_profile_update filters. These filters are all part of the user profile section.
403
+
404
+ Fixes, Patches, & Code Improvements
405
+
406
+ * Fixed the conversion of update-profile to members-area shortcode. The bug renders all page shortcodes as members-area.
407
+ * Fixed the activate user process for user defined passwords, a bug from 2.8.0/2.8.1.
408
+ * Fixed a bug that can cause the sidebar login widget to not post to the correct url when a static front page is used.
409
+ * Fixed user profile update (updates with custom checkbox don't stay checked), an issue from 2.8.0.
410
+ * Patch correcting the front-side registration form nonce. This patch should improve reliability while still using nonces for security.
411
+ * Patch for the dropdown field for users running < PHP 5.3.
412
+ * Made front-side nonce optional, defaults to off.
413
+ * Moved utility functions out of core.php to utility file utilities.php.
414
+ * Moved the location of the wpmem_email_notify hook so the filter comes after shortcodes are parsed.
415
+ * Updated the registration function to rely on the values contain in $fields, allowing for the array values to be filtered.
416
+ * Updated the registration form to accommodate registration function updates.
417
+ * Improved auto excerpt function screens for unclosed common html tags and provides a closing tag if none exists.
418
+ * Improved export process to wrap fields with double quotes - fixes issues if field contains a comma.
419
+
420
+ = 2.8.1 =
421
+
422
+ Security update release: 2.8.1 primarily closes some potential security holes. This update is highly recommended.
423
+
424
+ Security Updates:
425
+
426
+ * Closed potential cross site scripting exploit
427
+ * Added nonces to front-side registration
428
+ * Updated nonces in admin form submission
429
+ * Security evaluation and updates to other areas
430
+
431
+ Feature Updates:
432
+
433
+ * Added dropdown option for User Profile (members-area) and Register page location
434
+ * Updated dropdown field to accommodate commas in the values (ex: 1,000)
435
+
436
+ Other Updates:
437
+
438
+ * Updated TOS shortcode to be case-insensitive for the shortcode parameter (TOS/tos)
439
+ * Begin deprecating members-area parameter to be replaced with user-profile
440
+ * Separated User Profile functions from wp-members-core.php file
441
+ * Applied post 2.8.0 patches and corrected missing files
442
+
443
+ = 2.8.0 =
444
+
445
+ New Feature release: 2.8.0 offers the beginning of a major rebuild of the admin panels with a few front-side features slipped in along the way.
446
+
447
+ Security Improvements:
448
+
449
+ * Added a dummy index.php file in all plugin directories. This is a security improvement and disallows direct access to a directory (in case your server allows directory browsing).
450
+
451
+ Code Improvements:
452
+
453
+ * Added new constants WPMEM_DIR and WPMEM_PATH. This will allow you to grab the directory of the plugin directly in action and filter functions.
454
+ * Broke up the admin file wp-members-admin.php into multiple files based on function. These are all now moved into an /admin/ directory.
455
+ * Added the password field to the fields array in the registration function so that this can be used in the registration hooks and filters.
456
+ * Updated the logout process to use wp_clear_auth_cookie. The previous wp_clearcookie was deprecated and was causing header errors in some instances.
457
+ * Improved the TOS shortcode. This should eliminate some of the parsing errors some users experienced in previous releases.
458
+
459
+ Admin Panel Updates:
460
+
461
+ * New admin look updates the tabs to the WP format. This also was built to allow extensible tabs so you can hook in and create your own tabs and panels.
462
+ * Add field dialog was updated and improved.
463
+ * Added an admin process to edit existing fields.
464
+ * Added new option in the plugin options to load one of the predefined stylesheets from a dropdown.
465
+ * Block/Unblock post meta box added to the post/page editor – no need to use custom fields anymore (this feature actually updates the custom fields accordingly, so you can use custom fields if you want to).
466
+ * Added dropdown selector for preloaded stylesheets - no need to enter the location of the preloaded stylesheets to use them.
467
+
468
+ New Filters:
469
+
470
+ * wpmem_admin_tabs - allows developers to hook into the admin tabs to add additional tabs.
471
+ * wpmem_admin_style_list - allows developers to hook into the dropdown list of stylesheets to add additional stylesheets.
472
+ * wpmem_auto_excerpt - filters the automatically generated excerpt. Allows you to customize a 'read more' link.
473
+ * wpmem_post_password - filters the automatically generated post password that blocks comments on blocked posts/pages.
474
+ * wpmem_forgot_link - filters the forgot password link that shows in the login forms.
475
+ * wpmem_reg_link - filters the register link that shows in the login forms.
476
+
477
+ Other Updates:
478
+
479
+ * Added a new pre-loaded stylesheet for Twenty Twelve theme. New installs will default to this style. Note: with the addition of the new style selector in the admin panel, you can easily toggle between the preloaded stylesheets. You can also add your own using the new wpmem_admin_style_list filter, enter the URL location in the Custom Stylesheet field, or load one using wp_enqueue_scripts.
480
+
481
+ = 2.7.7 =
482
+
483
+ New Features:
484
+
485
+ * Added a new filter hook wpmem_securify. This hook applies a filter to the $content variable at the end of the wpmem_securify function. The primary reason for this hook is to be able to run filters on $content that would give you the ability to block content even if the user is logged in (the wpmem_block filter only works for non-logged in state). This will bring in the ability to block users from content based on defined criteria such as content is for members of "group A" but the user is does not have access to "group A" content.
486
+ * Added wpmem_email_headers filter hook. This will allow you to easily filter the headers for the email process of the plugin giving you the ability to send HTML email without modifying the plugin.
487
+ * Added wpmem_user_activated action hook. This hook will give you the ability to run actions at the end of user activation. For sites that moderate registration, this gives you the ability to hook in actions that you might not want to do before approval of the registration (such as would normally be done with wpmem_post_register_data).
488
+ * Added new shortcode for creating a user list/member directory. __This shortcode requires installation of the premium add-on module WP-Members User List [available to rocketgeek.com members](http://rocketgeek.com/about/site-membership-subscription/)__. The shortcode has parameters for including a member search function as well as filter hooks for filtering the layout of the directory elements.
489
+ * Added new shortcode for protecting inline content with the __premium add-on module WP-Members PayPal Subscription [available to rocketgeek.com members](http://rocketgeek.com/about/site-membership-subscription/)__.
490
+
491
+ Bug Fix:
492
+
493
+ * Fixed a bug where the reCAPTCHA error messages do not display on the [shortcode pages "register" and "members-area"](http://rocketgeek.com/plugins/wp-members/users-guide/shortcodes/page-shortcodes/).
494
+
495
+ Code Improvement:
496
+
497
+ * Completed a rebuild of the login function wpmem_login. Updated the cookie process to switch from [wp_setcookie](http://codex.wordpress.org/Function_Reference/wp_setcookie) (which is deprecated) to [wp_set_auth_cookie](http://codex.wordpress.org/Function_Reference/wp_set_auth_cookie). Also, the [wpmem_login_redirect hook](http://rocketgeek.com/plugins/wp-members/users-guide/filter-hooks/wpmem_login_redirect/) was moved to after the login credentials have been validated and the user is logged in. This allows the hook to access user data without the need to validate the user within the filter.
498
+
499
+ = 2.7.6 =
500
+
501
+ This release has some new features and some code updates
502
+
503
+ * Added ability to use same redirect_to querystring that WP uses in the wp-login form. This allows more seamless replacement of the wp-login.
504
+ * Added a new page shortcode for password reset/change [wp-members page="password"]. If the user is logged out, it works the reset forgotten password functionality. If the user is logged in, it will offer the change password functionality. These functions do also remain in the members-area page shortcode as well, but now can be placed in a stand-alone location as well.
505
+ * Added a new page shortcode for the user edit page [wp-members page="user-edit"]. This needs to be used if the user is logged in and can be used with the login status shortcode.
506
+ * Removed $content global from the page shortcode function. This should correct the double form issue when used with plugins/themes that filter $content.
507
+ * Added do_shortcode to the page shortcode call. This should allow the page shortcodes to be used in conjuction with other shortcodes on the page (although this is not necessarily recommended).
508
+ * Added translations for Russian, Slovak, and Hindi.
509
+ * Moved _OLD forms to wp-members-deprecated.php. These forms can still be used, but will be deprecated in a future version. It is highly recommended that users still using legacy forms begin converting to the _NEW forms.
510
+
511
+ = 2.7.5 =
512
+
513
+ This is a new feature release (see [release announcement](http://wp.me/p1zYcs-xf) for full details.)
514
+
515
+ * Added 5 new filter hooks
516
+ * Final deprecation of the old style shortcodes for special pages (<!--members-area-->, <!--reg-area-->). If you are using these you need simply need to update to the modern shortcodes such as [wp-members page="members-area"]
517
+ * Added a check for the error message variable immediately following the wpmem_pre_register_data and wpmem_pre_update_data action hooks. This will allow for use of these hooks to include your own custom validation and still be able to return a relevant error message.
518
+ * Added a check to see if the TOS field is not being used and thus don't display it on the User Profile for the admin.
519
+ * Fixed a bug that showed the incorrect heading on the User Edit page when there is an empty field error.
520
+ * Added completely updated .pot file for translations
521
+ * Updated all .po/.mo translation files from the new .pot (still need some strings translated for some languages).
522
+ * Added all .po/.mo files to the download package.
523
+
524
+ = 2.7.4 =
525
+
526
+ This is a new feature release (see [release announcement](http://wp.me/p1zYcs-wQ) for full details.)
527
+
528
+ * Added 14 new filter hooks
529
+ * Added full user export function
530
+ * Force email in password reset to be non-case sensitive (changes to wpmem_reset_password in wp-members-core.php)
531
+ * Changed "Existing users Login" to "Existing Users Login" in wpmem_inc_login in wp-members-dialogs.php
532
+
533
+ = 2.7.3 =
534
+
535
+ This is a code improvement release (see [release announcement](http://wp.me/p1zYcs-wD) for full details.)
536
+
537
+ * Improved a number of functions in various files for improved functionality.
538
+ * Added p tag with class .noinput to the username field when updating profile, added property definition to the stylesheet as well to better align the username.
539
+ * Added css property to better align checkboxes in the reg form (a change to wp-members.css).
540
+ * Added a class to captcha, and a cooresponding css property in wp-members.css for top/bottom margin of captcha form.
541
+
542
+ New features (shortcodes and hooks):
543
+
544
+ * Added 'field' shortcode for displaying user data with a shortcode - currently considered experimental and subject to changes.
545
+ * Added wpmem_restricted_msg filter hook to filter the restricted post message.
546
+ * Added wpmem_login_failed filter hook to filter the login failed message (includes filtering display markup).
547
+ * Added wpmem_login_failed_sb filter hook to filter the login failed message in the sidebar (filters message only, not formatting).
548
+
549
+ = 2.7.2 =
550
+
551
+ This is primarily a bug fix release (see [release announcement](http://wp.me/p1zYcs-vW) for full details.)
552
+
553
+ * Fixed a bug where, when using moderated registration, updating a user's backend profile deactivates the user.
554
+ * Improved the login error message for login via wp-login.php.
555
+ * Added wpmem_pre_register_data action hook.
556
+ * Added wpmem_post_register_data action hook.
557
+ * Added wpmem_pre_update_data action hook.
558
+ * Added wpmem_post_update_data action hook.
559
+
560
+ = 2.7.1 =
561
+
562
+ This release contains some new features that didn't get completed for 2.7.0 and some fixes (see [release announcement](http://wp.me/p1zYcs-vq) for full details.)
563
+
564
+ New features:
565
+
566
+ * Deactivate/reactivate users
567
+ * Registration moderation added for user defined passwords
568
+ * Include an optional stylesheet based on TwentyEleven Theme
569
+ * Include an optional stylesheet based on Kubrick (for narrower content areas)
570
+ * Added wpmem_register_redirect action hook
571
+ * Added wpmem_login_redirect filter hook
572
+ * Added wpmem_logout_redirect filter hook
573
+ * Added wpmem_sidebar_status filter hook
574
+ * Added wpmem_register_links filter hook
575
+ * Added wpmem_member_links filter hook
576
+ * Added wpmem_login_links filter hook
577
+
578
+
579
+ Fixes:
580
+
581
+ * rebuilt default email install function
582
+ * skip password in [fields] shortcode (changes in wpmem_notify_admin)
583
+ * fixed widget sidebar div tag (changes in class widget_wpmemwidget)
584
+ * fixed form field validation for invalid email still registered user (changes in wpmem_registration)
585
+ * fixed rememberme in login process (changes in wpmem_login)
586
+ * moved send from filters to just the wp-members email processes (changes in wpmem_inc_regemail && wpmem_notify_admin)
587
+
588
+
589
+ = 2.7.0 =
590
+
591
+ This is new feature release with the following features and improvements (see :
592
+
593
+ * Email messages can be customized via the plugin admin panel.
594
+ * Dropdown fields can be added via the field managment panel.
595
+ * Moved location of pluggable file load so that constants may be used without loading twice.
596
+ * Registration stores the url the user registered on for all registrations, not just if registration is moderated.
597
+ * Trim trailing whitespace on members area, register, and custom css urls.
598
+ * Added wp_specialchars_decode to blogname in emails to decode any special characters (such as &amp;) in the title.
599
+ * Registration function is now pluggable.
600
+ * Updated sidebar widget to be multi-widget compatible.
601
+ * TOS can be stored in dialogs OR be a WP page (set in dialogs with a shortcode).
602
+ * Plugin can be set up for users to select their own passwords at registration (cannot be used with moderated registration).
603
+
604
+ = 2.6.6 =
605
+ Bug fix release
606
+
607
+ * Fixes as bug where admin side user fields are cleared when a user updates their registration info.
608
+
609
+ = 2.6.5 =
610
+
611
+ * Rewrite of the reCAPTCHA script to address IE compatibility issues.
612
+ * Expansion of the wptexturize fix in 2.6.4, now wraps all of the login and registration forms.
613
+ * Fix for the user profile edit so that the admin can see his own additional fields
614
+ * Fix so users can edit additional fields through the user profile page.
615
+ * WPMEM_REGURL no longer sent to wpmem_chk_qstr as it is a direct URL.
616
+
617
+ = 2.6.4 =
618
+ Bug fix release with the following changes:
619
+
620
+ * Fixes the activate user bug, rolling back from wp_update_user to $wpdb->update.
621
+ * Added back wpmem_generatePassword (although this is no longer used, a lot of users are still using this in the comments template.
622
+ * Added an override in the login form for the wptexturize function so as to remove the <br> tag that WP puts into the generated form.
623
+
624
+ = 2.6.3 =
625
+ This is primarily a code improvement release
626
+
627
+ * Localized "Clear Form" and "Submit" buttons for translation
628
+ * Updated reCAPTCHA noscript (for loading when the browser has js turned off)
629
+ * Fixed front-end error messages that did not have stripslashes
630
+ * Updated bulk user management to paginate users when displaying all users
631
+ * Introduced dropdown support (must be added programmatically at this time)
632
+ * Cleaned up unused globals from the registration forms
633
+ * Updated the location of the pluggable function file to be outside the plugin folder
634
+
635
+ = 2.6.2 =
636
+ This is a bug fix release with some additional improvements.
637
+
638
+ Bug fixes
639
+
640
+ * Fixed checkbox that is set to be checked by default remains checked in the update user settings front end even if the user unchecked it.
641
+ * Fixed legacy form password reset bug
642
+
643
+ Improvements
644
+
645
+ * Registration fields that are not selected to be displayed on the front end will still display on the admin side and be exported. This provides fields that can be used by the admin only for additional user information.
646
+ * Checkbox field can be edited in the Manage Fields panel to be checked by default or not.
647
+ * Keep the active tab active when editing various plugin settings.
648
+
649
+ = 2.6.1 =
650
+ Bug fix release
651
+
652
+ * Corrected the settings link in the WP installed plugins panel.
653
+ * Fixed the view menu links for the bulk user management.
654
+ * Fixed ignore warning messages on the WP-Members settings.
655
+ * Fixed bulk activate users so already activated users would not be inadvertently reactivated.
656
+ * Deactivated auto-excerpt function (was not to be activated in 2.6 production version).
657
+
658
+ = 2.6.0 =
659
+ This version is a feature release that also includes some rebuilt functions and other code improvements.
660
+
661
+ New Features:
662
+
663
+ * Front-end now uses enqueue_style to load CSS, so advanced users can directly load their own styles for the plugin without using the plugin settings.
664
+ * Improved use of shortcodes. Old-style HTML comment shortcodes will continue to work in certain instances, but will no longer be supported in future versions. Upgrade to the new shortcodes. Major rewrite of the way WP-Members handles the_content() so that it will return a value rather than echo it. Working to better integrate with other shortcodes so they are propery parsed. New WP-Members shortcodes will added in future versions.
665
+ * Registration fields can now be customized via the admin panel. This includes adding new fields and deleting non-native fields, and also changing the field order.
666
+
667
+ Code Improvements
668
+
669
+ * eliminated unused globals
670
+ * updated certain functions to use more up-to-date native WP functions.
671
+ * core now checks to see if the action variable 'a' is set before requesting it.
672
+ * wpmem_securify now scans for 'more' tag so that it will not truncate if the work "more" exists in the excerpt.
673
+ * updated email validation/error message to registration process to use is_email().
674
+
675
+ = 2.5.4 =
676
+ This is a bug fix release. 2.5.3 introduced a bug where the random password sent to a new user was invalid. While the fix is simple, the nature of the bug related to the functionality of the plugin dictates a full update so that users unaware of the bug will be notified via their WP admin panel.
677
+
678
+ = 2.5.3 =
679
+ This is primarily a bug fix release.
680
+
681
+ Bug fixes:
682
+
683
+ * Fixed reCAPTCHA from trying to validate on the User Edit page even though reCAPTCHA is not used on this page.
684
+ * Added validation to change password page to not allow double empty fields.
685
+ * Added additional username validation to prevent invalid (non-alphanumeric) characters in the username.
686
+ * Fixed comments reply link which did not allow a registered user to reply on an unblocked page/post.
687
+
688
+ Other changes:
689
+
690
+ * Rebuild of registration function
691
+ * Review of comments process
692
+ * Added stripslashes to front-end user registration validation
693
+
694
+ = 2.5.2 =
695
+ This is predominately a release of fixes and improvements:
696
+
697
+ * Fixed the admin menus so that the user menu isn't open by default.
698
+ * Fixed the "ignore warning messages" that was broken in 2.5.1.
699
+ * Corrected the CAPTCHA to not show up on members settings update.
700
+ * Plugin checks to see if the reCAPTCHA library is already loaded to be compatible with other reCAPTCHA plugins.
701
+ * Fixed activate user function for bulk activation - checks to see if the user is already activated and if so, skips that user so we don't accidentally activate users that are already activated in bulk mode, thus resetting their passwords.
702
+ * Updated login process to use wp_signon (wp_login is deprecated).
703
+ * Updated sidebar widget include a new css class #wp-members .err for login error message
704
+ * Updated sidebar widget to use the appropriate `<li>` tag into the sidebar area. This should only be a factor for users that customized css. In this case, you'll need to update your stylesheet for ID #wpmem_login_side to #wp-members.
705
+ * Updated the sidebar login to better direct the user upon successful login (previously working fine on individual posts and pages, but not on categories).
706
+ * *Strictly Experimental* - Introducing pluggable functions - laying the ground work, won't be official yet, so some functions may be deprecated and/or modified.
707
+
708
+ = 2.5.1 =
709
+ Exanding on the features added in 2.5.0, this release adds setting for the register page, new tableless forms, and custom CSS
710
+
711
+ New Features
712
+
713
+ * Changed the "turn off registration" feature to allow for a registration page
714
+ * Specify registration page location (so we can have a register link in the login form)
715
+ * New tableless forms, can still toggle legacy forms
716
+ * Specify custom CSS for tableless forms
717
+
718
+ Fixes and Code Improvements
719
+
720
+ * Removed focus call in the reCAPTCHA that put the cursor focus immediately on the CAPTCHA
721
+ * Updated to wp_enqueue_script & _style for admin css and ajax.
722
+ * Fixed some typos.
723
+ * Fixed some security issues.
724
+
725
+ = 2.5.0 =
726
+ WP-Members&trade; 2.5 is essentially a pre-3.0 release and extention of the 2.4 release, which was only released as a public beta. In addition to the list below, see the list of features, improvements, and fixes for 2.4.0.
727
+
728
+ New Features
729
+
730
+ * added shortcode support for login only page
731
+ * added support for checkboxes in the registration fields
732
+ * added setting for members area/settings page url (so we can have "forgot password" link anywhere)
733
+ * added a "change your password" link in the email if members area/settings page url is set
734
+
735
+ Bug Fixes
736
+
737
+ * corrected a bug introduced in the 2.3.x widget update that caused the widget to be undraggable in certain instances
738
+
739
+ = 2.4.0 =
740
+ This was never a full production release, but was released as a public beta. The production completion of this project was 2.5
741
+
742
+ New Features
743
+
744
+ * added reCAPTCHA support for registration
745
+ * added Terms of Service (TOS) checkbox and popup
746
+ * added shortcode support for members area and register pages
747
+ * added custom user management panel for bulk user edits
748
+ * added user list export
749
+ * localization support (beginning)
750
+ * contextual help in admin panels (beginning)
751
+
752
+ Code Improvements
753
+
754
+ * updated the registration process so that unused fields are not put into the user_meta table
755
+ * updated emails for moderated registration to send user the url they signed up on
756
+ * capture user's IP address at registration
757
+ * sets logged in admin as activated (prevents admin from accidentally being locked out)
758
+ * added toggle to force clean install of settings
759
+ * improvements to uninstall process
760
+
761
+ Bug Fixes
762
+
763
+ * added stripslashes to dialogs (accommodates the use of apostrophes/quotation marks)
764
+ * fixed sidebar login for non-widget use (bug from 2.3.x)
765
+
766
+ = 2.3.2 =
767
+ Bug Fix Release
768
+
769
+ * fixed login failed message for sidebar widget
770
+ * fixed login failed message for members area page
771
+ * fixed email to include user_url field properly
772
+ * changed cell alignment for 'textarea' field type in reg form
773
+
774
+ = 2.3.1 =
775
+ Code Improvements
776
+
777
+ * updated deprecated call get_usermeta to get_user_meta, update_usermeta to update_user_meta
778
+ * completed update of deprecated call get_settings changed to get_option
779
+ * removed deprecated functions wpmem_register() and wpmem_update(), both of these are now handled by wpmem_registration
780
+ * $redirect_to in wpmem_login changed to $_POST
781
+ * fixed password reset link issue
782
+ * changed wp-members-admin.php to load for 'edit_users' capabilities, down from 'manage_options'.
783
+ * changes to admin form posts for use with WP Multisite (still need additional testing with Multisite for full compatibility)
784
+
785
+ New Features
786
+
787
+ * added direct link to edit user in notify admin email
788
+ * added optional registration page
789
+
790
+ = 2.3.0 =
791
+ Adds a number of features put off from the 2.2 release
792
+
793
+ * option to notify admin of new user registrations
794
+ * option to hold new registrations for admin approval
795
+ * option to turn registration off (for admins that want to control registrations in some other way)
796
+ * option to show excerpt on pages/posts
797
+ * updated widget calls to wp_register_sidebar_ (register_sidebar_ is deprecated)
798
+ * updated certain API calls known to be deprecated
799
+ * broke out email related functions to separate file; only loads when needed
800
+ * broke out core and dialog functions to separate files
801
+
802
+ = 2.2.2 =
803
+ This release is all code-side cleanup to make the plugin more efficient:
804
+
805
+ * Rewrote _securify function to remove redundancies
806
+ * Merged Login, Password Change, and Password Reset forms into _login_form
807
+ * Added uninstall/delete process to empty settings from database on plugin deletion
808
+ * Broke out install and admin scripts to separate file only loaded when needed
809
+ * Continued improvement of admin functions
810
+
811
+ = 2.2.1 =
812
+ * Change password bug fix
813
+ * Merged registration and user update functions to eliminate redundancy
814
+ * Added nonce security to the options admin
815
+
816
+ = 2.2.0 =
817
+ The #1 request with the plugin is to simply be able to change the required fields. I have greatly simplified the process so it can be managed from within the WP admin panel. Additionally, I added the ability to determine what fields will show in the registration form (both native WP fields, and additional WP-Members&trade; fields). Also, the error/dialog messages can now be managed from with the admin panel as well.
818
+
819
+ * Added new customization features and an admin panel
820
+ * Can set fields that will display
821
+ * Can set fields to be required
822
+ * Can manage error/dialog messages from admin
823
+
824
+ = 2.1.2 =
825
+ * Added fix to set new registrations as the default role
826
+
827
+ = 2.1.1 =
828
+ * Udates for the 2.1.0 release that were not completed.
829
+ * updated variables for some function calls.
830
+ * eliminated unnecessary $table_prefix globals.
831
+ * updated some queries to better utilize the $wpdb class.
832
  * custom fields admin is now managed as an array (cuts the lines of code by 75%, and makes way for user defined custom fields).
inc/api.php CHANGED
@@ -24,6 +24,7 @@
24
  * - wpmem_use_custom_dialog
25
  * - wpmem_user_has_role
26
  * - wpmem_create_membership_number
 
27
  */
28
 
29
 
@@ -35,7 +36,7 @@
35
  */
36
  function wpmem_redirect_to_login() {
37
  if ( ! is_user_logged_in() && wpmem_is_blocked() ) {
38
- $redirect_to = urlencode( wpmem_current_url() );
39
  $url = add_query_arg( 'redirect_to', $redirect_to, wpmem_login_url() );
40
  wp_redirect( $url );
41
  exit();
@@ -62,13 +63,20 @@ function wpmem_is_blocked() {
62
  * Wrapper to get the login page location.
63
  *
64
  * @since 3.1.1
 
65
  *
66
- * @global object $wpmem
67
- * @return string The login page url.
 
68
  */
69
- function wpmem_login_url() {
70
  global $wpmem;
71
- return $wpmem->user_pages['login'];
 
 
 
 
 
72
  }
73
 
74
 
@@ -90,13 +98,32 @@ function wpmem_register_url() {
90
  * Wrapper to get the profile page location.
91
  *
92
  * @since 3.1.1
 
93
  *
94
  * @global object $wpmem
95
- * @return string The profile page url.
 
96
  */
97
- function wpmem_profile_url() {
98
  global $wpmem;
99
- return $wpmem->user_pages['profile'];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
  }
101
 
102
 
@@ -116,6 +143,20 @@ function wpmem_current_url( $slash = true ) {
116
  }
117
 
118
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119
  /**
120
  * Wrapper to get form fields.
121
  *
@@ -134,14 +175,20 @@ function wpmem_fields( $form = false ) {
134
  * Wrapper to return a string from the get_text function.
135
  *
136
  * @since 3.1.1
 
137
  *
138
  * @global object $wpmem The WP_Members object class.
139
  * @param string $str The string to retrieve.
 
140
  * @return string $str The localized string.
141
  */
142
- function wpmem_gettext( $str ) {
143
  global $wpmem;
144
- return $wpmem->get_text( $str );
 
 
 
 
145
  }
146
 
147
 
@@ -202,3 +249,29 @@ function wpmem_create_membership_number( $args ) {
202
  global $wpmem;
203
  return $wpmem->api->generate_membership_number( $args );
204
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  * - wpmem_use_custom_dialog
25
  * - wpmem_user_has_role
26
  * - wpmem_create_membership_number
27
+ * - wpmem_login_status
28
  */
29
 
30
 
36
  */
37
  function wpmem_redirect_to_login() {
38
  if ( ! is_user_logged_in() && wpmem_is_blocked() ) {
39
+ $redirect_to = urlencode( wpmem_current_url() );
40
  $url = add_query_arg( 'redirect_to', $redirect_to, wpmem_login_url() );
41
  wp_redirect( $url );
42
  exit();
63
  * Wrapper to get the login page location.
64
  *
65
  * @since 3.1.1
66
+ * @since 3.1.2 Added redirect_to parameter.
67
  *
68
+ * @global object $wpmem The WP_Members object.
69
+ * @param string $redirect_to URL to return to (optional).
70
+ * @return string $url The login page url.
71
  */
72
+ function wpmem_login_url( $redirect_to = false ) {
73
  global $wpmem;
74
+ if ( $redirect_to ) {
75
+ $url = add_query_arg( 'redirect_to', urlencode( $redirect_to ), $wpmem->user_pages['login'] );
76
+ } else {
77
+ $url = $wpmem->user_pages['login'];
78
+ }
79
+ return $url;
80
  }
81
 
82
 
98
  * Wrapper to get the profile page location.
99
  *
100
  * @since 3.1.1
101
+ * @since 3.1.2 Added $a parameter.
102
  *
103
  * @global object $wpmem
104
+ * @param string $a Action (optional).
105
+ * @return string The profile page url.
106
  */
107
+ function wpmem_profile_url( $a = false ) {
108
  global $wpmem;
109
+ return ( $a ) ? add_query_arg( 'a', $a, $wpmem->user_pages['profile'] ) : $wpmem->user_pages['profile'];
110
+ }
111
+
112
+
113
+ /**
114
+ * Returns an array of user pages.
115
+ *
116
+ * @since 3.1.2
117
+ *
118
+ * @return array $pages
119
+ */
120
+ function wpmem_user_pages() {
121
+ $pages = array(
122
+ trailingslashit( wpmem_login_url() ),
123
+ trailingslashit( wpmem_register_url() ),
124
+ trailingslashit( wpmem_profile_url() ),
125
+ );
126
+ return $pages;
127
  }
128
 
129
 
143
  }
144
 
145
 
146
+ /**
147
+ * Wrapper for $wpmem->create_form_field().
148
+ *
149
+ * @since 3.1.2
150
+ *
151
+ * @param array $args
152
+ * @return string
153
+ */
154
+ function wpmem_form_field( $args ) {
155
+ global $wpmem;
156
+ return $wpmem->forms->create_form_field( $args );
157
+ }
158
+
159
+
160
  /**
161
  * Wrapper to get form fields.
162
  *
175
  * Wrapper to return a string from the get_text function.
176
  *
177
  * @since 3.1.1
178
+ * @since 3.1.2 Added $echo argument.
179
  *
180
  * @global object $wpmem The WP_Members object class.
181
  * @param string $str The string to retrieve.
182
+ * @param bool $echo Print the string (default: false).
183
  * @return string $str The localized string.
184
  */
185
+ function wpmem_gettext( $str, $echo = false ) {
186
  global $wpmem;
187
+ if ( $echo ) {
188
+ echo $wpmem->get_text( $str );
189
+ } else {
190
+ return $wpmem->get_text( $str );
191
+ }
192
  }
193
 
194
 
249
  global $wpmem;
250
  return $wpmem->api->generate_membership_number( $args );
251
  }
252
+
253
+
254
+ /**
255
+ * Returns or displays the user's login status.
256
+ *
257
+ * @since 2.0.0
258
+ * @since 3.1.2 Moved to api.php, no longer pluggable.
259
+ *
260
+ * @param boolean $echo Determines whether function should print result or not (default: true).
261
+ * @return string $status The user status string produced by wpmem_inc_memberlinks().
262
+ */
263
+ function wpmem_login_status( $echo = true ) {
264
+
265
+ /**
266
+ * Load the dialogs functions.
267
+ */
268
+ require_once( WPMEM_PATH . 'inc/dialogs.php' );
269
+
270
+ if ( is_user_logged_in() ) {
271
+ $status = wpmem_inc_memberlinks( 'status' );
272
+ if ( $echo ) {
273
+ echo $status;
274
+ }
275
+ return $status;
276
+ }
277
+ }
inc/class-wp-members-api.php CHANGED
@@ -22,6 +22,8 @@ class WP_Members_API {
22
  * Get field keys by meta.
23
  *
24
  * @since 3.1.1
 
 
25
  */
26
  function get_field_keys_by_meta() {
27
  global $wpmem;
22
  * Get field keys by meta.
23
  *
24
  * @since 3.1.1
25
+ *
26
+ * @return array $field_keys
27
  */
28
  function get_field_keys_by_meta() {
29
  global $wpmem;
inc/class-wp-members-forms.php CHANGED
@@ -25,14 +25,17 @@ class WP_Members_Forms {
25
  * Creates various form fields and returns them as a string.
26
  *
27
  * @since 3.1.0
 
 
28
  *
29
  * @param array $args {
30
  * @type string $name
31
  * @type string $type
32
  * @type string $value
33
- * @type string $valtochk
34
  * @type string $class
35
  * @type string $required
 
36
  * }
37
  * @return string $str The field returned as a string.
38
  */
@@ -41,7 +44,7 @@ class WP_Members_Forms {
41
  $name = $args['name'];
42
  $type = $args['type'];
43
  $value = maybe_unserialize( $args['value'] );
44
- $valtochk = $args['valtochk'];
45
  $class = ( isset( $args['class'] ) ) ? $args['class'] : 'textbox';
46
  $required = ( isset( $args['required'] ) ) ? $args['required'] : false;
47
  $delimiter = ( isset( $args['delimiter'] ) ) ? $args['delimiter'] : '|';
@@ -62,7 +65,7 @@ class WP_Members_Forms {
62
 
63
  case "checkbox":
64
  $class = ( $class == 'textbox' ) ? "checkbox" : $class;
65
- $str = "<input name=\"$name\" type=\"$type\" id=\"$name\" value=\"$value\"" . checked( $value, $valtochk, false ) . ( ( $required ) ? " required " : "" ) . " />";
66
  break;
67
 
68
  case "text":
@@ -85,7 +88,7 @@ class WP_Members_Forms {
85
  break;
86
 
87
  case "option":
88
- $str = "<option value=\"$value\" " . selected( $value, $valtochk, false ) . " >$name</option>";
89
  break;
90
 
91
  case "select":
@@ -98,12 +101,16 @@ class WP_Members_Forms {
98
  $pieces = explode( '|', $option );
99
  if ( 'multiselect' == $type ) {
100
  $chk = '';
101
- $values = ( empty( $valtochk ) ) ? array() : ( is_array( $valtochk ) ? $valtochk : explode( $delimiter, $valtochk ) );
102
  } else {
103
- $chk = $valtochk;
104
  $values = array();
105
  }
106
- $chk = ( ( isset( $pieces[2] ) && '' == $valtochk ) || in_array( $pieces[1], $values ) ) ? $pieces[1] : $chk;
 
 
 
 
107
  $str = $str . "<option value=\"$pieces[1]\"" . selected( $pieces[1], $chk, false ) . ">" . __( $pieces[0], 'wp-members' ) . "</option>\n";
108
  }
109
  $str = $str . "</select>";
@@ -114,13 +121,13 @@ class WP_Members_Forms {
114
  $str = '';
115
  foreach ( $value as $option ) {
116
  $pieces = explode( '|', $option );
117
- $values = ( empty( $valtochk ) ) ? array() : ( is_array( $valtochk ) ? $valtochk : explode( $delimiter, $valtochk ) );
118
- $chk = ( isset( $pieces[2] ) && '' == $valtochk ) ? $pieces[1] : '';
119
  $str = $str . $this->create_form_field( array(
120
- 'name' => $name . '[]',
121
- 'type' => 'checkbox',
122
- 'value' => $pieces[1],
123
- 'valtochk' => ( in_array( $pieces[1], $values ) ) ? $pieces[1] : $chk,
124
  ) ) . "&nbsp;" . $pieces[0] . "<br />\n";
125
  }
126
  break;
@@ -132,7 +139,7 @@ class WP_Members_Forms {
132
  foreach ( $value as $option ) {
133
  $pieces = explode( '|', $option );
134
  $id = $name . '_' . $num;
135
- $str = $str . "<input type=\"radio\" name=\"$name\" id=\"$id\" value=\"$pieces[1]\"" . checked( $pieces[1], $valtochk, false ) . ( ( $required ) ? " required " : " " ) . "> " . __( $pieces[0], 'wp-members' ) . "<br />\n";
136
  $num++;
137
  }
138
  break;
25
  * Creates various form fields and returns them as a string.
26
  *
27
  * @since 3.1.0
28
+ * @since 3.1.1 Added $delimiter.
29
+ * @since 3.1.2 Changed $valtochk to $compare
30
  *
31
  * @param array $args {
32
  * @type string $name
33
  * @type string $type
34
  * @type string $value
35
+ * @type string $compare
36
  * @type string $class
37
  * @type string $required
38
+ * @type string $delimiter
39
  * }
40
  * @return string $str The field returned as a string.
41
  */
44
  $name = $args['name'];
45
  $type = $args['type'];
46
  $value = maybe_unserialize( $args['value'] );
47
+ $compare = $args['compare'];
48
  $class = ( isset( $args['class'] ) ) ? $args['class'] : 'textbox';
49
  $required = ( isset( $args['required'] ) ) ? $args['required'] : false;
50
  $delimiter = ( isset( $args['delimiter'] ) ) ? $args['delimiter'] : '|';
65
 
66
  case "checkbox":
67
  $class = ( $class == 'textbox' ) ? "checkbox" : $class;
68
+ $str = "<input name=\"$name\" type=\"$type\" id=\"$name\" value=\"$value\"" . checked( $value, $compare, false ) . ( ( $required ) ? " required " : "" ) . " />";
69
  break;
70
 
71
  case "text":
88
  break;
89
 
90
  case "option":
91
+ $str = "<option value=\"$value\" " . selected( $value, $compare, false ) . " >$name</option>";
92
  break;
93
 
94
  case "select":
101
  $pieces = explode( '|', $option );
102
  if ( 'multiselect' == $type ) {
103
  $chk = '';
104
+ $values = ( empty( $compare ) ) ? array() : ( is_array( $compare ) ? $compare : explode( $delimiter, $compare ) );
105
  } else {
106
+ $chk = $compare;
107
  $values = array();
108
  }
109
+ if ( isset( $pieces[1] ) && '' != $pieces[1] ) {
110
+ $chk = ( ( isset( $pieces[2] ) && '' == $compare ) || in_array( $pieces[1], $values ) ) ? $pieces[1] : $chk;
111
+ } else {
112
+ $chk = 'not selected';
113
+ }
114
  $str = $str . "<option value=\"$pieces[1]\"" . selected( $pieces[1], $chk, false ) . ">" . __( $pieces[0], 'wp-members' ) . "</option>\n";
115
  }
116
  $str = $str . "</select>";
121
  $str = '';
122
  foreach ( $value as $option ) {
123
  $pieces = explode( '|', $option );
124
+ $values = ( empty( $compare ) ) ? array() : ( is_array( $compare ) ? $compare : explode( $delimiter, $compare ) );
125
+ $chk = ( isset( $pieces[2] ) && '' == $compare ) ? $pieces[1] : '';
126
  $str = $str . $this->create_form_field( array(
127
+ 'name' => $name . '[]',
128
+ 'type' => 'checkbox',
129
+ 'value' => $pieces[1],
130
+ 'compare' => ( in_array( $pieces[1], $values ) ) ? $pieces[1] : $chk,
131
  ) ) . "&nbsp;" . $pieces[0] . "<br />\n";
132
  }
133
  break;
139
  foreach ( $value as $option ) {
140
  $pieces = explode( '|', $option );
141
  $id = $name . '_' . $num;
142
+ $str = $str . "<input type=\"radio\" name=\"$name\" id=\"$id\" value=\"$pieces[1]\"" . checked( $pieces[1], $compare, false ) . ( ( $required ) ? " required " : " " ) . "> " . __( $pieces[0], 'wp-members' ) . "<br />\n";
143
  $num++;
144
  }
145
  break;
inc/class-wp-members.php CHANGED
@@ -84,18 +84,24 @@ class WP_Members {
84
 
85
  /**
86
  * Load the shortcode functions.
 
 
 
 
 
87
  */
88
  require_once( WPMEM_PATH . 'inc/shortcodes.php' );
89
 
90
  add_shortcode( 'wp-members', 'wpmem_shortcode' );
91
- add_shortcode( 'wpmem_field', 'wpmem_shortcode' );
92
  add_shortcode( 'wpmem_logged_in', 'wpmem_sc_logged_in' );
93
  add_shortcode( 'wpmem_logged_out', 'wpmem_sc_logged_out' );
94
- add_shortcode( 'wpmem_logout', 'wpmem_shortcode' );
95
  add_shortcode( 'wpmem_form', 'wpmem_sc_forms' );
96
  add_shortcode( 'wpmem_show_count', 'wpmem_sc_user_count' );
97
  add_shortcode( 'wpmem_profile', 'wpmem_sc_user_profile' );
98
  add_shortcode( 'wpmem_loginout', 'wpmem_sc_loginout' );
 
99
 
100
  /**
101
  * Fires after shortcodes load (for adding additional custom shortcodes).
@@ -386,7 +392,7 @@ class WP_Members {
386
 
387
  $content = ( is_single() || is_page() ) ? $content : wpmem_do_excerpt( $content );
388
 
389
- if ( ( ! wpmem_test_shortcode( $content, 'wp-members' ) ) ) {
390
 
391
  if ( $this->regchk == "captcha" ) {
392
  global $wpmem_captcha_err;
@@ -463,6 +469,7 @@ class WP_Members {
463
  * Filter the value of $content after wpmem_securify has run.
464
  *
465
  * @since 2.7.7
 
466
  *
467
  * @param string $content The content after securify has run.
468
  */
@@ -504,7 +511,7 @@ class WP_Members {
504
  /**
505
  * Get excluded meta fields.
506
  *
507
- * @since Unknown
508
  *
509
  * @param string $tag A tag so we know where the function is being used.
510
  * @return array The excluded fields.
@@ -518,7 +525,7 @@ class WP_Members {
518
  * Filter the fields to be excluded when user is created/updated.
519
  *
520
  * @since 2.9.3
521
- * @since Unknown Moved to new method in WP_Members Class.
522
  *
523
  * @param array An array of the field meta names to exclude.
524
  * @param string $tag A tag so we know where the function is being used.
84
 
85
  /**
86
  * Load the shortcode functions.
87
+ *
88
+ * @since 3.0.0
89
+ * @since 3.0.7 Added wpmem_show_count.
90
+ * @since 3.1.0 Added wpmem_profile.
91
+ * @since 3.1.1 Added wpmem_loginout.
92
  */
93
  require_once( WPMEM_PATH . 'inc/shortcodes.php' );
94
 
95
  add_shortcode( 'wp-members', 'wpmem_shortcode' );
96
+ add_shortcode( 'wpmem_field', 'wpmem_sc_fields' );
97
  add_shortcode( 'wpmem_logged_in', 'wpmem_sc_logged_in' );
98
  add_shortcode( 'wpmem_logged_out', 'wpmem_sc_logged_out' );
99
+ add_shortcode( 'wpmem_logout', 'wpmem_sc_logout' );
100
  add_shortcode( 'wpmem_form', 'wpmem_sc_forms' );
101
  add_shortcode( 'wpmem_show_count', 'wpmem_sc_user_count' );
102
  add_shortcode( 'wpmem_profile', 'wpmem_sc_user_profile' );
103
  add_shortcode( 'wpmem_loginout', 'wpmem_sc_loginout' );
104
+ add_shortcode( 'wpmem_tos', 'wpmem_sc_tos' );
105
 
106
  /**
107
  * Fires after shortcodes load (for adding additional custom shortcodes).
392
 
393
  $content = ( is_single() || is_page() ) ? $content : wpmem_do_excerpt( $content );
394
 
395
+ if ( ( ! has_shortcode( $content, 'wp-members' ) ) ) {
396
 
397
  if ( $this->regchk == "captcha" ) {
398
  global $wpmem_captcha_err;
469
  * Filter the value of $content after wpmem_securify has run.
470
  *
471
  * @since 2.7.7
472
+ * @since 3.0.0 Moved to new method in WP_Members Class.
473
  *
474
  * @param string $content The content after securify has run.
475
  */
511
  /**
512
  * Get excluded meta fields.
513
  *
514
+ * @since 3.0.0
515
  *
516
  * @param string $tag A tag so we know where the function is being used.
517
  * @return array The excluded fields.
525
  * Filter the fields to be excluded when user is created/updated.
526
  *
527
  * @since 2.9.3
528
+ * @since 3.0.0 Moved to new method in WP_Members Class.
529
  *
530
  * @param array An array of the field meta names to exclude.
531
  * @param string $tag A tag so we know where the function is being used.
inc/core.php CHANGED
@@ -76,6 +76,7 @@ if ( ! function_exists( 'wpmem_block' ) ):
76
  * @return bool $block true if content is blocked, false otherwise.
77
  */
78
  function wpmem_block() {
 
79
  global $wpmem;
80
  return $wpmem->is_blocked();
81
  }
@@ -222,33 +223,6 @@ function wpmem_logout( $redirect_to = null ) {
222
  endif;
223
 
224
 
225
- if ( ! function_exists( 'wpmem_login_status' ) ):
226
- /**
227
- * Returns or displays the user's login status.
228
- *
229
- * @since 2.0.0
230
- *
231
- * @param boolean $echo Determines whether function should print result or not (default: true).
232
- * @return string $status The user status string produced by wpmem_inc_memberlinks().
233
- */
234
- function wpmem_login_status( $echo = true ) {
235
-
236
- /**
237
- * Load the dialogs functions.
238
- */
239
- require_once( WPMEM_PATH . 'inc/dialogs.php' );
240
-
241
- if ( is_user_logged_in() ) {
242
- $status = wpmem_inc_memberlinks( 'status' );
243
- if ( $echo ) {
244
- echo $status;
245
- }
246
- return $status;
247
- }
248
- }
249
- endif;
250
-
251
-
252
  if ( ! function_exists( 'wpmem_inc_sidebar' ) ):
253
  /**
254
  * Displays the sidebar.
@@ -256,10 +230,10 @@ if ( ! function_exists( 'wpmem_inc_sidebar' ) ):
256
  * This function is a wrapper for wpmem_do_sidebar().
257
  *
258
  * @since 2.0.0
259
- *
260
- * @todo This function may be deprecated.
261
  */
262
  function wpmem_inc_sidebar() {
 
263
  /**
264
  * Load the sidebar functions.
265
  */
@@ -575,7 +549,7 @@ function wpmem_wplogin_stylesheet() {
575
  */
576
  function wpmem_securify_comments( $open ) {
577
 
578
- $open = ( ! is_user_logged_in() && wpmem_block() ) ? false : $open;
579
 
580
  /**
581
  * Filters whether comments are open or not.
76
  * @return bool $block true if content is blocked, false otherwise.
77
  */
78
  function wpmem_block() {
79
+ wpmem_write_log( "wpmem_block() is deprecated as of WP-Members 3.1.1, use wpmem_is_blocked() instead" );
80
  global $wpmem;
81
  return $wpmem->is_blocked();
82
  }
223
  endif;
224
 
225
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
226
  if ( ! function_exists( 'wpmem_inc_sidebar' ) ):
227
  /**
228
  * Displays the sidebar.
230
  * This function is a wrapper for wpmem_do_sidebar().
231
  *
232
  * @since 2.0.0
233
+ * @deprecated Unknown
 
234
  */
235
  function wpmem_inc_sidebar() {
236
+ wpmem_write_log( "WP-Members function wpmem_inc_sidebar() is deprecated. No alternative function exists" );
237
  /**
238
  * Load the sidebar functions.
239
  */
549
  */
550
  function wpmem_securify_comments( $open ) {
551
 
552
+ $open = ( ! is_user_logged_in() && wpmem_is_blocked() ) ? false : $open;
553
 
554
  /**
555
  * Filters whether comments are open or not.
inc/dialogs.php CHANGED
@@ -143,6 +143,7 @@ function wpmem_inc_regmessage( $toggle, $msg = '' ) {
143
  * Filter the message array
144
  *
145
  * @since 2.9.2
 
146
  *
147
  * @param array $defaults An array of the defaults.
148
  * @param string $toggle The toggle that we are on, if any.
143
  * Filter the message array
144
  *
145
  * @since 2.9.2
146
+ * @since 3.1.1 added $dialogs parameter.
147
  *
148
  * @param array $defaults An array of the defaults.
149
  * @param string $toggle The toggle that we are on, if any.
inc/email.php CHANGED
@@ -239,9 +239,8 @@ function wpmem_inc_regemail( $user_id, $password, $toggle, $wpmem_fields = null,
239
 
240
  // Add custom field shortcodes.
241
  foreach ( $wpmem_fields as $field ) {
242
- $key = '[' . $field[2] . ']';
243
  $val = ( is_array( $field_data ) && 'y' == $field[4] ) ? $field_data[ $field[2] ] : get_user_meta( $user_id, $field[2], true );
244
- $shortcodes[ $key ] = $val;
245
  }
246
 
247
  /**
@@ -260,7 +259,7 @@ function wpmem_inc_regemail( $user_id, $password, $toggle, $wpmem_fields = null,
260
  // Shortcodes.
261
  $shortcd[] = '[' . $key . ']';
262
  // Replacement values.
263
- $replace[] = $val;
264
  }
265
 
266
  // Do replacements for subject, body, and footer shortcodes.
@@ -426,8 +425,7 @@ function wpmem_notify_admin( $user_id, $wpmem_fields, $field_data = null ) {
426
  );
427
 
428
  // Add custom field shortcodes.
429
- foreach ( $wpmem_fields as $field ) {
430
- $key = '[' . $field[2] . ']';
431
  $val = ( is_array( $field_data ) && 'y' == $field[4] ) ? $field_data[ $field[2] ] : get_user_meta( $user_id, $field[2], true );
432
  $shortcodes[ $key ] = $val;
433
  }
239
 
240
  // Add custom field shortcodes.
241
  foreach ( $wpmem_fields as $field ) {
 
242
  $val = ( is_array( $field_data ) && 'y' == $field[4] ) ? $field_data[ $field[2] ] : get_user_meta( $user_id, $field[2], true );
243
+ $shortcodes[ $field[2] ] = $val;
244
  }
245
 
246
  /**
259
  // Shortcodes.
260
  $shortcd[] = '[' . $key . ']';
261
  // Replacement values.
262
+ $replace[] = ( 'password' == $key ) ? $password : $val;
263
  }
264
 
265
  // Do replacements for subject, body, and footer shortcodes.
425
  );
426
 
427
  // Add custom field shortcodes.
428
+ foreach ( $wpmem_fields as $field ) {
 
429
  $val = ( is_array( $field_data ) && 'y' == $field[4] ) ? $field_data[ $field[2] ] : get_user_meta( $user_id, $field[2], true );
430
  $shortcodes[ $key ] = $val;
431
  }
inc/forms.php CHANGED
@@ -549,11 +549,11 @@ if ( ! function_exists( 'wpmem_inc_registration' ) ):
549
  * @global object $wpmem The WP_Members object.
550
  * @global string $wpmem_regchk Used to determine if the form is in an error state.
551
  * @global array $userdata Used to get the user's registration data if they are logged in (user profile edit).
552
- * @param string $toggle (optional) Toggles between new registration ('new') and user profile edit ('edit').
553
  * @param string $heading (optional) The heading text for the form, null (default) for new registration.
554
  * @return string $form The HTML for the entire form as a string.
555
  */
556
- function wpmem_inc_registration( $toggle = 'new', $heading = '', $redirect_to = null ) {
557
 
558
  global $wpmem, $wpmem_regchk, $userdata;
559
 
@@ -609,16 +609,16 @@ function wpmem_inc_registration( $toggle = 'new', $heading = '', $redirect_to =
609
  *
610
  * @since 2.9.0
611
  *
612
- * @param array An array of arguments to merge with defaults. Default null.
613
- * @param string $toggle Toggle new registration or profile update. new|edit.
614
  */
615
- $args = apply_filters( 'wpmem_register_form_args', '', $toggle );
616
 
617
  // Merge $args with defaults.
618
  $args = wp_parse_args( $args, $defaults );
619
 
620
  // Username is editable if new reg, otherwise user profile is not.
621
- if ( $toggle == 'edit' ) {
622
  // This is the User Profile edit - username is not editable.
623
  $val = $userdata->user_login;
624
  $label = '<label for="user_login" class="text">' . $wpmem->get_text( 'profile_username' ) . '</label>';
@@ -629,12 +629,11 @@ function wpmem_inc_registration( $toggle = 'new', $heading = '', $redirect_to =
629
  // This is a new registration.
630
  $val = ( isset( $_POST['user_login'] ) ) ? stripslashes( $_POST['user_login'] ) : '';
631
  $label = '<label for="user_login" class="text">' . $wpmem->get_text( 'register_username' ) . $args['req_mark'] . '</label>';
632
- //$input = wpmem_create_formfield( 'log', 'text', $val, '', 'username' );
633
  $input = $wpmem->forms->create_form_field( array(
634
  'name' => 'user_login',
635
  'type' => 'text',
636
  'value' => $val,
637
- 'valtochk' => '',
638
  'required' => true,
639
  ) );
640
 
@@ -667,10 +666,10 @@ function wpmem_inc_registration( $toggle = 'new', $heading = '', $redirect_to =
667
  *
668
  * @since 2.9.0
669
  *
670
- * @param array The array of form fields.
671
- * @param string $toggle Toggle new registration or profile update. new|edit.
672
  */
673
- $wpmem_fields = apply_filters( 'wpmem_register_fields_arr', $wpmem->fields, $toggle );
674
 
675
  $hidden = '';
676
 
@@ -682,10 +681,10 @@ function wpmem_inc_registration( $toggle = 'new', $heading = '', $redirect_to =
682
 
683
  // Skips user selected passwords for profile update.
684
  $pass_arr = array( 'password', 'confirm_password', 'password_confirm' );
685
- $do_row = ( $toggle == 'edit' && in_array( $field[2], $pass_arr ) ) ? false : true;
686
 
687
  // Skips tos, makes tos field hidden on user edit page, unless they haven't got a value for tos.
688
- if ( $field[2] == 'tos' && $toggle == 'edit' && ( get_user_meta( $userdata->ID, 'tos', true ) ) ) {
689
  $do_row = false;
690
  $hidden_tos = wpmem_create_formfield( $field[2], 'hidden', get_user_meta( $userdata->ID, 'tos', true ) );
691
  }
@@ -697,7 +696,7 @@ function wpmem_inc_registration( $toggle = 'new', $heading = '', $redirect_to =
697
  'name' => $field[2],
698
  'type' => $field[3],
699
  'value' => $val,
700
- 'valtochk' => $valtochk,
701
  //'class' => ( $class ) ? $class : 'textbox',
702
  'required' => ( 'y' == $field[5] ) ? true : false,
703
  ) );
@@ -718,7 +717,7 @@ function wpmem_inc_registration( $toggle = 'new', $heading = '', $redirect_to =
718
  }
719
 
720
  // Gets the field value for both edit profile and submitted reg w/ error.
721
- if ( ( $toggle == 'edit' ) && ( $wpmem_regchk != 'updaterr' ) ) {
722
 
723
  switch ( $field[2] ) {
724
  case( 'description' ):
@@ -763,7 +762,7 @@ function wpmem_inc_registration( $toggle = 'new', $heading = '', $redirect_to =
763
 
764
  // Determine if TOS is a WP page or not.
765
  $tos_content = stripslashes( get_option( 'wpmembers_tos' ) );
766
- if ( ( wpmem_test_shortcode( $tos_content, 'wp-members' ) ) ) {
767
  $link = do_shortcode( $tos_content );
768
  $tos_pop = '<a href="' . $link . '" target="_blank">';
769
  } else {
@@ -775,10 +774,10 @@ function wpmem_inc_registration( $toggle = 'new', $heading = '', $redirect_to =
775
  *
776
  * @since 2.7.5
777
  *
778
- * @param string The link text.
779
- * @param string $toggle Toggle new registration or profile update. new|edit.
780
  */
781
- $input.= apply_filters( 'wpmem_tos_link_txt', sprintf( $wpmem->get_text( 'register_tos' ), $tos_pop, '</a>' ), $toggle );
782
 
783
  // In previous versions, the div class would end up being the same as the row before.
784
  $field_before = ( $args['wrap_inputs'] ) ? '<div class="div_text">' : '';
@@ -791,7 +790,7 @@ function wpmem_inc_registration( $toggle = 'new', $heading = '', $redirect_to =
791
  $valtochk = $val;
792
  $val = $field[7];
793
  // if it should it be checked by default (& only if form not submitted), then override above...
794
- if ( $field[8] == 'y' && ( ! $_POST && $toggle != 'edit' ) ) { $val = $valtochk = $field[7]; }
795
  }
796
 
797
  // For dropdown select.
@@ -802,7 +801,7 @@ function wpmem_inc_registration( $toggle = 'new', $heading = '', $redirect_to =
802
 
803
  if ( ! isset( $valtochk ) ) { $valtochk = ''; }
804
 
805
- if ( 'edit' == $toggle && ( 'file' == $field[3] || 'image' == $field[3] ) ) {
806
 
807
  $attachment_url = wp_get_attachment_url( $val );
808
  $empty_file = '<span class="description">' . __( 'None' ) . '</span>';
@@ -823,7 +822,7 @@ function wpmem_inc_registration( $toggle = 'new', $heading = '', $redirect_to =
823
  'name' => $field[2],
824
  'type' => $field[3],
825
  'value' => $val,
826
- 'valtochk' => $valtochk,
827
  //'class' => ( $class ) ? $class : 'textbox',
828
  'required' => ( 'y' == $field[5] ) ? true : false,
829
  );
@@ -868,7 +867,7 @@ function wpmem_inc_registration( $toggle = 'new', $heading = '', $redirect_to =
868
  }
869
 
870
  // If captcha is Really Simple CAPTCHA.
871
- if ( $wpmem->captcha == 2 && $toggle != 'edit' ) {
872
  $row = wpmem_build_rs_captcha();
873
  $rows['captcha'] = array(
874
  'order' => '',
@@ -911,9 +910,9 @@ function wpmem_inc_registration( $toggle = 'new', $heading = '', $redirect_to =
911
  * @type string field_after Closing wrapper tag around the input tag.
912
  * @type string row_after Closing wrapper tag around the row.
913
  * }
914
- * @param string $toggle Toggle new registration or profile update. new|edit.
915
  */
916
- $rows = apply_filters( 'wpmem_register_form_rows', $rows, $toggle );
917
 
918
  // Put the rows from the array into $form.
919
  $form = ''; $enctype = '';
@@ -926,7 +925,7 @@ function wpmem_inc_registration( $toggle = 'new', $heading = '', $redirect_to =
926
  }
927
 
928
  // Do recaptcha if enabled.
929
- if ( ( $wpmem->captcha == 1 || $wpmem->captcha == 3 ) && $toggle != 'edit' ) { // don't show on edit page!
930
 
931
  // Get the captcha options.
932
  $wpmem_captcha = get_option( 'wpmembers_captcha' );
@@ -942,14 +941,14 @@ function wpmem_inc_registration( $toggle = 'new', $heading = '', $redirect_to =
942
  *
943
  * @since 2.9.0
944
  *
945
- * @param string The HTML for the entire row (includes HTML tags plus reCAPTCHA).
946
- * @param string $toggle Toggle new registration or profile update. new|edit.
947
  */
948
- $form.= apply_filters( 'wpmem_register_captcha_row', $args['row_before'] . $row . $args['row_after'], $toggle );
949
  }
950
 
951
  // Create hidden fields.
952
- $var = ( $toggle == 'edit' ) ? 'update' : 'register';
953
  $redirect_to = ( isset( $_REQUEST['redirect_to'] ) ) ? esc_url( $_REQUEST['redirect_to'] ) : ( ( $redirect_to ) ? $redirect_to : get_permalink() );
954
  $hidden .= '<input name="a" type="hidden" value="' . $var . '" />' . $args['n'];
955
  $hidden .= '<input name="wpmem_reg_page" type="hidden" value="' . get_permalink() . '" />' . $args['n'];
@@ -964,15 +963,15 @@ function wpmem_inc_registration( $toggle = 'new', $heading = '', $redirect_to =
964
  * @since 2.9.0
965
  *
966
  * @param string $hidden The generated HTML of hidden fields.
967
- * @param string $toggle Toggle new registration or profile update. new|edit.
968
  */
969
- $hidden = apply_filters( 'wpmem_register_hidden_fields', $hidden, $toggle );
970
 
971
  // Add the hidden fields to the form.
972
  $form.= $hidden;
973
 
974
  // Create buttons and wrapper.
975
- $button_text = ( $toggle == 'edit' ) ? $args['submit_update'] : $args['submit_register'];
976
  $buttons = ( $args['show_clear_form'] ) ? '<input name="reset" type="reset" value="' . $args['clear_form'] . '" class="' . $args['button_class'] . '" /> ' . $args['n'] : '';
977
  $buttons.= '<input name="submit" type="submit" value="' . $button_text . '" class="' . $args['button_class'] . '" />' . $args['n'];
978
 
@@ -984,9 +983,9 @@ function wpmem_inc_registration( $toggle = 'new', $heading = '', $redirect_to =
984
  * @since 2.9.0
985
  *
986
  * @param string $buttons The generated HTML of the form buttons.
987
- * @param string $toggle Toggle new registration or profile update. new|edit.
988
  */
989
- $buttons = apply_filters( 'wpmem_register_form_buttons', $buttons, $toggle );
990
 
991
  // Add the buttons to the form.
992
  $form.= $args['buttons_before'] . $args['n'] . $buttons . $args['buttons_after'] . $args['n'];
@@ -1001,9 +1000,9 @@ function wpmem_inc_registration( $toggle = 'new', $heading = '', $redirect_to =
1001
  * @since 2.8.2
1002
  *
1003
  * @param string $str
1004
- * @param string $toggle Toggle new registration or profile update. new|edit.
1005
  */
1006
- $heading = ( !$heading ) ? apply_filters( 'wpmem_register_heading', $wpmem->get_text( 'register_heading' ), $toggle ) : $heading;
1007
  $form = $args['heading_before'] . $heading . $args['heading_after'] . $args['n'] . $form;
1008
 
1009
  // Apply fieldset wrapper.
@@ -1038,7 +1037,7 @@ function wpmem_inc_registration( $toggle = 'new', $heading = '', $redirect_to =
1038
  * @since 2.7.4
1039
  *
1040
  * @param string $form The HTML of the final generated form.
1041
- * @param string $toggle Toggle new registration or profile update. new|edit.
1042
  * @param array $rows {
1043
  * An array containing the form rows.
1044
  *
@@ -1057,7 +1056,7 @@ function wpmem_inc_registration( $toggle = 'new', $heading = '', $redirect_to =
1057
  * }
1058
  * @param string $hidden The HTML string of hidden fields
1059
  */
1060
- $form = apply_filters( 'wpmem_register_form', $form, $toggle, $rows, $hidden );
1061
 
1062
  /**
1063
  * Filter before the form.
@@ -1067,10 +1066,10 @@ function wpmem_inc_registration( $toggle = 'new', $heading = '', $redirect_to =
1067
  *
1068
  * @since 2.7.4
1069
  *
1070
- * @param string $str The HTML to add before the form. Default null.
1071
- * @param string $toggle Toggle new registration or profile update. new|edit.
1072
  */
1073
- $form = apply_filters( 'wpmem_register_form_before', '', $toggle ) . $form;
1074
 
1075
  // Return the generated form.
1076
  return $form;
549
  * @global object $wpmem The WP_Members object.
550
  * @global string $wpmem_regchk Used to determine if the form is in an error state.
551
  * @global array $userdata Used to get the user's registration data if they are logged in (user profile edit).
552
+ * @param string $tag (optional) Toggles between new registration ('new') and user profile edit ('edit').
553
  * @param string $heading (optional) The heading text for the form, null (default) for new registration.
554
  * @return string $form The HTML for the entire form as a string.
555
  */
556
+ function wpmem_inc_registration( $tag = 'new', $heading = '', $redirect_to = null ) {
557
 
558
  global $wpmem, $wpmem_regchk, $userdata;
559
 
609
  *
610
  * @since 2.9.0
611
  *
612
+ * @param array An array of arguments to merge with defaults. Default null.
613
+ * @param string $tag Toggle new registration or profile update. new|edit.
614
  */
615
+ $args = apply_filters( 'wpmem_register_form_args', '', $tag );
616
 
617
  // Merge $args with defaults.
618
  $args = wp_parse_args( $args, $defaults );
619
 
620
  // Username is editable if new reg, otherwise user profile is not.
621
+ if ( $tag == 'edit' ) {
622
  // This is the User Profile edit - username is not editable.
623
  $val = $userdata->user_login;
624
  $label = '<label for="user_login" class="text">' . $wpmem->get_text( 'profile_username' ) . '</label>';
629
  // This is a new registration.
630
  $val = ( isset( $_POST['user_login'] ) ) ? stripslashes( $_POST['user_login'] ) : '';
631
  $label = '<label for="user_login" class="text">' . $wpmem->get_text( 'register_username' ) . $args['req_mark'] . '</label>';
 
632
  $input = $wpmem->forms->create_form_field( array(
633
  'name' => 'user_login',
634
  'type' => 'text',
635
  'value' => $val,
636
+ 'compare' => '',
637
  'required' => true,
638
  ) );
639
 
666
  *
667
  * @since 2.9.0
668
  *
669
+ * @param array The array of form fields.
670
+ * @param string $tag Toggle new registration or profile update. new|edit.
671
  */
672
+ $wpmem_fields = apply_filters( 'wpmem_register_fields_arr', $wpmem->fields, $tag );
673
 
674
  $hidden = '';
675
 
681
 
682
  // Skips user selected passwords for profile update.
683
  $pass_arr = array( 'password', 'confirm_password', 'password_confirm' );
684
+ $do_row = ( $tag == 'edit' && in_array( $field[2], $pass_arr ) ) ? false : true;
685
 
686
  // Skips tos, makes tos field hidden on user edit page, unless they haven't got a value for tos.
687
+ if ( $field[2] == 'tos' && $tag == 'edit' && ( get_user_meta( $userdata->ID, 'tos', true ) ) ) {
688
  $do_row = false;
689
  $hidden_tos = wpmem_create_formfield( $field[2], 'hidden', get_user_meta( $userdata->ID, 'tos', true ) );
690
  }
696
  'name' => $field[2],
697
  'type' => $field[3],
698
  'value' => $val,
699
+ 'compare' => $valtochk,
700
  //'class' => ( $class ) ? $class : 'textbox',
701
  'required' => ( 'y' == $field[5] ) ? true : false,
702
  ) );
717
  }
718
 
719
  // Gets the field value for both edit profile and submitted reg w/ error.
720
+ if ( ( $tag == 'edit' ) && ( $wpmem_regchk != 'updaterr' ) ) {
721
 
722
  switch ( $field[2] ) {
723
  case( 'description' ):
762
 
763
  // Determine if TOS is a WP page or not.
764
  $tos_content = stripslashes( get_option( 'wpmembers_tos' ) );
765
+ if ( has_shortcode( $tos_content, 'wp-members' ) || has_shortcode( $tos_content, 'wpmem_tos' ) ) {
766
  $link = do_shortcode( $tos_content );
767
  $tos_pop = '<a href="' . $link . '" target="_blank">';
768
  } else {
774
  *
775
  * @since 2.7.5
776
  *
777
+ * @param string The link text.
778
+ * @param string $tag Toggle new registration or profile update. new|edit.
779
  */
780
+ $input.= apply_filters( 'wpmem_tos_link_txt', sprintf( $wpmem->get_text( 'register_tos' ), $tos_pop, '</a>' ), $tag );
781
 
782
  // In previous versions, the div class would end up being the same as the row before.
783
  $field_before = ( $args['wrap_inputs'] ) ? '<div class="div_text">' : '';
790
  $valtochk = $val;
791
  $val = $field[7];
792
  // if it should it be checked by default (& only if form not submitted), then override above...
793
+ if ( $field[8] == 'y' && ( ! $_POST && $tag != 'edit' ) ) { $val = $valtochk = $field[7]; }
794
  }
795
 
796
  // For dropdown select.
801
 
802
  if ( ! isset( $valtochk ) ) { $valtochk = ''; }
803
 
804
+ if ( 'edit' == $tag && ( 'file' == $field[3] || 'image' == $field[3] ) ) {
805
 
806
  $attachment_url = wp_get_attachment_url( $val );
807
  $empty_file = '<span class="description">' . __( 'None' ) . '</span>';
822
  'name' => $field[2],
823
  'type' => $field[3],
824
  'value' => $val,
825
+ 'compare' => $valtochk,
826
  //'class' => ( $class ) ? $class : 'textbox',
827
  'required' => ( 'y' == $field[5] ) ? true : false,
828
  );
867
  }
868
 
869
  // If captcha is Really Simple CAPTCHA.
870
+ if ( $wpmem->captcha == 2 && $tag != 'edit' ) {
871
  $row = wpmem_build_rs_captcha();
872
  $rows['captcha'] = array(
873
  'order' => '',
910
  * @type string field_after Closing wrapper tag around the input tag.
911
  * @type string row_after Closing wrapper tag around the row.
912
  * }
913
+ * @param string $tag Toggle new registration or profile update. new|edit.
914
  */
915
+ $rows = apply_filters( 'wpmem_register_form_rows', $rows, $tag );
916
 
917
  // Put the rows from the array into $form.
918
  $form = ''; $enctype = '';
925
  }
926
 
927
  // Do recaptcha if enabled.
928
+ if ( ( $wpmem->captcha == 1 || $wpmem->captcha == 3 ) && $tag != 'edit' ) { // don't show on edit page!
929
 
930
  // Get the captcha options.
931
  $wpmem_captcha = get_option( 'wpmembers_captcha' );
941
  *
942
  * @since 2.9.0
943
  *
944
+ * @param string The HTML for the entire row (includes HTML tags plus reCAPTCHA).
945
+ * @param string $tag Toggle new registration or profile update. new|edit.
946
  */
947
+ $form.= apply_filters( 'wpmem_register_captcha_row', $args['row_before'] . $row . $args['row_after'], $tag );
948
  }
949
 
950
  // Create hidden fields.
951
+ $var = ( $tag == 'edit' ) ? 'update' : 'register';
952
  $redirect_to = ( isset( $_REQUEST['redirect_to'] ) ) ? esc_url( $_REQUEST['redirect_to'] ) : ( ( $redirect_to ) ? $redirect_to : get_permalink() );
953
  $hidden .= '<input name="a" type="hidden" value="' . $var . '" />' . $args['n'];
954
  $hidden .= '<input name="wpmem_reg_page" type="hidden" value="' . get_permalink() . '" />' . $args['n'];
963
  * @since 2.9.0
964
  *
965
  * @param string $hidden The generated HTML of hidden fields.
966
+ * @param string $tag Toggle new registration or profile update. new|edit.
967
  */
968
+ $hidden = apply_filters( 'wpmem_register_hidden_fields', $hidden, $tag );
969
 
970
  // Add the hidden fields to the form.
971
  $form.= $hidden;
972
 
973
  // Create buttons and wrapper.
974
+ $button_text = ( $tag == 'edit' ) ? $args['submit_update'] : $args['submit_register'];
975
  $buttons = ( $args['show_clear_form'] ) ? '<input name="reset" type="reset" value="' . $args['clear_form'] . '" class="' . $args['button_class'] . '" /> ' . $args['n'] : '';
976
  $buttons.= '<input name="submit" type="submit" value="' . $button_text . '" class="' . $args['button_class'] . '" />' . $args['n'];
977
 
983
  * @since 2.9.0
984
  *
985
  * @param string $buttons The generated HTML of the form buttons.
986
+ * @param string $tag Toggle new registration or profile update. new|edit.
987
  */
988
+ $buttons = apply_filters( 'wpmem_register_form_buttons', $buttons, $tag );
989
 
990
  // Add the buttons to the form.
991
  $form.= $args['buttons_before'] . $args['n'] . $buttons . $args['buttons_after'] . $args['n'];
1000
  * @since 2.8.2
1001
  *
1002
  * @param string $str
1003
+ * @param string $tag Toggle new registration or profile update. new|edit.
1004
  */
1005
+ $heading = ( !$heading ) ? apply_filters( 'wpmem_register_heading', $wpmem->get_text( 'register_heading' ), $tag ) : $heading;
1006
  $form = $args['heading_before'] . $heading . $args['heading_after'] . $args['n'] . $form;
1007
 
1008
  // Apply fieldset wrapper.
1037
  * @since 2.7.4
1038
  *
1039
  * @param string $form The HTML of the final generated form.
1040
+ * @param string $tag Toggle new registration or profile update. new|edit.
1041
  * @param array $rows {
1042
  * An array containing the form rows.
1043
  *
1056
  * }
1057
  * @param string $hidden The HTML string of hidden fields
1058
  */
1059
+ $form = apply_filters( 'wpmem_register_form', $form, $tag, $rows, $hidden );
1060
 
1061
  /**
1062
  * Filter before the form.
1066
  *
1067
  * @since 2.7.4
1068
  *
1069
+ * @param string $str The HTML to add before the form. Default null.
1070
+ * @param string $tag Toggle new registration or profile update. new|edit.
1071
  */
1072
+ $form = apply_filters( 'wpmem_register_form_before', '', $tag ) . $form;
1073
 
1074
  // Return the generated form.
1075
  return $form;
inc/register.php CHANGED
@@ -28,13 +28,13 @@ if ( ! function_exists( 'wpmem_registration' ) ):
28
  *
29
  * @since 2.2.1
30
  *
31
- * @param string $toggle toggles the function between 'register' and 'update'.
32
  * @global int $user_ID
33
  * @global string $wpmem_themsg
34
  * @global array $userdata
35
  * @return string $wpmem_themsg|success|editsuccess
36
  */
37
- function wpmem_registration( $toggle ) {
38
 
39
  // Get the globals.
40
  global $user_ID, $wpmem, $wpmem_themsg, $userdata;
@@ -48,13 +48,16 @@ function wpmem_registration( $toggle ) {
48
  }
49
 
50
  // Is this a registration or a user profile update?
51
- if ( $toggle == 'register' ) {
52
  $fields['username'] = ( isset( $_POST['user_login'] ) ) ? sanitize_user( $_POST['user_login'] ) : '';
53
  }
54
 
55
  // Add the user email to the $fields array for _data hooks.
56
  $fields['user_email'] = ( isset( $_POST['user_email'] ) ) ? $_POST['user_email'] : '';
57
 
 
 
 
58
  // Build the $fields array from $_POST data.
59
  $wpmem_fields = $wpmem->fields; // get_option( 'wpmembers_fields' );
60
  foreach ( $wpmem_fields as $meta ) {
@@ -106,12 +109,12 @@ function wpmem_registration( $toggle ) {
106
 
107
  foreach ( $wpmem_fields_rev as $meta ) {
108
  $pass_arr = array( 'password', 'confirm_password', 'password_confirm' );
109
- $pass_chk = ( $toggle == 'update' && in_array( $meta[2], $pass_arr ) ) ? true : false;
110
  // Validation if the field is required.
111
  if ( $meta[5] == 'y' && $pass_chk == false ) {
112
  if ( 'file' == $meta[3] || 'image' == $meta[3] ) {
113
  // If this is a new registration.
114
- if ( 'register' == $toggle ) {
115
  // If the required field is a file type.
116
  if ( empty( $_FILES[ $meta[2] ]['name'] ) ) {
117
  $wpmem_themsg = sprintf( $wpmem->get_text( 'reg_empty_field' ), __( $meta[1], 'wp-members' ) );
@@ -126,7 +129,7 @@ function wpmem_registration( $toggle ) {
126
  }
127
  }
128
 
129
- switch ( $toggle ) {
130
 
131
  case "register":
132
 
@@ -280,7 +283,7 @@ function wpmem_registration( $toggle ) {
280
  * @since 2.8.2
281
  *
282
  * @param array $fields An array of the registration field data.
283
- * @param string $toggle A switch to indicate the action (new|edit).
284
  */
285
  $fields = apply_filters( 'wpmem_register_data', $fields, 'new' );
286
 
28
  *
29
  * @since 2.2.1
30
  *
31
+ * @param string $tag Identifies 'register' or 'update'.
32
  * @global int $user_ID
33
  * @global string $wpmem_themsg
34
  * @global array $userdata
35
  * @return string $wpmem_themsg|success|editsuccess
36
  */
37
+ function wpmem_registration( $tag ) {
38
 
39
  // Get the globals.
40
  global $user_ID, $wpmem, $wpmem_themsg, $userdata;
48
  }
49
 
50
  // Is this a registration or a user profile update?
51
+ if ( $tag == 'register' ) {
52
  $fields['username'] = ( isset( $_POST['user_login'] ) ) ? sanitize_user( $_POST['user_login'] ) : '';
53
  }
54
 
55
  // Add the user email to the $fields array for _data hooks.
56
  $fields['user_email'] = ( isset( $_POST['user_email'] ) ) ? $_POST['user_email'] : '';
57
 
58
+ /** This filter defined in inc/class-wp-members-forms.php */
59
+ $wpmem_fields = apply_filters( 'wpmem_register_fields_arr', $wpmem->fields, $tag );
60
+
61
  // Build the $fields array from $_POST data.
62
  $wpmem_fields = $wpmem->fields; // get_option( 'wpmembers_fields' );
63
  foreach ( $wpmem_fields as $meta ) {
109
 
110
  foreach ( $wpmem_fields_rev as $meta ) {
111
  $pass_arr = array( 'password', 'confirm_password', 'password_confirm' );
112
+ $pass_chk = ( $tag == 'update' && in_array( $meta[2], $pass_arr ) ) ? true : false;
113
  // Validation if the field is required.
114
  if ( $meta[5] == 'y' && $pass_chk == false ) {
115
  if ( 'file' == $meta[3] || 'image' == $meta[3] ) {
116
  // If this is a new registration.
117
+ if ( 'register' == $tag ) {
118
  // If the required field is a file type.
119
  if ( empty( $_FILES[ $meta[2] ]['name'] ) ) {
120
  $wpmem_themsg = sprintf( $wpmem->get_text( 'reg_empty_field' ), __( $meta[1], 'wp-members' ) );
129
  }
130
  }
131
 
132
+ switch ( $tag ) {
133
 
134
  case "register":
135
 
283
  * @since 2.8.2
284
  *
285
  * @param array $fields An array of the registration field data.
286
+ * @param string $tag A switch to indicate the action (new|edit).
287
  */
288
  $fields = apply_filters( 'wpmem_register_data', $fields, 'new' );
289
 
inc/shortcodes.php CHANGED
@@ -21,6 +21,10 @@
21
  * - wpmem_shortcode
22
  * - wpmem_do_sc_pages
23
  * - wpmem_sc_user_count
 
 
 
 
24
  */
25
 
26
 
@@ -264,6 +268,7 @@ if ( ! function_exists( 'wpmem_shortcode' ) ):
264
  * and fields when the wpmem_field tags are used.
265
  *
266
  * @since 2.4.0
 
267
  *
268
  * @global object $wpmem The WP_Members object.
269
  *
@@ -273,6 +278,8 @@ if ( ! function_exists( 'wpmem_shortcode' ) ):
273
  * @return string Returns the result of wpmem_do_sc_pages|wpmem_list_users|wpmem_sc_expmessage|$content.
274
  */
275
  function wpmem_shortcode( $attr, $content = null, $tag = 'wp-members' ) {
 
 
276
 
277
  global $wpmem;
278
 
@@ -300,7 +307,7 @@ function wpmem_shortcode( $attr, $content = null, $tag = 'wp-members' ) {
300
  } elseif ( $atts['page'] == 'tos' ) {
301
  return $atts['url'];
302
  } else {
303
- $content = do_shortcode( wpmem_do_sc_pages( $atts['page'], $atts['redirect_to'] ) );
304
  }
305
 
306
  // Resolve any texturize issues.
@@ -315,36 +322,12 @@ function wpmem_shortcode( $attr, $content = null, $tag = 'wp-members' ) {
315
 
316
  // Handles the 'status' attribute.
317
  if ( ( $atts['status'] ) || $tag == 'wpmem_logged_in' ) {
318
- return do_shortcode( wpmem_sc_logged_in( $atts, $content, $tag ) );
319
  }
320
 
321
  // Handles the 'field' attribute.
322
  if ( $atts['field'] || $tag == 'wpmem_field' ) {
323
- if ( $atts['id'] ) {
324
- // We are getting some other user.
325
- if ( $atts['id'] == 'get' ) {
326
- $the_user_ID = ( isset( $_GET['uid'] ) ) ? $_GET['uid'] : '';
327
- } else {
328
- $the_user_ID = $atts['id'];
329
- }
330
- } else {
331
- // Get the current user.
332
- $the_user_ID = get_current_user_id();
333
- }
334
- $user_info = get_userdata( $the_user_ID );
335
-
336
- if ( $atts['underscores'] == 'off' && $user_info ) {
337
- $user_info->{$atts['field']} = str_replace( '_', ' ', $user_info->{$atts['field']} );
338
- }
339
-
340
- return ( $user_info ) ? htmlspecialchars( $user_info->{$atts['field']} ) . do_shortcode( $content ) : do_shortcode( $content );
341
- }
342
-
343
- // Logout link shortcode.
344
- if ( is_user_logged_in() && $tag == 'wpmem_logout' ) {
345
- $link = ( $atts['url'] ) ? add_query_arg( 'a', 'logout', $atts['url'] ) : add_query_arg( 'a', 'logout' );
346
- $text = ( $content ) ? $content : __( 'Click here to log out.', 'wp-members' );
347
- return do_shortcode( "<a href=\"$link\">$text</a>" );
348
  }
349
 
350
  }
@@ -367,9 +350,14 @@ if ( ! function_exists( 'wpmem_do_sc_pages' ) ):
367
  *
368
  * @param string $page
369
  * @param string $redirect_to
 
370
  * @return string $content
371
  */
372
- function wpmem_do_sc_pages( $page, $redirect_to = null ) {
 
 
 
 
373
 
374
  global $wpmem, $wpmem_themsg, $post;
375
  include_once( WPMEM_PATH . 'inc/dialogs.php' );
@@ -391,7 +379,7 @@ function wpmem_do_sc_pages( $page, $redirect_to = null ) {
391
  }
392
 
393
  if ( ! is_user_logged_in() ) {
394
- if ( $wpmem->action == 'register' ) {
395
 
396
  switch( $wpmem->regchk ) {
397
 
@@ -417,7 +405,7 @@ function wpmem_do_sc_pages( $page, $redirect_to = null ) {
417
  } else {
418
 
419
  $content = ( $page == 'members-area' ) ? $content . wpmem_inc_login( 'members' ) : $content;
420
- $content = ( $page == 'register' || $wpmem->show_reg[ $post->post_type ] != 0 ) ? $content . wpmem_inc_registration() : $content;
421
  }
422
 
423
  } elseif ( is_user_logged_in() && $page == 'members-area' ) {
@@ -496,7 +484,7 @@ endif;
496
 
497
 
498
  /**
499
- * User count shortcode.
500
  *
501
  * @since 3.0.0
502
  *
@@ -511,33 +499,38 @@ function wpmem_sc_user_count( $atts, $content = null ) {
511
  $do_query = ( $atts['key'] && $atts['value'] ) ? true : false;
512
  if ( $do_query ) {
513
  $user_meta_query = $wpdb->get_var( $wpdb->prepare(
514
- "SELECT COUNT(*)
515
- FROM $wpdb->usermeta
516
- WHERE meta_key = %s
517
- AND meta_value = %s",
518
  $atts['key'],
519
  $atts['value']
520
  ) );
521
  }
522
- return ( $do_query ) ? $atts['label'] . $user_meta_query : '';
 
 
 
523
  }
524
 
525
 
526
  /**
527
- * Creates the user profile dashboard area (to replace page=user-profile shortcode).
528
  *
529
  * @since 3.1.0
 
530
  *
 
 
 
531
  * @return string $content
532
  */
533
- function wpmem_sc_user_profile() {
534
- $content = wpmem_do_sc_pages( 'user-profile' );
 
535
  return $content;
536
  }
537
 
538
 
539
  /**
540
- * Log in/out shortcode.
541
  *
542
  * @since 3.1.1
543
  *
@@ -568,4 +561,71 @@ function wpmem_sc_loginout( $atts, $content, $tag ) {
568
  return $link;
569
  }
570
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
571
  // End of file.
21
  * - wpmem_shortcode
22
  * - wpmem_do_sc_pages
23
  * - wpmem_sc_user_count
24
+ * - wpmem_sc_user_profile
25
+ * - wpmem_sc_loginout
26
+ * - wpmem_sc_fields
27
+ * - wpmem_sc_logout
28
  */
29
 
30
 
268
  * and fields when the wpmem_field tags are used.
269
  *
270
  * @since 2.4.0
271
+ * @deprecated 3.1.2
272
  *
273
  * @global object $wpmem The WP_Members object.
274
  *
278
  * @return string Returns the result of wpmem_do_sc_pages|wpmem_list_users|wpmem_sc_expmessage|$content.
279
  */
280
  function wpmem_shortcode( $attr, $content = null, $tag = 'wp-members' ) {
281
+
282
+ wpmem_write_log( "wpmem_shortcode() is deprecated as of WP-Members 3.1.2. This means a [wp-members] shortcode is being used and should be replaced." );
283
 
284
  global $wpmem;
285
 
307
  } elseif ( $atts['page'] == 'tos' ) {
308
  return $atts['url'];
309
  } else {
310
+ $content = do_shortcode( wpmem_do_sc_pages( $atts, $content, $tag ) );
311
  }
312
 
313
  // Resolve any texturize issues.
322
 
323
  // Handles the 'status' attribute.
324
  if ( ( $atts['status'] ) || $tag == 'wpmem_logged_in' ) {
325
+ return wpmem_sc_logged_in( $atts, $content, $tag );
326
  }
327
 
328
  // Handles the 'field' attribute.
329
  if ( $atts['field'] || $tag == 'wpmem_field' ) {
330
+ return wpmem_sc_fields( $atts, $content, $tag );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
331
  }
332
 
333
  }
350
  *
351
  * @param string $page
352
  * @param string $redirect_to
353
+ * @param string $tag
354
  * @return string $content
355
  */
356
+ function wpmem_do_sc_pages( $atts, $content, $tag ) {
357
+
358
+ $page = ( isset( $atts['page'] ) ) ? $atts['page'] : $tag;
359
+ $redirect_to = ( isset( $atts['redirect_to'] ) ) ? $atts['redirect_to'] : null;
360
+ $hide_register = ( isset( $atts['register'] ) && 'hide' == $atts['register'] ) ? true : false;
361
 
362
  global $wpmem, $wpmem_themsg, $post;
363
  include_once( WPMEM_PATH . 'inc/dialogs.php' );
379
  }
380
 
381
  if ( ! is_user_logged_in() ) {
382
+ if ( $wpmem->action == 'register' && ! $hide_register ) {
383
 
384
  switch( $wpmem->regchk ) {
385
 
405
  } else {
406
 
407
  $content = ( $page == 'members-area' ) ? $content . wpmem_inc_login( 'members' ) : $content;
408
+ $content = ( ( $page == 'register' || $wpmem->show_reg[ $post->post_type ] != 0 ) && ! $hide_register ) ? $content . wpmem_inc_registration() : $content;
409
  }
410
 
411
  } elseif ( is_user_logged_in() && $page == 'members-area' ) {
484
 
485
 
486
  /**
487
+ * User count shortcode [wpmem_show_count].
488
  *
489
  * @since 3.0.0
490
  *
499
  $do_query = ( $atts['key'] && $atts['value'] ) ? true : false;
500
  if ( $do_query ) {
501
  $user_meta_query = $wpdb->get_var( $wpdb->prepare(
502
+ "SELECT COUNT(*) FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value = %s",
 
 
 
503
  $atts['key'],
504
  $atts['value']
505
  ) );
506
  }
507
+ if ( $do_query ) {
508
+ $content = ( isset( $atts['label'] ) ) ? $atts['label'] . ' ' . $user_meta_query : $content . $user_meta_query;
509
+ }
510
+ return do_shortcode( $content );
511
  }
512
 
513
 
514
  /**
515
+ * Creates the user profile dashboard area [wpmem_profile].
516
  *
517
  * @since 3.1.0
518
+ * @since 3.1.2 Added function arguments.
519
  *
520
+ * @param array $atts
521
+ * @param string $content
522
+ * @param string $tag
523
  * @return string $content
524
  */
525
+ function wpmem_sc_user_profile( $atts, $content, $tag ) {
526
+ $atts['page'] = 'user-profile';
527
+ $content = wpmem_do_sc_pages( $atts, $content, $tag );
528
  return $content;
529
  }
530
 
531
 
532
  /**
533
+ * Log in/out shortcode [wpmem_loginout].
534
  *
535
  * @since 3.1.1
536
  *
561
  return $link;
562
  }
563
 
564
+
565
+ /**
566
+ * Function to handle field shortcodes [wpmem_field].
567
+ *
568
+ * @since 3.1.2
569
+ *
570
+ * @param array $atts
571
+ * @param string $content
572
+ * @param string $tag
573
+ * @retrun string $content
574
+ */
575
+ function wpmem_sc_fields( $atts, $content, $tag ) {
576
+ if ( isset( $atts['id'] ) ) {
577
+ // We are getting some other user.
578
+ if ( $atts['id'] == 'get' ) {
579
+ $the_user_ID = ( isset( $_GET['uid'] ) ) ? $_GET['uid'] : '';
580
+ } else {
581
+ $the_user_ID = $atts['id'];
582
+ }
583
+ } else {
584
+ // Get the current user.
585
+ $the_user_ID = get_current_user_id();
586
+ }
587
+ $user_info = get_userdata( $the_user_ID );
588
+
589
+ if ( isset( $atts['underscores'] ) && 'off' == $atts['underscores'] && $user_info ) {
590
+ $user_info->{$atts['field']} = str_replace( '_', ' ', $user_info->{$atts['field']} );
591
+ }
592
+
593
+ return ( $user_info ) ? htmlspecialchars( $user_info->{$atts['field']} ) . do_shortcode( $content ) : do_shortcode( $content );
594
+ }
595
+
596
+
597
+ /**
598
+ * Logout link shortcode [wpmem_logout].
599
+ *
600
+ * @since 3.1.2
601
+ *
602
+ * @param array $atts
603
+ * @param string $content
604
+ * @param string $tag
605
+ * @retrun string $content
606
+ */
607
+ function wpmem_sc_logout( $atts, $content, $tag ) {
608
+ // Logout link shortcode.
609
+ if ( is_user_logged_in() && $tag == 'wpmem_logout' ) {
610
+ $link = ( isset( $atts['url'] ) ) ? add_query_arg( 'a', 'logout', $atts['url'] ) : add_query_arg( 'a', 'logout' );
611
+ $text = ( $content ) ? $content : __( 'Click here to log out.', 'wp-members' );
612
+ return do_shortcode( "<a href=\"$link\">$text</a>" );
613
+ }
614
+ }
615
+
616
+
617
+ /**
618
+ * TOS shortcode [wpmem_tos].
619
+ *
620
+ * @since 3.1.2
621
+ *
622
+ * @param array $atts
623
+ * @param string $content
624
+ * @param string $tag
625
+ * @retrun string $content
626
+ */
627
+ function wpmem_sc_tos( $atts, $content, $tag ) {
628
+ return do_shortcode( $atts['url'] );
629
+ }
630
+
631
  // End of file.
inc/sidebar.php CHANGED
@@ -232,25 +232,27 @@ function wpmem_do_sidebar( $redirect_to = null ) {
232
  global $user_login;
233
 
234
  /** This filter is documented in wp-members/inc/dialogs.php */
235
- $logout = apply_filters( 'wpmem_logout_link', $url . '/?a=logout' );
236
 
237
  // Defaults.
238
  $defaults = array(
 
239
  'wrapper_before' => '<p>',
240
  'status_text' => sprintf( $wpmem->get_text( 'sb_status' ), $user_login ) . '<br />',
241
  'link_text' => $wpmem->get_text( 'sb_logout' ),
242
  'wrapper_after' => '</p>',
243
  );
244
-
245
  /**
246
  * Filter sidebar login status arguments.
247
  *
248
  * @since 3.1.0
 
249
  *
250
- * @param null
251
  * @return array
252
  */
253
- $args = apply_filters( 'wpmem_sidebar_status_args', '' );
254
 
255
  // Merge $args with $defaults.
256
  $args = wp_parse_args( $args, $defaults );
232
  global $user_login;
233
 
234
  /** This filter is documented in wp-members/inc/dialogs.php */
235
+ $logout = apply_filters( 'wpmem_logout_link', add_query_arg( 'a', 'logout', $url ) );
236
 
237
  // Defaults.
238
  $defaults = array(
239
+ 'user_login' => $user_login,
240
  'wrapper_before' => '<p>',
241
  'status_text' => sprintf( $wpmem->get_text( 'sb_status' ), $user_login ) . '<br />',
242
  'link_text' => $wpmem->get_text( 'sb_logout' ),
243
  'wrapper_after' => '</p>',
244
  );
245
+
246
  /**
247
  * Filter sidebar login status arguments.
248
  *
249
  * @since 3.1.0
250
+ * @since 3.1.2 Pass default args.
251
  *
252
+ * @param array $defaults
253
  * @return array
254
  */
255
+ $args = apply_filters( 'wpmem_sidebar_status_args', $defaults );
256
 
257
  // Merge $args with $defaults.
258
  $args = wp_parse_args( $args, $defaults );
inc/utilities.php CHANGED
@@ -53,7 +53,7 @@ function wpmem_create_formfield( $name, $type, $value, $valtochk=null, $class='t
53
  'name' => $name,
54
  'type' => $type,
55
  'value' => $value,
56
- 'valtochk' => $valtochk,
57
  'class' => $class,
58
  );
59
  return $wpmem->forms->create_form_field( $args );
@@ -74,6 +74,7 @@ if ( ! function_exists( 'wpmem_selected' ) ):
74
  * @return string $issame
75
  */
76
  function wpmem_selected( $value, $valtochk, $type = null ) {
 
77
  $issame = ( $type == 'select' ) ? ' selected' : ' checked';
78
  return ( $value == $valtochk ) ? $issame : '';
79
  }
@@ -85,12 +86,13 @@ if ( ! function_exists( 'wpmem_chk_qstr' ) ):
85
  * Checks querystrings.
86
  *
87
  * @since 2.0.0
 
88
  *
89
  * @param string $url
90
  * @return string $return_url
91
  */
92
  function wpmem_chk_qstr( $url = null ) {
93
-
94
  $permalink = get_option( 'permalink_structure' );
95
  if ( ! $permalink ) {
96
  $url = ( ! $url ) ? get_option( 'home' ) . "/?" . $_SERVER['QUERY_STRING'] : $url;
@@ -109,11 +111,12 @@ if ( ! function_exists( 'wpmem_generatePassword' ) ):
109
  * Generates a random password.
110
  *
111
  * @since 2.0.0
112
- * @deprecated Unknown
113
  *
114
  * @return string The random password.
115
  */
116
  function wpmem_generatePassword() {
 
117
  return substr( md5( uniqid( microtime() ) ), 0, 7 );
118
  }
119
  endif;
@@ -342,6 +345,7 @@ if ( ! function_exists( 'wpmem_test_shortcode' ) ):
342
  * Tests $content for the presence of the [wp-members] shortcode.
343
  *
344
  * @since 2.6.0
 
345
  *
346
  * @global string $shortcode_tags
347
  * @return bool
@@ -350,6 +354,7 @@ if ( ! function_exists( 'wpmem_test_shortcode' ) ):
350
  */
351
  function wpmem_test_shortcode( $content, $tag ) {
352
 
 
353
  global $shortcode_tags;
354
  if ( array_key_exists( $tag, $shortcode_tags ) ) {
355
  preg_match_all( '/' . get_shortcode_regex() . '/s', $content, $matches, PREG_SET_ORDER );
@@ -417,4 +422,21 @@ function wpmem_wp_reserved_terms() {
417
  return $reserved_terms;
418
  }
419
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
420
  // End of file.
53
  'name' => $name,
54
  'type' => $type,
55
  'value' => $value,
56
+ 'compare' => $valtochk,
57
  'class' => $class,
58
  );
59
  return $wpmem->forms->create_form_field( $args );
74
  * @return string $issame
75
  */
76
  function wpmem_selected( $value, $valtochk, $type = null ) {
77
+ wpmem_write_log( "wpmem_selected() is deprecated as of WP-Members 3.1.0. Use selected() or checked() instead" );
78
  $issame = ( $type == 'select' ) ? ' selected' : ' checked';
79
  return ( $value == $valtochk ) ? $issame : '';
80
  }
86
  * Checks querystrings.
87
  *
88
  * @since 2.0.0
89
+ * @deprecated 3.1.0 Use add_query_arg() instead.
90
  *
91
  * @param string $url
92
  * @return string $return_url
93
  */
94
  function wpmem_chk_qstr( $url = null ) {
95
+ wpmem_write_log( "wpmem_chk_qstr() is deprecated as of WP-Members 3.1.0. Use add_query_arg() instead" );
96
  $permalink = get_option( 'permalink_structure' );
97
  if ( ! $permalink ) {
98
  $url = ( ! $url ) ? get_option( 'home' ) . "/?" . $_SERVER['QUERY_STRING'] : $url;
111
  * Generates a random password.
112
  *
113
  * @since 2.0.0
114
+ * @deprecated Unknown Use wp_generate_password() instead.
115
  *
116
  * @return string The random password.
117
  */
118
  function wpmem_generatePassword() {
119
+ wpmem_write_log( "WP-Members function wpmem_generatePassword() is deprecated. Use wp_generate_password() instead" );
120
  return substr( md5( uniqid( microtime() ) ), 0, 7 );
121
  }
122
  endif;
345
  * Tests $content for the presence of the [wp-members] shortcode.
346
  *
347
  * @since 2.6.0
348
+ * @deprecated 3.1.2 Use has_shortcode() instead.
349
  *
350
  * @global string $shortcode_tags
351
  * @return bool
354
  */
355
  function wpmem_test_shortcode( $content, $tag ) {
356
 
357
+ wpmem_write_log( "wpmem_test_shortcode() is deprecated as of WP-Members 3.1.2. Use has_shortcode() instead." );
358
  global $shortcode_tags;
359
  if ( array_key_exists( $tag, $shortcode_tags ) ) {
360
  preg_match_all( '/' . get_shortcode_regex() . '/s', $content, $matches, PREG_SET_ORDER );
422
  return $reserved_terms;
423
  }
424
 
425
+
426
+ /**
427
+ * Log debugging errors.
428
+ *
429
+ * @since 3.1.2
430
+ *
431
+ * @param mixed (string|array|object) $log Information to write in the WP debug file.
432
+ */
433
+ function wpmem_write_log ( $log ) {
434
+ if ( is_array( $log ) || is_object( $log ) ) {
435
+ error_log( print_r( $log, true ) );
436
+ } else {
437
+ error_log( $log );
438
+ }
439
+ }
440
+
441
+
442
  // End of file.
inc/wp-registration.php CHANGED
@@ -100,7 +100,7 @@ function wpmem_do_wp_register_form() {
100
  'name' => $field[2],
101
  'type' => $field[3],
102
  'value' => $field[7],
103
- 'valtochk' => $valtochk,
104
  'required' => ( 'y' == $field[5] ) ? true : false,
105
  );
106
  if ( 'multicheckbox' == $field[3] || 'multiselect' == $field[3] ) {
@@ -214,7 +214,7 @@ function wpmem_do_wp_newuser_form() {
214
  'name' => $field[2],
215
  'type' => $field[3],
216
  'value' => $field[7],
217
- 'valtochk' => $valtochk,
218
  'required' => ( 'y' == $field[5] ) ? true : false,
219
  );
220
  if ( 'multicheckbox' == $field[3] || 'multiselect' == $field[3] ) {
@@ -244,7 +244,7 @@ function wpmem_do_wp_newuser_form() {
244
  <th scope="row">
245
  <label for="activate_user">' . __( 'Activate this user?', 'wp-members' ) . '</label>
246
  </th>
247
- <td>' . $wpmem->forms->create_form_field( array( 'name' => 'activate_user', 'type' => 'checkbox', 'value' => 1, 'valtochk' => '' ) ) . '</td>
248
  </tr>';
249
  }
250
 
100
  'name' => $field[2],
101
  'type' => $field[3],
102
  'value' => $field[7],
103
+ 'compare' => $valtochk,
104
  'required' => ( 'y' == $field[5] ) ? true : false,
105
  );
106
  if ( 'multicheckbox' == $field[3] || 'multiselect' == $field[3] ) {
214
  'name' => $field[2],
215
  'type' => $field[3],
216
  'value' => $field[7],
217
+ 'compare' => $valtochk,
218
  'required' => ( 'y' == $field[5] ) ? true : false,
219
  );
220
  if ( 'multicheckbox' == $field[3] || 'multiselect' == $field[3] ) {
244
  <th scope="row">
245
  <label for="activate_user">' . __( 'Activate this user?', 'wp-members' ) . '</label>
246
  </th>
247
+ <td>' . $wpmem->forms->create_form_field( array( 'name' => 'activate_user', 'type' => 'checkbox', 'value' => 1, 'compare' => '' ) ) . '</td>
248
  </tr>';
249
  }
250
 
readme.txt CHANGED
@@ -1,9 +1,9 @@
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.5.2
6
- Stable tag: 3.1.1
7
  License: GPLv2
8
 
9
  WP-Members&trade; is a free membership management framework for WordPress&reg; that restricts content to registered users.
@@ -112,8 +112,9 @@ Premium priority support is available at the plugin's site [RocketGeek.com](http
112
 
113
  == Upgrade Notice ==
114
 
115
- WP-Members 3.1.1 is primarily a feature update release (see changelog). This update does make a db settings change.
116
- WP-Members 3.1.0 is a major verion release, please review the changelog.
 
117
 
118
  == Screenshots ==
119
 
@@ -136,6 +137,23 @@ WP-Members 3.1.0 is a major verion release, please review the changelog.
136
 
137
  == Changelog ==
138
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
139
  = 3.1.1 =
140
 
141
  * Added downgrade function (currently runs on deactivation) to allow for version rollbacks.
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.6
5
  Tested up to: 4.5.2
6
+ Stable tag: 3.1.2
7
  License: GPLv2
8
 
9
  WP-Members&trade; is a free membership management framework for WordPress&reg; that restricts content to registered users.
112
 
113
  == Upgrade Notice ==
114
 
115
+ WP-Members 3.1.2 is primarily a feature update release with some fixes
116
+ (see changelog). Minimum WP version is increased to 3.6.
117
+ WP-Members 3.1.0 is a major verion release, 3.1.1 contains a db settings change, please review the changelog.
118
 
119
  == Screenshots ==
120
 
137
 
138
  == Changelog ==
139
 
140
+ = 3.1.2 =
141
+
142
+ * Minimum WordPress version increased to 3.6.
143
+ * Added user counts to user screen links (set as transient).
144
+ * Added redirect_to parameter to wpmem_login_url().
145
+ * Added action parameter to wpmem_profile_url().
146
+ * Added echo argument to wpmem_gettext().
147
+ * Added api function wpmem_user_pages() to return an array of the login, register, and profile page urls.
148
+ * Added shortcode [wpmem_tos] for Terms of Service page url (replaces [wp-members page=tos url=http://mysite.com/path/to/tos/]).
149
+ * Added wpmem_write_log() function for writing notices to the WP error log.
150
+ * Added hide registration form parameter to wpmem_profile shortcode: [wpmem_profile register=hide].
151
+ * Added $defaults to wpmem_sidebar_status_args. Now can pass $user_login to be used in filters.
152
+ * Moved wpmem_login_status() to api.php.
153
+ * Deprecated [wp-members] shortcode, all other shortcodes no longer rely on wpmem_shortcode().
154
+ * Fixed issue with pre-selected dropdown values to not select empty (separator) rows.
155
+ * Fixed field and custom shortcodes in email not being parsed.
156
+
157
  = 3.1.1 =
158
 
159
  * Added downgrade function (currently runs on deactivation) to allow for version rollbacks.
wp-members-install.php CHANGED
@@ -18,6 +18,7 @@
18
  * - wpmem_upgrade_settings
19
  * - wpmem_upgrade_email
20
  * - wpmem_upgrade_dialogs
 
21
  * - wpmem_upgrade_captcha
22
  */
23
 
@@ -149,7 +150,6 @@ function wpmem_do_install() {
149
 
150
  wpmem_upgrade_settings();
151
  wpmem_upgrade_captcha();
152
- wpmem_upgrade_dialogs();
153
  wpmem_append_email();
154
 
155
  }
@@ -166,7 +166,7 @@ function wpmem_do_install() {
166
  */
167
  function wpmem_upgrade_settings() {
168
 
169
- // Update dialogs to 3.1.1 settings.
170
  wpmem_upgrade_dialogs();
171
 
172
  $wpmem_settings = get_option( 'wpmembers_settings' );
18
  * - wpmem_upgrade_settings
19
  * - wpmem_upgrade_email
20
  * - wpmem_upgrade_dialogs
21
+ * - wpmem_downgrade_dialogs
22
  * - wpmem_upgrade_captcha
23
  */
24
 
150
 
151
  wpmem_upgrade_settings();
152
  wpmem_upgrade_captcha();
 
153
  wpmem_append_email();
154
 
155
  }
166
  */
167
  function wpmem_upgrade_settings() {
168
 
169
+ // Update dialogs for 3.1.1
170
  wpmem_upgrade_dialogs();
171
 
172
  $wpmem_settings = get_option( 'wpmembers_settings' );
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.1.1
7
  Author: Chad Butler
8
  Author URI: http://butlerblog.com/
9
  Text Domain: wp-members
@@ -62,7 +62,7 @@ License: GPLv2
62
 
63
 
64
  // Initialize constants.
65
- define( 'WPMEM_VERSION', '3.1.1' );
66
  define( 'WPMEM_DEBUG', false );
67
  define( 'WPMEM_DIR', plugin_dir_url ( __FILE__ ) );
68
  define( 'WPMEM_PATH', plugin_dir_path( __FILE__ ) );
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.1.2
7
  Author: Chad Butler
8
  Author URI: http://butlerblog.com/
9
  Text Domain: wp-members
62
 
63
 
64
  // Initialize constants.
65
+ define( 'WPMEM_VERSION', '3.1.2' );
66
  define( 'WPMEM_DEBUG', false );
67
  define( 'WPMEM_DIR', plugin_dir_url ( __FILE__ ) );
68
  define( 'WPMEM_PATH', plugin_dir_path( __FILE__ ) );