diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 786ed9cb..77b47666 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -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 diff --git a/Includes/Admin/AdminHooks.php b/Includes/Admin/AdminHooks.php index e11b8ba9..1c091935 100644 --- a/Includes/Admin/AdminHooks.php +++ b/Includes/Admin/AdminHooks.php @@ -19,6 +19,7 @@ */ class AdminHooks { + use Singleton; /** @@ -26,6 +27,7 @@ class AdminHooks { */ 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' ) ); } /** @@ -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(); + } + } + } } diff --git a/Includes/Admin/AdminMenu.php b/Includes/Admin/AdminMenu.php index 51f5aad9..5a155ed3 100644 --- a/Includes/Admin/AdminMenu.php +++ b/Includes/Admin/AdminMenu.php @@ -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', @@ -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. * diff --git a/Includes/Admin/WPInsightsStoreGrowthSalesBooster.php b/Includes/Admin/WPInsightsStoreGrowthSalesBooster.php deleted file mode 100644 index 58b80300..00000000 --- a/Includes/Admin/WPInsightsStoreGrowthSalesBooster.php +++ /dev/null @@ -1,925 +0,0 @@ -plugin_file = $plugin_file; - $this->plugin_name = basename( $this->plugin_file, '.php' ); - $this->disabled_wp_cron = defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON == true; - $this->enable_self_cron = $this->disabled_wp_cron == true ? true : false; - - $this->event_hook = 'put_do_weekly_action'; - - $this->require_optin = isset( $args['opt_in'] ) ? $args['opt_in'] : true; - $this->include_goodbye_form = isset( $args['goodbye_form'] ) ? $args['goodbye_form'] : true; - $this->marketing = isset( $args['email_marketing'] ) ? $args['email_marketing'] : true; - $this->options = isset( $args['options'] ) ? $args['options'] : array(); - $this->item_id = isset( $args['item_id'] ) ? $args['item_id'] : false; - - /** - * Activation Hook - */ - register_activation_hook( $this->plugin_file, array( $this, 'activate_this_plugin' ) ); - - /** - * Deactivation Hook - */ - register_deactivation_hook( $this->plugin_file, array( $this, 'deactivate_this_plugin' ) ); - } - - /** - * When user agreed to opt-in tracking schedule is enabled. - * - * @since 3.0.0 - */ - public function schedule_tracking() { - if ( $this->disabled_wp_cron ) { - return; - } - - if ( ! wp_next_scheduled( $this->event_hook ) ) { - wp_schedule_event( time(), $this->recurrence, $this->event_hook ); - } - } - - /** - * Add the schedule event if the plugin is tracked. - * - * @return void - */ - public function activate_this_plugin() { - $allow_tracking = $this->is_tracking_allowed(); - if ( ! $allow_tracking ) { - return; - } - $this->schedule_tracking(); - } - - /** - * Remove the schedule event when plugin is deactivated and send the deactivated reason to inishghts if user submitted. - * - * @since 3.0.0 - */ - public function deactivate_this_plugin() { - // Check tracking is allowed or not. - $allow_tracking = $this->is_tracking_allowed(); - if ( ! $allow_tracking ) { - return; - } - - $body = $this->get_data(); - $body['status'] = 'Deactivated'; - $body['deactivated_date'] = time(); - - // Check deactivation reason and add for insights data. - if ( false !== get_option( 'wpins_deactivation_reason_' . $this->plugin_name ) ) { - $body['deactivation_reason'] = get_option( 'wpins_deactivation_reason_' . $this->plugin_name ); - } - - if ( false !== get_option( 'wpins_deactivation_details_' . $this->plugin_name ) ) { - $body['deactivation_details'] = get_option( 'wpins_deactivation_details_' . $this->plugin_name ); - } - - $this->send_data( $body ); - - delete_option( 'wpins_deactivation_reason_' . $this->plugin_name ); - delete_option( 'wpins_deactivation_details_' . $this->plugin_name ); - - /** - * Clear the event schedule. - */ - if ( ! $this->disabled_wp_cron ) { - wp_clear_scheduled_hook( $this->event_hook ); - } - } - /** - * Initial Method to Hook Everything. - * - * @return void - */ - public function init() { - $this->clicked(); - add_action( $this->event_hook, array( $this, 'do_tracking' ) ); - // For Test - // add_action( 'admin_init', array( $this, 'force_tracking' ) ); - add_action( 'admin_notices', array( $this, 'notice' ) ); - - /** - * Deactivation Reason Form and Submit Data to Insights. - */ - add_filter( 'plugin_action_links_' . plugin_basename( $this->plugin_file ), array( $this, 'deactivate_action_links' ) ); - add_action( 'admin_footer-plugins.php', array( $this, 'deactivate_reasons_form' ) ); - add_action( 'wp_ajax_deactivation_form_' . esc_attr( $this->plugin_name ), array( $this, 'deactivate_reasons_form_submit' ) ); - } - /** - * For Redirecting Current Page without Arguments! - * - * @return void - */ - private function redirect_to() { - $request_uri = parse_url( $_SERVER['REQUEST_URI'], PHP_URL_PATH ); - $query_string = parse_url( $_SERVER['REQUEST_URI'], PHP_URL_QUERY ); - parse_str( $query_string, $current_url ); - - $unset_array = array( 'dismiss', 'plugin', '_wpnonce', 'later', 'plugin_action', 'marketing_optin' ); - - foreach ( $unset_array as $value ) { - if ( isset( $current_url[ $value ] ) ) { - unset( $current_url[ $value ] ); - } - } - - $current_url = http_build_query( $current_url ); - $redirect_url = $request_uri . '?' . $current_url; - - return $redirect_url; - } - - /** - * This method is responsible for all the magic from the front of the plugin. - * - * @since 3.0.0 - * @param bool $force Force tracking if it's not the correct time to track. - */ - public function do_tracking( $force = false ) { - /** - * Check URL is set or not. - */ - if ( empty( self::API_URL ) ) { - return; - } - /** - * Check is tracking allowed or not. - */ - if ( ! $this->is_tracking_allowed() ) { - return; - } - /** - * Check is this the correct time to track or not. - * or Force to track. - */ - if ( ! $this->is_time_to_track() && ! $force ) { - return; - } - /** - * Get All Data. - */ - $body = $this->get_data(); - /** - * Send all data. - */ - return $this->send_data( $body ); - } - /** - * Is tracking allowed? - * - * @since 1.0.0 - */ - private function is_tracking_allowed() { - // First, check if the user has changed their mind and opted out of tracking - if ( $this->has_user_opted_out() ) { - $this->set_is_tracking_allowed( false, $this->plugin_name ); - return false; - } - // The wpins_allow_tracking option is an array of plugins that are being tracked - $allow_tracking = get_option( 'wpins_allow_tracking' ); - // If this plugin is in the array, then tracking is allowed - if ( isset( $allow_tracking[ $this->plugin_name ] ) ) { - return true; - } - return false; - } - /** - * Set a flag in DB If tracking is allowed. - * - * @since 3.0.0 - * @param $is_allowed Boolean true if is allowed. - */ - protected function set_is_tracking_allowed( $is_allowed, $plugin = null ) { - if ( empty( $plugin ) ) { - $plugin = $this->plugin_name; - } - /** - * Get All Tracked Plugin List using this Tracker. - */ - $allow_tracking = get_option( 'wpins_allow_tracking' ); - /** - * Check user is opted out for tracking or not. - */ - if ( $this->has_user_opted_out() ) { - if ( isset( $allow_tracking[ $plugin ] ) ) { - unset( $allow_tracking[ $plugin ] ); - } - } elseif ( $is_allowed || ! $this->require_optin ) { - /** - * If user has agreed to allow tracking - */ - if ( empty( $allow_tracking ) || ! is_array( $allow_tracking ) ) { - $allow_tracking = array( $plugin => $plugin ); - } else { - $allow_tracking[ $plugin ] = $plugin; - } - } elseif ( isset( $allow_tracking[ $plugin ] ) ) { - unset( $allow_tracking[ $plugin ] ); - } - update_option( 'wpins_allow_tracking', $allow_tracking ); - } - - /** - * Check the user has opted out or not. - * - * @since 3.0.0 - * @return Boolean - */ - protected function has_user_opted_out() { - if ( ! empty( $this->options ) ) { - foreach ( $this->options as $option_name ) { - $options = get_option( $option_name ); - if ( ! empty( $options['wpins_opt_out'] ) ) { - return true; - } - } - } - return false; - } - /** - * Check if it's time to track - * - * @since 3.0.0 - */ - public function is_time_to_track() { - $track_times = get_option( 'wpins_last_track_time', array() ); - return ! isset( $track_times[ $this->plugin_name ] ) ? true : - ( ( isset( $track_times[ $this->plugin_name ] ) && $track_times[ $this->plugin_name ] ) < strtotime( '-1 day' ) ? true : false ); - } - /** - * Set tracking time. - * - * @since 3.0.0 - */ - public function set_track_time() { - $track_times = get_option( 'wpins_last_track_time', array() ); - $track_times[ $this->plugin_name ] = time(); - update_option( 'wpins_last_track_time', $track_times ); - } - /** - * This method is responsible for collecting all data. - * - * @since 3.0.0 - */ - public function get_data() { - $body = array( - 'plugin_slug' => sanitize_text_field( $this->plugin_name ), - 'url' => get_bloginfo( 'url' ), - 'site_name' => get_bloginfo( 'name' ), - 'site_version' => get_bloginfo( 'version' ), - 'site_language' => get_bloginfo( 'language' ), - 'charset' => get_bloginfo( 'charset' ), - 'wpins_version' => self::WPINS_VERSION, - 'php_version' => phpversion(), - 'multisite' => is_multisite(), - 'file_location' => __FILE__, - ); - - // Collect the email if the correct option has been set - if ( $this->marketing ) { - if ( ! function_exists( 'wp_get_current_user' ) ) { - include ABSPATH . 'wp-includes/pluggable.php'; - } - $current_user = wp_get_current_user(); - $email = $current_user->user_email; - if ( is_email( $email ) ) { - $body['email'] = $email; - } - } - $body['marketing_method'] = $this->marketing; - $body['server'] = isset( $_SERVER['SERVER_SOFTWARE'] ) ? $_SERVER['SERVER_SOFTWARE'] : ''; - - /** - * Collect all active and inactive plugins - */ - if ( ! function_exists( 'get_plugins' ) ) { - include ABSPATH . '/wp-admin/includes/plugin.php'; - } - $plugins = array_keys( get_plugins() ); - $active_plugins = is_network_admin() ? array_keys( get_site_option( 'active_sitewide_plugins', array() ) ) : get_option( 'active_plugins', array() ); - foreach ( $plugins as $key => $plugin ) { - if ( in_array( $plugin, $active_plugins ) ) { - unset( $plugins[ $key ] ); - } - } - $body['active_plugins'] = $active_plugins; - $body['inactive_plugins'] = $plugins; - - /** - * Text Direction. - */ - $body['text_direction'] = ( function_exists( 'is_rtl' ) ? ( is_rtl() ? 'RTL' : 'LTR' ) : 'NOT SET' ); - /** - * Get Our Plugin Data. - * - * @since 3.0.0 - */ - $plugin = $this->plugin_data(); - if ( empty( $plugin ) ) { - $body['message'] .= __( 'We can\'t detect any plugin information. This is most probably because you have not included the code in the plugin main file.', 'plugin-usage-tracker' ); - $body['status'] = 'NOT FOUND'; - } else { - if ( isset( $plugin['Name'] ) ) { - $body['plugin'] = sanitize_text_field( $plugin['Name'] ); - } - if ( isset( $plugin['Version'] ) ) { - $body['version'] = sanitize_text_field( $plugin['Version'] ); - } - $body['status'] = 'Active'; - } - - /** - * Get active theme name and version - * - * @since 3.0.0 - */ - $theme = wp_get_theme(); - if ( $theme->Name ) { - $body['theme'] = sanitize_text_field( $theme->Name ); - } - if ( $theme->Version ) { - $body['theme_version'] = sanitize_text_field( $theme->Version ); - } - return $body; - } - - /** - * Collect plugin data, - * Retrieve current plugin information - * - * @since 3.0.0 - */ - public function plugin_data() { - if ( ! function_exists( 'get_plugin_data' ) ) { - include ABSPATH . '/wp-admin/includes/plugin.php'; - } - $plugin = get_plugin_data( $this->plugin_file ); - return $plugin; - } - /** - * Send the data to insights. - * - * @since 3.0.0 - */ - public function send_data( $body ) { - /** - * Get SITE ID - */ - $site_id_key = "wpins_{$this->plugin_name}_site_id"; - $site_id = get_option( $site_id_key, false ); - $failed_data = array(); - $site_url = get_bloginfo( 'url' ); - $original_site_url = get_option( "wpins_{$this->plugin_name}_original_url", false ); - if ( $original_site_url === false && version_compare( $body['wpins_version'], '3.0.1', '==' ) ) { - $site_id = false; - } - /** - * Send Initial Data to API - */ - if ( $site_id == false && $this->item_id !== false && $original_site_url === false ) { - if ( isset( $_SERVER['REMOTE_ADDR'] ) && ! empty( $_SERVER['REMOTE_ADDR'] && $_SERVER['REMOTE_ADDR'] != '127.0.0.1' ) ) { - $country_request = wp_remote_get( 'http://ip-api.com/json/' . $_SERVER['REMOTE_ADDR'] . '?fields=country' ); - if ( ! is_wp_error( $country_request ) && $country_request['response']['code'] == 200 ) { - $ip_data = json_decode( $country_request['body'] ); - $body['country'] = isset( $ip_data->country ) ? $ip_data->country : 'NOT SET'; - } - } - - $body['plugin_slug'] = $this->plugin_name; - $body['url'] = $site_url; - $body['item_id'] = $this->item_id; - - $request = $this->remote_post( $body ); - if ( ! is_wp_error( $request ) && $request['response']['code'] == 200 ) { - $retrieved_body = json_decode( wp_remote_retrieve_body( $request ), true ); - if ( is_array( $retrieved_body ) && isset( $retrieved_body['siteId'] ) ) { - update_option( $site_id_key, $retrieved_body['siteId'] ); - update_option( "wpins_{$this->plugin_name}_original_url", $site_url ); - update_option( "wpins_{$this->plugin_name}_{$retrieved_body['siteId']}", $body ); - } - } else { - $failed_data = $body; - } - } - - $site_id_data_key = "wpins_{$this->plugin_name}_{$site_id}"; - $site_id_data_failed_key = "wpins_{$this->plugin_name}_{$site_id}_send_failed"; - - if ( $site_id != false ) { - $old_sent_data = get_option( $site_id_data_key, array() ); - $diff_data = $this->diff( $body, $old_sent_data ); - $failed_data = get_option( $site_id_data_failed_key, array() ); - if ( ! empty( $failed_data ) && $diff_data != $failed_data ) { - $failed_data = array_merge( $failed_data, $diff_data ); - } - } - - if ( ! empty( $failed_data ) && $site_id != false ) { - $failed_data['plugin_slug'] = $this->plugin_name; - $failed_data['url'] = $site_url; - $failed_data['site_id'] = $site_id; - if ( $original_site_url != false ) { - $failed_data['original_url'] = $original_site_url; - } - - $request = $this->remote_post( $failed_data ); - if ( ! is_wp_error( $request ) ) { - delete_option( $site_id_data_failed_key ); - $replaced_data = array_merge( $old_sent_data, $failed_data ); - update_option( $site_id_data_key, $replaced_data ); - } - } - - if ( ! empty( $diff_data ) && $site_id != false && empty( $failed_data ) ) { - $diff_data['plugin_slug'] = $this->plugin_name; - $diff_data['url'] = $site_url; - $diff_data['site_id'] = $site_id; - if ( $original_site_url != false ) { - $diff_data['original_url'] = $original_site_url; - } - - $request = $this->remote_post( $diff_data ); - if ( is_wp_error( $request ) ) { - update_option( $site_id_data_failed_key, $diff_data ); - } else { - $replaced_data = array_merge( $old_sent_data, $diff_data ); - update_option( $site_id_data_key, $replaced_data ); - } - } - - $this->set_track_time(); - - if ( isset( $request ) && is_wp_error( $request ) ) { - return $request; - } - - if ( isset( $request ) ) { - return true; - } - return false; - } - /** - * WP_REMOTE_POST method responsible for send data to the API_URL - * - * @param array $data - * @param array $args - * @return void - */ - protected function remote_post( $data = array(), $args = array() ) { - if ( empty( $data ) ) { - return; - } - - $args = wp_parse_args( - $args, - array( - 'method' => 'POST', - 'timeout' => 30, - 'redirection' => 5, - 'httpversion' => '1.1', - 'blocking' => true, - 'body' => $data, - 'user-agent' => 'PUT/1.0.0; ' . get_bloginfo( 'url' ), - ) - ); - - $request = wp_remote_post( esc_url( self::API_URL ), $args ); - if ( is_wp_error( $request ) || ( isset( $request['response'], $request['response']['code'] ) && $request['response']['code'] != 200 ) ) { - return new WP_Error( 500, 'Something went wrong.' ); - } - return $request; - } - /** - * Difference between old and new data - * - * @param array $new_data - * @param array $old_data - * @return void - */ - protected function diff( $new_data, $old_data ) { - $data = array(); - if ( ! empty( $new_data ) ) { - foreach ( $new_data as $key => $value ) { - if ( isset( $old_data[ $key ] ) ) { - if ( $old_data[ $key ] == $value ) { - continue; - } - } - $data[ $key ] = $value; - } - } - return $data; - } - /** - * Display the admin notice to users to allow them to opt in - * - * @since 3.0.0 - */ - public function notice() { - /** - * Return if notice is not set. - */ - if ( ! isset( $this->notice_options['notice'] ) ) { - return; - } - /** - * Check is allowed or blocked for notice. - */ - $block_notice = get_option( 'wpins_block_notice' ); - if ( isset( $block_notice[ $this->plugin_name ] ) ) { - return; - } - if ( ! current_user_can( 'manage_options' ) ) { - return; - } - - $url_yes = add_query_arg( - array( - 'plugin' => $this->plugin_name, - 'plugin_action' => 'yes', - ) - ); - $url_no = add_query_arg( - array( - 'plugin' => $this->plugin_name, - 'plugin_action' => 'no', - ) - ); - - // Decide on notice text - $notice_text = $this->notice_options['notice'] . ' ' . $this->notice_options['consent_button_text'] . ''; - $extra_notice_text = $this->notice_options['extra_notice']; - - $output = ''; - $output .= '
'; - $output .= '

' . $notice_text . '

'; - $output .= ''; - $output .= '

'; - $output .= '' . $this->notice_options['yes'] . ' '; - $output .= '' . $this->notice_options['no'] . ''; - $output .= '

'; - $output .= ""; - $output .= '
'; - - echo $output; - } - /** - * Set all notice options to customized notice. - * - * @since 3.0.0 - * @param array $options - * @return void - */ - public function set_notice_options( $options = array() ) { - $default_options = array( - 'consent_button_text' => __( 'What we collect.', 'wpinsight' ), - 'yes' => __( 'Sure, I\'d like to help', 'wpinsight' ), - 'no' => __( 'No Thanks.', 'wpinsight' ), - ); - $options = wp_parse_args( $options, $default_options ); - $this->notice_options = $options; - } - /** - * Responsible for track the click from Notice. - * - * @return void - */ - public function clicked() { - if ( isset( $_GET['plugin'] ) && isset( $_GET['plugin_action'] ) ) { - if ( isset( $_GET['tab'] ) && $_GET['tab'] === 'plugin-information' ) { - return; - } - $plugin = sanitize_text_field( $_GET['plugin'] ); - $action = sanitize_text_field( $_GET['plugin_action'] ); - if ( $action == 'yes' ) { - $this->schedule_tracking(); - $this->set_is_tracking_allowed( true, $plugin ); - if ( $this->do_tracking( true ) ) { - $this->update_block_notice( $plugin ); - } - /** - * Redirect User To the Current URL, but without set query arguments. - */ - wp_safe_redirect( $this->redirect_to() ); - } else { - $this->set_is_tracking_allowed( false, $plugin ); - $this->update_block_notice( $plugin ); - } - } - } - /** - * Set if we should block the opt-in notice for this plugin - * - * @since 3.0.0 - */ - public function update_block_notice( $plugin = null ) { - if ( empty( $plugin ) ) { - $plugin = $this->plugin_name; - } - $block_notice = get_option( 'wpins_block_notice' ); - if ( empty( $block_notice ) || ! is_array( $block_notice ) ) { - $block_notice = array( $plugin => $plugin ); - } else { - $block_notice[ $plugin ] = $plugin; - } - update_option( 'wpins_block_notice', $block_notice ); - } - /** - * AJAX callback when the deactivated form is submitted. - * - * @since 3.0.0 - */ - public function deactivate_reasons_form_submit() { - check_ajax_referer( 'wpins_deactivation_nonce', 'security' ); - if ( isset( $_POST['values'] ) ) { - $values = $_POST['values']; - update_option( 'wpins_deactivation_reason_' . $this->plugin_name, $values ); - } - if ( isset( $_POST['details'] ) ) { - $details = sanitize_text_field( $_POST['details'] ); - update_option( 'wpins_deactivation_details_' . $this->plugin_name, $details ); - } - echo 'success'; - wp_die(); - } - /** - * Filter the deactivation link to allow us to present a form when the user deactivates the plugin - * - * @since 3.0.0 - */ - public function deactivate_action_links( $links ) { - /** - * Check is tracking allowed or not. - */ - if ( ! $this->is_tracking_allowed() ) { - return $links; - } - if ( isset( $links['deactivate'] ) && $this->include_goodbye_form ) { - $deactivation_link = $links['deactivate']; - /** - * Change the default deactivate button link. - */ - $deactivation_link = str_replace( '
__( 'I found a better plugin', 'wpinsight' ), - 'extra_field' => __( 'Please share which plugin', 'wpinsight' ), - ), - __( "I couldn't get the plugin to work", 'wpinsight' ), - __( 'It\'s a temporary deactivation', 'wpinsight' ), - array( - 'label' => __( 'Other', 'wpinsight' ), - 'extra_field' => __( 'Please share the reason', 'wpinsight' ), - 'type' => 'textarea', - ), - ); - return apply_filters( 'wpins_form_text_' . $this->plugin_name, $form ); - } - /** - * Deactivate Reasons Form. - * This form will appears when user wants to deactivate the plugin to send you deactivated reasons. - * - * @since 3.0.0 - */ - public function deactivate_reasons_form() { - $form = $this->deactivation_reasons(); - $class_plugin_name = esc_attr( $this->plugin_name ); - $html = '
' . esc_html( $form['heading'] ) . '
'; - $html .= '

' . esc_html( $form['body'] ) . '

'; - if ( is_array( $form['options'] ) ) { - $html .= '
    '; - foreach ( $form['options'] as $option ) { - if ( is_array( $option ) ) { - $id = strtolower( str_replace( ' ', '_', esc_attr( $option['label'] ) ) ); - $id = $id . '_' . $class_plugin_name; - $html .= '
  • '; - $html .= ''; - $html .= '
    '; - if ( isset( $option['extra_field'] ) && ! isset( $option['type'] ) ) { - $html .= ''; - } - if ( isset( $option['extra_field'] ) && isset( $option['type'] ) ) { - $html .= '<' . $option['type'] . ' style="display: none" type="text" name="' . $id . '" id="' . str_replace( ' ', '', esc_attr( $option['extra_field'] ) ) . '" placeholder="' . esc_attr( $option['extra_field'] ) . '">'; - } - $html .= '
  • '; - } else { - $id = strtolower( str_replace( ' ', '_', esc_attr( $option ) ) ); - $id = $id . '_' . $class_plugin_name; - $html .= '
  • '; - } - } - $html .= '
'; - } - $html .= '
'; - $html .= '

' . __( 'Submitting form', 'wpinsight' ) . '

'; - - $wrapper_class = '.wpinsights-goodbye-form-wrapper-' . $class_plugin_name; - - $styles = ''; - $styles .= ''; - $styles .= ''; - - echo $styles; - ?> - - plugin_file = plugin_dir_path( __FILE__ ) . '../storegrowth-sales-booster.php'; + $this->plugin_name = basename( $this->plugin_file, '.php' ); add_action( 'wp_ajax_sgsb_admin_ajax', array( $this, 'admin_ajax' ) ); + /** + * Register ajax callback + */ + add_action( 'wp_ajax_sgsb_process_user_concent_data', array( $this, 'sgsb_process_user_concent_data' ) ); + add_action( 'wp_ajax_sgsb_inisetup_flag_update', array( $this, 'sgsb_inisetup_flag_update' ) ); } /** @@ -94,4 +126,153 @@ private function update_module_status() { wp_send_json_success(); } + /** + * Collect plugin data, + * Retrieve current plugin information + * + * @since 3.0.0 + */ + public function plugin_data() { + if ( ! function_exists( 'get_plugin_data' ) ) { + include ABSPATH . '/wp-admin/includes/plugin.php'; + } + $plugin = get_plugin_data( $this->plugin_file ); + return $plugin; + } + public function sgsb_collect_non_sensitive_data() { + $body = array( + 'plugin_slug' => sanitize_text_field( $this->plugin_name ), + 'url' => get_bloginfo( 'url' ), + 'site_name' => get_bloginfo( 'name' ), + 'site_version' => get_bloginfo( 'version' ), + 'site_language' => get_bloginfo( 'language' ), + 'charset' => get_bloginfo( 'charset' ), + 'wpins_version' => self::INVZ_VERSION, + 'php_version' => phpversion(), + 'multisite' => is_multisite(), + 'file_location' => __FILE__, + ); + + // Collect the email if the correct option has been set + + if ( ! function_exists( 'wp_get_current_user' ) ) { + include ABSPATH . 'wp-includes/pluggable.php'; + } + $current_user = wp_get_current_user(); + $email = $current_user->user_email; + if ( is_email( $email ) ) { + $body['email'] = $email; + } + $body['server'] = isset( $_SERVER['SERVER_SOFTWARE'] ) ? $_SERVER['SERVER_SOFTWARE'] : ''; + + /** + * Collect all active and inactive plugins + */ + if ( ! function_exists( 'get_plugins' ) ) { + include ABSPATH . '/wp-admin/includes/plugin.php'; + } + $plugins = array_keys( get_plugins() ); + $active_plugins = is_network_admin() ? array_keys( get_site_option( 'active_sitewide_plugins', array() ) ) : get_option( 'active_plugins', array() ); + foreach ( $plugins as $key => $plugin ) { + if ( in_array( $plugin, $active_plugins ) ) { + unset( $plugins[ $key ] ); + } + } + $body['active_plugins'] = $active_plugins; + $body['inactive_plugins'] = $plugins; + + /** + * Text Direction. + */ + $body['text_direction'] = ( function_exists( 'is_rtl' ) ? ( is_rtl() ? 'RTL' : 'LTR' ) : 'NOT SET' ); + /** + * Get Our Plugin Data. + * + * @since 3.0.0 + */ + $plugin = $this->plugin_data(); + if ( empty( $plugin ) ) { + $body['message'] .= __( 'We can\'t detect any plugin information. This is most probably because you have not included the code in the plugin main file.', 'plugin-usage-tracker' ); + $body['status'] = 'NOT FOUND'; + } else { + if ( isset( $plugin['Name'] ) ) { + $body['plugin'] = sanitize_text_field( $plugin['Name'] ); + } + if ( isset( $plugin['Version'] ) ) { + $body['version'] = sanitize_text_field( $plugin['Version'] ); + } + $body['status'] = 'Active'; + } + + /** + * Get active theme name and version + * + * @since 3.0.0 + */ + $theme = wp_get_theme(); + if ( $theme->Name ) { + $body['theme'] = sanitize_text_field( $theme->Name ); + } + if ( $theme->Version ) { + $body['theme_version'] = sanitize_text_field( $theme->Version ); + } + return $body; + } + /** + * Process Consent Data + */ + public function sgsb_process_user_concent_data() { + check_ajax_referer( 'sgsb_ajax_nonce', '_ajax_nonce' ); + $post_data = json_decode( wp_unslash( stripslashes( $_POST['data'] ) ) ); + + $update_news = $post_data->update_news; + $user_details = $post_data->user_details; + + if ( ! $update_news && ! $user_details ) { + return; + } + + $data_to_send = $this->sgsb_collect_non_sensitive_data(); + + $request_args = array( + 'body' => wp_json_encode( $data_to_send ), + 'headers' => array( + 'Content-Type' => 'application/json', + ), + 'timeout' => 30, + 'redirection' => 5, + 'blocking' => true, + 'httpversion' => '1.0', + 'sslverify' => true, + 'data_format' => 'body', + ); + + $response = wp_remote_post( self::API_URL, $request_args ); + + if ( is_wp_error( $response ) ) { + $error_message = $response->get_error_message(); + return new WP_Error( 'api_error', $error_message ); + } else { + $response_code = wp_remote_retrieve_response_code( $response ); + if ( $response_code === 200 ) { + $response_body = wp_remote_retrieve_body( $response ); + return $response_body; + } else { + return new WP_Error( 'api_error', 'API returned unexpected response code: ' . $response_code ); + } + } + + wp_send_json_success( array( 'message' => 'Success message' ) ); + wp_die(); + } + /** + * Process Consent Data + */ + public function sgsb_inisetup_flag_update() { + check_ajax_referer( 'sgsb_ajax_nonce', '_ajax_nonce' ); + $flag_data = isset( $_POST['sgsb_ini_completion'] ); + update_option( 'sgsb_ini_completion', $flag_data ); + wp_send_json_success( array( 'message' => 'Success message' ) ); + wp_die(); + } } diff --git a/Includes/Assets.php b/Includes/Assets.php index 2f1e2847..126f7dc4 100644 --- a/Includes/Assets.php +++ b/Includes/Assets.php @@ -40,8 +40,6 @@ class Assets { */ private function __construct() { add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) ); - add_action( 'admin_enqueue_scripts', array( $this, 'admin_menu_scripts' ) ); - add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_styles' ) ); } @@ -97,21 +95,6 @@ public function admin_enqueue_scripts( $hook ) { } } - /** - * Add CSS files to admin menu. - */ - public function admin_menu_scripts() { - $script_url = sgsb_assets_url( 'menu-scripts/admin-menu.js' ); - - wp_enqueue_script( - 'sgsb-settings-menu-script', - $script_url, - array(), - '1.0.1', - true - ); - } - /** * Add CSS files to admin. * diff --git a/Includes/Modules/FloatingNotificationBar/assets/src/components/ButtonAction.js b/Includes/Modules/FloatingNotificationBar/assets/src/components/ButtonAction.js index 6d7e8390..03ac3e57 100644 --- a/Includes/Modules/FloatingNotificationBar/assets/src/components/ButtonAction.js +++ b/Includes/Modules/FloatingNotificationBar/assets/src/components/ButtonAction.js @@ -7,7 +7,7 @@ const ButtonAction = ({ formData, onFieldChange }) => { const buttonActionOptions = [ { value: "ba-url-redirect", - label: __("Url Redirect", "storegrowth-sales-booster"), + label: __("URL Redirect", "storegrowth-sales-booster"), }, { value: "ba-close", diff --git a/Includes/Modules/StockBar/assets/src/components/SettingInstruction.js b/Includes/Modules/StockBar/assets/src/components/SettingInstruction.js index 910d8a75..fd58e559 100644 --- a/Includes/Modules/StockBar/assets/src/components/SettingInstruction.js +++ b/Includes/Modules/StockBar/assets/src/components/SettingInstruction.js @@ -48,7 +48,7 @@ const SettingInstruction = () => { ) } > - Documentaion + Documentation diff --git a/Includes/functions.php b/Includes/functions.php index 0a2e7205..e577b3b7 100644 --- a/Includes/functions.php +++ b/Includes/functions.php @@ -5,8 +5,6 @@ * @package WPBP */ -use STOREGROWTH\SPSB\Admin\WPInsightsStoreGrowthSalesBooster; - // If this file is called directly, abort. if ( ! defined( 'ABSPATH' ) ) { exit; @@ -131,39 +129,3 @@ function sgsb_sanitize_svg_icon_fields( $value ) { return wp_kses( $value, $icon_allowed_html ); } } - - -if ( ! function_exists( 'storegrowth_sales_booster_start_plugin_tracking' ) ) { - - /** - * This function allows you to track usage of your plugin - */ - function storegrowth_sales_booster_start_plugin_tracking() { - $tracker = WPInsightsStoreGrowthSalesBooster::get_instance( - plugin_dir_path( __FILE__ ), - array( - 'opt_in' => true, - 'goodbye_form' => true, - 'item_id' => 'cdabb75e4451684da3a3', - ) - ); - - $tracker->set_notice_options( - array( - 'notice' => __( 'Never miss an important update! - Opt in to get email notifications for security & feature updates, educational content, and occasional offers, and to share some basic WordPress environment info.', 'storegrowth-sales-booster' ), - 'extra_notice' => __( - 'We collect non-sensitive diagnostic data and plugin usage information. - Your site URL, WordPress & PHP version, plugins & themes and email address to send you the - discount coupon. This data lets us make sure this plugin always stays compatible with the most - popular plugins and themes. No spam, I promise.', - 'storegrowth-sales-booster' - ), - ) - ); - - $tracker->init(); - } - - storegrowth_sales_booster_start_plugin_tracking(); -} diff --git a/README.txt b/README.txt index 93201d9e..25a51fa1 100644 --- a/README.txt +++ b/README.txt @@ -4,7 +4,7 @@ Tags: floating cart, fly cart, side cart, checkout optimization, notification ba Requires at least: 5.4 Tested up to: 6.4.1 -Stable tag: 1.24.7 +Stable tag: 1.25.7 Requires PHP: 7.0 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html @@ -216,6 +216,10 @@ StoreGrowth floating notification bar displays ongoing offers and discounts whil == Changelog == += 1.25.7 - 10 March, 2024 = + +enhance: add onboarding screen + = 1.24.7 - 10 March, 2024 = update: fly cart icon and prompt text diff --git a/assets/images/congrats-announce.svg b/assets/images/congrats-announce.svg new file mode 100644 index 00000000..a6913c52 --- /dev/null +++ b/assets/images/congrats-announce.svg @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/welcome-announce.svg b/assets/images/welcome-announce.svg new file mode 100644 index 00000000..1ad9076a --- /dev/null +++ b/assets/images/welcome-announce.svg @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/menu-scripts/admin-menu.js b/assets/menu-scripts/admin-menu.js deleted file mode 100644 index 5b568449..00000000 --- a/assets/menu-scripts/admin-menu.js +++ /dev/null @@ -1,25 +0,0 @@ -(function ($) { - "use strict"; - - // ************************************* - // Add target blank for upgrade button - // ************************************* - $("#toplevel_page_sales-booster-for-woocommerce ul > li > a").each(function (e) { - if ($(this).attr("href").indexOf("?page=go-sgsb-pro") > 0) { - $(this).attr("target", "_blank"); - // Add hover effect - $(this).hover( - function() { - $(this).css('color', 'yellowgreen'); - }, - function() { - $(this).css('color', ''); // Revert to original color on hover out - } - ); - } - if ($(this).attr("href").indexOf("?page=go-sgsb-docs") > 0) { - $(this).attr("target", "_blank"); - } - }); - -})(jQuery); diff --git a/assets/src/admin.scss b/assets/src/admin.scss index 3936a69e..8a8891c0 100644 --- a/assets/src/admin.scss +++ b/assets/src/admin.scss @@ -10,20 +10,19 @@ $white-color: #ffffff; } } - // Usage -@include font-face('IBM Plex Sans', '../fonts/IBM_Plex_Sans/IBMPlexSans-Regular.ttf'); -@include font-face('Lato', '../fonts/Lato/Lato-Regular.ttf'); -@include font-face('Montserrat', '../fonts/Montserrat/Montserrat-Regular.ttf'); -@include font-face('Poppins', '../fonts/Poppins/Poppins-Regular.ttf'); -@include font-face('Roboto', '../fonts/Roboto/Roboto-Regular.ttf'); - +@include font-face("IBM Plex Sans", + "../fonts/IBM_Plex_Sans/IBMPlexSans-Regular.ttf" +); +@include font-face("Lato", "../fonts/Lato/Lato-Regular.ttf"); +@include font-face("Montserrat", "../fonts/Montserrat/Montserrat-Regular.ttf"); +@include font-face("Poppins", "../fonts/Poppins/Poppins-Regular.ttf"); +@include font-face("Roboto", "../fonts/Roboto/Roboto-Regular.ttf"); .sgsb-header { padding: 0 20px !important; display: inline-flex; align-items: center; - } .sgsb-logo { @@ -35,7 +34,6 @@ $white-color: #ffffff; // height: 36px; margin: 24px auto 10px; text-align: center; - } .sgsb-heading[class] { @@ -51,21 +49,18 @@ Module Card Style #sbooster-modules-page { .ant-layout-header { padding: 0; - } .ant-layout-header, .ant-layout-sider { background: #ffffff; - } - } .site-card-wrapper { .sgsb-module-card { border-radius: 10px; - background: #FFF; + background: #fff; .ant-card-body { padding: 0; @@ -79,7 +74,7 @@ Module Card Style height: auto; line-height: inherit; padding: 8px 18px 7px 15px !important; - border: 1px solid #B2DDFF; + border: 1px solid #b2ddff; position: relative; .anticon { @@ -106,20 +101,17 @@ Module Card Style .switch-btn { @media (min-width: 768px) and (max-width: 1024px) { float: none !important; - } - } .ant-switch { - background: #638DC1; + background: #638dc1; width: 46px; height: 25px; margin-left: -10px; @media (min-width: 768px) and (max-width: 1024px) { margin-left: 0 !important; - } .ant-switch-handle { @@ -128,7 +120,7 @@ Module Card Style } &.ant-switch-checked { - background: #2C81FF; + background: #2c81ff; .ant-switch-handle { left: calc(100% - 18px - 4px); @@ -138,7 +130,7 @@ Module Card Style .module-thumb { border-radius: 35px; - background: #E7F3FF; + background: #e7f3ff; padding: 14px; margin-right: 11px; width: 64px; @@ -146,36 +138,32 @@ Module Card Style display: inline-flex; align-items: center; justify-content: center; - } .module-name { - color: #073B4C; + color: #073b4c; font-size: 20px; font-style: normal; font-weight: 600; line-height: 29px; - } .module-desc { - color: #757C7E; + color: #757c7e; font-weight: 400; font-size: 16px; line-height: 28px; padding: 17px 40px 51px 23px; min-height: 180px; - } .sgsb__module-footer { - background: #DDF0FF; + background: #ddf0ff; border-bottom-left-radius: 10px; border-bottom-right-radius: 10px; @media (max-width: 767px) { padding: 19px 8px 19px !important; - } .ant-space { @@ -183,7 +171,6 @@ Module Card Style .doc-btn { display: flex; gap: 10px; - } .switch-btn { @@ -196,7 +183,6 @@ Module Card Style display: flex; justify-content: space-between; width: 100%; - } @media (min-width: 768px) and (max-width: 1024px) { @@ -205,31 +191,26 @@ Module Card Style &>div { // gap : 3px !important; - } a { // font-size: 11px !important; } - } .footer-btn[class] { - color: #073B4C; + color: #073b4c; font-size: 16px; font-weight: 400; border-radius: 8px; - border: 1px solid #B2DDFF; - background: #FFF; + border: 1px solid #b2ddff; + background: #fff; &:hover { - color: #0875FF; - border: 1px solid #B2DDFF; - + color: #0875ff; + border: 1px solid #b2ddff; } - } - } } } @@ -243,11 +224,10 @@ Pagination Style height: 47px; line-height: 45px; border-radius: 4px; - border: 1px solid #B2DDFF; + border: 1px solid #b2ddff; .ant-pagination-item-link { border: 0; - } } @@ -265,21 +245,17 @@ Pagination Style color: #fff; background: #008dff; border-radius: 4px; - } } } } .sgsb-search-section { - .search-bar { - padding-right: 10px; @media (max-width: 520px) { margin-bottom: 20px; - } &.active { @@ -287,11 +263,10 @@ Pagination Style display: block; width: 250px; border-right: none; - transition: .3s linear 0s; + transition: 0.3s linear 0s; @media (max-width: 520px) { width: 73%; - } .ant-input-group-wrapper { @@ -300,35 +275,28 @@ Pagination Style display: flex; } } - } - } .ant-input-group-addon { border-left-width: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; - } - - } - - } input[class] { - background: #F6F9FF; + background: #f6f9ff; border-radius: 8px; border: 0; height: 46px; width: 0; outline: none; display: none; - border: 1px solid #B2DDFF; + border: 1px solid #b2ddff; border-right-width: 0; - transition: .3s linear 0s; + transition: 0.3s linear 0s; &:focus { box-shadow: none; @@ -336,11 +304,11 @@ Pagination Style } .ant-input-group-addon[class] { - background-color: #F6F9FF; - border: 1px solid #B2DDFF; + background-color: #f6f9ff; + border: 1px solid #b2ddff; padding: 4px 10px 0 15px; border-radius: 8px; - color: #073B4C; + color: #073b4c; font-size: 20px; cursor: pointer; width: 46px; @@ -348,7 +316,6 @@ Pagination Style // display: flex; align-items: center; justify-content: center; - } .ant-select-selector[class] { @@ -468,22 +435,18 @@ main.ant-layout-content.sgsb-module-setting-layout { @media (max-width: 767px) { display: block; - } @media (min-width: 1500px) { // gap: 20px; - } @media (min-width: 768px) and (max-width: 1024px) { // gap: 10px; - } @media (min-width: 1500px) and (max-width: 2000px) { // gap: 20px; - } &-sideabr { @@ -491,13 +454,11 @@ main.ant-layout-content.sgsb-module-setting-layout { @media (min-width: 1800px) { // padding: 0 22px; - } @media (max-width: 767px) { padding-top: 2px; margin-bottom: 40px; - } h3 { @@ -517,7 +478,7 @@ main.ant-layout-content.sgsb-module-setting-layout { &:before { content: ""; position: absolute; - background: #0875FF; + background: #0875ff; width: 3px; height: 28px; right: 3px; @@ -527,7 +488,7 @@ main.ant-layout-content.sgsb-module-setting-layout { svg { rect { - fill: #0875FF; + fill: #0875ff; } } } @@ -535,7 +496,6 @@ main.ant-layout-content.sgsb-module-setting-layout { @media (min-width: 1500px) { // padding: 50px 8px 40px; - } svg { @@ -545,7 +505,7 @@ main.ant-layout-content.sgsb-module-setting-layout { .all-widgets-menu { h4 { - color: #073B4C; + color: #073b4c; font-size: 16px; font-weight: 600; display: flex; @@ -558,24 +518,21 @@ main.ant-layout-content.sgsb-module-setting-layout { &:hover:before { content: ""; position: absolute; - background: #0875FF; + background: #0875ff; width: 3px; height: 28px; right: 3px; border-top-left-radius: 10px; border-bottom-left-radius: 10px; - } - + } @media (min-width: 1500px) { // padding: 0 12px 20px 8px; - } span { margin-left: auto; cursor: pointer; - } .ant-menu-title-content { @@ -584,7 +541,6 @@ main.ant-layout-content.sgsb-module-setting-layout { display: flex; } } - } .widgets-menu { @@ -596,7 +552,6 @@ main.ant-layout-content.sgsb-module-setting-layout { @media (min-width: 1800px) { // padding: 0 22px; padding: 0 42px 0 0; - } &.ant-menu-hidden { @@ -608,7 +563,7 @@ main.ant-layout-content.sgsb-module-setting-layout { } .sgsb-selected-module { - background: #0875FF; + background: #0875ff; color: #ffffff !important; border-top-right-radius: 8px; border-bottom-right-radius: 8px; @@ -620,13 +575,11 @@ main.ant-layout-content.sgsb-module-setting-layout { @media (min-width: 1500px) { // padding: 12px 0px 12px 34px; - } &:hover { a { color: #ffffff; - } } @@ -642,166 +595,141 @@ main.ant-layout-content.sgsb-module-setting-layout { @media (min-width: 1500px) { // left: 8px; - } - } &.fly-cart { &:before { content: ""; - background: url('../images/menu/quick-cart-icon.svg'); - + background: url("../images/menu/quick-cart-icon.svg"); } &:hover { &:before { content: ""; - background: url('../images/menu/quick-cart-icon-white.svg'); - + background: url("../images/menu/quick-cart-icon-white.svg"); } - } } &.progressive-discount-banner { &:before { content: ""; - background: url('../images/menu/free-shipping-bar-icon.svg'); + background: url("../images/menu/free-shipping-bar-icon.svg"); width: 20px; height: 18px; background-repeat: no-repeat; - } &:hover { &:before { content: ""; - background: url('../images/menu/free-shipping-bar-icon-white.svg'); + background: url("../images/menu/free-shipping-bar-icon-white.svg"); width: 20px; height: 18px; background-repeat: no-repeat; } - } } &.floating-notification-bar { &:before { content: ""; - background: url('../images/menu/floating-bar.svg'); + background: url("../images/menu/floating-bar.svg"); width: 20px; height: 18px; background-repeat: no-repeat; - } &:hover { &:before { content: ""; - background: url('../images/menu/floating-bar-white.svg'); + background: url("../images/menu/floating-bar-white.svg"); width: 20px; height: 18px; background-repeat: no-repeat; } - } } &.sales-pop { &:before { content: ""; - background: url('../images/menu/sales-pop.svg'); + background: url("../images/menu/sales-pop.svg"); width: 19px; - } &:hover { &:before { content: ""; - background: url('../images/menu/sales-pop-white.svg'); - + background: url("../images/menu/sales-pop-white.svg"); } - } } &.countdown-timer { &:before { content: ""; - background: url('../images/menu/countdown-timer.svg'); + background: url("../images/menu/countdown-timer.svg"); width: 19px; - } &:hover { &:before { content: ""; - background: url('../images/menu/countdown-timer-white.svg'); - + background: url("../images/menu/countdown-timer-white.svg"); } - } } &.upsell-order-bump { &:before { content: ""; - background: url('../images/menu/upsel.svg'); + background: url("../images/menu/upsel.svg"); width: 19px; - } &:hover { &:before { content: ""; - background: url('../images/menu/upsel-white.svg'); - + background: url("../images/menu/upsel-white.svg"); } - } } &.direct-checkout { &:before { content: ""; - background: url('../images/menu/direct-checkout.svg'); + background: url("../images/menu/direct-checkout.svg"); width: 19px; - } &:hover { &:before { content: ""; - background: url('../images/menu/direct-checkout-white.svg'); - + background: url("../images/menu/direct-checkout-white.svg"); } - } } &.stock-bar { &:before { content: ""; - background: url('../images/menu/stock-bar.svg'); + background: url("../images/menu/stock-bar.svg"); width: 19px; - } &:hover { &:before { content: ""; - background: url('../images/menu/stock-bar-white.svg'); - + background: url("../images/menu/stock-bar-white.svg"); } - } } - } a { - color: #757D9E; + color: #757d9e; padding-top: 12px; padding-bottom: 12px; text-decoration: none; @@ -823,62 +751,57 @@ main.ant-layout-content.sgsb-module-setting-layout { } &.fly-cart::before { - background: url('../images/menu/quick-cart-icon-white.svg'); + background: url("../images/menu/quick-cart-icon-white.svg"); } &.progressive-discount-banner::before { - background: url('../images/menu/free-shipping-bar-icon-white.svg'); + background: url("../images/menu/free-shipping-bar-icon-white.svg"); width: 20px; height: 18px; background-repeat: no-repeat; } &.floating-notification-bar::before { - background: url('../images/menu/floating-bar-white.svg'); + background: url("../images/menu/floating-bar-white.svg"); width: 20px; height: 18px; background-repeat: no-repeat; } &.sales-pop::before { - background: url('../images/menu/sales-pop-white.svg'); + background: url("../images/menu/sales-pop-white.svg"); } &.direct-checkout::before { - background: url('../images/menu/direct-checkout-white.svg'); + background: url("../images/menu/direct-checkout-white.svg"); } &.stock-bar::before { - background: url('../images/menu/stock-bar-white.svg'); - + background: url("../images/menu/stock-bar-white.svg"); } &.upsell-order-bump::before { - background: url('../images/menu/upsel-white.svg'); + background: url("../images/menu/upsel-white.svg"); } &.countdown-timer::before { - background: url('../images/menu/countdown-timer-white.svg'); + background: url("../images/menu/countdown-timer-white.svg"); } - } li { - color: #757D9E; + color: #757d9e; font-size: 14px; font-weight: 500; cursor: pointer; &:hover { - background: #0875FF; + background: #0875ff; color: #ffffff; border-top-right-radius: 8px; border-bottom-right-radius: 8px; - } - } - } } @@ -888,7 +811,7 @@ main.ant-layout-content.sgsb-module-setting-layout { &:before { content: ""; position: absolute; - background: #0875FF; + background: #0875ff; width: 3px; height: 28px; right: 3px; @@ -898,7 +821,6 @@ main.ant-layout-content.sgsb-module-setting-layout { } } } - } .sgsb__settings-sidebar { @@ -909,7 +831,6 @@ main.ant-layout-content.sgsb-module-setting-layout { flex: 0 0 320px !important; max-width: 320px !important; min-width: 320px !important; - } .ant-layout-sider-children[class] { @@ -953,16 +874,15 @@ End Settings Sidebar align-items: center; padding: 9px 9px 9px 20px; border-radius: 5px; - background: #E0F6E5; + background: #e0f6e5; .sgsb-premium-limit-warning-message { - color: #073B4C; + color: #073b4c; display: block; font-size: 16px; } .premium-btn { - a { display: inline-flex; align-items: center; @@ -979,16 +899,14 @@ End Settings Sidebar span { font-size: 16px; font-weight: 700; - } - } } .premium-btn { a { border: none; - background: var(--premium-color, #FFAC27); + background: var(--premium-color, #ffac27); &:focus { color: #ffffff; @@ -998,11 +916,8 @@ End Settings Sidebar } } - - // upsell order bump css end - .sgsb-admin-dashboard { display: flex; flex-flow: row wrap; @@ -1010,22 +925,18 @@ End Settings Sidebar @media (max-width: 767px) { display: block; - } @media (min-width: 1500px) { // gap: 20px; - } @media (min-width: 768px) and (max-width: 1024px) { // gap: 10px; - } @media (min-width: 1500px) and (max-width: 2000px) { // gap: 20px; - } &-sideabr { @@ -1035,13 +946,11 @@ End Settings Sidebar @media (min-width: 1800px) { flex-basis: 320px; padding: 0 22px; - } @media (max-width: 767px) { padding-top: 2px; margin-bottom: 40px; - } h3 { @@ -1062,7 +971,7 @@ End Settings Sidebar &:before { content: ""; position: absolute; - background: #0875FF; + background: #0875ff; width: 3px; height: 28px; right: 3px; @@ -1072,7 +981,7 @@ End Settings Sidebar svg { rect { - fill: #0875FF; + fill: #0875ff; } } } @@ -1080,7 +989,6 @@ End Settings Sidebar @media (min-width: 1500px) { // padding: 50px 8px 40px; - } svg { @@ -1091,7 +999,7 @@ End Settings Sidebar .all-widgets-menu { h4 { cursor: pointer; - color: #073B4C; + color: #073b4c; font-size: 16px; font-weight: 600; display: flex; @@ -1104,23 +1012,21 @@ End Settings Sidebar &:hover:before { content: ""; position: absolute; - background: #0875FF; + background: #0875ff; width: 3px; height: 28px; right: 3px; border-top-left-radius: 10px; border-bottom-left-radius: 10px; - } + } @media (min-width: 1500px) { // padding: 0 12px 20px 8px; - } span { margin-left: auto; cursor: pointer; - } .ant-menu-title-content { @@ -1129,7 +1035,6 @@ End Settings Sidebar display: flex; } } - } .widgets-menu { @@ -1141,7 +1046,6 @@ End Settings Sidebar @media (min-width: 1800px) { // padding: 0 22px; padding: 0 42px 0 0; - } &.ant-menu-hidden { @@ -1153,7 +1057,7 @@ End Settings Sidebar } .sgsb-selected-module { - background: #0875FF; + background: #0875ff; color: #ffffff !important; border-top-right-radius: 8px; border-bottom-right-radius: 8px; @@ -1165,13 +1069,11 @@ End Settings Sidebar @media (min-width: 1500px) { // padding: 12px 0px 12px 34px; - } &:hover { a { color: #ffffff; - } } @@ -1187,166 +1089,141 @@ End Settings Sidebar @media (min-width: 1500px) { // left: 8px; - } - } &.fly-cart { &:before { content: ""; - background: url('../images/menu/quick-cart-icon.svg'); - + background: url("../images/menu/quick-cart-icon.svg"); } &:hover { &:before { content: ""; - background: url('../images/menu/quick-cart-icon-white.svg'); - + background: url("../images/menu/quick-cart-icon-white.svg"); } - } } &.progressive-discount-banner { &:before { content: ""; - background: url('../images/menu/free-shipping-bar-icon.svg'); + background: url("../images/menu/free-shipping-bar-icon.svg"); width: 20px; height: 18px; background-repeat: no-repeat; - } &:hover { &:before { content: ""; - background: url('../images/menu/free-shipping-bar-icon-white.svg'); + background: url("../images/menu/free-shipping-bar-icon-white.svg"); width: 20px; height: 18px; background-repeat: no-repeat; } - } } &.floating-notification-bar { &:before { content: ""; - background: url('../images/menu/floating-bar.svg'); + background: url("../images/menu/floating-bar.svg"); width: 20px; height: 18px; background-repeat: no-repeat; - } &:hover { &:before { content: ""; - background: url('../images/menu/floating-bar-white.svg'); + background: url("../images/menu/floating-bar-white.svg"); width: 20px; height: 18px; background-repeat: no-repeat; } - } } &.sales-pop { &:before { content: ""; - background: url('../images/menu/sales-pop.svg'); + background: url("../images/menu/sales-pop.svg"); width: 19px; - } &:hover { &:before { content: ""; - background: url('../images/menu/sales-pop-white.svg'); - + background: url("../images/menu/sales-pop-white.svg"); } - } } &.countdown-timer { &:before { content: ""; - background: url('../images/menu/countdown-timer.svg'); + background: url("../images/menu/countdown-timer.svg"); width: 19px; - } &:hover { &:before { content: ""; - background: url('../images/menu/countdown-timer-white.svg'); - + background: url("../images/menu/countdown-timer-white.svg"); } - } } &.upsell-order-bump { &:before { content: ""; - background: url('../images/menu/upsel.svg'); + background: url("../images/menu/upsel.svg"); width: 19px; - } &:hover { &:before { content: ""; - background: url('../images/menu/upsel-white.svg'); - + background: url("../images/menu/upsel-white.svg"); } - } } &.direct-checkout { &:before { content: ""; - background: url('../images/menu/direct-checkout.svg'); + background: url("../images/menu/direct-checkout.svg"); width: 19px; - } &:hover { &:before { content: ""; - background: url('../images/menu/direct-checkout-white.svg'); - + background: url("../images/menu/direct-checkout-white.svg"); } - } } &.stock-bar { &:before { content: ""; - background: url('../images/menu/stock-bar.svg'); + background: url("../images/menu/stock-bar.svg"); width: 19px; - } &:hover { &:before { content: ""; - background: url('../images/menu/stock-bar-white.svg'); - + background: url("../images/menu/stock-bar-white.svg"); } - } } - } a { - color: #757D9E; + color: #757d9e; padding-top: 12px; padding-bottom: 12px; text-decoration: none; @@ -1368,57 +1245,51 @@ End Settings Sidebar } &.fly-cart::before { - background: url('../images/menu/quick-cart-icon-white.svg'); + background: url("../images/menu/quick-cart-icon-white.svg"); } &.progressive-discount-banner::before { - background: url('../images/menu/free-shipping-bar-icon-white.svg'); + background: url("../images/menu/free-shipping-bar-icon-white.svg"); width: 20px; height: 18px; background-repeat: no-repeat; } &.sales-pop::before { - background: url('../images/menu/sales-pop-white.svg'); + background: url("../images/menu/sales-pop-white.svg"); } &.direct-checkout::before { - background: url('../images/menu/direct-checkout-white.svg'); + background: url("../images/menu/direct-checkout-white.svg"); } &.stock-bar::before { - background: url('../images/menu/stock-bar-white.svg'); - + background: url("../images/menu/stock-bar-white.svg"); } &.upsell-order-bump::before { - background: url('../images/menu/upsel-white.svg'); + background: url("../images/menu/upsel-white.svg"); } &.countdown-timer::before { - background: url('../images/menu/countdown-timer-white.svg'); + background: url("../images/menu/countdown-timer-white.svg"); } - } li { - color: #757D9E; + color: #757d9e; font-size: 14px; font-weight: 500; cursor: pointer; &:hover { - background: #0875FF; + background: #0875ff; color: #ffffff; border-top-right-radius: 8px; border-bottom-right-radius: 8px; - } - } - } - } h3, @@ -1427,7 +1298,7 @@ End Settings Sidebar &:before { content: ""; position: absolute; - background: #0875FF; + background: #0875ff; width: 3px; height: 28px; right: 3px; @@ -1438,7 +1309,7 @@ End Settings Sidebar } .active-widgets { - color: #073B4C; + color: #073b4c; font-size: 15px; list-style: none; display: flex; @@ -1455,15 +1326,14 @@ End Settings Sidebar .request__feature-block { text-align: center; border-radius: 8px; - border: 1px solid #2541AC; - background: #2541AC; + border: 1px solid #2541ac; + background: #2541ac; padding: 57px 3px 25px; margin: 95px 8px 0; position: relative; @media (min-width: 320px) and (max-width: 520px) { margin-bottom: 60px; - } &:before { @@ -1472,7 +1342,7 @@ End Settings Sidebar bottom: -19px; width: 100%; height: 40px; - background: url('../images/slide-layer.svg'); + background: url("../images/slide-layer.svg"); left: 0; background-repeat: no-repeat; background-size: contain; @@ -1481,14 +1351,12 @@ End Settings Sidebar @media (min-width: 320px) and (max-width: 520px) { background-size: cover; bottom: -31px; - } @media (min-width: 1441px) and (max-width: 2000px) { background-size: cover; left: -1.4px; bottom: -31px; - } } @@ -1498,9 +1366,7 @@ End Settings Sidebar .ant-image-img { width: inherit; - } - } .box-icon { @@ -1508,15 +1374,13 @@ End Settings Sidebar top: -38px; left: 50%; transform: translateX(-50%); - } .rating { margin-bottom: 22px; svg { - color: #FEB423; - + color: #feb423; } } @@ -1530,20 +1394,17 @@ End Settings Sidebar color: #ffffff; box-shadow: none; } - } h4, p, h5 { color: #ffffff; - } h5 { font-size: 14px; font-weight: 600; - } h4 { @@ -1551,7 +1412,6 @@ End Settings Sidebar font-weight: 600; line-height: 27px; margin-bottom: 4px; - } p { @@ -1559,20 +1419,15 @@ End Settings Sidebar font-weight: 300; line-height: 21px; margin-bottom: 20px; - } .ant-btn { border-radius: 6px; - background: #0875FF; + background: #0875ff; padding: 0 16px; border: 0; - } } - - - } &-module { @@ -1587,7 +1442,6 @@ End Settings Sidebar @media (min-width: 1800px) { .sgsb__module-pagination { padding-left: 38px !important; - } } @@ -1598,7 +1452,6 @@ End Settings Sidebar .sgsb__module-pagination { padding-left: 8px !important; - } .dashboard-faq-page { @@ -1635,9 +1488,7 @@ End Settings Sidebar @media (min-width: 1200px) and (max-width: 1439px) { .module-desc[class] { min-height: 208px; - } - } @media (min-width: 992px) and (max-width: 1199px) { @@ -1671,17 +1522,13 @@ End Settings Sidebar .doc-btn { gap: 3px !important; - } .footer-btn[class] { font-size: 10px; - } - } } - } @media (min-width: 1301px) and (max-width: 1439px) { @@ -1691,12 +1538,9 @@ End Settings Sidebar .footer-btn[class] { font-size: 12px; - } - } } - } @media (min-width: 1025px) and (max-width: 1199px) { @@ -1711,14 +1555,11 @@ End Settings Sidebar } } } - } - .module-banner[class] { .ant-image[class] { width: 100% !important; - } } @@ -1752,10 +1593,8 @@ End Settings Sidebar object-fit: cover; border-top-left-radius: 10px; border-top-right-radius: 10px; - } } - } @media (min-width: 1500px) and (max-width: 2000px) { @@ -1764,11 +1603,7 @@ End Settings Sidebar &-box-content { // padding-left: 0 !important; padding: 30px 0 0 30px; - } - - - } @media (min-width: 2001px) { @@ -1791,11 +1626,8 @@ End Settings Sidebar .module-banner { .ant-image { width: 100% !important; - } } - - } } @@ -1805,37 +1637,29 @@ End Settings Sidebar .module-banner { .ant-image { width: 100% !important; - } } .doc-btn { // gap: 2px !important; - } &-box-content { // padding-left: 0 !important; padding: 8px 0 0 8px; - } - } @media (min-width: 1440px) and (max-width: 2000px) { - .module-banner { .ant-image { width: 100% !important; - } } - } .ant-alert-warning { margin: 13px 0px 0 14px; - } &-top-bar { @@ -1857,7 +1681,6 @@ End Settings Sidebar @media (max-width: 767px) { display: none; - } } @@ -1873,13 +1696,11 @@ End Settings Sidebar @media (max-width: 767px) { display: none; - } } @media (max-width: 767px) { margin-bottom: 30px; - } .help-btn, @@ -1904,16 +1725,14 @@ End Settings Sidebar span { font-size: 18px; font-weight: 700; - } - } } .premium-btn { a { border: none; - background: var(--premium-color, #FFAC27); + background: var(--premium-color, #ffac27); &:focus { color: #ffffff; @@ -1921,7 +1740,6 @@ End Settings Sidebar } } } - } @media (max-width: 991px) { @@ -1930,13 +1748,11 @@ End Settings Sidebar &>div { max-width: 100% !important; - } .module-banner { .ant-image { width: 100% !important; - } } @@ -1944,7 +1760,6 @@ End Settings Sidebar .ant-card-body { &>div { display: block; - } } } @@ -1952,18 +1767,15 @@ End Settings Sidebar } @media (min-width: 1440px) and (max-width: 2000px) { - &-box-content { .sgsb-module-card { .ant-card-body { &>div { display: block; - } } } } - } @media (min-width: 1300px) and (max-width: 1550px) { @@ -1976,13 +1788,10 @@ End Settings Sidebar .switch-btn[class] { float: left !important; padding-left: 10px; - } } - } } - } } @@ -1993,7 +1802,6 @@ End Settings Sidebar .sgsb-logo { margin: 15px auto 10px; display: inline-block; - } } @@ -2001,7 +1809,7 @@ End Settings Sidebar .header-content { margin: 0; display: flex; - color: #073B4C; + color: #073b4c; font-size: 24px; font-weight: 600; line-height: 32px; @@ -2018,7 +1826,7 @@ End Settings Sidebar .header-divider { margin: 0; - color: #DDE6F9; + color: #dde6f9; } } @@ -2036,6 +1844,7 @@ End Settings Sidebar .dashicons { color: #0875ff; cursor: pointer; + &.dashicons-undo { color: #0875ff; cursor: pointer; @@ -2045,7 +1854,7 @@ End Settings Sidebar .sgsb-settings-card { height: 100%; border-radius: 5px; - border-color: #DDE6F9; + border-color: #dde6f9; .pro-content-overlay { top: 0; @@ -2067,7 +1876,7 @@ End Settings Sidebar padding: 9px 15px; border-radius: 5px; align-items: center; - background: #FFAC27; + background: #ffac27; display: inline-flex; .overlay-btn-crown { @@ -2169,7 +1978,6 @@ End Settings Sidebar margin-top: 5px; } - .settings-heading { margin: 0; margin-right: 10px; @@ -2181,7 +1989,7 @@ End Settings Sidebar .settings-field { float: right; - background: #DFE6F3; + background: #dfe6f3; &.singlecheckbox-field { background: none; @@ -2237,17 +2045,16 @@ End Settings Sidebar } .ant-select-selection-item { - color: #073B4C; - background: #F6F9FF; + color: #073b4c; + background: #f6f9ff; } - } } &.number-field { width: 100%; border-radius: 5px; - background: #F6F9FF; + background: #f6f9ff; input { color: #000; @@ -2256,7 +2063,7 @@ End Settings Sidebar &.combine-field { padding: 5px; - border-color: #DDE6F9; + border-color: #dde6f9; input { text-align: left; @@ -2266,10 +2073,10 @@ End Settings Sidebar &.textarea-field, &.textinput-field { - color: #073B4C; + color: #073b4c; border-radius: 5px; - background: #F6F9FF; - border: 1px solid #DDE6F9; + background: #f6f9ff; + border: 1px solid #dde6f9; &.field-gap { margin-bottom: 15px; @@ -2289,15 +2096,15 @@ End Settings Sidebar } &.single-select-field { - border-color: #DDE6F9; - background: #F6F9FF; + border-color: #dde6f9; + background: #f6f9ff; border-radius: 5px; .ant-select-selector { - border-color: #DDE6F9; + border-color: #dde6f9; border-radius: 5px; - background: #F6F9FF; - color: #073B4C; + background: #f6f9ff; + color: #073b4c; } &.combine-select, @@ -2321,7 +2128,7 @@ End Settings Sidebar } &.ant-switch-checked { - background: #0875FF; + background: #0875ff; } &.color-picker-field { @@ -2329,7 +2136,7 @@ End Settings Sidebar background: transparent; .ant-color-picker-color-block-inner { - border-color: #DDE6F9; + border-color: #dde6f9; } } @@ -2344,10 +2151,10 @@ End Settings Sidebar height: 100%; padding: 0 12px; border-radius: 5px; - border: 1px solid #DDE6F9; + border: 1px solid #dde6f9; &.ant-radio-button-wrapper-checked { - border-color: #0875FF; + border-color: #0875ff; } &:before { @@ -2355,14 +2162,15 @@ End Settings Sidebar } &:hover { - background: #0875FF; - border-color: #0875FF; + background: #0875ff; + border-color: #0875ff; .radio-icon { path { - fill: #FFF !important; + fill: #fff !important; } } + .radio-icon-stroke { path { fill: none !important; @@ -2391,7 +2199,6 @@ End Settings Sidebar } &.quick-cart-position { - grid-template-rows: repeat(2, auto); img { @@ -2404,8 +2211,9 @@ End Settings Sidebar width: 120px; } } + .upgrade-button { - gap:0px; + gap: 0px; flex-direction: column; } } @@ -2423,7 +2231,6 @@ End Settings Sidebar } } - .option-name { gap: 0px; display: flex; @@ -2438,13 +2245,11 @@ End Settings Sidebar position: absolute; bottom: 28%; } - } - } label.ant-radio-button-wrapper { - color: #073B4C; + color: #073b4c; font-size: 14px; .layout-img { @@ -2461,7 +2266,7 @@ End Settings Sidebar &:hover, &.ant-radio-button-wrapper-checked { - border: 1px solid #0875FF; + border: 1px solid #0875ff; background: transparent; } @@ -2484,7 +2289,7 @@ End Settings Sidebar height: 16px; display: flex; font-size: 12px; - background: #0875FF; + background: #0875ff; border-radius: 100%; justify-content: center; transform: translate(50%, -50%); @@ -2494,7 +2299,7 @@ End Settings Sidebar &.custom-field { label.ant-radio-button-wrapper { &:hover { - border-color: #DDE6F9; + border-color: #dde6f9; background: transparent; } @@ -2515,12 +2320,12 @@ End Settings Sidebar &:not(.ant-switch-checked) { .ant-switch-inner-unchecked { - color: #73829D; + color: #73829d; } .ant-switch-handle { &:before { - background: #ABB8D0; + background: #abb8d0; } } } @@ -2570,7 +2375,7 @@ End Settings Sidebar } .settings-heading { - color: #073B4C; + color: #073b4c; font-size: 16px; font-weight: 500; line-height: 20px; @@ -2591,14 +2396,14 @@ End Settings Sidebar margin-right: 10px; align-items: center; border-radius: 50px; - background: #DFE6F3; + background: #dfe6f3; justify-content: center; } .textarea-content { p { margin: 0; - color: #073B4C; + color: #073b4c; font-size: 14px; line-height: 1.8; } @@ -2613,7 +2418,7 @@ End Settings Sidebar font-size: 10px; font-weight: 600; line-height: 1; - background: #FFAC27; + background: #ffac27; color: white; border-radius: 10px; padding: 4px 7px; @@ -2658,7 +2463,7 @@ End Settings Sidebar .upgrade-content { gap: 10px; display: flex; - color: #073B4C; + color: #073b4c; font-weight: 500; } } @@ -2711,36 +2516,36 @@ End Settings Sidebar .section-divider { margin: 50px 0; - color: #DDE6F9; + color: #dde6f9; } .sgsb-collapse-settings { overflow: hidden; - border-color: #DDE6F9; + border-color: #dde6f9; border-radius: 5px; .ant-collapse-item { - border-color: #DDE6F9; + border-color: #dde6f9; border-radius: 0; } .ant-collapse-header { border-radius: 0; - background: #FFF; + background: #fff; padding: 10px 16px; .ant-collapse-header-text { - color: #073B4C; + color: #073b4c; } } .ant-collapse-content { border-radius: 0; background: #f7f9ff; - border-color: #DDE6F9; + border-color: #dde6f9; .content-bump-label { - color: #073B4C; + color: #073b4c; display: block; font-size: 16px; font-weight: 500; @@ -2750,10 +2555,10 @@ End Settings Sidebar #fixed-bump, #discount-bump { - color: #073B4C; + color: #073b4c; padding: 6px 10px; border-radius: 5px; - border: 1px solid #DDE6F9; + border: 1px solid #dde6f9; } } } @@ -2789,7 +2594,7 @@ End Settings Sidebar padding: 9px 15px; border-radius: 5px; align-items: center; - background: #FFAC27; + background: #ffac27; display: inline-flex; .overlay-btn-crown { @@ -2823,12 +2628,12 @@ End Settings Sidebar .ant-tabs-tab-active { .ant-tabs-tab-btn { - color: #0875FF; + color: #0875ff; } } &:before { - border-color: #DDE6F9; + border-color: #dde6f9; } } @@ -2841,7 +2646,7 @@ End Settings Sidebar h4 { margin: 0; - color: #073B4C; + color: #073b4c; font-size: 18px; font-weight: 600; } @@ -2863,27 +2668,27 @@ End Settings Sidebar .sgsb-settings-save-button { border: 0; margin: 0; - color: #FFF; + color: #fff; height: auto; z-index: 9999; line-height: 1; font-size: 16px; font-weight: 500; padding: 12px 24px; - background: #0875FF; + background: #0875ff; } .sgsb-settings-reset-button { height: auto; z-index: 9999; - color: #073B4C; + color: #073b4c; line-height: 1; font-size: 16px; font-weight: 500; border-radius: 5px; padding: 12px 24px; background: #f6f9ff; - border: 1px solid #DDE6F9; + border: 1px solid #dde6f9; } } } @@ -2917,7 +2722,7 @@ End Settings Sidebar width: 50px; height: 40px; display: flex; - background: #0875FF; + background: #0875ff; align-items: center; align-self: self-start; justify-content: center; @@ -2990,7 +2795,7 @@ End Settings Sidebar font-size: 10px; font-weight: 600; line-height: 1; - background: #FFAC27; + background: #ffac27; color: white; border-radius: 10px; padding: 4px 7px; @@ -3018,7 +2823,7 @@ End Settings Sidebar padding: 4px 14px; border-radius: 5px; align-items: center; - background: #FFAC27; + background: #ffac27; display: inline-flex; .overlay-btn-crown { @@ -3042,11 +2847,11 @@ End Settings Sidebar .ant-select-selector { width: 100%; - border-color: #DDE6F9 !important; + border-color: #dde6f9 !important; } .trigger-radio-selected { - background-color: #F6F9FF; + background-color: #f6f9ff; } .ant-radio-input { @@ -3094,7 +2899,7 @@ End Settings Sidebar &.modal-content-heading { font-size: 22px; font-weight: 700; - color: #102F50; + color: #102f50; margin-bottom: 0; } } @@ -3111,24 +2916,24 @@ End Settings Sidebar margin-top: 10px; .modal-cancel-button { - color: #FF0834; - border: 1px solid #FF0834; + color: #ff0834; + border: 1px solid #ff0834; &:hover { - background-color: #FFF0F3 !important; - color: #FF0834; - border: 1px solid #FF0834; + background-color: #fff0f3 !important; + color: #ff0834; + border: 1px solid #ff0834; } } .modal-submit-button { - color: #0875FF; - border: 1px solid #0875FF; + color: #0875ff; + border: 1px solid #0875ff; &:hover { - background-color: #ECF4FF; - color: #0875FF; - border: 1px solid #0875FF; + background-color: #ecf4ff; + color: #0875ff; + border: 1px solid #0875ff; } } @@ -3140,3 +2945,389 @@ End Settings Sidebar } } } + +/** +* starting of the intial setup page design. +*/ +.sgsb-ini-setup-page { + display: flex; + flex-direction: column; + align-items: center; + gap: 20px; + background-color: #fff; + min-height: inherit; + margin-bottom: -25px; + margin-left: -15px; + margin-right: -20px; + padding: 30px 30px 20px; + + .sgsb-ini-page-container { + max-width: 1100px; + width: -webkit-fill-available; + display: flex; + flex-direction: column; + align-items: center; + + .storegrowth-icon { + width: 100%; + display: flex; + justify-content: space-between; + gap: 12%; + padding: 0px 8px; + + img { + height: 28px; + } + + .steps-skipper-controller { + width: 18%; + text-align: center; + color: #1B49F6; + font-weight: 500; + cursor: pointer; + } + } + + .sgsg-ini-setup-progress { + width: 100%; + + .ant-steps-item-content { + font-weight: 700; + } + } + + .sgsb-return-dashboard { + .sgsb-dashboard-cta { + height: auto; + padding: 20px 30px; + border-radius: 5px; + border: none; + background: #e3e9ff; + } + } + + .sgsb-ini-setup-content-layout { + + .sgsb-steps-controller { + display: flex; + gap: 10px; + justify-content: center; + } + + .steps-button { + padding: 12px 30px; + border-radius: 6px; + border: none; + font-weight: 700; + width: fit-content; + cursor: pointer; + + &.next { + color: #fff; + background-color: #0875ff; + } + + &.previous { + background-color: #ffffff; + border: 1px solid black; + } + + &.completion-cta { + color: #fff; + background-color: #0875ff; + } + + &.doc-cta { + color: #fff; + background: #000000; + } + + &.support-cta { + color: #073b4c; + background-color: #dde6f9; + } + } + + // Welcome step layout + .sgsb-ini-setup-welcome { + display: flex; + justify-content: center; + flex-direction: column; + align-items: center; + + .ini-setup-announce-container { + display: flex; + flex-direction: column; + align-items: center; + gap: 24px; + margin: 80px 0px; + + &.congratulation { + margin: 40px 0px; + } + + .annouce-contents { + display: flex; + flex-direction: column; + gap: 10px; + max-width: 530px; + + .sgsb-content-heading { + color: var(--Secoundary-Color, #073b4c); + text-align: center; + font-size: 36px; + font-style: normal; + font-weight: 700; + line-height: normal; + margin: 0; + + span { + color: var(--Primary-Color, #0875ff); + } + } + + .sgsb-sub-heading { + // white-space: pre-line; + color: var(--Secoundary-Color, #5A5A5F); + text-align: center; + font-size: 16px; + font-style: normal; + font-weight: 500; + line-height: normal; + } + } + + .social-links { + display: flex; + gap: 10px; + + a { + &.social-link { + display: flex; + padding: 8px 12px 8px 8px; + justify-content: center; + align-items: center; + gap: var(--S-8, 8px); + border-radius: 10px; + color: var(--Text-color-Primary, #000012); + text-align: center; + font-size: 14px; + font-style: normal; + font-weight: 500; + } + + &.youtube { + background: #FFD5D5; + } + + &.get-support { + background: #B7DFFF; + } + + &.documentation { + background: #FFE7D9; + } + } + } + + .get-started { + display: flex; + height: 40px; + padding: 24px 20px; + justify-content: center; + align-items: center; + gap: 10px; + background-color: #0875FF; + color: #fff; + } + } + + //user Agriment + .ini-setup.user-agreement { + display: flex; + flex-direction: column; + gap: 16px; + + .getting-updates, + .getting-essentials { + .ant-checkbox-checked { + .ant-checkbox-inner { + background-color: #fff; + border-color: #B7DFFF; + + &::after { + border: 1.5px solid #008DFF; + border-left: none; + border-top: none; + } + } + } + + + .user-agreement { + display: flex; + gap: 6px; + + p { + margin: 0; + + &.heading { + font-weight: 600; + } + } + } + + } + + } + } + + //Modules page + .sgsb-admin-dashboard-module { + + .ini-setup-announce-container { + display: flex; + flex-direction: column; + align-items: center; + gap: 24px; + padding: 36px 0px; + + .annouce-contents { + display: flex; + flex-direction: column; + gap: 10px; + max-width: 530px; + + .sgsb-content-heading { + color: var(--Secoundary-Color, #073b4c); + text-align: center; + font-size: 36px; + font-style: normal; + font-weight: 700; + line-height: normal; + margin: 0; + + span { + color: var(--Primary-Color, #0875ff); + } + } + + .sgsb-sub-heading { + // white-space: pre-line; + color: var(--Secoundary-Color, #5A5A5F); + text-align: center; + font-size: 16px; + font-style: normal; + font-weight: 500; + line-height: normal; + } + } + } + + .sgsb-admin-dashboard-module-box-content { + padding: 0px !important; + background: none; + margin-bottom: 14px; + } + } + + //Setup Completion page + .sgsb-step-completion { + display: flex; + flex-direction: column; + gap: 50px; + + .sgsb-inisetup-heading-content { + display: flex; + justify-content: center; + flex-direction: column; + align-items: center; + gap: 24px; + + .completion-check-mark { + border: 2px solid #0875ff; + border-radius: 50%; + padding: 24px 22px; + display: inline-flex; + } + + .setup-completion-heading { + display: flex; + flex-direction: column; + align-items: center; + + .heading { + color: #073b4c; + text-align: center; + font-size: 36px; + font-weight: 700; + } + + .sub-heading { + color: #073b4c; + text-align: center; + font-size: 14px; + font-weight: 400; + } + } + } + + .sgsb-ini-setup-completion { + .sgsb-intro-video { + iframe { + width: 36vw; + height: 19vw; + border-radius: 6px; + background: gray; + } + } + + &.support-doc { + display: flex; + gap: 44px; + margin-left: 8%; + } + + .sgsb-support-doc-cta { + display: flex; + flex-direction: column; + gap: 15px; + } + } + + .ini-setup { + &.user-agreement { + display: flex; + flex-direction: column; + gap: 12px; + margin-left: 8%; + + .getting-updates, + .getting-essentials { + display: flex; + align-items: flex-start; + gap: 10px; + + .content-container { + line-height: 0.5; + + .heading { + color: var(--Secoundary-Color, #073b4c); + font-size: 16px; + font-weight: 500; + } + + .content { + color: var(--Secoundary-Color, #073b4c); + font-size: 12px; + font-weight: 400; + } + } + } + } + } + } + } + } + +} diff --git a/assets/src/components/dashboard/Overview.js b/assets/src/components/dashboard/Overview.js index 0b6e11e0..471ad5d2 100644 --- a/assets/src/components/dashboard/Overview.js +++ b/assets/src/components/dashboard/Overview.js @@ -38,7 +38,7 @@ const Overview = () => { {/* intro-section */}
- +
diff --git a/assets/src/components/dashboard/PremiumBox.js b/assets/src/components/dashboard/PremiumBox.js index 3ceda461..30b1dd5f 100644 --- a/assets/src/components/dashboard/PremiumBox.js +++ b/assets/src/components/dashboard/PremiumBox.js @@ -19,7 +19,7 @@ function PremiumBox() { support and boost your website’s visibility.

- + {current !== 2 && } + {current === 2 && +
iniSetupChecker()} + > + {__(`Go to dashboard`, "storegrowth-sales-booster")} + + } + + + } + + ); +} + +export default ContentLayout; diff --git a/assets/src/components/initail-setup/IniSetupLayout.jsx b/assets/src/components/initail-setup/IniSetupLayout.jsx new file mode 100644 index 00000000..d034cec0 --- /dev/null +++ b/assets/src/components/initail-setup/IniSetupLayout.jsx @@ -0,0 +1,154 @@ +import { + React, + Fragment, + useState, + useRef, + useEffect, +} from "@wordpress/element"; +import Progress from "./Progress"; +import { Steps } from "antd"; +import StoreGrowthIcon from "../../../images/logo.svg"; +import { __ } from "@wordpress/i18n"; +import { Ajax } from "../../ajax"; + +const IniSetupLayout = () => { + const [current, setCurrent] = useState(0); + const contentLayoutRef = useRef(null); + + const agreementsData = { + update_news: true, + user_details: true, + }; + const [agreementData, setAgreementData] = useState(agreementsData); + + const steps = [ + { + title: "Welcome", + }, + { + title: "Modules", + }, + { + title: "Ready", + }, + ]; + const stepSize = steps.length; + + const fetchData = async (url, params) => { + try { + const response = await fetch(url, { + method: "POST", + credentials: "same-origin", + headers: { + "Content-Type": "application/x-www-form-urlencoded", + }, + body: new URLSearchParams(params), + }); + + if (!response.ok) { + throw new Error("Network response was not ok"); + } + return await response.json(); + } catch (error) { + console.error("Error fetching data:", error); + } + }; + + const getUserDetails = async () => { + const params = { + _ajax_nonce: sgsbAdmin.nonce, + action: "sgsb_process_user_concent_data", + data: JSON.stringify(agreementData), + }; + return await fetchData("/wp-admin/admin-ajax.php", params); + }; + + const iniSetupChecker = async () => { + const params = { + _ajax_nonce: sgsbAdmin.nonce, + action: "sgsb_inisetup_flag_update", + sgsb_ini_completion: true, + }; + return await fetchData("/wp-admin/admin-ajax.php", params); + }; + + const handleCheckbox = (key, value) => { + setAgreementData({ + ...agreementData, + [key]: value, + }); + }; + + const next = () => { + setCurrent(current + 1); + }; + + const prev = () => { + setCurrent(current - 1); + }; + + const redirectHandler = () => { window.location.href = 'admin.php?page=sgsb-settings#/dashboard/overview' }; + const skipHandler = (event) => { + if (current !== (stepSize - 1)) { + next(); + } else { redirectHandler(); iniSetupChecker(); } + } + + useEffect(() => { + // Scroll to the top of the content layout when 'current' changes + if (current !== 0) { + if (contentLayoutRef.current) { + contentLayoutRef.current.scrollIntoView({ behavior: "smooth" }); + } + } + }, [current]); + + const DynamicContent = current !== (stepSize - 1) ? "Skip This Step" : "Skip Guide"; + + return ( + +
+
+
+ storegrowth-icon + { + setCurrent(value); + if (value !== 0) { + getUserDetails(); + } + }} + items={steps} + /> +
+ skipHandler()} + > + {__(`${current !== 0 ? DynamicContent : ""}`, "storegrowth-sales-booster")} + +
+
+
+ {" "} + +
+
+
+
+ ); +}; + +export default IniSetupLayout; diff --git a/assets/src/components/initail-setup/ModulesSetup.jsx b/assets/src/components/initail-setup/ModulesSetup.jsx new file mode 100644 index 00000000..32b6e3ae --- /dev/null +++ b/assets/src/components/initail-setup/ModulesSetup.jsx @@ -0,0 +1,88 @@ +import { useDispatch, useSelect } from "@wordpress/data"; +import { useEffect, useState} from "@wordpress/element"; +import { Pagination } from "antd"; +import ModuleList from "../modules/ModuleList"; +import { Ajax } from "../../ajax"; +import { __ } from "@wordpress/i18n"; + +function ModulesSetup() { + + const perPageItem = 6; + + const [pagination, setPagination] = useState({ + minValue: 0, + maxValue: perPageItem, + selectFilter: { modules: [] }, + currentPage: 1, + }); + + const { updateModules } = useDispatch("sgsb"); + + // Get from WP data. + const { allModules } = useSelect((select) => ({ + allModules: select("sgsb").getModules(), + })); + + const hanglePageItem = (pageNumber) => { + // Pagination calculation based on all Modules (preserves the current page) + const startIndex = (pageNumber - 1) * perPageItem; + const endIndex = startIndex + perPageItem; + + setPagination({ + ...pagination, + minValue: startIndex, + maxValue: endIndex, + currentPage: pageNumber, + }); + }; + + useEffect(() => { + if (allModules) { + setPagination({ + ...pagination, + selectFilter: { modules: allModules }, + }); + } + }, [allModules]); + + useEffect(() => { + Ajax("get_all_modules").success((response) => { + updateModules(response); + }); + }, []); + + return ( +
+
+
+
+

{__("Choose and Enable Modules", "storegrowth-sales-booster")}

+ {__(`This is a list of all the modules of StoreGrowth. Enable your desired modules and get them ready for your next sales campaign.`, 'storegrowth-sales-booster')} +
+
+ +
+ +
+
+
+ ); +} + +export default ModulesSetup; diff --git a/assets/src/components/initail-setup/Progress.jsx b/assets/src/components/initail-setup/Progress.jsx new file mode 100644 index 00000000..d50507d6 --- /dev/null +++ b/assets/src/components/initail-setup/Progress.jsx @@ -0,0 +1,14 @@ + +import { Fragment } from '@wordpress/element'; +import ContentLayout from './ContentLayout'; + +const Progress = ({ next, prev, current,stepSize, agreementData, handleCheckbox ,getUserDetails, iniSetupChecker}) => { + + return ( + + + + ); +} + +export default Progress diff --git a/assets/src/components/initail-setup/Ready.jsx b/assets/src/components/initail-setup/Ready.jsx new file mode 100644 index 00000000..5685462c --- /dev/null +++ b/assets/src/components/initail-setup/Ready.jsx @@ -0,0 +1,65 @@ +import { Fragment } from "react"; +import { __ } from "@wordpress/i18n"; +import CongratsAnnounce from '../../../images/congrats-announce.svg' + +const Ready = () => { + return ( + +
+
+ storegrowth-icon +
+

{__("Congratulation!", "storegrowth-sales-booster")}

+ {__(`You are at the last step to complete the setup process and start using the exciting features of StoreGrowth`, 'storegrowth-sales-booster')} +
+
+ + + + + {__(`Youtube`, "storegrowth-sales-booster")} + + + + + + + + + {__(`Get Support`, "storegrowth-sales-booster")} + + + + + + + + + + + + {__(`Documentation`, "storegrowth-sales-booster")} + +
+
+
+
+ ); +}; + +export default Ready; diff --git a/assets/src/components/initail-setup/Welcome.jsx b/assets/src/components/initail-setup/Welcome.jsx new file mode 100644 index 00000000..0aab75e2 --- /dev/null +++ b/assets/src/components/initail-setup/Welcome.jsx @@ -0,0 +1,41 @@ +import { Fragment } from 'react' +import { Checkbox } from 'antd'; +import { __ } from '@wordpress/i18n'; +import WelcomeAnnounce from '../../../images/welcome-announce.svg' +const Welcome = ({ next, agreementData, handleCheckbox, getUserDetails }) => { + + return ( + +
+
+ storegrowth-icon +
+

{__("Welcome To StoreGrowth", "storegrowth-sales-booster")}

+ {__(`Conversion Boosting Toolkit for WooCommerce`, 'storegrowth-sales-booster')} +
+ +
+
+
+ handleCheckbox('update_news', !agreementData?.update_news)} > + +

{__('Get Updates: ', "storegrowth-sales-booster")}

+

{__('We will send essential tips & tricks for effective usage of StoreGrowth.', "storegrowth-sales-booster")}

+
+
+
+
+ handleCheckbox('user_details', !agreementData.user_details)} > + +

{__('Share Essentials: ', "storegrowth-sales-booster")}

+

{__('Let us collect non-sensitive diagnosis data and usage information.', "storegrowth-sales-booster")}

+
+
+
+
+
+
+ ) +} + +export default Welcome diff --git a/assets/src/components/modules/Layout.js b/assets/src/components/modules/Layout.js index a8a83f98..a72eaefd 100644 --- a/assets/src/components/modules/Layout.js +++ b/assets/src/components/modules/Layout.js @@ -1,26 +1,30 @@ -import { Layout } from 'antd'; +import { Layout } from "antd"; +import { useRoutes } from "react-router-dom"; import PageLoader from "../PageLoader"; -import Modules from "./Modules"; +import moduleRoutes from "./ModuleRoutes"; +import { removeHashFromURL } from "../../utils/helper"; function AppLayout() { + const currentPath = removeHashFromURL(window.location.hash); + let element = useRoutes(moduleRoutes); + return ( + style={{ + padding: "0", + }} + > - + {element} - - + {currentPath !== "ini-setup" && } ); } diff --git a/assets/src/components/modules/ModuleList.jsx b/assets/src/components/modules/ModuleList.jsx new file mode 100644 index 00000000..ff3f5e95 --- /dev/null +++ b/assets/src/components/modules/ModuleList.jsx @@ -0,0 +1,24 @@ +import React from 'react' +import { nanoid } from 'nanoid'; +import { Row } from "antd"; +import ModuleCard from './ModuleCard'; + +const ModuleList = ({ modules, filterActiveModules = false, minValue = 0, maxValue = 6, searchModule = "" }) => { + return ( + <> + + {modules + .filter((module) => + module.name.toLowerCase().includes(searchModule.toLowerCase()) + ) + .filter((module) => (filterActiveModules ? module.status : true)) // Filter based on the filterActiveModules state + .slice(minValue, maxValue) + .map((module) => ( + + ))} + + + ); +}; + +export default ModuleList diff --git a/assets/src/components/modules/ModuleRoutes.js b/assets/src/components/modules/ModuleRoutes.js new file mode 100644 index 00000000..a4a40aa8 --- /dev/null +++ b/assets/src/components/modules/ModuleRoutes.js @@ -0,0 +1,17 @@ +import React from 'react'; +import Modules from './Modules'; +import IniSetupLayout from '../initail-setup/IniSetupLayout'; + +let moduleRoutes = [ + { + path : '/', + element : , + }, + { + path : '/ini-setup', + element : , + }, +]; + + +export default moduleRoutes; diff --git a/assets/src/components/modules/Modules.js b/assets/src/components/modules/Modules.js index 5f517686..27dc75d7 100644 --- a/assets/src/components/modules/Modules.js +++ b/assets/src/components/modules/Modules.js @@ -1,18 +1,12 @@ import { useDispatch, useSelect } from "@wordpress/data"; import { useEffect, useState, useMemo } from "@wordpress/element"; -import { Alert, Button, Col, Image, Pagination, Row, Modal } from "antd"; -import { nanoid } from "nanoid"; -import { ExclamationCircleFilled } from "@ant-design/icons"; - +import { Button, Col, Image, Pagination, Row } from "antd"; +import ModuleList from "./ModuleList"; import { Ajax } from "../../ajax"; -import ModuleCard from "./ModuleCard"; import ModuleSearch from "./ModuleSearch"; -import dashboardIcon from "../../../images/dashboard-icon.svg"; import helpIcon from "../../../images/help-icon.svg"; import logo from "../../../images/logo.svg"; -import downArrowIocn from "../../../images/menu/down-arrow-icon.svg"; -import upArrowIocn from "../../../images/menu/up-arrow-icon.svg"; import widgetIcon from "../../../images/widget-icon.svg"; import ModuleFilter from "./ModuleFilter"; import PremiumBox from "./PremiumBox"; @@ -161,23 +155,6 @@ function Modules() { } }, [activatedModules]); - // Module List - const ModuleList = ({ modules }) => { - return ( - <> - {modules - .filter((module) => - module.name.toLowerCase().includes(searchModule.toLowerCase()) - ) - .filter((module) => (filterActiveModules ? module.status : true)) // Filter based on the filterActiveModules state - .slice(minValue, maxValue) - .map((module) => ( - - ))} - - ); - }; - return (
@@ -298,11 +275,13 @@ function Modules() { handleModuleActivation={handleModuleActivation} /> )} - - - - - +
-