From bd4fd5671f6e2b78874acd00052ca380cb9d5bf7 Mon Sep 17 00:00:00 2001 From: arifulhoque7 Date: Fri, 26 Sep 2025 15:41:37 +0600 Subject: [PATCH 1/3] fix: bugfix/pcp-issues-sept-2025 --- Lib/Appsero/License.php | 2 +- Lib/Gateway/Bank.php | 1 + Lib/Gateway/Paypal.php | 8 +- Lib/invisible_recaptcha.php | 2 +- Lib/recaptchalib.php | 6 +- Lib/recaptchalib_noCaptcha.php | 38 ++--- .../builder-stage-v4-1/template.php | 6 +- .../template.php | 2 +- .../components/field-visibility/template.php | 4 +- .../components/form-column_field/template.php | 2 +- .../components/form-fields-v4-1/template.php | 2 +- .../form-builder/views/form-builder-v4.1.php | 7 +- .../form-builder/views/post-form-settings.php | 152 +++++++++--------- assets/js-templates/form-components.php | 16 +- class/render-form.php | 2 +- class/subscription.php | 8 +- includes/Admin/Forms/Admin_Form.php | 24 ++- includes/Admin/Forms/Admin_Form_Builder.php | 6 +- includes/Admin/List_Table_Subscribers.php | 71 +++++--- includes/Admin/Subscription.php | 54 +++---- includes/Admin/template-parts/modal-v4.1.php | 5 +- includes/Admin/template-parts/modal-v4.2.php | 1 + includes/Admin/views/need-to-update.php | 2 +- includes/Ajax/Admin_Form_Builder_Ajax.php | 3 +- includes/Fields/Form_Field_Post_Tags.php | 2 +- includes/Fields/Form_Field_reCaptcha.php | 4 +- includes/Fields/Form_Pro_Upgrade_Fields.php | 2 +- includes/Frontend/Payment.php | 19 ++- includes/Frontend_Render_Form.php | 4 +- .../Compatibility/TEC_V6_Compatibility.php | 4 +- .../Templates/Event_Form_Template.php | 3 +- .../Validators/Date_Validator.php | 10 +- .../Validators/Event_Validator.php | 30 ++-- .../Integrations/TEC_Venue_Organizer_Fix.php | 2 +- includes/Render_Form.php | 6 +- readme.txt | 2 +- 36 files changed, 281 insertions(+), 231 deletions(-) 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..2ce98518d 100644 --- a/Lib/recaptchalib.php +++ b/Lib/recaptchalib.php @@ -122,9 +122,11 @@ 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 ); + $return_var = ''; } return $return_var.' diff --git a/Lib/recaptchalib_noCaptcha.php b/Lib/recaptchalib_noCaptcha.php index 07c67c77c..c353258ea 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,19 @@ 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' => false + )); + + if (is_wp_error($response)) { + return false; } - return $response; + + return wp_remote_retrieve_body($response); } - 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