User Registration – Custom Registration Form, Login Form And User Profile For WordPress - Version 1.1.3

Version Description

  • 17/10/2017 =
  • Fix - Login shortcode required parameter issue resolved.
Download this release

Release Info

Developer wpeverest
Plugin Icon 128x128 User Registration – Custom Registration Form, Login Form And User Profile For WordPress
Version 1.1.3
Comparing to
See all releases

Code changes from version 1.1.2 to 1.1.3

includes/class-ur-emailer.php CHANGED
@@ -248,8 +248,12 @@ class UR_Emailer {
248
  $redirectUrl=network_site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user_login), 'login');
249
  $message .= __( sprintf( '<a href="%s">%s</a>', $redirectUrl ,$redirectUrl ), 'user-registration' );
250
  $message = apply_filters( 'retrieve_password_message', $message, $key, $user_login, $user_data );
251
- wp_mail( $user_data->user_email, $subject, $message, $headers);
252
 
 
 
 
 
 
253
  }
254
 
255
  }
248
  $redirectUrl=network_site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user_login), 'login');
249
  $message .= __( sprintf( '<a href="%s">%s</a>', $redirectUrl ,$redirectUrl ), 'user-registration' );
250
  $message = apply_filters( 'retrieve_password_message', $message, $key, $user_login, $user_data );
 
251
 
252
+ if(wp_mail( $user_data->user_email, $subject, $message, $headers))
253
+ {
254
+ return true;
255
+ }
256
+ return false;
257
  }
258
 
259
  }
includes/functions-ur-template.php CHANGED
@@ -38,8 +38,9 @@ add_action( 'template_redirect', 'ur_template_redirect' );
38
  */
39
  function ur_login_template_redirect() {
40
  global $post;
41
- if ( has_shortcode( $post->post_content, 'user_registration_login' ) && is_user_logged_in() ) {
42
- $attributes = shortcode_parse_atts( $post->post_content );
 
43
  $redirect_url = isset( $attributes[1] ) ? $attributes[1] : '';
44
  $redirect_url = str_replace( 'redirect_url', '', $redirect_url );
45
  $redirect_url = trim( str_replace( '=', '', $redirect_url ) );
38
  */
39
  function ur_login_template_redirect() {
40
  global $post;
41
+ $post_content = isset($post->post_content) ? $post->post_content:'';
42
+ if ( has_shortcode( $post_content, 'user_registration_login' ) && is_user_logged_in() ) {
43
+ $attributes = shortcode_parse_atts( $post_content );
44
  $redirect_url = isset( $attributes[1] ) ? $attributes[1] : '';
45
  $redirect_url = str_replace( 'redirect_url', '', $redirect_url );
46
  $redirect_url = trim( str_replace( '=', '', $redirect_url ) );
includes/shortcodes/class-ur-shortcode-login.php CHANGED
@@ -39,6 +39,7 @@ class UR_Shortcode_Login {
39
 
40
  public static function output( $atts ) {
41
  global $wp, $post;
 
42
 
43
  if ( ! is_user_logged_in() ) {
44
 
@@ -47,15 +48,16 @@ class UR_Shortcode_Login {
47
  } else {
48
  ur_get_template( 'myaccount/form-login.php' );
49
  }
50
- }else if(is_user_logged_in() && !empty(trim($atts['redirect_url']))){
 
51
  ?> <script>
52
- window.location = "<?php echo trim($atts['redirect_url']);?>";
53
  </script>
54
  <?php
55
  }
56
  else
57
  {
58
- echo __( sprintf( 'You are already logged in. <a href="%s">%s</a>', ur_logout_url() ,'Logout' ), 'user-registration' );
59
  }
60
  }
61
 
39
 
40
  public static function output( $atts ) {
41
  global $wp, $post;
42
+ $redirect_url=isset($atts['redirect_url'])?$atts['redirect_url']:'';
43
 
44
  if ( ! is_user_logged_in() ) {
45
 
48
  } else {
49
  ur_get_template( 'myaccount/form-login.php' );
50
  }
51
+
52
+ }else if(is_user_logged_in() && !empty(trim($redirect_url)) ){
53
  ?> <script>
54
+ window.location = "<?php echo trim($redirect_url);?>";
55
  </script>
56
  <?php
57
  }
58
  else
59
  {
60
+ echo sprintf( __('You are already logged in. %1$s %2$s?', 'user-registration' ), '<a href="'.ur_logout_url().'">', 'Logout' );
61
  }
62
  }
63
 
includes/shortcodes/class-ur-shortcode-my-account.php CHANGED
@@ -167,10 +167,11 @@ class UR_Shortcode_My_Account {
167
  /**
168
  * After sending the reset link, don't show the form again.
169
  */
 
170
  if ( ! empty( $_GET['reset-link-sent'] ) ) {
171
  return ur_get_template( 'myaccount/lost-password-confirmation.php' );
172
 
173
- /**
174
  * Process reset key / login from email confirmation link
175
  */
176
  } elseif ( ! empty( $_GET['show-reset-form'] ) ) {
@@ -265,7 +266,11 @@ class UR_Shortcode_My_Account {
265
  $key = get_password_reset_key( $user_data );
266
 
267
  // Send email notification
268
- UR_Emailer::lost_password_email($user_login,$user_data,$key);
 
 
 
 
269
 
270
  return true;
271
  }
@@ -301,6 +306,7 @@ class UR_Shortcode_My_Account {
301
  public static function reset_password( $user, $new_pass ) {
302
  do_action( 'password_reset', $user, $new_pass );
303
 
 
304
  wp_set_password( $new_pass, $user->ID );
305
  self::set_reset_password_cookie();
306
 
167
  /**
168
  * After sending the reset link, don't show the form again.
169
  */
170
+
171
  if ( ! empty( $_GET['reset-link-sent'] ) ) {
172
  return ur_get_template( 'myaccount/lost-password-confirmation.php' );
173
 
174
+ /**
175
  * Process reset key / login from email confirmation link
176
  */
177
  } elseif ( ! empty( $_GET['show-reset-form'] ) ) {
266
  $key = get_password_reset_key( $user_data );
267
 
268
  // Send email notification
269
+ if(UR_Emailer::lost_password_email($user_login,$user_data,$key) == false)
270
+ {
271
+ ur_add_notice( __( 'The email could not be sent. Possible reason: your host may have disabled the mail() function. ', 'user-registration' ), 'error' );
272
+ return false;
273
+ }
274
 
275
  return true;
276
  }
306
  public static function reset_password( $user, $new_pass ) {
307
  do_action( 'password_reset', $user, $new_pass );
308
 
309
+
310
  wp_set_password( $new_pass, $user->ID );
311
  self::set_reset_password_cookie();
312
 
languages/user-registration.pot CHANGED
@@ -2,9 +2,9 @@
2
  # This file is distributed under the same license as the User Registration package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: User Registration 1.1.1\n"
6
  "Report-Msgid-Bugs-To: wpeverest@gmail.com\n"
7
- "POT-Creation-Date: 2017-10-16 05:47:26+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -2255,11 +2255,11 @@ msgstr ""
2255
  msgid "This function should not be called before user_registration_init."
2256
  msgstr ""
2257
 
2258
- #: includes/functions-ur-template.php:123
2259
  msgid "required"
2260
  msgstr ""
2261
 
2262
- #: includes/functions-ur-template.php:198
2263
  msgid "Choose an option"
2264
  msgstr ""
2265
 
@@ -2271,6 +2271,10 @@ msgstr ""
2271
  msgid "This method should not be called before plugins_loaded."
2272
  msgstr ""
2273
 
 
 
 
 
2274
  #: includes/shortcodes/class-ur-shortcode-my-account.php:52
2275
  msgid "Your password has been reset successfully."
2276
  msgstr ""
@@ -2279,19 +2283,25 @@ msgstr ""
2279
  msgid "Are you sure you want to log out? <a href=\"%s\">Confirm and log out</a>"
2280
  msgstr ""
2281
 
2282
- #: includes/shortcodes/class-ur-shortcode-my-account.php:214
2283
  msgid "Enter a username or email address."
2284
  msgstr ""
2285
 
2286
- #: includes/shortcodes/class-ur-shortcode-my-account.php:237
2287
- #: includes/shortcodes/class-ur-shortcode-my-account.php:242
2288
  msgid "Invalid username or email."
2289
  msgstr ""
2290
 
2291
- #: includes/shortcodes/class-ur-shortcode-my-account.php:255
2292
  msgid "Password reset is not allowed for this user"
2293
  msgstr ""
2294
 
 
 
 
 
 
 
2295
  #: templates/myaccount/dashboard.php:29
2296
  #. translators: 1: user display name 2: logout url
2297
  msgid "Hello %1$s (not %1$s? <a href=\"%2$s\">Sign out</a>)"
@@ -2300,8 +2310,8 @@ msgstr ""
2300
  #: templates/myaccount/dashboard.php:39
2301
  #. translators: %1$s is replaced with the number of href
2302
  msgid ""
2303
- "From your account dashboard you can manage your <a href=\"%1$s\">profile "
2304
- "details</a> and <a href=\"%2$s\">edit your password and account details</a>."
2305
  msgstr ""
2306
 
2307
  #: templates/myaccount/form-edit-account.php:47
2
  # This file is distributed under the same license as the User Registration package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: User Registration 1.1.2\n"
6
  "Report-Msgid-Bugs-To: wpeverest@gmail.com\n"
7
+ "POT-Creation-Date: 2017-10-17 07:09:48+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
2255
  msgid "This function should not be called before user_registration_init."
2256
  msgstr ""
2257
 
2258
+ #: includes/functions-ur-template.php:125
2259
  msgid "required"
2260
  msgstr ""
2261
 
2262
+ #: includes/functions-ur-template.php:200
2263
  msgid "Choose an option"
2264
  msgstr ""
2265
 
2271
  msgid "This method should not be called before plugins_loaded."
2272
  msgstr ""
2273
 
2274
+ #: includes/shortcodes/class-ur-shortcode-login.php:60
2275
+ msgid "You are already logged in. %1$s %2$s?"
2276
+ msgstr ""
2277
+
2278
  #: includes/shortcodes/class-ur-shortcode-my-account.php:52
2279
  msgid "Your password has been reset successfully."
2280
  msgstr ""
2283
  msgid "Are you sure you want to log out? <a href=\"%s\">Confirm and log out</a>"
2284
  msgstr ""
2285
 
2286
+ #: includes/shortcodes/class-ur-shortcode-my-account.php:215
2287
  msgid "Enter a username or email address."
2288
  msgstr ""
2289
 
2290
+ #: includes/shortcodes/class-ur-shortcode-my-account.php:238
2291
+ #: includes/shortcodes/class-ur-shortcode-my-account.php:243
2292
  msgid "Invalid username or email."
2293
  msgstr ""
2294
 
2295
+ #: includes/shortcodes/class-ur-shortcode-my-account.php:256
2296
  msgid "Password reset is not allowed for this user"
2297
  msgstr ""
2298
 
2299
+ #: includes/shortcodes/class-ur-shortcode-my-account.php:271
2300
+ msgid ""
2301
+ "The email could not be sent. Possible reason: your host may have disabled "
2302
+ "the mail() function. "
2303
+ msgstr ""
2304
+
2305
  #: templates/myaccount/dashboard.php:29
2306
  #. translators: 1: user display name 2: logout url
2307
  msgid "Hello %1$s (not %1$s? <a href=\"%2$s\">Sign out</a>)"
2310
  #: templates/myaccount/dashboard.php:39
2311
  #. translators: %1$s is replaced with the number of href
2312
  msgid ""
2313
+ "From your account dashboard you can manage your profile details and <a "
2314
+ "href=\"%1$s\">edit your password and account details</a>."
2315
  msgstr ""
2316
 
2317
  #: templates/myaccount/form-edit-account.php:47
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: WPEverest
3
  Tags: user registration, registration, profile-builder, user profile, form, registration form, login form
4
  Requires at least: 4.0
5
  Tested up to: 4.8
6
- Stable tag: 1.1.2
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
@@ -77,7 +77,8 @@ Yes, the plugin is designed to work with any themes that have been coded followi
77
  11. Shortcode
78
 
79
  == Changelog ==
80
-
 
81
  = 1.1.2 - 16/10/2017 =
82
  * Feature - New shortcode for login [user_registration_login]
83
  * Feature - 2 More template added for user registration form
3
  Tags: user registration, registration, profile-builder, user profile, form, registration form, login form
4
  Requires at least: 4.0
5
  Tested up to: 4.8
6
+ Stable tag: 1.1.3
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
77
  11. Shortcode
78
 
79
  == Changelog ==
80
+ = 1.1.3 - 17/10/2017 =
81
+ * Fix - Login shortcode required parameter issue resolved.
82
  = 1.1.2 - 16/10/2017 =
83
  * Feature - New shortcode for login [user_registration_login]
84
  * Feature - 2 More template added for user registration form
templates/myaccount/dashboard.php CHANGED
@@ -36,8 +36,7 @@ if ( ! defined( 'ABSPATH' ) ) {
36
  <p><?php
37
  /* translators: %1$s is replaced with the number of href */
38
  printf(
39
- __( 'From your account dashboard you can manage your <a href="%1$s">profile details</a> and <a href="%2$s">edit your password and account details</a>.', 'user-registration' ),
40
- esc_url( ur_get_endpoint_url( 'edit-profile' ) ),
41
  esc_url( ur_get_endpoint_url( 'edit-account' ) )
42
  );
43
  ?></p>
36
  <p><?php
37
  /* translators: %1$s is replaced with the number of href */
38
  printf(
39
+ __( 'From your account dashboard you can manage your profile details and <a href="%1$s">edit your password and account details</a>.', 'user-registration' ),
 
40
  esc_url( ur_get_endpoint_url( 'edit-account' ) )
41
  );
42
  ?></p>
user-registration.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: User Registration
4
  * Plugin URI: https://wpeverest.com/plugins/user-registration
5
  * Description: Drag and Drop user registration and login form builder.
6
- * Version: 1.1.2
7
  * Author: WPEverest
8
  * Author URI: https://wpeverest.com
9
  * Requires at least: 4.0
@@ -35,7 +35,7 @@ final class UserRegistration {
35
  * Plugin version.
36
  * @var string
37
  */
38
- public $version = '1.1.2';
39
 
40
  /**
41
  * Session instance.
3
  * Plugin Name: User Registration
4
  * Plugin URI: https://wpeverest.com/plugins/user-registration
5
  * Description: Drag and Drop user registration and login form builder.
6
+ * Version: 1.1.3
7
  * Author: WPEverest
8
  * Author URI: https://wpeverest.com
9
  * Requires at least: 4.0
35
  * Plugin version.
36
  * @var string
37
  */
38
+ public $version = '1.1.3';
39
 
40
  /**
41
  * Session instance.