Plugin Directory

Changeset 3441283


Ignore:
Timestamp:
01/16/2026 09:48:41 PM (13 days ago)
Author:
digages
Message:

New Release

Location:
direct-payments-for-woocommerce
Files:
452 added
10 edited

Legend:

Unmodified
Added
Removed
  • direct-payments-for-woocommerce/trunk/ads/others/help-improve.php

    r3437722 r3441283  
    66    $data_usage_second = get_option('digages_wdpp_data_usage_second');
    77    $optional_proof = get_option('digages_wdpp_optional_ai_auto');
    8     $current_version = '2.4.0'; // plugin's current version
     8    $current_version = '2.4.1'; // plugin's current version
    99    $saved_version = get_option('digages_woodp_option_plugin_version');
    1010
  • direct-payments-for-woocommerce/trunk/allpagesenq.php

    r3437722 r3441283  
    1515    plugin_dir_url(__FILE__) . 'onboading/assets/js/overlaywait.js',
    1616    array('jquery'),
    17     '2.4.0',
     17    '2.4.1',
    1818    true
    1919);
     
    2222        plugin_dir_url(__FILE__) . 'onboarding/assets/js/allpages.js',
    2323        array('jquery'),
    24         '2.4.0',
     24        '2.4.1',
    2525        true
    2626    );
  • direct-payments-for-woocommerce/trunk/changelog.txt

    r3437722 r3441283  
    11== Direct Payments for Woocommerce Changelog ==
     2
     32026-01-08 - version 2.4.1
     4* Improved: Minor update.
    25
    362026-01-08 - version 2.4.0
  • direct-payments-for-woocommerce/trunk/digages.php

    r3437722 r3441283  
    33Plugin Name: Direct Payments for Woocommerce
    44Description: Enable instant payments from your customers via bank transfers, mobile money, cryptocurrency and popular P2P platforms like PayPal, Venmo, Zelle, GCash e.t.c—all with zero transaction fees. No API keys or KYC required.
    5 Version: 2.4.0
     5Version: 2.4.1
    66Author: Digages
    77Author URI: http://digages.com/
     
    137137function digages_plugin_on_activation() {
    138138   
    139     $current_version = '2.4.0'; // your plugin's current version
     139    $current_version = '2.4.1'; // your plugin's current version
    140140   
    141141    $confirmed_payments = array(
     
    325325// Alternative method for updates using version checking
    326326add_action('plugins_loaded', function() {
    327     $plugin_version = '2.4.0'; // Set your current plugin version
     327    $plugin_version = '2.4.1'; // Set your current plugin version
    328328    $stored_version = get_option('digages_plugin_version', '0.0.0');
    329329   
  • direct-payments-for-woocommerce/trunk/directpayment/header.php

    r3389074 r3441283  
    2323            <?php
    2424
    25             echo '<a href="' . esc_url(add_query_arg(['page' => 'direct-payments-about', '_wpnonce' => $nonce], admin_url('admin.php'))) . '"  '.wp_kses_post($current_pagef).' >Help Center</a>';
     25            echo '<a href="' . esc_url(add_query_arg(['page' => 'direct-payments-about', '_wpnonce' => $nonce], admin_url('admin.php'))) . '"  >Help Center</a>';
    2626            ?>
    2727        </div>
  • direct-payments-for-woocommerce/trunk/directpayment/orderdetails.php

    r3437722 r3441283  
    6666// Fetch order data
    6767$order = wc_get_order($order_id);
    68 if ($order instanceof WC_Order) {
     68if ($order instanceof WC_Order) {
     69   
    6970    // Get screenshot file URL from the order meta
    70     $screenshot_file = get_post_meta($order_id, '_screenshot_file', true);
    71     $screenshot_url = $screenshot_file ? esc_url($screenshot_file) : ''; // Ensure the URL is valid
     71    $screenshot_file1 = $order->get_meta('_screenshot_file');
     72    $screenshot_file2 = get_post_meta($order_id, '_screenshot_file', true);
     73    $screenshot_url = $screenshot_file1 ? esc_url($screenshot_file1) : ($screenshot_file2 ? esc_url($screenshot_file2) : ''); // Ensure the URL is valid
    7274
    7375   
  • direct-payments-for-woocommerce/trunk/frontend/paymentpopup.php

    r3437722 r3441283  
    4242function digages_enqueue_scripts() {
    4343
     44$popconvertoptiondb = get_option( 'digages_crypto_transfer_convert' );
     45$digagespopcyp = 'no';
     46if ($popconvertoptiondb =='yes' )
     47    {
     48        $digagespopcyp = 'yes';
     49    }
     50    else
     51        {
     52            $digagespopcyp = 'no';
     53        }
     54
     55
     56       
    4457wp_enqueue_script(
    4558'digages-qrcode-script', // Handle
    4659plugin_dir_url(__FILE__) . 'qrcode.js', // Path to your script
    4760array('jquery'), // Dependencies
    48 '2.4.0', // Version number
     61'2.4.1', // Version number
    4962true // Load in footer
    5063);
     
    5467plugin_dir_url(__FILE__) . 'qrcode2.js', // Path to your script
    5568array('jquery'), // Dependencies
    56 '2.4.0', // Version number
     69'2.4.1', // Version number
    5770true // Load in footer
    5871);
     
    6275plugin_dir_url(__FILE__) . 'pop.js', // Path to your script
    6376array('jquery'), // Dependencies
    64 '2.4.0', // Version number
     77'2.4.1', // Version number
    6578true // Load in footer
    6679);
     
    8295        plugin_dir_url(__FILE__) . 'country.js', // Path to your script
    8396        array('jquery'), // Dependencies
    84         '2.4.0', // Version number
     97        '2.4.1', // Version number
    8598        true // Load in footer
    8699    );
     
    98111        plugin_dir_url(__FILE__) . 'countrya.js', // Path to your script
    99112        array('jquery'), // Dependencies
    100         '2.4.0', // Version number
     113        '2.4.1', // Version number
    101114        true // Load in footer
    102115    );
  • direct-payments-for-woocommerce/trunk/functions/frontadminenqueue.php

    r3437722 r3441283  
    1010       
    1111        // Enqueue Bootstrap CSS and JS
    12         wp_enqueue_style('digages-admin-direct-payments', plugin_dir_url(__FILE__) . '../assets/css/digages-direct-payments.css', array(), '2.4.0', 'all');
    13         wp_enqueue_style('bootstrap-css', plugin_dir_url(__FILE__) . '../assets/css/bootstrap.min.css', array(), '2.4.0', 'all');
    14         wp_enqueue_style('bootstrap-font', plugin_dir_url(__FILE__) . '../assets/css/bootstrap-icons.min.css', array(), '2.4.0', 'all');
    15         wp_enqueue_script('bootstrap-js', plugin_dir_url(__FILE__) . '../assets/js/bootstrap.bundle.min.js', array('jquery'), '2.4.0', true);
    16         wp_enqueue_style('icomoon-css', plugin_dir_url(__FILE__) . '../assets/css/icomoon.css', array(), '2.4.0', 'all');
     12        wp_enqueue_style('digages-admin-direct-payments', plugin_dir_url(__FILE__) . '../assets/css/digages-direct-payments.css', array(), '2.4.1', 'all');
     13        wp_enqueue_style('bootstrap-css', plugin_dir_url(__FILE__) . '../assets/css/bootstrap.min.css', array(), '2.4.1', 'all');
     14        wp_enqueue_style('bootstrap-font', plugin_dir_url(__FILE__) . '../assets/css/bootstrap-icons.min.css', array(), '2.4.1', 'all');
     15        wp_enqueue_script('bootstrap-js', plugin_dir_url(__FILE__) . '../assets/js/bootstrap.bundle.min.js', array('jquery'), '2.4.1', true);
     16        wp_enqueue_style('icomoon-css', plugin_dir_url(__FILE__) . '../assets/css/icomoon.css', array(), '2.4.1', 'all');
    1717       
    1818        // Enqueue popup CSS and JS
    19         wp_enqueue_style('digages-new-popup-css', plugin_dir_url(__FILE__) . '../assets/css/popup.css', array(), '2.4.0', 'all');
    20         wp_enqueue_script('digages-new-popup-js', plugin_dir_url(__FILE__) . '../assets/js/popup.js', array('jquery'), '2.4.0', true);
    21         wp_enqueue_script('digages-new-getamount-js', plugin_dir_url(__FILE__) . '../assets/js/get-amount.js', array('jquery'), '2.4.0', true);
    22        
    23         wp_enqueue_script('digages-cryptocopy-js', plugin_dir_url(__FILE__) . '../assets/js/cryptocopy.js', array('jquery'), '2.4.0', true);
    24         wp_enqueue_script('digages-auto-adjust-popup-js', plugin_dir_url(__FILE__) . '../assets/js/adjustpopup.js', array('jquery'), '2.4.0', true);
    25         wp_enqueue_style('digages-new-grid-css', plugin_dir_url(__FILE__) . '../assets/css/grid.css', array(), '2.4.0', 'all');
    26         wp_enqueue_script('digages-mobile-option-change', plugin_dir_url(__FILE__) . '../assets/js/mobile-option-change.js', array('jquery'), '2.4.0', true);
     19        wp_enqueue_style('digages-new-popup-css', plugin_dir_url(__FILE__) . '../assets/css/popup.css', array(), '2.4.1', 'all');
     20        wp_enqueue_script('digages-new-popup-js', plugin_dir_url(__FILE__) . '../assets/js/popup.js', array('jquery'), '2.4.1', true);
     21        wp_enqueue_script('digages-new-getamount-js', plugin_dir_url(__FILE__) . '../assets/js/get-amount.js', array('jquery'), '2.4.1', true);
     22       
     23        wp_enqueue_script('digages-cryptocopy-js', plugin_dir_url(__FILE__) . '../assets/js/cryptocopy.js', array('jquery'), '2.4.1', true);
     24        wp_enqueue_script('digages-auto-adjust-popup-js', plugin_dir_url(__FILE__) . '../assets/js/adjustpopup.js', array('jquery'), '2.4.1', true);
     25        wp_enqueue_style('digages-new-grid-css', plugin_dir_url(__FILE__) . '../assets/css/grid.css', array(), '2.4.1', 'all');
     26        wp_enqueue_script('digages-mobile-option-change', plugin_dir_url(__FILE__) . '../assets/js/mobile-option-change.js', array('jquery'), '2.4.1', true);
    2727    }
    2828}
     
    5959        {
    6060        // Enqueue Bootstrap CSS and JS
    61         wp_enqueue_style('digages-admin-direct-payments', plugin_dir_url(__FILE__) . '../assets/css/digages-direct-payments.css', array(), '2.4.0', 'all');
    62         wp_enqueue_style('bootstrap-css', plugin_dir_url(__FILE__) . '../assets/css/bootstrap.min.css', array(), '2.4.0', 'all');
    63         wp_enqueue_style('bootstrap-font', plugin_dir_url(__FILE__) . '../assets/css/bootstrap-icons.min.css', array(), '2.4.0', 'all');
    64         wp_enqueue_script('bootstrap-js', plugin_dir_url(__FILE__) . '../assets/js/bootstrap.bundle.min.js', array('jquery'), '2.4.0', true);
    65         wp_enqueue_style('icomoon-css', plugin_dir_url(__FILE__) . '../assets/css/icomoon.css', array(), '2.4.0', 'all');
     61        wp_enqueue_style('digages-admin-direct-payments', plugin_dir_url(__FILE__) . '../assets/css/digages-direct-payments.css', array(), '2.4.1', 'all');
     62        wp_enqueue_style('bootstrap-css', plugin_dir_url(__FILE__) . '../assets/css/bootstrap.min.css', array(), '2.4.1', 'all');
     63        wp_enqueue_style('bootstrap-font', plugin_dir_url(__FILE__) . '../assets/css/bootstrap-icons.min.css', array(), '2.4.1', 'all');
     64        wp_enqueue_script('bootstrap-js', plugin_dir_url(__FILE__) . '../assets/js/bootstrap.bundle.min.js', array('jquery'), '2.4.1', true);
     65        wp_enqueue_style('icomoon-css', plugin_dir_url(__FILE__) . '../assets/css/icomoon.css', array(), '2.4.1', 'all');
    6666       
    6767        // Enqueue popup CSS and JS
    68         wp_enqueue_style('digages-new-popup-css', plugin_dir_url(__FILE__) . '../assets/css/popup.css', array(), '2.4.0', 'all');
    69         wp_enqueue_script('digages-new-popup-js', plugin_dir_url(__FILE__) . '../assets/js/popup.js', array('jquery'), '2.4.0', true);
    70         wp_enqueue_style('digages-new-grid-css', plugin_dir_url(__FILE__) . '../assets/css/grid.css', array(), '2.4.0', 'all');
    71 
    72      wp_enqueue_style('digages-admin-woodp-removenotice', plugin_dir_url(__FILE__) . '../assets/css/removenotice.css', array(), '2.4.0', 'all');
    73 
    74 
    75         wp_enqueue_script('digages-woodp-script', plugin_dir_url(__FILE__) . '../assets/js/plugin-install.js', array('jquery'), '2.4.0', true);
    76    
    77         wp_enqueue_script('digages-auto-all-select-js', plugin_dir_url(__FILE__) . '../assets/js/allselect.js', array('jquery'), '2.4.0', true);
     68        wp_enqueue_style('digages-new-popup-css', plugin_dir_url(__FILE__) . '../assets/css/popup.css', array(), '2.4.1', 'all');
     69        wp_enqueue_script('digages-new-popup-js', plugin_dir_url(__FILE__) . '../assets/js/popup.js', array('jquery'), '2.4.1', true);
     70        wp_enqueue_style('digages-new-grid-css', plugin_dir_url(__FILE__) . '../assets/css/grid.css', array(), '2.4.1', 'all');
     71
     72     wp_enqueue_style('digages-admin-woodp-removenotice', plugin_dir_url(__FILE__) . '../assets/css/removenotice.css', array(), '2.4.1', 'all');
     73
     74
     75        wp_enqueue_script('digages-woodp-script', plugin_dir_url(__FILE__) . '../assets/js/plugin-install.js', array('jquery'), '2.4.1', true);
     76   
     77        wp_enqueue_script('digages-auto-all-select-js', plugin_dir_url(__FILE__) . '../assets/js/allselect.js', array('jquery'), '2.4.1', true);
    7878       
    7979        // Localize script for AJAX
     
    8484
    8585       
    86         wp_enqueue_script('digages-woodp-script-admincurrencies', plugin_dir_url(__FILE__) . '../assets/js/admincurrencies.js', array('jquery'), '2.4.0', true);
     86        wp_enqueue_script('digages-woodp-script-admincurrencies', plugin_dir_url(__FILE__) . '../assets/js/admincurrencies.js', array('jquery'), '2.4.1', true);
    8787   
    8888        $default_currency = get_woocommerce_currency();
     
    9595
    9696
    97      wp_enqueue_script('digages-woodp-script_check_proof', plugin_dir_url(__FILE__) . '../assets/js/check_proof.js', array('jquery'), '2.4.0', true);
     97     wp_enqueue_script('digages-woodp-script_check_proof', plugin_dir_url(__FILE__) . '../assets/js/check_proof.js', array('jquery'), '2.4.1', true);
    9898   
    9999
     
    104104
    105105    // Enqueue jQuery UI CSS (optional, if needed for styling)
    106         wp_enqueue_style('digagespqselect-style', plugin_dir_url(__FILE__) . '../assets/css/digagespqselect.dev.css', array(), '2.4.0', 'all');
     106        wp_enqueue_style('digagespqselect-style', plugin_dir_url(__FILE__) . '../assets/css/digagespqselect.dev.css', array(), '2.4.1', 'all');
    107107 
    108        wp_enqueue_style('digagesjquery-uijquery-ui', plugin_dir_url(__FILE__) . '../assets/css/jquery-ui.css', array(), '2.4.0', 'all'); 
    109 
    110         wp_enqueue_style('digagesjquery-jquerysctipttop', plugin_dir_url(__FILE__) . '../assets/css/jquerysctipttop.css', array(), '2.4.0', 'all'); 
     108       wp_enqueue_style('digagesjquery-uijquery-ui', plugin_dir_url(__FILE__) . '../assets/css/jquery-ui.css', array(), '2.4.1', 'all'); 
     109
     110        wp_enqueue_style('digagesjquery-jquerysctipttop', plugin_dir_url(__FILE__) . '../assets/css/jquerysctipttop.css', array(), '2.4.1', 'all'); 
    111111 
    112         wp_enqueue_script('digages-woodp-jquery-min', plugin_dir_url(__FILE__) . '../assets/js/ajquery.min.js', array('jquery'), '2.4.0', true);
    113 
    114         wp_enqueue_script('digages-woodp-jquery-ui-min', plugin_dir_url(__FILE__) . '../assets/js/ajquery-ui.min.js', array('jquery'), '2.4.0', true);
    115 
    116         wp_enqueue_script('digages-woodp-digagespqselect-dev', plugin_dir_url(__FILE__) . '../assets/js/digagespqselect.dev.js', array('jquery'), '2.4.0', true);
    117 
    118         wp_enqueue_script('digages-woodp-select-single-correction', plugin_dir_url(__FILE__) . '../assets/js/select-single-correction.js', array('jquery'), '2.4.0', true);
     112        wp_enqueue_script('digages-woodp-jquery-min', plugin_dir_url(__FILE__) . '../assets/js/ajquery.min.js', array('jquery'), '2.4.1', true);
     113
     114        wp_enqueue_script('digages-woodp-jquery-ui-min', plugin_dir_url(__FILE__) . '../assets/js/ajquery-ui.min.js', array('jquery'), '2.4.1', true);
     115
     116        wp_enqueue_script('digages-woodp-digagespqselect-dev', plugin_dir_url(__FILE__) . '../assets/js/digagespqselect.dev.js', array('jquery'), '2.4.1', true);
     117
     118        wp_enqueue_script('digages-woodp-select-single-correction', plugin_dir_url(__FILE__) . '../assets/js/select-single-correction.js', array('jquery'), '2.4.1', true);
    119119       
    120120        wp_enqueue_script(
     
    122122            plugin_dir_url(__FILE__) . '../assets/js/selectd.js',
    123123            array('jquery'),
    124             '2.4.0',
     124            '2.4.1',
    125125            true
    126126        );
     
    129129        //
    130130           
    131     wp_enqueue_script('digages-woodp-payment-report', plugins_url('../assets/js/payment-report.js', __FILE__), ['jquery'], '2.4.0', true);
     131    wp_enqueue_script('digages-woodp-payment-report', plugins_url('../assets/js/payment-report.js', __FILE__), ['jquery'], '2.4.1', true);
    132132    wp_localize_script('digages-woodp-payment-report', 'digagesDirectPayment', [
    133133        'ajax_url' => admin_url('admin-ajax.php'),
     
    137137
    138138   
    139         wp_enqueue_style('digages-admin-woodp-onboarding-popup', plugin_dir_url(__FILE__) . '../onboarding/assets/css/popup.css', array(), '2.4.0', 'all');
    140 
    141         wp_enqueue_style('digages-admin-woodp_onboarding', plugin_dir_url(__FILE__) . '../onboarding/assets/css/styles.css', array(), '2.4.0', 'all');
     139        wp_enqueue_style('digages-admin-woodp-onboarding-popup', plugin_dir_url(__FILE__) . '../onboarding/assets/css/popup.css', array(), '2.4.1', 'all');
     140
     141        wp_enqueue_style('digages-admin-woodp_onboarding', plugin_dir_url(__FILE__) . '../onboarding/assets/css/styles.css', array(), '2.4.1', 'all');
    142142        wp_enqueue_script(
    143143            'digages-admin-script-onboaard-popup',
    144144            plugin_dir_url(__FILE__) . '../onboarding/assets/js/popup.js',
    145145            array('jquery'),
    146             '2.4.0',
     146            '2.4.1',
    147147            true
    148148        );
     
    154154        plugin_dir_url(__FILE__) . '../assets/js/dashboard-setup.js', // Adjust path as needed
    155155        array('jquery'),
    156         '2.4.0',
     156        '2.4.1',
    157157        true
    158158    );
     
    190190       
    191191        // Enqueue Bootstrap CSS and JS
    192         wp_enqueue_style('digages-admin-direct-payments', plugin_dir_url(__FILE__) . '../assets/css/digages-direct-payments.css', array(), '2.4.0', 'all');
    193         wp_enqueue_style('bootstrap-css', plugin_dir_url(__FILE__) . '../assets/css/bootstrap.min.css', array(), '2.4.0', 'all');
    194         wp_enqueue_style('bootstrap-font', plugin_dir_url(__FILE__) . '../assets/css/bootstrap-icons.min.css', array(), '2.4.0', 'all');
     192        wp_enqueue_style('digages-admin-direct-payments', plugin_dir_url(__FILE__) . '../assets/css/digages-direct-payments.css', array(), '2.4.1', 'all');
     193        wp_enqueue_style('bootstrap-css', plugin_dir_url(__FILE__) . '../assets/css/bootstrap.min.css', array(), '2.4.1', 'all');
     194        wp_enqueue_style('bootstrap-font', plugin_dir_url(__FILE__) . '../assets/css/bootstrap-icons.min.css', array(), '2.4.1', 'all');
    195195        wp_enqueue_script('bootstrap-js', plugin_dir_url(__FILE__) . '../assets/js/bootstrap.bundle.min.js', array('jquery'), '5.2.4', true);
    196         wp_enqueue_style('icomoon-css', plugin_dir_url(__FILE__) . '../assets/css/icomoon.css', array(), '2.4.0', 'all');
     196        wp_enqueue_style('icomoon-css', plugin_dir_url(__FILE__) . '../assets/css/icomoon.css', array(), '2.4.1', 'all');
    197197       
    198198        // Enqueue popup CSS and JS
    199         wp_enqueue_style('digages-new-popup-css', plugin_dir_url(__FILE__) . '../assets/css/popup.css', array(), '2.4.0', 'all');
    200         wp_enqueue_script('digages-new-popup-js', plugin_dir_url(__FILE__) . '../assets/js/popup.js', array('jquery'), '2.4.0', true);
    201         wp_enqueue_style('digages-new-grid-css', plugin_dir_url(__FILE__) . '../assets/css/grid.css', array(), '2.4.0', 'all');
    202 
    203         wp_enqueue_script('digages-auto-all-select-js', plugin_dir_url(__FILE__) . '../assets/js/allselect.js', array('jquery'), '2.4.0', true);
    204    
    205      wp_enqueue_script('digages-woodp-script_check_proof', plugin_dir_url(__FILE__) . '../assets/js/check_proof.js', array('jquery'), '2.4.0', true);
     199        wp_enqueue_style('digages-new-popup-css', plugin_dir_url(__FILE__) . '../assets/css/popup.css', array(), '2.4.1', 'all');
     200        wp_enqueue_script('digages-new-popup-js', plugin_dir_url(__FILE__) . '../assets/js/popup.js', array('jquery'), '2.4.1', true);
     201        wp_enqueue_style('digages-new-grid-css', plugin_dir_url(__FILE__) . '../assets/css/grid.css', array(), '2.4.1', 'all');
     202
     203        wp_enqueue_script('digages-auto-all-select-js', plugin_dir_url(__FILE__) . '../assets/js/allselect.js', array('jquery'), '2.4.1', true);
     204   
     205     wp_enqueue_script('digages-woodp-script_check_proof', plugin_dir_url(__FILE__) . '../assets/js/check_proof.js', array('jquery'), '2.4.1', true);
    206206     
    207      wp_enqueue_script('digages-woodp-script_paystack_blocker', plugin_dir_url(__FILE__) . '../assets/js/paystack-blocker.js', array('jquery'), '2.4.0', true);
    208    
    209    
    210 
    211         wp_enqueue_script('digages-woodp-script', plugin_dir_url(__FILE__) . '../assets/js/plugin-install.js', array('jquery'), '2.4.0', true);
     207     wp_enqueue_script('digages-woodp-script_paystack_blocker', plugin_dir_url(__FILE__) . '../assets/js/paystack-blocker.js', array('jquery'), '2.4.1', true);
     208   
     209   
     210
     211        wp_enqueue_script('digages-woodp-script', plugin_dir_url(__FILE__) . '../assets/js/plugin-install.js', array('jquery'), '2.4.1', true);
    212212   
    213213        // Localize script for AJAX
     
    218218
    219219        // Enqueue Bootstrap CSS and JS
    220         wp_enqueue_style('digages-admin-direct-payments-currency', plugin_dir_url(__FILE__) . '../assets/css/currency-css.css', array(), '2.4.0', 'all'); 
     220        wp_enqueue_style('digages-admin-direct-payments-currency', plugin_dir_url(__FILE__) . '../assets/css/currency-css.css', array(), '2.4.1', 'all'); 
    221221       
    222222    }
     
    245245
    246246        // Enqueue Bootstrap CSS and JS
    247      wp_enqueue_script('digages-woodp-script_paystack_blocker', plugin_dir_url(__FILE__) . '../assets/js/paystack-blocker.js', array('jquery'), '2.4.0', true);
    248    
    249      wp_enqueue_style('digages-admin-woodp-removenotice', plugin_dir_url(__FILE__) . '../assets/css/removenotice.css', array(), '2.4.0', 'all');
    250 
    251      wp_enqueue_style('digages-admin-woodp-settingss', plugin_dir_url(__FILE__) . '../assets/css/settings.css', array(), '2.4.0', 'all');
     247     wp_enqueue_script('digages-woodp-script_paystack_blocker', plugin_dir_url(__FILE__) . '../assets/js/paystack-blocker.js', array('jquery'), '2.4.1', true);
     248   
     249     wp_enqueue_style('digages-admin-woodp-removenotice', plugin_dir_url(__FILE__) . '../assets/css/removenotice.css', array(), '2.4.1', 'all');
     250
     251     wp_enqueue_style('digages-admin-woodp-settingss', plugin_dir_url(__FILE__) . '../assets/css/settings.css', array(), '2.4.1', 'all');
    252252     
    253253        // Enqueue Bootstrap CSS and JS
    254         wp_enqueue_style('digages-admin-direct-payments-currency', plugin_dir_url(__FILE__) . '../assets/css/currency-css.css', array(), '2.4.0', 'all'); 
    255        
    256 
    257         // Enqueue Bootstrap CSS and JS
    258         wp_enqueue_style('digages-admin-direct-payments', plugin_dir_url(__FILE__) . '../assets/css/digages-direct-payments.css', array(), '2.4.0', 'all');
    259         wp_enqueue_style('bootstrap-css', plugin_dir_url(__FILE__) . '../assets/css/bootstrap.min.css', array(), '2.4.0', 'all');
    260         wp_enqueue_style('bootstrap-font', plugin_dir_url(__FILE__) . '../assets/css/bootstrap-icons.min.css', array(), '2.4.0', 'all');
     254        wp_enqueue_style('digages-admin-direct-payments-currency', plugin_dir_url(__FILE__) . '../assets/css/currency-css.css', array(), '2.4.1', 'all'); 
     255       
     256
     257        // Enqueue Bootstrap CSS and JS
     258        wp_enqueue_style('digages-admin-direct-payments', plugin_dir_url(__FILE__) . '../assets/css/digages-direct-payments.css', array(), '2.4.1', 'all');
     259        wp_enqueue_style('bootstrap-css', plugin_dir_url(__FILE__) . '../assets/css/bootstrap.min.css', array(), '2.4.1', 'all');
     260        wp_enqueue_style('bootstrap-font', plugin_dir_url(__FILE__) . '../assets/css/bootstrap-icons.min.css', array(), '2.4.1', 'all');
    261261        wp_enqueue_script('bootstrap-js', plugin_dir_url(__FILE__) . '../assets/js/bootstrap.bundle.min.js', array('jquery'), '5.2.4', true);
    262         wp_enqueue_style('icomoon-css', plugin_dir_url(__FILE__) . '../assets/css/icomoon.css', array(), '2.4.0', 'all');
     262        wp_enqueue_style('icomoon-css', plugin_dir_url(__FILE__) . '../assets/css/icomoon.css', array(), '2.4.1', 'all');
    263263       
    264264        // Enqueue popup CSS and JS
    265         wp_enqueue_style('digages-new-popup-css', plugin_dir_url(__FILE__) . '../assets/css/popup.css', array(), '2.4.0', 'all');
    266         wp_enqueue_script('digages-new-popup-js', plugin_dir_url(__FILE__) . '../assets/js/popup.js', array('jquery'), '2.4.0', true);
     265        wp_enqueue_style('digages-new-popup-css', plugin_dir_url(__FILE__) . '../assets/css/popup.css', array(), '2.4.1', 'all');
     266        wp_enqueue_script('digages-new-popup-js', plugin_dir_url(__FILE__) . '../assets/js/popup.js', array('jquery'), '2.4.1', true);
    267267       
    268268    wp_enqueue_script(
     
    270270        plugin_dir_url(__FILE__) . '../onboarding/assets/js/qrsele.js',
    271271        array('jquery'),
    272         '2.4.0',
     272        '2.4.1',
    273273        true
    274274    );
    275275
    276276
    277         wp_enqueue_style('digages-new-grid-css', plugin_dir_url(__FILE__) . '../assets/css/grid.css', array(), '2.4.0', 'all');
    278 
    279         wp_enqueue_script('digages-auto-all-select-js', plugin_dir_url(__FILE__) . '../assets/js/allselect.js', array('jquery'), '2.4.0', true);
    280    
    281      wp_enqueue_script('digages-woodp-script_check_proof', plugin_dir_url(__FILE__) . '../assets/js/check_proof.js', array('jquery'), '2.4.0', true);
    282    
    283    
    284 
    285         wp_enqueue_script('digages-woodp-script', plugin_dir_url(__FILE__) . '../assets/js/plugin-install.js', array('jquery'), '2.4.0', true);
     277        wp_enqueue_style('digages-new-grid-css', plugin_dir_url(__FILE__) . '../assets/css/grid.css', array(), '2.4.1', 'all');
     278
     279        wp_enqueue_script('digages-auto-all-select-js', plugin_dir_url(__FILE__) . '../assets/js/allselect.js', array('jquery'), '2.4.1', true);
     280   
     281     wp_enqueue_script('digages-woodp-script_check_proof', plugin_dir_url(__FILE__) . '../assets/js/check_proof.js', array('jquery'), '2.4.1', true);
     282   
     283   
     284
     285        wp_enqueue_script('digages-woodp-script', plugin_dir_url(__FILE__) . '../assets/js/plugin-install.js', array('jquery'), '2.4.1', true);
    286286   
    287287        // Localize script for AJAX
  • direct-payments-for-woocommerce/trunk/others.php

    r3437722 r3441283  
    9797function digages_upload_screenshot_and_update_order() {
    9898    // Check if the required POST parameters are set
    99     if (isset($_POST['order_id']) && isset($_POST['payment_method_title'])) {   
    100            
    101         check_ajax_referer('digages_send_p2p_confirmation', 'nonce');     
    102         // The uploaded file
    103         // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
    104         $uploaded_file = $_FILES['screenshot'] ?? null;
    105        
    106         // Sanitize the input data
    107         $order_id = intval($_POST['order_id']);
    108         $payment_method_title = isset($_POST['payment_method_title']) ? sanitize_text_field(wp_unslash($_POST['payment_method_title'])) : '';
    109         $Ord_status = digages_woodp_get_option( 'payment_sent', 'wc-on-hold' ); //get_option('digages_woodp_pending_payments', 'on-hold');   // "on-hold"
    110 
    111         // Load the WooCommerce order
    112         $order = wc_get_order($order_id);
    113 
    114        
    115     // CRITICAL: Verify the current user owns this order
    116     $current_user_id = get_current_user_id();
    117    
    118     // // For logged-in users
    119     // if ($current_user_id > 0) {
    120     //     if ($order->get_customer_id() != $current_user_id) {
    121     //         wp_send_json_error('Unauthorized access');
    122     //     }
    123     // }
    124 
    125         if ($order) {
    126             // Check if the status is valid before setting it
    127             if (!empty($Ord_status)) {
    128                 if (in_array('wc-' . $Ord_status, array_keys(wc_get_order_statuses()))) {
    129                     if ($order->get_status() !== $Ord_status) {
    130                         $order->set_status($Ord_status);
    131                     }
    132                 }
     99    if (!isset($_POST['order_id']) || !isset($_POST['payment_method_title'])) {
     100        wp_send_json_error('Missing order ID or payment method title');
     101        return;
     102    }
     103   
     104    check_ajax_referer('digages_send_p2p_confirmation', 'nonce');
     105   
     106    // Sanitize the input data
     107    $order_id = intval($_POST['order_id']);
     108    $payment_method_title = sanitize_text_field(wp_unslash($_POST['payment_method_title']));
     109    $Ord_status = digages_woodp_get_option('payment_sent', 'wc-on-hold');
     110   
     111    // Load the WooCommerce order
     112    $order = wc_get_order($order_id);
     113   
     114    if (!$order) {
     115        wp_send_json_error('Order not found');
     116        return;
     117    }
     118   
     119    // Check if the status is valid before setting it
     120    if (!empty($Ord_status)) {
     121        $valid_statuses = array_keys(wc_get_order_statuses());
     122        $status_with_prefix = 'wc-' . $Ord_status;
     123       
     124        if (in_array($status_with_prefix, $valid_statuses)) {
     125            if ($order->get_status() !== $Ord_status) {
     126                $order->set_status($Ord_status);
    133127            }
    134 
    135             // Update the payment method title
    136             $order->set_payment_method_title($payment_method_title);
    137 
    138             // Handle the file upload
    139 if ($uploaded_file) {
     128        }
     129    }
     130   
     131    // Update the payment method title
     132    $order->set_payment_method_title($payment_method_title);
     133   
     134    // Handle the file upload
     135    $uploaded_file = isset($_FILES['screenshot']) ? $_FILES['screenshot'] : null;
     136   
     137    if (!$uploaded_file || !isset($uploaded_file['name']) || empty($uploaded_file['name'])) {
     138        wp_send_json_error('No file uploaded or an error occurred.');
     139        return;
     140    }
     141   
    140142    // Sanitize the file name
    141143    $file_name = sanitize_file_name($uploaded_file['name']);
    142144    $uploaded_file['name'] = $file_name;
    143 
     145   
    144146    // Allowed file types
    145147    $allowed_file_types = ['jpg', 'jpeg', 'png', 'webp', 'pdf'];
    146 
     148   
    147149    // Validate the file type
    148     $file_type = wp_check_filetype($file_name);
    149 
    150     if (in_array($file_type['ext'], $allowed_file_types)) {
    151         // Upload the file to the WordPress uploads directory
    152         require_once(ABSPATH . 'wp-admin/includes/file.php');
    153         require_once(ABSPATH . 'wp-admin/includes/image.php');
    154         require_once(ABSPATH . 'wp-admin/includes/media.php');
    155        
    156         $uploaded = wp_handle_upload($uploaded_file, ['test_form' => false]);
    157 
    158         if (!isset($uploaded['error']) && isset($uploaded['url'])) {
    159             // File was uploaded successfully, now add it to the Media Library
    160             $file_path = $uploaded['file'];
    161             $file_url = $uploaded['url'];
    162            
    163             // Prepare attachment data
    164             $wp_filetype = wp_check_filetype(basename($file_path), null);
    165             $attachment = array(
    166                 'guid' => $file_url,
    167                 'post_mime_type' => $wp_filetype['type'],
    168                 'post_title' => sanitize_file_name(basename($file_path)),
    169                 'post_content' => '',
    170                 'post_status' => 'inherit',
    171             );
    172            
    173             // Insert the attachment into the database
    174             $attachment_id = wp_insert_attachment($attachment, $file_path, $order_id);
    175            
    176             // Generate and update attachment metadata
    177             if (!is_wp_error($attachment_id)) {
    178                 $attachment_metadata = wp_generate_attachment_metadata($attachment_id, $file_path);
    179                 wp_update_attachment_metadata($attachment_id, $attachment_metadata);
    180                
    181                 // Check if metadata exists for '_screenshot_file'
    182                 if (metadata_exists('post', $order_id, '_screenshot_file')) {
    183                     // Update existing metadata
    184                     update_post_meta($order_id, '_screenshot_file', $file_url);
    185                 } else {
    186                     // Add new metadata
    187                     add_post_meta($order_id, '_screenshot_file', $file_url, true); // 'true' ensures it's unique
    188                 }
    189             }
    190         } else {
    191             // File upload failed
    192             wp_send_json_error('File upload failed: ' . $uploaded['error']);
    193         }
    194     } else {
    195         // Invalid file type
    196         wp_send_json_error('Invalid file type. Please upload a valid file (jpg, jpeg, png, gif, pdf).');
    197     }
    198 } else {
    199     wp_send_json_error('No file uploaded or an error occurred.');
    200 }
    201 
    202             // Save the updated order
    203             $order->save();
    204 
    205             // Prepare the response with a redirect URL
    206             $order_key = $order->get_order_key();
    207             $checkout_url = wc_get_page_permalink('checkout');
    208             $redirect_url = $checkout_url . '/order-received/' . $order_id . '/?key=' . $order_key;
    209 
    210             // Send a success response with the redirect URL
    211             wp_send_json_success(array(
    212                 'redirect' => $redirect_url
    213             ));
    214         } else {
    215             // Order not found
    216             wp_send_json_error('Order not found');
    217         }
    218     } else {
    219         // Missing required parameters
    220         wp_send_json_error('Missing order ID or payment method title');
    221     }
    222 }
    223 
     150    $file_type = wp_check_filetype($file_name);
     151   
     152    if (!in_array($file_type['ext'], $allowed_file_types)) {
     153        wp_send_json_error('Invalid file type. Please upload a valid file (jpg, jpeg, png, webp, pdf).');
     154        return;
     155    }
     156   
     157    // Upload the file to the WordPress uploads directory
     158    require_once(ABSPATH . 'wp-admin/includes/file.php');
     159    require_once(ABSPATH . 'wp-admin/includes/image.php');
     160    require_once(ABSPATH . 'wp-admin/includes/media.php');
     161   
     162    $uploaded = wp_handle_upload($uploaded_file, ['test_form' => false]);
     163   
     164    if (isset($uploaded['error'])) {
     165        wp_send_json_error('File upload failed: ' . $uploaded['error']);
     166        return;
     167    }
     168   
     169    if (!isset($uploaded['url']) || !isset($uploaded['file'])) {
     170        wp_send_json_error('File upload failed: Missing file data');
     171        return;
     172    }
     173   
     174    // File was uploaded successfully
     175    $file_path = $uploaded['file'];
     176    $file_url = $uploaded['url'];
     177   
     178    // Prepare attachment data
     179    $wp_filetype = wp_check_filetype(basename($file_path), null);
     180    $attachment = array(
     181        'guid'           => $file_url,
     182        'post_mime_type' => $wp_filetype['type'],
     183        'post_title'     => sanitize_file_name(basename($file_path)),
     184        'post_content'   => '',
     185        'post_status'    => 'inherit',
     186    );
     187   
     188    // Insert the attachment into the database
     189    $attachment_id = wp_insert_attachment($attachment, $file_path, $order_id);
     190   
     191    if (is_wp_error($attachment_id)) {
     192        wp_send_json_error('Failed to create attachment: ' . $attachment_id->get_error_message());
     193        return;
     194    }
     195   
     196    // Generate and update attachment metadata
     197    $attachment_metadata = wp_generate_attachment_metadata($attachment_id, $file_path);
     198    wp_update_attachment_metadata($attachment_id, $attachment_metadata);
     199   
     200    // CRITICAL: Save meta data using BOTH methods for maximum compatibility
     201    // Method 1: WooCommerce CRUD (preferred)
     202    $order->update_meta_data('_screenshot_file', $file_url);
     203    $order->update_meta_data('_screenshot_attachment_id', $attachment_id);
     204    $order->save();
     205   
     206    // Method 2: Direct database write (fallback for servers with caching issues)
     207    update_post_meta($order_id, '_screenshot_file', $file_url);
     208    update_post_meta($order_id, '_screenshot_attachment_id', $attachment_id);
     209   
     210    // Prepare the response with a redirect URL
     211    $order_key = $order->get_order_key();
     212    $checkout_url = wc_get_page_permalink('checkout');
     213    $redirect_url = $checkout_url . '/order-received/' . $order_id . '/?key=' . $order_key;
     214   
     215    // Send a success response with the redirect URL
     216    wp_send_json_success(array(
     217        'redirect' => $redirect_url
     218    ));
     219}
    224220//Do action when screenshot is skipped
     221
     222
    225223
    226224
  • direct-payments-for-woocommerce/trunk/readme.txt

    r3437722 r3441283  
    44Requires at least: 5.0
    55Tested up to: 6.8
    6 Stable tag: 2.4.0
     6Stable tag: 2.4.1
    77Requires PHP: 7.0
    88License: GPLv2 or later
     
    131131== Changelog ==
    132132
    133 = 2.4.0 =
     133= 2.4.1 =
     134* Improved: Minor update.
     135
     136= 2.4.1 =
    134137* Added: Workflow settings tab.
    135138* Added: WadSow AI option to general settings.
     
    283286
    284287== Upgrade Notice ==
    285 = 2.4.0 =
     288= 2.4.1 =
    286289Upgrade to the latest version for unlimited payment methods, instant payment alerts, and email confirmations.
    287290
Note: See TracChangeset for help on using the changeset viewer.