<?php

/*
 * ==========================================================
 * WORDPRESS APP
 * ==========================================================
 *
 * WordPress app main file. � 2022-2024 cryptopayment.network. All rights reserved.
 *
 */

if ( ! defined( 'ABSPATH' ) ) exit;

if ( ! defined( 'CRPAY_WP' ) ) {
    define( 'CRPAY_WP', true );
}

if ( isset( $_GET['crpay_error'] ) ) {
    // Sanitize nonce before verifying
    $nonce = isset( $_GET['_wpnonce'] ) ? sanitize_text_field( wp_unslash( $_GET['_wpnonce'] ) ) : '';

    // Verify the nonce for the 'crpay_error' action
    if ( ! wp_verify_nonce( $nonce, 'crpay_error_nonce' ) ) {
        // Escaped error message for security
        wp_die(
            esc_html__( 'Error! Payment page not found. Create a new WordPress page and insert the shortcode [crpay-cryptopayment-pay] into it. Enter the URL of the page in Cryptopayment > Settings > WordPress > Payment page URL and save.', 'cryptopayment-gateway' )
        );
    }
}


?>