Plugin Directory

Changeset 3437431


Ignore:
Timestamp:
01/12/2026 07:41:22 AM (3 months ago)
Author:
bucksbuspay
Message:

Bug fixes

Location:
bucksbus/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • bucksbus/trunk/README.txt

    r3428871 r3437431  
    55Requires at least: 6.0
    66Tested up to: 6.9
    7 Stable tag: 1.2.3
     7Stable tag: 1.2.4
    88Requires PHP: 7.4
    99License: GPLv2 or later
     
    8383== Changelog ==
    8484
     85= 1.2.4 =
     86* Bug fixes
     87
    8588= 1.2.3 =
    8689* Bug fixes
  • bucksbus/trunk/bucksbus.php

    r3428867 r3437431  
    44 * Plugin Name: BucksBus
    55 * Description: Adds BucksBus to your WooCommerce website.
    6  * Version: 1.2.3
     6 * Version: 1.2.4
    77 *
    88 * Author: BucksBus
     
    1212 * Domain Path: /languages
    1313 *
    14  * Copyright: © 2025 BucksBus.
     14 * Copyright: © 2026 BucksBus.
    1515 * License: GPL v2 or later
    1616 * License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3434            'name' => 'Banxa',
    3535            'code' => 'cbanxa'
    36         ),
    37         array(
    38             'name' => 'Guardarian',
    39             'code' => 'guardarian'
    4036        ),
    4137        array(
  • bucksbus/trunk/includes/class-wc-gateway-bucksbus-handler.php

    r3298100 r3437431  
    4343        // Actions.
    4444        add_action('woocommerce_api_wc_gateway_bucksbus',  array($this, 'handle_webhook'));
     45        add_action('template_redirect',  array($this, 'handle_no_referrer_redirect'));
    4546    }
    4647
     
    9697        wp_die('Invalid webhook', 'BucksBus Webhook', array('response' => 401));
    9798    }
     99
     100
     101public function handle_no_referrer_redirect() {
     102
     103    if ( empty( $_GET['wc-noref'] ) || empty( $_GET['to'] ) ) {
     104        return;
     105    }
     106
     107    $target = esc_url_raw( urldecode( $_GET['to'] ) );
     108
     109    if ( ! $target ) {
     110        wp_die( 'Invalid redirect' );
     111    }
     112
     113    header( 'Referrer-Policy: no-referrer' );
     114    header( 'Content-Type: text/html; charset=utf-8' );
     115
     116    printf(
     117        '<!doctype html>
     118<html>
     119<head>
     120    <meta charset="utf-8">
     121    <title>Redirecting…</title>
     122</head>
     123<body>
     124    <script>
     125        window.location.replace(%s);
     126    </script>
     127    <noscript>
     128        <meta http-equiv="refresh" content="0;url=%s">
     129    </noscript>
     130</body>
     131</html>',
     132        wp_json_encode( $target ),
     133        esc_attr( $target )
     134    );
     135
     136    exit;
     137}
     138
    98139}
    99140
  • bucksbus/trunk/includes/class-wc-gateway-bucksbus-provider-base.php

    r3298100 r3437431  
    297297        $order->save();
    298298
    299 
    300         return array(
    301             'result'   => 'success',
    302             'redirect' => $payment['fiat_payment_url'],
    303         );
     299        return [
     300                'result'   => 'success',
     301                'redirect' => add_query_arg(
     302                    [
     303                        'wc-noref' => 1,
     304                        'to'       => rawurlencode( $payment['fiat_payment_url'] ),
     305                    ],
     306                    home_url( '/' )
     307                ),
     308            ];
    304309    }
    305310
Note: See TracChangeset for help on using the changeset viewer.