Skip to content

Commit

Permalink
Merge pull request #397 from Invizo/develop
Browse files Browse the repository at this point in the history
Merge Develop into Master
  • Loading branch information
code-with-mehedi authored Mar 13, 2024
2 parents 2f85e8e + 7f59c7a commit 6430488
Show file tree
Hide file tree
Showing 32 changed files with 1,534 additions and 1,474 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SLUG: storegrowth-sales-booster
VERSION: 1.24.7
VERSION: 1.25.7
19 changes: 19 additions & 0 deletions Includes/Admin/AdminHooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@
*/
class AdminHooks {


use Singleton;

/**
* Constructor of Admin_Hooks class.
*/
private function __construct() {
add_filter( 'plugin_action_links_' . STOREGROWTH_PLUGIN_BASENAME, array( $this, 'plugin_action_links' ) );
add_action( 'admin_init', array( $this, 'sgsb_redirect_initial_setup' ) );
}

/**
Expand All @@ -44,4 +46,21 @@ public function plugin_action_links( $links ) {

return array_merge( $action_links, $links );
}

/**
* Redirect to Welcome Page when plugin is activated.
*/

public function sgsb_redirect_initial_setup() {
$ini_setup_completion = get_option( 'sgsb_ini_completion' );
if ( $ini_setup_completion ) {
return;}

if ( get_option( 'storegrowth_activation_redirect', false ) ) {
delete_option( 'storegrowth_activation_redirect' );
if ( wp_safe_redirect( admin_url( 'admin.php?page=sgsb-modules#/ini-setup' ) ) ) {
exit();
}
}
}
}
18 changes: 18 additions & 0 deletions Includes/Admin/AdminMenu.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,15 @@ public function register_admin_menu() {
array( $this, 'handle_external_redirects' )
);

add_submenu_page(
'sales-booster-for-woocommerce',
__( 'Initial Setup - StoreGrowth', 'storegrowth-sales-booster' ),
__( 'Initial Setup', 'storegrowth-sales-booster' ),
'manage_options',
'sgsb-modules#/ini-setup',
array( $this, 'initial_setup_page_callback' )
);

if ( ! SGSB_PRO_ACTIVE ) {
add_submenu_page(
'sales-booster-for-woocommerce',
Expand Down Expand Up @@ -137,6 +146,15 @@ public function dashboard_callback() {
exit;
}

/**
* Display Initail Setup page content.
*/
public function initial_setup_page_callback() {
$redirect_url = admin_url( 'admin.php?page=sgsb-modules#/ini-setup' );
wp_safe_redirect( $redirect_url );
exit;
}

/**
* Redirect to a specific URL.
*
Expand Down
Loading

0 comments on commit 6430488

Please sign in to comment.