PluginProbe
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder / 3.3.1
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder v3.3.1
3.3.1 V-3.3.0 3.2.2 3.2.1 3.2.0 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 V3.0.3 V3.0.2 -3.0.1 V_3.0.0 1.1.1 1.1.8 1.2 1.3 1.4 1.4.18 1.5.2 1.9 2.0 2.10.0 2.10.1 All 138 releases
← All changes | includes/Core/Integration/MailPoet/MailPoetHandler.php +17 -8 2.10.03.3.1 View file →
@@ -6,8 +6,12 @@
6 6 */
7 7
8 8 namespace BitCode\BitForm\Core\Integration\MailPoet;
9 9
10 +if (!defined('ABSPATH')) {
11 + exit;
12 +}
13 +
10 14 use BitCode\BitForm\Core\Integration\IntegrationHandler;
11 15 use WP_Error;
12 16
13 17 /**
@@ -12,15 +16,19 @@
12 16
13 17 /**
14 18 * Provide functionality for ZohoCrm integration
15 19 */
16 -class MailpoetHandler
20 +class MailPoetHandler
17 21 {
18 22 private $_integrationID;
19 23
24 + private $formId;
25 +
20 26 public function __construct($integrationID, $fromID)
21 27 {
22 28 $this->_integrationID = $integrationID;
29 +
30 + $this->formId = $fromID;
23 31 }
24 32
25 33 /**
26 34 * Helps to register ajax function's with wp
@@ -40,9 +48,9 @@
40 48 * @return string zoho crm api response and status
41 49 */
42 50 public static function mailPoetAuthorize()
43 51 {
44 - if (isset($_REQUEST['_ajax_nonce']) && wp_verify_nonce($_REQUEST['_ajax_nonce'], 'bitforms_save')) {
52 + if (isset($_REQUEST['_ajax_nonce']) && wp_verify_nonce(sanitize_text_field(wp_unslash($_REQUEST['_ajax_nonce'])), 'bitforms_save')) {
45 53 if (class_exists(\MailPoet\API\API::class)) {
46 54 wp_send_json_success(true);
47 55 } else {
48 56 wp_send_json_error(
@@ -66,14 +74,14 @@
66 74
67 75 /**
68 76 * Process ajax request for refresh crm modules
69 77 *
70 - * @return JSON crm module data
78 + * @return string JSON crm module data
71 79 */
72 80 public static function refreshNeswLetter()
73 81 {
74 82 $response = null;
75 - if (isset($_REQUEST['_ajax_nonce']) && wp_verify_nonce($_REQUEST['_ajax_nonce'], 'bitforms_save')) {
83 + if (isset($_REQUEST['_ajax_nonce']) && wp_verify_nonce(sanitize_text_field(wp_unslash($_REQUEST['_ajax_nonce'])), 'bitforms_save')) {
76 84 if (class_exists(\MailPoet\API\API::class)) {
77 85 $mailpoet_api = \MailPoet\API\API::MP('v1');
78 86 $newsletterList = $mailpoet_api->getLists();
79 87
@@ -89,9 +97,9 @@
89 97 wp_send_json_success($response, 200);
90 98 } else {
91 99 wp_send_json_error(
92 100 __(
93 - 'Please! Insatall MailPoet',
101 + 'Please! Install MailPoet',
94 102 'bit-form'
95 103 ),
96 104 400
97 105 );
@@ -109,9 +117,9 @@
109 117
110 118 public static function mailPoetListHeaders()
111 119 {
112 120 $response = null;
113 - if (isset($_REQUEST['_ajax_nonce']) && wp_verify_nonce($_REQUEST['_ajax_nonce'], 'bitforms_save')) {
121 + if (isset($_REQUEST['_ajax_nonce']) && wp_verify_nonce(sanitize_text_field(wp_unslash($_REQUEST['_ajax_nonce'])), 'bitforms_save')) {
114 122 if (class_exists(\MailPoet\API\API::class)) {
115 123 $mailpoet_api = \MailPoet\API\API::MP('v1');
116 124 $subscriber_form_fields = $mailpoet_api->getSubscriberFields();
117 125
@@ -161,9 +169,10 @@
161 169
162 170 $maiPoetApiResponse = $recordApiHelper->executeRecordApi(
163 171 $fieldValues,
164 172 $fieldMap,
165 - $lists
173 + $lists,
174 + $this->formId,
166 175 );
167 176
168 177 if (is_wp_error($maiPoetApiResponse)) {
169 178 return $maiPoetApiResponse;
@@ -169,5 +178,5 @@
169 178 return $maiPoetApiResponse;
170 179 }
171 180 return $maiPoetApiResponse;
172 181 }
173 -}
182 +}