Skip to content

Commit

Permalink
Removed Code Snippets module
Browse files Browse the repository at this point in the history
  • Loading branch information
thenahidul committed Nov 15, 2024
1 parent 712d701 commit 7d4931f
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 286 deletions.
10 changes: 0 additions & 10 deletions admin/classes/class-merchant-admin-modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,6 @@ public function __construct() {
'tutorial_url' => 'https://docs.athemes.com/article/merchant-recently-viewed-products/',
),

// Boost Revenue.

// Reduce Cart Abandonment.
'buy-now' => array(
'pro' => false,
Expand Down Expand Up @@ -320,14 +318,6 @@ public function __construct() {
'desc' => esc_html__( 'Help visitors instantly find the products they\'re looking for by using predictive search', 'merchant' ),
'tutorial_url' => 'https://docs.athemes.com/article/real-time-search/',
),
'code-snippets' => array(
'pro' => false,
'section' => 'improve-experience',
'icon' => Merchant_SVG_Icons::get_svg_icon( 'module-code-snippets' ),
'title' => esc_html__( 'Code Snippets', 'merchant' ),
'desc' => esc_html__( 'Add code snippets in WordPress without having to edit your theme\'s functions.php file ', 'merchant' ),
'tutorial_url' => 'https://docs.athemes.com/article/code-snippets/',
),
'scroll-to-top-button' => array(
'pro' => false,
'section' => 'improve-experience',
Expand Down
18 changes: 18 additions & 0 deletions admin/classes/class-merchant-admin-options.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ public function __construct() {
add_action( 'wp_ajax_merchant_admin_products_search', array( $this, 'products_search' ) );

add_action( 'clean_user_cache', array( $this, 'clear_customer_choices_cache' ), 10, 2 );

// Delete module data
add_action( 'admin_init', array( $this, 'delete_module_data' ) );
}

/**
Expand Down Expand Up @@ -2674,6 +2677,21 @@ public function clear_customer_choices_cache( $user_id, $user ) {
delete_transient( 'customers_select2_choices' );
}
}

/**
* Delete module data.
*
* @return void
*/
public function delete_module_data() {
$options = get_option( 'merchant', array() );

// Code Snippets module was removed, so delete data from DB as well.
if ( isset( $options['code-snippets'] ) ) {
unset( $options['code-snippets'] );
update_option( 'merchant', $options );
}
}
}

Merchant_Admin_Options::instance();
Expand Down
8 changes: 0 additions & 8 deletions assets/sass/admin/admin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1583,14 +1583,6 @@ body.merchant-module-disabled {
}
}

.merchant-code-snippets-textarea,
.merchant-code-snippets-textarea_code {

textarea {
min-height: 200px;
}
}

.merchant-module-page-setting-field-radio,
.merchant-module-page-setting-field-radio_alt,
.merchant-module-page-setting-field-checkbox,
Expand Down
22 changes: 0 additions & 22 deletions assets/sass/modules/code-snippets/admin/preview.scss

This file was deleted.

5 changes: 0 additions & 5 deletions inc/classes/class-merchant-custom-css.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,6 @@ public function output_css() {
$css .= $this->get_variable_css( 'real-time-search', 'results_box_width', 500, '.merchant-ajax-search-wrapper', '--merchant-results-box-width', 'px' );
}

// Code Snippets
if ( Merchant_Modules::is_module_active( 'code-snippets' ) ) {
$css .= Merchant_Option::get( 'code-snippets', 'custom_css', '' );
}

// Global Settings.
if ( ! is_admin() ) {
$css .= Merchant_Option::get( 'global-settings', 'custom_css', '' );
Expand Down
5 changes: 0 additions & 5 deletions inc/classes/class-merchant-svg-icons.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,6 @@ public static function get_svg_icon( $icon ) {
<path d="M9.00001 5.00001C8.44772 5.00001 8.00001 5.44773 8.00001 6.00002C8.00001 6.5523 8.44773 7.00001 9.00002 7.00001L11.5858 7L8.29289 10.2929C7.90237 10.6834 7.90237 11.3166 8.29289 11.7071C8.68342 12.0976 9.31658 12.0976 9.70711 11.7071L13 8.4142L13 11C13 11.5523 13.4477 12 14 12C14.5523 12 15 11.5523 15 11L15 5.99999C15 5.97501 14.9991 5.95013 14.9972 5.92539C14.9794 5.68746 14.877 5.46276 14.7071 5.29288C14.6967 5.28241 14.686 5.2722 14.6751 5.26225C14.5011 5.10281 14.2844 5.01607 14.0639 5.00203C14.0427 5.00068 14.0214 4.99999 14 4.99999L9.00001 5.00001Z" fill="#4A4A4A"/>
<path d="M1 14.5C1 13.6716 1.67157 13 2.5 13H5.5C6.32843 13 7 13.6716 7 14.5V17.5C7 18.3284 6.32843 19 5.5 19H2.5C1.67157 19 1 18.3284 1 17.5V14.5Z" fill="#4A4A4A"/>
<path d="M2.5 1C1.67157 1 1 1.67157 1 2.5V11H3V3H17V17H9V19H17.5C18.3284 19 19 18.3284 19 17.5V2.5C19 1.67157 18.3284 1 17.5 1H2.5Z" fill="#4A4A4A"/>
</svg>',
'module-code-snippets' => '<svg width="20" height="16" viewBox="0 0 20 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12.6375 1.2431C12.7854 0.725345 12.4856 0.185696 11.9679 0.0377652C11.4501 -0.110166 10.9105 0.189639 10.7625 0.707398L6.86253 14.3574C6.7146 14.8752 7.0144 15.4148 7.53216 15.5627C8.04992 15.7107 8.58957 15.4109 8.7375 14.8931L12.6375 1.2431Z" fill="#4A4A4A"/>
<path d="M5.88943 2.88589C6.27019 3.26665 6.27019 3.88399 5.88943 4.26475L2.35386 7.80032L5.88943 11.3359C6.27019 11.7167 6.27019 12.334 5.88943 12.7147C5.50867 13.0955 4.89133 13.0955 4.51057 12.7147L0.285571 8.48975C-0.0951902 8.10898 -0.0951902 7.49165 0.285571 7.11089L4.51057 2.88589C4.89133 2.50513 5.50867 2.50513 5.88943 2.88589Z" fill="#4A4A4A"/>
<path d="M13.6106 12.7147C13.2298 12.334 13.2298 11.7167 13.6106 11.3359L17.1461 7.80032L13.6106 4.26475C13.2298 3.88399 13.2298 3.26665 13.6106 2.88589C13.9913 2.50513 14.6087 2.50513 14.9894 2.88589L19.2144 7.11089C19.5952 7.49165 19.5952 8.10899 19.2144 8.48975L14.9894 12.7147C14.6087 13.0955 13.9913 13.0955 13.6106 12.7147Z" fill="#4A4A4A"/>
</svg>',
'module-real-time-search' => '<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8.12068 2.99222e-07H11.0114C12.2077 -1.09969e-05 13.1725 -1.98521e-05 13.9539 0.0638181C14.7583 0.129547 15.465 0.268416 16.1187 0.601521C17.1572 1.13063 18.0014 1.97491 18.5306 3.01335C18.8637 3.66711 19.0025 4.37373 19.0683 5.17822C19.1321 5.95955 19.1321 6.92441 19.1321 8.12065V8.46226C19.1321 9.07186 18.6379 9.56604 18.0283 9.56604C17.4187 9.56604 16.9245 9.07186 16.9245 8.46226V8.16792C16.9245 6.91337 16.9237 6.03884 16.868 5.35798C16.8135 4.69001 16.7117 4.30624 16.5636 4.01556C16.2461 3.39249 15.7396 2.88593 15.1165 2.56846C14.8258 2.42035 14.4421 2.31861 13.7741 2.26403C13.0932 2.20841 12.2187 2.20755 10.9642 2.20755H8.16792C6.91337 2.20755 6.03884 2.20841 5.35798 2.26403C4.69001 2.31861 4.30625 2.42035 4.01556 2.56846C3.3925 2.88593 2.88593 3.39249 2.56846 4.01556C2.42035 4.30624 2.31861 4.69001 2.26403 5.35798C2.20841 6.03883 2.20755 6.91337 2.20755 8.16792V10.9642C2.20755 12.2187 2.20841 13.0932 2.26403 13.7741C2.31861 14.4421 2.42035 14.8258 2.56846 15.1165C2.88593 15.7396 3.3925 16.2461 4.01556 16.5636C4.30625 16.7117 4.69001 16.8135 5.35798 16.868C6.03884 16.9237 6.91337 16.9245 8.16792 16.9245H8.46226C9.07186 16.9245 9.56604 17.4187 9.56604 18.0283C9.56604 18.6379 9.07186 19.1321 8.46226 19.1321H8.12065C6.92441 19.1321 5.95955 19.1321 5.17822 19.0683C4.37373 19.0025 3.66711 18.8637 3.01335 18.5306C1.97491 18.0014 1.13063 17.1572 0.601521 16.1187C0.268416 15.465 0.129547 14.7583 0.0638184 13.9539C-1.95177e-05 13.1725 -1.06597e-05 12.2077 2.85548e-07 11.0114V8.12068C-1.06597e-05 6.92442 -1.95177e-05 5.95956 0.0638184 5.17822C0.129547 4.37373 0.268416 3.66711 0.601521 3.01335C1.13063 1.97491 1.97491 1.13063 3.01335 0.601521C3.66711 0.268416 4.37373 0.129547 5.17822 0.0638181C5.95956 -1.98521e-05 6.92442 -1.09969e-05 8.12068 2.99222e-07Z" fill="#4A4A4A"/>
Expand Down
Binary file not shown.
43 changes: 0 additions & 43 deletions inc/modules/code-snippets/admin/options.php

This file was deleted.

185 changes: 0 additions & 185 deletions inc/modules/code-snippets/class-code-snippets.php

This file was deleted.

2 changes: 1 addition & 1 deletion inc/modules/pre-orders/admin/options.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@
'id' => 'button_text',
'type' => 'text',
'title' => esc_html__( 'Button text', 'merchant' ),
'default' => esc_html__( 'Pre-Order Now!', 'merchant' ),
'default' => esc_html__( 'Pre-Order', 'merchant' ),
),

array(
Expand Down
7 changes: 0 additions & 7 deletions wpgulp.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,13 +276,6 @@ const styles = [
destination: './assets/css/modules/real-time-search/admin',
},

// Code Snippets.
{
name: 'codeSnippetsAdmin',
src: './assets/sass/modules/code-snippets/admin/preview.scss',
destination: './assets/css/modules/code-snippets/admin',
},

// Cookie Banner.
{
name: 'cookieBanner',
Expand Down

0 comments on commit 7d4931f

Please sign in to comment.