Theme My Login - Version 6.3.7

Version Description

  • Revert tml_page post type back to default WP pages
  • Fix issue where SSL warnings were displayed in reCAPTCHA module
  • Fix issue where a blank page resulted when 404.php didn't exist in a theme
  • Fix issue where User Links couldn't be deleted
  • Fix issue where "Are you sure?" would display when attempting to log out
  • Fix issue where strings weren't being translated on Profile page
Download this release

Release Info

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

Code changes from version 6.3.6 to 6.3.7

admin/class-theme-my-login-admin.php CHANGED
@@ -223,6 +223,8 @@ class Theme_My_Login_Admin extends Theme_My_Login_Abstract {
223
  * @access public
224
  */
225
  public function install() {
 
 
226
  // Current version
227
  $version = $this->get_option( 'version', Theme_My_Login::version );
228
 
@@ -275,20 +277,27 @@ class Theme_My_Login_Admin extends Theme_My_Login_Abstract {
275
  if ( 'trash' == $page->post_status )
276
  wp_untrash_post( $page->ID );
277
 
278
- // Change to new post type
279
- set_post_type( $page->ID, 'tml_page' );
280
-
281
  update_post_meta( $page->ID, '_tml_action', 'login' );
282
  }
283
  }
284
 
 
 
 
 
 
 
 
 
 
285
  // Setup default pages
286
  foreach ( Theme_My_Login::default_pages() as $action => $title ) {
287
  if ( ! $page_id = Theme_My_Login::get_page_id( $action ) ) {
288
  $page_id = wp_insert_post( array(
289
  'post_title' => $title,
 
290
  'post_status' => 'publish',
291
- 'post_type' => 'tml_page',
292
  'post_content' => '[theme-my-login]',
293
  'comment_status' => 'closed',
294
  'ping_status' => 'closed'
@@ -297,9 +306,6 @@ class Theme_My_Login_Admin extends Theme_My_Login_Abstract {
297
  }
298
  }
299
 
300
- // Generate permalinks
301
- flush_rewrite_rules( false );
302
-
303
  // Activate modules
304
  foreach ( $this->get_option( 'active_modules', array() ) as $module ) {
305
  if ( file_exists( WP_PLUGIN_DIR . '/theme-my-login/modules/' . $module ) )
@@ -354,13 +360,17 @@ class Theme_My_Login_Admin extends Theme_My_Login_Abstract {
354
  do_action( 'tml_uninstall_' . $module );
355
  }
356
 
357
- // Remove delete block
358
- remove_action( 'wp_trash_post', array( self::get_object(), 'wp_trash_post' ) );
 
 
 
 
 
359
 
360
- // Delete the pages
361
- $pages = get_posts( array( 'post_type' => 'tml_page', 'post_status' => 'any', 'posts_per_page' => -1 ) );
362
  foreach ( $pages as $page ) {
363
- wp_delete_post( $page->ID );
364
  }
365
 
366
  // Delete options
223
  * @access public
224
  */
225
  public function install() {
226
+ global $wpdb;
227
+
228
  // Current version
229
  $version = $this->get_option( 'version', Theme_My_Login::version );
230
 
277
  if ( 'trash' == $page->post_status )
278
  wp_untrash_post( $page->ID );
279
 
 
 
 
280
  update_post_meta( $page->ID, '_tml_action', 'login' );
281
  }
282
  }
283
 
284
+ // 6.4 upgrade
285
+ if ( version_compare( $version, '6.3.7', '<' ) ) {
286
+ // Convert TML pages to regular pages
287
+ $wpdb->update( $wpdb->posts, array( 'post_type' => 'page' ), array( 'post_type' => 'tml_page' ) );
288
+
289
+ // Get rid of stale rewrite rules
290
+ flush_rewrite_rules( false );
291
+ }
292
+
293
  // Setup default pages
294
  foreach ( Theme_My_Login::default_pages() as $action => $title ) {
295
  if ( ! $page_id = Theme_My_Login::get_page_id( $action ) ) {
296
  $page_id = wp_insert_post( array(
297
  'post_title' => $title,
298
+ 'post_name' => $action,
299
  'post_status' => 'publish',
300
+ 'post_type' => 'page',
301
  'post_content' => '[theme-my-login]',
302
  'comment_status' => 'closed',
303
  'ping_status' => 'closed'
306
  }
307
  }
308
 
 
 
 
309
  // Activate modules
310
  foreach ( $this->get_option( 'active_modules', array() ) as $module ) {
311
  if ( file_exists( WP_PLUGIN_DIR . '/theme-my-login/modules/' . $module ) )
360
  do_action( 'tml_uninstall_' . $module );
361
  }
362
 
363
+ // Get pages
364
+ $pages = get_posts( array(
365
+ 'post_type' => 'page',
366
+ 'post_status' => 'any',
367
+ 'meta_key' => '_tml_action',
368
+ 'posts_per_page' => -1
369
+ ) );
370
 
371
+ // Delete pages
 
372
  foreach ( $pages as $page ) {
373
+ wp_delete_post( $page->ID, true );
374
  }
375
 
376
  // Delete options
includes/class-theme-my-login.php CHANGED
@@ -21,7 +21,7 @@ class Theme_My_Login extends Theme_My_Login_Abstract {
21
  * @since 6.3.2
22
  * @const string
23
  */
24
- const version = '6.3.6';
25
 
26
  /**
27
  * Holds options key
@@ -143,14 +143,13 @@ class Theme_My_Login extends Theme_My_Login_Abstract {
143
  add_action( 'wp_print_footer_scripts', array( &$this, 'wp_print_footer_scripts' ) );
144
  add_action( 'wp_authenticate', array( &$this, 'wp_authenticate' ) );
145
 
146
- add_filter( 'rewrite_rules_array', array( &$this, 'rewrite_rules_array' ) );
147
- add_filter( 'template_include', array( &$this, 'template_include' ) );
148
  add_filter( 'site_url', array( &$this, 'site_url' ), 10, 3 );
149
  add_filter( 'logout_url', array( &$this, 'logout_url' ), 10, 2 );
150
  add_filter( 'single_post_title', array( &$this, 'single_post_title' ) );
151
  add_filter( 'the_title', array( &$this, 'the_title' ), 10, 2 );
152
  add_filter( 'wp_setup_nav_menu_item', array( &$this, 'wp_setup_nav_menu_item' ) );
153
- add_filter( 'post_type_link', array( &$this, 'post_type_link' ), 10, 4 );
 
154
 
155
  add_action( 'tml_new_user_registered', 'wp_new_user_notification', 10, 2 );
156
  add_action( 'tml_user_password_changed', 'wp_password_change_notification' );
@@ -186,19 +185,6 @@ class Theme_My_Login extends Theme_My_Login_Abstract {
186
  public function init() {
187
  self::load_textdomain();
188
 
189
- register_post_type( 'tml_page', array(
190
- 'public' => true,
191
- 'show_in_menu' => 'theme_my_login',
192
- 'hierarchical' => true,
193
- 'supports' => array( 'title', 'editor', 'page-attributes' ),
194
- 'rewrite' => false,
195
- 'labels' => array(
196
- 'name' => __( 'Theme My Login Pages', 'theme-my-login' ),
197
- 'singular_name' => __( 'Theme My Login Page', 'theme-my-login' ),
198
- 'menu_name' => __( 'Pages' )
199
- )
200
- ) );
201
-
202
  $this->errors = new WP_Error();
203
 
204
  if ( ! is_admin() && $this->get_option( 'enable_css' ) )
@@ -572,44 +558,6 @@ if(typeof wpOnload=='function')wpOnload()
572
  * Filters
573
  ************************************************************************************************************************/
574
 
575
- /**
576
- * Generates verbose rewrite rules for plugin pages
577
- *
578
- * @since 6.3.4
579
- *
580
- * @param array $rules Rewrite rules
581
- * @return array Rewrite rules
582
- */
583
- public function rewrite_rules_array( $rules ) {
584
- $pages = get_posts( array(
585
- 'post_type' => 'tml_page',
586
- 'posts_per_page' => -1
587
- ) );
588
-
589
- $tml_rules = array();
590
- foreach ( $pages as $page ) {
591
- $tml_rules["{$page->post_name}/?$"] = "index.php?tml_page={$page->post_name}";
592
- }
593
-
594
- return array_merge( $tml_rules, $rules );
595
- }
596
-
597
- /**
598
- * Uses Page template hierarchy for TML pages
599
- *
600
- * @since 6.3
601
- *
602
- * @param string $template The template to include
603
- * @return string The template to include
604
- */
605
- public function template_include( $template ) {
606
- if ( self::is_tml_page() ) {
607
- if ( $page_template = get_page_template() )
608
- return $page_template;
609
- }
610
- return $template;
611
- }
612
-
613
  /**
614
  * Rewrites URL's containing wp-login.php created by site_url()
615
  *
@@ -654,7 +602,6 @@ if(typeof wpOnload=='function')wpOnload()
654
  $logout_url = self::get_page_link( 'logout' );
655
  if ( $redirect )
656
  $logout = add_query_arg( 'redirect_to', urlencode( $redirect ), $logout_url );
657
- $logout_url = wp_nonce_url( $logout_url, 'log-out' );
658
  return $logout_url;
659
  }
660
 
@@ -716,7 +663,7 @@ if(typeof wpOnload=='function')wpOnload()
716
  if ( is_admin() )
717
  return $menu_item;
718
 
719
- if ( 'tml_page' == $menu_item->object && self::is_tml_page( 'login', $menu_item->object_id ) ) {
720
  if ( is_user_logged_in() ) {
721
  $menu_item->title = $this->get_instance()->get_title( 'logout' );
722
  $menu_item->url = wp_logout_url();
@@ -726,24 +673,38 @@ if(typeof wpOnload=='function')wpOnload()
726
  }
727
 
728
  /**
729
- * Applies page permalink to TML pages
730
  *
731
- * @since 6.3
732
  *
733
- * @param string $post_link Post link
734
- * @param object $post Post object
735
- * @param bool $leavename
736
- * @param bool $sample
737
- * @return string Post link
738
  */
739
- public function post_type_link( $post_link, $post, $leavename, $sample ) {
740
- global $wp_rewrite;
 
 
 
 
 
 
741
 
742
- if ( $wp_rewrite->using_permalinks() ) {
743
- if ( 'tml_page' == $post->post_type )
744
- $post_link = get_page_link( $post->ID, $leavename, $sample );
745
- }
746
- return $post_link;
 
 
 
 
 
 
 
 
 
 
 
747
  }
748
 
749
 
@@ -819,7 +780,7 @@ if(typeof wpOnload=='function')wpOnload()
819
  if ( ! $page = get_post( $page ) )
820
  return false;
821
 
822
- if ( 'tml_page' != $page->post_type )
823
  return false;
824
 
825
  if ( empty( $action ) )
@@ -867,6 +828,10 @@ if(typeof wpOnload=='function')wpOnload()
867
  $link = add_query_arg( array_map( 'rawurlencode', $args ), $link );
868
  }
869
 
 
 
 
 
870
  return apply_filters( 'tml_page_link', $link, $action, $query );
871
  }
872
 
@@ -886,9 +851,10 @@ if(typeof wpOnload=='function')wpOnload()
886
  elseif ( 'retrievepassword' == $action )
887
  $action = 'lostpassword';
888
 
889
- $page_id = wp_cache_get( $action, 'tml_page_ids' );
890
- if ( false === $page_id ) {
891
- $page_id = $wpdb->get_var( $wpdb->prepare( "SELECT p.ID FROM $wpdb->posts p LEFT JOIN $wpdb->postmeta pmeta ON p.ID = pmeta.post_id WHERE p.post_type = 'tml_page' AND pmeta.meta_key = '_tml_action' AND pmeta.meta_value = %s", $action ) );
 
892
  wp_cache_add( $action, $page_id, 'tml_page_ids' );
893
  }
894
  return $page_id;
21
  * @since 6.3.2
22
  * @const string
23
  */
24
+ const version = '6.3.7';
25
 
26
  /**
27
  * Holds options key
143
  add_action( 'wp_print_footer_scripts', array( &$this, 'wp_print_footer_scripts' ) );
144
  add_action( 'wp_authenticate', array( &$this, 'wp_authenticate' ) );
145
 
 
 
146
  add_filter( 'site_url', array( &$this, 'site_url' ), 10, 3 );
147
  add_filter( 'logout_url', array( &$this, 'logout_url' ), 10, 2 );
148
  add_filter( 'single_post_title', array( &$this, 'single_post_title' ) );
149
  add_filter( 'the_title', array( &$this, 'the_title' ), 10, 2 );
150
  add_filter( 'wp_setup_nav_menu_item', array( &$this, 'wp_setup_nav_menu_item' ) );
151
+ add_filter( 'wp_list_pages_excludes', array( &$this, 'wp_list_pages_excludes' ) );
152
+ add_filter( 'page_link', array( &$this, 'page_link' ), 10, 2 );
153
 
154
  add_action( 'tml_new_user_registered', 'wp_new_user_notification', 10, 2 );
155
  add_action( 'tml_user_password_changed', 'wp_password_change_notification' );
185
  public function init() {
186
  self::load_textdomain();
187
 
 
 
 
 
 
 
 
 
 
 
 
 
 
188
  $this->errors = new WP_Error();
189
 
190
  if ( ! is_admin() && $this->get_option( 'enable_css' ) )
558
  * Filters
559
  ************************************************************************************************************************/
560
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
561
  /**
562
  * Rewrites URL's containing wp-login.php created by site_url()
563
  *
602
  $logout_url = self::get_page_link( 'logout' );
603
  if ( $redirect )
604
  $logout = add_query_arg( 'redirect_to', urlencode( $redirect ), $logout_url );
 
605
  return $logout_url;
606
  }
607
 
663
  if ( is_admin() )
664
  return $menu_item;
665
 
666
+ if ( 'page' == $menu_item->object && self::is_tml_page( 'login', $menu_item->object_id ) ) {
667
  if ( is_user_logged_in() ) {
668
  $menu_item->title = $this->get_instance()->get_title( 'logout' );
669
  $menu_item->url = wp_logout_url();
673
  }
674
 
675
  /**
676
+ * Excludes pages from wp_list_pages
677
  *
678
+ * @since 6.3.7
679
  *
680
+ * @param array $exclude Page IDs to exclude
681
+ * @return array Page IDs to exclude
 
 
 
682
  */
683
+ public function wp_list_pages_excludes( $exclude ) {
684
+ $pages = get_posts( array(
685
+ 'post_type' => 'page',
686
+ 'post_status' => 'any',
687
+ 'meta_key' => '_tml_action',
688
+ 'posts_per_page' => -1
689
+ ) );
690
+ $pages = wp_list_pluck( $pages, 'ID' );
691
 
692
+ return array_merge( $exclude, $pages );
693
+ }
694
+
695
+ /**
696
+ * Adds nonce to logout link
697
+ *
698
+ * @since 6.3.7
699
+ *
700
+ * @param string $link Page link
701
+ * @param int $post_id Post ID
702
+ * @return string Page link
703
+ */
704
+ public function page_link( $link, $post_id ) {
705
+ if ( self::is_tml_page( 'logout', $post_id ) )
706
+ $link = add_query_arg( '_wpnonce', wp_create_nonce( 'log-out' ), $link );
707
+ return $link;
708
  }
709
 
710
 
780
  if ( ! $page = get_post( $page ) )
781
  return false;
782
 
783
+ if ( 'page' != $page->post_type )
784
  return false;
785
 
786
  if ( empty( $action ) )
828
  $link = add_query_arg( array_map( 'rawurlencode', $args ), $link );
829
  }
830
 
831
+ // Respect FORCE_SSL_LOGIN
832
+ if ( 'login' == $action && force_ssl_login() )
833
+ $link = preg_replace( '|^http://|', 'https://', $link );
834
+
835
  return apply_filters( 'tml_page_link', $link, $action, $query );
836
  }
837
 
851
  elseif ( 'retrievepassword' == $action )
852
  $action = 'lostpassword';
853
 
854
+ if ( ! $page_id = wp_cache_get( $action, 'tml_page_ids' ) ) {
855
+ $page_id = $wpdb->get_var( $wpdb->prepare( "SELECT p.ID FROM $wpdb->posts p LEFT JOIN $wpdb->postmeta pmeta ON p.ID = pmeta.post_id WHERE p.post_type = 'page' AND pmeta.meta_key = '_tml_action' AND pmeta.meta_value = %s", $action ) );
856
+ if ( ! $page_id )
857
+ return null;
858
  wp_cache_add( $action, $page_id, 'tml_page_ids' );
859
  }
860
  return $page_id;
modules/custom-email/custom-email.php CHANGED
@@ -553,7 +553,7 @@ class Theme_My_Login_Custom_Email extends Theme_My_Login_Abstract {
553
  $this->get_option( array( 'user_approval', 'admin_mail_from_name' ) ),
554
  $this->get_option( array( 'user_approval', 'admin_mail_content_type' ) )
555
  );
556
- add_filter( 'user_approval_admin_notifcation_mail_to', array( &$this, 'user_approval_admin_notifcation_mail_to_filter' ) );
557
  add_filter( 'user_approval_admin_notification_title', array( &$this, 'user_approval_admin_notification_title_filter' ), 10, 2 );
558
  add_filter( 'user_approval_admin_notification_message', array( &$this, 'user_approval_admin_notification_message_filter' ), 10, 2 );
559
  break;
@@ -695,7 +695,7 @@ class Theme_My_Login_Custom_Email extends Theme_My_Login_Abstract {
695
  * @param string $to The default recipient
696
  * @return string The filtered recipient
697
  */
698
- public function user_approval_admin_notifcation_mail_to_filter( $to ) {
699
  $_to = $this->get_option( array( 'user_approval', 'admin_mail_to' ) );
700
  return empty( $_to ) ? $to : $_to;
701
  }
553
  $this->get_option( array( 'user_approval', 'admin_mail_from_name' ) ),
554
  $this->get_option( array( 'user_approval', 'admin_mail_content_type' ) )
555
  );
556
+ add_filter( 'user_approval_admin_notification_mail_to', array( &$this, 'user_approval_admin_notification_mail_to_filter' ) );
557
  add_filter( 'user_approval_admin_notification_title', array( &$this, 'user_approval_admin_notification_title_filter' ), 10, 2 );
558
  add_filter( 'user_approval_admin_notification_message', array( &$this, 'user_approval_admin_notification_message_filter' ), 10, 2 );
559
  break;
695
  * @param string $to The default recipient
696
  * @return string The filtered recipient
697
  */
698
+ public function user_approval_admin_notification_mail_to_filter( $to ) {
699
  $_to = $this->get_option( array( 'user_approval', 'admin_mail_to' ) );
700
  return empty( $_to ) ? $to : $_to;
701
  }
modules/custom-user-links/admin/custom-user-links-admin.php CHANGED
@@ -255,32 +255,36 @@ class Theme_My_Login_Custom_User_Links_Admin extends Theme_My_Login_Abstract {
255
  * @return string|array Sanitized settings
256
  */
257
  public function save_settings( $settings ) {
 
 
258
  // Bail-out if doing AJAX because it has it's own saving routine
259
  if ( defined( 'DOING_AJAX' ) && DOING_AJAX )
260
  return $settings;
261
 
262
- // Handle updating/deleting of links
263
- if ( ! empty( $_POST['user_links'] ) && is_array( $_POST['user_links'] ) ) {
264
- foreach ( $_POST['user_links'] as $role => $links ) {
265
- foreach ( $links as $key => $link ) {
 
 
 
 
 
266
  $clean_title = wp_kses( $link['title'], null );
267
  $clean_url = wp_kses( $link['url'], null );
268
- $links[$key] = array(
269
- 'title' => $clean_title,
270
- 'url' => $clean_url
271
- );
272
- if ( ( empty( $clean_title ) && empty( $clean_url ) ) || ( isset( $_POST['delete_user_link'][$role][$key] ) ) )
273
- unset( $links[$key] );
274
  }
275
- $settings[$role] = $links;
276
  }
277
- }
278
 
279
- // Handle new links
280
- if ( ! empty( $_POST['new_user_link'] ) && is_array( $_POST['new_user_link'] ) ) {
281
- foreach ( $_POST['new_user_link'] as $role => $link ) {
282
- $clean_title = wp_kses( $link['title'], null );
283
- $clean_url = wp_kses( $link['url'], null );
284
  if ( ! empty( $clean_title ) && ! empty( $clean_url ) ) {
285
  $settings[$role][] = array(
286
  'title' => $clean_title,
@@ -290,9 +294,6 @@ class Theme_My_Login_Custom_User_Links_Admin extends Theme_My_Login_Abstract {
290
  }
291
  }
292
 
293
- // Reset link keys
294
- $settings = array_map( 'array_values', $settings );
295
-
296
  return $settings;
297
  }
298
 
255
  * @return string|array Sanitized settings
256
  */
257
  public function save_settings( $settings ) {
258
+ global $wp_roles;
259
+
260
  // Bail-out if doing AJAX because it has it's own saving routine
261
  if ( defined( 'DOING_AJAX' ) && DOING_AJAX )
262
  return $settings;
263
 
264
+ foreach ( $wp_roles->get_names() as $role => $role_name ) {
265
+ if ( 'pending' == $role )
266
+ continue;
267
+
268
+ $settings[$role] = array();
269
+
270
+ // Handle updating/deleting of links
271
+ if ( ! empty( $_POST['user_links'] ) && ! empty( $_POST['user_links'][$role] ) ) {
272
+ foreach ( (array) $_POST['user_links'][$role] as $key => $link ) {
273
  $clean_title = wp_kses( $link['title'], null );
274
  $clean_url = wp_kses( $link['url'], null );
275
+ if ( ! empty( $clean_title ) && ! empty( $clean_url ) && ! isset( $_POST['delete_user_link'][$role][$key] ) ) {
276
+ $settings[$role][] = array(
277
+ 'title' => $clean_title,
278
+ 'url' => $clean_url
279
+ );
280
+ }
281
  }
 
282
  }
 
283
 
284
+ // Handle new links
285
+ if ( ! empty( $_POST['new_user_link'] ) && ! empty( $_POST['new_user_link'][$role] ) ) {
286
+ $clean_title = wp_kses( $_POST['new_user_link'][$role]['title'], null );
287
+ $clean_url = wp_kses( $_POST['new_user_link'][$role]['url'], null );
 
288
  if ( ! empty( $clean_title ) && ! empty( $clean_url ) ) {
289
  $settings[$role][] = array(
290
  'title' => $clean_title,
294
  }
295
  }
296
 
 
 
 
297
  return $settings;
298
  }
299
 
modules/recaptcha/recaptcha.php CHANGED
@@ -25,7 +25,15 @@ class Theme_My_Login_Recaptcha extends Theme_My_Login_Abstract {
25
  * @since 6.3
26
  * @const string
27
  */
28
- const RECAPTCHA_API_URI = 'http://www.google.com/recaptcha/api';
 
 
 
 
 
 
 
 
29
 
30
  /**
31
  * Holds options key
@@ -73,15 +81,17 @@ class Theme_My_Login_Recaptcha extends Theme_My_Login_Abstract {
73
  if ( ! ( $this->get_option( 'public_key' ) || $this->get_option( 'private_key' ) ) )
74
  return;
75
 
 
 
76
  add_action( 'wp_enqueue_scripts', array( &$this, 'wp_enqueue_scripts' ) );
77
 
78
- add_action( 'register_form', array( &$this, 'register_form' ) );
79
  add_filter( 'registration_errors', array( &$this, 'registration_errors' ) );
80
 
81
  if ( is_multisite() ) {
82
- add_action( 'signup_extra_fields', array( &$this, 'recaptcha_display' ) );
83
- add_filter( 'wpmu_validate_user_signup', array( &$this, 'recaptcha_validate' ) );
84
- add_filter( 'wpmu_validate_blog_signup', array( &$this, 'recaptcha_validate' ) );
85
  }
86
  }
87
 
@@ -91,7 +101,7 @@ class Theme_My_Login_Recaptcha extends Theme_My_Login_Abstract {
91
  * @since 6.3
92
  */
93
  function wp_enqueue_scripts() {
94
- wp_enqueue_script( 'recaptcha', 'http://www.google.com/recaptcha/api/js/recaptcha_ajax.js' );
95
  wp_enqueue_script( 'theme-my-login-recaptcha', plugins_url( 'theme-my-login/modules/recaptcha/js/recaptcha.js' ), array( 'recaptcha', 'jquery' ) );
96
  wp_localize_script( 'theme-my-login-recaptcha', 'tmlRecaptcha', array(
97
  'publickey' => $this->get_option( 'public_key' ),
@@ -99,15 +109,6 @@ class Theme_My_Login_Recaptcha extends Theme_My_Login_Abstract {
99
  ) );
100
  }
101
 
102
- /**
103
- * Renders reCAPTCHA on register form
104
- *
105
- * @since 6.3
106
- */
107
- public function register_form() {
108
- $this->recaptcha_display();
109
- }
110
-
111
  /**
112
  * Retrieves reCAPTCHA errors
113
  *
@@ -124,23 +125,36 @@ class Theme_My_Login_Recaptcha extends Theme_My_Login_Abstract {
124
 
125
  switch ( $error_code ) {
126
  case 'invalid-site-private-key' :
127
- $errors->add( $error_code, __( '<strong>ERROR</strong>: Invalid reCAPTCHA private key.', 'theme-my-login' ) );
128
  break;
129
  case 'invalid-request-cookie' :
130
- $errors->add( $error_code, __( '<strong>ERROR</strong>: Invalid reCAPTCHA challenge parameter.', 'theme-my-login' ) );
131
  break;
132
  case 'incorrect-captcha-sol' :
133
- $errors->add( $error_code, __( '<strong>ERROR</strong>: Incorrect captcha code.', 'theme-my-login' ) );
134
  break;
135
  case 'recaptcha-not-reachable' :
136
  default :
137
- $errors->add( $error_code, __( '<strong>ERROR</strong>: Unable to reach the reCAPTCHA server.', 'theme-my-login' ) );
138
  break;
139
  }
140
  }
141
  return $errors;
142
  }
143
 
 
 
 
 
 
 
 
 
 
 
 
 
 
144
  /**
145
  * Displays reCAPTCHA
146
  *
@@ -148,6 +162,11 @@ class Theme_My_Login_Recaptcha extends Theme_My_Login_Abstract {
148
  * @access public
149
  */
150
  public function recaptcha_display( $errors = null ) {
 
 
 
 
 
151
  ?>
152
  <div id="recaptcha">
153
  <noscript>
@@ -166,7 +185,7 @@ class Theme_My_Login_Recaptcha extends Theme_My_Login_Abstract {
166
  * @access public
167
  */
168
  public function recaptcha_validate( $remote_ip, $challenge, $response ) {
169
- $response = wp_remote_post( self::RECAPTCHA_API_URI . '/verify', array(
170
  'body' => array(
171
  'privatekey' => $this->get_option( 'private_key' ),
172
  'remoteip' => $remote_ip,
25
  * @since 6.3
26
  * @const string
27
  */
28
+ const RECAPTCHA_API_URI = 'www.google.com/recaptcha/api';
29
+
30
+ /**
31
+ * Holds reCAPTCHA API URL
32
+ *
33
+ * @since 6.3.7
34
+ * @var string
35
+ */
36
+ private $recaptcha_api_url;
37
 
38
  /**
39
  * Holds options key
81
  if ( ! ( $this->get_option( 'public_key' ) || $this->get_option( 'private_key' ) ) )
82
  return;
83
 
84
+ $this->recaptcha_api_url = ( is_ssl() ? 'https://' : 'http://' ) . self::RECAPTCHA_API_URI;
85
+
86
  add_action( 'wp_enqueue_scripts', array( &$this, 'wp_enqueue_scripts' ) );
87
 
88
+ add_action( 'register_form', array( &$this, 'recaptcha_display' ) );
89
  add_filter( 'registration_errors', array( &$this, 'registration_errors' ) );
90
 
91
  if ( is_multisite() ) {
92
+ add_action( 'signup_extra_fields', array( &$this, 'recaptcha_display' ) );
93
+ add_filter( 'wpmu_validate_user_signup', array( &$this, 'wpmu_validate_signup' ) );
94
+ add_filter( 'wpmu_validate_blog_signup', array( &$this, 'wpmu_validate_signup' ) );
95
  }
96
  }
97
 
101
  * @since 6.3
102
  */
103
  function wp_enqueue_scripts() {
104
+ wp_enqueue_script( 'recaptcha', $this->recaptcha_api_url . '/js/recaptcha_ajax.js' );
105
  wp_enqueue_script( 'theme-my-login-recaptcha', plugins_url( 'theme-my-login/modules/recaptcha/js/recaptcha.js' ), array( 'recaptcha', 'jquery' ) );
106
  wp_localize_script( 'theme-my-login-recaptcha', 'tmlRecaptcha', array(
107
  'publickey' => $this->get_option( 'public_key' ),
109
  ) );
110
  }
111
 
 
 
 
 
 
 
 
 
 
112
  /**
113
  * Retrieves reCAPTCHA errors
114
  *
125
 
126
  switch ( $error_code ) {
127
  case 'invalid-site-private-key' :
128
+ $errors->add( 'recaptcha', __( '<strong>ERROR</strong>: Invalid reCAPTCHA private key.', 'theme-my-login' ), 'invalid-site-private-key' );
129
  break;
130
  case 'invalid-request-cookie' :
131
+ $errors->add( 'recaptcha', __( '<strong>ERROR</strong>: Invalid reCAPTCHA challenge parameter.', 'theme-my-login' ), 'invalid-request-cookie' );
132
  break;
133
  case 'incorrect-captcha-sol' :
134
+ $errors->add( 'recaptcha', __( '<strong>ERROR</strong>: Incorrect captcha code.', 'theme-my-login' ), 'incorrect-captcha-sol' );
135
  break;
136
  case 'recaptcha-not-reachable' :
137
  default :
138
+ $errors->add( 'recaptcha', __( '<strong>ERROR</strong>: Unable to reach the reCAPTCHA server.', 'theme-my-login' ), 'recaptcha-not-reachable' );
139
  break;
140
  }
141
  }
142
  return $errors;
143
  }
144
 
145
+ /**
146
+ * Retrieves reCAPTCHA errors for multisite
147
+ *
148
+ * @since 6.3.7
149
+ *
150
+ * @param array $result Signup parameters
151
+ * @return array Signup parameters
152
+ */
153
+ public function wpmu_validate_signup( $result ) {
154
+ $result['errors'] = $this->registration_errors( $result['errors'] );
155
+ return $result;
156
+ }
157
+
158
  /**
159
  * Displays reCAPTCHA
160
  *
162
  * @access public
163
  */
164
  public function recaptcha_display( $errors = null ) {
165
+ if ( is_multisite() ) {
166
+ if ( $error = $errors->get_error_message( 'recaptcha' ) ) { ?>
167
+ <p class="error"><?php echo $error; ?></p>
168
+ <?php }
169
+ }
170
  ?>
171
  <div id="recaptcha">
172
  <noscript>
185
  * @access public
186
  */
187
  public function recaptcha_validate( $remote_ip, $challenge, $response ) {
188
+ $response = wp_remote_post( $this->recaptcha_api_url . '/verify', array(
189
  'body' => array(
190
  'privatekey' => $this->get_option( 'private_key' ),
191
  'remoteip' => $remote_ip,
modules/security/security.php CHANGED
@@ -96,7 +96,8 @@ class Theme_My_Login_Security extends Theme_My_Login_Abstract {
96
  $wp_query->set_404();
97
  status_header( 404 );
98
  nocache_headers();
99
- $template = get_404_template();
 
100
  include( $template );
101
  exit;
102
  }
96
  $wp_query->set_404();
97
  status_header( 404 );
98
  nocache_headers();
99
+ if ( ! $template = get_404_template() )
100
+ $template = 'index.php';
101
  include( $template );
102
  exit;
103
  }
modules/themed-profiles/admin/themed-profiles-admin.php CHANGED
@@ -72,14 +72,12 @@ class Theme_My_Login_Themed_Profiles_Admin extends Theme_My_Login_Abstract {
72
  $page_id = wp_insert_post( array(
73
  'post_title' => __( 'Your Profile' ),
74
  'post_status' => 'publish',
75
- 'post_type' => 'tml_page',
76
  'post_content' => '[theme-my-login]',
77
  'comment_status' => 'closed',
78
  'ping_status' => 'closed'
79
  ) );
80
  update_post_meta( $page_id, '_tml_action', 'profile' );
81
-
82
- flush_rewrite_rules( false );
83
  }
84
  }
85
 
72
  $page_id = wp_insert_post( array(
73
  'post_title' => __( 'Your Profile' ),
74
  'post_status' => 'publish',
75
+ 'post_type' => 'page',
76
  'post_content' => '[theme-my-login]',
77
  'comment_status' => 'closed',
78
  'ping_status' => 'closed'
79
  ) );
80
  update_post_meta( $page_id, '_tml_action', 'profile' );
 
 
81
  }
82
  }
83
 
modules/themed-profiles/themed-profiles.php CHANGED
@@ -206,6 +206,8 @@ class Theme_My_Login_Themed_Profiles extends Theme_My_Login_Abstract {
206
 
207
  define( 'IS_PROFILE_PAGE', true );
208
 
 
 
209
  register_admin_color_schemes();
210
 
211
  wp_enqueue_style( 'password-strength', plugins_url( 'theme-my-login/modules/themed-profiles/themed-profiles.css' ) );
206
 
207
  define( 'IS_PROFILE_PAGE', true );
208
 
209
+ load_textdomain( 'default', WP_LANG_DIR . '/admin-' . get_locale() . '.mo' );
210
+
211
  register_admin_color_schemes();
212
 
213
  wp_enqueue_style( 'password-strength', plugins_url( 'theme-my-login/modules/themed-profiles/themed-profiles.css' ) );
modules/user-moderation/user-moderation.php CHANGED
@@ -485,7 +485,7 @@ class Theme_My_Login_User_Moderation extends Theme_My_Login_Abstract {
485
  $title = apply_filters( 'user_approval_admin_notification_title', $title, $user_id );
486
  $message = apply_filters( 'user_approval_admin_notification_message', $message, $user_id );
487
 
488
- $to = apply_filters( 'user_approval_admin_notifcation_mail_to', get_option( 'admin_email' ) );
489
 
490
  @wp_mail( $to, $title, $message );
491
  }
485
  $title = apply_filters( 'user_approval_admin_notification_title', $title, $user_id );
486
  $message = apply_filters( 'user_approval_admin_notification_message', $message, $user_id );
487
 
488
+ $to = apply_filters( 'user_approval_admin_notification_mail_to', get_option( 'admin_email' ) );
489
 
490
  @wp_mail( $to, $title, $message );
491
  }
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: jfarthing84
3
  Tags: widget, login, registration, theme, custom, log in, register, sidebar, gravatar, redirection, e-mail
4
  Requires at least: 3.1
5
  Tested up to: 3.5.1
6
- Stable tag: 6.3.6
7
 
8
  Themes the WordPress login pages according to your theme.
9
 
@@ -56,6 +56,14 @@ Please visit http://www.jfarthing.com/development/theme-my-login first and then
56
 
57
  == Changelog ==
58
 
 
 
 
 
 
 
 
 
59
  = 6.3.6 =
60
  * Fix issue where all module options were set once activated
61
  * Fix issue where template tag was not being output
@@ -63,7 +71,7 @@ Please visit http://www.jfarthing.com/development/theme-my-login first and then
63
  * Fix issue where error messages were duplicated on login pages
64
 
65
  = 6.3.5 =
66
- * Fix issue with blank pages where page.php didn't exists in a theme
67
  * Fix issue where activating Themed Profiles resulted in a 404 for profile page
68
  * Fix issue where options were being deleted upon upgrade
69
  * Fix issue with AJAX module not working properly in Internet Explorer
3
  Tags: widget, login, registration, theme, custom, log in, register, sidebar, gravatar, redirection, e-mail
4
  Requires at least: 3.1
5
  Tested up to: 3.5.1
6
+ Stable tag: 6.3.7
7
 
8
  Themes the WordPress login pages according to your theme.
9
 
56
 
57
  == Changelog ==
58
 
59
+ = 6.3.7 =
60
+ * Revert tml_page post type back to default WP pages
61
+ * Fix issue where SSL warnings were displayed in reCAPTCHA module
62
+ * Fix issue where a blank page resulted when 404.php didn't exist in a theme
63
+ * Fix issue where User Links couldn't be deleted
64
+ * Fix issue where "Are you sure?" would display when attempting to log out
65
+ * Fix issue where strings weren't being translated on Profile page
66
+
67
  = 6.3.6 =
68
  * Fix issue where all module options were set once activated
69
  * Fix issue where template tag was not being output
71
  * Fix issue where error messages were duplicated on login pages
72
 
73
  = 6.3.5 =
74
+ * Fix issue with blank pages where page.php didn't exist in a theme
75
  * Fix issue where activating Themed Profiles resulted in a 404 for profile page
76
  * Fix issue where options were being deleted upon upgrade
77
  * Fix issue with AJAX module not working properly in Internet Explorer
templates/profile-form.php CHANGED
@@ -35,12 +35,12 @@ Theme My Login will always look in your theme's directory first, before using th
35
  </tr>
36
 
37
  <tr>
38
- <th><label for="first_name"><?php _e( 'First name' ); ?></label></th>
39
  <td><input type="text" name="first_name" id="first_name" value="<?php echo esc_attr( $profileuser->first_name ); ?>" class="regular-text" /></td>
40
  </tr>
41
 
42
  <tr>
43
- <th><label for="last_name"><?php _e( 'Last name' ); ?></label></th>
44
  <td><input type="text" name="last_name" id="last_name" value="<?php echo esc_attr( $profileuser->last_name ); ?>" class="regular-text" /></td>
45
  </tr>
46
 
35
  </tr>
36
 
37
  <tr>
38
+ <th><label for="first_name"><?php _e( 'First Name' ); ?></label></th>
39
  <td><input type="text" name="first_name" id="first_name" value="<?php echo esc_attr( $profileuser->first_name ); ?>" class="regular-text" /></td>
40
  </tr>
41
 
42
  <tr>
43
+ <th><label for="last_name"><?php _e( 'Last Name' ); ?></label></th>
44
  <td><input type="text" name="last_name" id="last_name" value="<?php echo esc_attr( $profileuser->last_name ); ?>" class="regular-text" /></td>
45
  </tr>
46
 
theme-my-login.php CHANGED
@@ -3,10 +3,11 @@
3
  Plugin Name: Theme My Login
4
  Plugin URI: http://www.jfarthing.com/extend/wordpress-plugins/theme-my-login/
5
  Description: Themes the WordPress login, registration and forgot password pages according to your theme.
6
- Version: 6.3.6
7
  Author: Jeff Farthing
8
  Author URI: http://www.jfarthing.com
9
  Text Domain: theme-my-login
 
10
  */
11
 
12
  // Allow custom functions file
3
  Plugin Name: Theme My Login
4
  Plugin URI: http://www.jfarthing.com/extend/wordpress-plugins/theme-my-login/
5
  Description: Themes the WordPress login, registration and forgot password pages according to your theme.
6
+ Version: 6.3.7
7
  Author: Jeff Farthing
8
  Author URI: http://www.jfarthing.com
9
  Text Domain: theme-my-login
10
+ Domain Path: /language/
11
  */
12
 
13
  // Allow custom functions file