Plugin Directory

Changeset 3402172


Ignore:
Timestamp:
11/25/2025 03:29:10 AM (3 months ago)
Author:
convertize
Message:

updated plugin name and contributors

Location:
nudgify
Files:
3 edited
56 copied

Legend:

Unmodified
Added
Removed
  • nudgify/tags/1.3.12/nudgify.php

    r3399921 r3402172  
    163163            }
    164164
    165             // JSON encode for safe JavaScript output
    166             $uuid = wp_json_encode($uuid);
    167             $url = wp_json_encode(NUDGIFY_PIXEL_BASE.'/pixel.js');
     165            // These will be properly escaped with esc_js() when output
     166            $url = NUDGIFY_PIXEL_BASE.'/pixel.js';
    168167
    169168            $pixelData = [];
     
    231230            echo '(function(w){' . "\n";
    232231            echo '    var k="nudgify",n=w[k]||(w[k]={});' . "\n";
    233             echo '    n.uuid=' . esc_js($uuid) . ';' . "\n";
     232            echo '    n.uuid=' . wp_json_encode($uuid) . ';' . "\n";
    234233            echo '    var d=document,s=d.createElement("script");' . "\n";
    235             echo '    s.src=' . esc_js($url) . ';' . "\n";
     234            echo '    s.src=' . wp_json_encode($url) . ';' . "\n";
    236235            echo '    s.async=1;' . "\n";
    237236            echo '    s.charset="utf-8";' . "\n";
  • nudgify/tags/1.3.14/includes/options.php

    r3399921 r3402172  
    9393        <h2>Sync orders</h2>
    9494        <?php echo wp_kses_post(nudgify_feedback_message('manualsync')); ?>
    95         <form action="<?php echo esc_url(admin_url('admin.php')); ?>" method="post" id="nudgify-form-manualsync">
     95        <form action="<?php echo esc_url(admin_url('admin-post.php')); ?>" method="post" id="nudgify-form-manualsync">
    9696            <input type="hidden" name="action" value="<?php echo esc_attr(NudgifyOptions::DO_MANUAL_SYNC); ?>" />
    9797            <input type="hidden" name="nudgify_manual_sync_nonce" value="<?php echo esc_attr(wp_create_nonce('nudgify_manual_sync_nonce')); ?>" />
     
    103103                        <p class="description">
    104104                            This will send the last 30 orders to Nudgify
     105                        </p>
     106                    </td>
     107                </tr>
     108                <tr>
     109                    <td colspan="2">
     110                        <p style="background: #f0f0f1; padding: 10px; border-left: 4px solid #2271b1;">
     111                            <strong>Debug Info:</strong><br>
     112                            Action: <code><?php echo esc_html(NudgifyOptions::DO_MANUAL_SYNC); ?></code><br>
     113                            Form submits to: <code><?php echo esc_html(admin_url('admin-post.php')); ?></code><br>
     114                            Expected URL: <code><?php echo esc_html(admin_url('admin-post.php?action=' . NudgifyOptions::DO_MANUAL_SYNC)); ?></code>
    105115                        </p>
    106116                    </td>
     
    151161        var buttonText = button.val();
    152162        var feedback = form.find('.nudgify-feedback');
    153        
     163
     164        // Get the action value from hidden input
     165        var actionValue = form.find('input[name="action"]').val();
     166        var ajaxEndpoint = window.ajaxurl || '<?php echo esc_js(admin_url('admin-ajax.php')); ?>';
     167        var ajaxUrl = ajaxEndpoint + '?action=' + actionValue;
     168
     169        console.log('[Nudgify AJAX] Submitting to:', ajaxUrl);
     170        console.log('[Nudgify AJAX] Form data:', form.serialize());
     171
    154172        jQuery.ajax({
    155173            type: "POST",
    156             url: form.attr('action'),
     174            url: ajaxUrl,
    157175            data: form.serialize(),
    158176            beforeSend: function() {
     
    162180            },
    163181            success: function(data) {
     182                console.log('[Nudgify AJAX] Success response:', data);
    164183                button.prop('disabled', false);
    165184                button.val(buttonText);
    166185                feedback.html(data);
     186            },
     187            error: function(xhr, status, error) {
     188                console.error('[Nudgify AJAX] Error:', status, error);
     189                console.error('[Nudgify AJAX] Response:', xhr.responseText);
     190                button.prop('disabled', false);
     191                button.val(buttonText);
     192                feedback.html('<div class="notice notice-error"><p>Error: ' + error + '</p></div>');
    167193            }
    168194        });
  • nudgify/tags/1.3.14/nudgify.php

    r3399921 r3402172  
    55Description: Install Nudgify on your WordPress website in less then 10 seconds. Integrate unique tracking code of Nudgify into every page of your website in one click.
    66Author: Nudgify
    7 Version: 1.3.12
     7Version: 1.3.14
    88Author URI: https://nudgify.com
    99License: GPLv2
     
    1313defined('ABSPATH') or exit('Restricted access!');
    1414
    15 define('NUDGIFY_PLUGIN_VERSION', '1.3.12');
     15define('NUDGIFY_PLUGIN_VERSION', '1.3.14');
    1616define('NUDGIFY_PLUGIN_SLUG', 'nudgify');
    1717define('NUDGIFY_PLUGIN_URL', plugin_dir_url(__FILE__));
     
    9191            add_action('update_option_'.NudgifyOptions::SITE_KEY, [$this, 'connect'], 999, 0);
    9292            add_action('update_option_'.NudgifyOptions::API_TOKEN, [$this, 'connect'], 999, 0);
     93
     94            add_action('admin_action_'.NudgifyOptions::DO_MANUAL_SYNC, [$this, 'sync_orders_manually']);
     95            add_action('admin_post_'.NudgifyOptions::DO_MANUAL_SYNC, [$this, 'sync_orders_manually']);
     96            add_action('wp_ajax_'.NudgifyOptions::DO_MANUAL_SYNC, [$this, 'sync_orders_manually']);
    9397        }
    9498
    9599        public function init_woocommerce_orders()
    96100        {
     101            // Log whether WooCommerce is detected using WooCommerce logger
     102            if (function_exists('wc_get_logger')) {
     103                $logger = wc_get_logger();
     104                $logger->info('init_woocommerce_orders called', ['source' => 'nudgify-init']);
     105                $logger->info('WooCommerce enabled: ' . (nudgify_woocommerce_enabled() ? 'YES' : 'NO'), ['source' => 'nudgify-init']);
     106                $logger->info('class_exists(WooCommerce): ' . (class_exists('WooCommerce') ? 'YES' : 'NO'), ['source' => 'nudgify-init']);
     107                $logger->info('function_exists(WC): ' . (function_exists('WC') ? 'YES' : 'NO'), ['source' => 'nudgify-init']);
     108            }
     109
    97110            if (! nudgify_woocommerce_enabled()) {
    98                 return;
    99             }
    100 
    101             add_action('admin_action_'.NudgifyOptions::DO_MANUAL_SYNC, [$this, 'sync_orders_manually']);
     111                if (function_exists('wc_get_logger')) {
     112                    $logger = wc_get_logger();
     113                    $logger->error('Exiting init_woocommerce_orders - WooCommerce not enabled', ['source' => 'nudgify-init']);
     114                }
     115                return;
     116            }
     117
     118            if (function_exists('wc_get_logger')) {
     119                $logger = wc_get_logger();
     120                $logger->info('Registering WooCommerce hooks...', ['source' => 'nudgify-init']);
     121                $logger->info('Registering Nudgify WooCommerce hooks', ['source' => 'nudgify-init']);
     122                $logger->info('Manual sync action: admin_post_' . NudgifyOptions::DO_MANUAL_SYNC, ['source' => 'nudgify-init']);
     123                $logger->info('About to register action: admin_post_' . NudgifyOptions::DO_MANUAL_SYNC, ['source' => 'nudgify-init']);
     124            }
     125
    102126            add_action('woocommerce_new_order', [$this, 'post_woocommerce_order']);
    103127            add_action('woocommerce_add_to_cart', [$this, 'post_woocommerce_add_to_cart'], 10, 6);
     
    163187            }
    164188
    165             // JSON encode for safe JavaScript output
    166             $uuid = wp_json_encode($uuid);
    167             $url = wp_json_encode(NUDGIFY_PIXEL_BASE.'/pixel.js');
     189            // These will be properly escaped with esc_js() when output
     190            $url = NUDGIFY_PIXEL_BASE.'/pixel.js';
    168191
    169192            $pixelData = [];
     
    231254            echo '(function(w){' . "\n";
    232255            echo '    var k="nudgify",n=w[k]||(w[k]={});' . "\n";
    233             echo '    n.uuid=' . esc_js($uuid) . ';' . "\n";
     256            echo '    n.uuid=' . wp_json_encode($uuid) . ';' . "\n";
    234257            echo '    var d=document,s=d.createElement("script");' . "\n";
    235             echo '    s.src=' . esc_js($url) . ';' . "\n";
     258            echo '    s.src=' . wp_json_encode($url) . ';' . "\n";
    236259            echo '    s.async=1;' . "\n";
    237260            echo '    s.charset="utf-8";' . "\n";
     
    388411        }
    389412
     413        private function log_sync($level, $message, $context = [])
     414        {
     415            if (function_exists('wc_get_logger')) {
     416                $logger = wc_get_logger();
     417                $context['source'] = 'nudgify-manual-sync';
     418                $logger->log($level, $message, $context);
     419            }
     420        }
     421
    390422        public function sync_orders_manually()
    391423        {
     424            $this->log_sync('info', 'Starting manual order sync...');
     425
    392426            if (! current_user_can('manage_options')) {
     427                $this->log_sync('error', 'User does not have manage_options capability');
    393428                echo wp_kses_post(nudgify_build_feedback_message('manualsync', '419'));
    394429
     
    399434
    400435            if (! wp_verify_nonce($nonce, 'nudgify_manual_sync_nonce')) {
     436                $this->log_sync('error', 'Nonce verification failed');
    401437                echo wp_kses_post(nudgify_build_feedback_message('manualsync', '419'));
    402438
    403439                exit();
    404440            }
     441
     442            $this->log_sync('info', 'Nonce verified successfully');
    405443
    406444            $enabled = get_option(NudgifyOptions::ENABLED, true);
     
    408446            $apiToken = get_option(NudgifyOptions::API_TOKEN);
    409447
     448            $this->log_sync('info', 'Settings check', [
     449                'enabled' => $enabled ? 'Yes' : 'No',
     450                'site_key' => $siteKey ? 'Present' : 'Missing',
     451                'api_token' => $apiToken ? 'Present' : 'Missing'
     452            ]);
     453
    410454            if (! (nudgify_woocommerce_enabled() && $enabled)) {
     455                $this->log_sync('error', 'WooCommerce not enabled or Nudgify disabled');
    411456                echo wp_kses_post(nudgify_build_feedback_message('manualsync', '423'));
    412457
     
    415460
    416461            if (! ($siteKey && $apiToken)) {
     462                $this->log_sync('error', 'Missing Site Key or API Token');
    417463                echo wp_kses_post(nudgify_build_feedback_message('manualsync', '424'));
    418464
     
    428474                return ! in_array($status, ['wc-refunded', 'wc-cancelled']);
    429475            });
     476
     477            $this->log_sync('info', 'Accepted order statuses: ' . implode(', ', $acceptedStatuses));
    430478
    431479            $orders = wc_get_orders([
     
    436484            ]);
    437485
     486            $this->log_sync('info', 'Found ' . count($orders) . ' orders to sync');
     487
    438488            foreach ($orders as $order) {
    439489                // guard agains OrderRefund or OrderCancelled
    440490                if (! method_exists($order, 'get_billing_last_name')) {
     491                    $this->log_sync('warning', 'Skipping order ID ' . $order->get_id() . ' - missing get_billing_last_name method');
    441492                    continue;
    442493                }
     
    446497
    447498                $data['orders'][] = $orderData;
    448             }
     499                $this->log_sync('debug', 'Prepared order ID: ' . $order->get_id());
     500            }
     501
     502            $this->log_sync('info', 'Sending ' . count($data['orders']) . ' orders to Nudgify API', [
     503                'endpoint' => NUDGIFY_ENDPOINT_SYNC,
     504                'order_count' => count($data['orders'])
     505            ]);
    449506
    450507            $response = $this->post(NUDGIFY_ENDPOINT_SYNC, $data, $apiToken);
     508
     509            $this->log_sync('info', 'API Response received', [
     510                'code' => $response['code'],
     511                'successful' => $response['successful'] ? 'Yes' : 'No'
     512            ]);
     513
     514            if (isset($response['message'])) {
     515                $this->log_sync('info', 'API Response Message: ' . $response['message']);
     516            }
    451517
    452518            if ($response['successful']) {
    453519                update_option(NudgifyOptions::CONNECTED, 1);
    454             }
    455             echo wp_kses_post(nudgify_build_feedback_message('manualsync', '200'));
     520                $this->log_sync('info', 'SUCCESS: Orders synced successfully');
     521                echo wp_kses_post(nudgify_build_feedback_message('manualsync', '200'));
     522            } else {
     523                $this->log_sync('error', 'FAILED: Orders sync failed', [
     524                    'code' => $response['code'],
     525                    'message' => isset($response['message']) ? $response['message'] : 'No message'
     526                ]);
     527                echo wp_kses_post(nudgify_build_feedback_message('manualsync', $response['code']));
     528            }
    456529
    457530            exit();
  • nudgify/tags/1.3.14/readme.txt

    r3399921 r3402172  
    55Requires at least: 4.6
    66Tested up to: 6.8
    7 Stable tag: 1.3.12
     7Stable tag: 1.3.14
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    122122
    123123Our pricing is per website. That means that you can add as many websites to your Nudgify account as you like, and multiply your plan price by the number of websites you have, e.g. if you use our Lite plan on 2 websites, it will cost 2x $0.99  = $1.98/month.
    124 
  • nudgify/trunk/includes/options.php

    r3399921 r3402172  
    9393        <h2>Sync orders</h2>
    9494        <?php echo wp_kses_post(nudgify_feedback_message('manualsync')); ?>
    95         <form action="<?php echo esc_url(admin_url('admin.php')); ?>" method="post" id="nudgify-form-manualsync">
     95        <form action="<?php echo esc_url(admin_url('admin-post.php')); ?>" method="post" id="nudgify-form-manualsync">
    9696            <input type="hidden" name="action" value="<?php echo esc_attr(NudgifyOptions::DO_MANUAL_SYNC); ?>" />
    9797            <input type="hidden" name="nudgify_manual_sync_nonce" value="<?php echo esc_attr(wp_create_nonce('nudgify_manual_sync_nonce')); ?>" />
     
    103103                        <p class="description">
    104104                            This will send the last 30 orders to Nudgify
     105                        </p>
     106                    </td>
     107                </tr>
     108                <tr>
     109                    <td colspan="2">
     110                        <p style="background: #f0f0f1; padding: 10px; border-left: 4px solid #2271b1;">
     111                            <strong>Debug Info:</strong><br>
     112                            Action: <code><?php echo esc_html(NudgifyOptions::DO_MANUAL_SYNC); ?></code><br>
     113                            Form submits to: <code><?php echo esc_html(admin_url('admin-post.php')); ?></code><br>
     114                            Expected URL: <code><?php echo esc_html(admin_url('admin-post.php?action=' . NudgifyOptions::DO_MANUAL_SYNC)); ?></code>
    105115                        </p>
    106116                    </td>
     
    151161        var buttonText = button.val();
    152162        var feedback = form.find('.nudgify-feedback');
    153        
     163
     164        // Get the action value from hidden input
     165        var actionValue = form.find('input[name="action"]').val();
     166        var ajaxEndpoint = window.ajaxurl || '<?php echo esc_js(admin_url('admin-ajax.php')); ?>';
     167        var ajaxUrl = ajaxEndpoint + '?action=' + actionValue;
     168
     169        console.log('[Nudgify AJAX] Submitting to:', ajaxUrl);
     170        console.log('[Nudgify AJAX] Form data:', form.serialize());
     171
    154172        jQuery.ajax({
    155173            type: "POST",
    156             url: form.attr('action'),
     174            url: ajaxUrl,
    157175            data: form.serialize(),
    158176            beforeSend: function() {
     
    162180            },
    163181            success: function(data) {
     182                console.log('[Nudgify AJAX] Success response:', data);
    164183                button.prop('disabled', false);
    165184                button.val(buttonText);
    166185                feedback.html(data);
     186            },
     187            error: function(xhr, status, error) {
     188                console.error('[Nudgify AJAX] Error:', status, error);
     189                console.error('[Nudgify AJAX] Response:', xhr.responseText);
     190                button.prop('disabled', false);
     191                button.val(buttonText);
     192                feedback.html('<div class="notice notice-error"><p>Error: ' + error + '</p></div>');
    167193            }
    168194        });
  • nudgify/trunk/nudgify.php

    r3399921 r3402172  
    55Description: Install Nudgify on your WordPress website in less then 10 seconds. Integrate unique tracking code of Nudgify into every page of your website in one click.
    66Author: Nudgify
    7 Version: 1.3.12
     7Version: 1.3.14
    88Author URI: https://nudgify.com
    99License: GPLv2
     
    1313defined('ABSPATH') or exit('Restricted access!');
    1414
    15 define('NUDGIFY_PLUGIN_VERSION', '1.3.12');
     15define('NUDGIFY_PLUGIN_VERSION', '1.3.14');
    1616define('NUDGIFY_PLUGIN_SLUG', 'nudgify');
    1717define('NUDGIFY_PLUGIN_URL', plugin_dir_url(__FILE__));
     
    9191            add_action('update_option_'.NudgifyOptions::SITE_KEY, [$this, 'connect'], 999, 0);
    9292            add_action('update_option_'.NudgifyOptions::API_TOKEN, [$this, 'connect'], 999, 0);
     93
     94            add_action('admin_action_'.NudgifyOptions::DO_MANUAL_SYNC, [$this, 'sync_orders_manually']);
     95            add_action('admin_post_'.NudgifyOptions::DO_MANUAL_SYNC, [$this, 'sync_orders_manually']);
     96            add_action('wp_ajax_'.NudgifyOptions::DO_MANUAL_SYNC, [$this, 'sync_orders_manually']);
    9397        }
    9498
    9599        public function init_woocommerce_orders()
    96100        {
     101            // Log whether WooCommerce is detected using WooCommerce logger
     102            if (function_exists('wc_get_logger')) {
     103                $logger = wc_get_logger();
     104                $logger->info('init_woocommerce_orders called', ['source' => 'nudgify-init']);
     105                $logger->info('WooCommerce enabled: ' . (nudgify_woocommerce_enabled() ? 'YES' : 'NO'), ['source' => 'nudgify-init']);
     106                $logger->info('class_exists(WooCommerce): ' . (class_exists('WooCommerce') ? 'YES' : 'NO'), ['source' => 'nudgify-init']);
     107                $logger->info('function_exists(WC): ' . (function_exists('WC') ? 'YES' : 'NO'), ['source' => 'nudgify-init']);
     108            }
     109
    97110            if (! nudgify_woocommerce_enabled()) {
    98                 return;
    99             }
    100 
    101             add_action('admin_action_'.NudgifyOptions::DO_MANUAL_SYNC, [$this, 'sync_orders_manually']);
     111                if (function_exists('wc_get_logger')) {
     112                    $logger = wc_get_logger();
     113                    $logger->error('Exiting init_woocommerce_orders - WooCommerce not enabled', ['source' => 'nudgify-init']);
     114                }
     115                return;
     116            }
     117
     118            if (function_exists('wc_get_logger')) {
     119                $logger = wc_get_logger();
     120                $logger->info('Registering WooCommerce hooks...', ['source' => 'nudgify-init']);
     121                $logger->info('Registering Nudgify WooCommerce hooks', ['source' => 'nudgify-init']);
     122                $logger->info('Manual sync action: admin_post_' . NudgifyOptions::DO_MANUAL_SYNC, ['source' => 'nudgify-init']);
     123                $logger->info('About to register action: admin_post_' . NudgifyOptions::DO_MANUAL_SYNC, ['source' => 'nudgify-init']);
     124            }
     125
    102126            add_action('woocommerce_new_order', [$this, 'post_woocommerce_order']);
    103127            add_action('woocommerce_add_to_cart', [$this, 'post_woocommerce_add_to_cart'], 10, 6);
     
    163187            }
    164188
    165             // JSON encode for safe JavaScript output
    166             $uuid = wp_json_encode($uuid);
    167             $url = wp_json_encode(NUDGIFY_PIXEL_BASE.'/pixel.js');
     189            // These will be properly escaped with esc_js() when output
     190            $url = NUDGIFY_PIXEL_BASE.'/pixel.js';
    168191
    169192            $pixelData = [];
     
    231254            echo '(function(w){' . "\n";
    232255            echo '    var k="nudgify",n=w[k]||(w[k]={});' . "\n";
    233             echo '    n.uuid=' . esc_js($uuid) . ';' . "\n";
     256            echo '    n.uuid=' . wp_json_encode($uuid) . ';' . "\n";
    234257            echo '    var d=document,s=d.createElement("script");' . "\n";
    235             echo '    s.src=' . esc_js($url) . ';' . "\n";
     258            echo '    s.src=' . wp_json_encode($url) . ';' . "\n";
    236259            echo '    s.async=1;' . "\n";
    237260            echo '    s.charset="utf-8";' . "\n";
     
    388411        }
    389412
     413        private function log_sync($level, $message, $context = [])
     414        {
     415            if (function_exists('wc_get_logger')) {
     416                $logger = wc_get_logger();
     417                $context['source'] = 'nudgify-manual-sync';
     418                $logger->log($level, $message, $context);
     419            }
     420        }
     421
    390422        public function sync_orders_manually()
    391423        {
     424            $this->log_sync('info', 'Starting manual order sync...');
     425
    392426            if (! current_user_can('manage_options')) {
     427                $this->log_sync('error', 'User does not have manage_options capability');
    393428                echo wp_kses_post(nudgify_build_feedback_message('manualsync', '419'));
    394429
     
    399434
    400435            if (! wp_verify_nonce($nonce, 'nudgify_manual_sync_nonce')) {
     436                $this->log_sync('error', 'Nonce verification failed');
    401437                echo wp_kses_post(nudgify_build_feedback_message('manualsync', '419'));
    402438
    403439                exit();
    404440            }
     441
     442            $this->log_sync('info', 'Nonce verified successfully');
    405443
    406444            $enabled = get_option(NudgifyOptions::ENABLED, true);
     
    408446            $apiToken = get_option(NudgifyOptions::API_TOKEN);
    409447
     448            $this->log_sync('info', 'Settings check', [
     449                'enabled' => $enabled ? 'Yes' : 'No',
     450                'site_key' => $siteKey ? 'Present' : 'Missing',
     451                'api_token' => $apiToken ? 'Present' : 'Missing'
     452            ]);
     453
    410454            if (! (nudgify_woocommerce_enabled() && $enabled)) {
     455                $this->log_sync('error', 'WooCommerce not enabled or Nudgify disabled');
    411456                echo wp_kses_post(nudgify_build_feedback_message('manualsync', '423'));
    412457
     
    415460
    416461            if (! ($siteKey && $apiToken)) {
     462                $this->log_sync('error', 'Missing Site Key or API Token');
    417463                echo wp_kses_post(nudgify_build_feedback_message('manualsync', '424'));
    418464
     
    428474                return ! in_array($status, ['wc-refunded', 'wc-cancelled']);
    429475            });
     476
     477            $this->log_sync('info', 'Accepted order statuses: ' . implode(', ', $acceptedStatuses));
    430478
    431479            $orders = wc_get_orders([
     
    436484            ]);
    437485
     486            $this->log_sync('info', 'Found ' . count($orders) . ' orders to sync');
     487
    438488            foreach ($orders as $order) {
    439489                // guard agains OrderRefund or OrderCancelled
    440490                if (! method_exists($order, 'get_billing_last_name')) {
     491                    $this->log_sync('warning', 'Skipping order ID ' . $order->get_id() . ' - missing get_billing_last_name method');
    441492                    continue;
    442493                }
     
    446497
    447498                $data['orders'][] = $orderData;
    448             }
     499                $this->log_sync('debug', 'Prepared order ID: ' . $order->get_id());
     500            }
     501
     502            $this->log_sync('info', 'Sending ' . count($data['orders']) . ' orders to Nudgify API', [
     503                'endpoint' => NUDGIFY_ENDPOINT_SYNC,
     504                'order_count' => count($data['orders'])
     505            ]);
    449506
    450507            $response = $this->post(NUDGIFY_ENDPOINT_SYNC, $data, $apiToken);
     508
     509            $this->log_sync('info', 'API Response received', [
     510                'code' => $response['code'],
     511                'successful' => $response['successful'] ? 'Yes' : 'No'
     512            ]);
     513
     514            if (isset($response['message'])) {
     515                $this->log_sync('info', 'API Response Message: ' . $response['message']);
     516            }
    451517
    452518            if ($response['successful']) {
    453519                update_option(NudgifyOptions::CONNECTED, 1);
    454             }
    455             echo wp_kses_post(nudgify_build_feedback_message('manualsync', '200'));
     520                $this->log_sync('info', 'SUCCESS: Orders synced successfully');
     521                echo wp_kses_post(nudgify_build_feedback_message('manualsync', '200'));
     522            } else {
     523                $this->log_sync('error', 'FAILED: Orders sync failed', [
     524                    'code' => $response['code'],
     525                    'message' => isset($response['message']) ? $response['message'] : 'No message'
     526                ]);
     527                echo wp_kses_post(nudgify_build_feedback_message('manualsync', $response['code']));
     528            }
    456529
    457530            exit();
  • nudgify/trunk/readme.txt

    r3399921 r3402172  
    55Requires at least: 4.6
    66Tested up to: 6.8
    7 Stable tag: 1.3.12
     7Stable tag: 1.3.14
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    122122
    123123Our pricing is per website. That means that you can add as many websites to your Nudgify account as you like, and multiply your plan price by the number of websites you have, e.g. if you use our Lite plan on 2 websites, it will cost 2x $0.99  = $1.98/month.
    124 
Note: See TracChangeset for help on using the changeset viewer.