Plugin Directory

Changeset 3462306


Ignore:
Timestamp:
02/16/2026 08:49:09 AM (7 weeks ago)
Author:
minicrmio
Message:

"Handling new Woocommerce plugin install conflict"

Location:
minicrm-woocommerce-sync/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • minicrm-woocommerce-sync/trunk/languages/minicrm-sync-for-woocommerce.pot

    r3448489 r3462306  
    44"Project-Id-Version: MiniCRM "
    55"WooCommerce Sync plugin "
    6 "v1.7.11\n"
     6"v1.7.12\n"
    77"POT-Creation-Date: 2022-05-30 "
    88"22:22+0200\n"
  • minicrm-woocommerce-sync/trunk/lib/Plugin.php

    r3448479 r3462306  
    3232    public static function activate ()
    3333    {
     34        // Check shared option for plugin conflict
     35        if (get_option ('minicrm_plugin_activated', false) == 'bridge') {
     36            wp_die(
     37                '<h1>' . esc_html__( 'Plugin Activation Error', 'minicrm-sync-for-woocommerce' ) . '</h1>' .
     38                '<p>' . esc_html__( 'Cannot activate this plugin because the new MiniCRM Connect plugin was previously used on this site.', 'minicrm-sync-for-woocommerce' ) . '</p>' .
     39                '<p>' . esc_html__( 'If you need assistance, please contact support.', 'minicrm-sync-for-woocommerce' ) . '</p>',
     40                esc_html__( 'Plugin Activation Error', 'minicrm-sync-for-woocommerce' ),
     41                [ 'back_link' => true ]
     42            );
     43        }
     44
     45        // Set shared flag to 'old' (no autoload for performance)
     46        update_option ('minicrm_plugin_activated', 'old', false);
     47
    3448        // Check if using a higher major WP version than supported
    3549        $wpVer = get_bloginfo ('version');
     
    4458        $testedUpToMajor = (int) ($matches [1] ?? '0');
    4559        if ($wpMajorVer > $testedUpToMajor) {
    46             exit (esc_html(sprintf (
    47                 /* translators: %s: WordPress major version number */
    48                 __(
    49                     'The plugin is not yet tested on Wordpress version %s.',
    50                     'minicrm-sync-for-woocommerce'
    51                 ),
    52                 $wpMajorVer
    53             )));
     60            wp_die (
     61                esc_html(sprintf (
     62                    /* translators: %s: WordPress major version number */
     63                    __(
     64                        'The plugin is not yet tested on Wordpress version %s.',
     65                        'minicrm-sync-for-woocommerce'
     66                    ),
     67                    $wpMajorVer
     68                )),
     69                esc_html__('Plugin Activation Error', 'minicrm-sync-for-woocommerce'),
     70                ['back_link' => true]
     71            );
    5472        }
    5573
    5674        // Check if PHP XML extension is loaded
    5775        if (!extension_loaded ('xml')) {
    58             exit (esc_html(sprintf (
    59                 /* translators: %s: PHP extension name */
    60                 __(
    61                     'PHP extension "%s" is required, but not loaded on your installation.',
    62                     'minicrm-sync-for-woocommerce'
    63                 ),
    64                 'xml'
    65             )));
     76            wp_die (
     77                esc_html(sprintf (
     78                    /* translators: %s: PHP extension name */
     79                    __(
     80                        'PHP extension "%s" is required, but not loaded on your installation.',
     81                        'minicrm-sync-for-woocommerce'
     82                    ),
     83                    'xml'
     84                )),
     85                esc_html__('Plugin Activation Error', 'minicrm-sync-for-woocommerce'),
     86                ['back_link' => true]
     87            );
    6688        }
    6789    }
     
    220242    public static function init ()
    221243    {
     244        // One-time migration: set flag if plugin is already configured
     245        if (get_option ('minicrm_plugin_activated') === false) {
     246            $integration = new Integration ();
     247
     248            if ($integration->get_option ('system_id')) {
     249                update_option ('minicrm_plugin_activated', 'old', false);
     250            }
     251        }
     252
    222253        /**
    223254         * Queue projects for syncing upon creating/updating/trashing/untrashing
  • minicrm-woocommerce-sync/trunk/minicrm-sync-for-woocommerce.php

    r3448489 r3462306  
    1212 * Requires Plugins: woocommerce
    1313 * Text Domain: minicrm-sync-for-woocommerce
    14  * Version: 1.7.11
     14 * Version: 1.7.12
    1515 * WC requires at least: 9.0
    1616 * WC tested up to: 10.2
  • minicrm-woocommerce-sync/trunk/readme.txt

    r3448489 r3462306  
    55Requires at least: 6.0
    66Requires PHP: 8.1
    7 Stable tag: 1.7.11
     7Stable tag: 1.7.12
    88Tested up to: 6.9
    99WC requires at least: 9.0
Note: See TracChangeset for help on using the changeset viewer.