Plugin Directory

Changeset 3256791


Ignore:
Timestamp:
03/17/2025 12:00:50 AM (13 months ago)
Author:
equalserving
Message:

Change timing of server outage errors.

Location:
es-woocommerce-activecampaign/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • es-woocommerce-activecampaign/trunk/class-es-wc-integration-activecampaign.php

    r3211949 r3256791  
    1111 * @class       ES_WC_Integration_ActiveCampaign
    1212 * @extends     WC_Integration
    13  * @version     2.1.8
     13 * @version     2.1.9
    1414 * @package     WooCommerce ActiveCampaign
    1515 * @author      EqualServing
     
    9595
    9696        // Hooks
    97         add_action( 'admin_notices', array( &$this, 'checks' ) );
     97        add_action( 'admin_notices', array( &$this, 'add_settings_errors' ) );
    9898        add_action( 'woocommerce_update_options_integration_' .  $this->id, array( $this, 'process_admin_options') );
    9999
     
    125125    }
    126126
     127    function add_settings_errors() {
     128        if ( $error = get_transient( "es_wc_activecampaign_errors" ) ) { ?>
     129            <div class="notice notice-error is-dismissible">
     130                <p><strong>ActiveCampaign error</strong>: <?php echo $error; ?></p>
     131            </div><?php
     132
     133            delete_transient("es_wc_activecampaign_errors");
     134        }
     135    }
     136
     137
    127138    /**
    128139     * Check if the user has enabled the plugin functionality, but hasn't provided an api key.
     
    135146        global $pagenow;
    136147
    137         if ( $error = get_transient( "es_wc_activecampaign_errors" ) ) { ?>
    138             <div class="error notice">
    139                 <p><strong>ActiveCampaign error</strong>: <?php echo $error; ?></p>
    140             </div><?php
    141 
    142             delete_transient("es_wc_activecampaign_errors");
    143         }
    144 
     148        delete_transient( 'es_wc_activecampaign_list_' . md5( $this->activecampaign_key ) );
    145149        if ($pagenow == "admin.php" && isset($_REQUEST["page"]) && $_REQUEST["page"] == "wc-settings" && isset($_REQUEST["tab"]) && $_REQUEST["tab"] == "integration") {
    146150            if ( $this->enabled == 'yes' ) {
     
    148152                if(!$this->has_api_info()) {
    149153                    if (!$this->has_key() && !$this->has_url()) {
    150                         echo '<div class="error notice"><p>' . sprintf( __('<strong>ActiveCampaign error</strong>: Please enter your API URL and Key <a href="%s">here</a>', 'es_wc_activecampaign'), admin_url('options-general.php?page=activecampaign' ) ) . '</p></div>';
     154                        echo '<div class="notice notice-error is-dismissible"><p>' . sprintf( __('<strong>ActiveCampaign error</strong>: Please enter your API URL and Key <a href="%s">here</a>', 'es_wc_activecampaign'), admin_url('admin.php?page=wc-settings&tab=integration&section=activecampaign' ) ) . '</p></div>';
    151155                    } elseif (!$this->has_key() ) {
    152                         echo '<div class="error notice"><p>' . sprintf( __('<strong>ActiveCampaign error</strong>: Please enter your API Key <a href="%s">here</a>', 'es_wc_activecampaign'), admin_url('options-general.php?page=activecampaign' ) ) . '</p></div>';
     156                        echo '<div class="notice notice-error is-dismissible"><p>' . sprintf( __('<strong>ActiveCampaign error</strong>: Please enter your API Key <a href="%s">here</a>', 'es_wc_activecampaign'), admin_url('admin.php?page=wc-settings&tab=integration&section=activecampaign' ) ) . '</p></div>';
    153157                    } elseif (!$this->has_url()) {
    154                         echo '<div class="error notice"><p>' . sprintf( __('<strong>ActiveCampaign error</strong>: Please enter your API Key <a href="%s">here</a>', 'es_wc_activecampaign'), admin_url('options-general.php?page=activecampaign' ) ) . '</p></div>';
     158                        echo '<div class="notice notice-error is-dismissible"><p>' . sprintf( __('<strong>ActiveCampaign error</strong>: Please enter your API Key <a href="%s">here</a>', 'es_wc_activecampaign'), admin_url('admin.php?page=wc-settings&tab=integration&section=activecampaign' ) ) . '</p></div>';
    155159                    }
    156160                    return;
     
    179183                        $error_msg = sprintf( __( 'ActiveCampaign credentials check failed: %s', 'es_wc_activecampaign' ), $error_msg_object->get_error_message() ) ;
    180184                        $this->log_this("error", $error_msg);
    181                         $this->error_msg = $msg;
     185                        $this->error_msg = $error_msg;
    182186                        set_transient("es_wc_activecampaign_errors", $error_msg, 45);
    183187
     
    446450    public function init_form_fields() {
    447451        if ( is_admin() ) {
     452            delete_transient("es_wc_activecampaign_errors");
    448453            if ($this->has_api_info()) {
    449454                array_merge( array( '' => __('Select a list...', 'es_wc_activecampaign' ) ), $this->activecampaign_lists );
     
    972977
    973978    function admin_options() {
    974         echo '<table><tboby><tr><td>';
     979        echo '<table><tbody><tr><td>';
    975980        echo '<div class="column-2">';
    976981        echo '<h3>';
    977982        _e( 'ActiveCampaign', 'es_wc_activecampaign' );
    978983        echo '</h3>';
     984        $this->checks();
     985
    979986        if ($this->dependencies_found) {
    980987            echo '<p>';
  • es-woocommerce-activecampaign/trunk/es-woocommerce-activecampaign.php

    r3211949 r3256791  
    44Plugin URI: https://www.equalserving.com/wordpress-plugins-equalserving/woocommerce-with-activecampaign/
    55Description: Integrates Woocommerce with ActiveCampaign by adding customers to ActiveCampaign at time of purchase.
    6 Version: 2.1.8
     6Version: 2.1.9
    77Author: EqualServing.com
    88Author URI: http://www.equalserving.com/
    9 Tested up to: 6.7.1
     9Tested up to: 6.7.2
    1010WC requires at least: 3.6
    11 WC tested up to: 9.5.1
     11WC tested up to: 9.7.1
    1212*/
    1313
  • es-woocommerce-activecampaign/trunk/readme.txt

    r3211949 r3256791  
    77Requires at least: 4.4
    88Requires PHP: 5.3
    9 Tested up to: 6.7.1
    10 Stable tag: 2.1.8
     9Tested up to: 6.7.2
     10Stable tag: 2.1.9
    1111WC requires at least: 3.6
    12 WC tested up to: 9.5.1
     12WC tested up to: 9.7.1
    1313
    1414Easily add ActiveCampaign integration to WooCommerce.
     
    7070
    7171== Changelog ==
     72
     73= 2.1.9 =
     74
     75Release Date: Mar 16, 2025
     76
     77* Change timing of server outage errors.
    7278
    7379= 2.1.8 =
Note: See TracChangeset for help on using the changeset viewer.