Theme My Login - Version 6.3.3

Version Description

  • Fix issue where actions weren't being appended to page links
  • Fix issue where modules weren't being installed on upgrade
  • Fix fatal error in Custom E-mail module where old function name wasn't replaced
  • Fix private constructor issue for PHP versions less than 5.3
Download this release

Release Info

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

Code changes from version 6.3.2 to 6.3.3

admin/class-theme-my-login-admin.php CHANGED
@@ -53,9 +53,6 @@ class Theme_My_Login_Admin extends Theme_My_Login_Abstract {
53
  add_action( 'admin_init', array( &$this, 'admin_init' ) );
54
  add_action( 'admin_menu', array( &$this, 'admin_menu' ), 8 );
55
 
56
- add_action( 'wp_trash_post', array( &$this, 'wp_trash_post' ) );
57
- add_action( 'before_delete_post', array( &$this, 'wp_trash_post' ) );
58
-
59
  register_uninstall_hook( WP_PLUGIN_DIR . '/theme-my-login/theme-my-login.php', array( 'Theme_My_Login_Admin', 'uninstall' ) );
60
  }
61
 
@@ -108,19 +105,6 @@ class Theme_My_Login_Admin extends Theme_My_Login_Abstract {
108
  $this->install();
109
  }
110
 
111
- /**
112
- * Don't allow deletion of Login page
113
- *
114
- * @since 6.3
115
- * @access public
116
- *
117
- * @param int $post_id Post ID
118
- */
119
- public function wp_trash_post( $post_id ) {
120
- if ( Theme_My_Login::get_page_action( $post_id ) )
121
- wp_die( __( 'Deleting this page will cause Theme My Login to malfunction. If you really want to delete it, please deactivate Theme My Login.', 'theme-my-login' ), '', array( 'back_link' => true ) );
122
- }
123
-
124
  /**
125
  * Renders the settings page
126
  *
@@ -264,7 +248,7 @@ class Theme_My_Login_Admin extends Theme_My_Login_Abstract {
264
  }
265
 
266
  // 6.3 upgrade
267
- if ( version_compare( $version, '6.3', '<' ) ) {
268
  // Delete obsolete options
269
  $this->delete_option( 'page_id' );
270
  $this->delete_option( 'initial_nag' );
@@ -277,6 +261,8 @@ class Theme_My_Login_Admin extends Theme_My_Login_Abstract {
277
 
278
  if ( is_array( $value ) )
279
  update_option( "theme_my_login_{$key}", $value );
 
 
280
  }
281
 
282
  // Maybe create login page?
@@ -310,6 +296,13 @@ class Theme_My_Login_Admin extends Theme_My_Login_Abstract {
310
  // Generate permalinks
311
  flush_rewrite_rules();
312
 
 
 
 
 
 
 
 
313
  $this->set_option( 'version', Theme_My_Login::version );
314
  $this->save_options();
315
  }
53
  add_action( 'admin_init', array( &$this, 'admin_init' ) );
54
  add_action( 'admin_menu', array( &$this, 'admin_menu' ), 8 );
55
 
 
 
 
56
  register_uninstall_hook( WP_PLUGIN_DIR . '/theme-my-login/theme-my-login.php', array( 'Theme_My_Login_Admin', 'uninstall' ) );
57
  }
58
 
105
  $this->install();
106
  }
107
 
 
 
 
 
 
 
 
 
 
 
 
 
 
108
  /**
109
  * Renders the settings page
110
  *
248
  }
249
 
250
  // 6.3 upgrade
251
+ if ( version_compare( $version, '6.3.3', '<' ) ) {
252
  // Delete obsolete options
253
  $this->delete_option( 'page_id' );
254
  $this->delete_option( 'initial_nag' );
261
 
262
  if ( is_array( $value ) )
263
  update_option( "theme_my_login_{$key}", $value );
264
+
265
+ $this->delete_option( $key );
266
  }
267
 
268
  // Maybe create login page?
296
  // Generate permalinks
297
  flush_rewrite_rules();
298
 
299
+ // Activate modules
300
+ foreach ( $this->get_option( 'active_modules', array() ) as $module ) {
301
+ if ( file_exists( WP_PLUGIN_DIR . '/theme-my-login/modules/' . $module ) )
302
+ include_once( WP_PLUGIN_DIR . '/theme-my-login/modules/' . $module );
303
+ do_action( 'tml_activate_' . $module );
304
+ }
305
+
306
  $this->set_option( 'version', Theme_My_Login::version );
307
  $this->save_options();
308
  }
includes/class-theme-my-login-abstract.php CHANGED
@@ -51,7 +51,7 @@ abstract class Theme_My_Login_Abstract {
51
  * @since 6.3
52
  * @access private
53
  */
54
- private function __construct() {
55
  $this->load_options();
56
  $this->load();
57
  }
51
  * @since 6.3
52
  * @access private
53
  */
54
+ protected function __construct() {
55
  $this->load_options();
56
  $this->load();
57
  }
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.2';
25
 
26
  /**
27
  * Holds options key
@@ -844,7 +844,18 @@ if(typeof wpOnload=='function')wpOnload()
844
  * @return string Login page link with optional $query arguments appended
845
  */
846
  public static function get_page_link( $action, $query = '' ) {
847
- $link = self::_get_page_link( $action );
 
 
 
 
 
 
 
 
 
 
 
848
 
849
  if ( ! empty( $query ) ) {
850
  $args = wp_parse_args( $query );
@@ -858,25 +869,6 @@ if(typeof wpOnload=='function')wpOnload()
858
  return apply_filters( 'tml_page_link', $link, $action, $query );
859
  }
860
 
861
- private static function _get_page_link( $action ) {
862
- // Check if page exists
863
- $page_id = self::get_page_id( $action );
864
-
865
- // If not, try for Login page, if it wasn't tried already.
866
- if ( ! $page_id && 'login' != $action )
867
- $page_id = self::get_page_id( 'login' );
868
-
869
- // Return permalink if page exists
870
- if ( $page_id )
871
- return get_permalink( $page_id );
872
-
873
- // Remove site_url filter so we can return wp-login.php
874
- remove_filter( 'site_url', array( self::get_object(), 'site_url' ), 10, 3 );
875
-
876
- // Return wp-login.php
877
- return site_url( 'wp-login.php' );
878
- }
879
-
880
  /**
881
  * Retrieves a page ID for an action
882
  *
21
  * @since 6.3.2
22
  * @const string
23
  */
24
+ const version = '6.3.3';
25
 
26
  /**
27
  * Holds options key
844
  * @return string Login page link with optional $query arguments appended
845
  */
846
  public static function get_page_link( $action, $query = '' ) {
847
+ $page_id = self::get_page_id( $action );
848
+
849
+ if ( $page_id ) {
850
+ $link = get_permalink( $page_id );
851
+ } elseif ( $page_id = self::get_page_id( 'login' ) ) {
852
+ $link = add_query_arg( 'action', $action, get_permalink( $page_id ) );
853
+ } else {
854
+ // Remove site_url filter so we can use wp-login.php
855
+ remove_filter( 'site_url', array( self::get_object(), 'site_url' ), 10, 3 );
856
+
857
+ $link = site_url( "wp-login.php?action=$action" );
858
+ }
859
 
860
  if ( ! empty( $query ) ) {
861
  $args = wp_parse_args( $query );
869
  return apply_filters( 'tml_page_link', $link, $action, $query );
870
  }
871
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
872
  /**
873
  * Retrieves a page ID for an action
874
  *
modules/custom-email/custom-email.php CHANGED
@@ -676,7 +676,7 @@ class Theme_My_Login_Custom_Email extends Theme_My_Login_Abstract {
676
  $_message = $this->get_option( array( 'user_approval', 'message' ) );
677
  if ( ! empty( $_message ) ) {
678
  $message = Theme_My_Login_Common::replace_vars( $_message, $user_id, array(
679
- '%loginurl%' => Theme_My_Login::get_object()->get_login_page_link(),
680
  '%user_pass%' => $new_pass
681
  ) );
682
  }
676
  $_message = $this->get_option( array( 'user_approval', 'message' ) );
677
  if ( ! empty( $_message ) ) {
678
  $message = Theme_My_Login_Common::replace_vars( $_message, $user_id, array(
679
+ '%loginurl%' => Theme_My_Login::get_object()->get_page_link( 'login' ),
680
  '%user_pass%' => $new_pass
681
  ) );
682
  }
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.2
7
 
8
  Themes the WordPress login pages according to your theme.
9
 
@@ -56,6 +56,12 @@ Please visit http://www.jfarthing.com/development/theme-my-login first and then
56
 
57
  == Changelog ==
58
 
 
 
 
 
 
 
59
  = 6.3.2 =
60
  * Fix issue where pages weren't created when upgrading from previous versions
61
 
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.3
7
 
8
  Themes the WordPress login pages according to your theme.
9
 
56
 
57
  == Changelog ==
58
 
59
+ = 6.3.3 =
60
+ * Fix issue where actions weren't being appended to page links
61
+ * Fix issue where modules weren't being installed on upgrade
62
+ * Fix fatal error in Custom E-mail module where old function name wasn't replaced
63
+ * Fix private constructor issue for PHP versions less than 5.3
64
+
65
  = 6.3.2 =
66
  * Fix issue where pages weren't created when upgrading from previous versions
67
 
theme-my-login.php CHANGED
@@ -3,7 +3,7 @@
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.2
7
  Author: Jeff Farthing
8
  Author URI: http://www.jfarthing.com
9
  Text Domain: theme-my-login
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.3
7
  Author: Jeff Farthing
8
  Author URI: http://www.jfarthing.com
9
  Text Domain: theme-my-login