Changeset 3476070
- Timestamp:
- 03/06/2026 05:26:28 AM (3 weeks ago)
- Location:
- advanced-emt-payment-gateway/trunk
- Files:
-
- 2 edited
-
advanced-emt-payment-gateway.php (modified) (5 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
advanced-emt-payment-gateway/trunk/advanced-emt-payment-gateway.php
r3476008 r3476070 5 5 * Plugin URI: https://wordpress.org/plugins/advanced-emt-payment-gateway/ 6 6 * Description: Accept Interac e-Transfer / Email Money Transfer (EMT) in WooCommerce with dynamic secret answers, order notes, and customizable instructions. Supports Block and Classic checkout. 7 * Version: 2. 0.57 * Version: 2.1.0 8 8 * Author: CaphLabs 9 9 * Author URI: https://profiles.wordpress.org/ipodguy79/ … … 22 22 if ( !defined( 'ABSPATH' ) ) { 23 23 exit; 24 } 25 26 if ( ! function_exists( 'advanced_emt_free_resolve_pro_conflict_early' ) ) { 27 /** 28 * During activation, the other version may already be loaded in-memory. 29 * Deactivate it first and short-circuit this request to avoid function redeclare fatals. 30 * 31 * @return bool True when the pro plugin was active at request start. 32 */ 33 function advanced_emt_free_resolve_pro_conflict_early() { 34 $pro_plugin_rel_path = 'advanced-emt-payment-gateway-pro/advanced-emt-payment-gateway-pro.php'; 35 36 if ( ! function_exists( 'is_plugin_active' ) || ! function_exists( 'deactivate_plugins' ) || ! function_exists( 'is_plugin_active_for_network' ) ) { 37 require_once ABSPATH . 'wp-admin/includes/plugin.php'; 38 } 39 40 $was_active = function_exists( 'is_plugin_active' ) && is_plugin_active( $pro_plugin_rel_path ); 41 $was_network_active = is_multisite() && function_exists( 'is_plugin_active_for_network' ) && is_plugin_active_for_network( $pro_plugin_rel_path ); 42 // Activation sandbox can load active plugins before option state is updated. 43 $pro_loaded_in_memory = function_exists( 'advanced_emt_get_blocks_data_payload' ); 44 45 if ( ( $was_active || $was_network_active || $pro_loaded_in_memory ) && function_exists( 'deactivate_plugins' ) ) { 46 deactivate_plugins( $pro_plugin_rel_path, true, $was_network_active ); 47 } 48 49 return ( $was_active || $was_network_active || $pro_loaded_in_memory ); 50 } 51 } 52 53 if ( advanced_emt_free_resolve_pro_conflict_early() ) { 54 // The pro plugin was already loaded in this request, so avoid duplicate symbol declarations. 55 return; 24 56 } 25 57 … … 76 108 // After opt-in/connect (or skip), go back to Plugins like other Freemius plugins do. 77 109 if ( function_exists( 'aemt_fs' ) ) { 110 // Freemius standard behavior: deactivate the other version on activation. 111 aemt_fs()->add_filter( 'deactivate_on_activation', '__return_true' ); 112 78 113 aemt_fs()->add_filter( 'after_connect_url', function ( $url ) { 79 114 return ( is_network_admin() ? network_admin_url( 'plugins.php' ) : admin_url( 'plugins.php' ) ); … … 248 283 249 284 // ✅ EMT Default Instructions 250 function advanced_emt_get_default_instructions() { 251 return "Send an EMT to your@email.com 285 if ( ! function_exists( 'advanced_emt_get_default_instructions' ) ) { 286 function advanced_emt_get_default_instructions() { 287 return "Send an EMT to your@email.com 252 288 253 289 Secret Question: Your Order Number [order] … … 255 291 256 292 Thank you!"; 293 } 257 294 } 258 295 -
advanced-emt-payment-gateway/trunk/readme.txt
r3476008 r3476070 7 7 WC requires at least: 6.0 8 8 WC tested up to: 8.6 9 Stable tag: 2. 0.59 Stable tag: 2.1.0 10 10 License: GPL2 or later 11 11 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 247 247 248 248 == Changelog == 249 250 = 2.1.0 = 251 - Added activation-safe Free/Pro conflict handling so activating one version disables the other without fatal collisions. 252 - Added early bootstrap guards to prevent same-request redeclare failures during WordPress plugin activation sandbox. 253 - Guarded shared helper declaration (`advanced_emt_get_default_instructions`) to avoid duplicate declaration fatals. 254 - Fixed Checkout Block editor integration by using valid React element registration (`content` and `edit`) in EMT Blocks. 255 - Hardened Blocks payment-method data retrieval to safely handle early editor loads when gateways are not initialized. 249 256 250 257 = 2.0.5 =
Note: See TracChangeset
for help on using the changeset viewer.