Easy Forms for MailChimp - Version 6.3.18

Version Description

Download this release

Release Info

Developer yikesitskevin
Plugin Icon 128x128 Easy Forms for MailChimp
Version 6.3.18
Comparing to
See all releases

Code changes from version 6.3.17 to 6.3.18

public/classes/checkbox-integrations.php CHANGED
@@ -176,6 +176,16 @@
176
  $data['interests'] = $groups;
177
  }
178
 
 
 
 
 
 
 
 
 
 
 
179
  // Subscribe the user to the list via the API.
180
  $response = yikes_get_mc_api_manager()->get_list_handler()->member_subscribe( $list_id, $id, $data );
181
  if ( is_wp_error( $response ) ) {
176
  $data['interests'] = $groups;
177
  }
178
 
179
+ /**
180
+ * 'yikes-mailchimp-checkbox-integration-body'
181
+ *
182
+ * Filter the request body for a MailChimp subscription via the checkbox integrations
183
+ *
184
+ * @param array | $data | The request body
185
+ * @param string | $type | The integration type, e.g. 'contact_form_7'
186
+ */
187
+ $data = apply_filters( 'yikes-mailchimp-checkbox-integration-body', $data, $type );
188
+
189
  // Subscribe the user to the list via the API.
190
  $response = yikes_get_mc_api_manager()->get_list_handler()->member_subscribe( $list_id, $id, $data );
191
  if ( is_wp_error( $response ) ) {
public/classes/process/class.process_form_submission_handler.php CHANGED
@@ -814,7 +814,20 @@ class Yikes_Inc_Easy_MailChimp_Extender_Process_Submission_Handler {
814
 
815
  // Loop through the data and check if any are empty
816
  foreach( $value as $field => $val ) {
817
- if ( empty( $val ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
818
  $field_is_missing = true;
819
 
820
  // Set the merge label (e.g. MMERGE6) as the key so we don't get the same field multiple times
814
 
815
  // Loop through the data and check if any are empty
816
  foreach( $value as $field => $val ) {
817
+
818
+ /**
819
+ * 'yikes-mailchimp-ignore-required-array-field'
820
+ *
821
+ * Filter the default array of fields we're ignoring. As of now, this is only for address fields because no other field is an array.
822
+ *
823
+ * @param array | Array of fields to ignore. Key of the array should be the field name.
824
+ * @param int | $form_id
825
+ *
826
+ * @return Array of fields to ignore.
827
+ */
828
+ $ignored_fields = apply_filters( 'yikes-mailchimp-ignore-required-array-field', array( 'addr2' => true ), $this->form_id );
829
+
830
+ if ( empty( $val ) && ! isset( $ignored_fields[ $field ] ) ) {
831
  $field_is_missing = true;
832
 
833
  // Set the merge label (e.g. MMERGE6) as the key so we don't get the same field multiple times
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://yikesplugins.com/?utm_source=wp_plugin_repo&utm_medium=dona
4
  Tags: MailChimp, MailChimp forms, MailChimp lists, opt-in forms, sign up form, MailChimp, email, forms, mailing lists, marketing, newsletter, sign up
5
  Requires at least: 4.0
6
  Tested up to: 4.7.4
7
- Stable tag: 6.3.17
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -237,6 +237,9 @@ Below you'll find a complete list of the hooks and filters available in Easy For
237
  * 6.3.15:
238
  * `yikes-mailchimp-{$merge_tag}-description-html` - Filter the full block of HTML that will be used for the form field's description. @params: $description_full, $description_text, $form_id
239
  * `yikes-mailchimp-{$interest_group_id}-description-html` - Filter the full block of HTML that will be used for the interest group field's description. @params: $description_full, $description_text, $form_id
 
 
 
240
 
241
  **Actions**
242
 
@@ -260,6 +263,10 @@ Below you'll find a complete list of the hooks and filters available in Easy For
260
 
261
  == Changelog ==
262
 
 
 
 
 
263
  = Easy Forms for MailChimp 6.3.17 - May 1st, 2017 =
264
  * Added a quick fix for the Addon Settings list
265
 
4
  Tags: MailChimp, MailChimp forms, MailChimp lists, opt-in forms, sign up form, MailChimp, email, forms, mailing lists, marketing, newsletter, sign up
5
  Requires at least: 4.0
6
  Tested up to: 4.7.4
7
+ Stable tag: 6.3.18
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
237
  * 6.3.15:
238
  * `yikes-mailchimp-{$merge_tag}-description-html` - Filter the full block of HTML that will be used for the form field's description. @params: $description_full, $description_text, $form_id
239
  * `yikes-mailchimp-{$interest_group_id}-description-html` - Filter the full block of HTML that will be used for the interest group field's description. @params: $description_full, $description_text, $form_id
240
+ * 6.3.18:
241
+ * `yikes-mailchimp-checkbox-integration-body` - Filter the full request body of a checkbox integration subscribe API call. @params: $data, $type
242
+ * `yikes-mailchimp-ignore-required-array-field` - For server side validation, filter the required/unrequired fields. Due to the way MailChimp requires addresses, this is only useful for address 2 at the moment. @params: $non_required_fields, $form_id
243
 
244
  **Actions**
245
 
263
 
264
  == Changelog ==
265
 
266
+ = Easy Forms for MailChimp 6.3.18 - May 3rd, 2017 =
267
+ * Added a filter, `yikes-mailchimp-checkbox-integration-body`, for the checkbox integrations. You can now filter the entire request body before it's sent to MailChimp.
268
+ * Fixed up the code that was requiring address 2. By default, the address 2 field will never be required (can be changed with filters `yikes-mailchimp-address-2-required` and `yikes-mailchimp-ignore-required-array-field`).
269
+
270
  = Easy Forms for MailChimp 6.3.17 - May 1st, 2017 =
271
  * Added a quick fix for the Addon Settings list
272
 
yikes-inc-easy-mailchimp-extender.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Easy Forms for MailChimp
4
  * Plugin URI: https://yikesplugins.com/plugin/easy-forms-for-mailchimp/
5
  * Description: The ultimate MailChimp WordPress plugin. Easily build <strong>unlimited forms for your MailChimp lists</strong>, add them to your site and track subscriber activity. To get started, go to the settings page and enter your <a href="https://yikesplugins.com/support/knowledge-base/finding-your-mailchimp-api-key/" target="_blank">MailChimp API key</a>.
6
- * Version: 6.3.17
7
  * Author: YIKES, Inc.
8
  * Author URI: https://www.yikesplugins.com/
9
  * License: GPL-3.0+
@@ -42,7 +42,7 @@ if ( ! defined( 'WPINC' ) ) {
42
  * @since 6.1.3
43
  */
44
  if ( ! defined( 'YIKES_MC_VERSION' ) ) {
45
- define( 'YIKES_MC_VERSION' , '6.3.17' );
46
  }
47
 
48
  /**
3
  * Plugin Name: Easy Forms for MailChimp
4
  * Plugin URI: https://yikesplugins.com/plugin/easy-forms-for-mailchimp/
5
  * Description: The ultimate MailChimp WordPress plugin. Easily build <strong>unlimited forms for your MailChimp lists</strong>, add them to your site and track subscriber activity. To get started, go to the settings page and enter your <a href="https://yikesplugins.com/support/knowledge-base/finding-your-mailchimp-api-key/" target="_blank">MailChimp API key</a>.
6
+ * Version: 6.3.18
7
  * Author: YIKES, Inc.
8
  * Author URI: https://www.yikesplugins.com/
9
  * License: GPL-3.0+
42
  * @since 6.1.3
43
  */
44
  if ( ! defined( 'YIKES_MC_VERSION' ) ) {
45
+ define( 'YIKES_MC_VERSION' , '6.3.18' );
46
  }
47
 
48
  /**