Skip to content

Commit

Permalink
Updated: version number
Browse files Browse the repository at this point in the history
Added: auto enable verify id
  • Loading branch information
thanghv committed Nov 20, 2024
1 parent 34f0be0 commit 4f8497b
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 4 deletions.
36 changes: 35 additions & 1 deletion class/class-mainwp-child.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class MainWP_Child {
*
* @var string MainWP Child plugin version.
*/
public static $version = '5.2'; // NOSONAR - not IP.
public static $version = '5.2.1'; // NOSONAR - not IP.

/**
* Private variable containing the latest MainWP Child update version.
Expand Down Expand Up @@ -72,6 +72,7 @@ public function __construct( $plugin_file ) {
$this->plugin_slug = plugin_basename( $plugin_file );

add_action( 'template_redirect', array( $this, 'template_redirect' ) );
add_action( 'activated_plugin', array( $this, 'hook_activated_plugin' ) );
add_action( 'init', array( &$this, 'init_check_login' ), 1 );
add_action( 'init', array( &$this, 'parse_init' ), 9999 );
add_action( 'init', array( &$this, 'localization' ), 33 );
Expand Down Expand Up @@ -255,6 +256,33 @@ public function template_redirect() {
MainWP_Utility::instance()->send_maintenance_alert();
}


/**
* Method hook_activated_plugin()
*
* @param mixed $plugin plugin.
* @return void
*/
public function hook_activated_plugin( $plugin ) {
if ( plugin_basename( MAINWP_CHILD_FILE ) === $plugin ) {
$just_activated = false;
if ( empty( get_option( 'mainwp_child_pubkey' ) ) ) {
MainWP_Helper::update_option( 'mainwp_child_uniqueId', MainWP_Helper::rand_string( 12 ) );
$just_activated = true;
}
if ( ! headers_sent() ) {
$branding = MainWP_Child_Branding::instance()->is_branding();
if ( ! $branding ) {
wp_safe_redirect( 'options-general.php?page=mainwp_child_tab' );
exit();
}
} elseif ( $just_activated ) {
MainWP_Helper::update_option( 'mainwp_child_just_activated', 1 );
}
}
}


/**
* Method parse_init()
*
Expand Down Expand Up @@ -352,6 +380,12 @@ public function admin_init() {
MainWP_Clone::instance()->init_ajax();
}
MainWP_Child_Actions::get_instance()->init_hooks();

if ( ! empty( get_option( 'mainwp_child_just_activated' ) ) ) {
delete_option( 'mainwp_child_just_activated' );
wp_safe_redirect( 'options-general.php?page=mainwp_child_tab' );
exit();
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion mainwp-child.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* Author: MainWP
* Author URI: https://mainwp.com
* Text Domain: mainwp-child
* Version: 5.2
* Version: 5.2.1
* Requires at least: 5.4
* Requires PHP: 7.4
*/
Expand Down
10 changes: 8 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ Author: mainwp
Author URI: https://mainwp.com
Plugin URI: https://mainwp.com
Requires at least: 6.2
Tested up to: 6.6.1
Tested up to: 6.7
Requires PHP: 7.4
Stable tag: 5.2
Stable tag: 5.2.1
License: GPLv3 or later
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Expand Down Expand Up @@ -111,6 +111,12 @@ We have an extensive FAQ with more questions and answers [here](https://mainwp.c

== Changelog ==


= 5.2.1 - 11-20-2024 =

* Added: After activating the MainWP plugin, users are now redirected to the MainWP Settings page for a smoother onboarding experience.
Updated: The Unique Security ID option is now enabled by default to enhance security for all MainWP installations.

= 5.2 - 8-28-2024 =

* Fixed: Issue with inserting multiple galleries in a post.
Expand Down

0 comments on commit 4f8497b

Please sign in to comment.