diff --git a/Lib/Appsero/License.php b/Lib/Appsero/License.php index e72ceb765..65e769d8f 100644 --- a/Lib/Appsero/License.php +++ b/Lib/Appsero/License.php @@ -272,7 +272,7 @@ public function menu_output() {

- client->__trans( 'Activate %s by your license key to get professional support and automatic update from your WordPress dashboard.' ) ), $this->client->name ); ?> + client->__trans( 'Activate %s by your license key to get professional support and automatic update from your WordPress dashboard.' ) ), esc_html( $this->client->name ) ); ?>

diff --git a/Lib/Gateway/Bank.php b/Lib/Gateway/Bank.php index 0dd6eaaaa..814b24c7e 100644 --- a/Lib/Gateway/Bank.php +++ b/Lib/Gateway/Bank.php @@ -124,6 +124,7 @@ public function order_notify_user( $transaction, $order_id ) { $msg = sprintf( // translators: %s is displayname __( 'Hello %s,', 'wp-user-frontend' ), $user->display_name ) . "\r\n"; + // translators: %s is the payment amount $msg .= sprintf( __( 'We have received your payment amount of %s through bank . ', 'wp-user-frontend' ), $transaction['cost'] ) . "\r\n\r\n"; $msg .= __( 'Thanks for being with us.', 'wp-user-frontend' ) . "\r\n"; diff --git a/Lib/Gateway/Paypal.php b/Lib/Gateway/Paypal.php index 63256e04d..eb89d4ec2 100644 --- a/Lib/Gateway/Paypal.php +++ b/Lib/Gateway/Paypal.php @@ -129,7 +129,7 @@ public function paypal_settings_update_notice() { type: 'POST', data: { action: 'wpuf_dismiss_paypal_notice', - nonce: '' + nonce: '' }, success: function(response) { // Handle success if needed @@ -465,7 +465,7 @@ public function handle_webhook_request() { $acknowledged = true; } catch ( \Exception $e ) { - throw new \Exception( 'Webhook processing failed: ' . $e->getMessage() ); + throw new \Exception( 'Webhook processing failed: ' . esc_html( $e->getMessage() ) ); } // Always acknowledge to PayPal @@ -1522,7 +1522,7 @@ function( $hosts ) { exit(); } } catch ( \Exception $e ) { - wp_die( $e->getMessage() ); + wp_die( esc_html( $e->getMessage() ) ); } } @@ -2066,7 +2066,7 @@ private function handle_subscription_activated( $subscription ) { } } } catch ( \Exception $e ) { - throw new \Exception( 'Error handling subscription activation: ' . $e->getMessage() ); + throw new \Exception( 'Error handling subscription activation: ' . esc_html( $e->getMessage() ) ); } } } diff --git a/Lib/invisible_recaptcha.php b/Lib/invisible_recaptcha.php index a59784041..f200ef644 100644 --- a/Lib/invisible_recaptcha.php +++ b/Lib/invisible_recaptcha.php @@ -24,7 +24,7 @@ public function __construct( $site_key, $secret_key ){ if ( $secret_key == null || $secret_key == "" ) { die("To use reCAPTCHA you must get an API key from " . self::$_signupUrl . ""); + . esc_url( self::$_signupUrl ) . "'>" . esc_html( self::$_signupUrl ) . ""); } $this->config = array( 'client-key' => $site_key, diff --git a/Lib/recaptchalib.php b/Lib/recaptchalib.php index 1c83263a9..143b895ce 100644 --- a/Lib/recaptchalib.php +++ b/Lib/recaptchalib.php @@ -122,9 +122,27 @@ function recaptcha_get_html ($pubkey, $enable_no_captcha = false, $error = null, if ( $enable_no_captcha == true ) { - $return_var = '
'; + wp_enqueue_script( 'wpuf-recaptcha', 'https://www.google.com/recaptcha/api.js', array(), null, true ); + $return_var = '
'; } else { - $return_var = ''; + wp_enqueue_script( 'wpuf-recaptcha-legacy', $server . '/challenge?k=' . $pubkey . $errorpart, array(), null, true ); + $container_id = 'wpuf-recaptcha-legacy-' . uniqid(); + $return_var = '
+'; } return $return_var.' diff --git a/Lib/recaptchalib_noCaptcha.php b/Lib/recaptchalib_noCaptcha.php index 07c67c77c..cf7c31ac1 100644 --- a/Lib/recaptchalib_noCaptcha.php +++ b/Lib/recaptchalib_noCaptcha.php @@ -58,7 +58,7 @@ function __construct($secret) { if ($secret == null || $secret == "") { die("To use reCAPTCHA you must get an API key from " . self::$_signupUrl . ""); + . esc_url( self::$_signupUrl ) . "'>" . esc_html( self::$_signupUrl ) . ""); } $this->_secret=$secret; } @@ -95,35 +95,27 @@ private function _submitHTTPGet($path, $data) $req = $this->_encodeQS($data); $url = $path . $req; - // Use curl if possible because allow_url_fopen is off in many - // environments, making file_get_contents fail. - if (function_exists('curl_init')) { - $response = $this->_curl($url); - } else { - $response = file_get_contents($url); + // Use WordPress HTTP API instead of cURL + $response = wp_remote_get($url, array( + 'timeout' => 3, + 'sslverify' => true + )); + + if (is_wp_error($response)) { + return false; + } + + $response_code = wp_remote_retrieve_response_code($response); + $response_body = wp_remote_retrieve_body($response); + + // Return false for non-200 responses or empty bodies + if ($response_code !== 200 || empty($response_body)) { + return false; } - return $response; + + return $response_body; } - private function _curl($url) - { - // Initiate curl. - $c = curl_init(); - // Set timeout. - $timeout = 3; - curl_setopt($c, CURLOPT_CONNECTTIMEOUT, $timeout); - curl_setopt($c, CURLOPT_RETURNTRANSFER, TRUE); - // Set url for call. - curl_setopt($c, CURLOPT_URL, $url); - - // Execute curl call. - $response = curl_exec($c); - - // Close curl. - curl_close($c); - - return $response; - } /** * Calls the reCAPTCHA siteverify API to verify whether the user passes diff --git a/admin/form-builder/assets/js/components/builder-stage-v4-1/template.php b/admin/form-builder/assets/js/components/builder-stage-v4-1/template.php index 0399eeaff..c10282235 100644 --- a/admin/form-builder/assets/js/components/builder-stage-v4-1/template.php +++ b/admin/form-builder/assets/js/components/builder-stage-v4-1/template.php @@ -1,6 +1,6 @@
- +

@@ -49,7 +49,7 @@ class="wpuf-relative"
@@ -111,7 +111,7 @@ class="fa fa-clone control-button-disabled wpuf--ml-1"> :href="pro_link" target="_blank" class="wpuf-rounded-r-md hover:wpuf-bg-slate-500 hover:wpuf-cursor-pointer wpuf-transition wpuf-duration-150 wpuf-ease-out hover:wpuf-transition-all"> - +
diff --git a/admin/form-builder/assets/js/components/field-option-pro-feature-alert/template.php b/admin/form-builder/assets/js/components/field-option-pro-feature-alert/template.php index 30f167af1..25f5c4ae6 100644 --- a/admin/form-builder/assets/js/components/field-option-pro-feature-alert/template.php +++ b/admin/form-builder/assets/js/components/field-option-pro-feature-alert/template.php @@ -3,6 +3,6 @@ diff --git a/admin/form-builder/assets/js/components/field-visibility/template.php b/admin/form-builder/assets/js/components/field-visibility/template.php index 5c62f4ce9..b69f583f0 100644 --- a/admin/form-builder/assets/js/components/field-visibility/template.php +++ b/admin/form-builder/assets/js/components/field-visibility/template.php @@ -81,7 +81,7 @@ class="wpuf-block wpuf-my-1 wpuf-mr-2 wpuf-font-medium wpuf-text-gray-900"> $partially_filtered = preg_replace('/(]+)/', '$1 ' . $attr, $partially_filtered, 1); } - echo $partially_filtered; + echo esc_html( $partially_filtered ); } ?> @@ -129,7 +129,7 @@ class="wpuf-block wpuf-my-1 wpuf-mr-2 wpuf-font-medium wpuf-text-gray-900"> $partially_filtered = preg_replace('/(]+)/', '$1 ' . $attr, $partially_filtered, 1); } - echo $partially_filtered; + echo esc_html( $partially_filtered ); } } else { esc_html_e( 'No subscription plan found.', 'wp-user-frontend' ); diff --git a/admin/form-builder/assets/js/components/form-column_field/template.php b/admin/form-builder/assets/js/components/form-column_field/template.php index 0a499cc0b..63fdef2f6 100644 --- a/admin/form-builder/assets/js/components/form-column_field/template.php +++ b/admin/form-builder/assets/js/components/form-column_field/template.php @@ -105,7 +105,7 @@ class="hover:wpuf-bg-green-700"> :href="pro_link" target="_blank" class="wpuf-rounded-r-md hover:wpuf-bg-slate-500 hover:wpuf-cursor-pointer wpuf-transition wpuf-duration-150 wpuf-ease-out hover:wpuf-transition-all"> - + diff --git a/admin/form-builder/assets/js/components/form-fields-v4-1/template.php b/admin/form-builder/assets/js/components/form-fields-v4-1/template.php index a1f9bd188..0b6d8f5e3 100644 --- a/admin/form-builder/assets/js/components/form-fields-v4-1/template.php +++ b/admin/form-builder/assets/js/components/form-fields-v4-1/template.php @@ -73,7 +73,7 @@ class="wpuf-shrink-0 wpuf-mr-2 wpuf-text-gray-400">
- +
- WPUF Icon + WPUF Icon