Plugin Directory

Changeset 3347478


Ignore:
Timestamp:
08/20/2025 10:53:12 AM (8 months ago)
Author:
wanotifier
Message:

v2.7.10

Location:
notifier
Files:
236 added
5 edited

Legend:

Unmodified
Added
Removed
  • notifier/trunk/README.txt

    r3320064 r3347478  
    55Requires at least: 5.0
    66Tested up to: 6.8
    7 Stable tag: 2.7.9
     7Stable tag: 2.7.10
    88Requires PHP: 7.4
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
    1111
    12 Integrate WhatsApp API with WordPress to send WhatsApp notifications from Woocommerce, Contact Form 7, Gravity Forms, WPForms & more.
     12WhatsApp API integration to send WhatsApp notifications from Woocommerce, Contact Form 7, Gravity Forms, WPForms & more.
    1313
    1414== Description ==
    15 **Integrate WhatsApp with WordPress** to send WhatsApp notifications for...
     15**WhatsApp API integration plugin for WordPress** to send WhatsApp notifications for...
    1616
    1717* orders status updates from Woocommerce
     
    159159
    160160== Changelog ==
     161= 2.7.10 - 2025-07-04 =
     162fix: duplicate cart abandonment notifications
     163add: added session_key field to cart (new) abandonment trigger
     164add: improved API key validation to prevent errors when using invalid keys
     165
    161166= 2.7.9 - 2025-06-30 =
    162167fix: resolved issue with incorrectly prefixed country codes in WooCommerce
  • notifier/trunk/includes/class-notifier.php

    r3320064 r3347478  
    2424     */
    2525    private function define_constants() {
    26         $this->define( 'NOTIFIER_VERSION', '2.7.9' );
     26        $this->define( 'NOTIFIER_VERSION', '2.7.10' );
    2727        $this->define( 'NOTIFIER_NAME', 'notifier' );
    2828        $this->define( 'NOTIFIER_PREFIX', 'notifier_' );
  • notifier/trunk/includes/classes/class-notifier-dashboard.php

    r3231402 r3347478  
    7272        $response = Notifier::send_api_request( 'verify_api', $params, 'POST' );
    7373
    74         if($response->error){
    75             $notices[] = array(
    76                 'message' => $response->message,
    77                 'type' => 'error'
    78             );
    79             new Notifier_Admin_Notices($notices, true);
    80             wp_redirect(admin_url('admin.php?page=notifier'));
    81             die;
     74        if(isset($response->error) && $response->error == false){
     75            update_option('notifier_api_activated', 'yes');
     76            $message_text = isset($response->data) ? $response->data : 'API key validated and saved successfully';
     77            $message_type = 'success';
     78        }
     79        else {
     80            $message_text = isset($response->message) ? $response->message : 'There was an error validating your API key.';
     81            $message_type = 'error';
    8282        }
    8383
    84         update_option('notifier_api_activated', 'yes');
    85 
    8684        $notices[] = array(
    87             'message' => $response->data,
    88             'type' => 'success'
     85            'message' => $message_text,
     86            'type' => $message_type
    8987        );
    9088        new Notifier_Admin_Notices($notices, true);
  • notifier/trunk/includes/classes/integrations/class-notifier-woocommerce.php

    r3320064 r3347478  
    497497                    }
    498498                    return wc_get_cart_url();
     499                }
     500            ),
     501            array(
     502                'id'            => 'wca_cart_session_key',
     503                'label'         => 'Abandoned cart recovery key',
     504                'preview_value' => '',
     505                'return_type'   => 'text',
     506                'value'         => function ($cart_details) {
     507                    if ($cart_details && isset($cart_details['session_key'])) {
     508                        $session_key = sanitize_key($cart_details['session_key']);
     509                        return $session_key;
     510                    }
     511                    return '';
    499512                }
    500513            ),
     
    10241037        }
    10251038
    1026         // Determine created_time
    1027         $created_time = $existing_entry ? $existing_entry->created_time : current_time('mysql');
     1039        // Fetch all active session_keys for this phone number
     1040        $existing_session_keys = $wpdb->get_col(
     1041            $wpdb->prepare(
     1042                "SELECT session_key FROM $table_name WHERE phone_number = %s AND triggered = 0 AND order_id = 0",
     1043                $phone_number
     1044            )
     1045        );
     1046
     1047        // Delete all other sessions except the current one
     1048        if (!empty($existing_session_keys)) {
     1049            foreach ($existing_session_keys as $old_session_key) {
     1050                if ($session_key !== $old_session_key) {
     1051                    $wpdb->query(
     1052                        $wpdb->prepare(
     1053                            "DELETE FROM $table_name WHERE session_key = %s",
     1054                            $old_session_key
     1055                        )
     1056                    );
     1057                }
     1058            }
     1059        }
    10281060
    10291061        // Update or insert cart and customer data into the table
  • notifier/trunk/notifier.php

    r3320064 r3347478  
    33 * Plugin Name: Send Notifications from Woocommerce, Form Plugins and More!
    44 * Plugin URI: https://wordpress.org/plugins/notifier/
    5  * Description: Integrate WhatsApp API with WordPress to send WhatsApp notifications from Woocommerce, Contact Form 7, Gravity Forms, WPForms & more.
    6  * Version: 2.7.9
     5 * Description: WhatsApp API integration to send WhatsApp notifications from Woocommerce, Contact Form 7, Gravity Forms, WPForms & more.
     6 * Version: 2.7.10
    77 * Author: WANotifier
    88 * Author URI: https://wanotifier.com
Note: See TracChangeset for help on using the changeset viewer.