Skip to content

Commit

Permalink
Version 1.4.8
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbourne committed Jan 2, 2025
1 parent 223c927 commit 674832b
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 9 deletions.
5 changes: 4 additions & 1 deletion README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Donate link: https://www.paypal.me/yycpro
Tags: commerce7
Requires at least: 6.0
Tested up to: 6.7.1
Stable tag: 1.4.7
Stable tag: 1.4.8
License: GPLv3 or later
License URI: https://www.gnu.org/licenses/gpl-3.0.en.html

Expand Down Expand Up @@ -72,6 +72,9 @@ Removing this plugin will render your widgets inactive, but will not remove them

== Changelog ==

= 1.4.8 - January 2, 2025 =
* Fix: Disable C7 JS in Oxygen's frontend builder to prevent conflicts.

= 1.4.7 - December 13, 2024 =
* Fix: Proper widgets loading when using compatibility mode.

Expand Down
10 changes: 5 additions & 5 deletions commerce7-for-wordpress.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
* @wordpress-plugin
* Plugin Name: Commerce7 for WordPress
* Description: Integrate Commerce7 functionality into your WordPress site easily
* Version: 1.4.7
* Version: 1.4.8
* Author: 5forests
* Author URI: https://5forests.com
* Plugin URI: https://c7wp.com
* Requires at least: 6.0
* Tested up to: 6.7.1
* Stable tag: 1.4.7
* Stable tag: 1.4.8
* Requires PHP: 7.4
* License: GPL3
* License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
Expand All @@ -27,10 +27,10 @@
* Created Date: Friday September 27th 2019
* Author: Michael Bourne
* -----
* Last Modified: Sunday, December 8th 2024, 1:33:04 pm
* Last Modified: Thursday, January 2nd 2025, 2:54:10 pm
* Modified By: Michael Bourne
* -----
* Copyright (c) 2019-2024 URSA6
* Copyright (c) 2019-2025 URSA6
*
* Commerce7 for WordPress is a plugin for WordPress that enables you to add Commerce7 ecommerce integration into your site.
* Plugin developed with permission of the Commerce7 company. Commerce7 logo and name used with permission.
Expand All @@ -47,7 +47,7 @@

defined( 'C7WP_ROOT' ) || define( 'C7WP_ROOT', dirname( __FILE__ ) );
defined( 'C7WP_URI' ) || define( 'C7WP_URI', plugin_dir_url( __FILE__ ) );
defined( 'C7WP_VERSION' ) || define( 'C7WP_VERSION', '1.4.7' );
defined( 'C7WP_VERSION' ) || define( 'C7WP_VERSION', '1.4.8' );


/**
Expand Down
22 changes: 21 additions & 1 deletion includes/class-c7wp.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ private function __construct() {
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
add_action( 'elementor/editor/before_enqueue_scripts', array( $this, 'elementor_editor_enqueue_scripts' ) );
add_action( 'after_setup_theme', array( $this, 'load_c7_css' ), 9 );
add_filter( 'body_class', array( $this, 'add_body_class' ) );

// for front end
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ), 10 );
Expand Down Expand Up @@ -676,7 +677,17 @@ public function enqueue_scripts() {
wp_register_script( 'c7js', 'https://cdn.commerce7.com/v2/commerce7.js', array(), null, true ); // phpcs:ignore
break;
}
wp_enqueue_script( 'c7js' );
/**
* Enqueues the 'c7js' script if the following conditions are met:
* - The current request is not an admin request.
* - The 'ct_builder' query parameter is not present in the URL.
*
* This ensures that the C7 script is only enqueued on the front-end and not when
* using certain page builders like Oxygen.
*/
if ( ! is_admin() && empty( $_GET['ct_builder'] ) ) {
wp_enqueue_script( 'c7js' );
}

/**
* Filter: `c7wp_enqueue_c7_css`
Expand Down Expand Up @@ -1040,4 +1051,13 @@ public function add_display_post_states( $post_states, $post ) {

return $post_states;
}


/**
* Add body class for styles specificity and scope
*/
public function add_body_class( $classes ) {
$classes[] = 'c7wp';
return $classes;
}
}
4 changes: 2 additions & 2 deletions includes/gutenberg/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Created Date: Wednesday September 2nd 2020
* Author: Michael Bourne
* -----
* Last Modified: Sunday, December 8th 2024, 1:29:52 pm
* Last Modified: Tuesday, December 17th 2024, 3:46:08 pm
* Modified By: Michael Bourne
* -----
* Copyright (c) 2020 URSA6
Expand Down Expand Up @@ -60,7 +60,7 @@
wp_register_script(
$block_slug,
plugins_url( $dir . '/' . $element . '/' . $block_slug . '.js', __FILE__ ),
[ 'wp-blocks', 'wp-element', 'wp-editor', 'wp-block-editor' ],
[ 'wp-blocks', 'wp-element' ],
C7WP_VERSION,
1
);
Expand Down

0 comments on commit 674832b

Please sign in to comment.