Theme My Login - Version 7.0.10

Version Description

  • Fix admin notices displaying for non-privileged users
  • Reinstate default testcookie method
  • Don't allow TML actions to stomp on other content
  • Don't allow TML actions to stomp on other TML actions
  • Allow non-TML actions to be handled
  • Include labels for custom fields if present
  • Hide comments on TML pages
  • Fix generation of non-pretty action links
  • Apply login_redirect filter to auto-login registration redirect
  • Fix new user notification being sent when unchecked upon creating a user
Download this release

Release Info

Developer jfarthing84
Plugin Icon 128x128 Theme My Login
Version 7.0.10
Comparing to
See all releases

Code changes from version 7.0.9 to 7.0.10

admin/assets/scripts/theme-my-login-admin.js CHANGED
@@ -12,12 +12,11 @@
12
  } )( jQuery );
13
 
14
  ( function( $ ) {
15
- if ( $( '#tml-settings' ).length ) {
16
- $( initMetaBoxes );
17
- }
18
 
19
  function initMetaBoxes() {
20
- var metaboxes = $( '.postbox' );
21
 
22
  if ( metaboxes.length ) {
23
  // Make metaboxes toggleable
12
  } )( jQuery );
13
 
14
  ( function( $ ) {
15
+
16
+ $( initMetaBoxes );
 
17
 
18
  function initMetaBoxes() {
19
+ var metaboxes = $( '#tml-settings .postbox' );
20
 
21
  if ( metaboxes.length ) {
22
  // Make metaboxes toggleable
admin/assets/scripts/theme-my-login-admin.min.js CHANGED
@@ -1 +1 @@
1
- !function(o){o(function(){var t=o("#wp-auth-check-form");t.length&&t.attr("data-src",tmlAdmin.interimLoginUrl)})}(jQuery),function(o){o("#tml-settings").length&&o(function(){o(".postbox").length&&(postboxes.add_postbox_toggles(pagenow),o(".postbox").addClass("closed"),o(".metabox-holder").each(function(){var t=o(this);"off"==t.data("sortable")&&(t.find(".meta-box-sortables").sortable("destroy"),t.find(".postbox .hndle").css("cursor","default"))}))})}(jQuery),function(n){n(function(){n(".tml-notice").on("click",".notice-dismiss",function(t){var o=n(t.delegateTarget);n.post(ajaxurl,{action:"tml-dismiss-notice",notice:o.data("notice")})})})}(jQuery);
1
+ !function(o){o(function(){var t=o("#wp-auth-check-form");t.length&&t.attr("data-src",tmlAdmin.interimLoginUrl)})}(jQuery),function(o){o(function(){o("#tml-settings .postbox").length&&(postboxes.add_postbox_toggles(pagenow),o(".postbox").addClass("closed"),o(".metabox-holder").each(function(){var t=o(this);"off"==t.data("sortable")&&(t.find(".meta-box-sortables").sortable("destroy"),t.find(".postbox .hndle").css("cursor","default"))}))})}(jQuery),function(n){n(function(){n(".tml-notice").on("click",".notice-dismiss",function(t){var o=n(t.delegateTarget);n.post(ajaxurl,{action:"tml-dismiss-notice",notice:o.data("notice")})})})}(jQuery);
admin/functions.php CHANGED
@@ -142,6 +142,11 @@ function tml_admin_enqueue_style_and_scripts() {
142
  function tml_admin_notices() {
143
  global $plugin_page;
144
 
 
 
 
 
 
145
  $is_pre_7 = ( $previous_version = tml_get_previous_version() ) && version_compare( $previous_version, '7.0', '<' );
146
 
147
  if ( 'theme-my-login-extensions' == $plugin_page && $is_pre_7 ) {
@@ -352,14 +357,17 @@ function tml_admin_deactivation_survey() {
352
  // Handle form submission
353
  if ( tml_is_post_request() ) {
354
  if ( $comments = tml_get_request_value( 'comments', 'post' ) ) {
355
- $message = wp_unslash( $comments ) . "\r\n\r\n";
356
- $message .= implode( "\r\n", array(
357
- 'WP Version: ' . $wp_version,
358
- 'TML Version: ' . THEME_MY_LOGIN_VERSION,
359
- 'PHP Version: ' . phpversion(),
360
- 'Multisite: ' . ( is_multisite() ? 'Yes' : 'No' ),
361
- ) );
362
- @wp_mail( 'deactivations@thememylogin.com', 'Deactivation Survey', $message );
 
 
 
363
  }
364
  wp_redirect( add_query_arg( 'skip_survey', 1 ) );
365
  exit;
142
  function tml_admin_notices() {
143
  global $plugin_page;
144
 
145
+ // Bail if the user cannot activate plugins
146
+ if ( ! current_user_can( 'activate_plugins' ) ) {
147
+ return;
148
+ }
149
+
150
  $is_pre_7 = ( $previous_version = tml_get_previous_version() ) && version_compare( $previous_version, '7.0', '<' );
151
 
152
  if ( 'theme-my-login-extensions' == $plugin_page && $is_pre_7 ) {
357
  // Handle form submission
358
  if ( tml_is_post_request() ) {
359
  if ( $comments = tml_get_request_value( 'comments', 'post' ) ) {
360
+ $words = explode( ' ', trim( $comments ) );
361
+ if ( count( $words ) > 5 ) {
362
+ $message = wp_unslash( $comments ) . "\r\n\r\n";
363
+ $message .= implode( "\r\n", array(
364
+ 'WP Version: ' . $wp_version,
365
+ 'TML Version: ' . THEME_MY_LOGIN_VERSION,
366
+ 'PHP Version: ' . phpversion(),
367
+ 'Multisite: ' . ( is_multisite() ? 'Yes' : 'No' ),
368
+ ) );
369
+ @wp_mail( 'deactivations@thememylogin.com', 'Deactivation Survey', $message );
370
+ }
371
  }
372
  wp_redirect( add_query_arg( 'skip_survey', 1 ) );
373
  exit;
includes/actions.php CHANGED
@@ -119,14 +119,15 @@ function tml_unregister_action( $action ) {
119
  * @return Theme_My_Login_Action|bool The action object if it exists or false otherwise.
120
  */
121
  function tml_get_action( $action = '' ) {
 
122
 
123
  if ( $action instanceof Theme_My_Login_Action ) {
124
  return $action;
125
  }
126
 
127
  if ( empty( $action ) ) {
128
- if ( ! $action = get_query_var( 'action' ) ) {
129
- $action = tml_get_request_value( 'action' );
130
  }
131
  }
132
 
@@ -288,11 +289,25 @@ function tml_action_handler() {
288
 
289
  nocache_headers();
290
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
291
  /** This action is documented in wp-login.php */
292
  do_action( 'login_init' );
293
 
294
  /** This action is documented in wp-login.php */
295
- do_action( 'login_form_' . tml_get_action()->get_name() );
296
 
297
  /**
298
  * Fires when a TML action is being requested.
@@ -342,64 +357,50 @@ function tml_login_handler() {
342
 
343
  $reauth = empty( $_REQUEST['reauth'] ) ? false : true;
344
 
345
- if ( isset( $_POST['log'] ) || isset( $_GET['testcookie'] ) ) {
346
-
347
- $user = wp_signon( array(), $secure_cookie );
348
-
349
- $redirect_to = apply_filters( 'login_redirect', $redirect_to, isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '', $user );
350
-
351
- if ( ! is_wp_error( $user ) && empty( $_COOKIE[ LOGGED_IN_COOKIE ] ) ) {
352
- $redirect_to = add_query_arg( array(
353
- 'testcookie' => 1,
354
- 'redirect_to' => urlencode( $redirect_to ),
355
- ) );
356
- wp_redirect( $redirect_to );
357
- exit;
358
- }
359
-
360
- if ( empty( $_COOKIE[ LOGGED_IN_COOKIE ] ) ) {
361
- if ( headers_sent() ) {
362
- $user = new WP_Error( 'test_cookie', sprintf(
363
- __( '<strong>ERROR</strong>: Cookies are blocked due to unexpected output. For help, please see <a href="%1$s">this documentation</a> or try the <a href="%2$s">support forums</a>.' ),
364
- __( 'https://codex.wordpress.org/Cookies' ),
365
- __( 'https://wordpress.org/support/' )
366
- )
367
- );
368
- } elseif ( isset( $_GET['testcookie'] ) ) {
369
- // If cookies are disabled we can't log in even with a valid user+pass
370
- $user = new WP_Error( 'test_cookie', sprintf(
371
- __( '<strong>ERROR</strong>: Cookies are blocked or not supported by your browser. You must <a href="%s">enable cookies</a> to use WordPress.' ),
372
- __( 'https://codex.wordpress.org/Cookies' )
373
- )
374
- );
375
- }
376
- } else {
377
- $user = wp_get_current_user();
378
  }
 
379
 
380
- if ( ! is_wp_error( $user ) && ! $reauth ) {
381
 
382
- if ( ( empty( $redirect_to ) || $redirect_to == 'wp-admin/' || $redirect_to == admin_url() ) ) {
383
 
384
- // If the user doesn't belong to a blog, send them to user admin. If the user can't edit posts, send them to their profile.
385
- if ( is_multisite() && ! get_active_blog_for_user( $user->ID ) && ! is_super_admin( $user->ID ) ) {
386
- $redirect_to = user_admin_url();
387
 
388
- } elseif ( is_multisite() && ! $user->has_cap( 'read' ) ) {
389
- $redirect_to = get_dashboard_url( $user->ID );
 
390
 
391
- } elseif ( ! $user->has_cap( 'edit_posts' ) ) {
392
- $redirect_to = $user->has_cap( 'read' ) ? admin_url( 'profile.php' ) : home_url();
393
- }
394
 
395
- wp_redirect( $redirect_to );
396
- exit;
397
  }
398
 
399
- wp_safe_redirect( $redirect_to );
400
  exit;
401
  }
402
 
 
 
 
403
  $errors = $user;
404
  }
405
 
@@ -490,13 +491,24 @@ function tml_registration_handler() {
490
  if ( tml_is_post_request() ) {
491
  $user_login = isset( $_POST['user_login'] ) ? $_POST['user_login'] : '';
492
  $user_email = isset( $_POST['user_email'] ) ? $_POST['user_email'] : '';
493
- $errors = register_new_user( $user_login, $user_email );
494
- if ( ! is_wp_error( $errors ) ) {
495
  $redirect_to = ! empty( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : site_url( 'wp-login.php?checkemail=registered' );
 
 
 
 
 
 
 
 
 
 
 
496
  wp_safe_redirect( $redirect_to );
497
  exit;
498
  } else {
499
- tml_set_errors( $errors );
500
  }
501
  }
502
  }
119
  * @return Theme_My_Login_Action|bool The action object if it exists or false otherwise.
120
  */
121
  function tml_get_action( $action = '' ) {
122
+ global $wp;
123
 
124
  if ( $action instanceof Theme_My_Login_Action ) {
125
  return $action;
126
  }
127
 
128
  if ( empty( $action ) ) {
129
+ if ( ! empty( $wp->query_vars['action'] ) ) {
130
+ $action = $wp->query_vars['action'];
131
  }
132
  }
133
 
289
 
290
  nocache_headers();
291
 
292
+ // Set a test cookie to test if cookies are enabled
293
+ $secure = ( 'https' === parse_url( wp_login_url(), PHP_URL_SCHEME ) );
294
+ setcookie( TEST_COOKIE, 'WP Cookie check', 0, COOKIEPATH, COOKIE_DOMAIN, $secure );
295
+ if ( SITECOOKIEPATH != COOKIEPATH ) {
296
+ setcookie( TEST_COOKIE, 'WP Cookie check', 0, SITECOOKIEPATH, COOKIE_DOMAIN, $secure );
297
+ }
298
+
299
+ // Add the testcookie field to the login form
300
+ tml_add_form_field( 'login', 'testcookie', array(
301
+ 'type' => 'hidden' ,
302
+ 'value' => 1,
303
+ 'priority' => 30,
304
+ ) );
305
+
306
  /** This action is documented in wp-login.php */
307
  do_action( 'login_init' );
308
 
309
  /** This action is documented in wp-login.php */
310
+ do_action( 'login_form_' . tml_get_request_value( 'action' ) );
311
 
312
  /**
313
  * Fires when a TML action is being requested.
357
 
358
  $reauth = empty( $_REQUEST['reauth'] ) ? false : true;
359
 
360
+ $user = wp_signon( array(), $secure_cookie );
361
+
362
+ if ( empty( $_COOKIE[ LOGGED_IN_COOKIE ] ) ) {
363
+ if ( headers_sent() ) {
364
+ $user = new WP_Error( 'test_cookie', sprintf(
365
+ __( '<strong>ERROR</strong>: Cookies are blocked due to unexpected output. For help, please see <a href="%1$s">this documentation</a> or try the <a href="%2$s">support forums</a>.' ),
366
+ __( 'https://codex.wordpress.org/Cookies' ),
367
+ __( 'https://wordpress.org/support/' )
368
+ )
369
+ );
370
+ } elseif ( isset( $_POST['testcookie'] ) && empty( $_COOKIE[ TEST_COOKIE ] ) ) {
371
+ // If cookies are disabled we can't log in even with a valid user+pass
372
+ $user = new WP_Error( 'test_cookie', sprintf(
373
+ __( '<strong>ERROR</strong>: Cookies are blocked or not supported by your browser. You must <a href="%s">enable cookies</a> to use WordPress.' ),
374
+ __( 'https://codex.wordpress.org/Cookies' )
375
+ )
376
+ );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
377
  }
378
+ }
379
 
380
+ $redirect_to = apply_filters( 'login_redirect', $redirect_to, isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '', $user );
381
 
382
+ if ( ! is_wp_error( $user ) && ! $reauth ) {
383
 
384
+ if ( ( empty( $redirect_to ) || $redirect_to == 'wp-admin/' || $redirect_to == admin_url() ) ) {
 
 
385
 
386
+ // If the user doesn't belong to a blog, send them to user admin. If the user can't edit posts, send them to their profile.
387
+ if ( is_multisite() && ! get_active_blog_for_user( $user->ID ) && ! is_super_admin( $user->ID ) ) {
388
+ $redirect_to = user_admin_url();
389
 
390
+ } elseif ( is_multisite() && ! $user->has_cap( 'read' ) ) {
391
+ $redirect_to = get_dashboard_url( $user->ID );
 
392
 
393
+ } elseif ( ! $user->has_cap( 'edit_posts' ) ) {
394
+ $redirect_to = $user->has_cap( 'read' ) ? admin_url( 'profile.php' ) : home_url();
395
  }
396
 
397
+ wp_redirect( $redirect_to );
398
  exit;
399
  }
400
 
401
+ wp_safe_redirect( $redirect_to );
402
+ exit;
403
+ } else {
404
  $errors = $user;
405
  }
406
 
491
  if ( tml_is_post_request() ) {
492
  $user_login = isset( $_POST['user_login'] ) ? $_POST['user_login'] : '';
493
  $user_email = isset( $_POST['user_email'] ) ? $_POST['user_email'] : '';
494
+ $user_id = register_new_user( $user_login, $user_email );
495
+ if ( ! is_wp_error( $user_id ) ) {
496
  $redirect_to = ! empty( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : site_url( 'wp-login.php?checkemail=registered' );
497
+
498
+ /**
499
+ * Filter the registration redirect.
500
+ *
501
+ * @since 7.0.10
502
+ *
503
+ * @param string $redirect_to The registration redirect.
504
+ * @param WP_User $user The user object.
505
+ */
506
+ $redirect_to = apply_filters( 'tml_registration_redirect', $redirect_to, get_userdata( $user_id ) );
507
+
508
  wp_safe_redirect( $redirect_to );
509
  exit;
510
  } else {
511
+ tml_set_errors( $user_id );
512
  }
513
  }
514
  }
includes/class-theme-my-login-action.php CHANGED
@@ -283,9 +283,7 @@ class Theme_My_Login_Action {
283
  $path = user_trailingslashit( $this->get_slug() );
284
  $url = $function( $path, $scheme );
285
  } else {
286
- $url = $function( '', $scheme );
287
- $url = user_trailingslashit( $url );
288
- $url = add_query_arg( 'action', $this->name, $url );
289
  }
290
 
291
  /**
283
  $path = user_trailingslashit( $this->get_slug() );
284
  $url = $function( $path, $scheme );
285
  } else {
286
+ $url = $function( '?action=' . $this->get_name(), $scheme );
 
 
287
  }
288
 
289
  /**
includes/class-theme-my-login-form-field.php CHANGED
@@ -557,6 +557,7 @@ class Theme_My_Login_Form_Field {
557
 
558
  switch ( $this->get_type() ) {
559
  case 'custom' :
 
560
  $output .= $this->get_content();
561
  break;
562
 
557
 
558
  switch ( $this->get_type() ) {
559
  case 'custom' :
560
+ $output .= $label;
561
  $output .= $this->get_content();
562
  break;
563
 
includes/forms.php CHANGED
@@ -78,12 +78,6 @@ function tml_register_login_form() {
78
  ),
79
  'priority' => 30,
80
  ) );
81
-
82
- tml_add_form_field( 'login', 'testcookie', array(
83
- 'type' => 'hidden' ,
84
- 'value' => 1,
85
- 'priority' => 30,
86
- ) );
87
  }
88
 
89
  /**
78
  ),
79
  'priority' => 30,
80
  ) );
 
 
 
 
 
 
81
  }
82
 
83
  /**
includes/functions.php CHANGED
@@ -18,6 +18,49 @@ function theme_my_login() {
18
  return Theme_My_Login::get_instance();
19
  }
20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  /**
22
  * Parse the query.
23
  *
@@ -32,16 +75,22 @@ function tml_parse_query( $wp_query ) {
32
  return;
33
  }
34
 
 
 
 
 
 
35
  // Bail if not handling a TML action
36
  if ( ! tml_is_action() ) {
37
  return;
38
  }
39
 
40
  // Tell WordPress that this is a page
41
- $wp_query->is_page = true;
42
- $wp_query->is_singular = true;
43
- $wp_query->is_single = false;
44
- $wp_query->is_home = false;
 
45
 
46
  // No need to calculate found rows
47
  $wp_query->set( 'no_found_rows', true );
@@ -66,8 +115,8 @@ function tml_the_posts( $posts, $wp_query ) {
66
  return $posts;
67
  }
68
 
69
- // Bail if not handling a TML action
70
- if ( ! tml_is_action() ) {
71
  return $posts;
72
  }
73
 
@@ -219,9 +268,6 @@ function tml_enqueue_scripts() {
219
  * @since 7.0
220
  */
221
  function tml_add_rewrite_tags() {
222
- if ( ! tml_use_permalinks() ) {
223
- return;
224
- }
225
  add_rewrite_tag( '%action%', '([^/]+)' );
226
  }
227
 
@@ -393,6 +439,21 @@ function tml_filter_get_edit_post_link( $link, $post_id ) {
393
  return $link;
394
  }
395
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
396
  /**
397
  * Add TML action type to the Customizer menu editor.
398
  *
@@ -585,12 +646,13 @@ function tml_set_user_login( $sanitized_user_login ) {
585
  *
586
  * @since 7.0.1
587
  *
588
- * @param string $url The registration redirect URL.
 
589
  * @return string The registration redirect URL.
590
  */
591
- function tml_registration_redirect( $url ) {
592
  if ( tml_allow_auto_login() ) {
593
- $url = home_url();
594
  }
595
  return $url;
596
  }
18
  return Theme_My_Login::get_instance();
19
  }
20
 
21
+ /**
22
+ * Parse the request.
23
+ *
24
+ * @since 7.0.10
25
+ *
26
+ * @param $wp WP The WordPress object.
27
+ */
28
+ function tml_parse_request( $wp ) {
29
+
30
+ if ( ! isset( $wp->query_vars['action'] ) ) {
31
+ return;
32
+ }
33
+
34
+ $action = $wp->query_vars['action'];
35
+
36
+ // Fix some alias actions
37
+ if ( 'retrievepassword' == $action ) {
38
+ $action = 'lostpassword';
39
+ } elseif ( 'rp' == $action ) {
40
+ $action = 'resetpass';
41
+ }
42
+
43
+ // Ensure that the permalink action is passed
44
+ if ( ! empty( $wp->did_permalink ) && false === strpos( $wp->matched_query, "action=$action" ) ) {
45
+
46
+ // Get the action from the matched query
47
+ preg_match( '/action=([^&]+)/', $wp->matched_query, $matches );
48
+ if ( ! empty( $matches ) ) {
49
+ $action = $matches[1];
50
+ }
51
+ }
52
+
53
+ // Default the action to login if an action is set and it's not a TML action
54
+ if ( ! empty( $action ) && ! tml_action_exists( $action ) ) {
55
+ $action = 'login';
56
+ }
57
+
58
+ // Set the proper action
59
+ if ( $action != $wp->query_vars['action'] ) {
60
+ $wp->set_query_var( 'action', $action );
61
+ }
62
+ }
63
+
64
  /**
65
  * Parse the query.
66
  *
75
  return;
76
  }
77
 
78
+ // Bail if not home
79
+ if ( ! $wp_query->is_home || $wp_query->is_posts_page ) {
80
+ return;
81
+ }
82
+
83
  // Bail if not handling a TML action
84
  if ( ! tml_is_action() ) {
85
  return;
86
  }
87
 
88
  // Tell WordPress that this is a page
89
+ $wp_query->is_tml_action = true;
90
+ $wp_query->is_page = true;
91
+ $wp_query->is_singular = true;
92
+ $wp_query->is_single = false;
93
+ $wp_query->is_home = false;
94
 
95
  // No need to calculate found rows
96
  $wp_query->set( 'no_found_rows', true );
115
  return $posts;
116
  }
117
 
118
+ // Bail if not a TML action
119
+ if ( ! $wp_query->is_tml_action ) {
120
  return $posts;
121
  }
122
 
268
  * @since 7.0
269
  */
270
  function tml_add_rewrite_tags() {
 
 
 
271
  add_rewrite_tag( '%action%', '([^/]+)' );
272
  }
273
 
439
  return $link;
440
  }
441
 
442
+ /**
443
+ * Filter the comments.
444
+ *
445
+ * @since 7.0.10
446
+ *
447
+ * @param array $comments The comments.
448
+ * @return array The comments.
449
+ */
450
+ function tml_filter_comments_array( $comments ) {
451
+ if ( tml_is_action() ) {
452
+ return array();
453
+ }
454
+ return $comments;
455
+ }
456
+
457
  /**
458
  * Add TML action type to the Customizer menu editor.
459
  *
646
  *
647
  * @since 7.0.1
648
  *
649
+ * @param string $url The registration redirect URL.
650
+ * @param WP_User $user The user object.
651
  * @return string The registration redirect URL.
652
  */
653
+ function tml_registration_redirect( $url, $user ) {
654
  if ( tml_allow_auto_login() ) {
655
+ $url = apply_filters( 'login_redirect', home_url(), tml_get_request_value( 'redirect_to' ), $user );
656
  }
657
  return $url;
658
  }
includes/hooks.php CHANGED
@@ -22,6 +22,10 @@ add_action( 'init', 'tml_add_rewrite_rules' );
22
  // Widgets
23
  add_action( 'widgets_init', 'Theme_My_Login_Widget::register' );
24
 
 
 
 
 
25
  // Query
26
  add_action( 'parse_query', 'tml_parse_query' );
27
 
@@ -34,11 +38,12 @@ add_action( 'wp_enqueue_scripts', 'tml_enqueue_styles', 10 );
34
  add_action( 'wp_enqueue_scripts', 'tml_enqueue_scripts', 10 );
35
 
36
  // Registration
 
37
  add_action( 'register_new_user', 'tml_set_new_user_password' );
38
  add_action( 'register_new_user', 'tml_handle_auto_login' );
39
 
40
- add_action( 'register_new_user', 'tml_send_new_user_notifications' );
41
- add_action( 'edit_user_created_user', 'tml_send_new_user_notifications' );
42
 
43
  remove_action( 'register_new_user', 'wp_send_new_user_notifications' );
44
  remove_action( 'edit_user_created_user', 'wp_send_new_user_notifications' );
@@ -61,6 +66,7 @@ add_filter( 'the_posts', 'tml_the_posts', 10, 2 );
61
  add_filter( 'page_template', 'tml_page_template', 10, 3 );
62
  add_filter( 'body_class', 'tml_body_class', 10, 2 );
63
  add_filter( 'get_edit_post_link', 'tml_filter_get_edit_post_link', 10, 2 );
 
64
 
65
  // URLs
66
  add_filter( 'site_url', 'tml_filter_site_url', 10, 3 );
@@ -76,9 +82,8 @@ if ( tml_is_username_login_type() ) {
76
  }
77
 
78
  // Registration
79
- add_filter( 'registration_errors', 'tml_validate_new_user_password' );
80
- add_action( 'pre_user_login', 'tml_set_user_login' );
81
- add_filter( 'registration_redirect', 'tml_registration_redirect' );
82
 
83
  // Notifications
84
  add_filter( 'wp_new_user_notification_email', 'tml_add_password_notice_to_new_user_notification_email' );
22
  // Widgets
23
  add_action( 'widgets_init', 'Theme_My_Login_Widget::register' );
24
 
25
+
26
+ // Request
27
+ add_action( 'parse_request', 'tml_parse_request' );
28
+
29
  // Query
30
  add_action( 'parse_query', 'tml_parse_query' );
31
 
38
  add_action( 'wp_enqueue_scripts', 'tml_enqueue_scripts', 10 );
39
 
40
  // Registration
41
+ add_action( 'pre_user_login', 'tml_set_user_login' );
42
  add_action( 'register_new_user', 'tml_set_new_user_password' );
43
  add_action( 'register_new_user', 'tml_handle_auto_login' );
44
 
45
+ add_action( 'register_new_user', 'tml_send_new_user_notifications', 10, 1 );
46
+ add_action( 'edit_user_created_user', 'tml_send_new_user_notifications', 10, 2 );
47
 
48
  remove_action( 'register_new_user', 'wp_send_new_user_notifications' );
49
  remove_action( 'edit_user_created_user', 'wp_send_new_user_notifications' );
66
  add_filter( 'page_template', 'tml_page_template', 10, 3 );
67
  add_filter( 'body_class', 'tml_body_class', 10, 2 );
68
  add_filter( 'get_edit_post_link', 'tml_filter_get_edit_post_link', 10, 2 );
69
+ add_filter( 'comments_array', 'tml_filter_comments_array', 10, 1 );
70
 
71
  // URLs
72
  add_filter( 'site_url', 'tml_filter_site_url', 10, 3 );
82
  }
83
 
84
  // Registration
85
+ add_filter( 'registration_errors', 'tml_validate_new_user_password', 10, 1 );
86
+ add_filter( 'tml_registration_redirect', 'tml_registration_redirect', 10, 2 );
 
87
 
88
  // Notifications
89
  add_filter( 'wp_new_user_notification_email', 'tml_add_password_notice_to_new_user_notification_email' );
includes/shortcodes.php CHANGED
@@ -32,7 +32,7 @@ function tml_shortcode( $atts = array() ) {
32
  'action' => '',
33
  'show_links' => null,
34
  'redirect_to' => null,
35
- ), $atts );
36
 
37
  $content = '';
38
 
32
  'action' => '',
33
  'show_links' => null,
34
  'redirect_to' => null,
35
+ ), $atts, 'theme-my-login' );
36
 
37
  $content = '';
38
 
languages/theme-my-login.pot CHANGED
@@ -2,45 +2,45 @@
2
  # This file is distributed under the same license as the Theme My Login package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Theme My Login 7.0.9\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/theme-my-login\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "POT-Creation-Date: 2018-07-12T15:31:08-04:00\n"
13
- "PO-Revision-Date: 2018-07-12T15:31:08-04:00\n"
14
  "X-Domain: theme-my-login\n"
15
 
16
- #: includes/functions.php:406
17
- #: admin/functions.php:266
18
  msgid "Theme My Login Actions"
19
  msgstr ""
20
 
21
- #: includes/functions.php:407
22
  msgid "Theme My Login Action"
23
  msgstr ""
24
 
25
- #: includes/functions.php:435
26
- #: includes/functions.php:462
27
- #: includes/functions.php:477
28
  msgid "TML Action"
29
  msgstr ""
30
 
31
- #: includes/functions.php:539
32
  msgid "<strong>ERROR</strong>: Please enter a password."
33
  msgstr ""
34
 
35
- #: includes/functions.php:542
36
  msgid "<strong>ERROR</strong>: Passwords may not contain the character \"\\\"."
37
  msgstr ""
38
 
39
- #: includes/functions.php:545
40
  msgid "<strong>ERROR</strong>: Please enter the same password in both password fields."
41
  msgstr ""
42
 
43
- #: includes/functions.php:561
44
  msgid "If you have already set your own password, you may disregard this email and use the password you have already set."
45
  msgstr ""
46
 
@@ -48,7 +48,7 @@ msgstr ""
48
  msgid "Your Data Request"
49
  msgstr ""
50
 
51
- #: includes/actions.php:426
52
  msgid "Registration complete. You may now log in."
53
  msgstr ""
54
 
@@ -67,7 +67,7 @@ msgstr ""
67
  msgid "Show action links?"
68
  msgstr ""
69
 
70
- #: includes/forms.php:139
71
  msgid "Confirm Password"
72
  msgstr ""
73
 
@@ -119,37 +119,37 @@ msgstr ""
119
  msgid "Extensions"
120
  msgstr ""
121
 
122
- #: admin/functions.php:151
123
  msgid "As a token of our gratitude, we would like to offer your an incentive for upgrading Theme My Login to version 7.0. For a limited time, we are offering a <strong>20% discount</strong> when you use the code <strong>SAVINGFACE</strong> at checkout. Act now - this offer won't last!"
124
  msgstr ""
125
 
126
- #: admin/functions.php:167
127
  msgid "A new <strong>Theme My Login</strong> extension is available!"
128
  msgstr ""
129
 
130
- #: admin/functions.php:174
131
  #: admin/extensions.php:95
132
  msgid "Get This Extension"
133
  msgstr ""
134
 
135
- #: admin/functions.php:371
136
- #: admin/functions.php:384
137
  msgid "Deactivating Theme My Login"
138
  msgstr ""
139
 
140
- #: admin/functions.php:372
141
  msgid "Before you go, please take a moment to let us know why you are deactivating:"
142
  msgstr ""
143
 
144
- #: admin/functions.php:376
145
  msgid "Submitting this form will also include your WordPress version, TML version, PHP version and whether this is a multisite installation or not."
146
  msgstr ""
147
 
148
- #: admin/functions.php:379
149
  msgid "Submit & Deactivate"
150
  msgstr ""
151
 
152
- #: admin/functions.php:380
153
  msgid "No thanks, just deactivate"
154
  msgstr ""
155
 
2
  # This file is distributed under the same license as the Theme My Login package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Theme My Login 7.0.10\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/theme-my-login\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "POT-Creation-Date: 2018-08-02T18:14:45-04:00\n"
13
+ "PO-Revision-Date: 2018-08-02T18:14:45-04:00\n"
14
  "X-Domain: theme-my-login\n"
15
 
16
+ #: includes/functions.php:467
17
+ #: admin/functions.php:271
18
  msgid "Theme My Login Actions"
19
  msgstr ""
20
 
21
+ #: includes/functions.php:468
22
  msgid "Theme My Login Action"
23
  msgstr ""
24
 
25
+ #: includes/functions.php:496
26
+ #: includes/functions.php:523
27
+ #: includes/functions.php:538
28
  msgid "TML Action"
29
  msgstr ""
30
 
31
+ #: includes/functions.php:600
32
  msgid "<strong>ERROR</strong>: Please enter a password."
33
  msgstr ""
34
 
35
+ #: includes/functions.php:603
36
  msgid "<strong>ERROR</strong>: Passwords may not contain the character \"\\\"."
37
  msgstr ""
38
 
39
+ #: includes/functions.php:606
40
  msgid "<strong>ERROR</strong>: Please enter the same password in both password fields."
41
  msgstr ""
42
 
43
+ #: includes/functions.php:622
44
  msgid "If you have already set your own password, you may disregard this email and use the password you have already set."
45
  msgstr ""
46
 
48
  msgid "Your Data Request"
49
  msgstr ""
50
 
51
+ #: includes/actions.php:427
52
  msgid "Registration complete. You may now log in."
53
  msgstr ""
54
 
67
  msgid "Show action links?"
68
  msgstr ""
69
 
70
+ #: includes/forms.php:133
71
  msgid "Confirm Password"
72
  msgstr ""
73
 
119
  msgid "Extensions"
120
  msgstr ""
121
 
122
+ #: admin/functions.php:156
123
  msgid "As a token of our gratitude, we would like to offer your an incentive for upgrading Theme My Login to version 7.0. For a limited time, we are offering a <strong>20% discount</strong> when you use the code <strong>SAVINGFACE</strong> at checkout. Act now - this offer won't last!"
124
  msgstr ""
125
 
126
+ #: admin/functions.php:172
127
  msgid "A new <strong>Theme My Login</strong> extension is available!"
128
  msgstr ""
129
 
130
+ #: admin/functions.php:179
131
  #: admin/extensions.php:95
132
  msgid "Get This Extension"
133
  msgstr ""
134
 
135
+ #: admin/functions.php:379
136
+ #: admin/functions.php:392
137
  msgid "Deactivating Theme My Login"
138
  msgstr ""
139
 
140
+ #: admin/functions.php:380
141
  msgid "Before you go, please take a moment to let us know why you are deactivating:"
142
  msgstr ""
143
 
144
+ #: admin/functions.php:384
145
  msgid "Submitting this form will also include your WordPress version, TML version, PHP version and whether this is a multisite installation or not."
146
  msgstr ""
147
 
148
+ #: admin/functions.php:387
149
  msgid "Submit & Deactivate"
150
  msgstr ""
151
 
152
+ #: admin/functions.php:388
153
  msgid "No thanks, just deactivate"
154
  msgstr ""
155
 
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: thememylogin, jfarthing84
3
  Tags: login, register, password, branding, customize, widget, wp-login, wp-login.php
4
  Requires at least: 4.6
5
- Tested up to: 4.9.7
6
- Stable tag: 7.0.9
7
 
8
  The ultimate login branding solution! Theme My Login offers matchless customization of your WordPress user experience!
9
 
@@ -59,6 +59,18 @@ Report bugs, suggest ideas and participate in development at [GitHub](https://gi
59
 
60
  == Changelog ==
61
 
 
 
 
 
 
 
 
 
 
 
 
 
62
  = 7.0.9 =
63
  * Fix fatal error on PHP versions less than 5.5
64
  * Apply `tml_get_action_tile` filter at the object level
2
  Contributors: thememylogin, jfarthing84
3
  Tags: login, register, password, branding, customize, widget, wp-login, wp-login.php
4
  Requires at least: 4.6
5
+ Tested up to: 4.9.8
6
+ Stable tag: 7.0.10
7
 
8
  The ultimate login branding solution! Theme My Login offers matchless customization of your WordPress user experience!
9
 
59
 
60
  == Changelog ==
61
 
62
+ = 7.0.10 =
63
+ * Fix admin notices displaying for non-privileged users
64
+ * Reinstate default testcookie method
65
+ * Don't allow TML actions to stomp on other content
66
+ * Don't allow TML actions to stomp on other TML actions
67
+ * Allow non-TML actions to be handled
68
+ * Include labels for custom fields if present
69
+ * Hide comments on TML pages
70
+ * Fix generation of non-pretty action links
71
+ * Apply `login_redirect` filter to auto-login registration redirect
72
+ * Fix new user notification being sent when unchecked upon creating a user
73
+
74
  = 7.0.9 =
75
  * Fix fatal error on PHP versions less than 5.5
76
  * Apply `tml_get_action_tile` filter at the object level
theme-my-login.php CHANGED
@@ -10,7 +10,7 @@
10
  Plugin Name: Theme My Login
11
  Plugin URI: https://thememylogin.com
12
  Description: Creates an alternate login, registration and password recovery experience within your theme.
13
- Version: 7.0.9
14
  Author: Theme My Login
15
  Author URI: https://thememylogin.com
16
  License: GPLv2
@@ -24,7 +24,7 @@ Network: true
24
  *
25
  * @since 7.0
26
  */
27
- define( 'THEME_MY_LOGIN_VERSION', '7.0.9' );
28
 
29
  /**
30
  * Stores the path to TML.
10
  Plugin Name: Theme My Login
11
  Plugin URI: https://thememylogin.com
12
  Description: Creates an alternate login, registration and password recovery experience within your theme.
13
+ Version: 7.0.10
14
  Author: Theme My Login
15
  Author URI: https://thememylogin.com
16
  License: GPLv2
24
  *
25
  * @since 7.0
26
  */
27
+ define( 'THEME_MY_LOGIN_VERSION', '7.0.10' );
28
 
29
  /**
30
  * Stores the path to TML.