Plugin Directory

Changeset 3286862


Ignore:
Timestamp:
05/03/2025 04:10:13 PM (11 months ago)
Author:
ashleysmith1
Message:

Quick fix: UPGRADE bug resolved in version 3.3.16

Location:
abmsense/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • abmsense/trunk/abmsense.php

    r3286855 r3286862  
    33Plugin Name: ABMsense - Visitor Identification for B2B Pipeline Growth
    44Description: Turn Site Visitors into Hot Leads– It's Marketing Magic! ABMsense is a powerful tool that helps you to identify and track your website visitors. It provides you with the information you need to turn your website visitors into hot leads. With ABMsense, you can track your website visitors, identify their company, and get detailed information about their visit. Go to Settings -> ABMsense to configure the plugin.
    5 Version: 3.3.15
     5Version: 3.3.16
    66Author: Ashley Smith
    77Requires PHP: 7.2
     
    2626define('ABMSENSE_PREFIX', 'abmsense_');
    2727if (!defined('ABMSENSE_VERSION')) {
    28     define('ABMSENSE_VERSION', '3.3.15');
     28    define('ABMSENSE_VERSION', '3.3.16');
    2929}
    3030
  • abmsense/trunk/activation_deactivation.php

    r3286855 r3286862  
    6969// Function to handle plugin upgrades
    7070function abmsense_upgrade_completed() {
    71     $upgrade_completed = get_transient(ABMSENSE_PREFIX . 'upgrade_completed');
     71    // Check if we're in the middle of an upgrade
     72    if (get_transient(ABMSENSE_PREFIX . 'upgrade_in_progress')) {
     73        return;
     74    }
    7275   
    73     if (!$upgrade_completed && abmsense_version_check()) {
    74         // Set a transient to prevent multiple upgrade runs
    75         set_transient(ABMSENSE_PREFIX . 'upgrade_completed', true, 30);
     76    // Check if upgrade is needed
     77    if (abmsense_version_check()) {
     78        // Set a longer-lived transient to prevent multiple upgrade attempts
     79        set_transient(ABMSENSE_PREFIX . 'upgrade_completed', true, DAY_IN_SECONDS);
    7680       
    77         // Update plugin data
    78         abmsense_update_plugin_data();
     81        // Set a short-lived transient to prevent concurrent upgrades
     82        set_transient(ABMSENSE_PREFIX . 'upgrade_in_progress', true, 60);
    7983       
    80         // Run any additional upgrade tasks
    81         abmsense_run_version_updates();
     84        try {
     85            // Update plugin data
     86            abmsense_update_plugin_data();
     87           
     88            // Run any additional upgrade tasks
     89            abmsense_run_version_updates();
     90        } finally {
     91            // Always clear the in-progress flag
     92            delete_transient(ABMSENSE_PREFIX . 'upgrade_in_progress');
     93        }
    8294    }
    8395}
     
    8597// Function to update plugin data
    8698function abmsense_update_plugin_data() {
     99    // Check if we're in the middle of an upgrade
     100    if (get_transient(ABMSENSE_PREFIX . 'upgrade_in_progress')) {
     101        return;
     102    }
     103   
    87104    $current_user = wp_get_current_user();
    88105    $server_name = isset($_SERVER['SERVER_NAME']) ? sanitize_text_field(wp_unslash($_SERVER['SERVER_NAME'])) : '';
     
    91108    // Get existing values or set defaults
    92109    $report_email = get_option(ABMSENSE_PREFIX . 'report_email') ?: $admin_email;
    93     $report_frequency = get_option(ABMSENSE_PREFIX . 'report_frequency', 'weekly'); // Add 'weekly' as default
     110    $report_frequency = get_option(ABMSENSE_PREFIX . 'report_frequency', 'weekly');
    94111    $is_consent = get_option(ABMSENSE_PREFIX . 'is_consent') ?: 0;
    95112    $date_registered = get_option(ABMSENSE_PREFIX . 'date_registered') ?: gmdate('Y-m-d');
  • abmsense/trunk/readme.txt

    r3286855 r3286862  
    77Tested up to: 6.8
    88Requires PHP: 7.2
    9 Stable tag: 3.3.15
     9Stable tag: 3.3.16
    1010License: GPLv2 or later
    1111License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    125125* Adding Export CSV inside the Identified Companies table
    126126
    127 = 3.3.15 =
     127= 3.3.16 =
    128128* Added: User Management table
    129129* Added: Hot Lead Alerts
Note: See TracChangeset for help on using the changeset viewer.