Theme My Login - Version 6.3.2

Version Description

  • Fix issue where pages weren't created when upgrading from previous versions
Download this release

Release Info

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

Code changes from version 6.3.1 to 6.3.2

admin/class-theme-my-login-admin.php CHANGED
@@ -56,7 +56,6 @@ class Theme_My_Login_Admin extends Theme_My_Login_Abstract {
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_activation_hook( WP_PLUGIN_DIR . '/theme-my-login/theme-my-login.php', array( &$this, 'install' ) );
60
  register_uninstall_hook( WP_PLUGIN_DIR . '/theme-my-login/theme-my-login.php', array( 'Theme_My_Login_Admin', 'uninstall' ) );
61
  }
62
 
@@ -104,6 +103,9 @@ class Theme_My_Login_Admin extends Theme_My_Login_Abstract {
104
  */
105
  public function admin_init() {
106
  register_setting( 'theme_my_login', 'theme_my_login', array( &$this, 'save_settings' ) );
 
 
 
107
  }
108
 
109
  /**
@@ -230,52 +232,22 @@ class Theme_My_Login_Admin extends Theme_My_Login_Abstract {
230
  return $settings;
231
  }
232
 
233
- /**
234
- * Wrapper for multisite installation
235
- *
236
- * @since 6.1
237
- * @access public
238
- */
239
- public function install() {
240
- global $wpdb;
241
-
242
- if ( is_multisite() ) {
243
- if ( isset( $_GET['networkwide'] ) && ( $_GET['networkwide'] == 1 ) ) {
244
- $blogids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" );
245
- foreach ( $blogids as $blog_id ) {
246
- switch_to_blog( $blog_id );
247
- $this->_install();
248
- }
249
- restore_current_blog();
250
- return;
251
- }
252
- }
253
- $this->_install();
254
- }
255
-
256
  /**
257
  * Installs TML
258
  *
259
  * @since 6.0
260
- * @access protected
261
  */
262
- protected function _install() {
263
- global $wpdb;
264
-
265
- // Initialize the plugin
266
- Theme_My_Login::get_object()->init();
267
-
268
- // Get plugin data
269
- $plugin_data = get_plugin_data( WP_PLUGIN_DIR . '/theme-my-login/theme-my-login.php' );
270
-
271
  // Current version
272
- $version = $this->get_option( 'version', $plugin_data['Version'] );
273
-
274
- // Get existing page ID
275
- $page_id = $this->get_option( 'page_id' );
276
 
277
- // Check if page exists
278
- $existing_page = ( $page_id ) ? get_page( $page_id ) : get_page_by_title( 'Login' );
 
 
 
 
279
 
280
  // 4.4 upgrade
281
  if ( version_compare( $version, '4.4', '<' ) ) {
@@ -285,9 +257,9 @@ class Theme_My_Login_Admin extends Theme_My_Login_Abstract {
285
  // 6.0 upgrade
286
  if ( version_compare( $version, '6.0', '<' ) ) {
287
  // Replace shortcode
288
- if ( $existing_page ) {
289
- $existing_page->post_content = str_replace( '[theme-my-login-page]', '[theme-my-login]', $existing_page->post_content );
290
- wp_update_post( $existing_page );
291
  }
292
  }
293
 
@@ -308,15 +280,15 @@ class Theme_My_Login_Admin extends Theme_My_Login_Abstract {
308
  }
309
 
310
  // Maybe create login page?
311
- if ( $existing_page ) {
312
  // Make sure the page is not in the trash
313
  if ( 'trash' == $page->post_status )
314
- wp_untrash_post( $page_id );
315
 
316
  // Change to new post type
317
- $wpdb->update( $wpdb->posts, array( 'post_type' => 'tml_page' ), array( 'ID' => $existing_page->ID ) );
318
 
319
- update_post_meta( $existing_page->ID, '_tml_action', 'login' );
320
  }
321
  }
322
 
@@ -335,11 +307,11 @@ class Theme_My_Login_Admin extends Theme_My_Login_Abstract {
335
  }
336
  }
337
 
338
- $this->set_option( 'version', $plugin_data['Version'] );
339
- $this->save_options();
340
-
341
  // Generate permalinks
342
  flush_rewrite_rules();
 
 
 
343
  }
344
 
345
  /**
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
 
103
  */
104
  public function admin_init() {
105
  register_setting( 'theme_my_login', 'theme_my_login', array( &$this, 'save_settings' ) );
106
+
107
+ if ( version_compare( $this->get_option( 'version', 0 ), Theme_My_Login::version, '<' ) )
108
+ $this->install();
109
  }
110
 
111
  /**
232
  return $settings;
233
  }
234
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
235
  /**
236
  * Installs TML
237
  *
238
  * @since 6.0
239
+ * @access private
240
  */
241
+ private function install() {
 
 
 
 
 
 
 
 
242
  // Current version
243
+ $version = $this->get_option( 'version', Theme_My_Login::version );
 
 
 
244
 
245
+ // Check if legacy page exists
246
+ if ( $page_id = $this->get_option( 'page_id' ) ) {
247
+ $page = get_page( $page_id );
248
+ } else {
249
+ $page = get_page_by_title( 'Login' );
250
+ }
251
 
252
  // 4.4 upgrade
253
  if ( version_compare( $version, '4.4', '<' ) ) {
257
  // 6.0 upgrade
258
  if ( version_compare( $version, '6.0', '<' ) ) {
259
  // Replace shortcode
260
+ if ( $page ) {
261
+ $page->post_content = str_replace( '[theme-my-login-page]', '[theme-my-login]', $page->post_content );
262
+ wp_update_post( $page );
263
  }
264
  }
265
 
280
  }
281
 
282
  // Maybe create login page?
283
+ if ( $page ) {
284
  // Make sure the page is not in the trash
285
  if ( 'trash' == $page->post_status )
286
+ wp_untrash_post( $page->ID );
287
 
288
  // Change to new post type
289
+ set_post_type( $page->ID, 'tml_page' );
290
 
291
+ update_post_meta( $page->ID, '_tml_action', 'login' );
292
  }
293
  }
294
 
307
  }
308
  }
309
 
 
 
 
310
  // Generate permalinks
311
  flush_rewrite_rules();
312
+
313
+ $this->set_option( 'version', Theme_My_Login::version );
314
+ $this->save_options();
315
  }
316
 
317
  /**
includes/class-theme-my-login.php CHANGED
@@ -15,6 +15,14 @@ if ( ! class_exists( 'Theme_My_Login' ) ) :
15
  * @since 6.0
16
  */
17
  class Theme_My_Login extends Theme_My_Login_Abstract {
 
 
 
 
 
 
 
 
18
  /**
19
  * Holds options key
20
  *
15
  * @since 6.0
16
  */
17
  class Theme_My_Login extends Theme_My_Login_Abstract {
18
+ /**
19
+ * Holds plugin version
20
+ *
21
+ * @since 6.3.2
22
+ * @const string
23
+ */
24
+ const version = '6.3.2';
25
+
26
  /**
27
  * Holds options key
28
  *
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.1
7
 
8
  Themes the WordPress login pages according to your theme.
9
 
@@ -56,6 +56,9 @@ Please visit http://www.jfarthing.com/development/theme-my-login first and then
56
 
57
  == Changelog ==
58
 
 
 
 
59
  = 6.3.1 =
60
  * Fix multisite 404 error when using Post Name permalink structure
61
  * Fix multisite redirect to main site for register
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
 
57
  == Changelog ==
58
 
59
+ = 6.3.2 =
60
+ * Fix issue where pages weren't created when upgrading from previous versions
61
+
62
  = 6.3.1 =
63
  * Fix multisite 404 error when using Post Name permalink structure
64
  * Fix multisite redirect to main site for register
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.1
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.2
7
  Author: Jeff Farthing
8
  Author URI: http://www.jfarthing.com
9
  Text Domain: theme-my-login