Easy Forms for MailChimp - Version 6.3.0

Version Description

Download this release

Release Info

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

Code changes from version 6.2.4 to 6.3.0

Files changed (82) hide show
  1. .gitignore +3 -3
  2. Gruntfile.js +0 -156
  3. admin/class-yikes-inc-easy-mailchimp-extender-admin.php +385 -354
  4. admin/css/jquery.qtip.min.css +2 -2
  5. admin/css/yikes-inc-easy-mailchimp-extender-admin.css +25 -9
  6. admin/css/yikes-inc-easy-mailchimp-extender-admin.min.css +1 -2
  7. admin/css/yikes-inc-easy-mailchimp-migrate-option-styles.css +1 -2
  8. admin/js/min/yikes-inc-easy-mailchimp-dashboard-widget.min.js +1 -1
  9. admin/js/min/yikes-inc-easy-mailchimp-extender-edit-form.min.js +1 -1
  10. admin/js/yikes-inc-easy-mailchimp-dashboard-widget.js +1 -1
  11. admin/js/yikes-inc-easy-mailchimp-extender-edit-form.js +16 -7
  12. admin/partials/ajax/add_field_to_form.php +79 -78
  13. admin/partials/ajax/add_interest_group_to_form.php +167 -146
  14. admin/partials/ajax/class.ajax.php +30 -87
  15. admin/partials/ajax/process_ajax.php +0 -190
  16. admin/partials/dashboard-widgets/class.list-activity-widget.php +22 -60
  17. admin/partials/dashboard-widgets/templates/stats-list-template.php +16 -5
  18. admin/partials/edit-form.php +100 -103
  19. admin/partials/menu/account-details.php +50 -83
  20. admin/partials/menu/add-ons.php +2 -2
  21. admin/partials/menu/manage-forms.php +37 -63
  22. admin/partials/menu/manage-lists.php +41 -55
  23. admin/partials/menu/options-sections/api-cache-settings.php +2 -2
  24. admin/partials/menu/options-sections/integration-settings.php +31 -46
  25. admin/partials/menu/options-sections/templates/integration-interest-groups.php +39 -46
  26. admin/partials/menu/options.php +2 -2
  27. admin/partials/menu/support.php +11 -23
  28. admin/partials/upgrade-helpers/upgrade-migrate-options.php +6 -3
  29. admin/partials/view-list.php +150 -200
  30. admin/partials/view-user.php +294 -377
  31. admin/partials/welcome-page/welcome-sections/credits-section.php +0 -97
  32. admin/partials/welcome-page/welcome-sections/getting-started-section.php +11 -15
  33. admin/partials/welcome-page/welcome-sections/whats-new-section.php +4 -60
  34. admin/partials/welcome-page/welcome.php +3 -6
  35. class-map.php +9 -0
  36. includes/api/class-yikes-inc-eacy-mailchimp-api-account.php +31 -0
  37. includes/api/class-yikes-inc-easy-mailchimp-api-abstract-items.php +272 -0
  38. includes/api/class-yikes-inc-easy-mailchimp-api-account-details.php +48 -0
  39. includes/api/class-yikes-inc-easy-mailchimp-api-chimp-chatter.php +46 -0
  40. includes/api/class-yikes-inc-easy-mailchimp-api-lists.php +419 -0
  41. includes/api/class-yikes-inc-easy-mailchimp-api-manager.php +255 -0
  42. includes/api/class-yikes-inc-easy-mailchimp-api-profile.php +46 -0
  43. includes/api/class-yikes-inc-easy-mailchimp-api.php +382 -0
  44. includes/class-yikes-inc-easy-mailchimp-extender-activator.php +2 -2
  45. includes/class-yikes-inc-easy-mailchimp-extender-forms-abstract.php +8 -8
  46. includes/class-yikes-inc-easy-mailchimp-extender-forms.php +0 -10
  47. includes/class-yikes-inc-easy-mailchimp-extender-loader.php +2 -2
  48. includes/class-yikes-inc-easy-mailchimp-extender.php +2 -2
  49. includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php +31 -4
  50. includes/images/Support_Page/Octocat.png +0 -0
  51. includes/images/Support_Page/github-issue-screenshot.png +0 -0
  52. includes/images/Support_Page/wordpress-issue-screenshot.png +0 -0
  53. includes/images/Welcome_Page/api-v3-animated.png +0 -0
  54. includes/images/Welcome_Page/yikes-mailchimp-welcome-logo.png +0 -0
  55. includes/third-party-integrations/visual-composer/visual-composer.php +2 -2
  56. package.json +0 -26
  57. phpunit.xml.dist +0 -14
  58. public/class-yikes-inc-easy-mailchimp-extender-public.php +7 -6
  59. public/classes/checkbox-integrations.php +125 -132
  60. public/classes/checkbox-integrations/class.bbpress_forms-checkbox.php +1 -2
  61. public/classes/checkbox-integrations/class.buddypress_form-checkbox.php +1 -3
  62. public/classes/checkbox-integrations/class.comment_form-checkbox.php +6 -6
  63. public/classes/checkbox-integrations/class.contact_form_7-checkbox.php +5 -3
  64. public/classes/checkbox-integrations/class.easy_digital_downloads_checkout_form-checkbox.php +6 -8
  65. public/classes/checkbox-integrations/class.registration_form-checkbox.php +4 -6
  66. public/classes/checkbox-integrations/class.woocommerce_checkout_form-checkbox.php +1 -3
  67. public/classes/process/class.process_form_submission_handler.php +1348 -0
  68. public/css/yikes-inc-easy-mailchimp-extender-public.css +1 -2
  69. public/css/yikes-inc-easy-mailchimp-extender-public.min.css +1 -2
  70. public/js/yikes-mc-ajax-forms.js +226 -1
  71. public/js/yikes-mc-ajax-forms.min.js +1 -1
  72. public/js/yikes-update-existing-subscriber.js +3 -2
  73. public/js/yikes-update-existing-subscriber.min.js +1 -0
  74. public/partials/ajax/class.public_ajax.php +88 -99
  75. public/partials/shortcodes/process/process_form_submission.php +226 -279
  76. public/partials/shortcodes/process/process_form_submission_ajax.php +167 -274
  77. public/partials/shortcodes/process_form_shortcode.php +114 -45
  78. public/partials/shortcodes/templates/state-dropdown.php +2 -1
  79. public/partials/shortcodes/yikes-mailchimp-subscriber-count.php +31 -55
  80. readme.md +68 -57
  81. readme.txt +128 -83
  82. yikes-inc-easy-mailchimp-extender.php +29 -13
.gitignore CHANGED
@@ -1,3 +1,3 @@
1
- /plugin_core/includes/error_log/yikes-easy-mailchimp-error-log.php
2
- /node_modules
3
- vendor
1
+ /plugin_core/includes/error_log/yikes-easy-mailchimp-error-log.php
2
+ /node_modules
3
+ vendor
Gruntfile.js DELETED
@@ -1,156 +0,0 @@
1
- 'use strict';
2
- module.exports = function(grunt) {
3
-
4
- grunt.initConfig({
5
-
6
- // js minification
7
- uglify: {
8
- dist: {
9
- files: {
10
- // admin scripts
11
- 'admin/js/min/yikes-inc-easy-mailchimp-dashboard-widget.min.js': [ // widget specific script
12
- 'admin/js/yikes-inc-easy-mailchimp-dashboard-widget.js'
13
- ],
14
- 'admin/js/min/yikes-inc-easy-mailchimp-extender-admin.min.js': [ // global admin script
15
- 'admin/js/yikes-inc-easy-mailchimp-extender-admin.js'
16
- ],
17
- 'admin/js/min/yikes-inc-easy-mailchimp-extender-edit-form.min.js': [ // edit MailChimp form script
18
- 'admin/js/yikes-inc-easy-mailchimp-extender-edit-form.js'
19
- ],
20
- 'admin/js/min/yikes-inc-easy-mailchimp-tinymce-button.min.js': [ // custom tinyMCE button script
21
- 'admin/js/yikes-inc-easy-mailchimp-tinymce-button.js'
22
- ],
23
- // public scripts
24
- 'public/js/yikes-mc-ajax-forms.min.js': [ // public ajax script
25
- 'public/js/yikes-mc-ajax-forms.js'
26
- ],
27
- }
28
- }
29
- },
30
-
31
- // css minify all contents of our directory and add .min.css extension
32
- cssmin: {
33
- target: {
34
- files: [
35
- // admin css files
36
- {
37
- expand: true,
38
- cwd: 'admin/css',
39
- src: [
40
- 'yikes-inc-easy-mailchimp-extender-admin.css',
41
- 'yikes-inc-easy-mailchimp-migrate-option-styles.css',
42
- ], // main style declaration file
43
- dest: 'admin/css',
44
- ext: '.min.css'
45
- },
46
- {
47
- expand: true,
48
- cwd: 'public/css',
49
- src: [
50
- 'yikes-inc-easy-mailchimp-checkbox-integration.css',
51
- 'yikes-inc-easy-mailchimp-datepicker-styles.css',
52
- 'yikes-inc-easy-mailchimp-extender-public.css',
53
- ], // main style declaration file
54
- dest: 'public/css',
55
- ext: '.min.css'
56
- }
57
- ]
58
- }
59
- },
60
-
61
- // watch our project for changes
62
- watch: {
63
- admin_css: { // admin css
64
- files: 'admin/css/*.css',
65
- tasks: ['cssmin'],
66
- options: {
67
- spawn:false,
68
- event:['all']
69
- },
70
- },
71
- admin_js: { // admin js
72
- files: 'admin/js/*.js',
73
- tasks: ['uglify'],
74
- options: {
75
- spawn:false,
76
- event:['all']
77
- },
78
- },
79
- public_css: {
80
- // public css
81
- files: 'public/css/*.css',
82
- tasks: ['cssmin'],
83
- options: {
84
- spawn:false,
85
- event:['all']
86
- },
87
- },
88
- public_js: { // public js
89
- files: 'public/js/*.js',
90
- tasks: ['uglify'],
91
- options: {
92
- spawn:false,
93
- event:['all']
94
- },
95
- },
96
- },
97
-
98
- // Borwser Sync
99
- browserSync: {
100
- bsFiles: {
101
- src : [ 'admin/css/*.min.css' , 'public/css/*.min.css' , 'admin/js/*.min.js' , 'public/js/*.min.js' ],
102
- },
103
- options: {
104
- proxy: "localhost/mc_free/",
105
- watchTask : true
106
- }
107
- },
108
-
109
- // Autoprefixer for our CSS files
110
- postcss: {
111
- options: {
112
- map: true,
113
- processors: [
114
- require( 'autoprefixer-core' ) ({
115
- browsers: ['last 2 versions']
116
- })
117
- ]
118
- },
119
- dist: {
120
- src: [ 'admin/css/*.css' , 'public/css/*.css' ]
121
- }
122
- },
123
-
124
- auto_install: {
125
- local: {}
126
- },
127
-
128
- /* Delete the error log - gets recreated in the next step */
129
- clean: ['includes/error_log/yikes-easy-mailchimp-error-log.php' ],
130
-
131
- });
132
-
133
- // load tasks
134
- grunt.loadNpmTasks('grunt-contrib-uglify');
135
- grunt.loadNpmTasks('grunt-contrib-cssmin');
136
- grunt.loadNpmTasks('grunt-contrib-watch');
137
- grunt.loadNpmTasks('grunt-browser-sync'); // browser-sync auto refresh
138
- grunt.loadNpmTasks('grunt-postcss'); // CSS autoprefixer plugin (cross-browser auto pre-fixes)
139
- grunt.loadNpmTasks('grunt-wp-i18n'); // wordpress localization plugin
140
- grunt.loadNpmTasks('grunt-auto-install'); // autoload all of our dependencies (ideally, you install this one package, and run grunt auto_install to install our dependencies automagically)
141
- grunt.loadNpmTasks('grunt-contrib-clean');
142
-
143
- // register task
144
- grunt.registerTask( 'default', [
145
- 'uglify',
146
- 'cssmin',
147
- 'postcss',
148
- 'clean',
149
- 'emptyFile'
150
- ]);
151
-
152
- grunt.registerTask( 'emptyFile', 'Creates an empty file', function() {
153
- grunt.file.write('includes/error_log/yikes-easy-mailchimp-error-log.php', '');
154
- });
155
-
156
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/class-yikes-inc-easy-mailchimp-extender-admin.php CHANGED
@@ -7,7 +7,7 @@
7
  *
8
  * @package Yikes_Inc_Easy_Mailchimp_Forms
9
  * @subpackage Yikes_Inc_Easy_Mailchimp_Forms/admin
10
- * @author YIKES Inc. <info@yikesinc.com>
11
  */
12
  class Yikes_Inc_Easy_Mailchimp_Forms_Admin {
13
 
@@ -281,12 +281,12 @@ class Yikes_Inc_Easy_Mailchimp_Forms_Admin {
281
  */
282
  public function easy_forms_plugin_action_links( $links ) {
283
  $links[] = '<a href="'. esc_url( get_admin_url(null, 'admin.php?page=yikes-inc-easy-mailchimp-settings') ) .'">' . __( 'Settings', 'yikes-inc-easy-mailchimp-extender' ) . '</a>';
284
- $links[] = '<a href="' . esc_url( 'http://www.yikesplugins.com?utm_source=plugins-page&utm_medium=plugin-row&utm_campaign=admin' ) . '" target="_blank">' . __( 'More plugins by YIKES' , 'yikes-inc-easy-mailchimp-extender' ) . '</a>';
285
  return $links;
286
  }
287
 
288
  /**
289
- * Add a disclaimer to the admin footer for all YIKES pages to ensure that users understand there is no coorelation between this plugin and MailChimp.
290
  * This plugin simply provides the service of linking MailChimp with your site.
291
  *
292
  * @since 6.0
@@ -299,7 +299,7 @@ class Yikes_Inc_Easy_Mailchimp_Forms_Admin {
299
  $page = get_current_screen();
300
  $base = $page->base;
301
  if ( strpos( $base, 'yikes-' ) !== false ) {
302
- $disclaimer_text = sprintf( '<em>' . __( 'Disclaimer: <strong>Easy Forms for MailChimp by YIKES</strong> is in no way endorsed, affiliated or backed by MailChimp, or its parent company Rocket Science Group.', 'yikes-inc-easy-mailchimp-extender' ), '<a href="https://wordpress.org/support/view/plugin-reviews/give?filter=5#postform" target="_blank" class="give-rating-link" data-rated="' . __( 'Thanks :)', 'yikes-inc-easy-mailchimp-extender' ) . '">', '</a></em>' );
303
  return $disclaimer_text;
304
  } else {
305
  return $footer_text;
@@ -558,12 +558,29 @@ class Yikes_Inc_Easy_Mailchimp_Forms_Admin {
558
  public function yikes_easy_mailchimp_display_review_us_notice() {
559
  /* Lets only display our admin notice on YT4WP pages to not annoy the hell out of people :) */
560
  if ( in_array( get_current_screen()->base , array( 'dashboard' , 'post' , 'edit' ) ) || strpos( get_current_screen()->base ,'yikes-inc-easy-mailchimp') !== false ) {
 
 
561
  // Review URL - Change to the URL of your plugin on WordPress.org
562
  $reviewurl = 'https://wordpress.org/support/view/plugin-reviews/yikes-inc-easy-mailchimp-extender';
563
  $addons_url = esc_url( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-addons' ) );
564
  $nobugurl = esc_url_raw( add_query_arg( 'yikes_easy_mc_icons_nobug', '1', admin_url() ) );
 
 
 
 
 
 
565
  $review_message = '<div id="yikes-mailchimp-logo"></div>';
566
- $review_message .= sprintf( __( "It looks like you've been using %s for 2 weeks now. We hope you're enjoying the features included with the free version. If so, please consider leaving us a review. Reviews only help to catch other users attention as well as provide us with feedback to grow and improve upon. If you're really enjoying the plugin, consider buying an add-on or developer license for some really awesome features and premium support." , 'yikes-inc-easy-mailchimp-extender' ) . "<span class='button-container'> <a href='%s' target='_blank' class='button-secondary'><span class='dashicons dashicons-star-filled'></span>" . __( "Leave A Review" , 'yikes-inc-easy-mailchimp-extender' ) . "</a> <a href='%s' class='button-secondary'><span class='dashicons dashicons-upload'></span>" . __( "View Addons" , 'yikes-inc-easy-mailchimp-extender' ) . "</a> <a href='%s' class='button-secondary'><span class='dashicons dashicons-no-alt'></span>" . __( "Dismiss" , 'yikes-inc-easy-mailchimp-extender' ) . "</a> </span>", '<strong>Easy Forms for MailChimp by YIKES Inc.</strong>', $reviewurl, $addons_url, $nobugurl ) . '';
 
 
 
 
 
 
 
 
 
567
  ?>
568
  <div id="review-yikes-easy-mailchimp-notice">
569
  <?php echo $review_message; ?>
@@ -591,7 +608,7 @@ class Yikes_Inc_Easy_Mailchimp_Forms_Admin {
591
 
592
  /* Display a warning users who are using PHP < 5.3 */
593
  public function display_php_warning() {
594
- $message = __( 'YIKES Inc. Easy Forms for MailChimp requires a minimum of PHP 5.3. The plugin will not function properly until you update. Reach out to your host provider for assistance.' , 'yikes-inc-easy-mailchimp-extender' );
595
  echo "<div class='error'> <p><span class='dashicons dashicons-no-alt' style='color:rgb(231, 98, 98)'></span> $message</p></div>";
596
  }
597
 
@@ -656,8 +673,8 @@ class Yikes_Inc_Easy_Mailchimp_Forms_Admin {
656
  /* Pass our form data to our JS file for use */
657
  wp_localize_script( 'editor', 'localized_data', array(
658
  'forms' => json_encode( $lists ),
659
- 'button_title' => __( 'Easy Forms for MailChimp by YIKES', 'yikes-inc-easy-mailchimp-extender' ),
660
- 'popup_title' => __( 'Easy Forms for MailChimp by YIKES', 'yikes-inc-easy-mailchimp-extender' ),
661
  'list_id_label' => __( 'MailChimp Opt-In Form' , 'yikes-inc-easy-mailchimp-extender' ),
662
  'show_title_label' => __( 'Display Form Title' , 'yikes-inc-easy-mailchimp-extender' ),
663
  'show_description_label' => __( 'Display Form Description' , 'yikes-inc-easy-mailchimp-extender' ),
@@ -829,6 +846,8 @@ class Yikes_Inc_Easy_Mailchimp_Forms_Admin {
829
  case 'd/m/Y':
830
  case 'dd/mm/yyyy':
831
  case 'DD/MM/YYYY':
 
 
832
  return( 'dd/mm' );
833
  break;
834
  }
@@ -864,9 +883,9 @@ class Yikes_Inc_Easy_Mailchimp_Forms_Admin {
864
 
865
  /* Top Level Menu 'Easy MailChimp' */
866
  add_menu_page(
867
- __( 'Easy Forms' , 'yikes-inc-easy-mailchimp-extender' ),
868
  'Easy Forms',
869
- apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
870
  'yikes-inc-easy-mailchimp',
871
  '', // no callback,
872
  YIKES_MC_URL . 'includes/images/MailChimp_Assets/Freddie_wink_icon.png'
@@ -875,131 +894,131 @@ class Yikes_Inc_Easy_Mailchimp_Forms_Admin {
875
  // Sub Pages
876
  /*************/
877
 
878
- /* YIKES Inc. Easy MailChimp Settings */
879
-
880
- /* YIKES Inc. Easy MailChimp Manage Forms */
881
- add_submenu_page(
882
- 'yikes-inc-easy-mailchimp',
883
- __( 'Opt-in Forms' , 'yikes-inc-easy-mailchimp-extender' ),
884
- __( 'Opt-in Forms' , 'yikes-inc-easy-mailchimp-extender' ),
885
- apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
886
- 'yikes-inc-easy-mailchimp',
887
- array( $this, 'generateManageFormsPage' )
888
- );
889
-
890
- /* YIKES Inc. Easy MailChimp Manage Lists */
891
- add_submenu_page(
892
- 'yikes-inc-easy-mailchimp',
893
- __( 'Mailing Lists' , 'yikes-inc-easy-mailchimp-extender' ),
894
- __( 'Mailing Lists' , 'yikes-inc-easy-mailchimp-extender' ),
895
- apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
896
- 'yikes-inc-easy-mailchimp-lists',
897
- array( $this, 'generateManageListsPage' )
898
- );
899
 
 
 
 
 
 
 
 
 
 
900
 
901
- /*
902
- * Custom action hook to hook into to add additional
903
- * menu items from extensions
904
- */
905
- do_action( 'yikes-mailchimp-menu' );
 
 
 
 
906
 
907
 
908
- /* YIKES Inc. Easy MailChimp Account Overview */
909
- if ( get_option('yikes-mc-api-validation') == 'valid_api_key' ) {
910
- /* YIKES Inc. Easy MailChimp Settings */
911
- add_submenu_page(
912
- 'yikes-inc-easy-mailchimp',
913
- __( 'Account' , 'yikes-inc-easy-mailchimp-extender' ),
914
- __( 'Account' , 'yikes-inc-easy-mailchimp-extender' ),
915
- apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
916
- 'yikes-inc-easy-mailchimp-account-overview',
917
- array( $this, 'generateAccountDetailsPage' )
918
- );
919
- }
920
 
921
 
922
- /* YIKES Inc. Easy MailChimp Settings */
 
 
923
  add_submenu_page(
924
  'yikes-inc-easy-mailchimp',
925
- __( 'Settings.' , 'yikes-inc-easy-mailchimp-extender' ),
926
- __( 'Settings' , 'yikes-inc-easy-mailchimp-extender' ),
927
- apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
928
- 'yikes-inc-easy-mailchimp-settings',
929
- array( $this, 'generatePageOptions' )
930
  );
 
931
 
932
- /* Support Page */
933
- add_submenu_page(
934
- 'yikes-inc-easy-mailchimp',
935
- __( 'Support' , 'yikes-inc-easy-mailchimp-extender' ),
936
- __( 'Support' , 'yikes-inc-easy-mailchimp-extender' ),
937
- apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
938
- 'yikes-inc-easy-mailchimp-support',
939
- array( $this, 'generateSupportPage' )
940
- );
941
 
942
- /* Add-Ons Page */
943
- add_submenu_page(
944
- 'yikes-inc-easy-mailchimp',
945
- __( 'Add-Ons' , 'yikes-inc-easy-mailchimp-extender' ),
946
- __( 'Add-Ons' , 'yikes-inc-easy-mailchimp-extender' ),
947
- apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
948
- 'yikes-inc-easy-mailchimp-addons',
949
- array( $this , 'generateAddOnsPage' )
950
- );
951
 
952
- /** Hidden Pages **/
 
 
 
 
 
 
 
 
953
 
954
- /* Add Hidden Edit Form Page */
955
- add_submenu_page(
956
- 'options.php',
957
- __( 'Edit Form' , 'yikes-inc-easy-mailchimp-extender' ),
958
- __( 'Edit Form' , 'yikes-inc-easy-mailchimp-extender' ),
959
- apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
960
- 'yikes-mailchimp-edit-form',
961
- array( $this, 'generateEditFormPage' )
962
- );
963
 
964
- /* Add Hidden Migrate Options Page */
965
- add_submenu_page(
966
- 'options-writing.php',
967
- __( 'YIKES Inc. Easy Forms for MailChimp Upgrade Options Structure' , 'yikes-inc-easy-mailchimp-extender' ),
968
- 'YIKES Inc. Easy Forms for MailChimp Upgrade Options Structure',
969
- 'manage_options',
970
- 'yikes-inc-easy-mailchimp-update' ,
971
- array( $this , 'migrate_old_yks_mc_options' )
972
- );
973
 
974
- /* Add Hidden Welcome Page */
975
- add_submenu_page(
976
- 'options.php',
977
- __( 'Welcome' , 'yikes-inc-easy-mailchimp-extender' ),
978
- __( 'Welcome' , 'yikes-inc-easy-mailchimp-extender' ),
979
- apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
980
- 'yikes-mailchimp-welcome',
981
- array( $this, 'generateWelcomePage' )
982
- );
983
 
984
- /* Add Hidden 'View List' Page */
985
- add_submenu_page(
986
- 'options.php',
987
- __( 'View List' , 'yikes-inc-easy-mailchimp-extender' ),
988
- __( 'View List' , 'yikes-inc-easy-mailchimp-extender' ),
989
- apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
990
- 'yikes-mailchimp-view-list',
991
- array( $this, 'generateViewListPage' )
992
- );
993
 
994
- /* Add Hidden View User Page */
995
- add_submenu_page(
996
- 'options.php',
997
- __( 'View User' , 'yikes-inc-easy-mailchimp-extender' ),
998
- __( 'View User' , 'yikes-inc-easy-mailchimp-extender' ),
999
- apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ),
1000
- 'yikes-mailchimp-view-user',
1001
- array( $this, 'generateViewUserPage' )
1002
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1003
 
1004
  }
1005
 
@@ -1013,7 +1032,7 @@ class Yikes_Inc_Easy_Mailchimp_Forms_Admin {
1013
  }
1014
 
1015
  /**
1016
- * Generate YIKES Inc. Easy MailChimp Manage Forms Page
1017
  *
1018
  * @since 1.0.0
1019
  */
@@ -1022,7 +1041,7 @@ class Yikes_Inc_Easy_Mailchimp_Forms_Admin {
1022
  }
1023
 
1024
  /**
1025
- * Generate YIKES Inc. Easy MailChimp Manage Lists Page
1026
  *
1027
  * @since 1.0.0
1028
  */
@@ -1031,7 +1050,7 @@ class Yikes_Inc_Easy_Mailchimp_Forms_Admin {
1031
  }
1032
 
1033
  /**
1034
- * Generate YIKES Inc. Easy MailChimp Account Details Page
1035
  *
1036
  * @since 1.0.0
1037
  */
@@ -1040,7 +1059,7 @@ class Yikes_Inc_Easy_Mailchimp_Forms_Admin {
1040
  }
1041
 
1042
  /**
1043
- * Generate YIKES Inc. Easy MailChimp Support Page
1044
  *
1045
  * @since 1.0.0
1046
  */
@@ -1049,7 +1068,7 @@ class Yikes_Inc_Easy_Mailchimp_Forms_Admin {
1049
  }
1050
 
1051
  /**
1052
- * Generate YIKES Inc. Easy MailChimp Edit Form Page
1053
  *
1054
  * @since 1.0.0
1055
  */
@@ -1058,7 +1077,7 @@ class Yikes_Inc_Easy_Mailchimp_Forms_Admin {
1058
  }
1059
 
1060
  /**
1061
- * Generate YIKES Inc. Easy MailChimp Welcome Page
1062
  *
1063
  * @since 1.0.0
1064
  */
@@ -1067,7 +1086,7 @@ class Yikes_Inc_Easy_Mailchimp_Forms_Admin {
1067
  }
1068
 
1069
  /**
1070
- * Generate YIKES Inc. Easy MailChimp View List Page
1071
  *
1072
  * @since 1.0.0
1073
  */
@@ -1076,7 +1095,7 @@ class Yikes_Inc_Easy_Mailchimp_Forms_Admin {
1076
  }
1077
 
1078
  /**
1079
- * Generate YIKES Inc. Easy MailChimp View User Page
1080
  *
1081
  * @since 1.0.0
1082
  */
@@ -1210,37 +1229,27 @@ class Yikes_Inc_Easy_Mailchimp_Forms_Admin {
1210
  function yikes_mc_validate_api_key( $input ) {
1211
  if( $input === '' ) {
1212
  update_option( 'yikes-mc-api-validation' , 'invalid_api_key' );
1213
- return;
1214
  }
1215
  $api_key = strip_tags ( trim( $input ) );
1216
  $dash_position = strpos( trim( $input ), '-' );
1217
  if( $dash_position !== false ) {
1218
- $api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/helper/ping.json';
1219
  } else {
1220
  update_option( 'yikes-mc-api-invalid-key-response', __( 'Your API key appears to be invalid.', 'yikes-inc-easy-mailchimp-extender' ) );
1221
  update_option( 'yikes-mc-api-validation' , 'invalid_api_key' );
1222
  return $api_key;
1223
  }
1224
- $request_args = array(
1225
- 'body' => array(
1226
- 'apikey' => $api_key,
1227
- ),
1228
- 'timeout' => 10,
1229
- 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true ),
1230
- );
1231
- $api_key_response = wp_remote_post( $api_endpoint, $request_args );
1232
- if( ! is_wp_error( $api_key_response ) ) {
1233
- $body = json_decode( wp_remote_retrieve_body( $api_key_response ), true );
1234
- if( isset( $body['msg'] ) && $body['msg'] == "Everything's Chimpy!" ) {
1235
- update_option( 'yikes-mc-api-validation' , 'valid_api_key' );
1236
  // Clear the API key transient data
1237
- $this->delete_yikes_mailchimp_transients();
1238
- }
1239
  } else {
1240
- require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
1241
  $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
1242
- $error_logging->yikes_easy_mailchimp_write_to_error_log( $api_key_response->get_error_message() , __( "Connecting to MailChimp" , 'yikes-inc-easy-mailchimp-extender' ) , __( "Settings Page/General Settings" , 'yikes-inc-easy-mailchimp-extender' ) );
1243
- update_option( 'yikes-mc-api-invalid-key-response' , $api_key_response->get_error_message() );
1244
  update_option( 'yikes-mc-api-validation' , 'invalid_api_key' );
1245
  }
1246
  // returned the api key
@@ -1248,7 +1257,7 @@ class Yikes_Inc_Easy_Mailchimp_Forms_Admin {
1248
  }
1249
 
1250
  /**
1251
- * Generate YIKES Inc. Easy Forms for MailChimp Options Page
1252
  *
1253
  * @since 1.0.0
1254
  */
@@ -1262,13 +1271,13 @@ class Yikes_Inc_Easy_Mailchimp_Forms_Admin {
1262
  * to form fields. (input, dropdowns, buttons etc.)
1263
  * @since v5.5 re-write
1264
  **/
1265
- public function is_user_mc_api_valid_form( $echo=true ) {
1266
- if( $echo == true ) {
1267
- if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) == 'invalid_api_key' ) {
1268
  echo 'disabled="disabled"';
1269
  }
1270
  } else {
1271
- if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) == 'invalid_api_key' ) {
1272
  return false;
1273
  } else {
1274
  return true;
@@ -1337,13 +1346,13 @@ class Yikes_Inc_Easy_Mailchimp_Forms_Admin {
1337
  delete_option( 'yikes-mc-lists' );
1338
  ?>
1339
  <div class="yikes-easy-mc-updated migrate-options-notice">
1340
- <p><?php printf( __( "The previously stored options for %s have been cleared from the database. You should update the plugin options on the <a href='%s' title='Settings Page'>settings page</a> before continuing. You should also update the shortcodes used to generate your forms, and any widgets you may have previously set-up.", 'yikes-inc-easy-mailchimp-extender' ), '<strong>YIKES Inc. Easy Forms for MailChimp</strong>', admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings' ) ); ?></p>
1341
  </div>
1342
  <?php
1343
  } else {
1344
  ?>
1345
  <div class="yikes-easy-mc-updated migrate-options-notice">
1346
- <p><?php printf( __( "It looks like you're upgrading from a previous version of %s.", 'yikes-inc-easy-mailchimp-extender' ), '<strong>YIKES Inc. Easy Forms for MailChimp</strong>' ); ?> <?php printf( __( "In the newest version of %s, the options data structure has changed. We've also moved the mailing lists into its own database table to allow for some higher level customization. Now you can easily create multiple forms and assign them to the same mailing list." , 'yikes-inc-easy-mailchimp-extender' ), '<strong>YIKES Inc. Easy Forms for MailChimp</strong>' ); ?></p>
1347
  <p><?php _e( "Before you continue, it's strongly recommended you the perform the migration to ensure the plugin continues to function properly.", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
1348
  <p><em><?php _e( "It's also strongly recommended that you take a backup of your database.", 'yikes-inc-easy-mailchimp-extender' ); ?></em></p>
1349
  <section id="migration-buttons">
@@ -1409,7 +1418,6 @@ class Yikes_Inc_Easy_Mailchimp_Forms_Admin {
1409
 
1410
  $custom_styles = isset( $new_options['custom_styles'] ) ? $new_options['custom_styles']: '0'; // store as an array with all of our styles
1411
  $custom_template = isset( $new_options['custom_template'] ) ? $new_options['custom_template'] : '0'; // store template data as an array ( active , template used )
1412
- $send_welcome_email = isset( $new_options['yks_mailchimp_send_welcome_'.$list_id] ) ? '0' : '1';
1413
  $redirect_user_on_submit = isset( $new_options['yks_mailchimp_redirect_'.$list_id] ) ? '1' : '0';
1414
  $redirect_page = isset( $new_options['page_id_'.$list_id] ) ? $new_options['page_id_'.$list_id] : '';
1415
 
@@ -1421,7 +1429,6 @@ class Yikes_Inc_Easy_Mailchimp_Forms_Admin {
1421
  'fields' => $fields,
1422
  'custom_styles' => $custom_styles,
1423
  'custom_template' => $custom_template,
1424
- 'send_welcome_email' => $send_welcome_email,
1425
  'redirect_user_on_submit' => $redirect_user_on_submit,
1426
  'redirect_page' => $redirect_page,
1427
  'submission_settings' => '',
@@ -1504,92 +1511,92 @@ class Yikes_Inc_Easy_Mailchimp_Forms_Admin {
1504
  )
1505
  );
1506
  ?>
1507
- <h3><?php _e( 'Create a New Signup Form' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
1508
 
1509
- <div class="inside">
1510
 
1511
- <p class="description"><?php _e( "Give your form a name, select a MailChimp list to assign users to, then click 'Create'.", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
1512
-
1513
- <form id="import-list-to-site" method="POST" action="<?php echo $url; ?>">
1514
- <input type="hidden" name="import-list-to-site" value="1" />
1515
- <!-- Name your new form -->
1516
- <label for="form-name"><strong><?php _e( 'Form Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
1517
- <input type="text" class="widefat input-field" placeholder="<?php _e( 'Form Name' , 'yikes-inc-easy-mailchimp-extender' ); ?>" name="form-name" id="form-name" <?php $this->is_user_mc_api_valid_form( true ); ?> required>
1518
- </label>
1519
- <!-- Name your new form -->
1520
- <label for="form-description"><strong><?php _e( 'Form Description' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
1521
- <textarea class="widefat input-field form-description" placeholder="<?php _e( 'Form Description' , 'yikes-inc-easy-mailchimp-extender' ); ?>" name="form-description" id="form-description" <?php $this->is_user_mc_api_valid_form( true ); ?>></textarea>
1522
- </label>
1523
- <!-- Associate this form with a list! -->
1524
- <label for="associated-list"><strong><?php _e( 'Associated List' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
1525
- <select name="associated-list" id="associated-list" class=" input-field" <?php $this->is_user_mc_api_valid_form( true ); if( isset( $lists ) && empty( $lists ) ) { echo 'disabled="disabled"'; } ?>>
1526
- <?php
1527
- if( isset( $lists ) && !empty( $lists ) ) {
1528
- foreach( $lists as $mailing_list ) {
1529
- ?>
1530
- <option value="<?php echo $mailing_list['id']; ?>"><?php echo stripslashes( $mailing_list['name'] ) . ' (' . $mailing_list['stats']['member_count'] . ') '; ?></option>
1531
- <?php
1532
- }
1533
- } else {
1534
- if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) == 'invalid_api_key' ) {
1535
- ?>
1536
- <option><?php echo __( "Please enter a valid API key." , 'yikes-inc-easy-mailchimp-extender' ); ?></option>
1537
- <?php
1538
- } else {
1539
- ?>
1540
- <option><?php echo __( "No lists were found on the account." , 'yikes-inc-easy-mailchimp-extender' ); ?></option>
1541
- <?php
1542
-
1543
- }
1544
- }
1545
- ?>
1546
- </select>
1547
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1548
  <?php
1549
- if ( isset( $_GET['transient-cleared'] ) ) {
1550
- if ( 'true' === $_GET['transient-cleared'] ) {
1551
  ?>
1552
- <div class="yikes-list-refreshed-notice">
1553
- <p><?php esc_attr_e( 'MailChimp list data has been succesfully refreshed.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
1554
- </div>
1555
  <?php
1556
  }
1557
- }
1558
-
1559
- if( isset( $lists ) && empty( $lists ) ) {
1560
- if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) != 'invalid_api_key' ) {
 
 
1561
  ?>
1562
- <p class="description">
1563
- <?php printf( __( 'Head over to <a href="http://www.MailChimp.com" title="%s">MailChimp</a> to create a new list.', 'yikes-inc-easy-mailchimp-extender' ) , __( 'Create a list' , 'yikes-inc-easy-mailchimp-extender' ) ); ?>
1564
- </p>
1565
  <?php
 
1566
  }
1567
  }
1568
  ?>
1569
- </label>
 
1570
  <?php
1571
- if( $this->is_user_mc_api_valid_form( false ) ) {
1572
- echo submit_button( __( 'Create', 'yikes-inc-easy-mailchimp-extender' ) , 'primary' , '' , false , array( 'style' => 'margin:.75em 0 .5em 0;' ) );
1573
- } else {
1574
- echo '<p class="description">' . __( "Please enter a valid MailChimp API key to get started." , 'yikes-inc-easy-mailchimp-extender' ) . '</p>';
1575
  ?>
1576
- <a href="<?php echo esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&settings-updated=true' ) ); ?>"><?php _e( 'general settings' , 'yikes-inc-easy-mailchimp-extender' ); ?></a>
 
 
1577
  <?php
1578
  }
1579
- ?>
1580
- </form>
1581
 
1582
- <!-- Clear API CACHE -->
 
 
 
 
 
 
 
 
 
 
1583
  <?php
1584
- if( isset( $lists ) && ! empty( $lists ) ) {
1585
- if ( false !== get_transient( 'yikes-easy-mailchimp-list-data' ) ) { ?>
1586
- <form action="<?php echo esc_url_raw( add_query_arg( array( 'action' => 'yikes-easy-mc-clear-transient-data' , 'nonce' => wp_create_nonce( 'clear-mc-transient-data' ) ) ) ); ?>" method="post">
1587
- <input type="submit" class="button-secondary clear-mailchimp-api-cache" value="<?php _e( 'Refresh Lists' , 'yikes-inc-easy-mailchimp-extender' ); ?>" />
1588
- </form>
1589
- <?php }
1590
- }
 
1591
  ?>
1592
- </div> <!-- .inside -->
 
 
 
 
 
 
 
 
 
 
 
 
1593
  <?php
1594
  }
1595
 
@@ -1625,13 +1632,16 @@ class Yikes_Inc_Easy_Mailchimp_Forms_Admin {
1625
  ?><option <?php selected( $redirect_page , $page->ID ); ?> value="<?php echo $page->ID; ?>"><?php echo $page->post_title; ?></option><?php
1626
  }
1627
  ?>
1628
- <option <?php selected( $redirect_page, 'custom_url' ); ?> value="custom_url"><?php echo __( 'Custom URL', 'yikes-inc-easy-mailchimp-extender' ); ?></option>
1629
  </optgroup>
1630
  <?php
1631
  }
1632
  }
1633
  }
1634
  ?>
 
 
 
 
1635
  </select>
1636
 
1637
  <label name="custom-redirect-url" class="custom_redirect_url_label" <?php if( ! isset( $redirect_page ) || $redirect_page != 'custom_url' ) { echo 'style="display:none;"'; } ?>>
@@ -1670,7 +1680,7 @@ class Yikes_Inc_Easy_Mailchimp_Forms_Admin {
1670
  <div class="postbox yikes-easy-mc-postbox show-some-love-container">
1671
 
1672
  <!-- review us container -->
1673
- <h3 data-alt-text="<?php _e( 'About YIKES Inc.', 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'Show YIKES Inc. Some Love' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
1674
  <div id="review-yikes-easy-mc" class="inside">
1675
 
1676
  <p>
@@ -1760,13 +1770,13 @@ class Yikes_Inc_Easy_Mailchimp_Forms_Admin {
1760
  $available_interest_groups = array();
1761
 
1762
  // loop over merge variables
1763
- if ( ! empty( $merge_variables['data'][0]['merge_vars'] ) ) {
1764
- $available_merge_variables = wp_list_pluck( $merge_variables['data'][0]['merge_vars'], 'tag' );
1765
  }
1766
 
1767
  // loop over interest groups
1768
- if ( ! empty( $interest_groups ) && ! isset( $interest_groups['error'] ) ) {
1769
- $available_interest_groups = wp_list_pluck( $interest_groups, 'id' );
1770
  }
1771
 
1772
  // build our assigned fields
@@ -2127,13 +2137,18 @@ class Yikes_Inc_Easy_Mailchimp_Forms_Admin {
2127
  <td>
2128
  <?php
2129
  if( $field['type'] != 'checkboxes' ) {
2130
- if( ! isset( $field['default_choice'] ) ) { $field['default_choice'] = json_decode( stripslashes( $field['groups'] ) , true ); }
 
 
 
2131
  } else {
2132
- if ( ! isset( $field['default_choice'] ) ) { $field['default_choice'] = array(); }
 
 
2133
  }
2134
- $i = 0;
2135
- foreach( json_decode( $field['groups'], true ) as $group ) {
2136
- $field_id = "{$field['group_id']}-{$i}";
2137
  $field_type = 'hidden' == $field['type'] ? 'radio' : $field['type'];
2138
  $field_type = 'checkboxes' == $field_type ? 'checkbox' : $field_type;
2139
  $field_name = "field[{$field['group_id']}][default_choice]";
@@ -2145,11 +2160,11 @@ class Yikes_Inc_Easy_Mailchimp_Forms_Admin {
2145
  case 'radio':
2146
  case 'hidden':
2147
  default:
2148
- $checked = checked( $field['default_choice'], $i, false );
2149
  break;
2150
 
2151
  case 'checkbox':
2152
- if ( in_array( $i, (array) $field['default_choice'] ) ) {
2153
  $checked = checked( true, true, false );
2154
  }
2155
  }
@@ -2159,11 +2174,10 @@ class Yikes_Inc_Easy_Mailchimp_Forms_Admin {
2159
  <input id="<?php echo $field_id; ?>"
2160
  type="<?php echo $field_type; ?>"
2161
  name="<?php echo $field_name; ?>"
2162
- value="<?php echo $i; ?>" <?php echo $checked; ?>>
2163
- <?php echo stripslashes( str_replace( '\'' , '' , $group['name'] ) ); ?>&nbsp;
2164
  </label>
2165
  <?php
2166
- $i++;
2167
  } ?>
2168
  <p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
2169
  </td>
@@ -2182,9 +2196,9 @@ class Yikes_Inc_Easy_Mailchimp_Forms_Admin {
2182
  </td>
2183
  <td>
2184
  <select type="default" name="field[<?php echo $field['group_id']; ?>][default_choice]">
2185
- <?php $i = 0; foreach( json_decode( stripslashes_deep( $field['groups'] ) , true ) as $group ) { ?>
2186
- <option value="<?php echo $i; ?>" <?php selected( $field['default_choice'] , $i ); ?>><?php echo stripslashes( $group['name'] ); ?></option>
2187
- <?php $i++; } ?>
2188
  </select>
2189
  <p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
2190
  </td>
@@ -2369,30 +2383,54 @@ class Yikes_Inc_Easy_Mailchimp_Forms_Admin {
2369
  */
2370
  public function build_available_merge_vars( $form_fields , $available_merge_variables ) {
2371
  $fields_assigned_to_form = array();
2372
- if( !empty( $form_fields ) ) {
2373
- foreach( $form_fields as $assigned_field ) {
2374
- // print_r( $assigned_field) ;
2375
- // switch between merge variables and interest groups
2376
- if( isset( $assigned_field['merge'] ) ) {
2377
- $fields_assigned_to_form[] = $assigned_field['merge'];
2378
- }
2379
  }
2380
  }
2381
- if( !empty( $available_merge_variables['data'][0] ) ) {
2382
- ?><ul id="available-fields"><?php
2383
- foreach( $available_merge_variables['data'][0]['merge_vars'] as $merge_var ) {
2384
- if( in_array( $merge_var['tag'] , $fields_assigned_to_form ) ) {
 
 
2385
  ?>
2386
- <li class="available-form-field not-available" alt="<?php echo $merge_var['tag']; ?>" data-attr-field-type="<?php echo $merge_var['field_type']; ?>" data-attr-field-name="<?php echo $merge_var['name']; ?>" data-attr-form-id="<?php echo $available_merge_variables['data'][0]['id']; ?>" title="<?php _e( 'Already assigned to your form' , 'yikes-inc-easy-mailchimp-extender' ); ?>" disabled="disabled"><?php echo stripslashes( $merge_var['name'] ); if( $merge_var['req'] == '1' ) { echo ' <span class="field-required" title="' . __( 'required field' , 'yikes-inc-easy-mailchimp-extender' ) . '">*</span>'; } ?> <small class="field-type-text"><?php echo $merge_var['field_type']; ?></small></li>
 
 
 
 
 
 
 
 
 
 
 
 
2387
  <?php
2388
  } else {
2389
  ?>
2390
- <li class="available-form-field" alt="<?php echo $merge_var['tag']; ?>" data-attr-field-type="<?php echo $merge_var['field_type']; ?>" data-attr-field-name="<?php echo $merge_var['name']; ?>" data-attr-form-id="<?php echo $available_merge_variables['data'][0]['id']; ?>"><?php echo stripslashes( $merge_var['name'] ); if( $merge_var['req'] == '1' ) { echo ' <span class="field-required" title="' . __( 'required field' , 'yikes-inc-easy-mailchimp-extender' ) . '">*</span>'; } ?> <small class="field-type-text"><?php echo $merge_var['field_type']; ?></small></li>
 
 
 
 
 
 
 
 
 
 
2391
  <?php
2392
  }
2393
  }
2394
  ?></ul>
2395
- <a href="#" class="add-field-to-editor button-secondary yikes-easy-mc-hidden" style="display:none;"><small><span class="dashicons dashicons-arrow-left-alt add-to-form-builder-arrow"></span> <?php _e( 'Add to Form Builder' , 'yikes-inc-easy-mailchimp-extender' ); ?></small></a>
 
 
 
 
2396
  <?php
2397
  }
2398
  }
@@ -2406,28 +2444,38 @@ class Yikes_Inc_Easy_Mailchimp_Forms_Admin {
2406
  */
2407
  public function build_available_interest_groups( $form_fields , $available_interest_groups , $list_id ) {
2408
  $fields_assigned_to_form = array();
2409
- if( !empty( $form_fields ) ) {
2410
- foreach( $form_fields as $assigned_interest_group ) {
2411
- if( isset( $assigned_interest_group['group_id'] ) ) {
2412
- $fields_assigned_to_form[] = $assigned_interest_group['group_id'];
2413
  }
2414
  }
2415
  }
2416
- if( !empty( $available_interest_groups) ) {
2417
- ?><ul id="available-interest-groups"><?php
2418
- foreach( $available_interest_groups as $interest_group ) {
2419
- if( in_array( $interest_group['id'] , $fields_assigned_to_form ) ) {
 
 
2420
  ?>
2421
- <li class="available-interest-group not-available" alt="<?php echo $interest_group['id']; ?>" data-attr-field-name="<?php echo stripslashes( $interest_group['name'] ); ?>" data-attr-field-type="<?php echo $interest_group['form_field']; ?>" data-attr-form-id="<?php echo $list_id; ?>" title="<?php _e( 'Already assigned to your form' , 'yikes-inc-easy-mailchimp-extender' ); ?>" disabled="disabled"><?php echo stripslashes( $interest_group['name'] ); ?> <small class="field-type-text"><?php echo $interest_group['form_field']; ?></small></li>
 
 
2422
  <?php
2423
  } else {
2424
  ?>
2425
- <li class="available-interest-group" alt="<?php echo $interest_group['id']; ?>" data-attr-field-name="<?php echo stripslashes( $interest_group['name'] ); ?>" data-attr-field-type="<?php echo $interest_group['form_field']; ?>" data-attr-form-id="<?php echo $list_id; ?>"><?php echo stripslashes( $interest_group['name'] ); ?> <small class="field-type-text"><?php echo $interest_group['form_field']; ?></small></li>
 
 
2426
  <?php
2427
  }
2428
  }
2429
  ?></ul>
2430
- <a href="#" class="add-interest-group-to-editor button-secondary yikes-easy-mc-hidden" style="display:none;"><small><span class="dashicons dashicons-arrow-left-alt add-to-form-builder-arrow"></span> <?php _e( 'Add to Form Builder' , 'yikes-inc-easy-mailchimp-extender' ); ?></small></a>
 
 
 
 
2431
  <?php
2432
  }
2433
  }
@@ -2454,10 +2502,8 @@ class Yikes_Inc_Easy_Mailchimp_Forms_Admin {
2454
  if ( false == $result ) {
2455
  // write it to the error log
2456
  // if the form was not created successfully
2457
- if( get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
2458
- $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
2459
- $error_logging->yikes_easy_mailchimp_write_to_error_log( __( 'Error creating a new form', 'yikes-inc-easy-mailchimp-extender') , __( "Creating a new form" , 'yikes-inc-easy-mailchimp-extender' ) , __( "Forms" , 'yikes-inc-easy-mailchimp-extender' ) );
2460
- }
2461
  wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-edit-form&sql_error=' . urlencode( __( 'Error creating a new form', 'yikes-inc-easy-mailchimp-extender' ) ) ) ) );
2462
  } else {
2463
  // redirect the user to the new form edit page
@@ -2577,7 +2623,6 @@ class Yikes_Inc_Easy_Mailchimp_Forms_Admin {
2577
  $list_id = $_POST['associated-list'];
2578
  $form_name = stripslashes( $_POST['form-name'] );
2579
  $form_description = sanitize_text_field( stripslashes( $_POST['form-description'] ) );
2580
- $send_welcome_email = $_POST['send-welcome-email'];
2581
  $redirect_user_on_submit = $_POST['redirect-user-on-submission'];
2582
  $redirect_page = $_POST['redirect-user-to-selection'];
2583
 
@@ -2599,16 +2644,18 @@ class Yikes_Inc_Easy_Mailchimp_Forms_Admin {
2599
  'optin' => $_POST['single-double-optin'],
2600
  'update_existing_user' => $_POST['update-existing-user'],
2601
  'send_update_email' => $_POST['update-existing-email'],
2602
- 'send_welcome_email' => $_POST['send-welcome-email'],
2603
  );
2604
 
2605
- // setup our error settings serialized array
2606
  $error_settings = array(
2607
- 'success' => trim( $_POST['yikes-easy-mc-success-message'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-success-message'] ) ) : '',
2608
- 'general-error' => trim( $_POST['yikes-easy-mc-general-error-message'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-general-error-message'] ) ) : '',
2609
- 'invalid-email' => trim( $_POST['yikes-easy-mc-invalid-email-message'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-invalid-email-message'] ) ) : '',
2610
- 'already-subscribed' => trim( $_POST['yikes-easy-mc-user-subscribed-message'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-user-subscribed-message'] ) ) : '',
2611
- 'update-link' => trim( $_POST['yikes-easy-mc-user-update-link'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-user-update-link'] ) ) : '',
 
 
 
2612
  );
2613
 
2614
  // Setup the new form settings array
@@ -2649,7 +2696,6 @@ class Yikes_Inc_Easy_Mailchimp_Forms_Admin {
2649
  'form_description' => $form_description,
2650
  'fields' => $assigned_fields,
2651
  'custom_template' => 0,
2652
- 'send_welcome_email' => $send_welcome_email,
2653
  'redirect_user_on_submit' => $redirect_user_on_submit,
2654
  'redirect_page' => $redirect_page,
2655
  'submission_settings' => $submission_settings,
@@ -2671,45 +2717,51 @@ class Yikes_Inc_Easy_Mailchimp_Forms_Admin {
2671
  exit();
2672
  }
2673
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2674
  /* Unsubscribe a given user from our list */
2675
  public function yikes_easy_mailchimp_unsubscribe_user() {
2676
- $nonce = $_REQUEST['nonce'];
2677
- $list_id = $_REQUEST['mailchimp-list'];
2678
  $email_id = $_REQUEST['email_id'];
 
2679
  // verify our nonce
2680
  if( ! wp_verify_nonce( $nonce, 'unsubscribe-user-' . $email_id ) ) {
2681
  wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) , __( "Failed nonce validation" , 'yikes-inc-easy-mailchimp-extender' ) , array( 'response' => 500 , 'back_link' => true ) );
2682
  }
2683
- // only re-run the API request if our API key has changed
2684
- // initialize MailChimp Class
2685
- $api_key = yikes_get_mc_api_key();
2686
- $dash_position = strpos( $api_key, '-' );
2687
- if( $dash_position !== false ) {
2688
- $api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/unsubscribe.json';
2689
- }
2690
- $response = wp_remote_post( $api_endpoint, array(
2691
- 'body' => array(
2692
- 'apikey' => $api_key,
2693
- 'id' => $list_id,
2694
- 'email' => array( 'leid' => $email_id ),
2695
- 'send_goodbye' => false,
2696
- 'send_notify' => false
2697
- ),
2698
- 'timeout' => 10,
2699
- 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true )
2700
- ) );
2701
- if( ! is_wp_error( $response ) ) {
2702
- $response_body = json_decode( wp_remote_retrieve_body( $response ), true );
2703
- if( isset( $response_body['error'] ) ) {
2704
- if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
2705
- require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
2706
- $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
2707
- $error_logging->yikes_easy_mailchimp_write_to_error_log( $response_body['error'], __( "Unsubscribe User" , 'yikes-inc-easy-mailchimp-extender' ) , __( "Manage List Page" , 'yikes-inc-easy-mailchimp-extender' ) );
2708
- }
2709
- }
2710
- wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-view-list&list-id=' . $list_id . '&user-unsubscribed=true' ) ) );
2711
- exit;
2712
  }
 
 
 
2713
  }
2714
 
2715
  public function yikes_easy_mailchimp_create_missing_error_log() {
@@ -2737,31 +2789,31 @@ class Yikes_Inc_Easy_Mailchimp_Forms_Admin {
2737
  * Probably Move these to its own file,
2738
  */
2739
  public function yikes_easy_mailchimp_clear_transient_data() {
2740
- $referer = wp_get_referer();
2741
- // grab & store our variables ( associated list & form name )
2742
- $nonce = $_REQUEST['nonce'];
2743
  // verify our nonce
 
2744
  if( ! wp_verify_nonce( $nonce, 'clear-mc-transient-data' ) ) {
2745
  wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) , __( "Failed nonce validation" , 'yikes-inc-easy-mailchimp-extender' ) , array( 'response' => 500 , 'back_link' => true ) );
2746
  }
2747
- // delete all of the integration settings list data in the cache
 
2748
  $list_ids = $this->get_mailchimp_list_ids_on_account();
2749
- // confirm the list IDs was returned and is not empty
2750
- if( isset( $list_ids ) && ! empty( $list_ids ) ) {
2751
- foreach( $list_ids as $id ) {
2752
- // loop over each interest group and delete the transient associated with it
2753
- // this is created & stored on the integration list page
2754
- // id = groupID_interest_group
2755
- delete_transient( $id . '_interest_group' );
2756
- }
2757
  }
2758
- // Delete list data transient
2759
  delete_transient( 'yikes-easy-mailchimp-list-data' );
2760
- // Delete list account data
2761
  delete_transient( 'yikes-easy-mailchimp-account-data' );
2762
- // Delete list account data
2763
  delete_transient( 'yikes-easy-mailchimp-profile-data' );
 
 
 
2764
  // if the request came from the settings page, redirect to the settings page
 
2765
  if ( $referer && ( strpos( $referer, 'yikes-inc-easy-mailchimp-settings' ) > 0 ) ) {
2766
  wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=api-cache-settings&transient-cleared=true' ) ) );
2767
  } else {
@@ -2781,42 +2833,21 @@ class Yikes_Inc_Easy_Mailchimp_Forms_Admin {
2781
  */
2782
  public function get_mailchimp_list_ids_on_account() {
2783
  $api_key = yikes_get_mc_api_key();
2784
- if( ! $api_key ) {
2785
  // if no api key is set/site is not connected, return an empty array
2786
  return array();
2787
  }
2788
- $dash_position = strpos( $api_key, '-' );
2789
- if( $dash_position !== false ) {
2790
- $api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/list.json';
2791
- }
2792
- $mailchimp_lists = wp_remote_post( $api_endpoint, array(
2793
- 'body' => array(
2794
- 'apikey' => $api_key,
2795
- 'limit' => 100
2796
- ),
2797
- 'timeout' => 10,
2798
- 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true )
2799
- ) );
2800
- if( ! is_wp_error( $mailchimp_lists ) ) {
2801
- $list_data = json_decode( wp_remote_retrieve_body( $mailchimp_lists ), true );
2802
- if( isset( $list_data['error'] ) ) {
2803
- if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
2804
- require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
2805
- $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
2806
- $error_logging->yikes_easy_mailchimp_write_to_error_log( $list_data['error'], __( "Get List IDs" , 'yikes-inc-easy-mailchimp-extender' ) , __( "Clear API Cache" , 'yikes-inc-easy-mailchimp-extender' ) );
2807
- }
2808
- }
2809
- $mail_chimp_list_ids = array();
2810
- if( isset( $list_data['data'] ) ) {
2811
- foreach( $list_data['data'] as $list ) {
2812
- $mail_chimp_list_ids[] = $list['id'];
2813
- }
2814
- return $mail_chimp_list_ids;
2815
- } else {
2816
  return array();
2817
  }
 
2818
  }
2819
- return;
 
2820
  }
2821
 
2822
  /*
7
  *
8
  * @package Yikes_Inc_Easy_Mailchimp_Forms
9
  * @subpackage Yikes_Inc_Easy_Mailchimp_Forms/admin
10
+ * @author YIKES, Inc. <plugins@yikesinc.com>
11
  */
12
  class Yikes_Inc_Easy_Mailchimp_Forms_Admin {
13
 
281
  */
282
  public function easy_forms_plugin_action_links( $links ) {
283
  $links[] = '<a href="'. esc_url( get_admin_url(null, 'admin.php?page=yikes-inc-easy-mailchimp-settings') ) .'">' . __( 'Settings', 'yikes-inc-easy-mailchimp-extender' ) . '</a>';
284
+ $links[] = '<a href="' . esc_url( 'http://www.yikesplugins.com?utm_source=plugins-page&utm_medium=plugin-row&utm_campaign=admin' ) . '" target="_blank">' . __( 'More plugins by YIKES, Inc.' , 'yikes-inc-easy-mailchimp-extender' ) . '</a>';
285
  return $links;
286
  }
287
 
288
  /**
289
+ * Add a disclaimer to the admin footer for all YIKES pages to ensure that users understand there is no correlation between this plugin and MailChimp.
290
  * This plugin simply provides the service of linking MailChimp with your site.
291
  *
292
  * @since 6.0
299
  $page = get_current_screen();
300
  $base = $page->base;
301
  if ( strpos( $base, 'yikes-' ) !== false ) {
302
+ $disclaimer_text = sprintf( '<em>' . __( 'Disclaimer: <strong>Easy Forms for MailChimp</strong> is in no way endorsed, affiliated or backed by MailChimp, or its parent company Rocket Science Group.', 'yikes-inc-easy-mailchimp-extender' ), '<a href="https://wordpress.org/support/view/plugin-reviews/give?filter=5#postform" target="_blank" class="give-rating-link" data-rated="' . __( 'Thanks :)', 'yikes-inc-easy-mailchimp-extender' ) . '">', '</a></em>' );
303
  return $disclaimer_text;
304
  } else {
305
  return $footer_text;
558
  public function yikes_easy_mailchimp_display_review_us_notice() {
559
  /* Lets only display our admin notice on YT4WP pages to not annoy the hell out of people :) */
560
  if ( in_array( get_current_screen()->base , array( 'dashboard' , 'post' , 'edit' ) ) || strpos( get_current_screen()->base ,'yikes-inc-easy-mailchimp') !== false ) {
561
+
562
+ $plugin_name = '<strong>Easy Forms for MailChimp</strong>';
563
  // Review URL - Change to the URL of your plugin on WordPress.org
564
  $reviewurl = 'https://wordpress.org/support/view/plugin-reviews/yikes-inc-easy-mailchimp-extender';
565
  $addons_url = esc_url( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-addons' ) );
566
  $nobugurl = esc_url_raw( add_query_arg( 'yikes_easy_mc_icons_nobug', '1', admin_url() ) );
567
+
568
+ // Make sure all of our variables have values
569
+ $reviewurl = ( ! empty( $reviewurl ) ) ? $reviewurl : '';
570
+ $addons_url = ( ! empty( $addons_url ) ) ? $addons_url : '';
571
+ $nobugurl = ( ! empty( $nobugurl ) ) ? $nobugurl : '';
572
+
573
  $review_message = '<div id="yikes-mailchimp-logo"></div>';
574
+ $review_message .= sprintf(
575
+ __( 'It looks like you\'ve been using %1$s for 2 weeks now. We hope you\'re enjoying the features included with the free version. If so, please consider leaving us a review. Reviews only help to catch other users attention as well as provide us with feedback to grow and improve upon. If you\'re really enjoying the plugin, consider buying an add-on or developer license for some really awesome features and premium support.' , 'yikes-inc-easy-mailchimp-extender' )
576
+ . '<span class="button-container"> <a href="%2$s" target="_blank" class="button-secondary"><span class="dashicons dashicons-star-filled"></span>'
577
+ . __( "Leave A Review" , 'yikes-inc-easy-mailchimp-extender' )
578
+ . '</a> <a href="%3$s" class="button-secondary"><span class="dashicons dashicons-upload"></span>'
579
+ . __( "View Addons" , 'yikes-inc-easy-mailchimp-extender' )
580
+ . '</a> <a href="%4$s" class="button-secondary"><span class="dashicons dashicons-no-alt"></span>'
581
+ . __( "Dismiss" , 'yikes-inc-easy-mailchimp-extender' )
582
+ . "</a> </span>",
583
+ $plugin_name, $reviewurl, $addons_url, $nobugurl );
584
  ?>
585
  <div id="review-yikes-easy-mailchimp-notice">
586
  <?php echo $review_message; ?>
608
 
609
  /* Display a warning users who are using PHP < 5.3 */
610
  public function display_php_warning() {
611
+ $message = __( 'Easy Forms for MailChimp requires a minimum of PHP 5.3. The plugin will not function properly until you update. Please reach out to your host provider for assistance.' , 'yikes-inc-easy-mailchimp-extender' );
612
  echo "<div class='error'> <p><span class='dashicons dashicons-no-alt' style='color:rgb(231, 98, 98)'></span> $message</p></div>";
613
  }
614
 
673
  /* Pass our form data to our JS file for use */
674
  wp_localize_script( 'editor', 'localized_data', array(
675
  'forms' => json_encode( $lists ),
676
+ 'button_title' => __( 'Easy Forms for MailChimp', 'yikes-inc-easy-mailchimp-extender' ),
677
+ 'popup_title' => __( 'Easy Forms for MailChimp', 'yikes-inc-easy-mailchimp-extender' ),
678
  'list_id_label' => __( 'MailChimp Opt-In Form' , 'yikes-inc-easy-mailchimp-extender' ),
679
  'show_title_label' => __( 'Display Form Title' , 'yikes-inc-easy-mailchimp-extender' ),
680
  'show_description_label' => __( 'Display Form Description' , 'yikes-inc-easy-mailchimp-extender' ),
846
  case 'd/m/Y':
847
  case 'dd/mm/yyyy':
848
  case 'DD/MM/YYYY':
849
+ case 'dd/mm':
850
+ case 'DD/MM':
851
  return( 'dd/mm' );
852
  break;
853
  }
883
 
884
  /* Top Level Menu 'Easy MailChimp' */
885
  add_menu_page(
886
+ __( 'Easy Forms', 'yikes-inc-easy-mailchimp-extender' ),
887
  'Easy Forms',
888
+ apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
889
  'yikes-inc-easy-mailchimp',
890
  '', // no callback,
891
  YIKES_MC_URL . 'includes/images/MailChimp_Assets/Freddie_wink_icon.png'
894
  // Sub Pages
895
  /*************/
896
 
897
+ /* Easy MailChimp Settings */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
898
 
899
+ /* Easy MailChimp Manage Forms */
900
+ add_submenu_page(
901
+ 'yikes-inc-easy-mailchimp',
902
+ __( 'Opt-in Forms', 'yikes-inc-easy-mailchimp-extender' ),
903
+ __( 'Opt-in Forms', 'yikes-inc-easy-mailchimp-extender' ),
904
+ apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
905
+ 'yikes-inc-easy-mailchimp',
906
+ array( $this, 'generateManageFormsPage' )
907
+ );
908
 
909
+ /* Easy MailChimp Manage Lists */
910
+ add_submenu_page(
911
+ 'yikes-inc-easy-mailchimp',
912
+ __( 'Mailing Lists', 'yikes-inc-easy-mailchimp-extender' ),
913
+ __( 'Mailing Lists', 'yikes-inc-easy-mailchimp-extender' ),
914
+ apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
915
+ 'yikes-inc-easy-mailchimp-lists',
916
+ array( $this, 'generateManageListsPage' )
917
+ );
918
 
919
 
920
+ /*
921
+ * Custom action hook to hook into to add additional
922
+ * menu items from extensions
923
+ */
924
+ do_action( 'yikes-mailchimp-menu' );
 
 
 
 
 
 
 
925
 
926
 
927
+ /* Easy MailChimp Account Overview */
928
+ if ( get_option( 'yikes-mc-api-validation' ) == 'valid_api_key' ) {
929
+ /* Easy MailChimp Settings */
930
  add_submenu_page(
931
  'yikes-inc-easy-mailchimp',
932
+ __( 'Account', 'yikes-inc-easy-mailchimp-extender' ),
933
+ __( 'Account', 'yikes-inc-easy-mailchimp-extender' ),
934
+ apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
935
+ 'yikes-inc-easy-mailchimp-account-overview',
936
+ array( $this, 'generateAccountDetailsPage' )
937
  );
938
+ }
939
 
 
 
 
 
 
 
 
 
 
940
 
941
+ /* Easy MailChimp Settings */
942
+ add_submenu_page(
943
+ 'yikes-inc-easy-mailchimp',
944
+ __( 'Settings.', 'yikes-inc-easy-mailchimp-extender' ),
945
+ __( 'Settings', 'yikes-inc-easy-mailchimp-extender' ),
946
+ apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
947
+ 'yikes-inc-easy-mailchimp-settings',
948
+ array( $this, 'generatePageOptions' )
949
+ );
950
 
951
+ /* Support Page */
952
+ add_submenu_page(
953
+ 'yikes-inc-easy-mailchimp',
954
+ __( 'Support', 'yikes-inc-easy-mailchimp-extender' ),
955
+ __( 'Support', 'yikes-inc-easy-mailchimp-extender' ),
956
+ apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
957
+ 'yikes-inc-easy-mailchimp-support',
958
+ array( $this, 'generateSupportPage' )
959
+ );
960
 
961
+ /* Add-Ons Page */
962
+ add_submenu_page(
963
+ 'yikes-inc-easy-mailchimp',
964
+ __( 'Add-Ons', 'yikes-inc-easy-mailchimp-extender' ),
965
+ __( 'Add-Ons', 'yikes-inc-easy-mailchimp-extender' ),
966
+ apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
967
+ 'yikes-inc-easy-mailchimp-addons',
968
+ array( $this, 'generateAddOnsPage' )
969
+ );
970
 
971
+ /** Hidden Pages **/
 
 
 
 
 
 
 
 
972
 
973
+ /* Add Hidden Edit Form Page */
974
+ add_submenu_page(
975
+ 'options.php',
976
+ __( 'Edit Form', 'yikes-inc-easy-mailchimp-extender' ),
977
+ __( 'Edit Form', 'yikes-inc-easy-mailchimp-extender' ),
978
+ apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
979
+ 'yikes-mailchimp-edit-form',
980
+ array( $this, 'generateEditFormPage' )
981
+ );
982
 
983
+ /* Add Hidden Migrate Options Page */
984
+ add_submenu_page(
985
+ 'options-writing.php',
986
+ __( 'Us Easy Forms for MailChimp Upgrade Options Structure', 'yikes-inc-easy-mailchimp-extender' ),
987
+ 'Us Easy Forms for MailChimp Upgrade Options Structure',
988
+ 'manage_options',
989
+ 'yikes-inc-easy-mailchimp-update',
990
+ array( $this, 'migrate_old_yks_mc_options' )
991
+ );
992
 
993
+ /* Add Hidden Welcome Page */
994
+ add_submenu_page(
995
+ 'options.php',
996
+ __( 'Welcome', 'yikes-inc-easy-mailchimp-extender' ),
997
+ __( 'Welcome', 'yikes-inc-easy-mailchimp-extender' ),
998
+ apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
999
+ 'yikes-mailchimp-welcome',
1000
+ array( $this, 'generateWelcomePage' )
1001
+ );
1002
+
1003
+ /* Add Hidden 'View List' Page */
1004
+ add_submenu_page(
1005
+ 'options.php',
1006
+ __( 'View List', 'yikes-inc-easy-mailchimp-extender' ),
1007
+ __( 'View List', 'yikes-inc-easy-mailchimp-extender' ),
1008
+ apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
1009
+ 'yikes-mailchimp-view-list',
1010
+ array( $this, 'generateViewListPage' )
1011
+ );
1012
+
1013
+ /* Add Hidden View User Page */
1014
+ add_submenu_page(
1015
+ 'options.php',
1016
+ __( 'View User', 'yikes-inc-easy-mailchimp-extender' ),
1017
+ __( 'View User', 'yikes-inc-easy-mailchimp-extender' ),
1018
+ apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ),
1019
+ 'yikes-mailchimp-view-user',
1020
+ array( $this, 'generateViewUserPage' )
1021
+ );
1022
 
1023
  }
1024
 
1032
  }
1033
 
1034
  /**
1035
+ * Generate Us Easy MailChimp Manage Forms Page
1036
  *
1037
  * @since 1.0.0
1038
  */
1041
  }
1042
 
1043
  /**
1044
+ * Generate Us Easy MailChimp Manage Lists Page
1045
  *
1046
  * @since 1.0.0
1047
  */
1050
  }
1051
 
1052
  /**
1053
+ * Generate Us Easy MailChimp Account Details Page
1054
  *
1055
  * @since 1.0.0
1056
  */
1059
  }
1060
 
1061
  /**
1062
+ * Generate Us Easy MailChimp Support Page
1063
  *
1064
  * @since 1.0.0
1065
  */
1068
  }
1069
 
1070
  /**
1071
+ * Generate Us Easy MailChimp Edit Form Page
1072
  *
1073
  * @since 1.0.0
1074
  */
1077
  }
1078
 
1079
  /**
1080
+ * Generate Us Easy MailChimp Welcome Page
1081
  *
1082
  * @since 1.0.0
1083
  */
1086
  }
1087
 
1088
  /**
1089
+ * Generate Us Easy MailChimp View List Page
1090
  *
1091
  * @since 1.0.0
1092
  */
1095
  }
1096
 
1097
  /**
1098
+ * Generate Us Easy MailChimp View User Page
1099
  *
1100
  * @since 1.0.0
1101
  */
1229
  function yikes_mc_validate_api_key( $input ) {
1230
  if( $input === '' ) {
1231
  update_option( 'yikes-mc-api-validation' , 'invalid_api_key' );
1232
+ return '';
1233
  }
1234
  $api_key = strip_tags ( trim( $input ) );
1235
  $dash_position = strpos( trim( $input ), '-' );
1236
  if( $dash_position !== false ) {
1237
+ $manager = new Yikes_Inc_Easy_MailChimp_API_Manager( $api_key );
1238
  } else {
1239
  update_option( 'yikes-mc-api-invalid-key-response', __( 'Your API key appears to be invalid.', 'yikes-inc-easy-mailchimp-extender' ) );
1240
  update_option( 'yikes-mc-api-validation' , 'invalid_api_key' );
1241
  return $api_key;
1242
  }
1243
+
1244
+ $response = $manager->get_account_handler()->get_account( false );
1245
+ if( ! is_wp_error( $response ) ) {
1246
+ update_option( 'yikes-mc-api-validation' , 'valid_api_key' );
 
 
 
 
 
 
 
 
1247
  // Clear the API key transient data
1248
+ $this->delete_yikes_mailchimp_transients();
 
1249
  } else {
 
1250
  $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
1251
+ $error_logging->yikes_easy_mailchimp_write_to_error_log( $response->get_error_message() , __( "Connecting to MailChimp" , 'yikes-inc-easy-mailchimp-extender' ) , __( "Settings Page/General Settings" , 'yikes-inc-easy-mailchimp-extender' ) );
1252
+ update_option( 'yikes-mc-api-invalid-key-response' , $response->get_error_message() );
1253
  update_option( 'yikes-mc-api-validation' , 'invalid_api_key' );
1254
  }
1255
  // returned the api key
1257
  }
1258
 
1259
  /**
1260
+ * Generate Us Easy Forms for MailChimp Options Page
1261
  *
1262
  * @since 1.0.0
1263
  */
1271
  * to form fields. (input, dropdowns, buttons etc.)
1272
  * @since v5.5 re-write
1273
  **/
1274
+ public function is_user_mc_api_valid_form( $echo = true ) {
1275
+ if ( $echo == true ) {
1276
+ if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) == 'invalid_api_key' ) {
1277
  echo 'disabled="disabled"';
1278
  }
1279
  } else {
1280
+ if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) == 'invalid_api_key' ) {
1281
  return false;
1282
  } else {
1283
  return true;
1346
  delete_option( 'yikes-mc-lists' );
1347
  ?>
1348
  <div class="yikes-easy-mc-updated migrate-options-notice">
1349
+ <p><?php printf( __( "The previously stored options for %s have been cleared from the database. You should update the plugin options on the <a href='%s' title='Settings Page'>settings page</a> before continuing. You should also update the shortcodes used to generate your forms, and any widgets you may have previously set-up.", 'yikes-inc-easy-mailchimp-extender' ), '<strong>Us Easy Forms for MailChimp</strong>', admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings' ) ); ?></p>
1350
  </div>
1351
  <?php
1352
  } else {
1353
  ?>
1354
  <div class="yikes-easy-mc-updated migrate-options-notice">
1355
+ <p><?php printf( __( "It looks like you're upgrading from a previous version of %s.", 'yikes-inc-easy-mailchimp-extender' ), '<strong>Us Easy Forms for MailChimp</strong>' ); ?> <?php printf( __( "In the newest version of %s, the options data structure has changed. We've also moved the mailing lists into its own database table to allow for some higher level customization. Now you can easily create multiple forms and assign them to the same mailing list." , 'yikes-inc-easy-mailchimp-extender' ), '<strong>Us Easy Forms for MailChimp</strong>' ); ?></p>
1356
  <p><?php _e( "Before you continue, it's strongly recommended you the perform the migration to ensure the plugin continues to function properly.", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
1357
  <p><em><?php _e( "It's also strongly recommended that you take a backup of your database.", 'yikes-inc-easy-mailchimp-extender' ); ?></em></p>
1358
  <section id="migration-buttons">
1418
 
1419
  $custom_styles = isset( $new_options['custom_styles'] ) ? $new_options['custom_styles']: '0'; // store as an array with all of our styles
1420
  $custom_template = isset( $new_options['custom_template'] ) ? $new_options['custom_template'] : '0'; // store template data as an array ( active , template used )
 
1421
  $redirect_user_on_submit = isset( $new_options['yks_mailchimp_redirect_'.$list_id] ) ? '1' : '0';
1422
  $redirect_page = isset( $new_options['page_id_'.$list_id] ) ? $new_options['page_id_'.$list_id] : '';
1423
 
1429
  'fields' => $fields,
1430
  'custom_styles' => $custom_styles,
1431
  'custom_template' => $custom_template,
 
1432
  'redirect_user_on_submit' => $redirect_user_on_submit,
1433
  'redirect_page' => $redirect_page,
1434
  'submission_settings' => '',
1511
  )
1512
  );
1513
  ?>
1514
+ <h3><?php _e( 'Create a New Signup Form' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
1515
 
1516
+ <div class="inside">
1517
 
1518
+ <p class="description"><?php _e( "Give your form a name, select a MailChimp list to assign users to, then click 'Create'.", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1519
 
1520
+ <form id="import-list-to-site" method="POST" action="<?php echo $url; ?>">
1521
+ <input type="hidden" name="import-list-to-site" value="1" />
1522
+ <!-- Name your new form -->
1523
+ <label for="form-name"><strong><?php _e( 'Form Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
1524
+ <input type="text" class="widefat input-field" placeholder="<?php _e( 'Form Name' , 'yikes-inc-easy-mailchimp-extender' ); ?>" name="form-name" id="form-name" <?php $this->is_user_mc_api_valid_form( true ); ?> required>
1525
+ </label>
1526
+ <!-- Name your new form -->
1527
+ <label for="form-description"><strong><?php _e( 'Form Description' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
1528
+ <textarea class="widefat input-field form-description" placeholder="<?php _e( 'Form Description' , 'yikes-inc-easy-mailchimp-extender' ); ?>" name="form-description" id="form-description" <?php $this->is_user_mc_api_valid_form( true ); ?>></textarea>
1529
+ </label>
1530
+ <!-- Associate this form with a list! -->
1531
+ <label for="associated-list"><strong><?php _e( 'Associated List' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
1532
+ <select name="associated-list" id="associated-list" class=" input-field" <?php $this->is_user_mc_api_valid_form( true ); disabled( true, empty( $lists ) ); ?>>
1533
  <?php
1534
+ if ( ! empty( $lists ) ) {
1535
+ foreach( $lists as $mailing_list ) {
1536
  ?>
1537
+ <option value="<?php echo $mailing_list['id']; ?>"><?php echo stripslashes( $mailing_list['name'] ) . ' (' . $mailing_list['stats']['member_count'] . ') '; ?></option>
 
 
1538
  <?php
1539
  }
1540
+ } else {
1541
+ if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) == 'invalid_api_key' ) {
1542
+ ?>
1543
+ <option><?php echo __( "Please enter a valid API key." , 'yikes-inc-easy-mailchimp-extender' ); ?></option>
1544
+ <?php
1545
+ } else {
1546
  ?>
1547
+ <option><?php echo __( "No lists were found on the account." , 'yikes-inc-easy-mailchimp-extender' ); ?></option>
 
 
1548
  <?php
1549
+
1550
  }
1551
  }
1552
  ?>
1553
+ </select>
1554
+
1555
  <?php
1556
+ if ( isset( $_GET['transient-cleared'] ) ) {
1557
+ if ( 'true' === $_GET['transient-cleared'] ) {
 
 
1558
  ?>
1559
+ <div class="yikes-list-refreshed-notice">
1560
+ <p><?php esc_attr_e( 'MailChimp list data has been succesfully refreshed.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
1561
+ </div>
1562
  <?php
1563
  }
1564
+ }
 
1565
 
1566
+ if( isset( $lists ) && empty( $lists ) ) {
1567
+ if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) != 'invalid_api_key' ) {
1568
+ ?>
1569
+ <p class="description">
1570
+ <?php printf( __( 'Head over to <a href="http://www.MailChimp.com" title="%s">MailChimp</a> to create a new list.', 'yikes-inc-easy-mailchimp-extender' ) , __( 'Create a list' , 'yikes-inc-easy-mailchimp-extender' ) ); ?>
1571
+ </p>
1572
+ <?php
1573
+ }
1574
+ }
1575
+ ?>
1576
+ </label>
1577
  <?php
1578
+ if( $this->is_user_mc_api_valid_form( false ) ) {
1579
+ echo submit_button( __( 'Create', 'yikes-inc-easy-mailchimp-extender' ) , 'primary' , '' , false , array( 'style' => 'margin:.75em 0 .5em 0;' ) );
1580
+ } else {
1581
+ echo '<p class="description">' . __( "Please enter a valid MailChimp API key to get started." , 'yikes-inc-easy-mailchimp-extender' ) . '</p>';
1582
+ ?>
1583
+ <a href="<?php echo esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&settings-updated=true' ) ); ?>"><?php _e( 'general settings' , 'yikes-inc-easy-mailchimp-extender' ); ?></a>
1584
+ <?php
1585
+ }
1586
  ?>
1587
+ </form>
1588
+
1589
+ <!-- Clear API CACHE -->
1590
+ <?php
1591
+ if( isset( $lists ) && ! empty( $lists ) ) {
1592
+ if ( false !== get_transient( 'yikes-easy-mailchimp-list-data' ) ) { ?>
1593
+ <form action="<?php echo esc_url_raw( add_query_arg( array( 'action' => 'yikes-easy-mc-clear-transient-data' , 'nonce' => wp_create_nonce( 'clear-mc-transient-data' ) ) ) ); ?>" method="post">
1594
+ <input type="submit" class="button-secondary clear-mailchimp-api-cache" value="<?php _e( 'Refresh Lists' , 'yikes-inc-easy-mailchimp-extender' ); ?>" />
1595
+ </form>
1596
+ <?php }
1597
+ }
1598
+ ?>
1599
+ </div> <!-- .inside -->
1600
  <?php
1601
  }
1602
 
1632
  ?><option <?php selected( $redirect_page , $page->ID ); ?> value="<?php echo $page->ID; ?>"><?php echo $page->post_title; ?></option><?php
1633
  }
1634
  ?>
 
1635
  </optgroup>
1636
  <?php
1637
  }
1638
  }
1639
  }
1640
  ?>
1641
+ <!-- Add the Custom URL option -->
1642
+ <optgroup label="Custom URL">
1643
+ <option <?php selected( $redirect_page, 'custom_url' ); ?> value="custom_url"><?php echo __( 'Custom URL', 'yikes-inc-easy-mailchimp-extender' ); ?></option>
1644
+ </optgroup>
1645
  </select>
1646
 
1647
  <label name="custom-redirect-url" class="custom_redirect_url_label" <?php if( ! isset( $redirect_page ) || $redirect_page != 'custom_url' ) { echo 'style="display:none;"'; } ?>>
1680
  <div class="postbox yikes-easy-mc-postbox show-some-love-container">
1681
 
1682
  <!-- review us container -->
1683
+ <h3 data-alt-text="<?php _e( 'About YIKES, Inc.', 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'Show Us Some Love' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
1684
  <div id="review-yikes-easy-mc" class="inside">
1685
 
1686
  <p>
1770
  $available_interest_groups = array();
1771
 
1772
  // loop over merge variables
1773
+ if ( ! empty( $merge_variables['merge_fields'] ) ) {
1774
+ $available_merge_variables = wp_list_pluck( $merge_variables['merge_fields'], 'tag' );
1775
  }
1776
 
1777
  // loop over interest groups
1778
+ if ( ! empty( $interest_groups ) ) {
1779
+ $available_interest_groups = array_keys( $interest_groups );
1780
  }
1781
 
1782
  // build our assigned fields
2137
  <td>
2138
  <?php
2139
  if( $field['type'] != 'checkboxes' ) {
2140
+ if ( ! isset( $field['default_choice'] ) ) {
2141
+ $group_options = json_decode( stripslashes( $field['groups'] ), true );
2142
+ $field['default_choice'] = key( $group_options );
2143
+ }
2144
  } else {
2145
+ if ( ! isset( $field['default_choice'] ) ) {
2146
+ $field['default_choice'] = array();
2147
+ }
2148
  }
2149
+
2150
+ foreach( json_decode( $field['groups'], true ) as $id => $group ) {
2151
+ $field_id = "{$field['group_id']}-{$id}";
2152
  $field_type = 'hidden' == $field['type'] ? 'radio' : $field['type'];
2153
  $field_type = 'checkboxes' == $field_type ? 'checkbox' : $field_type;
2154
  $field_name = "field[{$field['group_id']}][default_choice]";
2160
  case 'radio':
2161
  case 'hidden':
2162
  default:
2163
+ $checked = checked( $field['default_choice'], $id, false );
2164
  break;
2165
 
2166
  case 'checkbox':
2167
+ if ( in_array( $id, (array) $field['default_choice'] ) ) {
2168
  $checked = checked( true, true, false );
2169
  }
2170
  }
2174
  <input id="<?php echo $field_id; ?>"
2175
  type="<?php echo $field_type; ?>"
2176
  name="<?php echo $field_name; ?>"
2177
+ value="<?php echo $id; ?>" <?php echo $checked; ?>>
2178
+ <?php echo stripslashes( str_replace( '\'' , '' , $group ) ); ?>&nbsp;
2179
  </label>
2180
  <?php
 
2181
  } ?>
2182
  <p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
2183
  </td>
2196
  </td>
2197
  <td>
2198
  <select type="default" name="field[<?php echo $field['group_id']; ?>][default_choice]">
2199
+ <?php foreach( json_decode( stripslashes_deep( $field['groups'] ) , true ) as $id => $group ) { ?>
2200
+ <option value="<?php echo $id; ?>" <?php selected( $field['default_choice'] , $id ); ?>><?php echo stripslashes( $group ); ?></option>
2201
+ <?php } ?>
2202
  </select>
2203
  <p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
2204
  </td>
2383
  */
2384
  public function build_available_merge_vars( $form_fields , $available_merge_variables ) {
2385
  $fields_assigned_to_form = array();
2386
+ foreach ( $form_fields as $field ) {
2387
+ if ( isset( $field['merge'] ) ) {
2388
+ $fields_assigned_to_form[ $field['merge'] ] = true;
 
 
 
 
2389
  }
2390
  }
2391
+
2392
+ if ( ! empty( $available_merge_variables['merge_fields'] ) ) {
2393
+ ?>
2394
+ <ul id="available-fields"><?php
2395
+ foreach ( $available_merge_variables['merge_fields'] as $merge_var ) {
2396
+ if ( isset( $fields_assigned_to_form[ $merge_var['tag'] ] ) ) {
2397
  ?>
2398
+ <li class="available-form-field not-available"
2399
+ alt="<?php echo $merge_var['tag']; ?>"
2400
+ data-attr-field-type="<?php echo esc_attr( $merge_var['type'] ); ?>"
2401
+ data-attr-field-name="<?php echo esc_attr( $merge_var['name'] ); ?>"
2402
+ data-attr-form-id="<?php echo esc_attr( $available_merge_variables['list_id'] ); ?>"
2403
+ title="<?php esc_attr_e( 'Already assigned to your form', 'yikes-inc-easy-mailchimp-extender' ); ?>"
2404
+ disabled="disabled">
2405
+ <?php echo stripslashes( $merge_var['name'] );
2406
+ if ( $merge_var['required'] ) {
2407
+ echo ' <span class="field-required" title="' . __( 'required field', 'yikes-inc-easy-mailchimp-extender' ) . '">*</span>';
2408
+ } ?>
2409
+ <small class="field-type-text"><?php echo $merge_var['type']; ?></small>
2410
+ </li>
2411
  <?php
2412
  } else {
2413
  ?>
2414
+ <li class="available-form-field"
2415
+ alt="<?php echo $merge_var['tag']; ?>"
2416
+ data-attr-field-type="<?php echo esc_attr( $merge_var['type'] ); ?>"
2417
+ data-attr-field-name="<?php echo esc_attr( $merge_var['name'] ); ?>"
2418
+ data-attr-form-id="<?php echo esc_attr( $available_merge_variables['list_id'] ); ?>">
2419
+ <?php echo stripslashes( $merge_var['name'] );
2420
+ if ( $merge_var['required'] ) {
2421
+ echo ' <span class="field-required" title="' . __( 'required field', 'yikes-inc-easy-mailchimp-extender' ) . '">*</span>';
2422
+ } ?>
2423
+ <small class="field-type-text"><?php echo $merge_var['type']; ?></small>
2424
+ </li>
2425
  <?php
2426
  }
2427
  }
2428
  ?></ul>
2429
+ <a href="#" class="add-field-to-editor button-secondary yikes-easy-mc-hidden" style="display:none;">
2430
+ <small>
2431
+ <span class="dashicons dashicons-arrow-left-alt add-to-form-builder-arrow"></span> <?php _e( 'Add to Form Builder', 'yikes-inc-easy-mailchimp-extender' ); ?>
2432
+ </small>
2433
+ </a>
2434
  <?php
2435
  }
2436
  }
2444
  */
2445
  public function build_available_interest_groups( $form_fields , $available_interest_groups , $list_id ) {
2446
  $fields_assigned_to_form = array();
2447
+ if ( ! empty( $form_fields ) ) {
2448
+ foreach ( $form_fields as $field ) {
2449
+ if ( isset( $field['group_id'] ) ) {
2450
+ $fields_assigned_to_form[ $field['group_id'] ] = true;
2451
  }
2452
  }
2453
  }
2454
+
2455
+ if ( ! empty( $available_interest_groups ) ) {
2456
+ ?>
2457
+ <ul id="available-interest-groups"><?php
2458
+ foreach ( $available_interest_groups as $interest_group ) {
2459
+ if ( isset( $fields_assigned_to_form[ $interest_group['id'] ] ) ) {
2460
  ?>
2461
+ <li class="available-interest-group not-available" alt="<?php echo $interest_group['id']; ?>" data-attr-field-name="<?php echo stripslashes( $interest_group['title'] ); ?>" data-attr-field-type="<?php echo $interest_group['type']; ?>" data-attr-form-id="<?php echo $list_id; ?>" title="<?php _e( 'Already assigned to your form', 'yikes-inc-easy-mailchimp-extender' ); ?>" disabled="disabled"><?php echo stripslashes( $interest_group['title'] ); ?>
2462
+ <small class="field-type-text"><?php echo $interest_group['type']; ?></small>
2463
+ </li>
2464
  <?php
2465
  } else {
2466
  ?>
2467
+ <li class="available-interest-group" alt="<?php echo $interest_group['id']; ?>" data-attr-field-name="<?php echo stripslashes( $interest_group['title'] ); ?>" data-attr-field-type="<?php echo $interest_group['type']; ?>" data-attr-form-id="<?php echo $list_id; ?>"><?php echo stripslashes( $interest_group['title'] ); ?>
2468
+ <small class="field-type-text"><?php echo $interest_group['type']; ?></small>
2469
+ </li>
2470
  <?php
2471
  }
2472
  }
2473
  ?></ul>
2474
+ <a href="#" class="add-interest-group-to-editor button-secondary yikes-easy-mc-hidden" style="display:none;">
2475
+ <small>
2476
+ <span class="dashicons dashicons-arrow-left-alt add-to-form-builder-arrow"></span> <?php _e( 'Add to Form Builder', 'yikes-inc-easy-mailchimp-extender' ); ?>
2477
+ </small>
2478
+ </a>
2479
  <?php
2480
  }
2481
  }
2502
  if ( false == $result ) {
2503
  // write it to the error log
2504
  // if the form was not created successfully
2505
+ $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
2506
+ $error_logging->maybe_write_to_log( __( 'Error creating a new form', 'yikes-inc-easy-mailchimp-extender') , __( "Creating a new form" , 'yikes-inc-easy-mailchimp-extender' ) , __( "Forms" , 'yikes-inc-easy-mailchimp-extender' ) );
 
 
2507
  wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-edit-form&sql_error=' . urlencode( __( 'Error creating a new form', 'yikes-inc-easy-mailchimp-extender' ) ) ) ) );
2508
  } else {
2509
  // redirect the user to the new form edit page
2623
  $list_id = $_POST['associated-list'];
2624
  $form_name = stripslashes( $_POST['form-name'] );
2625
  $form_description = sanitize_text_field( stripslashes( $_POST['form-description'] ) );
 
2626
  $redirect_user_on_submit = $_POST['redirect-user-on-submission'];
2627
  $redirect_page = $_POST['redirect-user-to-selection'];
2628
 
2644
  'optin' => $_POST['single-double-optin'],
2645
  'update_existing_user' => $_POST['update-existing-user'],
2646
  'send_update_email' => $_POST['update-existing-email'],
 
2647
  );
2648
 
2649
+ // Setup our error settings serialized array
2650
  $error_settings = array(
2651
+ 'success' => trim( $_POST['yikes-easy-mc-success-message'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-success-message'] ) ) : '',
2652
+ 'success-single-optin' => trim( $_POST['yikes-easy-mc-success-single-optin-message'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-success-single-optin-message'] ) ) : '',
2653
+ 'success-resubscribed' => trim( $_POST['yikes-easy-mc-user-resubscribed-success-message'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-user-resubscribed-success-message'] ) ) : '',
2654
+ 'general-error' => trim( $_POST['yikes-easy-mc-general-error-message'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-general-error-message'] ) ) : '',
2655
+ 'already-subscribed' => trim( $_POST['yikes-easy-mc-user-subscribed-message'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-user-subscribed-message'] ) ) : '',
2656
+ 'update-link' => trim( $_POST['yikes-easy-mc-user-update-link'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-user-update-link'] ) ) : '',
2657
+ 'email-subject' => trim( $_POST['yikes-easy-mc-user-email-subject'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-user-email-subject'] ) ) : '',
2658
+ 'email-body' => trim( $_POST['yikes-easy-mc-user-email-body'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-user-email-body'] ) ) : '',
2659
  );
2660
 
2661
  // Setup the new form settings array
2696
  'form_description' => $form_description,
2697
  'fields' => $assigned_fields,
2698
  'custom_template' => 0,
 
2699
  'redirect_user_on_submit' => $redirect_user_on_submit,
2700
  'redirect_page' => $redirect_page,
2701
  'submission_settings' => $submission_settings,
2717
  exit();
2718
  }
2719
 
2720
+ public static function generate_default_email_body() {
2721
+ $email_body = '<p>' . __( 'Greetings,', 'yikes-inc-easy-mailchimp-extender' ) . '</p>';
2722
+
2723
+ $email_body .= '<p>';
2724
+ $email_body .= __( 'A request has been made to update your MailChimp account profile information.', 'yikes-inc-easy-mailchimp-extender' );
2725
+ $email_body .= __( ' To do so please use the following link: ', 'yikes-inc-easy-mailchimp-extender' );
2726
+ $email_body .= '[link]';
2727
+ $email_body .= __( 'Update MailChimp Profile Info', 'yikes-inc-easy-mailchimp-extender' );
2728
+ $email_body .= '[/link]';
2729
+ $email_body .= '</p>';
2730
+
2731
+ $email_body .= '<p>' . __( 'If you did not request this update, please disregard this email.', 'yikes-inc-easy-mailchimp-extender' ) . '</p>';
2732
+
2733
+ $email_body .= '<p>&nbsp;</p>';
2734
+ $email_body .= '<p>' . sprintf( __( 'This email was sent from: %s', 'yikes-inc-easy-mailchimp-extender' ), '[url]' ) . '</p>';
2735
+ $email_body .= '<p>&nbsp;</p>';
2736
+ $email_body .= '<p>&nbsp;</p>';
2737
+ $email_body .= '<p style="font-size:13px;margin-top:5em;"><em>This email was generated by the <a href="http://www.wordpress.org/plugins/yikes-inc-easy-mailchimp-extender/" target="_blank">Easy Forms for MailChimp</a> plugin, created by <a href="http://www.yikesinc.com" target="_blank">YIKES Inc.</a></em></p>';
2738
+
2739
+ return $email_body;
2740
+ }
2741
+
2742
  /* Unsubscribe a given user from our list */
2743
  public function yikes_easy_mailchimp_unsubscribe_user() {
2744
+ $nonce = $_REQUEST['nonce'];
2745
+ $list_id = $_REQUEST['mailchimp-list'];
2746
  $email_id = $_REQUEST['email_id'];
2747
+
2748
  // verify our nonce
2749
  if( ! wp_verify_nonce( $nonce, 'unsubscribe-user-' . $email_id ) ) {
2750
  wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) , __( "Failed nonce validation" , 'yikes-inc-easy-mailchimp-extender' ) , array( 'response' => 500 , 'back_link' => true ) );
2751
  }
2752
+
2753
+ $response = yikes_get_mc_api_manager()->get_list_handler()->member_unsubscribe( $list_id, $email_id );
2754
+ if ( is_wp_error( $response ) ) {
2755
+ $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
2756
+ $error_logging->maybe_write_to_log(
2757
+ $response->get_error_code(),
2758
+ __( "Unsubscribe User", 'yikes-inc-easy-mailchimp-extender' ),
2759
+ __( "Manage List Page", 'yikes-inc-easy-mailchimp-extender' )
2760
+ );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2761
  }
2762
+
2763
+ wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-view-list&list-id=' . $list_id . '&user-unsubscribed=true' ) ) );
2764
+ exit;
2765
  }
2766
 
2767
  public function yikes_easy_mailchimp_create_missing_error_log() {
2789
  * Probably Move these to its own file,
2790
  */
2791
  public function yikes_easy_mailchimp_clear_transient_data() {
2792
+
 
 
2793
  // verify our nonce
2794
+ $nonce = $_REQUEST['nonce'];
2795
  if( ! wp_verify_nonce( $nonce, 'clear-mc-transient-data' ) ) {
2796
  wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) , __( "Failed nonce validation" , 'yikes-inc-easy-mailchimp-extender' ) , array( 'response' => 500 , 'back_link' => true ) );
2797
  }
2798
+
2799
+ // delete all of the list_id transients
2800
  $list_ids = $this->get_mailchimp_list_ids_on_account();
2801
+ foreach ( $list_ids as $id ) {
2802
+ delete_transient( "yikes_eme_list_{$id}" );
2803
+ delete_transient( "yikes_eme_merge_variables_{$id}" );
2804
+ delete_transient( "yikes_eme_interest_categories_{$id}" );
2805
+ delete_transient( "yikes_eme_segments_{$id}" );
2806
+ delete_transient( "yikes_eme_members_{$id}" );
 
 
2807
  }
2808
+
2809
  delete_transient( 'yikes-easy-mailchimp-list-data' );
 
2810
  delete_transient( 'yikes-easy-mailchimp-account-data' );
 
2811
  delete_transient( 'yikes-easy-mailchimp-profile-data' );
2812
+ delete_transient( 'yikesinc_eme_list_ids' );
2813
+ delete_transient( 'yikes_eme_lists' );
2814
+
2815
  // if the request came from the settings page, redirect to the settings page
2816
+ $referer = wp_get_referer();
2817
  if ( $referer && ( strpos( $referer, 'yikes-inc-easy-mailchimp-settings' ) > 0 ) ) {
2818
  wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=api-cache-settings&transient-cleared=true' ) ) );
2819
  } else {
2833
  */
2834
  public function get_mailchimp_list_ids_on_account() {
2835
  $api_key = yikes_get_mc_api_key();
2836
+ if ( ! $api_key ) {
2837
  // if no api key is set/site is not connected, return an empty array
2838
  return array();
2839
  }
2840
+
2841
+ $lists = get_transient( 'yikesinc_eme_list_ids' );
2842
+ if ( false === $lists ) {
2843
+ $lists = yikes_get_mc_api_manager()->get_list_handler()->get_list_ids();
2844
+ if ( is_wp_error( $lists ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2845
  return array();
2846
  }
2847
+ set_transient( 'yikesinc_eme_list_ids', $lists, HOUR_IN_SECONDS );
2848
  }
2849
+
2850
+ return $lists;
2851
  }
2852
 
2853
  /*
admin/css/jquery.qtip.min.css CHANGED
@@ -1,3 +1,3 @@
1
  /* qTip2 v2.2.1 | Plugins: tips viewport imagemap svg modal ie6 | Styles: core basic css3 | qtip2.com | Licensed MIT | Sat Sep 06 2014 18:25:07 */
2
- .qtip{position:absolute;left:-28000px;top:-28000px;display:none;max-width:280px;min-width:50px;font-size:10.5px;line-height:12px;direction:ltr;box-shadow:none;padding:0}.qtip-content{position:relative;padding:5px 9px;overflow:hidden;text-align:left;word-wrap:break-word}.qtip-titlebar{position:relative;padding:5px 35px 5px 10px;overflow:hidden;border-width:0 0 1px;font-weight:700}.qtip-titlebar+.qtip-content{border-top-width:0!important}.qtip-close{position:absolute;right:-9px;top:-9px;z-index:11;cursor:pointer;outline:medium none;border:1px solid transparent}.qtip-titlebar .qtip-close{right:4px;top:50%;margin-top:-9px}* html .qtip-titlebar .qtip-close{top:16px}.qtip-titlebar .ui-icon,.qtip-icon .ui-icon{display:block;text-indent:-1000em;direction:ltr}.qtip-icon,.qtip-icon .ui-icon{border-radius:3px;text-decoration:none}.qtip-icon .ui-icon{width:18px;height:14px;line-height:14px;text-align:center;text-indent:0;font:400 bold 10px/13px Tahoma,sans-serif;color:inherit;background:transparent none no-repeat -100em -100em}.qtip-focus{}.qtip-hover{}.qtip-default{border:1px solid #F1D031;background-color:#FFFFA3;color:#555}.qtip-default .qtip-titlebar{background-color:#FFEF93}.qtip-default .qtip-icon{border-color:#CCC;background:#F1F1F1;color:#777}.qtip-default .qtip-titlebar .qtip-close{border-color:#AAA;color:#111} .qtip-light{background-color:#fff;border-color:#E2E2E2;color:#454545}.qtip-light .qtip-titlebar{background-color:#f1f1f1} .qtip-dark{background-color:#505050;border-color:#303030;color:#f3f3f3}.qtip-dark .qtip-titlebar{background-color:#404040}.qtip-dark .qtip-icon{border-color:#444}.qtip-dark .qtip-titlebar .ui-state-hover{border-color:#303030} .qtip-cream{background-color:#FBF7AA;border-color:#F9E98E;color:#A27D35}.qtip-cream .qtip-titlebar{background-color:#F0DE7D}.qtip-cream .qtip-close .qtip-icon{background-position:-82px 0} .qtip-red{background-color:#F78B83;border-color:#D95252;color:#912323}.qtip-red .qtip-titlebar{background-color:#F06D65}.qtip-red .qtip-close .qtip-icon{background-position:-102px 0}.qtip-red .qtip-icon{border-color:#D95252}.qtip-red .qtip-titlebar .ui-state-hover{border-color:#D95252} .qtip-green{background-color:#CAED9E;border-color:#90D93F;color:#3F6219}.qtip-green .qtip-titlebar{background-color:#B0DE78}.qtip-green .qtip-close .qtip-icon{background-position:-42px 0} .qtip-blue{background-color:#E5F6FE;border-color:#ADD9ED;color:#5E99BD}.qtip-blue .qtip-titlebar{background-color:#D0E9F5}.qtip-blue .qtip-close .qtip-icon{background-position:-2px 0}.qtip-shadow{box-shadow:1px 1px 3px 1px rgba(0,0,0,.15)}.qtip-rounded,.qtip-tipsy,.qtip-bootstrap{border-radius:5px}.qtip-rounded .qtip-titlebar{border-radius:4px 4px 0 0}.qtip-youtube{border-radius:2px;box-shadow:0 0 3px #333;color:#fff;border:0 solid transparent;background:#4A4A4A;background-image:-o-linear-gradient(top,#4A4A4A 0,#000 100%)}.qtip-youtube .qtip-titlebar{background-color:#4A4A4A;background-color:rgba(0,0,0,0)}.qtip-youtube .qtip-content{padding:.75em;font:12px arial,sans-serif;filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#4a4a4a, EndColorStr=#000000);-ms-filter:"progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#4a4a4a, EndColorStr=#000000);"}.qtip-youtube .qtip-icon{border-color:#222}.qtip-youtube .qtip-titlebar .ui-state-hover{border-color:#303030}.qtip-jtools{background:#232323;background:rgba(0,0,0,.7);background-image:-o-linear-gradient(top,#717171,#232323);border:2px solid #ddd;border:2px solid rgba(241,241,241,1);border-radius:2px;box-shadow:0 0 12px #333}.qtip-jtools .qtip-titlebar{background-color:transparent;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#717171, endColorstr=#4A4A4A);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#717171, endColorstr=#4A4A4A)"}.qtip-jtools .qtip-content{filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#4A4A4A, endColorstr=#232323);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#4A4A4A, endColorstr=#232323)"}.qtip-jtools .qtip-titlebar,.qtip-jtools .qtip-content{background:transparent;color:#fff;border:0 dashed transparent}.qtip-jtools .qtip-icon{border-color:#555}.qtip-jtools .qtip-titlebar .ui-state-hover{border-color:#333}.qtip-cluetip{box-shadow:4px 4px 5px rgba(0,0,0,.4);background-color:#D9D9C2;color:#111;border:0 dashed transparent}.qtip-cluetip .qtip-titlebar{background-color:#87876A;color:#fff;border:0 dashed transparent}.qtip-cluetip .qtip-icon{border-color:#808064}.qtip-cluetip .qtip-titlebar .ui-state-hover{border-color:#696952;color:#696952}.qtip-tipsy{background:#000;background:rgba(0,0,0,.87);color:#fff;border:0 solid transparent;font-size:11px;font-family:'Lucida Grande',sans-serif;font-weight:700;line-height:16px;text-shadow:0 1px #000}.qtip-tipsy .qtip-titlebar{padding:6px 35px 0 10px;background-color:transparent}.qtip-tipsy .qtip-content{padding:6px 10px}.qtip-tipsy .qtip-icon{border-color:#222;text-shadow:none}.qtip-tipsy .qtip-titlebar .ui-state-hover{border-color:#303030}.qtip-tipped{border:3px solid #959FA9;border-radius:3px;background-color:#F9F9F9;color:#454545;font-weight:400;font-family:serif}.qtip-tipped .qtip-titlebar{border-bottom-width:0;color:#fff;background:#3A79B8;background-image:-o-linear-gradient(top,#3A79B8,#2E629D);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#3A79B8, endColorstr=#2E629D);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#3A79B8, endColorstr=#2E629D)"}.qtip-tipped .qtip-icon{border:2px solid #285589;background:#285589}.qtip-tipped .qtip-icon .ui-icon{background-color:#FBFBFB;color:#555}.qtip-bootstrap{font-size:14px;line-height:20px;color:#333;padding:1px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:6px;box-shadow:0 5px 10px rgba(0,0,0,.2);background-clip:padding-box}.qtip-bootstrap .qtip-titlebar{padding:8px 14px;margin:0;font-size:14px;font-weight:400;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.qtip-bootstrap .qtip-titlebar .qtip-close{right:11px;top:45%;border-style:none}.qtip-bootstrap .qtip-content{padding:9px 14px}.qtip-bootstrap .qtip-icon{background:transparent}.qtip-bootstrap .qtip-icon .ui-icon{width:auto;height:auto;float:right;font-size:20px;font-weight:700;line-height:18px;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.qtip-bootstrap .qtip-icon .ui-icon:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.4;filter:alpha(opacity=40)}.qtip:not(.ie9haxors) div.qtip-content,.qtip:not(.ie9haxors) div.qtip-titlebar{-webkit-filter:none;filter:none;-ms-filter:none}.qtip .qtip-tip{margin:0 auto;overflow:hidden;z-index:10}x:-o-prefocus,.qtip .qtip-tip{visibility:hidden}.qtip .qtip-tip,.qtip .qtip-tip .qtip-vml,.qtip .qtip-tip canvas{position:absolute;color:#123456;background:transparent;border:0 dashed transparent}.qtip .qtip-tip canvas{top:0;left:0}.qtip .qtip-tip .qtip-vml{behavior:url(#default#VML);display:inline-block;visibility:visible}#qtip-overlay{position:fixed;left:0;top:0;width:100%;height:100%}#qtip-overlay.blurs{cursor:pointer}#qtip-overlay div{position:absolute;left:0;top:0;width:100%;height:100%;background-color:#000;opacity:.7;filter:alpha(opacity=70);-ms-filter:"alpha(Opacity=70)"}.qtipmodal-ie6fix{position:absolute!important}
3
- /*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImpxdWVyeS5xdGlwLm1pbi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V0ZTtjb2xvcjojMTIzNDU2O2JhY2tncm91bmQ6dHJhbnNwYXJlbnQ7Ym9yZGVyOjAgZGFzaGVkIHRyYW5zcGFyZW50fS5xdGlwIC5xdGlwLXRpcCBjYW52YXN7dG9wOjA7bGVmdDowfS5xdGlwIC5xdGlwLXRpcCAucXRpcC12bWx7YmVoYXZpb3I6dXJsKCNkZWZhdWx0I1ZNTCk7ZGlzcGxheTppbmxpbmUtYmxvY2s7dmlzaWJpbGl0eTp2aXNpYmxlfSNxdGlwLW92ZXJsYXl7cG9zaXRpb246Zml4ZWQ7bGVmdDowO3RvcDowO3dpZHRoOjEwMCU7aGVpZ2h0OjEwMCV9I3F0aXAtb3ZlcmxheS5ibHVyc3tjdXJzb3I6cG9pbnRlcn0jcXRpcC1vdmVybGF5IGRpdntwb3NpdGlvbjphYnNvbHV0ZTtsZWZ0OjA7dG9wOjA7d2lkdGg6MTAwJTtoZWlnaHQ6MTAwJTtiYWNrZ3JvdW5kLWNvbG9yOiMwMDA7b3BhY2l0eTouNztmaWx0ZXI6YWxwaGEob3BhY2l0eT03MCk7LW1zLWZpbHRlcjpcImFscGhhKE9wYWNpdHk9NzApXCJ9LnF0aXBtb2RhbC1pZTZmaXh7cG9zaXRpb246YWJzb2x1dGUhaW1wb3J0YW50fSJdfQ== */
1
  /* qTip2 v2.2.1 | Plugins: tips viewport imagemap svg modal ie6 | Styles: core basic css3 | qtip2.com | Licensed MIT | Sat Sep 06 2014 18:25:07 */
2
+ .qtip{position:absolute;left:-28000px;top:-28000px;display:none;max-width:280px;min-width:50px;font-size:10.5px;line-height:12px;direction:ltr;box-shadow:none;padding:0}.qtip-content{position:relative;padding:5px 9px;overflow:hidden;text-align:left;word-wrap:break-word}.qtip-titlebar{position:relative;padding:5px 35px 5px 10px;overflow:hidden;border-width:0 0 1px;font-weight:700}.qtip-titlebar+.qtip-content{border-top-width:0!important}.qtip-close{position:absolute;right:-9px;top:-9px;z-index:11;cursor:pointer;outline:medium none;border:1px solid transparent}.qtip-titlebar .qtip-close{right:4px;top:50%;margin-top:-9px}* html .qtip-titlebar .qtip-close{top:16px}.qtip-titlebar .ui-icon,.qtip-icon .ui-icon{display:block;text-indent:-1000em;direction:ltr}.qtip-icon,.qtip-icon .ui-icon{border-radius:3px;text-decoration:none}.qtip-icon .ui-icon{width:18px;height:14px;line-height:14px;text-align:center;text-indent:0;font:400 bold 10px/13px Tahoma,sans-serif;color:inherit;background:transparent none no-repeat -100em -100em}.qtip-focus{}.qtip-hover{}.qtip-default{border:1px solid #F1D031;background-color:#FFFFA3;color:#555}.qtip-default .qtip-titlebar{background-color:#FFEF93}.qtip-default .qtip-icon{border-color:#CCC;background:#F1F1F1;color:#777}.qtip-default .qtip-titlebar .qtip-close{border-color:#AAA;color:#111} .qtip-light{background-color:#fff;border-color:#E2E2E2;color:#454545}.qtip-light .qtip-titlebar{background-color:#f1f1f1} .qtip-dark{background-color:#505050;border-color:#303030;color:#f3f3f3}.qtip-dark .qtip-titlebar{background-color:#404040}.qtip-dark .qtip-icon{border-color:#444}.qtip-dark .qtip-titlebar .ui-state-hover{border-color:#303030} .qtip-cream{background-color:#FBF7AA;border-color:#F9E98E;color:#A27D35}.qtip-cream .qtip-titlebar{background-color:#F0DE7D}.qtip-cream .qtip-close .qtip-icon{background-position:-82px 0} .qtip-red{background-color:#F78B83;border-color:#D95252;color:#912323}.qtip-red .qtip-titlebar{background-color:#F06D65}.qtip-red .qtip-close .qtip-icon{background-position:-102px 0}.qtip-red .qtip-icon{border-color:#D95252}.qtip-red .qtip-titlebar .ui-state-hover{border-color:#D95252} .qtip-green{background-color:#CAED9E;border-color:#90D93F;color:#3F6219}.qtip-green .qtip-titlebar{background-color:#B0DE78}.qtip-green .qtip-close .qtip-icon{background-position:-42px 0} .qtip-blue{background-color:#E5F6FE;border-color:#ADD9ED;color:#5E99BD}.qtip-blue .qtip-titlebar{background-color:#D0E9F5}.qtip-blue .qtip-close .qtip-icon{background-position:-2px 0}.qtip-shadow{box-shadow:1px 1px 3px 1px rgba(0,0,0,.15)}.qtip-rounded,.qtip-tipsy,.qtip-bootstrap{border-radius:5px}.qtip-rounded .qtip-titlebar{border-radius:4px 4px 0 0}.qtip-youtube{border-radius:2px;box-shadow:0 0 3px #333;color:#fff;border:0 solid transparent;background:#4A4A4A;background-image:-o-linear-gradient(top,#4A4A4A 0,#000 100%)}.qtip-youtube .qtip-titlebar{background-color:#4A4A4A;background-color:rgba(0,0,0,0)}.qtip-youtube .qtip-content{padding:.75em;font:12px arial,sans-serif;filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#4a4a4a, EndColorStr=#000000);-ms-filter:"progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#4a4a4a, EndColorStr=#000000);"}.qtip-youtube .qtip-icon{border-color:#222}.qtip-youtube .qtip-titlebar .ui-state-hover{border-color:#303030}.qtip-jtools{background:#232323;background:rgba(0,0,0,.7);background-image:-o-linear-gradient(top,#717171,#232323);border:2px solid #ddd;border:2px solid rgba(241,241,241,1);border-radius:2px;box-shadow:0 0 12px #333}.qtip-jtools .qtip-titlebar{background-color:transparent;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#717171, endColorstr=#4A4A4A);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#717171, endColorstr=#4A4A4A)"}.qtip-jtools .qtip-content{filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#4A4A4A, endColorstr=#232323);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#4A4A4A, endColorstr=#232323)"}.qtip-jtools .qtip-titlebar,.qtip-jtools .qtip-content{background:transparent;color:#fff;border:0 dashed transparent}.qtip-jtools .qtip-icon{border-color:#555}.qtip-jtools .qtip-titlebar .ui-state-hover{border-color:#333}.qtip-cluetip{box-shadow:4px 4px 5px rgba(0,0,0,.4);background-color:#D9D9C2;color:#111;border:0 dashed transparent}.qtip-cluetip .qtip-titlebar{background-color:#87876A;color:#fff;border:0 dashed transparent}.qtip-cluetip .qtip-icon{border-color:#808064}.qtip-cluetip .qtip-titlebar .ui-state-hover{border-color:#696952;color:#696952}.qtip-tipsy{background:#000;background:rgba(0,0,0,.87);color:#fff;border:0 solid transparent;font-size:11px;font-family:'Lucida Grande',sans-serif;font-weight:700;line-height:16px;text-shadow:0 1px #000}.qtip-tipsy .qtip-titlebar{padding:6px 35px 0 10px;background-color:transparent}.qtip-tipsy .qtip-content{padding:6px 10px}.qtip-tipsy .qtip-icon{border-color:#222;text-shadow:none}.qtip-tipsy .qtip-titlebar .ui-state-hover{border-color:#303030}.qtip-tipped{border:3px solid #959FA9;border-radius:3px;background-color:#F9F9F9;color:#454545;font-weight:400;font-family:serif}.qtip-tipped .qtip-titlebar{border-bottom-width:0;color:#fff;background:#3A79B8;background-image:-o-linear-gradient(top,#3A79B8,#2E629D);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#3A79B8, endColorstr=#2E629D);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#3A79B8, endColorstr=#2E629D)"}.qtip-tipped .qtip-icon{border:2px solid #285589;background:#285589}.qtip-tipped .qtip-icon .ui-icon{background-color:#FBFBFB;color:#555}.qtip-bootstrap{font-size:14px;line-height:20px;color:#333;padding:1px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:6px;box-shadow:0 5px 10px rgba(0,0,0,.2);background-clip:padding-box}.qtip-bootstrap .qtip-titlebar{padding:8px 14px;margin:0;font-size:14px;font-weight:400;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.qtip-bootstrap .qtip-titlebar .qtip-close{right:11px;top:45%;border-style:none}.qtip-bootstrap .qtip-content{padding:9px 14px}.qtip-bootstrap .qtip-icon{background:transparent}.qtip-bootstrap .qtip-icon .ui-icon{width:auto;height:auto;float:right;font-size:20px;font-weight:700;line-height:18px;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.qtip-bootstrap .qtip-icon .ui-icon:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.4;filter:alpha(opacity=40)}.qtip:not(.ie9haxors) div.qtip-content,.qtip:not(.ie9haxors) div.qtip-titlebar{filter:none;-ms-filter:none}.qtip .qtip-tip{margin:0 auto;overflow:hidden;z-index:10}x:-o-prefocus,.qtip .qtip-tip{visibility:hidden}.qtip .qtip-tip,.qtip .qtip-tip .qtip-vml,.qtip .qtip-tip canvas{position:absolute;color:#123456;background:transparent;border:0 dashed transparent}.qtip .qtip-tip canvas{top:0;left:0}.qtip .qtip-tip .qtip-vml{behavior:url(#default#VML);display:inline-block;visibility:visible}#qtip-overlay{position:fixed;left:0;top:0;width:100%;height:100%}#qtip-overlay.blurs{cursor:pointer}#qtip-overlay div{position:absolute;left:0;top:0;width:100%;height:100%;background-color:#000;opacity:.7;filter:alpha(opacity=70);-ms-filter:"alpha(Opacity=70)"}.qtipmodal-ie6fix{position:absolute!important}
3
+ /*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImpxdWVyeS5xdGlwLm1pbi5jc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsa0pBQWtKO0FBQ2xKLE1BQU0sa0JBQWtCLGNBQWMsYUFBYSxhQUFhLGdCQUFnQixlQUFlLGlCQUFpQixpQkFBaUIsY0FBYyxnQkFBZ0IsU0FBUyxDQUFDLGNBQWMsa0JBQWtCLGdCQUFnQixnQkFBZ0IsZ0JBQWdCLG9CQUFvQixDQUFDLGVBQWUsa0JBQWtCLDBCQUEwQixnQkFBZ0IscUJBQXFCLGVBQWUsQ0FBQyw2QkFBNkIsNEJBQTRCLENBQUMsWUFBWSxrQkFBa0IsV0FBVyxTQUFTLFdBQVcsZUFBZSxvQkFBb0IsNEJBQTRCLENBQUMsMkJBQTJCLFVBQVUsUUFBUSxlQUFlLENBQUMsa0NBQWtDLFFBQVEsQ0FBQyw0Q0FBNEMsY0FBYyxvQkFBb0I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g6MTAwJTtoZWlnaHQ6MTAwJTtiYWNrZ3JvdW5kLWNvbG9yOiMwMDA7b3BhY2l0eTouNztmaWx0ZXI6YWxwaGEob3BhY2l0eT03MCk7LW1zLWZpbHRlcjpcImFscGhhKE9wYWNpdHk9NzApXCJ9LnF0aXBtb2RhbC1pZTZmaXh7cG9zaXRpb246YWJzb2x1dGUhaW1wb3J0YW50fSJdfQ== */
admin/css/yikes-inc-easy-mailchimp-extender-admin.css CHANGED
@@ -303,7 +303,7 @@
303
  width: 80px;
304
  }
305
 
306
- .yikes-easy-mc-feature-image-left {
307
  float: left;
308
  margin-right: 30px;
309
  margin-left: 0 !important;
@@ -352,9 +352,6 @@ ul.support-option-list {
352
 
353
  .whats-new-wrap .feature-section:nth-child(1) img {
354
  float: left;
355
- width: 500px;
356
- margin-left: 0 !important;
357
- margin-right: 30px;
358
  }
359
 
360
  .whats-new-wrap .feature-section:nth-child(3) img {
@@ -383,6 +380,10 @@ ul.support-option-list {
383
  left: 0;
384
  }
385
 
 
 
 
 
386
  .edd-welcome-screenshots {
387
  float: right;
388
  margin-left: 10px!important;
@@ -392,9 +393,21 @@ ul.support-option-list {
392
  margin-top: 20px;
393
  }
394
 
395
- .yikes-easy-mc-feature-image {
 
 
 
 
396
  float: right;
397
- margin-left: 30px !important;
 
 
 
 
 
 
 
 
398
  }
399
 
400
  #credit-container,
@@ -630,10 +643,13 @@ ul.support-option-list {
630
  }
631
 
632
  .error-message-container label[for="yikes-easy-mc-success-message"],
 
 
633
  .error-message-container label[for="yikes-easy-mc-general-error-message"],
634
- .error-message-container label[for="yikes-easy-mc-invalid-email-message"],
635
  .error-message-container label[for="yikes-easy-mc-user-subscribed-message"],
636
- .error-message-container label[for="yikes-easy-mc-user-subscribed-update-link"] {
 
 
637
  padding: .5em 1em;
638
  background: rgba(241, 241, 241, 0.75);
639
  box-sizing: border-box;
@@ -1081,7 +1097,7 @@ ul.support-option-list {
1081
  width: 18px;
1082
  }
1083
  .field-type-text {
1084
- float: right;
1085
  }
1086
  .type-container {
1087
  margin-top: 0;
303
  width: 80px;
304
  }
305
 
306
+ .about-wrap img.yikes-easy-mc-feature-image.yikes-easy-mc-feature-image-left, .yikes-easy-mc-feature-image-left {
307
  float: left;
308
  margin-right: 30px;
309
  margin-left: 0 !important;
352
 
353
  .whats-new-wrap .feature-section:nth-child(1) img {
354
  float: left;
 
 
 
355
  }
356
 
357
  .whats-new-wrap .feature-section:nth-child(3) img {
380
  left: 0;
381
  }
382
 
383
+ .about-wrap h2 {
384
+ text-align: left;
385
+ }
386
+
387
  .edd-welcome-screenshots {
388
  float: right;
389
  margin-left: 10px!important;
393
  margin-top: 20px;
394
  }
395
 
396
+ .about-wrap .feature-section p {
397
+ max-width: 40em;
398
+ }
399
+
400
+ .about-wrap img.yikes-easy-mc-feature-image {
401
  float: right;
402
+ margin-left: 30px;
403
+ }
404
+
405
+ .yikes-easy-mc-feature-image.yikes-easy-mc-feature-v3-image {
406
+ border: 0;
407
+ margin-left: 100px !important;
408
+ margin-right: 100px;
409
+ max-height: 340px;
410
+ width: auto;
411
  }
412
 
413
  #credit-container,
643
  }
644
 
645
  .error-message-container label[for="yikes-easy-mc-success-message"],
646
+ .error-message-container label[for="yikes-easy-mc-success-single-optin-message"],
647
+ .error-message-container label[for="yikes-easy-mc-user-resubscribed-success-message"],
648
  .error-message-container label[for="yikes-easy-mc-general-error-message"],
 
649
  .error-message-container label[for="yikes-easy-mc-user-subscribed-message"],
650
+ .error-message-container label[for="yikes-easy-mc-user-subscribed-update-link"],
651
+ .error-message-container label[for="yikes-easy-mc-user-email-subject"],
652
+ .error-message-container label[for="yikes-easy-mc-user-email-body"] {
653
  padding: .5em 1em;
654
  background: rgba(241, 241, 241, 0.75);
655
  box-sizing: border-box;
1097
  width: 18px;
1098
  }
1099
  .field-type-text {
1100
+ display: inline-block;
1101
  }
1102
  .type-container {
1103
  margin-top: 0;
admin/css/yikes-inc-easy-mailchimp-extender-admin.min.css CHANGED
@@ -1,2 +1 @@
1
- #yikes-easy-mc-dashboard-widget-stats h3,.addon-image{text-align:center}.yikes-easy-mc-hidden{display:none}.shortcode-input-field{color:#333;background:rgba(216,216,216,.35)!important}.edit-form-field-container-span{display:block;margin:.5em 0}.no-forms-widget{margin:2em 0}.view-ad-link{display:block;margin:0 auto}.no-forms-found-icon{font-size:14px;line-height:1.4;width:14px;color:#e07d7d}.coming-soon-button{position:absolute}.coming-soon-button .dashicons{font-size:14px;line-height:1.8}.add-ons-about-text{margin-top:0}#add-ons{margin:3em 0}.addon-image{display:block}.no-mailchimp-lists-found{padding:25px 0 25px 25px}.add-new-subscriber-button{display:block;margin-top:2em}.add-new-subscriber-form-container{display:none;padding-top:1em}.add-new-subscriber-form-container h4{margin-top:0}#yikes-easy-mc-widget-stat-holder,.yikes-easy-mc-stats-table{margin-top:1em}#migration-buttons{display:inline-block;margin-bottom:.5em}#migration-buttons form:first-child{margin-right:10px}#migration-buttons form{float:left}#yikes_easy_mc_account_activity_widget h3 span,#yikes_easy_mc_list_stats_widget h3 span{background:url(../../includes/images/MailChimp_Assets/Freddie_original.png) 8px 4px/25px auto no-repeat;background-size:25px;display:block;height:30px;padding-left:3em;padding-top:5px}#yikes_easy_mc_account_activity_widget h3.hndle,#yikes_easy_mc_list_stats_widget .inside{padding:0}#yikes_easy_mc_list_stats_widget h3{padding:0;line-height:1.6em}.yikes-easy-mc-stats-table,.yikes-easy-mc-stats-table .yikes-easy-mc-table-stats-tr,.yikes-easy-mc-stats-table tbody{display:block;width:100%}.yikes-easy-mc-table-stats-tr td{display:inline-block;width:48%;text-align:center}.yikes-easy-mc-table-stats-tr td:hover{cursor:pointer}.yikes-easy-mc-table-stats-tr td:first-of-type{border-right:1px solid #ececec}.yikes-easy-mc-stats-table .yikes-easy-mc-table-stats-tr-first{border-bottom:1px solid #ececec;border-top:1px solid #ececec}.yikes-easy-mc-stats-table p.yikes-easy-mc-dashboard-stat{color:#00a0d2;font-weight:800;font-size:20px;margin-bottom:2px;margin-top:15px;line-height:1.2;max-height:80px}.yikes-easy-mc-stats-table p.yikes-easy-mc-stat-list-label{font-size:13px;margin-top:0;margin-bottom:15px;font-family:"Open Sans"}#yikes_easy_mc_account_activity_widget table th.row-title{padding-left:10px}#pre-defined-tag-interior-container{background:url(../../includes/images/tinyMCE/yikes-mailchimp-combo-faded.png) bottom right no-repeat #fff;background-size:40%}.qtip-default{background-color:transparent!important;border:transparent!important;z-index:9999999!important}.qtip-bootstrap{padding:10px!important;z-index:9999999!important;font-size:12px}.search-interest-group-preloader{display:block;margin:8px 0 0 55px;width:12px}.no-interest-groupings-enabled-message{display:block;margin-top:12px!important;width:100%}.tooltip-integration-banner{max-width:100%;margin:0 0 .25em}.tooltiptext.qtip-bootstrap{font-size:12px}.tooltip-title{margin:0}.dashicons-editor-help:hover{cursor:pointer}body.easy-forms_page_yikes-inc-easy-mailchimp-settings .interest-group-section{display:block;width:100%;margin:1.5em 0}body.easy-forms_page_yikes-inc-easy-mailchimp-settings .interest-group-section .interest-group-section-title{display:block;width:100%;margin:.5em 0;text-decoration:underline}.github-avatar-url,body.admin_page_yikes-mailchimp-welcome #kb-container .knowledge-base-listing li a,body.easy-forms_page_yikes-inc-easy-mailchimp-support .knowledge-base-articles .knowledge-base-listing li a{text-decoration:none}body.easy-forms_page_yikes-inc-easy-mailchimp-settings .interest-group-section input{margin-right:0}body.easy-forms_page_yikes-inc-easy-mailchimp-settings .interest-group-section label{margin-right:10px}i.mce-ico.mce-i-yks_mc_tinymce_button_key{background:url(../../includes/images/tinyMCE/Freddie_wink.png) no-repeat;background-size:18px;background-position-y:1px}#yikes_mailchimp_tinyMCE_modal-title{padding-left:42px;background:url(../../includes/images/MailChimp_Assets/Freddie_original.png) left no-repeat;background-size:25px;background-position-x:10px}#yikes_mailchimp_tinyMCE_modal{background:url(../../includes/images/tinyMCE/yikes-mailchimp-combo-faded.png) bottom left no-repeat #fff;background-size:40%;background-position-x:10px;background-position-y:95%}#yikes_mailchimp_tinyMCE_modal .mce-foot{border-top:none!important;background:0 0}[id*="_yikes_easy_mc_widget"]>div.widget-top>div.widget-title>h4{background:url(../../includes/images/MailChimp_Assets/Freddie_original.png) 2% 50%/25px auto no-repeat #FAFAFA;padding-left:40px}#review-yikes-easy-mailchimp-notice #yikes-mailchimp-logo,#yikes-mailchimp-logo{font-size:14px;background:url(../../includes/images/Welcome_Page/yikes-mailchimp-welcome-logo.png) no-repeat;text-align:center}#review-yikes-easy-mailchimp-notice #yikes-mailchimp-logo{background-size:60px;float:left;height:80px;width:80px}.yikes-easy-mc-feature-image-left{float:left;margin-right:30px;margin-left:0!important}.need-support-icon{line-height:1.5}ul.support-option-list{display:inline-block;width:100%}.support-option{float:left}.support-option-second{margin-left:10px}#yikes-mailchimp-logo.support-page{float:left;width:80pt}.yikes-easy-mc-whats-new-section-image{float:none;width:100%;margin-left:0!important}.welcome-page-tabs{margin-top:2em!important}.welcome-page-about-wrap .about-text,.welcome-page-about-wrap h2.welcome-title{margin-left:115px}.whats-new-wrap img.yikes-easy-mc-whats-new-section-image{margin-top:10px}.whats-new-wrap .feature-section:nth-child(1) img{float:left;width:500px;margin-left:0!important;margin-right:30px}.whats-new-wrap .feature-section:nth-child(3) img{float:right;width:250px;margin-right:0!important;margin-left:30px}.whats-new-wrap .feature-section:nth-child(4) img{margin-left:0!important}#yikes-mailchimp-logo{height:132px;width:132px}.about-wrap #yikes-mailchimp-logo{position:absolute;top:0;left:0}.edd-welcome-screenshots{float:right;margin-left:10px!important}.about-wrap .feature-section{margin-top:20px}.yikes-easy-mc-feature-image{float:right;margin-left:30px!important}#credit-container,#translators-container{display:inline-block;width:100%}#credit-container h2,#translators-container h2{margin:0 0 .5em 1em}#translators-container{margin-top:5em}#translators-container .translation-language{color:#333}#credit-container .team-member,#translators-container .translator{margin:1em 5% 1em 0;text-align:center}#credit-container .team-member img,#translators-container .translator img{border-radius:50%}.admin_page_yikes-mailchimp-welcome .about-wrap div.error,.admin_page_yikes-mailchimp-welcome .about-wrap div.updated{display:block;margin-left:115px}.github-avatar-image{width:100px}.github-avatar-url{display:inline-block;width:20%}github-avatar-url:focus{outline:0}body.admin_page_yikes-mailchimp-edit-form div.show-some-love-container img,div.show-some-love-container img.customizer-upsell-banner{max-width:100%}body.admin_page_yikes-mailchimp-edit-form div.show-some-love-container p:first-child{font-style:italic}body.admin_page_yikes-mailchimp-edit-form div.show-some-love-container hr{margin:1em 0}body.admin_page_yikes-mailchimp-welcome .nav-tab-wrapper .nav-tab .dashicons{font-size:17px;line-height:1.5}body.admin_page_yikes-mailchimp-welcome #kb-container,body.easy-forms_page_yikes-inc-easy-mailchimp-support .knowledge-base-articles{display:inline-block;margin-top:1em}body.admin_page_yikes-mailchimp-welcome #kb-container h1{font-size:20px;margin-top:-1em}body.admin_page_yikes-mailchimp-welcome #kb-container .knowledge-base-listing,body.easy-forms_page_yikes-inc-easy-mailchimp-support .knowledge-base-articles .knowledge-base-listing{width:45%;margin-right:2%;float:left;min-height:260px}body.admin_page_yikes-mailchimp-welcome #kb-container .knowledge-base-listing li,body.easy-forms_page_yikes-inc-easy-mailchimp-support .knowledge-base-articles .knowledge-base-listing li{margin:12px 0;text-decoration:none}body.admin_page_yikes-mailchimp-welcome #kb-container .knowledge-base-listing li:before,body.easy-forms_page_yikes-inc-easy-mailchimp-support .knowledge-base-articles .knowledge-base-listing li:before{font-family:dashicons;content:"\f123";vertical-align:middle;display:block;float:left;margin:0 5px 5px 0}body.admin_page_yikes-mailchimp-welcome #kb-container .knowledge-base-listing li.list-title,body.easy-forms_page_yikes-inc-easy-mailchimp-support .knowledge-base-articles .knowledge-base-listing li.list-title{font-size:17px;font-weight:200;text-decoration:underline}body.admin_page_yikes-mailchimp-welcome #kb-container .knowledge-base-listing li.list-title:before,body.easy-forms_page_yikes-inc-easy-mailchimp-support .knowledge-base-articles .knowledge-base-listing li.list-title:before{content:"";padding-left:12px}body.admin_page_yikes-mailchimp-welcome .new-feature-list{list-style:none;line-height:middle}body.admin_page_yikes-mailchimp-welcome .new-feature-list li{margin-bottom:10px}body.admin_page_yikes-mailchimp-welcome .new-feature-list li:before{font-family:dashicons;content:"\f139";padding-right:2px;font-size:20px;vertical-align:middle}#review-yikes-easy-mailchimp-notice .button-container{display:block;width:100%;margin:.75em 0 1.5em}#review-yikes-easy-mailchimp-notice .button-container .dashicons{font-size:14px;line-height:1.9;margin-left:-4px}#review-yikes-easy-mailchimp-notice .button-container .dashicons-star-filled{color:#E6B800}#review-yikes-easy-mailchimp-notice .button-container .dashicons-upload{color:#6E8841}#review-yikes-easy-mailchimp-notice .button-container .dashicons-no-alt{color:#dc3a3a;line-height:2}body.easy-mailchimp_page_yikes-inc-easy-mailchimp-settings .dashicons-no-alt{color:#dc3a3a}#review-yikes-easy-mailchimp-notice .button-container a{margin-right:10px}#review-yikes-easy-mailchimp-notice{border-left:4px solid #00a0d2;background:#fefefe;padding:10px 12px 1px;box-shadow:0 1px 1px 0 rgba(0,0,0,.1);-webkit-box-shadow:0 1px 1px 0 rgba(0,0,0,.1);margin:15px 25px 20px 5px}input.readonly,input[readonly],textarea.readonly,textarea[readonly]{background:#D8D8D8}.dashicons.yikes-love{color:pink}.field-description-input{resize:vertical;max-height:100px}.yikes-easy-mc-postbox h3{background:#00a0d2;font-weight:800;color:#fff}.yikes-easy-mc-postbox h3.bg-transparent{color:#333;font-weight:400;background:0 0}.yikes-mc-warning-message{padding-left:15px;margin-top:0;padding-top:10px;color:#da6e6e}.error-message-container label[for=yikes-easy-mc-user-subscribed-update-link],.error-message-container label[for=yikes-easy-mc-success-message],.error-message-container label[for=yikes-easy-mc-general-error-message],.error-message-container label[for=yikes-easy-mc-invalid-email-message],.error-message-container label[for=yikes-easy-mc-user-subscribed-message]{padding:.5em 1em;background:rgba(241,241,241,.75);box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;margin:0}body.admin_page_yikes-mailchimp-edit-form #error-container{padding:2px 1em;background:rgba(241,241,241,.75);box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;margin:0;color:#F56060}.error-message-container label:last-child{padding-bottom:1em;margin-bottom:.5em}.error-message-container label,.form-settings-container label{display:block;margin:1em 0}.yikes-easy-forms-sidebar .yikes-mc-settings-expansion-section{padding:.5em .75em;-webkit-box-sizing:border-box;-moz-box-sizing:border-box}.yikes-mc-settings-expansion-section{display:none;background:rgba(241,241,241,.75)}.expansion-section-title{background:#fff}.expansion-section-title.settings-sidebar,.form-builder-section-title{text-decoration:none;display:block;border:1px solid rgba(177,177,177,.71);color:#333;padding:5px;margin:.5em 0 0}.expansion-section-title.settings-sidebar .dashicons,.form-builder-section-title .dashicons{content:"\f132";font-family:dashicons;font-size:15px;line-height:1.5}span.easy-mailchimp-add-on-valid-license-container{color:#44ba44;display:block;margin-top:1em}.easy-mailchimp-add-on-invalid-license-container{color:rgba(227,107,107,.86);display:block;margin-top:1em}.options-sidebar .yikes-easy-mc-postbox{overflow:visible}.options-sidebar .inside{padding:0 20px 12px}.yikes-easy-mc-about-text{margin-top:0}.add-on-settings-divider{margin:1em 0!important}#yks-mailchimp-double-optin-message,#yks-mailchimp-single-optin-message,.settings-page-input{width:50%}#yks-mailchimp-double-optin-message,#yks-mailchimp-single-optin-message{min-height:75px;max-height:200px;resize:vertical}#addon-settings-nav li a,#settings-nav li a{color:#333;text-decoration:none!important;transition:color .15s ease-out;-moz-transition:color .15s ease-out;-webkit-transition:color .15s ease-out;-o-transition:color .15s ease-out}#addon-settings-nav li a:hover,#settings-nav li a:hover,.option-menu-selected-arrow+a{color:#00a0d2!important}#addon-settings-nav{margin-bottom:0;margin-top:5px}.option-menu-selected-arrow{width:0;height:0;border-top:10px solid transparent;border-bottom:10px solid transparent;border-left:10px solid #a0a5aa;position:absolute;left:-.1em}label[for=yikes-mailchimp-debug-status]{display:inline-block;margin-bottom:1em;line-height:2.25}#yikes-mailchimp-debug-status{float:left;margin-top:.5em}label[for=yikes-mc-recaptcha-setting],label[for=yikes-mc-recaptcha-api-key]{display:block;margin-bottom:1em}.recaptcha-preview-link,input.recaptcha-setting-checkbox{display:block;margin-top:.5em}.recaptcha-preview-container{width:100%;display:none;margin:1em 0}#premium-support-form,.support-page-button,.support-page-logo{display:block;width:100%}.wrap #col-left,.wrap #col-right{width:49%}@media (max-width:800px){.wrap #col-left,.wrap #col-right{width:100%}}.support-page-logo{opacity:.7;max-width:100%}.support-page-button{min-height:40px;font-weight:700;text-align:center;line-height:3!important;margin-top:1em!important}.support-page-wordpress-font{font-size:1.3em;margin-right:13px}h2.premium-support-title{margin:1em 0 .5em}#premium-support-form input[type=text],#premium-support-form input[type=email],#premium-support-form input[type=submit],#premium-support-form select{display:block;width:100%;min-width:200px;margin:.5em 0}#premium-support-form label{font-weight:800}#premium-support-form label input,#premium-support-form label select{font-weight:500}#premium-support-form p{font-weight:300;display:block;margin-bottom:1em}#wp-support-content-wrap{min-height:150px;width:100%}.support-form-hidden{display:none!important}#yikes-mailchimp-error-log .row-title{font-weight:400}.create-error-log-help:hover{cursor:pointer}.error-log-tr td{display:table;margin-bottom:1em;margin-top:.5em}p.error-log-missing-file em,p.to-start-logging-errors-notice em{margin:10px 0}.export-custom-forms-list{display:none;margin:1em 0 2em}.export-custom-forms-list p{margin-top:0}.list-rating-star{color:#E6B800}#chimp-chatter{text-align:center}#chimp-chatter .chimp-chatter-container{margin:1em .2em;background:#F8F8F8;border-radius:10px;float:left;height:220px;padding:10px;width:44%}.chimp-chatter-mailchimp-logo{width:100%;display:block;margin:0 auto}.chimp-chatter-sidebar h2.account-status{text-align:center}.mailchimp-affiliate-link{color:#333;display:none}.mailchimp-avatar{display:block;margin:0 auto;box-shadow:3px 3px 10px 0 rgba(214,214,214,.75)}#yikes_easy_mc_toolbar_links li a:focus,.merge-tag-text{box-shadow:none}.chimpchatter-button-container{clear:both;display:block}.chimp-chatter-postbox{float:left;width:49%;margin-right:1%}.circle-account-active,.circle-account-inactive{display:inline-block;vertical-align:middle;height:15px;width:15px;border-radius:50%}#account-details .chimp-chatter-postbox.even{margin-right:0}.circle-account-inactive{margin-top:-3px;margin-right:5px;background:rgba(250,138,138,.79)}.chatter-type{font-weight:600;font-family:"open sans";font-size:14px;margin:5px 5px 0}.chatter-message{margin:2px 2px 15px!important}.circle-account-active{margin-top:-3px;margin-right:5px;background:rgba(128,214,128,.77)}#account-details .mailchimp-avatar{width:120px;border-radius:10%;margin-top:.5em}.chimp-chatter-positive{border-left:4px solid #9ddf9d}.chimp-chatter-negative{border-left:4px solid #FBA2A2}.chimp-chatter-neutral{border-left:4px solid #b1b1b1}#import-list-to-site{margin-top:10px}#import-list-to-site .input-field{display:block;width:100%;margin-top:5px;margin-bottom:5px}#import-list-to-site .form-description{resize:vertical;max-height:65px}#import-list-to-site .description{margin-top:5px}input.clear-mailchimp-api-cache{float:right;margin-top:-33px!important}.yikes-list-refreshed-notice{border-left:4px solid #46b450;margin:5px 0}.yikes-list-refreshed-notice p{margin:1em 0 .5em;padding:6px 12px;background:rgba(241,241,241,.5);font-size:13px;line-height:1.5}.sidebar-container,.star-container{margin-top:5px;margin-bottom:1.5em}.star-container a{text-decoration:none}.star-container .dashicons-star-filled{font-size:1.75em}.sidebar-footer-text{margin:15px 0!important;text-align:center}.sidebar-twitter-icon{text-decoration:none;color:#55ACEE}.field-doesnt-exist-notice{position:absolute;margin-left:5px;width:18px}.field-type-text{float:right}.type-container{margin:0}.form-field-container{margin-top:0;margin-bottom:0}.field-no-longer-exists-warning{position:absolute;margin-left:5px;width:18px}.form-field-container td input[type=checkbox],.form-field-container td input[type=radio]{margin:0 5px}.form-field-container td input[type=checkbox]:first-child,.form-field-container td input[type=radio]:first-child{margin-left:0!important}.merge-tag-text{background:0 0;border:none}.pre-defined-tag-link{font-size:11px}.toggle-container{font-size:small;float:right}#pre-defined-tag-container{display:none}#pre-defined-tag-container h3{margin-bottom:0}#pre-defined-tag-container .tooltop-tag .dashicons-editor-help{font-size:13px;line-height:1.5}.no-fields-assigned-notice{margin:4em 0 2.25em;padding-bottom:6em;width:100%;text-align:center;background:url(../../includes/images/no-form-fields-assigned-arrow.jpg) bottom center no-repeat;background-size:105px}.yikes-easy-mc-widget-preloader{position:absolute;left:48%;margin-top:-96px}.yikes-dashboard-widget-section{padding:0 12px 12px}.select-list-title{padding-left:0}.yikes-dashboard-widget-section .description{margin:.5em 0 0}. error-descripion{padding-top:.5em}.yikes-mc-freddie-logo{float:left;margin-right:10px}.mv_ig_list{width:94%;margin-bottom:8px!important;border:none!important;background:0 0!important}.mv_ig_list .list-container{position:absolute}.mv_ig_list a{width:48%;padding:5px 0!important;text-align:center;margin:0}.mv_ig_list a:first-child{margin-right:0}.mv_ig_list a:last-child{float:right}.mv_ig_list .nav-tab{border:1px solid #ccc}.mv_ig_list .nav-tab-active{color:#fff;font-weight:700;background:#00a0d2}.mv_ig_list .arrow-down{position:absolute;margin-top:21px;margin-left:50px;width:0;height:0;border-left:12px solid transparent;border-right:12px solid transparent;border-top:12px solid #00a0d2}#container-container{display:inline-block;width:521px}#container-container .list-container{float:left;width:240px;position:relative}#container-container .list-container:last-child{margin-left:2em}#yikes_easy_mc_toolbar{margin-top:-.75em}#yikes_easy_mc_toolbar_links{display:inline-block;width:100%;margin:0;padding:10px 0}#yikes_easy_mc_toolbar_links li{float:left;margin:0 .5em}#yikes_easy_mc_toolbar_links li a{text-decoration:none;display:inline-block}#yikes_easy_mc_toolbar_links li a.selected_hidden_setting{color:#333;margin-bottom:3px}#yikes_easy_mc_toolbar_links li .selected_setting_triangle{width:0;height:0;border-left:13px solid transparent;border-right:13px solid transparent;border-top:13px solid rgba(206,206,206,1);margin:0 auto}.checkbox-settings-list-dropdown,.optin-checkbox-label-input{width:250px;display:block}#yikes_easy_mc_toolbar_links li a.form-builder:before{content:"\f116";font-family:dashicons}#yikes_easy_mc_toolbar_links li a.form-customizer:before{content:"\f100";font-family:dashicons}#yikes_easy_mc_toolbar_links li a.error-messages:before{content:"\f117";font-family:dashicons}#yikes_easy_mc_toolbar_links li a.form-settings:before{content:"\f111";font-family:dashicons}#checkbox-settings-form .dashicons-editor-help{font-size:15px;line-height:1.6}.no-lists-setup-notice{padding:.5em 0}.yikes-form-id-number{width:55px}span[title=Impressions]:hover,span[title=Submissions]:hover,span[title="Conversion Rate"]:hover{display:block;cursor:pointer}.form-id-container{padding:1px 8px;border-radius:5px;background:#49a9ec;font-weight:700;color:#fff}.manage-form-admin-notice{margin-top:1.75em!important}.remove-notification,.yikes-mc-settings-expansion-section a.remove-field,a.yikes-delete-mailchimp-form,a.yikes-delete-subscriber{color:#d96060!important}.yikes-delete-mailchimp-form{margin-top:6px}#postbox-container-1 .yikes-delete-mailchimp-form{float:right}.form-buttons-container{display:block;padding:11px 10px}.forms-buttons-container input[type=submit]{margin:0 0 .5em}.update-form-spinner{position:absolute;left:0;right:0;margin:0 auto;bottom:13px}.yikes-mc-shortcode-input{text-align:center;width:100%;color:#333}.hidden-class{display:none!important}.stat-container{width:10%;max-width:75px}.no-current-subscriber-notice em,.no-mailchimp-forms-found em{padding:25px 0 25px 25px}.column-columnname span.stats{display:block;width:100%;text-align:center}.column-columnname span.stats span{display:inline-block;width:20%}.column-columnname span.stats span:hover{cursor:pointer}#available-fields li,#available-interest-groups li{text-decoration:none;display:block;border:1px solid rgba(177,177,177,.71);color:#333;padding:5px;margin:.5em 0}#available-fields li.not-available,#available-interest-groups li.not-available{opacity:.6!important}#available-fields li.field-to-add-to-form,#available-interest-groups li.group-to-add-to-form{background:rgba(46,162,204,.25)}.add-field-to-editor .add-to-form-builder-arrow,.button-secondary .add-to-form-builder-arrow{width:15px;font-size:15px;line-height:1.8}.clear-form-fields{background:#e14d43;border-color:#d02c21;color:#fff;box-shadow:inset 0 1px 0 #ec8b85,0 1px 0 rgba(0,0,0,.15);text-decoration:none;display:inline-block;height:28px;padding:0 10px 1px;border-width:1px;-webkit-appearance:none;border-radius:3px;white-space:nowrap;font-size:13px;line-height:26px;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;float:right;margin:0 11px 10px 0}.clear-form-fields:active,.clear-form-fields:focus,.clear-form-fields:hover{background:#dd382d;border-color:#ba281e;color:#fff;box-shadow:inset 0 1px 0 #e8776f}.yikes-mc-view-list-breadcrumbs{padding:.8em;border:1px solid #D8D8D8;background:#ECECEC;margin:1.5em 0 .8em}.yikes-mc-member-rating-star{color:#daa520}#yikes-mc-subscriber-card-wrapper{background:#fefefe;min-height:200px;display:inline-block;box-shadow:0 1px 1px rgba(0,0,0,.04);webkit-box-shadow:0 1px 1px rgba(0,0,0,.04);border:1px solid #e5e5e5;padding:15px 20px;width:500px;float:left}#yikes-mc-subscriber-card-wrapper .subscriber-optin-ip{display:inline-block;margin:1em 0 0;font-style:italic}.view-user-data-wrap #customer-tab-wrapper-list{float:left;background:#fefefe;margin-top:0;padding:12px;margin-left:-1px;border-right:1px solid #e5e5e5;border-top:1px solid #e5e5e5;border-bottom:1px solid #e5e5e5}.view-user-data-wrap #customer-tab-wrapper-list .dashicons{font-size:23px;height:23px;width:23px;margin:3px 0}.view-user-data-wrap #customer-tab-wrapper-list li.inactive{color:rgba(51,51,51,.31);transition:color ease-out .1s}.view-user-data-wrap #customer-tab-wrapper-list li.active,.view-user-data-wrap #customer-tab-wrapper-list li.inactive:hover{color:rgba(51,51,51,1)}#yikes-mc-subscriber-card-wrapper .yikes-mc-card-top .member-star-rating-container,#yikes-mc-subscriber-card-wrapper .yikes-mc-card-top h2,#yikes-mc-subscriber-card-wrapper .yikes-mc-card-top img{float:left}#yikes-mc-subscriber-card-wrapper #delete-mailchimp-subscriber{display:block;margin:0 auto}#yikes-mc-subscriber-card-wrapper .yikes-mc-card-top img{border-radius:3px}#yikes-mc-subscriber-card-wrapper .merge-variable-section li{display:inline-block;list-style:none;float:left;width:50%;min-height:65px;border-bottom:1px dotted #ddd}#yikes-mc-subscriber-card-wrapper .merge-variable-section li p{margin:0 0 1em}#yikes-mc-subscriber-card-wrapper .yikes-mc-card-top h2{max-width:370px;width:75%;padding:0}#yikes-mc-subscriber-card-wrapper .member-star-rating-container{display:block;margin:.5em 0 .5em 10px}#yikes-mc-subscriber-card-wrapper h2{margin-left:10px;margin-top:0;padding-top:0}#yikes-mc-subscriber-card-wrapper .yikes-mc-card-body,#yikes-mc-subscriber-card-wrapper .yikes-mc-card-top{display:inline-block;width:100%}.member-location-data,.member-subscription-date{width:70%;max-width:370px;display:block;float:left}#yikes-mc-subscriber-card-wrapper .yikes-mc-card-body h4{margin-top:0;margin-left:5px}.yikes-mc-subscriber-hr{margin:1.5em 0}.member-subscription-date{margin:.5em 0 .5em 10px}.member-location-data{margin:.25em 0 .25em 10px}.addon-required-link{color:#333;opacity:.5}.view-list-sidebar-input{color:#333}.interest-group-ul,.merge-variable-ul,.segment-ul{padding-left:15px;font-size:14px}.interest-group-ul li .dashicons,.merge-variable-ul li .dashicons{line-height:1.8;font-size:9px}a.button-primary.edit-fields-button{margin:0 0 10px 15px}.interest-group-count,.merge-variable-count,.segment-group-count{text-decoration:underline;margin-bottom:.75em;padding-left:7px}body.admin_page_yikes-mailchimp-edit-form .ui-datepicker .ui-datepicker-calendar td a,body.admin_page_yikes-mailchimp-edit-form .ui-datepicker a,body.admin_page_yikes-mailchimp-edit-form .ui-datepicker a:hover{text-decoration:none}.interest-group-title{padding-left:5px}.edit-segments-button{margin:0 0 10px 15px}.edit-segment-description{padding:0 0 10px 15px}#credit-container{margin-top:1.5em}.yikes-easy-mailchimp-custom-content-icon{font-size:15px;line-height:1}.custom-field-section{display:block;margin:1em 0}#associated-list{width:100%;margin-top:5px}#redirect-user-to-selection{width:100%}#edit-yikes-mc-form label h3{margin-left:0;padding-left:0}#available-fields .field-required{color:#d96060!important}body.admin_page_yikes-mailchimp-edit-form #poststuff h2{padding:8px 12px;margin-top:0}.edit-form-form-description{width:100%;resize:vertical;min-height:65px;max-height:100px}.edit-form-title{padding-left:12px!important}#edit-form-description{padding:0 12px;margin:1em 0}.yikes-easy-mc-postbox{overflow:hidden}.no-interest-groups-found-message{opacity:.35}.upgrading-ellipse-one,.upgrading-ellipse-two{-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";-moz-opacity:0;-webkit-animation:dot 1.3s infinite}#interest-groups-container .description,#merge-variables-container .description{padding-top:.5em}.inside-section-1{margin-top:0;margin-bottom:1.5em}.inside-section-2{margin-top:0;margin-bottom:2em}.form-field-container-span{display:block;margin:.5em 0}#style-list ul li{display:block;width:100%;margin:1em 0}.form-style-adjustment,.wp-picker-container{display:block!important;width:100%;margin:.5em 0}.dynamic-email-tag{display:inline-block;margin-right:5px}.dynamic-tag-description td{padding-top:0}#create-new-notification-button{margin-top:1em}.file-container{display:none}.yikes-mailchimp-file-field input[name*="custom-field[incentive-attachment]"]{margin-bottom:.5em}.yikes-mailchimp-file-field input[name*="custom-field[incentive-attachment]"]+.button-secondary{margin-left:4px}input#upload-btn[data-attr-position="1"]{margin-left:0}.remove-file-button{background:url(../partials/helpers/fields/img/icon-delete.png);height:16px;position:absolute;text-indent:-99999px;width:16px}a.add-new-incentive-attachment{display:block;width:40px;margin-right:100%!important;margin-top:.5em!important}a.add-new-incentive-attachment .dashicons{font-size:15px;line-height:1.8}.form-builder-placeholder{background:rgba(206,206,206,.2);height:30px}.admin_page_yikes-mailchimp-edit-form #form-settings .section-title{font-size:1em;border-bottom:1px solid rgba(187,187,187,.29);display:block;width:100%;padding-bottom:6px;margin-bottom:.5em;margin-top:1.5em}.admin_page_yikes-mailchimp-edit-form #form-settings .section-interior label,.admin_page_yikes-mailchimp-edit-form #form-settings .section-title.first{margin-top:0}.admin_page_yikes-mailchimp-edit-form #form-settings .section-interior{display:inline-block;width:100%;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;background:rgba(241,241,241,.75);padding:1em}label.login-restriction-center{display:block;width:100%}.admin_page_yikes-mailchimp-edit-form #form-settings .section-interior .date-restirction-section{display:inline-block}.admin_page_yikes-mailchimp-edit-form #form-settings .section-interior .date-restirction-section p.description.error{color:#F56060}.admin_page_yikes-mailchimp-edit-form #form-settings .section-interior .date-restirction-section label{float:left;margin-right:.5em;margin-top:0;margin-bottom:0}.admin_page_yikes-mailchimp-edit-form #form-settings .section-interior .nested-child .yikes-easy-mc-form-restriction-expired-message,.admin_page_yikes-mailchimp-edit-form #form-settings .section-interior .nested-child .yikes-easy-mc-form-restriction-login-message,.admin_page_yikes-mailchimp-edit-form #form-settings .section-interior .nested-child .yikes-easy-mc-form-restriction-pending-message{display:block;width:100%;min-height:50px}.admin_page_yikes-mailchimp-edit-form #form-settings .section-interior .nested-child{float:left;padding-left:2%;width:98%;border-left:1px dashed #BDBDBD;border-spacing:2px;margin:.5em 0 1em}.admin_page_yikes-mailchimp-edit-form #form-settings .section-interior .nested-child .yikes-easy-mc-submit-button-text{margin:0}.admin_page_yikes-mailchimp-edit-form #form-settings .section-interior .date-restirction-section{margin-bottom:0}.admin_page_yikes-mailchimp-edit-form #form-settings .section-interior .date-restirction-section.last{margin-bottom:.75em}.admin_page_yikes-mailchimp-edit-form #form-settings .section-interior .nested-child.hidden{display:none}.admin_page_yikes-mailchimp-edit-form #form-settings .section-interior .description+label{margin-top:1em;float:left;width:100%}.admin_page_yikes-mailchimp-edit-form #form-settings .section-interior label.inline-form-label{margin-bottom:0;margin-top:0}.admin_page_yikes-mailchimp-edit-form #form-settings .section-interior .description{display:block;width:100%;float:left}.admin_page_yikes-mailchimp-edit-form #form-settings .nested-child strong:first-child,.admin_page_yikes-mailchimp-edit-form #form-settings .section-interior strong:first-child{display:block;width:100%}.admin_page_yikes-mailchimp-edit-form #form-settings .inline-form-label{float:left;margin-right:10px}body.admin_page_yikes-mailchimp-edit-form .ui-timepicker-wrapper{overflow-y:auto;height:150px;width:170px;background:#fff;border:1px solid #ddd;box-shadow:0 5px 10px rgba(0,0,0,.2);outline:0;z-index:10001;margin:0}body.admin_page_yikes-mailchimp-edit-form .ui-timepicker-wrapper.ui-timepicker-with-duration{width:13em}body.admin_page_yikes-mailchimp-edit-form .ui-timepicker-wrapper.ui-timepicker-with-duration.ui-timepicker-step-30,body.admin_page_yikes-mailchimp-edit-form .ui-timepicker-wrapper.ui-timepicker-with-duration.ui-timepicker-step-60{width:11em}body.admin_page_yikes-mailchimp-edit-form .ui-timepicker-list{margin:0;padding:0;list-style:none}body.admin_page_yikes-mailchimp-edit-form .ui-timepicker-duration{margin-left:5px;color:#888}body.admin_page_yikes-mailchimp-edit-form .ui-timepicker-list:hover .ui-timepicker-duration{color:#888}body.admin_page_yikes-mailchimp-edit-form .ui-timepicker-list li{padding:3px 0 3px 5px;cursor:pointer;white-space:nowrap;color:#000;list-style:none;margin:0}body.admin_page_yikes-mailchimp-edit-form .ui-timepicker-list:hover .ui-timepicker-selected{background:#fff;color:#000}body.admin_page_yikes-mailchimp-edit-form .ui-timepicker-list .ui-timepicker-selected:hover,body.admin_page_yikes-mailchimp-edit-form .ui-timepicker-list li:hover,body.admin_page_yikes-mailchimp-edit-form li.ui-timepicker-selected{background:#1980EC;color:#fff}body.admin_page_yikes-mailchimp-edit-form .ui-timepicker-list li:hover .ui-timepicker-duration,body.admin_page_yikes-mailchimp-edit-form li.ui-timepicker-selected .ui-timepicker-duration{color:#ccc}body.admin_page_yikes-mailchimp-edit-form .ui-timepicker-list li.ui-timepicker-disabled,body.admin_page_yikes-mailchimp-edit-form .ui-timepicker-list li.ui-timepicker-disabled:hover,body.admin_page_yikes-mailchimp-edit-form .ui-timepicker-list li.ui-timepicker-selected.ui-timepicker-disabled{color:#888;cursor:default}body.admin_page_yikes-mailchimp-edit-form .ui-timepicker-list li.ui-timepicker-disabled:hover,body.admin_page_yikes-mailchimp-edit-form .ui-timepicker-list li.ui-timepicker-selected.ui-timepicker-disabled{background:#f2f2f2}body.admin_page_yikes-mailchimp-edit-form .ui-datepicker{background-color:#fff;border:1px solid #66AFE9;border-radius:4px;box-shadow:0 0 8px rgba(102,175,233,.6);display:none;margin-top:4px;padding:10px;width:240px}body.admin_page_yikes-mailchimp-edit-form .ui-datepicker a:hover,body.admin_page_yikes-mailchimp-edit-form .ui-datepicker td:hover a{color:#2A6496;transition:color .1s ease-in-out}body.admin_page_yikes-mailchimp-edit-form .ui-datepicker .ui-datepicker-header{margin-bottom:4px;text-align:center}body.admin_page_yikes-mailchimp-edit-form .ui-datepicker .ui-datepicker-title{font-weight:700}body.admin_page_yikes-mailchimp-edit-form .ui-datepicker .ui-datepicker-next,body.admin_page_yikes-mailchimp-edit-form .ui-datepicker .ui-datepicker-prev{cursor:default;font-family:'Glyphicons Halflings';-webkit-font-smoothing:antialiased;font-style:normal;font-weight:400;height:20px;line-height:1;margin-top:2px;width:30px}body.admin_page_yikes-mailchimp-edit-form .ui-datepicker .ui-datepicker-prev{float:left;text-align:left}body.admin_page_yikes-mailchimp-edit-form .ui-datepicker .ui-datepicker-next{float:right;text-align:right}body.admin_page_yikes-mailchimp-edit-form .ui-datepicker .ui-datepicker-prev:before{content:"\f141";font-family:dashicons}body.admin_page_yikes-mailchimp-edit-form .ui-datepicker .ui-datepicker-next:before{content:"\f139";font-family:dashicons}body.admin_page_yikes-mailchimp-edit-form .ui-datepicker-next:hover,body.admin_page_yikes-mailchimp-edit-form .ui-datepicker-prev:hover{cursor:pointer!important}body.admin_page_yikes-mailchimp-edit-form .ui-datepicker-close{display:none}body.admin_page_yikes-mailchimp-edit-form .ui-datepicker-current{color:#555!important;border-color:#ccc!important;background:#f7f7f7!important;box-shadow:0 1px 0 #ccc!important;vertical-align:top!important;display:inline-block;text-decoration:none;font-size:13px;line-height:26px;height:28px;padding:0 10px 1px;cursor:pointer;border-width:1px;border-style:solid;-webkit-appearance:none;border-radius:3px;white-space:nowrap;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;margin-top:10px}body.admin_page_yikes-mailchimp-edit-form .ui-datepicker .ui-datepicker-current-day a,body.admin_page_yikes-mailchimp-edit-form .ui-datepicker .ui-datepicker-today a{color:#fff}body.admin_page_yikes-mailchimp-edit-form .ui-datepicker .ui-icon{display:none}body.admin_page_yikes-mailchimp-edit-form .ui-datepicker .ui-datepicker-calendar{table-layout:fixed;width:100%}body.admin_page_yikes-mailchimp-edit-form .ui-datepicker .ui-datepicker-calendar td,body.admin_page_yikes-mailchimp-edit-form .ui-datepicker .ui-datepicker-calendar th{text-align:center;padding:4px 0}body.admin_page_yikes-mailchimp-edit-form .ui-datepicker .ui-datepicker-calendar td{border-radius:4px;transition:background-color .1s ease-in-out,color .1s ease-in-out}body.admin_page_yikes-mailchimp-edit-form .ui-datepicker .ui-datepicker-calendar td:hover{background-color:#EBEBEB;cursor:pointer}body.admin_page_yikes-mailchimp-edit-form .ui-datepicker .ui-datepicker-today{background-color:rgba(66,137,204,.65)}body.admin_page_yikes-mailchimp-edit-form .ui-datepicker .ui-datepicker-current-day{background-color:#4289cc}body.admin_page_yikes-mailchimp-edit-form .ui-datepicker .ui-datepicker-calendar .ui-datepicker-unselectable:hover{background-color:#fff;cursor:default}.custom-radio-holder{display:inline-block;width:100%;margin:.5em 0}.custom-radio-label{display:block;float:left;margin:0 5px}.custom-radio-label:first-child{margin-left:0!important}.custom-radio-label input[type=radio]{margin-right:0!important}.custom-select-field{display:block;width:100%;margin:.5em 0}#available-widgets [class*=yikes_easy] .widget-title:before{content:""!important;background:url(../../includes/images/MailChimp_Assets/Freddie_original.png) no-repeat #FAFAFA;background-size:contain}body.wp-customizer #available-widgets [id*="_yikes_easy_mc_widget"]>div.widget-top>div.widget-title>h4{background:0 0!important}#connection-container{float:right;color:#fff;padding:.25em .75em .25em .25em;margin-top:-4px}#connection-container.api-connected{background:#44ba44}#connection-container.api-not-connected{background:#b5b5b5}.yikes-mc-api-connected,.yikes-mc-api-not-connected{line-height:1}.show-some-love-container{transition:max-height .75s}#review-yikes-easy-mc{text-align:center}#review-yikes-easy-mc .dashicons-star-filled{color:#E6B800}.meta-box-sortables hr{margin:1.75em 0 0}#about-yikes-inc{display:none}#about-yikes-inc .about-sidebar-yikes-logo{float:left;width:95px;margin:5px 7px 0 0}#about-yikes-inc p{margin-top:0}.yikes-easy-mc-updated{display:block;border-left:4px solid #4EAEF0;margin:1em 20px 1em 0;padding:2px 10px;background:right bottom no-repeat #fff;background-size:120px;background-position-y:29px}.support-section{margin:1.5em 0;padding:1em 0}.github-octocat{background:url(../../includes/images/Support_Page/Octocat.png) left top no-repeat;background-size:100%;width:50px;height:45px;display:block;float:left;margin-top:-5px}@media screen and (max-width:1200px){.yikes-easy-mc-postbox #post-body.columns-2 #postbox-container-1{float:none}}@media screen and (max-width:850px){.option-menu-selected-arrow{display:none!important}}@media screen and (max-width:782px){#chimp-chatter .chimp-chatter-container{float:none;height:auto;width:100%}}.recaptcha-demo-gif{width:275px}.pro-version-only-notice{color:#d96060}.upgrading-ellipse-one{filter:alpha(opacity=0);-khtml-opacity:0;opacity:0;-webkit-animation-delay:0ms;animation:dot 1.3s infinite;animation-delay:0ms}.upgrading-ellipse-two{filter:alpha(opacity=0);-khtml-opacity:0;opacity:0;-webkit-animation-delay:.2s;animation:dot 1.3s infinite;animation-delay:.2s}.upgrading-ellipse-three{-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";filter:alpha(opacity=0);-moz-opacity:0;-khtml-opacity:0;opacity:0;-webkit-animation:dot 1.3s infinite;-webkit-animation-delay:.3s;animation:dot 1.3s infinite;animation-delay:.3s}@keyframes dot{0%,50%{opacity:0}100%{opacity:1}}
2
- /*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInlpa2VzLWluYy1lYXN5LW1haWxjaGltcC1leHRlbmRlci1hZG1pbi5taW4uY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLHNEQUFzRCxpQkFBaUIsQ0FBQyxzQkFBc0IsWUFBWSxDQUFDLHVCQUF1QixXQUFXLDBDQUEwQyxDQUFDLGdDQUFnQyxjQUFjLGFBQWEsQ0FBQyxpQkFBaUIsWUFBWSxDQUFDLGNBQWMsY0FBYyxhQUFhLENBQUMscUJBQXFCLGVBQWUsZ0JBQWdCLFdBQVcsYUFBYSxDQUFDLG9CQUFvQixpQkF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0udXBncmFkaW5nLWVsbGlwc2Utb25le2ZpbHRlcjphbHBoYShvcGFjaXR5PTApOy1raHRtbC1vcGFjaXR5OjA7b3BhY2l0eTowOy13ZWJraXQtYW5pbWF0aW9uLWRlbGF5OjBtczthbmltYXRpb246ZG90IDEuM3MgaW5maW5pdGU7YW5pbWF0aW9uLWRlbGF5OjBtc30udXBncmFkaW5nLWVsbGlwc2UtdHdve2ZpbHRlcjphbHBoYShvcGFjaXR5PTApOy1raHRtbC1vcGFjaXR5OjA7b3BhY2l0eTowOy13ZWJraXQtYW5pbWF0aW9uLWRlbGF5Oi4yczthbmltYXRpb246ZG90IDEuM3MgaW5maW5pdGU7YW5pbWF0aW9uLWRlbGF5Oi4yc30udXBncmFkaW5nLWVsbGlwc2UtdGhyZWV7LW1zLWZpbHRlcjpcInByb2dpZDpEWEltYWdlVHJhbnNmb3JtLk1pY3Jvc29mdC5BbHBoYShPcGFjaXR5PTApXCI7ZmlsdGVyOmFscGhhKG9wYWNpdHk9MCk7LW1vei1vcGFjaXR5OjA7LWtodG1sLW9wYWNpdHk6MDtvcGFjaXR5OjA7LXdlYmtpdC1hbmltYXRpb246ZG90IDEuM3MgaW5maW5pdGU7LXdlYmtpdC1hbmltYXRpb24tZGVsYXk6LjNzO2FuaW1hdGlvbjpkb3QgMS4zcyBpbmZpbml0ZTthbmltYXRpb24tZGVsYXk6LjNzfUBrZXlmcmFtZXMgZG90ezAlLDUwJXtvcGFjaXR5OjB9MTAwJXtvcGFjaXR5OjF9fSJdfQ== */
1
+ #yikes-easy-mc-dashboard-widget-stats h3,.addon-image{text-align:center}.yikes-easy-mc-hidden{display:none}.shortcode-input-field{color:#333;background:rgba(216,216,216,.35)!important}.edit-form-field-container-span{display:block;margin:.5em 0}.no-forms-widget{margin:2em 0}.view-ad-link{display:block;margin:0 auto}.no-forms-found-icon{font-size:14px;line-height:1.4;width:14px;color:#e07d7d}.coming-soon-button{position:absolute}.coming-soon-button .dashicons{font-size:14px;line-height:1.8}.add-ons-about-text{margin-top:0}#add-ons{margin:3em 0}.addon-image{display:block}.no-mailchimp-lists-found{padding:25px 0 25px 25px}.add-new-subscriber-button{display:block;margin-top:2em}.add-new-subscriber-form-container{display:none;padding-top:1em}.add-new-subscriber-form-container h4{margin-top:0}#yikes-easy-mc-widget-stat-holder,.yikes-easy-mc-stats-table{margin-top:1em}#migration-buttons{display:inline-block;margin-bottom:.5em}#migration-buttons form:first-child{margin-right:10px}#migration-buttons form{float:left}#yikes_easy_mc_account_activity_widget h3 span,#yikes_easy_mc_list_stats_widget h3 span{background:url(../../includes/images/MailChimp_Assets/Freddie_original.png) 8px 4px/25px auto no-repeat;background-size:25px;display:block;height:30px;padding-left:3em;padding-top:5px}#yikes_easy_mc_account_activity_widget h3.hndle,#yikes_easy_mc_list_stats_widget .inside{padding:0}#yikes_easy_mc_list_stats_widget h3{padding:0;line-height:1.6em}.yikes-easy-mc-stats-table,.yikes-easy-mc-stats-table .yikes-easy-mc-table-stats-tr,.yikes-easy-mc-stats-table tbody{display:block;width:100%}.yikes-easy-mc-table-stats-tr td{display:inline-block;width:48%;text-align:center}.yikes-easy-mc-table-stats-tr td:hover{cursor:pointer}.yikes-easy-mc-table-stats-tr td:first-of-type{border-right:1px solid #ececec}.yikes-easy-mc-stats-table .yikes-easy-mc-table-stats-tr-first{border-bottom:1px solid #ececec;border-top:1px solid #ececec}.yikes-easy-mc-stats-table p.yikes-easy-mc-dashboard-stat{color:#00a0d2;font-weight:800;font-size:20px;margin-bottom:2px;margin-top:15px;line-height:1.2;max-height:80px}.yikes-easy-mc-stats-table p.yikes-easy-mc-stat-list-label{font-size:13px;margin-top:0;margin-bottom:15px;font-family:"Open Sans"}#yikes_easy_mc_account_activity_widget table th.row-title{padding-left:10px}#pre-defined-tag-interior-container{background:url(../../includes/images/tinyMCE/yikes-mailchimp-combo-faded.png) bottom right no-repeat #fff;background-size:40%}.qtip-default{background-color:transparent!important;border:transparent!important;z-index:9999999!important}.qtip-bootstrap{padding:10px!important;z-index:9999999!important;font-size:12px}.search-interest-group-preloader{display:block;margin:8px 0 0 55px;width:12px}.no-interest-groupings-enabled-message{display:block;margin-top:12px!important;width:100%}.tooltip-integration-banner{max-width:100%;margin:0 0 .25em}.tooltiptext.qtip-bootstrap{font-size:12px}.tooltip-title{margin:0}.dashicons-editor-help:hover{cursor:pointer}body.easy-forms_page_yikes-inc-easy-mailchimp-settings .interest-group-section{display:block;width:100%;margin:1.5em 0}body.easy-forms_page_yikes-inc-easy-mailchimp-settings .interest-group-section .interest-group-section-title{display:block;width:100%;margin:.5em 0;text-decoration:underline}.github-avatar-url,body.admin_page_yikes-mailchimp-welcome #kb-container .knowledge-base-listing li a,body.easy-forms_page_yikes-inc-easy-mailchimp-support .knowledge-base-articles .knowledge-base-listing li a{text-decoration:none}body.easy-forms_page_yikes-inc-easy-mailchimp-settings .interest-group-section input{margin-right:0}body.easy-forms_page_yikes-inc-easy-mailchimp-settings .interest-group-section label{margin-right:10px}i.mce-ico.mce-i-yks_mc_tinymce_button_key{background:url(../../includes/images/tinyMCE/Freddie_wink.png) no-repeat;background-size:18px;background-position-y:1px}#yikes_mailchimp_tinyMCE_modal-title{padding-left:42px;background:url(../../includes/images/MailChimp_Assets/Freddie_original.png) left no-repeat;background-size:25px;background-position-x:10px}#yikes_mailchimp_tinyMCE_modal{background:url(../../includes/images/tinyMCE/yikes-mailchimp-combo-faded.png) bottom left no-repeat #fff;background-size:40%;background-position-x:10px;background-position-y:95%}#yikes_mailchimp_tinyMCE_modal .mce-foot{border-top:none!important;background:0 0}[id*="_yikes_easy_mc_widget"]>div.widget-top>div.widget-title>h4{background:url(../../includes/images/MailChimp_Assets/Freddie_original.png) 2% 50%/25px auto no-repeat #FAFAFA;padding-left:40px}#review-yikes-easy-mailchimp-notice #yikes-mailchimp-logo,#yikes-mailchimp-logo{font-size:14px;text-align:center;background:url(../../includes/images/Welcome_Page/yikes-mailchimp-welcome-logo.png) no-repeat}#review-yikes-easy-mailchimp-notice #yikes-mailchimp-logo{background-size:60px;float:left;height:80px;width:80px}.about-wrap img.yikes-easy-mc-feature-image.yikes-easy-mc-feature-image-left,.yikes-easy-mc-feature-image-left{float:left;margin-right:30px;margin-left:0!important}.need-support-icon{line-height:1.5}ul.support-option-list{display:inline-block;width:100%}.support-option{float:left}.support-option-second{margin-left:10px}#yikes-mailchimp-logo.support-page{float:left;width:80pt}.yikes-easy-mc-whats-new-section-image{float:none;width:100%;margin-left:0!important}.welcome-page-tabs{margin-top:2em!important}.welcome-page-about-wrap .about-text,.welcome-page-about-wrap h2.welcome-title{margin-left:115px}.whats-new-wrap img.yikes-easy-mc-whats-new-section-image{margin-top:10px}.whats-new-wrap .feature-section:nth-child(1) img{float:left}.whats-new-wrap .feature-section:nth-child(3) img{float:right;width:250px;margin-right:0!important;margin-left:30px}.whats-new-wrap .feature-section:nth-child(4) img{margin-left:0!important}#yikes-mailchimp-logo{height:132px;width:132px}.about-wrap #yikes-mailchimp-logo{position:absolute;top:0;left:0}.about-wrap h2{text-align:left}.edd-welcome-screenshots{float:right;margin-left:10px!important}.about-wrap .feature-section{margin-top:20px}.about-wrap .feature-section p{max-width:40em}.about-wrap img.yikes-easy-mc-feature-image{float:right;margin-left:30px}.yikes-easy-mc-feature-image.yikes-easy-mc-feature-v3-image{border:0;margin-left:100px!important;margin-right:100px;max-height:340px;width:auto}#credit-container,#translators-container{display:inline-block;width:100%}#credit-container h2,#translators-container h2{margin:0 0 .5em 1em}#translators-container{margin-top:5em}#translators-container .translation-language{color:#333}#credit-container .team-member,#translators-container .translator{margin:1em 5% 1em 0;text-align:center}#credit-container .team-member img,#translators-container .translator img{border-radius:50%}.admin_page_yikes-mailchimp-welcome .about-wrap div.error,.admin_page_yikes-mailchimp-welcome .about-wrap div.updated{display:block;margin-left:115px}.github-avatar-image{width:100px}.github-avatar-url{display:inline-block;width:20%}github-avatar-url:focus{outline:0}body.admin_page_yikes-mailchimp-edit-form div.show-some-love-container img,div.show-some-love-container img.customizer-upsell-banner{max-width:100%}body.admin_page_yikes-mailchimp-edit-form div.show-some-love-container p:first-child{font-style:italic}body.admin_page_yikes-mailchimp-edit-form div.show-some-love-container hr{margin:1em 0}body.admin_page_yikes-mailchimp-welcome .nav-tab-wrapper .nav-tab .dashicons{font-size:17px;line-height:1.5}body.admin_page_yikes-mailchimp-welcome #kb-container,body.easy-forms_page_yikes-inc-easy-mailchimp-support .knowledge-base-articles{display:inline-block;margin-top:1em}body.admin_page_yikes-mailchimp-welcome #kb-container h1{font-size:20px;margin-top:-1em}body.admin_page_yikes-mailchimp-welcome #kb-container .knowledge-base-listing,body.easy-forms_page_yikes-inc-easy-mailchimp-support .knowledge-base-articles .knowledge-base-listing{width:45%;margin-right:2%;float:left;min-height:260px}body.admin_page_yikes-mailchimp-welcome #kb-container .knowledge-base-listing li,body.easy-forms_page_yikes-inc-easy-mailchimp-support .knowledge-base-articles .knowledge-base-listing li{margin:12px 0;text-decoration:none}body.admin_page_yikes-mailchimp-welcome #kb-container .knowledge-base-listing li:before,body.easy-forms_page_yikes-inc-easy-mailchimp-support .knowledge-base-articles .knowledge-base-listing li:before{font-family:dashicons;content:"\f123";vertical-align:middle;display:block;float:left;margin:0 5px 5px 0}body.admin_page_yikes-mailchimp-welcome #kb-container .knowledge-base-listing li.list-title,body.easy-forms_page_yikes-inc-easy-mailchimp-support .knowledge-base-articles .knowledge-base-listing li.list-title{font-size:17px;font-weight:200;text-decoration:underline}body.admin_page_yikes-mailchimp-welcome #kb-container .knowledge-base-listing li.list-title:before,body.easy-forms_page_yikes-inc-easy-mailchimp-support .knowledge-base-articles .knowledge-base-listing li.list-title:before{content:"";padding-left:12px}body.admin_page_yikes-mailchimp-welcome .new-feature-list{list-style:none;line-height:middle}body.admin_page_yikes-mailchimp-welcome .new-feature-list li{margin-bottom:10px}body.admin_page_yikes-mailchimp-welcome .new-feature-list li:before{font-family:dashicons;content:"\f139";padding-right:2px;font-size:20px;vertical-align:middle}#review-yikes-easy-mailchimp-notice .button-container{display:block;width:100%;margin:.75em 0 1.5em}#review-yikes-easy-mailchimp-notice .button-container .dashicons{font-size:14px;line-height:1.9;margin-left:-4px}#review-yikes-easy-mailchimp-notice .button-container .dashicons-star-filled{color:#E6B800}#review-yikes-easy-mailchimp-notice .button-container .dashicons-upload{color:#6E8841}#review-yikes-easy-mailchimp-notice .button-container .dashicons-no-alt{color:#dc3a3a;line-height:2}body.easy-mailchimp_page_yikes-inc-easy-mailchimp-settings .dashicons-no-alt{color:#dc3a3a}#review-yikes-easy-mailchimp-notice .button-container a{margin-right:10px}#review-yikes-easy-mailchimp-notice{border-left:4px solid #00a0d2;background:#fefefe;padding:10px 12px 1px;box-shadow:0 1px 1px 0 rgba(0,0,0,.1);-webkit-box-shadow:0 1px 1px 0 rgba(0,0,0,.1);margin:15px 25px 20px 5px}input.readonly,input[readonly],textarea.readonly,textarea[readonly]{background:#D8D8D8}.dashicons.yikes-love{color:pink}.field-description-input{resize:vertical;max-height:100px}.yikes-easy-mc-postbox h3{background:#00a0d2;font-weight:800;color:#fff}.yikes-easy-mc-postbox h3.bg-transparent{color:#333;font-weight:400;background:0 0}.yikes-mc-warning-message{padding-left:15px;margin-top:0;padding-top:10px;color:#da6e6e}.error-message-container label[for=yikes-easy-mc-user-subscribed-message],.error-message-container label[for=yikes-easy-mc-user-subscribed-update-link],.error-message-container label[for=yikes-easy-mc-user-email-subject],.error-message-container label[for=yikes-easy-mc-user-email-body],.error-message-container label[for=yikes-easy-mc-success-message],.error-message-container label[for=yikes-easy-mc-success-single-optin-message],.error-message-container label[for=yikes-easy-mc-user-resubscribed-success-message],.error-message-container label[for=yikes-easy-mc-general-error-message]{padding:.5em 1em;background:rgba(241,241,241,.75);box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;margin:0}body.admin_page_yikes-mailchimp-edit-form #error-container{padding:2px 1em;background:rgba(241,241,241,.75);box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;margin:0;color:#F56060}.error-message-container label:last-child{padding-bottom:1em;margin-bottom:.5em}.error-message-container label,.form-settings-container label{display:block;margin:1em 0}.yikes-easy-forms-sidebar .yikes-mc-settings-expansion-section{padding:.5em .75em;-webkit-box-sizing:border-box;-moz-box-sizing:border-box}.yikes-mc-settings-expansion-section{display:none;background:rgba(241,241,241,.75)}.expansion-section-title{background:#fff}.expansion-section-title.settings-sidebar,.form-builder-section-title{text-decoration:none;display:block;border:1px solid rgba(177,177,177,.71);color:#333;padding:5px;margin:.5em 0 0}.expansion-section-title.settings-sidebar .dashicons,.form-builder-section-title .dashicons{content:"\f132";font-family:dashicons;font-size:15px;line-height:1.5}span.easy-mailchimp-add-on-valid-license-container{color:#44ba44;display:block;margin-top:1em}.easy-mailchimp-add-on-invalid-license-container{color:rgba(227,107,107,.86);display:block;margin-top:1em}.options-sidebar .yikes-easy-mc-postbox{overflow:visible}.options-sidebar .inside{padding:0 20px 12px}.yikes-easy-mc-about-text{margin-top:0}.add-on-settings-divider{margin:1em 0!important}#yks-mailchimp-double-optin-message,#yks-mailchimp-single-optin-message,.settings-page-input{width:50%}#yks-mailchimp-double-optin-message,#yks-mailchimp-single-optin-message{min-height:75px;max-height:200px;resize:vertical}#addon-settings-nav li a,#settings-nav li a{color:#333;text-decoration:none!important;transition:color .15s ease-out;-moz-transition:color .15s ease-out;-webkit-transition:color .15s ease-out;-o-transition:color .15s ease-out}#addon-settings-nav li a:hover,#settings-nav li a:hover,.option-menu-selected-arrow+a{color:#00a0d2!important}#addon-settings-nav{margin-bottom:0;margin-top:5px}.option-menu-selected-arrow{width:0;height:0;border-top:10px solid transparent;border-bottom:10px solid transparent;border-left:10px solid #a0a5aa;position:absolute;left:-.1em}label[for=yikes-mailchimp-debug-status]{display:inline-block;margin-bottom:1em;line-height:2.25}#yikes-mailchimp-debug-status{float:left;margin-top:.5em}label[for=yikes-mc-recaptcha-setting],label[for=yikes-mc-recaptcha-api-key]{display:block;margin-bottom:1em}.recaptcha-preview-link,input.recaptcha-setting-checkbox{display:block;margin-top:.5em}.recaptcha-preview-container{width:100%;display:none;margin:1em 0}#premium-support-form,.support-page-button,.support-page-logo{display:block;width:100%}.wrap #col-left,.wrap #col-right{width:49%}@media (max-width:800px){.wrap #col-left,.wrap #col-right{width:100%}}.support-page-logo{opacity:.7;max-width:100%}.support-page-button{min-height:40px;font-weight:700;text-align:center;line-height:3!important;margin-top:1em!important}.support-page-wordpress-font{font-size:1.3em;margin-right:13px}h2.premium-support-title{margin:1em 0 .5em}#premium-support-form input[type=text],#premium-support-form input[type=email],#premium-support-form input[type=submit],#premium-support-form select{display:block;width:100%;min-width:200px;margin:.5em 0}#premium-support-form label{font-weight:800}#premium-support-form label input,#premium-support-form label select{font-weight:500}#premium-support-form p{font-weight:300;display:block;margin-bottom:1em}#wp-support-content-wrap{min-height:150px;width:100%}.support-form-hidden{display:none!important}#yikes-mailchimp-error-log .row-title{font-weight:400}.create-error-log-help:hover{cursor:pointer}.error-log-tr td{display:table;margin-bottom:1em;margin-top:.5em}p.error-log-missing-file em,p.to-start-logging-errors-notice em{margin:10px 0}.export-custom-forms-list{display:none;margin:1em 0 2em}.export-custom-forms-list p{margin-top:0}.list-rating-star{color:#E6B800}#chimp-chatter{text-align:center}#chimp-chatter .chimp-chatter-container{margin:1em .2em;background:#F8F8F8;border-radius:10px;float:left;height:220px;padding:10px;width:44%}.chimp-chatter-mailchimp-logo{width:100%;display:block;margin:0 auto}.chimp-chatter-sidebar h2.account-status{text-align:center}.mailchimp-affiliate-link{color:#333;display:none}.mailchimp-avatar{display:block;margin:0 auto;box-shadow:3px 3px 10px 0 rgba(214,214,214,.75)}#yikes_easy_mc_toolbar_links li a:focus,.merge-tag-text{box-shadow:none}.chimpchatter-button-container{clear:both;display:block}.chimp-chatter-postbox{float:left;width:49%;margin-right:1%}.circle-account-active,.circle-account-inactive{display:inline-block;vertical-align:middle;height:15px;width:15px;border-radius:50%}#account-details .chimp-chatter-postbox.even{margin-right:0}.circle-account-inactive{margin-top:-3px;margin-right:5px;background:rgba(250,138,138,.79)}.chatter-type{font-weight:600;font-family:"open sans";font-size:14px;margin:5px 5px 0}.chatter-message{margin:2px 2px 15px!important}.circle-account-active{margin-top:-3px;margin-right:5px;background:rgba(128,214,128,.77)}#account-details .mailchimp-avatar{width:120px;border-radius:10%;margin-top:.5em}.chimp-chatter-positive{border-left:4px solid #9ddf9d}.chimp-chatter-negative{border-left:4px solid #FBA2A2}.chimp-chatter-neutral{border-left:4px solid #b1b1b1}#import-list-to-site{margin-top:10px}#import-list-to-site .input-field{display:block;width:100%;margin-top:5px;margin-bottom:5px}#import-list-to-site .form-description{resize:vertical;max-height:65px}#import-list-to-site .description{margin-top:5px}input.clear-mailchimp-api-cache{float:right;margin-top:-33px!important}.yikes-list-refreshed-notice{border-left:4px solid #46b450;margin:5px 0}.yikes-list-refreshed-notice p{margin:1em 0 .5em;padding:6px 12px;background:rgba(241,241,241,.5);font-size:13px;line-height:1.5}.sidebar-container,.star-container{margin-top:5px;margin-bottom:1.5em}.star-container a{text-decoration:none}.star-container .dashicons-star-filled{font-size:1.75em}.sidebar-footer-text{margin:15px 0!important;text-align:center}.sidebar-twitter-icon{text-decoration:none;color:#55ACEE}.field-doesnt-exist-notice{position:absolute;margin-left:5px;width:18px}.field-type-text{display:inline-block}.type-container{margin:0}.form-field-container{margin-top:0;margin-bottom:0}.field-no-longer-exists-warning{position:absolute;margin-left:5px;width:18px}.form-field-container td input[type=checkbox],.form-field-container td input[type=radio]{margin:0 5px}.form-field-container td input[type=checkbox]:first-child,.form-field-container td input[type=radio]:first-child{margin-left:0!important}.merge-tag-text{background:0 0;border:none}.pre-defined-tag-link{font-size:11px}.toggle-container{font-size:small;float:right}#pre-defined-tag-container{display:none}#pre-defined-tag-container h3{margin-bottom:0}#pre-defined-tag-container .tooltop-tag .dashicons-editor-help{font-size:13px;line-height:1.5}.no-fields-assigned-notice{margin:4em 0 2.25em;padding-bottom:6em;width:100%;text-align:center;background:url(../../includes/images/no-form-fields-assigned-arrow.jpg) bottom center no-repeat;background-size:105px}.yikes-easy-mc-widget-preloader{position:absolute;left:48%;margin-top:-96px}.yikes-dashboard-widget-section{padding:0 12px 12px}.select-list-title{padding-left:0}.yikes-dashboard-widget-section .description{margin:.5em 0 0}. error-descripion{padding-top:.5em}.yikes-mc-freddie-logo{float:left;margin-right:10px}.mv_ig_list{width:94%;margin-bottom:8px!important;border:none!important;background:0 0!important}.mv_ig_list .list-container{position:absolute}.mv_ig_list a{width:48%;padding:5px 0!important;text-align:center;margin:0}.mv_ig_list a:first-child{margin-right:0}.mv_ig_list a:last-child{float:right}.mv_ig_list .nav-tab{border:1px solid #ccc}.mv_ig_list .nav-tab-active{color:#fff;font-weight:700;background:#00a0d2}.mv_ig_list .arrow-down{position:absolute;margin-top:21px;margin-left:50px;width:0;height:0;border-left:12px solid transparent;border-right:12px solid transparent;border-top:12px solid #00a0d2}#container-container{display:inline-block;width:521px}#container-container .list-container{float:left;width:240px;position:relative}#container-container .list-container:last-child{margin-left:2em}#yikes_easy_mc_toolbar{margin-top:-.75em}#yikes_easy_mc_toolbar_links{display:inline-block;width:100%;margin:0;padding:10px 0}#yikes_easy_mc_toolbar_links li{float:left;margin:0 .5em}#yikes_easy_mc_toolbar_links li a{text-decoration:none;display:inline-block}#yikes_easy_mc_toolbar_links li a.selected_hidden_setting{color:#333;margin-bottom:3px}#yikes_easy_mc_toolbar_links li .selected_setting_triangle{width:0;height:0;border-left:13px solid transparent;border-right:13px solid transparent;border-top:13px solid rgba(206,206,206,1);margin:0 auto}.checkbox-settings-list-dropdown,.optin-checkbox-label-input{width:250px;display:block}#yikes_easy_mc_toolbar_links li a.form-builder:before{content:"\f116";font-family:dashicons}#yikes_easy_mc_toolbar_links li a.form-customizer:before{content:"\f100";font-family:dashicons}#yikes_easy_mc_toolbar_links li a.error-messages:before{content:"\f117";font-family:dashicons}#yikes_easy_mc_toolbar_links li a.form-settings:before{content:"\f111";font-family:dashicons}#checkbox-settings-form .dashicons-editor-help{font-size:15px;line-height:1.6}.no-lists-setup-notice{padding:.5em 0}.yikes-form-id-number{width:55px}span[title=Impressions]:hover,span[title=Submissions]:hover,span[title="Conversion Rate"]:hover{display:block;cursor:pointer}.form-id-container{padding:1px 8px;border-radius:5px;background:#49a9ec;font-weight:700;color:#fff}.manage-form-admin-notice{margin-top:1.75em!important}.remove-notification,.yikes-mc-settings-expansion-section a.remove-field,a.yikes-delete-mailchimp-form,a.yikes-delete-subscriber{color:#d96060!important}.yikes-delete-mailchimp-form{margin-top:6px}#postbox-container-1 .yikes-delete-mailchimp-form{float:right}.form-buttons-container{display:block;padding:11px 10px}.forms-buttons-container input[type=submit]{margin:0 0 .5em}.update-form-spinner{position:absolute;left:0;right:0;margin:0 auto;bottom:13px}.yikes-mc-shortcode-input{text-align:center;width:100%;color:#333}.hidden-class{display:none!important}.stat-container{width:10%;max-width:75px}.no-current-subscriber-notice em,.no-mailchimp-forms-found em{padding:25px 0 25px 25px}.column-columnname span.stats{display:block;width:100%;text-align:center}.column-columnname span.stats span{display:inline-block;width:20%}.column-columnname span.stats span:hover{cursor:pointer}#available-fields li,#available-interest-groups li{text-decoration:none;display:block;border:1px solid rgba(177,177,177,.71);color:#333;padding:5px;margin:.5em 0}#available-fields li.not-available,#available-interest-groups li.not-available{opacity:.6!important}#available-fields li.field-to-add-to-form,#available-interest-groups li.group-to-add-to-form{background:rgba(46,162,204,.25)}.add-field-to-editor .add-to-form-builder-arrow,.button-secondary .add-to-form-builder-arrow{width:15px;font-size:15px;line-height:1.8}.clear-form-fields{background:#e14d43;border-color:#d02c21;color:#fff;box-shadow:inset 0 1px 0 #ec8b85,0 1px 0 rgba(0,0,0,.15);text-decoration:none;display:inline-block;height:28px;padding:0 10px 1px;border-width:1px;-webkit-appearance:none;border-radius:3px;white-space:nowrap;font-size:13px;line-height:26px;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;float:right;margin:0 11px 10px 0}.clear-form-fields:active,.clear-form-fields:focus,.clear-form-fields:hover{background:#dd382d;border-color:#ba281e;color:#fff;box-shadow:inset 0 1px 0 #e8776f}.yikes-mc-view-list-breadcrumbs{padding:.8em;border:1px solid #D8D8D8;background:#ECECEC;margin:1.5em 0 .8em}.yikes-mc-member-rating-star{color:#daa520}#yikes-mc-subscriber-card-wrapper{background:#fefefe;min-height:200px;display:inline-block;box-shadow:0 1px 1px rgba(0,0,0,.04);webkit-box-shadow:0 1px 1px rgba(0,0,0,.04);border:1px solid #e5e5e5;padding:15px 20px;width:500px;float:left}#yikes-mc-subscriber-card-wrapper .subscriber-optin-ip{display:inline-block;margin:1em 0 0;font-style:italic}.view-user-data-wrap #customer-tab-wrapper-list{float:left;background:#fefefe;margin-top:0;padding:12px;margin-left:-1px;border-right:1px solid #e5e5e5;border-top:1px solid #e5e5e5;border-bottom:1px solid #e5e5e5}.view-user-data-wrap #customer-tab-wrapper-list .dashicons{font-size:23px;height:23px;width:23px;margin:3px 0}.view-user-data-wrap #customer-tab-wrapper-list li.inactive{color:rgba(51,51,51,.31);transition:color ease-out .1s}.view-user-data-wrap #customer-tab-wrapper-list li.active,.view-user-data-wrap #customer-tab-wrapper-list li.inactive:hover{color:rgba(51,51,51,1)}#yikes-mc-subscriber-card-wrapper .yikes-mc-card-top .member-star-rating-container,#yikes-mc-subscriber-card-wrapper .yikes-mc-card-top h2,#yikes-mc-subscriber-card-wrapper .yikes-mc-card-top img{float:left}#yikes-mc-subscriber-card-wrapper #delete-mailchimp-subscriber{display:block;margin:0 auto}#yikes-mc-subscriber-card-wrapper .yikes-mc-card-top img{border-radius:3px}#yikes-mc-subscriber-card-wrapper .merge-variable-section li{display:inline-block;list-style:none;float:left;width:50%;min-height:65px;border-bottom:1px dotted #ddd}#yikes-mc-subscriber-card-wrapper .merge-variable-section li p{margin:0 0 1em}#yikes-mc-subscriber-card-wrapper .yikes-mc-card-top h2{max-width:370px;width:75%;padding:0}#yikes-mc-subscriber-card-wrapper .member-star-rating-container{display:block;margin:.5em 0 .5em 10px}#yikes-mc-subscriber-card-wrapper h2{margin-left:10px;margin-top:0;padding-top:0}#yikes-mc-subscriber-card-wrapper .yikes-mc-card-body,#yikes-mc-subscriber-card-wrapper .yikes-mc-card-top{display:inline-block;width:100%}.member-location-data,.member-subscription-date{width:70%;max-width:370px;display:block;float:left}#yikes-mc-subscriber-card-wrapper .yikes-mc-card-body h4{margin-top:0;margin-left:5px}.yikes-mc-subscriber-hr{margin:1.5em 0}.member-subscription-date{margin:.5em 0 .5em 10px}.member-location-data{margin:.25em 0 .25em 10px}.addon-required-link{color:#333;opacity:.5}.view-list-sidebar-input{color:#333}.interest-group-ul,.merge-variable-ul,.segment-ul{padding-left:15px;font-size:14px}.interest-group-ul li .dashicons,.merge-variable-ul li .dashicons{line-height:1.8;font-size:9px}a.button-primary.edit-fields-button{margin:0 0 10px 15px}.interest-group-count,.merge-variable-count,.segment-group-count{text-decoration:underline;margin-bottom:.75em;padding-left:7px}body.admin_page_yikes-mailchimp-edit-form .ui-datepicker .ui-datepicker-calendar td a,body.admin_page_yikes-mailchimp-edit-form .ui-datepicker a,body.admin_page_yikes-mailchimp-edit-form .ui-datepicker a:hover{text-decoration:none}.interest-group-title{padding-left:5px}.edit-segments-button{margin:0 0 10px 15px}.edit-segment-description{padding:0 0 10px 15px}#credit-container{margin-top:1.5em}.yikes-easy-mailchimp-custom-content-icon{font-size:15px;line-height:1}.custom-field-section{display:block;margin:1em 0}#associated-list{width:100%;margin-top:5px}#redirect-user-to-selection{width:100%}#edit-yikes-mc-form label h3{margin-left:0;padding-left:0}#available-fields .field-required{color:#d96060!important}body.admin_page_yikes-mailchimp-edit-form #poststuff h2{padding:8px 12px;margin-top:0}.edit-form-form-description{width:100%;resize:vertical;min-height:65px;max-height:100px}.edit-form-title{padding-left:12px!important}#edit-form-description{padding:0 12px;margin:1em 0}.yikes-easy-mc-postbox{overflow:hidden}.no-interest-groups-found-message{opacity:.35}.upgrading-ellipse-one,.upgrading-ellipse-two{-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";-moz-opacity:0;-webkit-animation:dot 1.3s infinite}#interest-groups-container .description,#merge-variables-container .description{padding-top:.5em}.inside-section-1{margin-top:0;margin-bottom:1.5em}.inside-section-2{margin-top:0;margin-bottom:2em}.form-field-container-span{display:block;margin:.5em 0}#style-list ul li{display:block;width:100%;margin:1em 0}.form-style-adjustment,.wp-picker-container{display:block!important;width:100%;margin:.5em 0}.dynamic-email-tag{display:inline-block;margin-right:5px}.dynamic-tag-description td{padding-top:0}#create-new-notification-button{margin-top:1em}.file-container{display:none}.yikes-mailchimp-file-field input[name*="custom-field[incentive-attachment]"]{margin-bottom:.5em}.yikes-mailchimp-file-field input[name*="custom-field[incentive-attachment]"]+.button-secondary{margin-left:4px}input#upload-btn[data-attr-position="1"]{margin-left:0}.remove-file-button{background:url(../partials/helpers/fields/img/icon-delete.png);height:16px;position:absolute;text-indent:-99999px;width:16px}a.add-new-incentive-attachment{display:block;width:40px;margin-right:100%!important;margin-top:.5em!important}a.add-new-incentive-attachment .dashicons{font-size:15px;line-height:1.8}.form-builder-placeholder{background:rgba(206,206,206,.2);height:30px}.admin_page_yikes-mailchimp-edit-form #form-settings .section-title{font-size:1em;border-bottom:1px solid rgba(187,187,187,.29);display:block;width:100%;padding-bottom:6px;margin-bottom:.5em;margin-top:1.5em}.admin_page_yikes-mailchimp-edit-form #form-settings .section-interior label,.admin_page_yikes-mailchimp-edit-form #form-settings .section-title.first{margin-top:0}.admin_page_yikes-mailchimp-edit-form #form-settings .section-interior{display:inline-block;width:100%;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;background:rgba(241,241,241,.75);padding:1em}label.login-restriction-center{display:block;width:100%}.admin_page_yikes-mailchimp-edit-form #form-settings .section-interior .date-restirction-section{display:inline-block}.admin_page_yikes-mailchimp-edit-form #form-settings .section-interior .date-restirction-section p.description.error{color:#F56060}.admin_page_yikes-mailchimp-edit-form #form-settings .section-interior .date-restirction-section label{float:left;margin-right:.5em;margin-top:0;margin-bottom:0}.admin_page_yikes-mailchimp-edit-form #form-settings .section-interior .nested-child .yikes-easy-mc-form-restriction-expired-message,.admin_page_yikes-mailchimp-edit-form #form-settings .section-interior .nested-child .yikes-easy-mc-form-restriction-login-message,.admin_page_yikes-mailchimp-edit-form #form-settings .section-interior .nested-child .yikes-easy-mc-form-restriction-pending-message{display:block;width:100%;min-height:50px}.admin_page_yikes-mailchimp-edit-form #form-settings .section-interior .nested-child{float:left;padding-left:2%;width:98%;border-left:1px dashed #BDBDBD;border-spacing:2px;margin:.5em 0 1em}.admin_page_yikes-mailchimp-edit-form #form-settings .section-interior .nested-child .yikes-easy-mc-submit-button-text{margin:0}.admin_page_yikes-mailchimp-edit-form #form-settings .section-interior .date-restirction-section{margin-bottom:0}.admin_page_yikes-mailchimp-edit-form #form-settings .section-interior .date-restirction-section.last{margin-bottom:.75em}.admin_page_yikes-mailchimp-edit-form #form-settings .section-interior .nested-child.hidden{display:none}.admin_page_yikes-mailchimp-edit-form #form-settings .section-interior .description+label{margin-top:1em;float:left;width:100%}.admin_page_yikes-mailchimp-edit-form #form-settings .section-interior label.inline-form-label{margin-bottom:0;margin-top:0}.admin_page_yikes-mailchimp-edit-form #form-settings .section-interior .description{display:block;width:100%;float:left}.admin_page_yikes-mailchimp-edit-form #form-settings .nested-child strong:first-child,.admin_page_yikes-mailchimp-edit-form #form-settings .section-interior strong:first-child{display:block;width:100%}.admin_page_yikes-mailchimp-edit-form #form-settings .inline-form-label{float:left;margin-right:10px}body.admin_page_yikes-mailchimp-edit-form .ui-timepicker-wrapper{overflow-y:auto;height:150px;width:170px;background:#fff;border:1px solid #ddd;box-shadow:0 5px 10px rgba(0,0,0,.2);outline:0;z-index:10001;margin:0}body.admin_page_yikes-mailchimp-edit-form .ui-timepicker-wrapper.ui-timepicker-with-duration{width:13em}body.admin_page_yikes-mailchimp-edit-form .ui-timepicker-wrapper.ui-timepicker-with-duration.ui-timepicker-step-30,body.admin_page_yikes-mailchimp-edit-form .ui-timepicker-wrapper.ui-timepicker-with-duration.ui-timepicker-step-60{width:11em}body.admin_page_yikes-mailchimp-edit-form .ui-timepicker-list{margin:0;padding:0;list-style:none}body.admin_page_yikes-mailchimp-edit-form .ui-timepicker-duration{margin-left:5px;color:#888}body.admin_page_yikes-mailchimp-edit-form .ui-timepicker-list:hover .ui-timepicker-duration{color:#888}body.admin_page_yikes-mailchimp-edit-form .ui-timepicker-list li{padding:3px 0 3px 5px;cursor:pointer;white-space:nowrap;color:#000;list-style:none;margin:0}body.admin_page_yikes-mailchimp-edit-form .ui-timepicker-list:hover .ui-timepicker-selected{background:#fff;color:#000}body.admin_page_yikes-mailchimp-edit-form .ui-timepicker-list .ui-timepicker-selected:hover,body.admin_page_yikes-mailchimp-edit-form .ui-timepicker-list li:hover,body.admin_page_yikes-mailchimp-edit-form li.ui-timepicker-selected{background:#1980EC;color:#fff}body.admin_page_yikes-mailchimp-edit-form .ui-timepicker-list li:hover .ui-timepicker-duration,body.admin_page_yikes-mailchimp-edit-form li.ui-timepicker-selected .ui-timepicker-duration{color:#ccc}body.admin_page_yikes-mailchimp-edit-form .ui-timepicker-list li.ui-timepicker-disabled,body.admin_page_yikes-mailchimp-edit-form .ui-timepicker-list li.ui-timepicker-disabled:hover,body.admin_page_yikes-mailchimp-edit-form .ui-timepicker-list li.ui-timepicker-selected.ui-timepicker-disabled{color:#888;cursor:default}body.admin_page_yikes-mailchimp-edit-form .ui-timepicker-list li.ui-timepicker-disabled:hover,body.admin_page_yikes-mailchimp-edit-form .ui-timepicker-list li.ui-timepicker-selected.ui-timepicker-disabled{background:#f2f2f2}body.admin_page_yikes-mailchimp-edit-form .ui-datepicker{background-color:#fff;border:1px solid #66AFE9;border-radius:4px;box-shadow:0 0 8px rgba(102,175,233,.6);display:none;margin-top:4px;padding:10px;width:240px}body.admin_page_yikes-mailchimp-edit-form .ui-datepicker a:hover,body.admin_page_yikes-mailchimp-edit-form .ui-datepicker td:hover a{color:#2A6496;transition:color .1s ease-in-out}body.admin_page_yikes-mailchimp-edit-form .ui-datepicker .ui-datepicker-header{margin-bottom:4px;text-align:center}body.admin_page_yikes-mailchimp-edit-form .ui-datepicker .ui-datepicker-title{font-weight:700}body.admin_page_yikes-mailchimp-edit-form .ui-datepicker .ui-datepicker-next,body.admin_page_yikes-mailchimp-edit-form .ui-datepicker .ui-datepicker-prev{cursor:default;font-family:'Glyphicons Halflings';-webkit-font-smoothing:antialiased;font-style:normal;font-weight:400;height:20px;line-height:1;margin-top:2px;width:30px}body.admin_page_yikes-mailchimp-edit-form .ui-datepicker .ui-datepicker-prev{float:left;text-align:left}body.admin_page_yikes-mailchimp-edit-form .ui-datepicker .ui-datepicker-next{float:right;text-align:right}body.admin_page_yikes-mailchimp-edit-form .ui-datepicker .ui-datepicker-prev:before{content:"\f141";font-family:dashicons}body.admin_page_yikes-mailchimp-edit-form .ui-datepicker .ui-datepicker-next:before{content:"\f139";font-family:dashicons}body.admin_page_yikes-mailchimp-edit-form .ui-datepicker-next:hover,body.admin_page_yikes-mailchimp-edit-form .ui-datepicker-prev:hover{cursor:pointer!important}body.admin_page_yikes-mailchimp-edit-form .ui-datepicker-close{display:none}body.admin_page_yikes-mailchimp-edit-form .ui-datepicker-current{color:#555!important;border-color:#ccc!important;background:#f7f7f7!important;box-shadow:0 1px 0 #ccc!important;vertical-align:top!important;display:inline-block;text-decoration:none;font-size:13px;line-height:26px;height:28px;padding:0 10px 1px;cursor:pointer;border-width:1px;border-style:solid;-webkit-appearance:none;border-radius:3px;white-space:nowrap;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;margin-top:10px}body.admin_page_yikes-mailchimp-edit-form .ui-datepicker .ui-datepicker-current-day a,body.admin_page_yikes-mailchimp-edit-form .ui-datepicker .ui-datepicker-today a{color:#fff}body.admin_page_yikes-mailchimp-edit-form .ui-datepicker .ui-icon{display:none}body.admin_page_yikes-mailchimp-edit-form .ui-datepicker .ui-datepicker-calendar{table-layout:fixed;width:100%}body.admin_page_yikes-mailchimp-edit-form .ui-datepicker .ui-datepicker-calendar td,body.admin_page_yikes-mailchimp-edit-form .ui-datepicker .ui-datepicker-calendar th{text-align:center;padding:4px 0}body.admin_page_yikes-mailchimp-edit-form .ui-datepicker .ui-datepicker-calendar td{border-radius:4px;transition:background-color .1s ease-in-out,color .1s ease-in-out}body.admin_page_yikes-mailchimp-edit-form .ui-datepicker .ui-datepicker-calendar td:hover{background-color:#EBEBEB;cursor:pointer}body.admin_page_yikes-mailchimp-edit-form .ui-datepicker .ui-datepicker-today{background-color:rgba(66,137,204,.65)}body.admin_page_yikes-mailchimp-edit-form .ui-datepicker .ui-datepicker-current-day{background-color:#4289cc}body.admin_page_yikes-mailchimp-edit-form .ui-datepicker .ui-datepicker-calendar .ui-datepicker-unselectable:hover{background-color:#fff;cursor:default}.custom-radio-holder{display:inline-block;width:100%;margin:.5em 0}.custom-radio-label{display:block;float:left;margin:0 5px}.custom-radio-label:first-child{margin-left:0!important}.custom-radio-label input[type=radio]{margin-right:0!important}.custom-select-field{display:block;width:100%;margin:.5em 0}#available-widgets [class*=yikes_easy] .widget-title:before{content:""!important;background:url(../../includes/images/MailChimp_Assets/Freddie_original.png) no-repeat #FAFAFA;background-size:contain}body.wp-customizer #available-widgets [id*="_yikes_easy_mc_widget"]>div.widget-top>div.widget-title>h4{background:0 0!important}#connection-container{float:right;color:#fff;padding:.25em .75em .25em .25em;margin-top:-4px}#connection-container.api-connected{background:#44ba44}#connection-container.api-not-connected{background:#b5b5b5}.yikes-mc-api-connected,.yikes-mc-api-not-connected{line-height:1}.show-some-love-container{transition:max-height .75s}#review-yikes-easy-mc{text-align:center}#review-yikes-easy-mc .dashicons-star-filled{color:#E6B800}.meta-box-sortables hr{margin:1.75em 0 0}#about-yikes-inc{display:none}#about-yikes-inc .about-sidebar-yikes-logo{float:left;width:95px;margin:5px 7px 0 0}#about-yikes-inc p{margin-top:0}.yikes-easy-mc-updated{display:block;border-left:4px solid #4EAEF0;margin:1em 20px 1em 0;padding:2px 10px;background:right bottom no-repeat #fff;background-size:120px;background-position-y:29px}.support-section{margin:1.5em 0;padding:1em 0}.github-octocat{background:url(../../includes/images/Support_Page/Octocat.png) left top no-repeat;background-size:100%;width:50px;height:45px;display:block;float:left;margin-top:-5px}@media screen and (max-width:1200px){.yikes-easy-mc-postbox #post-body.columns-2 #postbox-container-1{float:none}}@media screen and (max-width:850px){.option-menu-selected-arrow{display:none!important}}@media screen and (max-width:782px){#chimp-chatter .chimp-chatter-container{float:none;height:auto;width:100%}}.recaptcha-demo-gif{width:275px}.pro-version-only-notice{color:#d96060}.upgrading-ellipse-one{filter:alpha(opacity=0);-khtml-opacity:0;opacity:0;-webkit-animation-delay:0ms;animation:dot 1.3s infinite;animation-delay:0ms}.upgrading-ellipse-two{filter:alpha(opacity=0);-khtml-opacity:0;opacity:0;-webkit-animation-delay:.2s;animation:dot 1.3s infinite;animation-delay:.2s}.upgrading-ellipse-three{-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";filter:alpha(opacity=0);-moz-opacity:0;-khtml-opacity:0;opacity:0;-webkit-animation:dot 1.3s infinite;-webkit-animation-delay:.3s;animation:dot 1.3s infinite;animation-delay:.3s}@keyframes dot{0%,50%{opacity:0}100%{opacity:1}}
 
admin/css/yikes-inc-easy-mailchimp-migrate-option-styles.css CHANGED
@@ -1,2 +1 @@
1
-
2
- /*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInlpa2VzLWluYy1lYXN5LW1haWxjaGltcC1taWdyYXRlLW9wdGlvbi1zdHlsZXMuY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJHQUFHLDZIQUE2SCxJQUFJLDRCQUE0QixjQUFjLEdBQUcsSUFBSSxxQ0FBK0IsZ0JBQW9CLEdBQUcsZ0JBQUEsR0FBbUIsaUJBQUcsR0FBa0IsSUFBRywrQkFBK0Isb0JBQUcsR0FBQSxtQkFBNEIsR0FBQSxrQkFBd0IsR0FBQSwrQkFBMEMsR0F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tZGVsYXk6IDAuM3M7XHJcdFx0IGFuaW1hdGlvbjogZG90IDEuM3MgaW5maW5pdGU7XHJcdFx0IGFuaW1hdGlvbi1kZWxheTogMC4zcztcclx0fVxyXHRcclx0XHJcdC8qIEFuaW1hdGlvbnMgKi9cclx0QC13ZWJraXQta2V5ZnJhbWVzIGRvdCB7XHJcdFx0ICAwJSB7IG9wYWNpdHk6IDA7IH1cclx0XHQgNTAlIHsgb3BhY2l0eTogMDsgfVxyXHRcdDEwMCUgeyBvcGFjaXR5OiAxOyB9XHJcdH1cclx0QGtleWZyYW1lcyBkb3Qge1xyXHRcdCAgMCUgeyBvcGFjaXR5OiAwOyB9XHJcdFx0IDUwJSB7IG9wYWNpdHk6IDA7IH1cclx0XHQxMDAlIHsgb3BhY2l0eTogMTsgfVxyXHR9Il19 */
1
+
 
admin/js/min/yikes-inc-easy-mailchimp-dashboard-widget.min.js CHANGED
@@ -1 +1 @@
1
- window.Yikes_MailChimp_Dashboard_Widget=window.Yikes_MailChimp_Dashboard_Widget||{},function(a,b,c,d,e){"use strict";d.l10n=a.yikes_mailchimp_dsahboard_widget||{},d.cache=function(){d.$={},d.$.change_list=c(b.getElementById("yikes-easy-mc-dashboard-change-list")),d.$.widget_stats=c(b.getElementById("yikes-easy-mc-dashboard-widget-stats")),d.$.preloader=c(".yikes-easy-mc-widget-preloader")},d.new_list_data=function(){d.$.widget_stats.children().not(".yikes-easy-mc-widget-preloader").fadeTo("fast",".5"),d.$.widget_stats.append(d.l10n.preloader);var a=c(this).find("option:selected").attr("val"),b={action:"get_new_list_data",list_id:a};return c.ajax({url:d.l10n.ajax_url,type:"POST",data:b,success:function(a,b,c){d.$.preloader.remove(),d.$.widget_stats.children().fadeTo("fast","1"),d.$.widget_stats.html(a)},error:function(a,b,c){alert(b+a.status+a.responseText+"...")},complete:function(a,b){}}),!1},d.init=function(){d.cache(),d.$.change_list.on("change",d.new_list_data)},c(b).ready(d.init)}(window,document,jQuery,Yikes_MailChimp_Dashboard_Widget);
1
+ window.Yikes_MailChimp_Dashboard_Widget=window.Yikes_MailChimp_Dashboard_Widget||{},function(a,b,c,d,e){"use strict";d.l10n=a.yikes_mailchimp_dsahboard_widget||{},d.cache=function(){d.$={},d.$.change_list=c(b.getElementById("yikes-easy-mc-dashboard-change-list")),d.$.widget_stats=c(b.getElementById("yikes-easy-mc-dashboard-widget-stats")),d.$.preloader=c(".yikes-easy-mc-widget-preloader")},d.new_list_data=function(){d.$.widget_stats.children().not(".yikes-easy-mc-widget-preloader").fadeTo("fast",".5"),d.$.widget_stats.append(d.l10n.preloader);var a=c(this).val(),b={action:"get_new_list_data",list_id:a};return c.ajax({url:d.l10n.ajax_url,type:"POST",data:b,success:function(a,b,c){console.log(a),d.$.preloader.remove(),d.$.widget_stats.children().fadeTo("fast","1"),d.$.widget_stats.html(a)},error:function(a,b,c){alert(b+a.status+a.responseText+"...")},complete:function(a,b){}}),!1},d.init=function(){d.cache(),d.$.change_list.on("change",d.new_list_data)},c(b).ready(d.init)}(window,document,jQuery,Yikes_MailChimp_Dashboard_Widget);
admin/js/min/yikes-inc-easy-mailchimp-extender-edit-form.min.js CHANGED
@@ -1 +1 @@
1
- function togglePageRedirection(a){1==a.value?jQuery("#redirect-user-to-selection-label").fadeIn():jQuery("#redirect-user-to-selection-label").fadeOut()}function storeGlobalClicked(a){var b=a.parents("td").find("input").attr("name");jQuery(".clicked-input").val(b)}function populateDefaultValue(a){var b=jQuery(".clicked-input").val();jQuery(".clicked-input").val(""),tb_remove(),jQuery('input[name="'+b+'"]').val(a)}function toggle_nested_section(a){var b=jQuery(a).val();switch(b){case"image":jQuery(".submit-button-type-text").fadeOut("fast",function(){jQuery(".submit-button-type-image").fadeIn("fast")});break;case"text":jQuery(".submit-button-type-image").fadeOut("fast",function(){jQuery(".submit-button-type-text").fadeIn("fast")});break;default:case"1":"yikes-easy-mc-form-schedule"==jQuery(a).attr("name")?jQuery(".date-restirction-section").fadeToggle():jQuery(".login-restirction-section").fadeToggle()}return!1}function initialize_form_schedule_time_pickers(){jQuery(".date-picker").datepicker({numberOfMonths:1,showButtonPanel:!0,closeText:window.yikes_mailchimp_edit_form.closeText,currentText:window.yikes_mailchimp_edit_form.currentText,monthNames:window.yikes_mailchimp_edit_form.monthNames,monthNamesShort:window.yikes_mailchimp_edit_form.monthNamesShort,dayNames:window.yikes_mailchimp_edit_form.dayNames,dayNamesShort:window.yikes_mailchimp_edit_form.dayNamesShort,dayNamesMin:window.yikes_mailchimp_edit_form.dayNamesMin,dateFormat:window.yikes_mailchimp_edit_form.dateFormat,firstDay:window.yikes_mailchimp_edit_form.firstDay,isRTL:window.yikes_mailchimp_edit_form.isRTL,onSelect:function(a,b){var c=b.lastVal,d=b.id;yikes_check_valid_date(a,c,d)}}),jQuery(".time-picker").timepicker({scrollDefault:"now",timeFormat:"h:i A"}),jQuery(".time-picker").on("changeTime",function(){var a=jQuery(this).attr("id"),b=jQuery("#yikes-easy-mc-form-restriction-start-date").val(),c=jQuery("#yikes-easy-mc-form-restriction-end-date").val();yikes_check_valid_date(b,c,a)})}function yikes_check_valid_date(a,b,c){var d=jQuery("#yikes-easy-mc-form-restriction-start-date").val(),e=jQuery("#yikes-easy-mc-form-restriction-end-date").val(),f=yikes_12_to_24_hour_time_conversion(jQuery("#yikes-easy-mc-form-restriction-start-time").val()),g=yikes_12_to_24_hour_time_conversion(jQuery("#yikes-easy-mc-form-restriction-end-time").val()),h=new Date(d+" "+f),i=new Date(e+" "+g);if(h>i){if("yikes-easy-mc-form-restriction-start-date"!=c&&"yikes-easy-mc-form-restriction-end-date"!=c||jQuery("#"+c).val(b),jQuery(".date-restirction-section").find("p.description.error").length)return;jQuery(".date-restirction-section").first().find("p.description").after('<p class="description error">'+window.yikes_mailchimp_edit_form.start_date_exceeds_end_date_error+"</p>")}else jQuery(".date-restirction-section").find("p.description.error").remove()}function yikes_12_to_24_hour_time_conversion(a){var b=Number(a.match(/^(\d+)/)[1]),c=Number(a.match(/:(\d+)/)[1]),d=a.match(/\s(.*)$/)[1];"PM"==d&&b<12&&(b+=12),"AM"==d&&12==b&&(b-=12);var e=b.toString(),f=c.toString();return b<10&&(e="0"+e),c<10&&(f="0"+f),e+":"+f}function toggleUpdateEmailContainer(a){jQuery(".send-update-email").stop().fadeToggle()}window.Yikes_MailChimp_Edit_Form=window.Yikes_MailChimp_Edit_Form||{},window.yikes_mailchimp_edit_form=window.yikes_mailchimp_edit_form||{},function(a,b,c,d,e){"use strict";d.l10n=a.yikes_mailchimp_edit_form||{},c(b).ready(function(){c("body").find("#form-builder-container").sortable({items:".draggable:not(.non-draggable-yikes)",axis:"y",placeholder:"form-builder-placeholder",update:function(){var a=1;jQuery("#form-builder-container").find(".draggable").each(function(){jQuery(this).find(".position-input").val(a),a++})}}),c("body").on("click",".remove-field",function(){var a=jQuery(this).attr("alt"),b=jQuery(this);return c(this).parents(".yikes-mc-settings-expansion-section").prev().find(".dashicons").toggleClass("dashicons-minus"),c(this).parents(".yikes-mc-settings-expansion-section").slideToggle(450,function(){b.parents(".draggable").find(".expansion-section-title").css("background","rgb(255, 134, 134)"),b.parents(".draggable").fadeOut("slow",function(){jQuery("#available-fields").find('li[alt="'+a+'"]').removeClass("not-available"),jQuery("#available-interest-groups").find('li[alt="'+a+'"]').removeClass("not-available"),jQuery(this).remove(),c("#form-builder-container").find(".draggable").length<1&&(c(".clear-form-fields").hide(),c(".clear-form-fields").next().hide(),c("#form-builder-container").html('<h4 class="no-fields-assigned-notice non-draggable-yikes"><em>'+d.l10n.no_fields_assigned+"</em></h4>"))})}),!1}),c("body").on("click",".hide-field",function(){return c(this).parents(".yikes-mc-settings-expansion-section").prev().find(".dashicons").toggleClass("dashicons-minus"),c(this).parents(".yikes-mc-settings-expansion-section").slideToggle(450),!1}),c("body").on("click",".add-field-to-editor",function(){return c(".field-to-add-to-form").each(function(){var a=c("#form-builder-container").find(".draggable").length,b=c(this),e=b.attr("alt");c("#available-fields").children("li").removeClass("available-form-field");var f=c(this);f.attr("disabled","disabled").attr("onclick","return false;").removeClass("add-field-to-editor");var g={action:"add_field_to_form",field_name:b.attr("data-attr-field-name"),merge_tag:e,field_type:b.attr("data-attr-field-type"),list_id:b.attr("data-attr-form-id")};c.ajax({url:d.l10n.ajax_url,type:"POST",data:g,dataType:"html",success:function(d,f,g){b.removeClass("field-to-add-to-form").addClass("not-available"),c(".add-field-to-editor").hide(),c(".no-fields-assigned-notice").is(":visible")&&c("#form-builder-container").html(""),c("#form-builder-container").append(d),c(".clear-form-fields").show(),c(".clear-form-fields").next().show(),c(".field-"+e+"-position").val(parseInt(a+1))},error:function(a,b,c){alert(b+a.status+a.responseText+"...")},complete:function(a,b){c("#available-fields").children("li").addClass("available-form-field"),f.removeAttr("disabled").removeAttr("onclick"),c(".add-field-to-editor").hide()}})}),!1}),c("body").on("click",".add-interest-group-to-editor",function(){var a=c("#form-builder-container").find(".draggable").length,b=c(".group-to-add-to-form").attr("alt");c("#available-interest-groups").children("li").removeClass("available-interest-group");var e=c(this);e.attr("disabled","disabled").attr("onclick","return false;").removeClass("add-interest-group-to-editor");var f={action:"add_interest_group_to_form",field_name:c(".group-to-add-to-form").attr("data-attr-field-name"),group_id:b,field_type:c(".group-to-add-to-form").attr("data-attr-field-type"),list_id:c(".group-to-add-to-form").attr("data-attr-form-id")};return c.ajax({url:d.l10n.ajax_url,type:"POST",data:f,dataType:"html",success:function(b,d,e){c(".group-to-add-to-form").removeClass("group-to-add-to-form").addClass("not-available"),c(".add-interest-group-to-editor").hide(),a<1?(c("#form-builder-container").html("").append(b),c(".clear-form-fields").show(),c(".clear-form-fields").next().show()):c("#form-builder-container").append(b)},error:function(a,b,c){alert(b+a.status+a.responseText+"...")},complete:function(a,b){c("#available-interest-groups").children("li").addClass("available-interest-group"),e.removeAttr("disabled").removeAttr("onclick").addClass("add-interest-group-to-editor"),c(".add-interest-group-to-editor").hide()}}),!1}),c(".color-picker").each(function(){c(this).wpColorPicker()}),c("body").on("click",".expansion-section-title",function(){return c(this).next().stop().slideToggle(),c(this).find(".dashicons").toggleClass("dashicons-minus"),!1}),c("body").on("click",".available-form-field",function(){return!c(this).hasClass("not-available")&&void(c(this).hasClass("field-to-add-to-form")?(c(this).removeClass("field-to-add-to-form"),c(".add-field-to-editor").stop().fadeOut()):(c(this).toggleClass("field-to-add-to-form"),c(".add-field-to-editor").stop().fadeIn()))}),c("body").on("click",".available-interest-group",function(){return!c(this).hasClass("not-available")&&void(c(this).hasClass("group-to-add-to-form")?(c(this).removeClass("group-to-add-to-form"),c(".add-interest-group-to-editor").stop().fadeOut()):(c(".group-to-add-to-form").removeClass("group-to-add-to-form"),c(this).toggleClass("group-to-add-to-form"),c(".add-interest-group-to-editor").stop().fadeIn()))}),c("body").on("click",".hidden_setting",function(){c(".hidden_setting").removeClass("selected_hidden_setting"),c(".selected_setting_triangle").remove(),c(this).addClass("selected_hidden_setting").append('<div class="selected_setting_triangle"></div>');var a=c(this).attr("data-attr-container");c(".hidden-setting-label").hide(),c("#"+a).show()}),c("body").on("click",".close-form-expansion",function(){return c(this).parents(".yikes-mc-settings-expansion-section").slideToggle().prev().find(".dashicons").toggleClass("dashicons-minus"),!1}),c("body").on("click",".mv_ig_list .nav-tab",function(){if(c(this).hasClass("nav-tab-active"))return!1;if(c(this).hasClass("nav-tab-disabled"))return!1;c(".mv_ig_list .nav-tab").removeClass("nav-tab-active"),c(".arrow-down").remove(),c(this).addClass("nav-tab-active").prepend('<div class="arrow-down"></div>'),c(".mv_ig_list .nav-tab").addClass("nav-tab-disabled");var a=c(this).attr("alt");return"merge-variables"==a?(c("#merge-variables-container").stop().animate({left:"0px"},function(){c(".mv_ig_list .nav-tab").removeClass("nav-tab-disabled")}),c("#interest-groups-container").stop().animate({left:"+=268px"},function(){c(".mv_ig_list .nav-tab").removeClass("nav-tab-disabled")})):(c("#merge-variables-container").stop().animate({left:"-=278px"},function(){c(".mv_ig_list .nav-tab").removeClass("nav-tab-disabled")}),c("#interest-groups-container").stop().animate({left:"-=268px"},function(){c(".mv_ig_list .nav-tab").removeClass("nav-tab-disabled")})),!1}),c("body").on("click",".clear-form-fields",function(){return confirm(d.l10n.bulk_delete_alert)&&c("#form-builder").find(".draggable").find(".expansion-section-title").each(function(){c(this).css("background","rgb(255, 134, 134)");var a=c(this).parents(".draggable").find(".remove-field").attr("alt");c(this).fadeOut("slow",function(){c("#available-fields").find('li[alt="'+a+'"]').removeClass("not-available"),c("#available-interest-groups").find('li[alt="'+a+'"]').removeClass("not-available"),c(this).remove(),c(".clear-form-fields").hide(),c(".clear-form-fields").next().hide(),c(".available-form-field").each(function(){c(this).removeClass("not-available")}),c("#form-builder-container").html('<h4 class="no-fields-assigned-notice non-draggable-yikes"><em>'+d.l10n.no_fields_assigned+"</em></h4>")})}),!1}),initialize_form_schedule_time_pickers()})}(window,document,jQuery,Yikes_MailChimp_Edit_Form);
1
+ function togglePageRedirection(a){1==a.value?jQuery("#redirect-user-to-selection-label").fadeIn():jQuery("#redirect-user-to-selection-label").fadeOut()}function storeGlobalClicked(a){var b=a.parents("td").find("input").attr("name");jQuery(".clicked-input").val(b)}function populateDefaultValue(a){var b=jQuery(".clicked-input").val();jQuery(".clicked-input").val(""),tb_remove(),jQuery('input[name="'+b+'"]').val(a)}function toggle_nested_section(a){var b=jQuery(a).val();switch(b){case"image":jQuery(".submit-button-type-text").fadeOut("fast",function(){jQuery(".submit-button-type-image").fadeIn("fast")});break;case"text":jQuery(".submit-button-type-image").fadeOut("fast",function(){jQuery(".submit-button-type-text").fadeIn("fast")});break;default:case"1":"yikes-easy-mc-form-schedule"==jQuery(a).attr("name")?jQuery(".date-restirction-section").fadeToggle():jQuery(".login-restirction-section").fadeToggle()}return!1}function initialize_form_schedule_time_pickers(){jQuery(".date-picker").datepicker({numberOfMonths:1,showButtonPanel:!0,closeText:window.yikes_mailchimp_edit_form.closeText,currentText:window.yikes_mailchimp_edit_form.currentText,monthNames:window.yikes_mailchimp_edit_form.monthNames,monthNamesShort:window.yikes_mailchimp_edit_form.monthNamesShort,dayNames:window.yikes_mailchimp_edit_form.dayNames,dayNamesShort:window.yikes_mailchimp_edit_form.dayNamesShort,dayNamesMin:window.yikes_mailchimp_edit_form.dayNamesMin,dateFormat:window.yikes_mailchimp_edit_form.dateFormat,firstDay:window.yikes_mailchimp_edit_form.firstDay,isRTL:window.yikes_mailchimp_edit_form.isRTL,onSelect:function(a,b){var c=b.lastVal,d=b.id;yikes_check_valid_date(a,c,d)}}),jQuery(".time-picker").timepicker({scrollDefault:"now",timeFormat:"h:i A"}),jQuery(".time-picker").on("changeTime",function(){var a=jQuery(this).attr("id"),b=jQuery("#yikes-easy-mc-form-restriction-start-date").val(),c=jQuery("#yikes-easy-mc-form-restriction-end-date").val();yikes_check_valid_date(b,c,a)})}function yikes_check_valid_date(a,b,c){var d=jQuery("#yikes-easy-mc-form-restriction-start-date").val(),e=jQuery("#yikes-easy-mc-form-restriction-end-date").val(),f=yikes_12_to_24_hour_time_conversion(jQuery("#yikes-easy-mc-form-restriction-start-time").val()),g=yikes_12_to_24_hour_time_conversion(jQuery("#yikes-easy-mc-form-restriction-end-time").val()),h=new Date(d+" "+f),i=new Date(e+" "+g);if(h>i){if("yikes-easy-mc-form-restriction-start-date"!=c&&"yikes-easy-mc-form-restriction-end-date"!=c||jQuery("#"+c).val(b),jQuery(".date-restirction-section").find("p.description.error").length)return;jQuery(".date-restirction-section").first().find("p.description").after('<p class="description error">'+window.yikes_mailchimp_edit_form.start_date_exceeds_end_date_error+"</p>")}else jQuery(".date-restirction-section").find("p.description.error").remove()}function yikes_12_to_24_hour_time_conversion(a){var b=Number(a.match(/^(\d+)/)[1]),c=Number(a.match(/:(\d+)/)[1]),d=a.match(/\s(.*)$/)[1];"PM"==d&&b<12&&(b+=12),"AM"==d&&12==b&&(b-=12);var e=b.toString(),f=c.toString();return b<10&&(e="0"+e),c<10&&(f="0"+f),e+":"+f}function toggleUpdateEmailContainer(a){jQuery(".send-update-email").stop().fadeToggle()}window.Yikes_MailChimp_Edit_Form=window.Yikes_MailChimp_Edit_Form||{},window.yikes_mailchimp_edit_form=window.yikes_mailchimp_edit_form||{},function(a,b,c,d,e){"use strict";d.l10n=a.yikes_mailchimp_edit_form||{},c(b).ready(function(){c("body").find("#form-builder-container").sortable({items:".draggable:not(.non-draggable-yikes)",axis:"y",placeholder:"form-builder-placeholder",update:function(){var a=1;jQuery("#form-builder-container").find(".draggable").each(function(){jQuery(this).find(".position-input").val(a),a++})}}),c("body").on("click",".remove-field",function(){var a=jQuery(this).attr("alt"),b=jQuery(this);return c(this).parents(".yikes-mc-settings-expansion-section").prev().find(".dashicons").toggleClass("dashicons-minus"),c(this).parents(".yikes-mc-settings-expansion-section").slideToggle(450,function(){b.parents(".draggable").find(".expansion-section-title").css("background","rgb(255, 134, 134)"),b.parents(".draggable").fadeOut("slow",function(){jQuery("#available-fields").find('li[alt="'+a+'"]').removeClass("not-available"),jQuery("#available-interest-groups").find('li[alt="'+a+'"]').removeClass("not-available"),jQuery(this).remove(),c("#form-builder-container").find(".draggable").length<1&&(c(".clear-form-fields").hide(),c(".clear-form-fields").next().hide(),c("#form-builder-container").html('<h4 class="no-fields-assigned-notice non-draggable-yikes"><em>'+d.l10n.no_fields_assigned+"</em></h4>"))})}),!1}),c("body").on("click",".hide-field",function(){return c(this).parents(".yikes-mc-settings-expansion-section").prev().find(".dashicons").toggleClass("dashicons-minus"),c(this).parents(".yikes-mc-settings-expansion-section").slideToggle(450),!1}),c("body").on("click",".add-field-to-editor",function(){return c(".field-to-add-to-form").each(function(){var a=c("#form-builder-container").find(".draggable").length,b=c(this),e=b.attr("alt");c("#available-fields").children("li").removeClass("available-form-field");var f=c(this);f.attr("disabled","disabled").attr("onclick","return false;").removeClass("add-field-to-editor");var g={action:"add_field_to_form",field_name:b.attr("data-attr-field-name"),merge_tag:e,field_type:b.attr("data-attr-field-type"),list_id:b.attr("data-attr-form-id")};c.ajax({url:d.l10n.ajax_url,type:"POST",data:g,dataType:"html",success:function(d,f,g){b.removeClass("field-to-add-to-form").addClass("not-available"),c(".add-field-to-editor").hide(),c(".no-fields-assigned-notice").is(":visible")&&c("#form-builder-container").html(""),c("#form-builder-container").append(d),c(".clear-form-fields").show(),c(".clear-form-fields").next().show(),c(".field-"+e+"-position").val(parseInt(a+1))},error:function(a,b,c){alert(b+a.status+a.responseText+"...")},complete:function(a,b){c("#available-fields").children("li").addClass("available-form-field"),f.removeAttr("disabled").removeAttr("onclick"),c(".add-field-to-editor").hide()}})}),!1}),c("body").on("click",".add-interest-group-to-editor",function(){var a=c("#form-builder-container").find(".draggable").length,b=[];c(".group-to-add-to-form").each(function(){b.push({group_id:c(this).attr("alt"),field_type:c(this).attr("data-attr-field-type"),field_name:c(this).attr("data-attr-field-name")})}),c("#available-interest-groups").children("li").removeClass("available-interest-group");var e=c(this);e.attr("disabled","disabled").attr("onclick","return false;").removeClass("add-interest-group-to-editor");var f={action:"add_interest_group_to_form",interest_groups:b,list_id:c(".group-to-add-to-form").attr("data-attr-form-id")};return c.ajax({url:d.l10n.ajax_url,type:"POST",data:f,dataType:"html",success:function(b,d,e){c(".group-to-add-to-form").removeClass("group-to-add-to-form").addClass("not-available"),c(".add-interest-group-to-editor").hide(),a<1?(c("#form-builder-container").html("").append(b),c(".clear-form-fields").show(),c(".clear-form-fields").next().show()):c("#form-builder-container").append(b)},error:function(a,b,c){alert(b+a.status+a.responseText+"...")},complete:function(a,b){c("#available-interest-groups").children("li").addClass("available-interest-group"),e.removeAttr("disabled").removeAttr("onclick").addClass("add-interest-group-to-editor"),c(".add-interest-group-to-editor").hide()}}),!1}),c(".color-picker").each(function(){c(this).wpColorPicker()}),c("body").on("click",".expansion-section-title",function(){return c(this).next().stop().slideToggle(),c(this).find(".dashicons").toggleClass("dashicons-minus"),!1}),c("body").on("click",".available-form-field",function(){return!c(this).hasClass("not-available")&&void(c(this).hasClass("field-to-add-to-form")?(c(this).removeClass("field-to-add-to-form"),c(".add-field-to-editor").stop().fadeOut()):(c(this).toggleClass("field-to-add-to-form"),c(".add-field-to-editor").stop().fadeIn()))}),c("body").on("click",".available-interest-group",function(){return!c(this).hasClass("not-available")&&(c(this).hasClass("group-to-add-to-form")?c(this).removeClass("group-to-add-to-form"):c(this).toggleClass("group-to-add-to-form"),void(c(".group-to-add-to-form").length>0?c(".add-interest-group-to-editor").stop().fadeIn():c(".add-interest-group-to-editor").stop().fadeOut()))}),c("body").on("click",".hidden_setting",function(){c(".hidden_setting").removeClass("selected_hidden_setting"),c(".selected_setting_triangle").remove(),c(this).addClass("selected_hidden_setting").append('<div class="selected_setting_triangle"></div>');var a=c(this).attr("data-attr-container");c(".hidden-setting-label").hide(),c("#"+a).show()}),c("body").on("click",".close-form-expansion",function(){return c(this).parents(".yikes-mc-settings-expansion-section").slideToggle().prev().find(".dashicons").toggleClass("dashicons-minus"),!1}),c("body").on("click",".mv_ig_list .nav-tab",function(){if(c(this).hasClass("nav-tab-active"))return!1;if(c(this).hasClass("nav-tab-disabled"))return!1;c(".mv_ig_list .nav-tab").removeClass("nav-tab-active"),c(".arrow-down").remove(),c(this).addClass("nav-tab-active").prepend('<div class="arrow-down"></div>'),c(".mv_ig_list .nav-tab").addClass("nav-tab-disabled");var a=c(this).attr("alt");return"merge-variables"==a?(c("#merge-variables-container").stop().animate({left:"0px"},function(){c(".mv_ig_list .nav-tab").removeClass("nav-tab-disabled")}),c("#interest-groups-container").stop().animate({left:"+=268px"},function(){c(".mv_ig_list .nav-tab").removeClass("nav-tab-disabled")})):(c("#merge-variables-container").stop().animate({left:"-=278px"},function(){c(".mv_ig_list .nav-tab").removeClass("nav-tab-disabled")}),c("#interest-groups-container").stop().animate({left:"-=268px"},function(){c(".mv_ig_list .nav-tab").removeClass("nav-tab-disabled")})),!1}),c("body").on("click",".clear-form-fields",function(){return confirm(d.l10n.bulk_delete_alert)&&c("#form-builder").find(".draggable").find(".expansion-section-title").each(function(){c(this).css("background","rgb(255, 134, 134)");var a=c(this).parents(".draggable").find(".remove-field").attr("alt");c(this).fadeOut("slow",function(){c("#available-fields").find('li[alt="'+a+'"]').removeClass("not-available"),c("#available-interest-groups").find('li[alt="'+a+'"]').removeClass("not-available"),c(this).remove(),c(".clear-form-fields").hide(),c(".clear-form-fields").next().hide(),c(".available-form-field").each(function(){c(this).removeClass("not-available")}),c("#form-builder-container").html('<h4 class="no-fields-assigned-notice non-draggable-yikes"><em>'+d.l10n.no_fields_assigned+"</em></h4>")})}),!1}),initialize_form_schedule_time_pickers()})}(window,document,jQuery,Yikes_MailChimp_Edit_Form);
admin/js/yikes-inc-easy-mailchimp-dashboard-widget.js CHANGED
@@ -1 +1 @@
1
- window.Yikes_MailChimp_Dashboard_Widget = window.Yikes_MailChimp_Dashboard_Widget || {};
1
+ window.Yikes_MailChimp_Dashboard_Widget = window.Yikes_MailChimp_Dashboard_Widget || {};
admin/js/yikes-inc-easy-mailchimp-extender-edit-form.js CHANGED
@@ -132,7 +132,14 @@ window.yikes_mailchimp_edit_form = window.yikes_mailchimp_edit_form || {};
132
  /* get the length, to decide if we should clear the html and append, or just append */
133
  var form_builder_length = $( '#form-builder-container' ).find( '.draggable' ).length;
134
 
135
- var group_id = $( '.group-to-add-to-form' ).attr( 'alt' );
 
 
 
 
 
 
 
136
 
137
  /* temporarily disable all of the possible merge variables and interest groups (to prevent some weird stuff happening) */
138
  $( '#available-interest-groups' ).children( 'li' ).removeClass( 'available-interest-group' );
@@ -143,9 +150,7 @@ window.yikes_mailchimp_edit_form = window.yikes_mailchimp_edit_form || {};
143
  /* build our data */
144
  var data = {
145
  'action' : 'add_interest_group_to_form',
146
- 'field_name' : $( '.group-to-add-to-form' ).attr( 'data-attr-field-name' ),
147
- 'group_id' : group_id,
148
- 'field_type' : $( '.group-to-add-to-form' ).attr( 'data-attr-field-type' ),
149
  'list_id' : $( '.group-to-add-to-form' ).attr( 'data-attr-form-id' ) /* grab the form ID to query the API for field data */
150
  };
151
 
@@ -218,13 +223,17 @@ window.yikes_mailchimp_edit_form = window.yikes_mailchimp_edit_form || {};
218
  } else {
219
  if( $( this ).hasClass( 'group-to-add-to-form' ) ) {
220
  $( this ).removeClass( 'group-to-add-to-form' );
221
- $( '.add-interest-group-to-editor' ).stop().fadeOut();
222
  } else {
223
- $( '.group-to-add-to-form' ).removeClass( 'group-to-add-to-form' );
224
  $( this ).toggleClass( 'group-to-add-to-form' );
225
- $( '.add-interest-group-to-editor' ).stop().fadeIn();
226
  }
227
  }
 
 
 
 
 
 
 
228
  });
229
 
230
  /* Toggle Additional Form Settings (customizer, builder, error messages) */
132
  /* get the length, to decide if we should clear the html and append, or just append */
133
  var form_builder_length = $( '#form-builder-container' ).find( '.draggable' ).length;
134
 
135
+ var interest_groups = [];
136
+ $( '.group-to-add-to-form' ).each( function() {
137
+ interest_groups.push({
138
+ 'group_id' : $( this ).attr( 'alt' ),
139
+ 'field_type': $( this ).attr( 'data-attr-field-type' ),
140
+ 'field_name': $( this ).attr( 'data-attr-field-name' )
141
+ });
142
+ });
143
 
144
  /* temporarily disable all of the possible merge variables and interest groups (to prevent some weird stuff happening) */
145
  $( '#available-interest-groups' ).children( 'li' ).removeClass( 'available-interest-group' );
150
  /* build our data */
151
  var data = {
152
  'action' : 'add_interest_group_to_form',
153
+ 'interest_groups': interest_groups,
 
 
154
  'list_id' : $( '.group-to-add-to-form' ).attr( 'data-attr-form-id' ) /* grab the form ID to query the API for field data */
155
  };
156
 
223
  } else {
224
  if( $( this ).hasClass( 'group-to-add-to-form' ) ) {
225
  $( this ).removeClass( 'group-to-add-to-form' );
 
226
  } else {
 
227
  $( this ).toggleClass( 'group-to-add-to-form' );
 
228
  }
229
  }
230
+
231
+ // Check if we have groups to add still
232
+ if ( $( '.group-to-add-to-form' ).length > 0 ) {
233
+ $( '.add-interest-group-to-editor' ).stop().fadeIn();
234
+ } else {
235
+ $( '.add-interest-group-to-editor' ).stop().fadeOut();
236
+ }
237
  });
238
 
239
  /* Toggle Additional Form Settings (customizer, builder, error messages) */
admin/partials/ajax/add_field_to_form.php CHANGED
@@ -1,43 +1,43 @@
1
  <?php
2
- // lets run an ajax request to get all of our field data, to either prepopulate
3
- // or build our default selection arrays etc.
4
- $api_key = yikes_get_mc_api_key();
5
- $dash_position = strpos( $api_key, '-' );
6
- if( $dash_position !== false ) {
7
- $api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/merge-vars.json';
8
- }
9
- $available_merge_variables = wp_remote_post( $api_endpoint, array(
10
- 'body' => array(
11
- 'apikey' => $api_key,
12
- 'id' => array( $form_data_array['list_id'] ),
13
- ),
14
- 'timeout' => 10,
15
- 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true )
16
- ) );
17
- $body = json_decode( wp_remote_retrieve_body( $available_merge_variables ), true );
18
- if( isset( $body['error'] ) ) {
19
- if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
20
- require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
21
- $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
22
- $error_logging->yikes_easy_mailchimp_write_to_error_log( $body['error'], __( "Get Merge Variables" , 'yikes-inc-easy-mailchimp-extender' ) , __( "Add Field to Form" , 'yikes-inc-easy-mailchimp-extender' ) );
23
- }
24
- ?>
25
- <section class="draggable" id="error-container">
26
- <p><span class="dashicons dashicons-no-alt"></span> <?php printf( __( 'Error: %s', 'yikes-inc-easy-mailchimp-extender' ), $body['error'] ); ?></p>
27
- </section>
28
- <?php
29
- return;
30
- }
31
- // find and return the location of this merge field in the array
32
- $index = $this->findMCListIndex( $form_data_array['merge_tag'] , $body['data'][0]['merge_vars'], 'tag' );
33
- // store it and use it to pre-populate field data (only on initial add to form)
34
- $merge_field_data = $body['data'][0]['merge_vars'][$index];
35
  ?>
36
- <section class="draggable" id="<?php echo $form_data_array['field_name']; ?>">
37
  <!-- top -->
38
  <a href="#" class="expansion-section-title settings-sidebar">
39
- <span class="dashicons dashicons-plus" title="<?php _e( 'Expand Field' , 'yikes-inc-easy-mailchimp-extender' ); ?>"></span><?php echo stripslashes( $form_data_array['field_name'] ); ?>
40
- <span class="field-type-text"><small><?php echo __( 'type' , 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $form_data_array['field_type']; ?></small></span>
41
  </a>
42
  <!-- expansion section -->
43
  <div class="yikes-mc-settings-expansion-section">
@@ -45,13 +45,13 @@
45
  <!-- Single or Double Opt-in -->
46
  <p class="type-container form-field-container"><!-- necessary to prevent skipping on slideToggle(); -->
47
  <!-- store the label -->
48
- <input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][label]" value="<?php echo $form_data_array['field_name']; ?>" />
49
- <input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][type]" value="<?php echo $form_data_array['field_type']; ?>" />
50
  <input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][merge]" value="<?php echo $merge_field_data['tag']; ?>" />
51
  <input type="hidden" class="field-<?php echo $merge_field_data['tag']; ?>-position position-input" name="field[<?php echo $merge_field_data['tag']; ?>][position]" value="" />
52
 
53
- <?php if ( $form_data_array['field_type'] == 'radio' || $form_data_array['field_type'] == 'dropdown' ) { ?>
54
- <?php $choices = ( isset( $merge_field_data['choices'] ) ) ? esc_attr( json_encode( $merge_field_data['choices'] ) ) : ''; ?>
55
  <input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][choices]" value='<?php echo $choices; ?>' />
56
  <?php } ?>
57
 
@@ -69,7 +69,7 @@
69
  </td>
70
  </tr>
71
 
72
- <?php switch( $form_data_array['field_type'] ) {
73
 
74
  default:
75
  break;
@@ -101,27 +101,27 @@
101
  * Loop over field types and store necessary formats
102
  * ( date, birthday - dateformat ; phone - phoneformat )
103
  */
104
- switch( $form_data_array['field_type'] ) {
105
 
106
  /* Store the date format, for properly rendering dates on the front end */
107
  case 'date':
108
- $date_format = ( isset( $merge_field_data['dateformat'] ) ) ? $merge_field_data['dateformat'] : 'MM/DD/YYYY';
109
  ?>
110
- <input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][date_format]" value="<?php echo strtolower( $merge_field_data['dateformat'] ); ?>" />
111
  <?php
112
  break;
113
 
114
  case 'birthday':
115
- $date_format = ( isset( $merge_field_data['dateformat'] ) ) ? $merge_field_data['dateformat'] : 'MM/DD';
116
  ?>
117
- <input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][date_format]" value="<?php echo strtolower( $date_format ); ?>" />
118
  <?php
119
  break;
120
 
121
  /* Store the phone format, for properly regex pattern */
122
  case 'phone':
123
  ?>
124
- <input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][phone_format]" value="<?php echo $merge_field_data['phoneformat']; ?>" />
125
  <?php
126
  break;
127
  }
@@ -132,32 +132,32 @@
132
  ?>
133
 
134
  <!-- Default Value -->
135
- <?php switch( $form_data_array['field_type'] ) {
136
 
137
- default:
138
- case 'text':
139
  ?>
140
- <tr valign="top">
141
- <td scope="row">
142
- <label for="placeholder">
143
- <?php _e( 'Default Value' , 'yikes-inc-easy-mailchimp-extender' ); ?>
144
- </label>
145
- </td>
146
  <td>
147
- <input type="text" class="widefat" name="field[<?php echo $merge_field_data['tag']; ?>][default]" <?php if( $form_data_array['field_type'] != 'url' ) { ?> value="<?php echo isset( $merge_field_data['default'] ) ? stripslashes( wp_strip_all_tags( $merge_field_data['default'] ) ) : ''; ?>" <?php } else { ?> value="<?php echo isset( $merge_field_data['default'] ) ? stripslashes( wp_strip_all_tags( esc_url_raw( $merge_field_data['default'] ) ) ) : ''; } ?>" />
148
  <p class="description"><small><?php _e( "Assign a default value to populate this field with on initial page load.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
149
  <?php
150
- switch( $form_data_array['field_type'] ) {
151
  case 'text':
152
  ?>
153
- <p><small class="pre-defined-tag-link"><a href="#TB_inline?width=600&height=550&inlineId=pre-defined-tag-container" class="thickbox" onclick="storeGlobalClicked( jQuery( this ) );"><?php _e( 'View Pre-Defined Tags' , 'yikes-inc-easy-mailchimp-extender' ); ?></a></small></p>
154
  <?php
155
  break;
156
  } ?>
157
  </td>
158
- </tr>
159
  <?php
160
- break;
161
 
162
  case 'radio':
163
  ?>
@@ -169,14 +169,15 @@
169
  </td>
170
  <td>
171
  <?php
172
- $x = 0;
173
- foreach( $merge_field_data['choices'] as $choice => $value ) {
174
- $pre_selected = !empty( $merge_field_data['default_choice'] ) ? $merge_field_data['default_choice'] : '0';
175
- ?>
176
  <label>
177
- <input type="radio" name="field[<?php echo $merge_field_data['tag']; ?>][default_choice]" value="<?php echo $x; ?>" <?php checked( $pre_selected , $choice ); ?>><?php echo $value; ?>
178
  </label>
179
- <?php $x++; } ?>
 
180
  <p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
181
  </td>
182
  </tr>
@@ -194,10 +195,10 @@
194
  </td>
195
  <td>
196
  <select type="default" name="field[<?php echo $merge_field_data['tag']; ?>][default_choice]">
197
- <?php foreach( $merge_field_data['choices'] as $choice => $value ) {
198
- $pre_selected = ! empty( $merge_field_data['default_choice'] ) ? $merge_field_data['default_choice'] : '0';
199
- ?>
200
- <option value="<?php echo $choice; ?>" <?php selected( $pre_selected , $choice ); ?>><?php echo stripslashes( $value ); ?></option>
201
  <?php } ?>
202
  </select>
203
  <p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
@@ -230,7 +231,7 @@
230
  </label>
231
  </td>
232
  <td>
233
- <input type="text" class="widefat" name="field[<?php echo $merge_field_data['tag']; ?>][additional-classes]" value="<?php echo isset( $form_data_array['classes'] ) ? stripslashes( wp_strip_all_tags( $form_data_array['classes'] ) ) : '' ; ?>" />
234
  <p class="description"><small><?php printf( __( "Assign additional classes to this field. %s.", 'yikes-inc-easy-mailchimp-extender' ), '<a target="_blank" href="' . esc_url( 'https://yikesplugins.com/support/knowledge-base/bundled-css-classes/' ) . '">' . __( 'View bundled classes', 'yikes-inc-easy-mailchimp-extender' ) . '</a>' );?></small></p>
235
  </td>
236
  </tr>
@@ -242,7 +243,7 @@
242
  </label>
243
  </td>
244
  <td>
245
- <input type="checkbox" class="widefat" value="1" name="field[<?php echo $merge_field_data['tag']; ?>][require]" <?php checked( $merge_field_data['req'], 1 ); ?> <?php if( $merge_field_data['tag'] == 'EMAIL' ) { ?> disabled="disabled" checked="checked" title="<?php echo __( 'Email is a required field.' , 'yikes-inc-easy-mailchimp-extender' ); } ?>">
246
  <p class="description"><small><?php _e( "Require this field to be filled in before the form can be submitted.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
247
  </td>
248
  </tr>
@@ -272,7 +273,7 @@
272
  </tr>
273
  <!-- Display Phone/Date Formats back to the user -->
274
  <?php
275
- switch( $form_data_array['field_type'] ) {
276
 
277
  /* Store the phone format, for properly regex pattern */
278
  case 'phone':
@@ -283,23 +284,23 @@
283
  <td scope="row">
284
  <label for="placeholder">
285
  <?php
286
- switch( $form_data_array['field_type'] ) {
287
  default:
288
  case 'birthday':
289
  $type = __( 'Date Format' , 'yikes-inc-easy-mailchimp-extender' );
290
- $format = $merge_field_data['dateformat'];
291
  $format_name = 'date_format';
292
  break;
293
 
294
  case 'date':
295
  $type = __( 'Date Format' , 'yikes-inc-easy-mailchimp-extender' );
296
- $format = $merge_field_data['dateformat'];
297
  $format_name = 'date_format';
298
  break;
299
 
300
  case 'phone':
301
  $type = __( 'Phone Format' , 'yikes-inc-easy-mailchimp-extender' );
302
- $format = ( ( $merge_field_data['phoneformat'] == 'none' ) ? __( 'International', 'yikes-inc-easy-mailchimp-extender' ) : $merge_field_data['phoneformat'] );
303
  $format_name = 'phone_format';
304
  break;
305
  }
1
  <?php
2
+ $form_data = array(
3
+ 'field_name' => $_POST['field_name'],
4
+ 'merge_tag' => $_POST['merge_tag'],
5
+ 'field_type' => $_POST['field_type'],
6
+ 'list_id' => $_POST['list_id'],
7
+ );
8
+
9
+ // Grab our list handler.
10
+ $list_handler = yikes_get_mc_api_manager()->get_list_handler();
11
+
12
+ $available_merge_variables = $list_handler->get_merge_fields( $form_data['list_id'] );
13
+ if ( is_wp_error( $available_merge_variables ) ) {
14
+ $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
15
+ $error_logging->maybe_write_to_log(
16
+ $available_merge_variables->get_error_code(),
17
+ __( "Get Merge Variables", 'yikes-inc-easy-mailchimp-extender' ),
18
+ __( "Add Field to Form", 'yikes-inc-easy-mailchimp-extender' )
19
+ );
20
+ ?>
21
+ <section class="draggable" id="error-container">
22
+ <p>
23
+ <span class="dashicons dashicons-no-alt"></span> <?php printf( __( 'Error: %s', 'yikes-inc-easy-mailchimp-extender' ), $available_merge_variables->get_error_code() ); ?>
24
+ </p>
25
+ </section>
26
+ <?php
27
+ return;
28
+ }
29
+
30
+ // find and return the location of this merge field in the array
31
+ $index = $this->findMCListIndex( $form_data['merge_tag'], $available_merge_variables['merge_fields'], 'tag' );
32
+
33
+ // store it and use it to pre-populate field data (only on initial add to form)
34
+ $merge_field_data = $available_merge_variables['merge_fields'][ $index ];
35
  ?>
36
+ <section class="draggable" id="<?php echo $form_data['field_name']; ?>">
37
  <!-- top -->
38
  <a href="#" class="expansion-section-title settings-sidebar">
39
+ <span class="dashicons dashicons-plus" title="<?php _e( 'Expand Field' , 'yikes-inc-easy-mailchimp-extender' ); ?>"></span><?php echo stripslashes( $form_data['field_name'] ); ?>
40
+ <span class="field-type-text"><small><?php echo __( 'type' , 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $form_data['field_type']; ?></small></span>
41
  </a>
42
  <!-- expansion section -->
43
  <div class="yikes-mc-settings-expansion-section">
45
  <!-- Single or Double Opt-in -->
46
  <p class="type-container form-field-container"><!-- necessary to prevent skipping on slideToggle(); -->
47
  <!-- store the label -->
48
+ <input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][label]" value="<?php echo $form_data['field_name']; ?>" />
49
+ <input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][type]" value="<?php echo $form_data['field_type']; ?>" />
50
  <input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][merge]" value="<?php echo $merge_field_data['tag']; ?>" />
51
  <input type="hidden" class="field-<?php echo $merge_field_data['tag']; ?>-position position-input" name="field[<?php echo $merge_field_data['tag']; ?>][position]" value="" />
52
 
53
+ <?php if ( $form_data['field_type'] == 'radio' || $form_data['field_type'] == 'dropdown' ) { ?>
54
+ <?php $choices = ( isset( $merge_field_data['options']['choices'] ) ) ? esc_attr( json_encode( $merge_field_data['options']['choices'] ) ) : ''; ?>
55
  <input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][choices]" value='<?php echo $choices; ?>' />
56
  <?php } ?>
57
 
69
  </td>
70
  </tr>
71
 
72
+ <?php switch( $form_data['field_type'] ) {
73
 
74
  default:
75
  break;
101
  * Loop over field types and store necessary formats
102
  * ( date, birthday - dateformat ; phone - phoneformat )
103
  */
104
+ switch( $form_data['field_type'] ) {
105
 
106
  /* Store the date format, for properly rendering dates on the front end */
107
  case 'date':
108
+ $date_format = isset( $merge_field_data['options']['dateformat'] ) ? $merge_field_data['options']['dateformat'] : 'MM/DD/YYYY';
109
  ?>
110
+ <input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][date_format]" value="<?php echo strtolower( $date_format ); ?>" />
111
  <?php
112
  break;
113
 
114
  case 'birthday':
115
+ $date_format = isset( $merge_field_data['options']['dateformat'] ) ? $merge_field_data['options']['dateformat'] : 'MM/DD';
116
  ?>
117
+ <input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][date_format]" value="<?php echo strtolower( $date_format ); ?>" />
118
  <?php
119
  break;
120
 
121
  /* Store the phone format, for properly regex pattern */
122
  case 'phone':
123
  ?>
124
+ <input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][phone_format]" value="<?php echo $merge_field_data['options']['phone_format']; ?>" />
125
  <?php
126
  break;
127
  }
132
  ?>
133
 
134
  <!-- Default Value -->
135
+ <?php switch( $form_data['field_type'] ) {
136
 
137
+ default:
138
+ case 'text':
139
  ?>
140
+ <tr valign="top">
141
+ <td scope="row">
142
+ <label for="placeholder">
143
+ <?php _e( 'Default Value' , 'yikes-inc-easy-mailchimp-extender' ); ?>
144
+ </label>
145
+ </td>
146
  <td>
147
+ <input type="text" class="widefat" name="field[<?php echo $merge_field_data['tag']; ?>][default]" <?php if( $form_data['field_type'] != 'url' ) { ?> value="<?php echo isset( $merge_field_data['default_value'] ) ? stripslashes( wp_strip_all_tags( $merge_field_data['default_value'] ) ) : ''; ?>" <?php } else { ?> value="<?php echo isset( $merge_field_data['default_value'] ) ? stripslashes( wp_strip_all_tags( esc_url_raw( $merge_field_data['default_value'] ) ) ) : ''; } ?>" />
148
  <p class="description"><small><?php _e( "Assign a default value to populate this field with on initial page load.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
149
  <?php
150
+ switch ( $form_data['field_type'] ) {
151
  case 'text':
152
  ?>
153
+ <p><small class="pre-defined-tag-link"><a href="#TB_inline?width=600&height=550&inlineId=pre-defined-tag-container" class="thickbox" onclick="storeGlobalClicked( jQuery( this ) );"><?php _e( 'View Pre-Defined Tags' , 'yikes-inc-easy-mailchimp-extender' ); ?></a></small></p>
154
  <?php
155
  break;
156
  } ?>
157
  </td>
158
+ </tr>
159
  <?php
160
+ break;
161
 
162
  case 'radio':
163
  ?>
169
  </td>
170
  <td>
171
  <?php
172
+ $x = 0;
173
+ foreach ( $merge_field_data['options']['choices'] as $choice => $value ) {
174
+ $pre_selected = ! empty( $merge_field_data['default_choice'] ) ? $merge_field_data['default_choice'] : '0';
175
+ ?>
176
  <label>
177
+ <input type="radio" name="field[<?php echo $merge_field_data['tag']; ?>][default_choice]" value="<?php echo $x; ?>" <?php checked( $pre_selected, $choice ); ?>><?php echo $value; ?>
178
  </label>
179
+ <?php $x ++;
180
+ } ?>
181
  <p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
182
  </td>
183
  </tr>
195
  </td>
196
  <td>
197
  <select type="default" name="field[<?php echo $merge_field_data['tag']; ?>][default_choice]">
198
+ <?php foreach ( $merge_field_data['options']['choices'] as $choice => $value ) {
199
+ $pre_selected = ! empty( $merge_field_data['default_choice'] ) ? $merge_field_data['default_choice'] : '0';
200
+ ?>
201
+ <option value="<?php echo $choice; ?>" <?php selected( $pre_selected, $choice ); ?>><?php echo stripslashes( $value ); ?></option>
202
  <?php } ?>
203
  </select>
204
  <p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
231
  </label>
232
  </td>
233
  <td>
234
+ <input type="text" class="widefat" name="field[<?php echo $merge_field_data['tag']; ?>][additional-classes]" value="<?php echo isset( $form_data['classes'] ) ? stripslashes( wp_strip_all_tags( $form_data['classes'] ) ) : '' ; ?>" />
235
  <p class="description"><small><?php printf( __( "Assign additional classes to this field. %s.", 'yikes-inc-easy-mailchimp-extender' ), '<a target="_blank" href="' . esc_url( 'https://yikesplugins.com/support/knowledge-base/bundled-css-classes/' ) . '">' . __( 'View bundled classes', 'yikes-inc-easy-mailchimp-extender' ) . '</a>' );?></small></p>
236
  </td>
237
  </tr>
243
  </label>
244
  </td>
245
  <td>
246
+ <input type="checkbox" class="widefat" value="1" name="field[<?php echo $merge_field_data['tag']; ?>][require]" <?php checked( $merge_field_data['required'], 1 ); ?> <?php if( $merge_field_data['tag'] == 'EMAIL' ) { ?> disabled="disabled" checked="checked" title="<?php echo __( 'Email is a required field.' , 'yikes-inc-easy-mailchimp-extender' ); } ?>">
247
  <p class="description"><small><?php _e( "Require this field to be filled in before the form can be submitted.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
248
  </td>
249
  </tr>
273
  </tr>
274
  <!-- Display Phone/Date Formats back to the user -->
275
  <?php
276
+ switch( $form_data['field_type'] ) {
277
 
278
  /* Store the phone format, for properly regex pattern */
279
  case 'phone':
284
  <td scope="row">
285
  <label for="placeholder">
286
  <?php
287
+ switch( $form_data['field_type'] ) {
288
  default:
289
  case 'birthday':
290
  $type = __( 'Date Format' , 'yikes-inc-easy-mailchimp-extender' );
291
+ $format = $merge_field_data['options']['date_format'];
292
  $format_name = 'date_format';
293
  break;
294
 
295
  case 'date':
296
  $type = __( 'Date Format' , 'yikes-inc-easy-mailchimp-extender' );
297
+ $format = $merge_field_data['options']['date_format'];
298
  $format_name = 'date_format';
299
  break;
300
 
301
  case 'phone':
302
  $type = __( 'Phone Format' , 'yikes-inc-easy-mailchimp-extender' );
303
+ $format = ( ( $merge_field_data['options']['phone_format'] == 'none' ) ? __( 'International', 'yikes-inc-easy-mailchimp-extender' ) : $merge_field_data['options']['phone_format'] );
304
  $format_name = 'phone_format';
305
  break;
306
  }
admin/partials/ajax/add_interest_group_to_form.php CHANGED
@@ -1,65 +1,84 @@
1
  <?php
2
- $api_key = yikes_get_mc_api_key();
3
- $dash_position = strpos( $api_key, '-' );
4
- if( $dash_position !== false ) {
5
- $api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/interest-groupings.json';
6
- }
7
- // get the interest group data
8
- $interest_groupings = wp_remote_post( $api_endpoint, array(
9
- 'body' => array(
10
- 'apikey' => $api_key,
11
- 'id' => $form_data_array['list_id']
12
- ),
13
- 'timeout' => 10,
14
- 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true )
15
- ) );
16
- $interest_groupings_body = json_decode( wp_remote_retrieve_body( $interest_groupings ), true );
17
- if( ! is_wp_error( $interest_groupings_body ) ) {
18
- if( isset( $interest_groupings_body['error'] ) ) {
19
- if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
20
- require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
21
- $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
22
- $error_logging->yikes_easy_mailchimp_write_to_error_log( $interest_groupings_body['error'], __( "Get Interest Groups" , 'yikes-inc-easy-mailchimp-extender' ) , __( "Add Interest Group to Form" , 'yikes-inc-easy-mailchimp-extender' ) );
23
- }
24
- ?>
25
- <section class="draggable" id="error-container">
26
- <p><span class="dashicons dashicons-no-alt"></span> <?php printf( __( 'Error: %s', 'yikes-inc-easy-mailchimp-extender' ), $interest_groupings_body['error'] ); ?></p>
27
- </section>
28
- <?php
29
- return;
30
- }
31
- // find and return the location of this merge field in the array
32
- $index = $this->findMCListIndex( $form_data_array['group_id'], $interest_groupings_body, 'id' );
33
- // check for our index...
34
- if( isset( $index) ) {
35
- // store it and use it to pre-populate field data (only on initial add to form)
36
- $merge_field_data = $interest_groupings_body[$index];
37
- }
38
- }
39
-
40
- ?>
41
- <section class="draggable" id="<?php echo $form_data_array['group_id']; ?>">
42
- <!-- top -->
43
- <a href="#" class="expansion-section-title settings-sidebar">
44
- <span class="dashicons dashicons-plus" title="<?php _e( 'Expand Field' , 'yikes-inc-easy-mailchimp-extender' ); ?>"></span><?php echo stripslashes( $form_data_array['field_name'] ); ?>
45
- <span class="field-type-text"><small><?php echo __( 'type' , 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $form_data_array['field_type']; ?></small></span>
46
- </a>
47
- <!-- expansion section -->
48
- <div class="yikes-mc-settings-expansion-section">
49
-
50
- <!-- Single or Double Opt-in -->
51
- <p class="type-container"><!-- necessary to prevent skipping on slideToggle(); -->
52
- <!-- store the label -->
53
- <input type="hidden" name="field[<?php echo $form_data_array['group_id']; ?>][label]" value="<?php echo $form_data_array['field_name']; ?>" />
54
- <input type="hidden" name="field[<?php echo $form_data_array['group_id']; ?>][type]" value="<?php echo $form_data_array['field_type']; ?>" />
55
- <input type="hidden" name="field[<?php echo $form_data_array['group_id']; ?>][group_id]" value="<?php echo $form_data_array['group_id']; ?>" />
56
- <input type="hidden" name="field[<?php echo $form_data_array['group_id']; ?>][groups]" value='<?php echo str_replace( '\'' , '~' , json_encode( $merge_field_data['groups'] ) ); ?>' />
57
-
58
-
59
- <table class="form-table form-field-container">
60
-
61
- <!-- Default Value -->
62
- <?php switch( $form_data_array['field_type'] ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
 
64
  default:
65
  case 'radio':
@@ -71,13 +90,14 @@
71
  </label>
72
  </td>
73
  <td>
74
- <?php $i = 0; foreach( $merge_field_data['groups'] as $interest_group ) {
75
- $pre_selected = !empty( $merge_field_data['default_choice'] ) ? $merge_field_data['default_choice'] : '0';
76
- ?>
77
- <input type="radio" name="field[<?php echo $form_data_array['group_id']; ?>][default_choice][]" value="<?php echo $i; ?>" <?php checked( $pre_selected , $i ); ?>><?php echo stripslashes( $interest_group['name'] ); ?>
78
  <?php
79
- $i++;
80
- }
 
 
 
 
 
81
  ?>
82
  <p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
83
  </td>
@@ -95,13 +115,13 @@
95
  </label>
96
  </td>
97
  <td>
98
- <?php $i = 0; foreach( $merge_field_data['groups'] as $interest_group ) {
99
- $pre_selected = !empty( $merge_field_data['default_choice'] ) ? $merge_field_data['default_choice'] : '0';
100
- ?>
101
- <input type="checkbox" name="field[<?php echo $form_data_array['group_id']; ?>][default_choice][]" value="<?php echo $i; ?>" <?php checked( $pre_selected , $i ); ?>><?php echo stripslashes( $interest_group['name'] ); ?>
102
  <?php
103
- $i++;
104
- }
 
 
 
 
105
  ?>
106
  <p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
107
  </td>
@@ -119,98 +139,99 @@
119
  </label>
120
  </td>
121
  <td>
122
- <select type="default" name="field[<?php echo $form_data_array['group_id']; ?>][default_choice]">
123
- <?php $i = 0; foreach( $merge_field_data['groups'] as $interest_group ) {
124
- $pre_selected = !empty( $merge_field_data['default_choice'] ) ? $merge_field_data['default_choice'] : '0';
125
- ?>
126
- <option value="<?php echo $i; ?>" <?php selected( $pre_selected , $i ); ?>><?php echo $interest_group['name']; ?></option>
127
- <?php $i++; } ?>
 
 
128
  </select>
129
  <p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
130
  </td>
131
  </tr>
132
 
133
- <?php
134
  break;
135
- ?>
136
 
137
- <?php } // end switch field type ?>
138
-
139
- <!-- Field Description -->
140
- <tr valign="top">
141
- <td scope="row">
142
- <label for="placeholder">
143
- <?php _e( 'Description' , 'yikes-inc-easy-mailchimp-extender' ); ?>
144
- </label>
145
- </td>
146
- <td>
147
- <textarea class="widefat field-description-input" name="field[<?php echo $form_data_array['group_id']; ?>][description]"></textarea>
148
- <p class="description"><small><?php _e( "Enter the description for the form field. This will be displayed to the user and provide some direction on how the field should be filled out or selected.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
149
- </td>
150
- </tr>
151
-
152
- <!-- Additional Classes -->
153
- <tr valign="top">
154
- <td scope="row">
155
- <label for="placeholder">
156
- <?php _e( 'Additional Classes' , 'yikes-inc-easy-mailchimp-extender' ); ?>
157
- </label>
158
- </td>
159
- <td>
160
- <input type="text" class="widefat" name="field[<?php echo $form_data_array['group_id']; ?>][additional-classes]" value="<?php echo isset( $form_data_array['classes'] ) ? stripslashes( wp_strip_all_tags( $form_data_array['classes'] ) ) : '' ; ?>" />
161
- <p class="description"><small><?php printf( __( "Assign additional classes to this field. %s.", 'yikes-inc-easy-mailchimp-extender' ), '<a target="_blank" href="' . esc_url( 'https://yikesplugins.com/support/knowledge-base/bundled-css-classes/' ) . '">' . __( 'View bundled classes', 'yikes-inc-easy-mailchimp-extender' ) . '</a>' );?></small></p>
162
- </td>
163
- </tr>
164
- <!-- Required Toggle -->
165
- <tr valign="top">
166
- <td scope="row">
167
- <label for="field-required">
168
- <?php _e( 'Field Required?' , 'yikes-inc-easy-mailchimp-extender' ); ?>
169
- </label>
170
- </td>
171
- <td>
172
- <input type="checkbox" class="widefat" value="1" name="field[<?php echo $form_data_array['group_id']; ?>][require]">
173
- <p class="description"><small><?php _e( "Require this field to be filled in before the form can be submitted.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
174
- </td>
175
- </tr>
176
- <!-- Visible Toggle -->
177
  <tr valign="top">
178
  <td scope="row">
179
- <label for="hide-field">
180
- <?php _e( 'Hide Field' , 'yikes-inc-easy-mailchimp-extender' ); ?>
181
  </label>
182
  </td>
183
  <td>
184
- <input type="checkbox" class="widefat" value="1" name="field[<?php echo $form_data_array['group_id']; ?>][hide]">
185
- <p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
186
  </td>
187
  </tr>
188
- <!-- Toggle Field Label Visibility -->
 
189
  <tr valign="top">
190
  <td scope="row">
191
  <label for="placeholder">
192
- <?php _e( 'Hide Label' , 'yikes-inc-easy-mailchimp-extender' ); ?>
193
  </label>
194
  </td>
195
  <td>
196
- <input type="checkbox" name="field[<?php echo $form_data_array['group_id']; ?>][hide-label]" value="1" />
197
- <p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
198
- </td>
199
- </tr>
200
- <!-- Toggle Buttons -->
201
- <tr valign="top">
202
- <td scope="row">
203
- &nbsp;
204
- </td>
205
- <td>
206
- <span class="toggle-container">
207
- <a href="#" class="hide-field"><?php _e( "Close" , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
208
- <a href="#" class="remove-field" alt="<?php echo $form_data_array['group_id']; ?>"><?php _e( "Remove Field" , 'yikes-inc-easy-mailchimp-extender' ); ?></a>
209
- </span>
210
  </td>
211
- </tr>
212
- </table>
213
- </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
214
 
215
- </div>
216
- </section>
 
1
  <?php
2
+
3
+ // Set up our default $error values
4
+ $error_messages = '';
5
+ $error = 0;
6
+
7
+ // Get our $_POST variables
8
+ $list_id = isset( $_POST['list_id'] ) ? $_POST['list_id'] : '';
9
+ $interest_groups = isset( $_POST['interest_groups'] ) ? $_POST['interest_groups'] : array();
10
+
11
+ // Make sure our $_POST variables aren't empty
12
+ if ( empty( $list_id ) ) {
13
+ $error = 1;
14
+ $error_messages .= __( 'Could not find the list id. ', 'yikes-inc-easy-mailchimp-extender' );
15
+ }
16
+ if ( empty( $interest_groups ) ) {
17
+ $error = 1;
18
+ $error_messages .= __( 'Could not find interest group data. ', 'yikes-inc-easy-mailchimp-extender' );
19
+ }
20
+
21
+ // Get the list, interest groups
22
+ $list_helper = yikes_get_mc_api_manager()->get_list_handler();
23
+ $interest_groupings = $list_helper->get_interest_categories( $list_id );
24
+
25
+ // Make sure the interest groups aren't empty
26
+ if ( is_wp_error( $interest_groupings ) ) {
27
+ $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
28
+ $error_logging->maybe_write_to_log(
29
+ $interest_groupings->get_error_code(),
30
+ __( "Get Interest Groups", 'yikes-inc-easy-mailchimp-extender' ),
31
+ __( "Add Interest Group to Form", 'yikes-inc-easy-mailchimp-extender' )
32
+ );
33
+ $error = 1;
34
+ $error_messages .= $interest_groupings->get_error_code();
35
+ }
36
+
37
+ // If we hit an error above at some point, then display the error(s) and return
38
+ if ( $error === 1 ) {
39
+ $error_messages .= __( ' Please refresh and try again.', 'yikes-inc-easy-mailchimp-extender' );
40
+ ?>
41
+ <section class="draggable" id="error-container">
42
+ <p>
43
+ <span class="dashicons dashicons-no-alt"></span> <?php printf( __( 'Error: %s', 'yikes-inc-easy-mailchimp-extender' ), $error_messages ); ?>
44
+ </p>
45
+ </section>
46
+ <?php
47
+ return;
48
+ }
49
+
50
+
51
+ // Loop through the interest groups data (group_id, field_name, field_type) and add the fields to the form
52
+ foreach( $interest_groups as $group ) {
53
+
54
+ // find and return the location of this merge field in the array
55
+ $index = $this->findMCListIndex( $group['group_id'], $interest_groupings, 'id' );
56
+ $field_data = $interest_groupings[ $index ];
57
+ $groups = wp_list_pluck( $field_data['items'], 'name' );
58
+
59
+ ?>
60
+ <section class="draggable" id="<?php echo $group['group_id']; ?>">
61
+ <!-- top -->
62
+ <a href="#" class="expansion-section-title settings-sidebar">
63
+ <span class="dashicons dashicons-plus" title="<?php _e( 'Expand Field' , 'yikes-inc-easy-mailchimp-extender' ); ?>"></span><?php echo stripslashes( $group['field_name'] ); ?>
64
+ <span class="field-type-text"><small><?php echo __( 'type' , 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $group['field_type']; ?></small></span>
65
+ </a>
66
+ <!-- expansion section -->
67
+ <div class="yikes-mc-settings-expansion-section">
68
+
69
+ <!-- Single or Double Opt-in -->
70
+ <p class="type-container"><!-- necessary to prevent skipping on slideToggle(); -->
71
+ <!-- store the label -->
72
+ <input type="hidden" name="field[<?php echo $group['group_id']; ?>][label]" value="<?php echo $group['field_name']; ?>" />
73
+ <input type="hidden" name="field[<?php echo $group['group_id']; ?>][type]" value="<?php echo $group['field_type']; ?>" />
74
+ <input type="hidden" name="field[<?php echo $group['group_id']; ?>][group_id]" value="<?php echo $group['group_id']; ?>" />
75
+ <input type="hidden" name="field[<?php echo $group['group_id']; ?>][groups]" value='<?php echo str_replace( '\'' , '~' , json_encode( $groups ) ); ?>' />
76
+
77
+
78
+ <table class="form-table form-field-container">
79
+
80
+ <!-- Default Value -->
81
+ <?php switch( $group['field_type'] ) {
82
 
83
  default:
84
  case 'radio':
90
  </label>
91
  </td>
92
  <td>
 
 
 
 
93
  <?php
94
+ foreach ( $field_data['items'] as $id => $interest_group ) {
95
+ $pre_selected = ! empty( $field_data['default_choice'] ) ? $field_data['default_choice'] : '0';
96
+ ?>
97
+ <input type="radio" name="field[<?php echo $group['group_id']; ?>][default_choice][]" value="<?php echo esc_attr( $id ); ?>" <?php checked( $pre_selected, $id ); ?>><?php echo stripslashes( $interest_group['name'] ); ?>
98
+ <?php
99
+
100
+ }
101
  ?>
102
  <p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
103
  </td>
115
  </label>
116
  </td>
117
  <td>
 
 
 
 
118
  <?php
119
+ foreach ( $field_data['items'] as $id => $interest_group ) {
120
+ $pre_selected = ! empty( $field_data['default_choice'] ) ? $field_data['default_choice'] : '0';
121
+ ?>
122
+ <input type="checkbox" name="field[<?php echo $group['group_id']; ?>][default_choice][]" value="<?php echo $id; ?>" <?php checked( $pre_selected, $id ); ?>><?php echo stripslashes( $interest_group['name'] ); ?>
123
+ <?php
124
+ }
125
  ?>
126
  <p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
127
  </td>
139
  </label>
140
  </td>
141
  <td>
142
+ <select type="default" name="field[<?php echo $group['group_id']; ?>][default_choice]">
143
+ <?php
144
+ foreach ( $field_data['items'] as $id => $interest_group ) {
145
+ $pre_selected = ! empty( $field_data['default_choice'] ) ? $field_data['default_choice'] : '0';
146
+ ?>
147
+ <option value="<?php echo $id; ?>" <?php selected( $pre_selected, $id ); ?>><?php echo $interest_group['name']; ?></option>
148
+ <?php
149
+ } ?>
150
  </select>
151
  <p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
152
  </td>
153
  </tr>
154
 
155
+ <?php
156
  break;
157
+ } ?>
158
 
159
+ <!-- Field Description -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
160
  <tr valign="top">
161
  <td scope="row">
162
+ <label for="placeholder">
163
+ <?php _e( 'Description' , 'yikes-inc-easy-mailchimp-extender' ); ?>
164
  </label>
165
  </td>
166
  <td>
167
+ <textarea class="widefat field-description-input" name="field[<?php echo $group['group_id']; ?>][description]"></textarea>
168
+ <p class="description"><small><?php _e( "Enter the description for the form field. This will be displayed to the user and provide some direction on how the field should be filled out or selected.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
169
  </td>
170
  </tr>
171
+
172
+ <!-- Additional Classes -->
173
  <tr valign="top">
174
  <td scope="row">
175
  <label for="placeholder">
176
+ <?php _e( 'Additional Classes' , 'yikes-inc-easy-mailchimp-extender' ); ?>
177
  </label>
178
  </td>
179
  <td>
180
+ <input type="text" class="widefat" name="field[<?php echo $group['group_id']; ?>][additional-classes]" value="<?php echo isset( $group['classes'] ) ? stripslashes( wp_strip_all_tags( $group['classes'] ) ) : '' ; ?>" />
181
+ <p class="description"><small><?php printf( __( "Assign additional classes to this field. %s.", 'yikes-inc-easy-mailchimp-extender' ), '<a target="_blank" href="' . esc_url( 'https://yikesplugins.com/support/knowledge-base/bundled-css-classes/' ) . '">' . __( 'View bundled classes', 'yikes-inc-easy-mailchimp-extender' ) . '</a>' );?></small></p>
 
 
 
 
 
 
 
 
 
 
 
 
182
  </td>
183
+ </tr>
184
+ <!-- Required Toggle -->
185
+ <tr valign="top">
186
+ <td scope="row">
187
+ <label for="field-required">
188
+ <?php _e( 'Field Required?' , 'yikes-inc-easy-mailchimp-extender' ); ?>
189
+ </label>
190
+ </td>
191
+ <td>
192
+ <input type="checkbox" class="widefat" value="1" name="field[<?php echo $group['group_id']; ?>][require]">
193
+ <p class="description"><small><?php _e( "Require this field to be filled in before the form can be submitted.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
194
+ </td>
195
+ </tr>
196
+ <!-- Visible Toggle -->
197
+ <tr valign="top">
198
+ <td scope="row">
199
+ <label for="hide-field">
200
+ <?php _e( 'Hide Field' , 'yikes-inc-easy-mailchimp-extender' ); ?>
201
+ </label>
202
+ </td>
203
+ <td>
204
+ <input type="checkbox" class="widefat" value="1" name="field[<?php echo $group['group_id']; ?>][hide]">
205
+ <p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
206
+ </td>
207
+ </tr>
208
+ <!-- Toggle Field Label Visibility -->
209
+ <tr valign="top">
210
+ <td scope="row">
211
+ <label for="placeholder">
212
+ <?php _e( 'Hide Label' , 'yikes-inc-easy-mailchimp-extender' ); ?>
213
+ </label>
214
+ </td>
215
+ <td>
216
+ <input type="checkbox" name="field[<?php echo $group['group_id']; ?>][hide-label]" value="1" />
217
+ <p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
218
+ </td>
219
+ </tr>
220
+ <!-- Toggle Buttons -->
221
+ <tr valign="top">
222
+ <td scope="row">
223
+ &nbsp;
224
+ </td>
225
+ <td>
226
+ <span class="toggle-container">
227
+ <a href="#" class="hide-field"><?php _e( "Close" , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
228
+ <a href="#" class="remove-field" alt="<?php echo $group['group_id']; ?>"><?php _e( "Remove Field" , 'yikes-inc-easy-mailchimp-extender' ); ?></a>
229
+ </span>
230
+ </td>
231
+ </tr>
232
+ </table>
233
+ </p>
234
 
235
+ </div>
236
+ </section>
237
+ <?php } // End our loop of interest group data ?>
admin/partials/ajax/class.ajax.php CHANGED
@@ -38,31 +38,19 @@
38
  // when the user wants to switch which form data
39
  // is displayed on the dashboard
40
  public function get_new_list_data() {
41
- $list_id = $_POST['list_id'];
42
- $api_key = yikes_get_mc_api_key();
43
- $dash_position = strpos( $api_key, '-' );
44
- if( $dash_position !== false ) {
45
- $api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/list.json';
46
- }
47
- $list_data = wp_remote_post( $api_endpoint, array(
48
- 'body' => array(
49
- 'apikey' => $api_key,
50
- 'filters' => array( 'list_id' => $list_id )
51
- ),
52
- 'timeout' => 10,
53
- 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true )
54
- ) );
55
- $list_data = json_decode( wp_remote_retrieve_body( $list_data ), true );
56
- if( isset( $list_data['error'] ) ) {
57
- if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
58
- require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
59
- $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
60
- $error_logging->yikes_easy_mailchimp_write_to_error_log( $list_data['error'], __( "Get Account Lists" , 'yikes-inc-easy-mailchimp-extender' ) , __( "MailChimp Widget" , 'yikes-inc-easy-mailchimp-extender' ) );
61
- }
62
- }
63
- if( ! empty( $list_data['data'][0] ) ) {
64
- include_once( YIKES_MC_PATH . 'admin/partials/dashboard-widgets/templates/stats-list-template.php' );
65
  }
 
 
66
  exit();
67
  }
68
 
@@ -71,47 +59,27 @@
71
  // we want to return the interest groups associated with this list,
72
  // to allow users to pre-check anything they want to assign users appropriately
73
  /* note: this function is called statically from the integration settings page */
74
- public static function check_list_for_interest_groups( $list_id='', $integration_type='', $load=false ) {
75
- if( ! $list_id ) {
76
  $list_id = $_POST['list_id'];
77
  }
78
- if( ! $integration_type ) {
79
  $integration_type = $_POST['integration'];
80
  }
81
- $api_key = yikes_get_mc_api_key();
82
- // setup/check our transients
83
- if ( WP_DEBUG || false === ( $interest_groupings = get_transient( $list_id . '_interest_group' ) ) ) {
84
- // It wasn't there, so regenerate the data and save the transient
85
- $dash_position = strpos( $api_key, '-' );
86
- if( $dash_position !== false ) {
87
- $api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/interest-groupings.json';
88
- }
89
- $interest_groupings = wp_remote_post( $api_endpoint, array(
90
- 'body' => array(
91
- 'apikey' => $api_key,
92
- 'id' => $list_id,
93
- 'counts' => false
94
- ),
95
- 'timeout' => 10,
96
- 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true )
97
- ) );
98
- $interest_groupings = json_decode( wp_remote_retrieve_body( $interest_groupings ), true );
99
- if( isset( $interest_groupings['error'] ) ) {
100
- if( get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
101
- require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
102
- $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
103
- $error_logging->yikes_easy_mailchimp_write_to_error_log( $interest_groupings['error'], __( "Get Interest Groups" , 'yikes-inc-easy-mailchimp-extender' ), "class.ajax.php" );
104
- }
105
- } else {
106
- // set the transient for 2 hours
107
- set_transient( $list_id . '_interest_group', $interest_groupings, 2 * HOUR_IN_SECONDS );
108
- }
109
  }
110
- if( isset( $interest_groupings ) && ! empty( $interest_groupings ) ) {
 
111
  require( YIKES_MC_PATH . 'admin/partials/menu/options-sections/templates/integration-interest-groups.php' );
112
  }
113
  // do not kill off execution on load, only on an ajax request
114
- if( ! $load ) {
115
  exit();
116
  }
117
  }
@@ -119,24 +87,12 @@
119
  // Process our Ajax Request
120
  // send a field to our form
121
  public function send_field_to_form() {
122
- $form_data_array = array(
123
- 'field_name' => $_POST['field_name'],
124
- 'merge_tag' => $_POST['merge_tag'],
125
- 'field_type' => $_POST['field_type'],
126
- 'list_id' => $_POST['list_id'],
127
- );
128
  include YIKES_MC_PATH . 'admin/partials/ajax/add_field_to_form.php';
129
  exit();
130
  }
131
 
132
  // send interest group to our form
133
  public function send_interest_group_to_form() {
134
- $form_data_array = array(
135
- 'field_name' => $_POST['field_name'],
136
- 'group_id' => $_POST['group_id'],
137
- 'field_type' => $_POST['field_type'],
138
- 'list_id' => $_POST['list_id'],
139
- );
140
  include YIKES_MC_PATH . 'admin/partials/ajax/add_interest_group_to_form.php';
141
  exit();
142
  }
@@ -147,22 +103,9 @@
147
  * - http://stackoverflow.com/questions/6661530/php-multi-dimensional-array-search
148
  */
149
  public function findMCListIndex( $id, $array, $tag ) {
150
- if( $tag == 'tag' ) {
151
- foreach( $array as $key => $val ) {
152
- if ( $val['tag'] === $id ) {
153
- return $key;
154
- }
155
- }
156
- return null;
157
- } else {
158
- foreach ( $array as $key => $val ) {
159
- if ( $val['id'] == $id ) {
160
- return $key;
161
- }
162
- }
163
- return null;
164
- }
165
- } // end
166
-
167
- } // end class
168
 
 
 
 
38
  // when the user wants to switch which form data
39
  // is displayed on the dashboard
40
  public function get_new_list_data() {
41
+ $list_id = $_POST['list_id'];
42
+ $list_data = yikes_get_mc_api_manager()->get_list_handler()->get_list( $list_id );
43
+ if ( is_wp_error( $list_data ) ) {
44
+ $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
45
+ $error_logging->maybe_write_to_log(
46
+ $list_data->get_error_code(),
47
+ __( "Get Account Lists", 'yikes-inc-easy-mailchimp-extender' ),
48
+ __( "MailChimp Widget", 'yikes-inc-easy-mailchimp-extender' )
49
+ );
50
+ exit();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
  }
52
+
53
+ include_once( YIKES_MC_PATH . 'admin/partials/dashboard-widgets/templates/stats-list-template.php' );
54
  exit();
55
  }
56
 
59
  // we want to return the interest groups associated with this list,
60
  // to allow users to pre-check anything they want to assign users appropriately
61
  /* note: this function is called statically from the integration settings page */
62
+ public static function check_list_for_interest_groups( $list_id = '', $integration_type = '', $load = false ) {
63
+ if ( ! $list_id ) {
64
  $list_id = $_POST['list_id'];
65
  }
66
+ if ( ! $integration_type ) {
67
  $integration_type = $_POST['integration'];
68
  }
69
+
70
+
71
+ $interest_groupings = yikes_get_mc_api_manager()->get_list_handler()->get_interest_categories( $list_id );
72
+ if ( is_wp_error( $interest_groupings ) ) {
73
+ $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
74
+ $error_logging->maybe_write_to_log( $interest_groupings['error'], __( "Get Interest Groups" , 'yikes-inc-easy-mailchimp-extender' ), "class.ajax.php" );
75
+ $interest_groupings = array();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
  }
77
+
78
+ if ( ! empty( $interest_groupings ) ) {
79
  require( YIKES_MC_PATH . 'admin/partials/menu/options-sections/templates/integration-interest-groups.php' );
80
  }
81
  // do not kill off execution on load, only on an ajax request
82
+ if ( ! $load ) {
83
  exit();
84
  }
85
  }
87
  // Process our Ajax Request
88
  // send a field to our form
89
  public function send_field_to_form() {
 
 
 
 
 
 
90
  include YIKES_MC_PATH . 'admin/partials/ajax/add_field_to_form.php';
91
  exit();
92
  }
93
 
94
  // send interest group to our form
95
  public function send_interest_group_to_form() {
 
 
 
 
 
 
96
  include YIKES_MC_PATH . 'admin/partials/ajax/add_interest_group_to_form.php';
97
  exit();
98
  }
103
  * - http://stackoverflow.com/questions/6661530/php-multi-dimensional-array-search
104
  */
105
  public function findMCListIndex( $id, $array, $tag ) {
106
+ $mapping = array_flip( wp_list_pluck( $array, $tag ) );
107
+ $index = isset( $mapping[ $id ] ) ? $mapping[ $id ] : null;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
108
 
109
+ return $index;
110
+ }
111
+ }
admin/partials/ajax/process_ajax.php DELETED
@@ -1,190 +0,0 @@
1
- <?php
2
- /*
3
- * Hidden container section / content
4
- *
5
- * Lets run an ajax request to get all of our field data, to either pre-populate
6
- * or build our default selection arrays etc.
7
- *
8
- * @since 6.0.0
9
- * Author: Yikes Inc. | https://www.yikesinc.com
10
- */
11
- $api_key = yikes_get_mc_api_key();
12
- $dash_position = strpos( $api_key, '-' );
13
- if( $dash_position !== false ) {
14
- $api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/merge-vars.json';
15
- }
16
- $available_merge_variables = wp_remote_post( $api_endpoint, array(
17
- 'body' => array(
18
- 'apikey' => $api_key,
19
- 'id' => array( $form_data_array['list_id'] ),
20
- ),
21
- 'timeout' => 10,
22
- 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true )
23
- ) );
24
- $body = json_decode( wp_remote_retrieve_body( $available_merge_variables ), true );
25
- if( isset( $body['error'] ) ) {
26
- if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
27
- require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
28
- $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
29
- $error_logging->yikes_easy_mailchimp_write_to_error_log( $body['error'], __( "Get Merge Variables" , 'yikes-inc-easy-mailchimp-extender' ), "process_ajax.php" );
30
- }
31
- }
32
- // find and return the location of this merge field in the array
33
- $index = $this->findMCListIndex( $form_data_array['merge_tag'] , $body['data'][0]['merge_vars'], 'tag' );
34
- // store it and use it to pre-populate field data (only on initial add to form)
35
- $merge_field_data = $body['data'][0]['merge_vars'][$index];
36
- ?>
37
- <section class="draggable" id="<?php echo $form_data_array['field_name']; ?>">
38
- <!-- top -->
39
- <a href="#" class="expansion-section-title settings-sidebar">
40
- <span class="dashicons dashicons-plus"></span><?php echo $form_data_array['field_name']; ?>
41
- <span class="field-type-text"><small><?php echo __( 'type' , 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $form_data_array['field_type']; ?></small></span>
42
- </a>
43
- <!-- expansion section -->
44
- <div class="yikes-mc-settings-expansion-section">
45
-
46
- <!-- Single or Double Opt-in -->
47
- <p class="type-container form-field-container"><!-- necessary to prevent skipping on slideToggle(); -->
48
- <!-- store the label -->
49
- <input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][label]" value="<?php echo $form_data_array['field_name']; ?>" />
50
- <input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][type]" value="<?php echo $form_data_array['field_type']; ?>" />
51
- <input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][merge]" value="<?php echo $merge_field_data['tag']; ?>" />
52
- <input type="hidden" class="field-<?php echo $merge_field_data['tag']; ?>-position position-input" name="field[<?php echo $merge_field_data['tag']; ?>][position]" value="" />
53
-
54
- <?php if ( $form_data_array['field_type'] == 'radio' || $form_data_array['field_type'] == 'dropdown' ) { ?>
55
- <input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][choices]" value='<?php echo stripslashes( json_encode( $merge_field_data['choices'] ) ); ?>' />
56
- <?php } ?>
57
-
58
- <table class="form-table form-field-container">
59
- <!-- Placeholder -->
60
- <tr valign="top">
61
- <td scope="row">
62
- <label for="placeholder">
63
- <?php _e( 'Placeholder' , 'yikes-inc-easy-mailchimp-extender' ); ?>
64
- </label>
65
- </td>
66
- <td>
67
- <input type="text" class="widefat" name="field[<?php echo $merge_field_data['tag']; ?>][placeholder]" value="<?php echo isset( $merge_field_data['placeholder'] ) ? stripslashes( wp_strip_all_tags( $merge_field_data['placeholder'] ) ) : '' ; ?>" />
68
- <p class="description"><small><?php _e( "Assign a placeholder value to this field.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
69
- </td>
70
- </tr>
71
- <!-- Default Value -->
72
- <?php switch( $form_data_array['field_type'] ) {
73
-
74
- default:
75
- case 'text':
76
- ?>
77
- <tr valign="top">
78
- <td scope="row">
79
- <label for="placeholder">
80
- <?php _e( 'Default Value' , 'yikes-inc-easy-mailchimp-extender' ); ?>
81
- </label>
82
- </td>
83
- <td>
84
- <input type="text" class="widefat" name="field[<?php echo $merge_field_data['tag']; ?>][default]" <?php if( $form_data_array['field_type'] != 'url' ) { ?> value="<?php echo isset( $merge_field_data['default'] ) ? stripslashes( wp_strip_all_tags( $merge_field_data['default'] ) ) : ''; ?>" <?php } else { ?> value="<?php echo isset( $merge_field_data['default'] ) ? stripslashes( wp_strip_all_tags( esc_url_raw( $merge_field_data['default'] ) ) ) : ''; } ?>" />
85
- <p class="description"><small><?php _e( "Assign a default value to populate this field with on initial page load.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
86
- </td>
87
- </tr>
88
- <?php
89
- break;
90
-
91
- case 'radio':
92
- ?>
93
- <tr valign="top">
94
- <td scope="row">
95
- <label for="placeholder">
96
- <?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?>
97
- </label>
98
- </td>
99
- <td>
100
- <?php foreach( $merge_field_data['choices'] as $choice => $value ) {
101
- $pre_selected = !empty( $merge_field_data['default_choice'] ) ? $merge_field_data['default_choice'] : '0';
102
- ?>
103
- <input type="radio" name="field[<?php echo $merge_field_data['tag']; ?>][default_choice]" value="<?php echo $choice; ?>" <?php checked( $pre_selected , $choice ); ?>><?php echo stripslashes( $value ); ?>
104
- <?php } ?>
105
- <p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
106
- </td>
107
- </tr>
108
-
109
- <?php
110
- break;
111
-
112
- case 'dropdown':
113
- ?>
114
- <tr valign="top">
115
- <td scope="row">
116
- <label for="placeholder">
117
- <?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?>
118
- </label>
119
- </td>
120
- <td>
121
- <select type="default" name="field[<?php echo $merge_field_data['tag']; ?>][default_choice]">
122
- <?php foreach( $merge_field_data['choices'] as $choice => $value ) {
123
- $pre_selected = !empty( $merge_field_data['default_choice'] ) ? $merge_field_data['default_choice'] : '0';
124
- ?>
125
- <option value="<?php echo $choice; ?>" <?php selected( $pre_selected , $choice ); ?>><?php echo stripslashes( $value ); ?></option>
126
- <?php } ?>
127
- </select>
128
- <p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
129
- </td>
130
- </tr>
131
-
132
- <?php
133
- break;
134
- ?>
135
-
136
- <?php } // end switch field type ?>
137
-
138
- <!-- Additional Classes -->
139
- <tr valign="top">
140
- <td scope="row">
141
- <label for="placeholder">
142
- <?php _e( 'Additional Classes' , 'yikes-inc-easy-mailchimp-extender' ); ?>
143
- </label>
144
- </td>
145
- <td>
146
- <input type="text" class="widefat" name="field[<?php echo $merge_field_data['tag']; ?>][additional-classes]" value="<?php echo isset( $form_data_array['classes'] ) ? stripslashes( esc_html( $form_data_array['classes'] ) ) : '' ; ?>" />
147
- <p class="description"><small><?php printf( __( "Assign additional classes to this field. %s.", 'yikes-inc-easy-mailchimp-extender' ), '<a target="_blank" href="' . esc_url( 'https://yikesplugins.com/support/knowledge-base/bundled-css-classes/' ) . '">' . __( 'View bundled classes', 'yikes-inc-easy-mailchimp-extender' ) . '</a>' );?></small></p>
148
- </td>
149
- </tr>
150
- <!-- Required Toggle -->
151
- <tr valign="top">
152
- <td scope="row">
153
- <label for="field-required">
154
- <?php _e( 'Field Required?' , 'yikes-inc-easy-mailchimp-extender' ); ?>
155
- </label>
156
- </td>
157
- <td>
158
- <input type="checkbox" class="widefat" value="1" name="field[<?php echo $merge_field_data['tag']; ?>][require]" <?php checked( $merge_field_data['req'] , 1 ); ?> <?php if( $merge_field_data['tag'] == 'EMAIL' ) { ?> disabled="disabled" checked="checked" title="<?php echo __( 'Email is a required field.' , 'yikes-inc-easy-mailchimp-extender' ); } ?>">
159
- <p class="description"><small><?php _e( "Require this field to be filled in before the form can be submitted.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
160
- </td>
161
- </tr>
162
- <!-- Visible Toggle -->
163
- <tr valign="top">
164
- <td scope="row">
165
- <label for="hide-field">
166
- <?php _e( 'Hide Field' , 'yikes-inc-easy-mailchimp-extender' ); ?>
167
- </label>
168
- </td>
169
- <td>
170
- <input type="checkbox" class="widefat" value="1" name="field[<?php echo $merge_field_data['tag']; ?>][hide]" <?php if( empty( $merge_field_data['show'] ) ) { echo 'checked="checked"'; } ?> <?php if( $merge_field_data['tag'] == 'EMAIL' ) { ?> disabled="disabled" title="<?php echo __( 'Cannot toggle email field visibility.' , 'yikes-inc-easy-mailchimp-extender' ); } ?>">
171
- <p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
172
- </td>
173
- </tr>
174
- <!-- Toggle Buttons -->
175
- <tr valign="top">
176
- <td scope="row">
177
- &nbsp;
178
- </td>
179
- <td>
180
- <span class="toggle-container">
181
- <a href="#" class="hide-field"><?php _e( "Close" , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
182
- <a href="#" class="remove-field" alt="<?php echo $merge_field_data['tag']; ?>"><?php _e( "Remove Field" , 'yikes-inc-easy-mailchimp-extender' ); ?></a>
183
- </span>
184
- </td>
185
- </tr>
186
- </table>
187
- </p>
188
-
189
- </div>
190
- </section>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/partials/dashboard-widgets/class.list-activity-widget.php CHANGED
@@ -66,44 +66,25 @@ class YIKES_Inc_Easy_MailChimp_Dashboard_Widgets {
66
  */
67
  function list_stats_dashboard_widget() {
68
  // Get our list data!
69
- // Check for a transient, if not - set one up for one hour
70
- if ( false === ( $list_data = get_transient( 'yikes-easy-mailchimp-list-data' ) ) ) {
71
- $api_key = yikes_get_mc_api_key();
72
- $dash_position = strpos( $api_key, '-' );
73
- if ( $dash_position !== false ) {
74
- $api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/list.json';
75
- }
76
- $list_data = wp_remote_post( $api_endpoint, array(
77
- 'body' => array(
78
- 'apikey' => $api_key,
79
- 'limit' => 100,
80
- ),
81
- 'timeout' => 10,
82
- 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true ),
83
- ) );
84
- $list_data = json_decode( wp_remote_retrieve_body( $list_data ), true );
85
- if ( isset( $list_data['error'] ) ) {
86
- if ( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) {
87
- require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
88
- $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
89
- $error_logging->yikes_easy_mailchimp_write_to_error_log( $list_data['error'], __( "Get Account Lists", 'yikes-inc-easy-mailchimp-extender' ), "Dashboard Activity Widget" );
90
- }
91
- } else {
92
- // set our transient
93
- set_transient( 'yikes-easy-mailchimp-list-data', $list_data, 1 * HOUR_IN_SECONDS );
94
- }
95
  }
 
96
  ?>
97
  <!-- Dropdown to Change the list -->
98
- <?php if ( ! empty( $list_data['data'] ) ) {
99
  ?>
100
  <section class="inside-widget yikes-dashboard-widget-section">
101
  <strong class="select-list-title"><?php _e( 'Select a list', 'yikes-inc-easy-mailchimp-extender' ) ?>:</strong>
102
  <select id="yikes-easy-mc-dashboard-change-list" class="widefat">
103
  <?php
104
- foreach ( $list_data['data'] as $list ) {
105
  ?>
106
- <option val="<?php echo $list['id']; ?>"><?php echo $list['name']; ?></option><?php
 
107
  }
108
  ?>
109
  </select>
@@ -111,11 +92,7 @@ class YIKES_Inc_Easy_MailChimp_Dashboard_Widgets {
111
  </section>
112
  <!-- display stats here! -->
113
  <section id="yikes-easy-mc-dashboard-widget-stats">
114
- <?php
115
- if ( ! empty( $list_data['data'] ) ) {
116
- include_once( YIKES_MC_PATH . 'admin/partials/dashboard-widgets/templates/stats-list-template.php' );
117
- }
118
- ?>
119
  </section>
120
  <?php } else { ?>
121
  <section id="yikes-easy-mc-dashboard-widget-stats">
@@ -128,33 +105,18 @@ class YIKES_Inc_Easy_MailChimp_Dashboard_Widgets {
128
  * Create the function to output our account activity dashboard widget
129
  */
130
  function account_activity_dashboard_widget() {
131
- // Get our list data!
132
- // Check for a transient, if not - set one up for one hour
133
- if ( false === ( $account_activity = get_transient( 'yikes-easy-mailchimp-account-activity' ) ) ) {
134
- $api_key = yikes_get_mc_api_key();
135
- $dash_position = strpos( $api_key, '-' );
136
- if ( $dash_position !== false ) {
137
- $api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/helper/chimp-chatter.json';
138
- }
139
- $account_activity = wp_remote_post( $api_endpoint, array(
140
- 'body' => array(
141
- 'apikey' => $api_key,
142
- ),
143
- 'timeout' => 10,
144
- 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true ),
145
- ) );
146
- $account_activity = json_decode( wp_remote_retrieve_body( $account_activity ), true );
147
- if ( isset( $account_activity['error'] ) ) {
148
- if ( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) {
149
- require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
150
- $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
151
- $error_logging->yikes_easy_mailchimp_write_to_error_log( $account_activity['error'], __( "Get Account Activity", 'yikes-inc-easy-mailchimp-extender' ), "Dashboard Activity Widget" );
152
- }
153
- } else {
154
- // set our transient for one hour
155
- set_transient( 'yikes-easy-mailchimp-account-activity', $account_activity, 1 * HOUR_IN_SECONDS );
156
- }
157
  }
 
158
  if ( ! empty( $account_activity ) ) {
159
  include_once( YIKES_MC_PATH . 'admin/partials/dashboard-widgets/templates/account-activity-template.php' );
160
  }
66
  */
67
  function list_stats_dashboard_widget() {
68
  // Get our list data!
69
+ $list_data = yikes_get_mc_api_manager()->get_list_handler()->get_lists();
70
+
71
+ if ( isset( $list_data['error'] ) ) {
72
+ $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
73
+ $error_logging->maybe_write_to_log( $list_data['error'], __( "Get Account Lists", 'yikes-inc-easy-mailchimp-extender' ), "Dashboard Activity Widget" );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
  }
75
+
76
  ?>
77
  <!-- Dropdown to Change the list -->
78
+ <?php if ( ! empty( $list_data ) ) {
79
  ?>
80
  <section class="inside-widget yikes-dashboard-widget-section">
81
  <strong class="select-list-title"><?php _e( 'Select a list', 'yikes-inc-easy-mailchimp-extender' ) ?>:</strong>
82
  <select id="yikes-easy-mc-dashboard-change-list" class="widefat">
83
  <?php
84
+ foreach ( $list_data as $list ) {
85
  ?>
86
+ <option value="<?php echo $list['id']; ?>"><?php echo $list['name']; ?></option>
87
+ <?php
88
  }
89
  ?>
90
  </select>
92
  </section>
93
  <!-- display stats here! -->
94
  <section id="yikes-easy-mc-dashboard-widget-stats">
95
+ <?php include_once( YIKES_MC_PATH . 'admin/partials/dashboard-widgets/templates/stats-list-template.php' ); ?>
 
 
 
 
96
  </section>
97
  <?php } else { ?>
98
  <section id="yikes-easy-mc-dashboard-widget-stats">
105
  * Create the function to output our account activity dashboard widget
106
  */
107
  function account_activity_dashboard_widget() {
108
+ $chimp_chatter = yikes_get_mc_api_manager()->get_chimp_chatter();
109
+ $account_activity = $chimp_chatter->chimp_chatter();
110
+
111
+ if ( is_wp_error( $account_activity ) ) {
112
+ $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
113
+ $error_logging->maybe_write_to_log(
114
+ $account_activity->get_error_code(),
115
+ __( "Get Account Activity", 'yikes-inc-easy-mailchimp-extender' ),
116
+ "Dashboard Activity Widget"
117
+ );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
118
  }
119
+
120
  if ( ! empty( $account_activity ) ) {
121
  include_once( YIKES_MC_PATH . 'admin/partials/dashboard-widgets/templates/account-activity-template.php' );
122
  }
admin/partials/dashboard-widgets/templates/stats-list-template.php CHANGED
@@ -1,8 +1,19 @@
1
  <?php
2
  /* The template file for displaying our stats in the Admin dashboard widget */
 
 
 
 
 
 
 
 
 
 
 
3
  ?>
4
  <section id="yikes-easy-mc-widget-stat-holder">
5
- <h3><?php echo $list_data['data'][0]['name']; ?> <small><a href="<?php echo esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-view-list&list-id=' . $list_data['data'][0]['id'] . '' ) ); ?>" title="<?php _e( 'view List' , 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'view list' , 'yikes-inc-easy-mailchimp-extender' ); ?></a></small></h3>
6
 
7
  <table class="yikes-easy-mc-stats-table">
8
  <thead class="yikes-easy-mc-hidden">
@@ -16,21 +27,21 @@
16
  <tbody>
17
  <tr class="yikes-easy-mc-table-stats-tr yikes-easy-mc-table-stats-tr-first">
18
  <td title="<?php _e( 'Number of active subscribers.' , 'yikes-inc-easy-mailchimp-extender' ); ?>">
19
- <p class="yikes-easy-mc-dashboard-stat"><?php echo $list_data['data'][0]['stats']['member_count']; ?></p>
20
  <p class="yikes-easy-mc-stat-list-label"><?php _e( 'subscribers' , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
21
  </td>
22
  <td title="<?php _e( 'Number of users who have unsusbscribed.' , 'yikes-inc-easy-mailchimp-extender' ); ?>">
23
- <p class="yikes-easy-mc-dashboard-stat"><?php echo $list_data['data'][0]['stats']['unsubscribe_count']; ?></p>
24
  <p class="yikes-easy-mc-stat-list-label"><?php _e( 'unsubscribed' , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
25
  </td>
26
  </tr>
27
  <tr class="yikes-easy-mc-table-stats-tr yikes-easy-mc-table-stats-tr-second">
28
  <td title="<?php _e( 'Number of new subscribers since the last campaign was sent.' , 'yikes-inc-easy-mailchimp-extender' ); ?>">
29
- <p class="yikes-easy-mc-dashboard-stat"><?php echo $list_data['data'][0]['stats']['member_count_since_send']; ?></p>
30
  <p class="yikes-easy-mc-stat-list-label"><?php _e( 'new since send' , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
31
  </td>
32
  <td title="<?php _e( 'Average number of subscribers per month.' , 'yikes-inc-easy-mailchimp-extender' ); ?>">
33
- <p class="yikes-easy-mc-dashboard-stat"><?php echo $list_data['data'][0]['stats']['avg_sub_rate']; ?></p>
34
  <p class="yikes-easy-mc-stat-list-label"><?php _e( 'avg. sub. rate' , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
35
  </td>
36
  </tr>
1
  <?php
2
  /* The template file for displaying our stats in the Admin dashboard widget */
3
+
4
+ if ( isset( $list_data ) && isset( $list_data['id'] ) ) {
5
+
6
+ // When a user selects a list from the dropdown, capture the array value here
7
+ $list = $list_data;
8
+ } else {
9
+
10
+ // On initial page load, we grab all of the lists
11
+ // So we need to default to the first item in the list
12
+ $list = $list_data[ array_keys( $list_data )[0] ];
13
+ }
14
  ?>
15
  <section id="yikes-easy-mc-widget-stat-holder">
16
+ <h3><?php echo $list['name']; ?> <small><a href="<?php echo esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-view-list&list-id=' . $list['id'] . '' ) ); ?>" title="<?php _e( 'view List' , 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'view list' , 'yikes-inc-easy-mailchimp-extender' ); ?></a></small></h3>
17
 
18
  <table class="yikes-easy-mc-stats-table">
19
  <thead class="yikes-easy-mc-hidden">
27
  <tbody>
28
  <tr class="yikes-easy-mc-table-stats-tr yikes-easy-mc-table-stats-tr-first">
29
  <td title="<?php _e( 'Number of active subscribers.' , 'yikes-inc-easy-mailchimp-extender' ); ?>">
30
+ <p class="yikes-easy-mc-dashboard-stat"><?php echo $list['stats']['member_count']; ?></p>
31
  <p class="yikes-easy-mc-stat-list-label"><?php _e( 'subscribers' , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
32
  </td>
33
  <td title="<?php _e( 'Number of users who have unsusbscribed.' , 'yikes-inc-easy-mailchimp-extender' ); ?>">
34
+ <p class="yikes-easy-mc-dashboard-stat"><?php echo $list['stats']['unsubscribe_count']; ?></p>
35
  <p class="yikes-easy-mc-stat-list-label"><?php _e( 'unsubscribed' , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
36
  </td>
37
  </tr>
38
  <tr class="yikes-easy-mc-table-stats-tr yikes-easy-mc-table-stats-tr-second">
39
  <td title="<?php _e( 'Number of new subscribers since the last campaign was sent.' , 'yikes-inc-easy-mailchimp-extender' ); ?>">
40
+ <p class="yikes-easy-mc-dashboard-stat"><?php echo $list['stats']['member_count_since_send']; ?></p>
41
  <p class="yikes-easy-mc-stat-list-label"><?php _e( 'new since send' , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
42
  </td>
43
  <td title="<?php _e( 'Average number of subscribers per month.' , 'yikes-inc-easy-mailchimp-extender' ); ?>">
44
+ <p class="yikes-easy-mc-dashboard-stat"><?php echo $list['stats']['avg_sub_rate']; ?></p>
45
  <p class="yikes-easy-mc-stat-list-label"><?php _e( 'avg. sub. rate' , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
46
  </td>
47
  </tr>
admin/partials/edit-form.php CHANGED
@@ -70,73 +70,43 @@
70
  );
71
  }
72
 
73
- $api_key = yikes_get_mc_api_key();
74
- $dash_position = strpos( $api_key, '-' );
75
 
76
  // Check for a transient, if not - set one up for one hour
77
- if ( false === ( $list_data = get_transient( 'yikes-easy-mailchimp-list-data' ) ) ) {
78
- if( $dash_position !== false ) {
79
- $api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/list.json';
80
- }
81
- $list_data = wp_remote_post( $api_endpoint, array(
82
- 'body' => array(
83
- 'apikey' => $api_key,
84
- 'limit' => 100
85
- ),
86
- 'timeout' => 10,
87
- 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true )
88
- ) );
89
- $list_data = json_decode( wp_remote_retrieve_body( $list_data ), true );
90
- if( isset( $list_data['error'] ) ) {
91
- if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
92
- $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
93
- $error_logging->yikes_easy_mailchimp_write_to_error_log( $list_data['error'], __( "Get Account Lists" , 'yikes-inc-easy-mailchimp-extender' ), "Edit Form Page" );
94
- }
95
- } else {
96
- // set our transient
97
- set_transient( 'yikes-easy-mailchimp-list-data', $list_data, 1 * HOUR_IN_SECONDS );
98
- }
99
  }
100
 
101
- // get the list data
102
- if( $dash_position !== false ) {
103
- $api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/merge-vars.json';
104
- }
105
- $available_merge_variables = wp_remote_post( $api_endpoint, array(
106
- 'body' => array(
107
- 'apikey' => $api_key,
108
- 'id' => array( $form['list_id'] ),
109
- ),
110
- 'timeout' => 10,
111
- 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true )
112
- ) );
113
- $available_merge_variables = json_decode( wp_remote_retrieve_body( $available_merge_variables ), true );
114
- if( isset( $available_merge_variables['error'] ) ) {
115
- if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
116
- $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
117
- $error_logging->yikes_easy_mailchimp_write_to_error_log( $available_merge_variables['error'], __( "Get Merge Variables" , 'yikes-inc-easy-mailchimp-extender' ), "Edit Form Page" );
118
- }
119
  }
120
 
121
  // get the interest group data
122
- if( $dash_position !== false ) {
123
- $api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/interest-groupings.json';
124
- }
125
- $interest_groupings = wp_remote_post( $api_endpoint, array(
126
- 'body' => array(
127
- 'apikey' => $api_key,
128
- 'id' => $form['list_id']
129
- ),
130
- 'timeout' => 10,
131
- 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true )
132
- ) );
133
- $interest_groupings = json_decode( wp_remote_retrieve_body( $interest_groupings ), true );
134
- $no_interest_groupings = '<p class="description error-descripion">' . __( 'No Interest Groups Found' , 'yikes-inc-easy-mailchimp-extender' ) . '.</p>';
135
- if( isset( $interest_groupings['error'] ) ) {
136
- if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
137
- $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
138
- $error_logging->yikes_easy_mailchimp_write_to_error_log( $interest_groupings['error'], __( "Get Interest Groups" , 'yikes-inc-easy-mailchimp-extender' ), "Edit Form Page" );
139
- }
140
  }
141
 
142
  /* Build Our Update Form URL */
@@ -253,7 +223,7 @@
253
  ?>
254
 
255
  <!-- Save Fields Button -->
256
- <?php echo submit_button( __( 'Update Form' ) , 'primary' , '' , false , array( 'onclick' => '', 'style' => 'float:right;margin-right:12px;'.$display_none ) ); ?>
257
 
258
  <!-- .inside -->
259
  </div>
@@ -573,34 +543,57 @@
573
  // build our default options
574
  $error_message_array = array(
575
  'success' => __( 'Thank You for subscribing! Check your email for the confirmation message.' , 'yikes-inc-easy-mailchimp-extender' ),
 
 
576
  'general-error' => __( "Whoops! It looks like something went wrong. Please try again." , 'yikes-inc-easy-mailchimp-extender' ),
577
- 'invalid-email' => __( "Please provide a valid email address." , 'yikes-inc-easy-mailchimp-extender' ),
578
- 'email-exists-error' => __( "The provided email is already subscribed to this list." , 'yikes-inc-easy-mailchimp-extender' ),
579
- 'update-link' => __ ( "To update your MailChimp profile, please [link]click to send yourself an update link[/link].", 'yikes-inc-easy-mailchimp-extender' ),
 
580
  );
581
  $global_error_messages = get_option( 'yikes-easy-mc-global-error-messages' , $error_message_array );
582
  ?>
583
- <p class="edit-form-description"><?php _e( "Enter your custom messages for this form below. Leave the field blank to use the default global error message." , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
584
 
585
- <!-- Success Message -->
586
- <label for="yikes-easy-mc-success-message"><strong><?php _e( 'Success Message' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
587
  <input type="text" class="widefat" name="yikes-easy-mc-success-message" id="yikes-easy-mc-success-message" value="<?php echo isset( $error_messages['success'] ) ? stripslashes( esc_html( $error_messages['success'] ) ) : ''; ?>" placeholder="<?php echo $global_error_messages['success']; ?>" >
588
  </label>
589
- <!-- General Error Message -->
590
- <label for="yikes-easy-mc-general-error-message"><strong><?php _e( 'General Error Message' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
591
- <input type="text" class="widefat" name="yikes-easy-mc-general-error-message" id="yikes-easy-mc-general-error-message" value="<?php echo isset( $error_messages['general-error'] ) ? stripslashes( esc_html( $error_messages['general-error'] ) ) : ''; ?>" placeholder="<?php echo $global_error_messages['general-error']; ?>" >
 
 
 
 
592
  </label>
593
- <!-- Invalid Email Address Message -->
594
- <label for="yikes-easy-mc-invalid-email-message"><strong><?php _e( 'Invalid Email' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
595
- <input type="text" class="widefat" name="yikes-easy-mc-invalid-email-message" id="yikes-easy-mc-invalid-email-message" value="<?php echo isset( $error_messages['invalid-email'] ) ? stripslashes( esc_html( $error_messages['invalid-email'] ) ) : ''; ?>" placeholder="<?php echo $global_error_messages['invalid-email']; ?>">
596
  </label>
597
  <!-- Email Address is already subscribed -->
598
- <label for="yikes-easy-mc-user-subscribed-message"><strong><?php _e( 'Email Already Subscribed' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
599
  <input type="text" class="widefat" name="yikes-easy-mc-user-subscribed-message" id="yikes-easy-mc-user-subscribed-message" value="<?php echo isset( $error_messages['already-subscribed'] ) ? stripslashes( esc_html( $error_messages['already-subscribed'] ) ) : ''; ?>" placeholder="<?php echo $global_error_messages['email-exists-error']; ?>">
600
  </label>
601
- <!-- Click the link to update user profile etc. etc. -->
602
- <label for="yikes-easy-mc-user-subscribed-update-link"><strong><?php _e( 'Update Link' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
603
- <input type="text" class="widefat" name="yikes-easy-mc-user-update-link" id="yikes-easy-mc-user-update-link" value="<?php echo isset( $error_messages['update-link'] ) ? stripslashes( esc_html( $error_messages['update-link'] ) ) : ''; ?>" placeholder="<?php echo $global_error_messages['update-link']; ?>">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
604
  </label>
605
  </div>
606
 
@@ -615,20 +608,38 @@
615
  <div id="postbox-container-1" class="postbox-container">
616
  <div class="meta-box-sortables">
617
  <div class="postbox yikes-easy-mc-postbox">
618
- <h3 class="edit-form-title"><span><?php _e( "Error Message Explanation" , 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
619
  <div class="inside">
620
 
621
  <ul>
622
- <li><strong><?php _e( 'Success Message' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> : <?php _e( 'The message displayed to the user after they have submitted the form and the data has been successfully sent to MailChimp.' , 'yikes-inc-easy-mailchimp-extender' ); ?></li>
623
- <li><strong><?php _e( 'General Error Message' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> : <?php _e( 'The message displayed to the user after a generic error has occurred.' , 'yikes-inc-easy-mailchimp-extender' ); ?></li>
624
- <li><strong><?php _e( 'Invalid Email' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> : <?php _e( 'The message displayed to the user after they have entered a non-valid email address.' , 'yikes-inc-easy-mailchimp-extender' ); ?></li>
625
- <li><strong><?php _e( 'Email Already Subscribed' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> : <?php _e( 'The message displayed to the user after they attempt to sign up for a mailing list using an email address that is already subscribed. You can display the user email back in the response by using an <code>[email]</code> tag. This will be replaced with the email entered by the user, in the response.' , 'yikes-inc-easy-mailchimp-extender' ); ?></li>
626
- <li><strong><?php _e( 'Update Link' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> : <?php _e( 'The update link is used when you allow users to generate an update email, when they are already subscribed to a list. Wrap the text you want to use as the link in <code>[link][/link]</code> tags.' , 'yikes-inc-easy-mailchimp-extender' ); ?></li>
627
  </ul>
628
 
629
  </div>
630
  <!-- .inside -->
631
  </div>
 
 
 
 
 
632
  <!-- .postbox -->
633
  </div>
634
  <!-- .meta-box-sortables -->
@@ -683,22 +694,22 @@
683
  <div class="yikes-mc-settings-expansion-section">
684
  <!-- Associated List -->
685
  <p class="form-field-container"><!-- necessary to prevent skipping on slideToggle(); --><label for="associated-list"><strong><?php _e( 'Associated List' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
686
- <select name="associated-list" id="associated-list" <?php if( empty( $list_data['data'] ) ) { echo 'disabled="disabled"'; } ?> onchange="jQuery('.view-list-link').attr( 'href', '<?php echo esc_url( admin_url( 'admin.php?page=yikes-mailchimp-view-list&list-id=' ) ); ?>' + jQuery( this ).val() );">
687
  <?php
688
- if( !empty( $list_data['data'] ) ) {
689
- foreach( $list_data['data'] as $mailing_list ) {
690
  ?>
691
- <option <?php selected( $form['list_id'] , $mailing_list['id'] ); ?> value="<?php echo $mailing_list['id']; ?>"><?php echo stripslashes( $mailing_list['name'] ) . ' (' . $mailing_list['stats']['member_count'] . ') '; ?></option>
692
  <?php
693
  }
694
  } else {
695
  ?>
696
- <option value="no-forms"><?php _e( 'No Lists Found' , 'yikes-inc-easy-mailchimp-extender' ); ?></option>
697
  <?php
698
  }
699
  ?>
700
  </select>
701
- <?php if( !empty( $list_data['data'] ) ) { ?>
702
  <p class="description view-list">
703
  <a href="<?php echo esc_url( admin_url( 'admin.php?page=yikes-mailchimp-view-list&list-id=' . $form['list_id'] ) ); ?>" class="view-list-link"><?php _e( 'View List', 'yikes-inc-easy-mailchimp-extender' ); ?></a>
704
  </p>
@@ -732,20 +743,6 @@
732
  <p class="description"><?php _e( "Double opt-in requires users to confirm their email address before being added to a list (recommended)" , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
733
  </label></p>
734
 
735
- <!-- Welcome Email -->
736
- <?php
737
- if( !isset( $optin_settings['send_welcome_email'] ) ) {
738
- $optin_settings['send_welcome_email'] = '1';
739
- }
740
- ?>
741
- <p class="form-field-container"><!-- necessary to prevent skipping on slideToggle(); --><label for="send-welcome-email"><strong><?php _e( 'Send Welcome Email' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
742
- <span class="edit-form-field-container-span">
743
- <label for="send-welcome"><input id="send-welcome" type="radio" name="send-welcome-email" value="1" <?php checked( $optin_settings['send_welcome_email'] , '1' ); ?>><?php _e( 'Yes' , 'yikes-inc-easy-mailchimp-extender' ); ?></label>
744
- &nbsp;<label for="do-not-send-welcome"><input id="do-not-send-welcome" type="radio" name="send-welcome-email" value="0" <?php checked( $optin_settings['send_welcome_email'] , '0' ); ?>><?php _e( 'No' , 'yikes-inc-easy-mailchimp-extender' ); ?></label>
745
- </span>
746
- <p class="description"><?php _e( "When a user signs up, should they receive the default welcome email?" , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
747
- </label></p>
748
-
749
  <!-- Update Existing Users -->
750
  <?php
751
  if( !isset( $optin_settings['update_existing_user'] ) ) {
70
  );
71
  }
72
 
73
+ // Set up our list_handler object.
74
+ $list_handler = yikes_get_mc_api_manager()->get_list_handler();
75
 
76
  // Check for a transient, if not - set one up for one hour
77
+ $list_data = $list_handler->get_lists();
78
+ if ( is_wp_error( $list_data ) ) {
79
+ $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
80
+ $error_logging->maybe_write_to_log(
81
+ $list_data->get_error_code(),
82
+ __( "Get Account Lists", 'yikes-inc-easy-mailchimp-extender' ),
83
+ "Edit Form Page"
84
+ );
85
+ $list_data = array();
 
 
 
 
 
 
 
 
 
 
 
 
 
86
  }
87
 
88
+ // Get the merge fields
89
+ $available_merge_variables = $list_handler->get_merge_fields( $form['list_id'] );
90
+ if ( is_wp_error( $available_merge_variables ) ) {
91
+ $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
92
+ $error_logging->maybe_write_to_log(
93
+ $available_merge_variables->get_error_code(),
94
+ __( "Get Merge Variables", 'yikes-inc-easy-mailchimp-extender' ),
95
+ "Edit Form Page"
96
+ );
97
+ $available_merge_variables = array();
 
 
 
 
 
 
 
 
98
  }
99
 
100
  // get the interest group data
101
+ $interest_groupings = $list_handler->get_interest_categories( $form['list_id'] );
102
+ if ( is_wp_error( $interest_groupings ) ) {
103
+ $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
104
+ $error_logging->maybe_write_to_log(
105
+ $interest_groupings->get_error_code(),
106
+ __( 'Get Interest Groups', 'yikes-inc-easy-mailchimp-extender' ),
107
+ 'Edit Form Page'
108
+ );
109
+ $interest_groupings = array();
 
 
 
 
 
 
 
 
 
110
  }
111
 
112
  /* Build Our Update Form URL */
223
  ?>
224
 
225
  <!-- Save Fields Button -->
226
+ <?php submit_button( __( 'Update Form' ) , 'primary' , '' , false , array( 'onclick' => '', 'style' => 'float:right;margin-right:12px;'.$display_none ) ); ?>
227
 
228
  <!-- .inside -->
229
  </div>
543
  // build our default options
544
  $error_message_array = array(
545
  'success' => __( 'Thank You for subscribing! Check your email for the confirmation message.' , 'yikes-inc-easy-mailchimp-extender' ),
546
+ 'success-single-optin' => __( 'Thank you for subscribing!' , 'yikes-inc-easy-mailchimp-extender' ),
547
+ 'success-resubscribed' => __( 'Thank you for already being a subscriber! Your profile info has been updated.', 'yikes-inc-easy-mailchimp-extender' ),
548
  'general-error' => __( "Whoops! It looks like something went wrong. Please try again." , 'yikes-inc-easy-mailchimp-extender' ),
549
+ 'email-exists-error' => __( "The email you entered is already a subscriber to this list." , 'yikes-inc-easy-mailchimp-extender' ),
550
+ 'update-link' => __( "You're already subscribed. To update your MailChimp profile, please [link]click to send yourself an update link[/link].", 'yikes-inc-easy-mailchimp-extender' ),
551
+ 'email-subject' => __( 'MailChimp Profile Update', 'yikes-inc-easy-mailchimp-extender' ),
552
+
553
  );
554
  $global_error_messages = get_option( 'yikes-easy-mc-global-error-messages' , $error_message_array );
555
  ?>
556
+ <p class="edit-form-description"><?php _e( "Customize the response messages for this form. Leave the field blank to use the default message. The messages applicable to this form depend on the Opt-in Settings chosen." , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
557
 
558
+ <!-- Success Message (refactored @ 6.3.0 for double optin) -->
559
+ <label for="yikes-easy-mc-success-message"><strong><?php _e( 'Success: Double opt-in' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
560
  <input type="text" class="widefat" name="yikes-easy-mc-success-message" id="yikes-easy-mc-success-message" value="<?php echo isset( $error_messages['success'] ) ? stripslashes( esc_html( $error_messages['success'] ) ) : ''; ?>" placeholder="<?php echo $global_error_messages['success']; ?>" >
561
  </label>
562
+ <!-- Success Message (for single optin) -->
563
+ <label for="yikes-easy-mc-success-single-optin-message"><strong><?php _e( 'Success: Single opt-in' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
564
+ <input type="text" class="widefat" name="yikes-easy-mc-success-single-optin-message" id="yikes-easy-mc-success-single-optin-message" value="<?php echo isset( $error_messages['success-single-optin'] ) ? stripslashes( esc_html( $error_messages['success-single-optin'] ) ) : ''; ?>" placeholder="<?php echo $global_error_messages['success-single-optin']; ?>" >
565
+ </label>
566
+ <!-- Resubscribing users when updating your profile via the form is allowed -->
567
+ <label for="yikes-easy-mc-user-resubscribed-success-message"><strong><?php _e( 'Success: Re-subscriber' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
568
+ <input type="text" class="widefat" name="yikes-easy-mc-user-resubscribed-success-message" id="yikes-easy-mc-user-resubscribed-success-message" value="<?php echo isset( $error_messages['success-resubscribed'] ) ? stripslashes( esc_html( $error_messages['success-resubscribed'] ) ) : ''; ?>" placeholder="<?php echo $global_error_messages['success-resubscribed']; ?>">
569
  </label>
570
+ <!-- Click the link to update user profile etc. etc. -->
571
+ <label for="yikes-easy-mc-user-subscribed-update-link"><strong><?php _e( 'Success: Re-subscriber with link to email profile update message' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
572
+ <input type="text" class="widefat" name="yikes-easy-mc-user-update-link" id="yikes-easy-mc-user-update-link" value="<?php echo isset( $error_messages['update-link'] ) ? stripslashes( esc_html( $error_messages['update-link'] ) ) : ''; ?>" placeholder="<?php echo $global_error_messages['update-link']; ?>">
573
  </label>
574
  <!-- Email Address is already subscribed -->
575
+ <label for="yikes-easy-mc-user-subscribed-message"><strong><?php _e( 'Error: Re-subscribers not permitted' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
576
  <input type="text" class="widefat" name="yikes-easy-mc-user-subscribed-message" id="yikes-easy-mc-user-subscribed-message" value="<?php echo isset( $error_messages['already-subscribed'] ) ? stripslashes( esc_html( $error_messages['already-subscribed'] ) ) : ''; ?>" placeholder="<?php echo $global_error_messages['email-exists-error']; ?>">
577
  </label>
578
+ <!-- General Error Message -->
579
+ <label for="yikes-easy-mc-general-error-message"><strong><?php _e( 'Error: General' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
580
+ <input type="text" class="widefat" name="yikes-easy-mc-general-error-message" id="yikes-easy-mc-general-error-message" value="<?php echo isset( $error_messages['general-error'] ) ? stripslashes( esc_html( $error_messages['general-error'] ) ) : ''; ?>" placeholder="<?php echo $global_error_messages['general-error']; ?>" >
581
+ </label>
582
+
583
+ <!-- Email Section -->
584
+
585
+ <hr>
586
+ <p class="edit-form-description"><?php _e( 'Customize the profile verification email sent to re-subscribers. Leave the text unedited to use the default message. This email is used if you have "Update Existing Subscriber" set to Yes and "Send Update Email" set to Yes.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
587
+ <!-- Email Subject -->
588
+ <label for="yikes-easy-mc-user-email-subject"><strong><?php _e( 'Email Subject' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
589
+ <input type="text" class="widefat" name="yikes-easy-mc-user-email-subject" id="yikes-easy-mc-user-email-subject" value="<?php echo isset( $error_messages['email-subject'] ) ? stripslashes( esc_html( $error_messages['email-subject'] ) ) : ''; ?>" placeholder="<?php echo $global_error_messages['email-subject']; ?>">
590
+ </label>
591
+ <!-- Email Body -->
592
+ <label for="yikes-easy-mc-user-email-body"><strong><?php _e( 'Email Body' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
593
+ <?php
594
+ $editor_content = ( isset( $error_messages['email-body'] ) && ! empty( $error_messages['email-body'] ) ) ? $error_messages['email-body'] : Yikes_Inc_Easy_Mailchimp_Forms_Admin::generate_default_email_body();
595
+ wp_editor( $editor_content, 'yikes-easy-mc-user-email-body', array( 'textarea_id' => 'yikes-easy-mc-user-email-body' ) );
596
+ ?>
597
  </label>
598
  </div>
599
 
608
  <div id="postbox-container-1" class="postbox-container">
609
  <div class="meta-box-sortables">
610
  <div class="postbox yikes-easy-mc-postbox">
611
+ <h3 class="edit-form-title"><span><?php _e( "Custom Message Help" , 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3>
612
+ <div class="inside">
613
+ <ul>
614
+ <li><strong><?php _e( 'Success: Double opt-in' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> <?php _e( 'The message displayed after a double opt-in form has been submitted.' , 'yikes-inc-easy-mailchimp-extender' ); ?></li>
615
+ <li><strong><?php _e( 'Success Message: Single opt-in' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> <?php _e( 'The message displayed after a single opt-in form has been submitted.' , 'yikes-inc-easy-mailchimp-extender' ); ?></li>
616
+ <li><strong><?php _e( 'Success: Re-subscriber' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> <?php _e( 'The message displayed after a form has been submitted if you have "Update Existing Subscriber" set to Yes and "Send Update Email" set to No.' , 'yikes-inc-easy-mailchimp-extender' ); ?></li>
617
+ <li><strong><?php _e( 'Success: Re-subscriber with link to email profile update message' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> <?php _e( 'The message displayed after a form has been submitted if you have "Update Existing Subscriber" set to Yes and "Send Update Email" set to Yes. Wrap the text you want to be the link in <code>[link][/link]</code> tags.' , 'yikes-inc-easy-mailchimp-extender' ); ?></li>
618
+ <li><strong><?php _e( 'Error: Re-subscribers not permitted' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> <?php _e( 'The message displayed after an current subscriber tries to submit a form that has "Update Existing Subscriber" set to No. You can display the user\'s email in the message using an <code>[email]</code> tag.' , 'yikes-inc-easy-mailchimp-extender' ); ?></li>
619
+ <li><strong><?php _e( 'Error: General' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> <?php _e( 'The message displayed if an form error has occurred.' , 'yikes-inc-easy-mailchimp-extender' ); ?></li>
620
+ </ul>
621
+
622
+ </div>
623
+ <!-- .inside -->
624
+ </div>
625
+
626
+ <div class="postbox yikes-easy-mc-postbox">
627
+ <h3 class="edit-form-title"><span><?php _e( "Email Message Help" , 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3>
628
  <div class="inside">
629
 
630
  <ul>
631
+ <li><strong><?php _e( 'Email Subject' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> <?php _e( 'The subject of the email sent to the user.' , 'yikes-inc-easy-mailchimp-extender' ); ?></li>
632
+ <li><strong><?php _e( 'Email Body' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> <?php echo sprintf( __( 'The text in the profile update verification email sent to the subscriber. Wrap the text you want to be the link in <code>[link][/link]</code> tags. The link is required in the email, please don\'t leave these tags out. You can also use <code>[url]</code> tag to display your website\'s URL (e.g. %s).', 'yikes-inc-easy-mailchimp-extender' ), get_home_url() ); ?></li>
 
 
 
633
  </ul>
634
 
635
  </div>
636
  <!-- .inside -->
637
  </div>
638
+
639
+
640
+
641
+
642
+
643
  <!-- .postbox -->
644
  </div>
645
  <!-- .meta-box-sortables -->
694
  <div class="yikes-mc-settings-expansion-section">
695
  <!-- Associated List -->
696
  <p class="form-field-container"><!-- necessary to prevent skipping on slideToggle(); --><label for="associated-list"><strong><?php _e( 'Associated List' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
697
+ <select name="associated-list" id="associated-list" <?php if ( empty( $list_data ) ) { echo 'disabled="disabled"'; } ?> onchange="jQuery('.view-list-link').attr( 'href', '<?php echo esc_url( admin_url( 'admin.php?page=yikes-mailchimp-view-list&list-id=' ) ); ?>' + jQuery( this ).val() );">
698
  <?php
699
+ if ( ! empty( $list_data ) ) {
700
+ foreach( $list_data as $mailing_list ) {
701
  ?>
702
+ <option <?php selected( $form['list_id'] , $mailing_list['id'] ); ?> value="<?php echo $mailing_list['id']; ?>"><?php echo stripslashes( $mailing_list['name'] ) . ' (' . $mailing_list['stats']['member_count'] . ') '; ?></option>
703
  <?php
704
  }
705
  } else {
706
  ?>
707
+ <option value="no-forms"><?php _e( 'No Lists Found' , 'yikes-inc-easy-mailchimp-extender' ); ?></option>
708
  <?php
709
  }
710
  ?>
711
  </select>
712
+ <?php if( ! empty( $form['list_id'] ) ) { ?>
713
  <p class="description view-list">
714
  <a href="<?php echo esc_url( admin_url( 'admin.php?page=yikes-mailchimp-view-list&list-id=' . $form['list_id'] ) ); ?>" class="view-list-link"><?php _e( 'View List', 'yikes-inc-easy-mailchimp-extender' ); ?></a>
715
  </p>
743
  <p class="description"><?php _e( "Double opt-in requires users to confirm their email address before being added to a list (recommended)" , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
744
  </label></p>
745
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
746
  <!-- Update Existing Users -->
747
  <?php
748
  if( !isset( $optin_settings['update_existing_user'] ) ) {
admin/partials/menu/account-details.php CHANGED
@@ -1,90 +1,56 @@
1
  <?php
2
- // lets confirm the user has a valid API key stored
3
- if( $this->is_user_mc_api_valid_form( false ) == 'valid' ) {
4
- // store the API key
5
- $api_key = yikes_get_mc_api_key();
6
- $dash_position = strpos( $api_key, '-' );
7
- /// Check for a transients, if not - set them up
8
- if ( false === ( $profile_info = get_transient( 'yikes-easy-mailchimp-profile-data' ) ) ) {
9
- if( $dash_position !== false ) {
10
- $api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/users/profile.json';
11
- }
12
- $profile_info = wp_remote_post( $api_endpoint, array(
13
- 'body' => array(
14
- 'apikey' => $api_key
15
- ),
16
- 'timeout' => 10,
17
- 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true )
18
- ) );
19
- $profile_info = json_decode( wp_remote_retrieve_body( $profile_info ), true );
20
- if( isset( $profile_info['error'] ) ) {
21
- if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
22
- require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
23
- $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
24
- $error_logging->yikes_easy_mailchimp_write_to_error_log( $profile_info['error'], __( "Get Profile Info." , 'yikes-inc-easy-mailchimp-extender' ), "Account Details Page" );
25
- }
26
- return;
27
- } else {
28
- // set our transient for one week
29
- set_transient( 'yikes-easy-mailchimp-profile-data', $profile_info, 1 * WEEK_IN_SECONDS );
30
- }
31
- }
32
- if ( false === ( $account_details = get_transient( 'yikes-easy-mailchimp-account-data' ) ) ) {
33
- if( $dash_position !== false ) {
34
- $api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/helper/account-details.json';
35
- }
36
- $account_details = wp_remote_post( $api_endpoint, array(
37
- 'body' => array(
38
- 'apikey' => $api_key
39
- ),
40
- 'timeout' => 10,
41
- 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true )
42
- ) );
43
- $account_details = json_decode( wp_remote_retrieve_body( $account_details ), true );
44
- if( isset( $account_details['error'] ) ) {
45
- if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
46
- require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
47
- $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
48
- $error_logging->yikes_easy_mailchimp_write_to_error_log( $account_details['error'], __( "Get Account Details" , 'yikes-inc-easy-mailchimp-extender' ), "Account Details Page" );
49
- }
50
- } else {
51
- // set our transient for one hour
52
- set_transient( 'yikes-easy-mailchimp-account-data', $account_details, 1 * HOUR_IN_SECONDS );
53
- }
54
- }
55
- if ( false === ( $account_activity = get_transient( 'yikes-easy-mailchimp-account-activity' ) ) ) {
56
- // retreive our list data
57
- if( $dash_position !== false ) {
58
- $api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/helper/chimp-chatter.json';
59
- }
60
- $account_activity = wp_remote_post( $api_endpoint, array(
61
- 'body' => array(
62
- 'apikey' => $api_key
63
- ),
64
- 'timeout' => 10,
65
- 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true )
66
- ) );
67
- $account_activity = json_decode( wp_remote_retrieve_body( $account_activity ), true );
68
- if( isset( $account_activity['error'] ) ) {
69
- if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
70
- require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
71
- $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
72
- $error_logging->yikes_easy_mailchimp_write_to_error_log( $account_activity['error'], __( "Get Chimp Chatter" , 'yikes-inc-easy-mailchimp-extender' ), "Account Details Page" );
73
- }
74
- } else {
75
- // set our transient for one hour
76
- set_transient( 'yikes-easy-mailchimp-account-activity', $account_activity, 1 * HOUR_IN_SECONDS );
77
- }
78
- }
79
- } else {
80
- wp_die( __( 'It looks like you need to re-validate your MailChimp API key before you can continue.' , 'yikes-inc-easy-mailchimp-extender' ) , 500 );
81
- }
82
  ?>
83
  <div class="wrap" id="account-details">
84
  <!-- Freddie Logo -->
85
  <img src="<?php echo YIKES_MC_URL . 'includes/images/MailChimp_Assets/Freddie_60px.png'; ?>" alt="<?php _e( 'Freddie - MailChimp Mascot' , 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-mc-freddie-logo" />
86
 
87
- <h1><?php _e( 'Account Overview' , 'yikes-inc-easy-mailchimp-extender' ); echo ' | ' . $profile_info['username']; ?></h1>
88
  <!-- Account Overview Page Description -->
89
  <p class="yikes-easy-mc-about-text about-text"><?php _e( "Below you'll find a brief overview of account activity as well as some account and profile info." , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
90
 
@@ -105,6 +71,7 @@
105
  $end = count( $account_activity );
106
  foreach( $account_activity as $activity ) {
107
  $split_type = explode( ':',str_replace('-',' ',$activity['type']));
 
108
  switch( $activity['type'] ) {
109
  case 'lists:new-subscriber':
110
  case 'lists:profile-updates':
@@ -219,7 +186,7 @@
219
  <div class="postbox yikes-easy-mc-postbox chimp-chatter-sidebar">
220
  <div class="inside">
221
 
222
- <h2 class="account-status"><?php if( $account_details['has_activated'] == 1 ) { ?><div class="circle-account-active" title="<?php _e( "Account Active" , 'yikes-inc-easy-mailchimp-extender' ); ?>"></div><?php } else { ?><div class="circle-account-inactive" title="<?php _e( "Account Inactive" , 'yikes-inc-easy-mailchimp-extender' ); ?>"></div><?php } echo $profile_info['name']; ?> <small>(<?php echo $profile_info['role']; ?>)</small></h2>
223
 
224
  <img class="mailchimp-avatar" src="<?php echo esc_url_raw( $profile_info['avatar'] ); ?>" title="<?php echo $profile_info['username'] . ' ' . __( "MailChimp avatar" , 'yikes-inc-easy-mailchimp-extender' ); ?>">
225
 
@@ -230,7 +197,7 @@
230
  <strong><?php _e( 'Company' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
231
  </label>
232
  </td>
233
- <td><?php echo $account_details['contact']['company']; ?><br /><?php echo $account_details['contact']['city'] . ', ' . $account_details['contact']['state']; ?></td>
234
  </tr>
235
  <tr valign="top">
236
  <td scope="row">
1
  <?php
2
+ // lets confirm the user has a valid API key stored
3
+ if ( ! $this->is_user_mc_api_valid_form( false ) ) {
4
+ wp_die( __( 'It looks like you need to re-validate your MailChimp API key before you can continue.', 'yikes-inc-easy-mailchimp-extender' ), 500 );
5
+ }
6
+
7
+ $manager = yikes_get_mc_api_manager();
8
+
9
+ // Use new account details where we can.
10
+ $new_account_details = $manager->get_account_handler()->get_account();
11
+
12
+ // Get the user profile data from the V2 API
13
+ $profile_info = $manager->get_profile_handler()->get_profile();
14
+ if ( is_wp_error( $profile_info ) ) {
15
+ $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
16
+ $error_logging->maybe_write_to_log(
17
+ $profile_info->get_error_code(),
18
+ __( "Get Profile Info.", 'yikes-inc-easy-mailchimp-extender' ),
19
+ "Account Details Page"
20
+ );
21
+
22
+ return;
23
+ }
24
+
25
+ $account_details = $manager->get_account_details_handler()->account_details();
26
+ if ( is_wp_error( $account_details ) ) {
27
+ $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
28
+ $error_logging->maybe_write_to_log(
29
+ $account_details->get_error_code(),
30
+ __( "Get Account Details", 'yikes-inc-easy-mailchimp-extender' ),
31
+ "Account Details Page"
32
+ );
33
+
34
+ return;
35
+ }
36
+
37
+ $account_activity = $manager->get_chimp_chatter()->chimp_chatter();
38
+ if ( is_wp_error( $account_activity ) ) {
39
+ $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
40
+ $error_logging->maybe_write_to_log(
41
+ $account_activity->get_error_code(),
42
+ __( "Get Chimp Chatter", 'yikes-inc-easy-mailchimp-extender' ),
43
+ "Account Details Page"
44
+ );
45
+
46
+ return;
47
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  ?>
49
  <div class="wrap" id="account-details">
50
  <!-- Freddie Logo -->
51
  <img src="<?php echo YIKES_MC_URL . 'includes/images/MailChimp_Assets/Freddie_60px.png'; ?>" alt="<?php _e( 'Freddie - MailChimp Mascot' , 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-mc-freddie-logo" />
52
 
53
+ <h1><?php _e( 'Account Overview' , 'yikes-inc-easy-mailchimp-extender' ); echo ' | ' . $account_details['username']; ?></h1>
54
  <!-- Account Overview Page Description -->
55
  <p class="yikes-easy-mc-about-text about-text"><?php _e( "Below you'll find a brief overview of account activity as well as some account and profile info." , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
56
 
71
  $end = count( $account_activity );
72
  foreach( $account_activity as $activity ) {
73
  $split_type = explode( ':',str_replace('-',' ',$activity['type']));
74
+ $section_class = '';
75
  switch( $activity['type'] ) {
76
  case 'lists:new-subscriber':
77
  case 'lists:profile-updates':
186
  <div class="postbox yikes-easy-mc-postbox chimp-chatter-sidebar">
187
  <div class="inside">
188
 
189
+ <h2 class="account-status"><?php if( $account_details['has_activated'] == 1 ) { ?><div class="circle-account-active" title="<?php _e( "Account Active" , 'yikes-inc-easy-mailchimp-extender' ); ?>"></div><?php } else { ?><div class="circle-account-inactive" title="<?php _e( "Account Inactive" , 'yikes-inc-easy-mailchimp-extender' ); ?>"></div><?php } echo $new_account_details['username']; ?> <small>(<?php echo $new_account_details['role']; ?>)</small></h2>
190
 
191
  <img class="mailchimp-avatar" src="<?php echo esc_url_raw( $profile_info['avatar'] ); ?>" title="<?php echo $profile_info['username'] . ' ' . __( "MailChimp avatar" , 'yikes-inc-easy-mailchimp-extender' ); ?>">
192
 
197
  <strong><?php _e( 'Company' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
198
  </label>
199
  </td>
200
+ <td><?php echo $new_account_details['contact']['company']; ?><br /><?php echo $new_account_details['contact']['city'] . ', ' . $new_account_details['contact']['state']; ?></td>
201
  </tr>
202
  <tr valign="top">
203
  <td scope="row">
admin/partials/menu/add-ons.php CHANGED
@@ -9,10 +9,10 @@
9
  <!-- Freddie Logo -->
10
  <img src="<?php echo esc_url( YIKES_MC_URL . 'includes/images/MailChimp_Assets/Freddie_60px.png' ); ?>" alt="<?php esc_attr_e( 'Freddie - MailChimp Mascot' , 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-mc-freddie-logo" />
11
 
12
- <h1>YIKES Easy Forms for MailChimp | <?php echo esc_attr__( 'Add-Ons' , 'yikes-inc-easy-mailchimp-extender' ); ?> &nbsp; <a href="https://yikesplugins.com/plugins/?plugins=MailChimp" target="_blank" class="button-primary coming-soon-button" title="<?php esc_attr_e( 'View All Add-Ons' , 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php esc_attr_e( 'View All Add-Ons' , 'yikes-inc-easy-mailchimp-extender' ); ?> <span class="dashicons dashicons-external"></span></a></h1>
13
 
14
  <!-- Addons Page Description -->
15
- <p class="yikes-easy-mc-about-text about-text"><?php esc_attr_e( "Below you'll find a list of add-ons available for YIKES Easy Forms for MailChimp. Each add-on extends the base functionality of the free plugin." , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
16
 
17
  <!-- Add-On Container -->
18
  <section id="add-ons">
9
  <!-- Freddie Logo -->
10
  <img src="<?php echo esc_url( YIKES_MC_URL . 'includes/images/MailChimp_Assets/Freddie_60px.png' ); ?>" alt="<?php esc_attr_e( 'Freddie - MailChimp Mascot' , 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-mc-freddie-logo" />
11
 
12
+ <h1>Easy Forms for MailChimp | <?php echo esc_attr__( 'Add-Ons' , 'yikes-inc-easy-mailchimp-extender' ); ?> &nbsp; <a href="https://yikesplugins.com/plugins/?plugins=MailChimp" target="_blank" class="button-primary coming-soon-button" title="<?php esc_attr_e( 'View All Add-Ons' , 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php esc_attr_e( 'View All Add-Ons' , 'yikes-inc-easy-mailchimp-extender' ); ?> <span class="dashicons dashicons-external"></span></a></h1>
13
 
14
  <!-- Addons Page Description -->
15
+ <p class="yikes-easy-mc-about-text about-text"><?php esc_attr_e( "Below you'll find all free and paid add-ons available for Easy Forms for MailChimp. Each add-on extends the functionality of the free plugin." , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
16
 
17
  <!-- Add-On Container -->
18
  <section id="add-ons">
admin/partials/menu/manage-forms.php CHANGED
@@ -6,78 +6,36 @@ $form_interface = yikes_easy_mailchimp_extender_get_form_interface();
6
  $all_forms = $form_interface->get_all_forms();
7
 
8
  /* Store Data if User is Authorized */
9
- if ( $this->is_user_mc_api_valid_form( false ) == 'valid' ) {
10
- /// Check for a transient, if not - set one up for one hour
11
- if ( false === ( $list_data = get_transient( 'yikes-easy-mailchimp-list-data' ) ) ) {
12
- $api_key = yikes_get_mc_api_key();
13
- $dash_position = strpos( $api_key, '-' );
14
- if ( $dash_position !== false ) {
15
- $api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/list.json';
16
- }
17
- $list_data = wp_remote_post( $api_endpoint, array(
18
- 'body' => array(
19
- 'apikey' => $api_key,
20
- 'limit' => 100,
21
- ),
22
- 'timeout' => 10,
23
- 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true ),
24
- ) );
25
-
26
- if ( is_wp_error( $list_data ) ) {
27
- if ( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) {
28
- $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
29
- $error_logging->yikes_easy_mailchimp_write_to_error_log( $list_data->get_error_message(), __( "Get Account Lists", 'yikes-inc-easy-mailchimp-extender' ), "Manage Forms Page" );
30
- }
31
- $list_data = null;
32
- }
33
-
34
- $list_data = json_decode( wp_remote_retrieve_body( $list_data ), true );
35
- if ( isset( $list_data['error'] ) ) {
36
- if ( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) {
37
- $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
38
- $error_logging->yikes_easy_mailchimp_write_to_error_log( $list_data['error'], __( "Get Account Lists", 'yikes-inc-easy-mailchimp-extender' ), "Manage Forms Page" );
39
- }
40
- $list_data = null;
41
- }
42
-
43
- // Maybe set our transient
44
- if ( null !== $list_data ) {
45
- set_transient( 'yikes-easy-mailchimp-list-data', $list_data, HOUR_IN_SECONDS );
46
- }
47
  }
48
  } else {
49
- $list_data = null;
50
  }
51
  ?>
52
  <div class="wrap">
53
  <!-- Freddie Logo -->
54
  <img src="<?php echo YIKES_MC_URL . 'includes/images/MailChimp_Assets/Freddie_60px.png'; ?>" alt="<?php _e( 'Freddie - MailChimp Mascot' , 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-mc-freddie-logo" />
55
 
56
- <h1>YIKES Easy Forms for MailChimp | <?php _e( 'Manage Forms' , 'yikes-inc-easy-mailchimp-extender' ) ?></h1>
57
 
58
  <!-- Settings Page Description -->
59
- <p class="yikes-easy-mc-about-text about-text"><?php _e( 'Create and manage your MailChimp opt-in forms on the following page. Select a form to make edits to it.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
60
 
61
  <!-- Action Notices -->
62
  <?php
63
 
64
  /* If the user hasn't authenticated yet, lets kill off */
65
  if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) != 'valid_api_key' ) {
66
-
67
- $error_string = sprintf(
68
- esc_html__( 'You need to connect to MailChimp before you can start creating forms. Head over to the %s and enter your API key.', 'yikes-inc-easy-mailchimp-extender' ),
69
- sprintf(
70
- '<a href="%s" title="Settings Page">' . esc_html__( 'Settings Page', 'yikes-inc-easy-mailchimp-extender' ) . '</a>',
71
- admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings' )
72
- )
73
- );
74
-
75
- echo wp_kses_post(
76
- '<div class="error"><p>' . $error_string . '</p></div>'
77
- );
78
-
79
- exit;
80
-
81
  }
82
 
83
  /* Display our admin notices here */
@@ -200,7 +158,17 @@ if ( $this->is_user_mc_api_valid_form( false ) == 'valid' ) {
200
  </td>
201
 
202
  <td class="column-columnname"><?php echo isset( $form['form_description'] ) ? str_replace( '[yikes-mailchimp-subscriber-count]', do_shortcode( '[yikes-mailchimp-subscriber-count form="' . $id . '"]' ), $form['form_description'] ) : ''; ?></td>
203
- <td class="column-columnname"><?php if( isset( $list_data ) && $list_data['total'] > 0 ) { $key = $this->findMCListID( $form['list_id'] , $list_data['data'] ); if( isset( $key ) ) { echo $list_data['data'][$key]['name']; } else { echo '<strong>' . __( 'List Not Found' , 'yikes-inc-easy-mailchimp-extender' ) . '</strong>'; } } ?></td>
 
 
 
 
 
 
 
 
 
 
204
 
205
  <td class="column-columnname num stat-container">
206
  <?php
@@ -259,20 +227,26 @@ if ( $this->is_user_mc_api_valid_form( false ) == 'valid' ) {
259
 
260
  <!-- sidebar -->
261
  <div id="postbox-container-1" class="postbox-container">
 
262
  <div class="meta-box-sortables">
 
263
  <div class="postbox yikes-easy-mc-postbox">
 
264
  <?php
265
- if ( isset( $list_data['data'] ) ) {
266
- $this->generate_manage_forms_sidebar( $list_data['data'] );
267
- } else {
268
- esc_html_e( 'There was an error retrieving the list data.', 'yikes-inc-easy-mailchimp-extender' );
269
- }
270
  ?>
 
271
  </div> <!-- .postbox -->
272
 
273
- <?php $this->generate_show_some_love_container(); ?>
 
 
 
 
274
  </div> <!-- .meta-box-sortables -->
 
275
  </div> <!-- #postbox-container-1 .postbox-container -->
 
276
  </div> <!-- #post-body .metabox-holder .columns-2 -->
277
 
278
  <br class="clear">
6
  $all_forms = $form_interface->get_all_forms();
7
 
8
  /* Store Data if User is Authorized */
9
+ if( $this->is_user_mc_api_valid_form( false ) == 'valid' ) {
10
+ $list_data = yikes_get_mc_api_manager()->get_list_handler()->get_lists();
11
+ if ( is_wp_error( $list_data ) ) {
12
+ $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
13
+ $error_logging->maybe_write_to_log(
14
+ $list_data->get_error_code(),
15
+ __( "Get Account Lists" , 'yikes-inc-easy-mailchimp-extender' ),
16
+ "Manage Forms Page"
17
+ );
18
+ $list_data = array();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  }
20
  } else {
21
+ $list_data = array();
22
  }
23
  ?>
24
  <div class="wrap">
25
  <!-- Freddie Logo -->
26
  <img src="<?php echo YIKES_MC_URL . 'includes/images/MailChimp_Assets/Freddie_60px.png'; ?>" alt="<?php _e( 'Freddie - MailChimp Mascot' , 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-mc-freddie-logo" />
27
 
28
+ <h1>Easy Forms for MailChimp | <?php _e( 'Manage Forms' , 'yikes-inc-easy-mailchimp-extender' ) ?></h1>
29
 
30
  <!-- Settings Page Description -->
31
+ <p class="yikes-easy-mc-about-text about-text"><?php _e( 'Create and manage your MailChimp forms.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
32
 
33
  <!-- Action Notices -->
34
  <?php
35
 
36
  /* If the user hasn't authenticated yet, lets kill off */
37
  if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) != 'valid_api_key' ) {
38
+ wp_die( '<div class="error"><p>' . sprintf( __( 'You need to connect to MailChimp before you can start creating forms. Head over to the <a href="%s" title="Settings Page">Settings Page</a> and enter your API key.' , 'yikes-inc-easy-mailchimp-extender' ), esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings' ) ) ) . '</p></div>' , 500 );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  }
40
 
41
  /* Display our admin notices here */
158
  </td>
159
 
160
  <td class="column-columnname"><?php echo isset( $form['form_description'] ) ? str_replace( '[yikes-mailchimp-subscriber-count]', do_shortcode( '[yikes-mailchimp-subscriber-count form="' . $id . '"]' ), $form['form_description'] ) : ''; ?></td>
161
+ <td class="column-columnname">
162
+ <?php
163
+ if ( $list_data && count( $list_data ) > 0 ) {
164
+ $parsed = wp_list_pluck( $list_data, 'name', 'id' );
165
+ if ( isset( $parsed[ $form['list_id'] ] ) ) {
166
+ echo esc_textarea( $parsed[ $form['list_id'] ] );
167
+ } else {
168
+ echo '<strong>' . __( 'List Not Found', 'yikes-inc-easy-mailchimp-extender' ) . '</strong>';
169
+ }
170
+ } ?>
171
+ </td>
172
 
173
  <td class="column-columnname num stat-container">
174
  <?php
227
 
228
  <!-- sidebar -->
229
  <div id="postbox-container-1" class="postbox-container">
230
+
231
  <div class="meta-box-sortables">
232
+
233
  <div class="postbox yikes-easy-mc-postbox">
234
+
235
  <?php
236
+ $this->generate_manage_forms_sidebar( $list_data );
 
 
 
 
237
  ?>
238
+
239
  </div> <!-- .postbox -->
240
 
241
+ <?php
242
+ // display, show some love container
243
+ $this->generate_show_some_love_container();
244
+ ?>
245
+
246
  </div> <!-- .meta-box-sortables -->
247
+
248
  </div> <!-- #postbox-container-1 .postbox-container -->
249
+
250
  </div> <!-- #post-body .metabox-holder .columns-2 -->
251
 
252
  <br class="clear">
admin/partials/menu/manage-lists.php CHANGED
@@ -1,43 +1,28 @@
1
  <?php
2
- // lets confirm the user has a valid API key stored
3
- if( $this->is_user_mc_api_valid_form( false ) == 'valid' ) {
4
- /// Check for a transient, if not - set one up for one hour
5
- if ( false === ( $list_data = get_transient( 'yikes-easy-mailchimp-list-data' ) ) ) {
6
- $api_key = yikes_get_mc_api_key();
7
- $dash_position = strpos( $api_key, '-' );
8
- if( $dash_position !== false ) {
9
- $api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/list.json';
10
- }
11
- $list_data = wp_remote_post( $api_endpoint, array(
12
- 'body' => array(
13
- 'apikey' => $api_key,
14
- 'limit' => 100
15
- ),
16
- 'timeout' => 10,
17
- 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true )
18
- ) );
19
- $list_data = json_decode( wp_remote_retrieve_body( $list_data ), true );
20
- if( isset( $list_data['error'] ) ) {
21
- if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
22
- require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
23
- $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
24
- $error_logging->yikes_easy_mailchimp_write_to_error_log( $list_data['error'], __( "Get Account Lists" , 'yikes-inc-easy-mailchimp-extender' ), "Manage Lists Page" );
25
- }
26
- } else {
27
- // set our transient
28
- set_transient( 'yikes-easy-mailchimp-list-data', $list_data, 1 * HOUR_IN_SECONDS );
29
- }
30
- }
31
  }
 
 
 
32
  ?>
33
  <div class="wrap">
34
  <!-- Freddie Logo -->
35
  <img src="<?php echo YIKES_MC_URL . 'includes/images/MailChimp_Assets/Freddie_60px.png'; ?>" alt="<?php __( 'Freddie - MailChimp Mascot' , 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-mc-freddie-logo" />
36
 
37
- <h1>YIKES Easy Forms for MailChimp | <?php _e( 'Manage Mailing Lists' , 'yikes-inc-easy-mailchimp-extender' ); ?></h1>
38
 
39
  <!-- Settings Page Description -->
40
- <p class="yikes-easy-mc-about-text about-text"><?php _e( 'Make edits to your MailChimp lists on the following page. Select a list to make edits to it.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
41
 
42
  <?php
43
  /* If the user hasn't authenticated yet, lets kill off */
@@ -94,32 +79,33 @@
94
 
95
  <!-- TABLE BODY -->
96
  <tbody>
97
- <?php if( $list_data['total'] > 0 ) {
98
- $i = 1;
99
- foreach( $list_data['data'] as $list ) {
100
- ?>
101
- <tr class="<?php if( $i % 2 == 0 ) { echo 'alternate'; } ?>">
102
- <td class="column-columnname">
103
- <a href="<?php echo esc_url_raw( add_query_arg( array( 'list-id' => $list['id'] ) , admin_url( 'admin.php?page=yikes-mailchimp-view-list' ) ) ); ?>" class="row-title">
104
- <?php echo stripslashes( $list['name'] ); ?>
105
- </a>
106
- <div class="row-actions">
107
- <span><a href="<?php echo esc_url_raw( add_query_arg( array( 'list-id' => $list['id'] ) , admin_url( 'admin.php?page=yikes-mailchimp-view-list' ) ) ); ?>"><?php _e( "View" , 'yikes-inc-easy-mailchimp-extender' ); ?></a></span>
108
- <?php
109
- /*
110
- * Custom action to allow users to add additional action links
111
- * to each list. We use this in our add-ons.
112
- */
113
- do_action( 'yikes-mailchimp-manage-lists-actions', $list );
114
- ?>
115
- </div>
116
- </td>
117
- <td class="column-columnname num"><?php echo $list['stats']['member_count']; ?></td>
118
- </tr>
119
- <?php
120
  $i++;
121
  }
122
- } else { ?>
 
123
  <tr class="no-items">
124
  <td class="colspanchange no-mailchimp-lists-found" colspan="3"><em><?php printf( __( 'No MailChimp lists found. Head over to <a href="%s" title="MailChimp.com">MailChimp.com</a> to setup your first mailing list. Once thats done you can head back here to customize it!' , 'yikes-inc-easy-mailchimp-extender' ), esc_url( 'http://mailchimp.com/' ) ); ?></em></td>
125
  </tr>
1
  <?php
2
+ // lets confirm the user has a valid API key stored
3
+ if ( $this->is_user_mc_api_valid_form( false ) == 'valid' ) {
4
+ $list_data = yikes_get_mc_api_manager()->get_list_handler()->get_lists();
5
+ if ( is_wp_error( $list_data ) ) {
6
+ $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
7
+ $error_logging->maybe_write_to_log(
8
+ $list_data->get_error_code(),
9
+ __( "Get Account Lists", 'yikes-inc-easy-mailchimp-extender' ),
10
+ "Manage Lists Page"
11
+ );
12
+ $list_data = array();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  }
14
+ } else {
15
+ $list_data = array();
16
+ }
17
  ?>
18
  <div class="wrap">
19
  <!-- Freddie Logo -->
20
  <img src="<?php echo YIKES_MC_URL . 'includes/images/MailChimp_Assets/Freddie_60px.png'; ?>" alt="<?php __( 'Freddie - MailChimp Mascot' , 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-mc-freddie-logo" />
21
 
22
+ <h1>Easy Forms for MailChimp | <?php _e( 'Manage Mailing Lists' , 'yikes-inc-easy-mailchimp-extender' ); ?></h1>
23
 
24
  <!-- Settings Page Description -->
25
+ <p class="yikes-easy-mc-about-text about-text"><?php _e( 'Make edits to your MailChimp lists.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
26
 
27
  <?php
28
  /* If the user hasn't authenticated yet, lets kill off */
79
 
80
  <!-- TABLE BODY -->
81
  <tbody>
82
+ <?php if( count( $list_data ) > 0 ) {
83
+ $i = 1;
84
+ foreach( $list_data as $list ) {
85
+ ?>
86
+ <tr class="<?php if( $i % 2 == 0 ) { echo 'alternate'; } ?>">
87
+ <td class="column-columnname">
88
+ <a href="<?php echo esc_url_raw( add_query_arg( array( 'list-id' => $list['id'] ) , admin_url( 'admin.php?page=yikes-mailchimp-view-list' ) ) ); ?>" class="row-title">
89
+ <?php echo stripslashes( $list['name'] ); ?>
90
+ </a>
91
+ <div class="row-actions">
92
+ <span><a href="<?php echo esc_url_raw( add_query_arg( array( 'list-id' => $list['id'] ) , admin_url( 'admin.php?page=yikes-mailchimp-view-list' ) ) ); ?>"><?php _e( "View" , 'yikes-inc-easy-mailchimp-extender' ); ?></a></span>
93
+ <?php
94
+ /*
95
+ * Custom action to allow users to add additional action links
96
+ * to each list. We use this in our add-ons.
97
+ */
98
+ do_action( 'yikes-mailchimp-manage-lists-actions', $list );
99
+ ?>
100
+ </div>
101
+ </td>
102
+ <td class="column-columnname num"><?php echo $list['stats']['member_count']; ?></td>
103
+ </tr>
104
+ <?php
105
  $i++;
106
  }
107
+ } else {
108
+ ?>
109
  <tr class="no-items">
110
  <td class="colspanchange no-mailchimp-lists-found" colspan="3"><em><?php printf( __( 'No MailChimp lists found. Head over to <a href="%s" title="MailChimp.com">MailChimp.com</a> to setup your first mailing list. Once thats done you can head back here to customize it!' , 'yikes-inc-easy-mailchimp-extender' ), esc_url( 'http://mailchimp.com/' ) ); ?></em></td>
111
  </tr>
admin/partials/menu/options-sections/api-cache-settings.php CHANGED
@@ -11,11 +11,11 @@
11
 
12
  <p><?php _e( "Delete all MailChimp data stored in your sites cache. Most data is stored in the cache for 1 hour." , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
13
  <!-- check if any of our transients contain data -->
14
- <?php if ( false === get_transient( 'yikes-easy-mailchimp-list-data' ) && false === get_transient( 'yikes-easy-mailchimp-profile-data' ) && false === get_transient( 'yikes-easy-mailchimp-account-data' ) ) { ?>
15
  <p><a href="#" class="button-secondary" disabled="disabled" title="<?php _e( 'No MailChimp data found in temporary cache storage.' , 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'Clear MailChimp API Cache' , 'yikes-inc-easy-mailchimp-extender' ); ?></a></p>
16
  <?php } else { ?>
17
  <p><input type="submit" class="button-primary" value="<?php _e( 'Clear MailChimp API Cache' , 'yikes-inc-easy-mailchimp-extender' ); ?>" /></p>
18
  <?php } ?>
19
 
20
  </form>
21
- </div> <!-- .inside -->
11
 
12
  <p><?php _e( "Delete all MailChimp data stored in your sites cache. Most data is stored in the cache for 1 hour." , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
13
  <!-- check if any of our transients contain data -->
14
+ <?php if ( false === get_transient( 'yikes-easy-mailchimp-list-data' ) && false === get_transient( 'yikes-easy-mailchimp-profile-data' ) && false === get_transient( 'yikes-easy-mailchimp-account-data' ) && false === get_transient( 'yikesinc_eme_list_ids' ) && false === get_transient( 'yikes_eme_lists' ) ) { ?>
15
  <p><a href="#" class="button-secondary" disabled="disabled" title="<?php _e( 'No MailChimp data found in temporary cache storage.' , 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'Clear MailChimp API Cache' , 'yikes-inc-easy-mailchimp-extender' ); ?></a></p>
16
  <?php } else { ?>
17
  <p><input type="submit" class="button-primary" value="<?php _e( 'Clear MailChimp API Cache' , 'yikes-inc-easy-mailchimp-extender' ); ?>" /></p>
18
  <?php } ?>
19
 
20
  </form>
21
+ </div> <!-- .inside -->
admin/partials/menu/options-sections/integration-settings.php CHANGED
@@ -80,51 +80,33 @@
80
 
81
 
82
  <?php
83
- // lets confirm the user has a valid API key stored
84
- if( $this->is_user_mc_api_valid_form( false ) == 'valid' ) {
85
- /// Check for a transient, if not - set one up for one hour
86
- if ( false === ( $list_data = get_transient( 'yikes-easy-mailchimp-list-data' ) ) ) {
87
- $api_key = yikes_get_mc_api_key();
88
- $dash_position = strpos( $api_key, '-' );
89
- if( $dash_position !== false ) {
90
- $api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/list.json';
91
- }
92
- $list_data = wp_remote_post( $api_endpoint, array(
93
- 'body' => array(
94
- 'apikey' => $api_key,
95
- 'limit' => 100
96
- ),
97
- 'timeout' => 10,
98
- 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true )
99
- ) );
100
- $list_data = json_decode( wp_remote_retrieve_body( $list_data ), true );
101
- if( isset( $list_data['error'] ) ) {
102
- if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
103
- require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
104
- $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
105
- $error_logging->yikes_easy_mailchimp_write_to_error_log( $list_data['error'], __( "Get Account Lists" , 'yikes-inc-easy-mailchimp-extender' ), "Integration Settings Page" );
106
- }
107
- } else {
108
- // set our transient
109
- set_transient( 'yikes-easy-mailchimp-list-data', $list_data, 1 * HOUR_IN_SECONDS );
110
- }
111
- }
112
- } else {
113
- ?>
114
- <div class="inside">
115
- <?php
116
- echo sprintf( __( 'Please %s to setup your integrations.', 'yikes-inc-easy-mailchimp-extender' ), '<a href="' . esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=general-settings' ) ) . '" title="' . __( 'General Settings' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'enter a valid MailChimp API key' , 'yikes-inc-easy-mailchimp-extender' ) . '</a>' );
117
- ?>
118
- </div>
119
- <?php
120
- return;
121
  }
 
 
 
 
 
 
 
 
 
 
122
  ?>
123
 
124
  <div class="inside">
125
 
126
  <p>
127
- <?php _e( 'Select which plugins or features Easy Forms for MailChimp by Yikes Inc. should integrate with. Depending on which plugins or features you choose to integrate with, an opt-in checkbox will be generated. For example, the comment form checkbox will generate a checkbox below the standard WordPress comment form to add any new commenters to a pre-determined MailChimp mailing list.' , 'yikes-inc-easy-mailchimp-extender' ); ?>
128
  </p>
129
 
130
  <!-- Settings Form -->
@@ -159,14 +141,17 @@
159
  <!-- checkbox associated list -->
160
  <label><?php _e( 'Associated List' , 'yikes-inc-easy-mailchimp-extender' ); ?>
161
  <?php
162
- if( $list_data['total'] > 0 ) {
163
  ?>
164
- <select class="optin-checkbox-init[<?php echo $class; ?>][associated-list] checkbox-settings-list-dropdown" data-attr-integration="<?php echo $class; ?>" name="optin-checkbox-init[<?php echo $class; ?>][associated-list]" onchange="checkForInterestGroups( jQuery( this ), jQuery( this ).find( 'option:selected' ).val(), jQuery( this ).attr( 'data-attr-integration' ) );return false;">
165
- <option value="-" <?php selected( $selected_list , '-' ); ?>><?php _e( 'Select a List' , 'yikes-inc-easy-mailchimp-extender' ); ?></option>
166
- <?php foreach( $list_data['data'] as $list ) { ?>
167
- <option value="<?php echo $list['id']; ?>" <?php selected( $selected_list , $list['id'] ); ?>><?php echo $list['name']; ?></option>
168
- <?php } ?>
169
- </select>
 
 
 
170
  <?php
171
  } else {
172
  echo '<p class="description no-lists-setup-notice"><strong>' . __( 'You have not setup any lists. You should head over to MailChimp and setup your first list.' , 'yikes-inc-easy-mailchimp-extender' ) . '</strong></p>';
80
 
81
 
82
  <?php
83
+ // lets confirm the user has a valid API key stored
84
+ if ( $this->is_user_mc_api_valid_form( false ) == 'valid' ) {
85
+ $list_data = yikes_get_mc_api_manager()->get_list_handler()->get_lists();
86
+ if ( is_wp_error( $list_data ) ) {
87
+ $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
88
+ $error_logging->maybe_write_to_log(
89
+ $list_data->get_error_code(),
90
+ __( "Get Account Lists" , 'yikes-inc-easy-mailchimp-extender' ),
91
+ "Integration Settings Page"
92
+ );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
  }
94
+ } else {
95
+ ?>
96
+ <div class="inside">
97
+ <?php
98
+ echo sprintf( __( 'Please %s to setup your integrations.', 'yikes-inc-easy-mailchimp-extender' ), '<a href="' . esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=general-settings' ) ) . '" title="' . __( 'General Settings' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'enter a valid MailChimp API key' , 'yikes-inc-easy-mailchimp-extender' ) . '</a>' );
99
+ ?>
100
+ </div>
101
+ <?php
102
+ return;
103
+ }
104
  ?>
105
 
106
  <div class="inside">
107
 
108
  <p>
109
+ <?php _e( 'Select which plugins or features Easy Forms for MailChimp should integrate with. Depending on which plugins or features you choose to integrate with, an opt-in checkbox will be generated. For example, the comment form checkbox will generate a checkbox below the standard WordPress comment form to add any new commenters to a pre-determined MailChimp mailing list.' , 'yikes-inc-easy-mailchimp-extender' ); ?>
110
  </p>
111
 
112
  <!-- Settings Form -->
141
  <!-- checkbox associated list -->
142
  <label><?php _e( 'Associated List' , 'yikes-inc-easy-mailchimp-extender' ); ?>
143
  <?php
144
+ if ( count( $list_data ) > 0 ) {
145
  ?>
146
+ <select class="optin-checkbox-init[<?php echo $class; ?>][associated-list] checkbox-settings-list-dropdown"
147
+ data-attr-integration="<?php echo $class; ?>"
148
+ name="optin-checkbox-init[<?php echo $class; ?>][associated-list]"
149
+ onchange="checkForInterestGroups( jQuery( this ), jQuery( this ).find( 'option:selected' ).val(), jQuery( this ).attr( 'data-attr-integration' ) );return false;">
150
+ <option value="-" <?php selected( $selected_list , '-' ); ?>><?php _e( 'Select a List' , 'yikes-inc-easy-mailchimp-extender' ); ?></option>
151
+ <?php foreach( $list_data as $list ) { ?>
152
+ <option value="<?php echo $list['id']; ?>" <?php selected( $selected_list , $list['id'] ); ?>><?php echo $list['name']; ?></option>
153
+ <?php } ?>
154
+ </select>
155
  <?php
156
  } else {
157
  echo '<p class="description no-lists-setup-notice"><strong>' . __( 'You have not setup any lists. You should head over to MailChimp and setup your first list.' , 'yikes-inc-easy-mailchimp-extender' ) . '</strong></p>';
admin/partials/menu/options-sections/templates/integration-interest-groups.php CHANGED
@@ -1,81 +1,76 @@
1
  <?php
2
 
3
- // print_r( $interest_groupings );
4
-
5
- $integration_options = get_option( 'optin-checkbox-init' , '' );
6
-
7
- // print_r( $integration_options );
8
-
9
- // confirm interest groups are set, else bail
10
-
11
- /*
12
- * Confirm the interest groups is an array and not empty or else bail
13
- */
14
- if( isset( $interest_groupings['error'] ) ) {
15
- echo '<p class="description no-interest-groupings-enabled-message">' . $interest_groupings['error'] . '</p>';
16
- return;
17
- }
18
 
19
  ?>
20
  <br />
21
  <p class="description"><?php _e( 'It looks like we found some interest groups! Pre-select interest groups for this integration below.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
22
- <p class="description"><?php _e( 'note: the interest groups will not show up on the front end for your users to select from.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
23
  <?php
24
 
25
  /*
26
  * Loop over interest groups
27
  */
28
- foreach( $interest_groupings as $interest_group ) {
29
-
30
- $interest_group_id = $interest_group['id'];
31
- $interest_group_type = ( isset( $interest_group['form_field'] ) ) ? $interest_group['form_field'] : '';
32
- $interest_groups_fields = ( isset( $interest_group['groups'] ) ) ? $interest_group['groups'] : false; // if not set return false
33
- $selected_interest_groups = ( isset( $integration_options[$integration_type]['interest-groups'] ) ) ? $integration_options[$integration_type]['interest-groups'] : array();
34
  ?>
35
  <section class="interest-group-section">
36
- <strong class="interest-group-section-title"><?php echo ucwords( $interest_group['name'] ); ?></strong>
37
  <?php
38
  /*
39
  * Loop over the interest group types, and return the appropriate type
40
- */
 
41
  switch( $interest_group_type ) {
42
 
43
  default:
44
  case 'hidden':
45
  case 'checkboxes':
46
- if( $interest_groups_fields ) {
47
- foreach( $interest_groups_fields as $field ) {
 
 
48
  ?>
49
- <label>
50
- <input type="checkbox" name="optin-checkbox-init[<?php echo $integration_type; ?>][interest-groups][<?php echo $interest_group_id; ?>][]" value="<?php echo $field['name']; ?>" <?php if( isset( $selected_interest_groups[$interest_group_id] ) ) { if( in_array( $field['name'], $selected_interest_groups[$interest_group_id] ) ) { ?> checked="checked" <?php } } ?>>
51
- <?php echo $field['name']; ?>
52
- </label>
 
 
53
  <?php
54
- }
55
  }
56
  break;
57
 
58
  case 'radio':
59
- if( $interest_groups_fields ) {
60
- $x = 1; // used to decide which is pre-checked
61
- foreach( $interest_groups_fields as $field ) {
 
62
  ?>
63
- <label>
64
- <input type="radio" name="optin-checkbox-init[<?php echo $integration_type; ?>][interest-groups][<?php echo $interest_group_id; ?>][]" value="<?php echo $field['name']; ?>" <?php if( isset( $selected_interest_groups[$interest_group_id] ) ) { if( in_array( $field['name'], $selected_interest_groups[$interest_group_id] ) ) { ?> checked="checked" <?php } } elseif( $x == 1 ) { ?> checked="checked" <?php }?>>
65
- <?php echo $field['name']; ?>
66
- </label>
 
 
67
  <?php
68
- $x++;
69
- }
70
  }
 
71
  break;
72
 
73
  case 'dropdown':
74
- if( $interest_groups_fields ) {
75
- ?><select name="optin-checkbox-init[<?php echo $integration_type; ?>][interest-groups][<?php echo $interest_group_id; ?>][]"><?php
76
- foreach( $interest_groups_fields as $field ) {
77
  ?>
78
- <option value="<?php echo $field['name']; ?>" <?php if( isset( $selected_interest_groups[$interest_group_id] ) ) { if( in_array( $field['name'], $selected_interest_groups[$interest_group_id] ) ) { ?> selected="selected" <?php } } ?>>
 
 
 
 
 
 
79
  <?php echo $field['name']; ?>
80
  </option>
81
  <?php
@@ -90,5 +85,3 @@ foreach( $interest_groupings as $interest_group ) {
90
  </section>
91
  <?php
92
  }
93
-
94
- ?>
1
  <?php
2
 
3
+ $integration_options = get_option( 'optin-checkbox-init' , '' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
 
5
  ?>
6
  <br />
7
  <p class="description"><?php _e( 'It looks like we found some interest groups! Pre-select interest groups for this integration below.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
8
+ <p class="description"><?php _e( '<strong>Note:</strong> the interest groups will not show up on the front end for your users to select from.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
9
  <?php
10
 
11
  /*
12
  * Loop over interest groups
13
  */
14
+ foreach( $interest_groupings as $id => $interest_group ) {
15
+
16
+ $interest_group_type = isset( $interest_group['type'] ) ? $interest_group['type'] : '';
17
+ $interest_groups_fields = isset( $interest_group['items'] ) ? $interest_group['items'] : array();
18
+ $selected_interest_groups = isset( $integration_options[ $integration_type ]['interest-groups'] ) ? $integration_options[ $integration_type ]['interest-groups'] : array();
 
19
  ?>
20
  <section class="interest-group-section">
21
+ <strong class="interest-group-section-title"><?php echo ucwords( $interest_group['title'] ); ?></strong>
22
  <?php
23
  /*
24
  * Loop over the interest group types, and return the appropriate type
25
+ */
26
+ $checked = $selected = '';
27
  switch( $interest_group_type ) {
28
 
29
  default:
30
  case 'hidden':
31
  case 'checkboxes':
32
+ foreach( $interest_groups_fields as $field_id => $field ) {
33
+ if ( isset( $selected_interest_groups[ $id ] ) ) {
34
+ $checked = checked( true, in_array( $field_id, $selected_interest_groups[ $id ] ), false );
35
+ }
36
  ?>
37
+ <label>
38
+ <input type="checkbox"
39
+ name="optin-checkbox-init[<?php echo $integration_type; ?>][interest-groups][<?php echo $id; ?>][]"
40
+ value="<?php echo $field_id; ?>" <?php echo $checked ?>>
41
+ <?php echo $field['name']; ?>
42
+ </label>
43
  <?php
 
44
  }
45
  break;
46
 
47
  case 'radio':
48
+ foreach ( $interest_groups_fields as $field_id => $field ) {
49
+ if ( isset( $selected_interest_groups[ $id ] ) ) {
50
+ $checked = checked( true, in_array( $field_id, $selected_interest_groups[ $id ] ), false );
51
+ }
52
  ?>
53
+ <label>
54
+ <input type="radio"
55
+ name="optin-checkbox-init[<?php echo $integration_type; ?>][interest-groups][<?php echo $id; ?>][]"
56
+ value="<?php echo $field_id; ?>" <?php echo $checked; ?>>
57
+ <?php echo $field['name']; ?>
58
+ </label>
59
  <?php
 
 
60
  }
61
+
62
  break;
63
 
64
  case 'dropdown':
65
+ if ( ! empty( $interest_groups_fields ) ) {
 
 
66
  ?>
67
+ <select name="optin-checkbox-init[<?php echo $integration_type; ?>][interest-groups][<?php echo $id; ?>][]">
68
+ <?php foreach( $interest_groups_fields as $field_id => $field ) {
69
+ if ( isset( $selected_interest_groups[ $id ] ) ) {
70
+ $selected = selected( true, in_array( $field_id, $selected_interest_groups[ $id ] ), false );
71
+ }
72
+ ?>
73
+ <option value="<?php echo $field_id; ?>" <?php echo $selected; ?>>
74
  <?php echo $field['name']; ?>
75
  </option>
76
  <?php
85
  </section>
86
  <?php
87
  }
 
 
admin/partials/menu/options.php CHANGED
@@ -34,10 +34,10 @@
34
  <!-- Freddie Logo -->
35
  <img src="<?php echo YIKES_MC_URL . 'includes/images/MailChimp_Assets/Freddie_60px.png'; ?>" alt="<?php _e( 'Freddie - MailChimp Mascot' , 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-mc-freddie-logo" />
36
 
37
- <h1>YIKES Easy Forms for MailChimp | <?php if ( isset( $_REQUEST['section'] ) ) { echo ucwords( str_replace( '-', ' ', $_REQUEST['section'] ) ); } else { echo __( 'General Settings' , 'yikes-inc-easy-mailchimp-extender' ); } ?></h1>
38
 
39
  <!-- Settings Page Description -->
40
- <p class="yikes-easy-mc-about-text about-text"><?php _e( 'Easy Forms for MailChimp allows you to painlessly add MailChimp sign up forms to your WordPress site and track user activity with interactive reports.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
41
  <?php
42
  /* Success Messages on Options Updated */
43
  if( isset( $_REQUEST['settings-updated'] ) && $_REQUEST['settings-updated'] == 'true' ) {
34
  <!-- Freddie Logo -->
35
  <img src="<?php echo YIKES_MC_URL . 'includes/images/MailChimp_Assets/Freddie_60px.png'; ?>" alt="<?php _e( 'Freddie - MailChimp Mascot' , 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-mc-freddie-logo" />
36
 
37
+ <h1>Easy Forms for MailChimp | <?php if ( isset( $_REQUEST['section'] ) ) { echo ucwords( str_replace( '-', ' ', $_REQUEST['section'] ) ); } else { echo __( 'General Settings' , 'yikes-inc-easy-mailchimp-extender' ); } ?></h1>
38
 
39
  <!-- Settings Page Description -->
40
+ <p class="yikes-easy-mc-about-text about-text"><?php _e( 'Manage the overall settings for Easy forms for MailChimp.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
41
  <?php
42
  /* Success Messages on Options Updated */
43
  if( isset( $_REQUEST['settings-updated'] ) && $_REQUEST['settings-updated'] == 'true' ) {
admin/partials/menu/support.php CHANGED
@@ -8,39 +8,27 @@
8
  ?>
9
  <div class="wrap yikes-easy-mc-support-wrap">
10
 
11
- <div id="yikes-mailchimp-logo" class="support-page"></div>
12
-
13
- <h1><?php _e( 'Support' , 'yikes-inc-easy-mailchimp-extender' ); ?></h1>
14
- <strong><?php _e( "You've got questions? We have answers!" , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
 
 
 
15
  <?php if( get_option( 'yikes-easy-mc-active-addons' , array() ) == array() ) { ?>
16
- <p><?php _e( 'Users of the free version of YIKES Inc. Easy Forms for MailChimp are limited to two methods of support. We respond to support requests for the free version of the plugin once a week.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
17
- <p><?php printf( __( 'Purchasers of our paid add-ons qualify for premium support, <a href="%s" target="_blank" title="' . __( 'check them out', 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'check them out', 'yikes-inc-easy-mailchimp-extender' ) . '</a>!' , 'yikes-inc-easy-mailchimp-extender' ), esc_url( 'https://yikesplugins.com/' ) ); ?></p>
18
  <?php } else { ?>
19
  <p><?php _e( "It looks like you are one of our premium users! Fill out the form below to submit a priority support request." , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
20
  <p><?php _e( "If you have any problems with the form, send an email to <a href='mailto:support@yikesinc.com'>support@yikesinc.com</a> and a ticket will be created." , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
21
  <?php } ?>
22
 
23
- <p><?php printf( __( 'Before submitting a support request, visit our %s.' , 'yikes-inc-easy-mailchimp-extender' ), '<a target="_blank" href="' . esc_url( 'https://yikesplugins.com/support/knowledge-base/product/easy-forms-for-mailchimp/' ) . '" title="' . __( 'Knowledge Base', 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'knowledge base', 'yikes-inc-easy-mailchimp-extender' ) . '</a> where we have step-by-step guides and troubleshooting help.' ); ?></p>
24
 
25
  <hr />
26
 
27
  <div id="col-container" class="free-support-container">
28
 
29
- <div id="col-right">
30
-
31
- <div class="col-wrap">
32
- <h1><span class="github-octocat"></span><?php _e( 'Github Issue Tracker' , 'yikes-inc-easy-mailchimp-extender' ); ?></h1>
33
- <div class="inside">
34
- <p><?php _e( 'The fastest way to receive free support is to submit a new issue to our GitHub issue tracker. ', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
35
- <img class="support-page-logo" src="<?php echo YIKES_MC_URL; ?>includes/images/Support_Page/github-issue-screenshot.png" title="<?php esc_attr_e( 'Github Issue Tracker Screenshot' , 'yikes-inc-easy-mailchimp-extender' ); ?>" >
36
- <a href="https://github.com/yikesinc/yikes-inc-easy-mailchimp-extender/issues" target="_blank" class="button-secondary support-page-button"><?php _e( 'Submit New github.org Issue', 'yikes-inc-easy-mailchimp-extender' ); ?></a>
37
- </div>
38
- </div>
39
- <!-- /col-wrap -->
40
-
41
- </div>
42
- <!-- /col-right -->
43
-
44
  <div id="col-left">
45
 
46
  <div class="col-wrap">
@@ -48,7 +36,7 @@
48
  <div class="inside">
49
  <p><?php _e( 'Use your WordPress.org username to submit support requests on the WordPress Directory support forum.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
50
  <img class="support-page-logo" src="<?php echo YIKES_MC_URL; ?>includes/images/Support_Page/wordpress-issue-screenshot.png" title="<?php esc_attr_e( 'WordPress.org Issue Tracker Screenshot' , 'yikes-inc-easy-mailchimp-extender' ); ?>" >
51
- <a href="https://wordpress.org/support/plugin/yikes-inc-easy-mailchimp-extender" target="_blank" class="button-secondary support-page-button"><?php _e( 'Submit New WordPress.org Support Request', 'yikes-inc-easy-mailchimp-extender' ); ?></a>
52
  </div>
53
  </div>
54
  <!-- /col-wrap -->
8
  ?>
9
  <div class="wrap yikes-easy-mc-support-wrap">
10
 
11
+ <!-- Freddie Logo -->
12
+ <img src="<?php echo YIKES_MC_URL . 'includes/images/MailChimp_Assets/Freddie_60px.png'; ?>" alt="<?php _e( 'Freddie - MailChimp Mascot' , 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-mc-freddie-logo" />
13
+
14
+ <h1>Easy Forms for MailChimp | <?php _e( 'Support' , 'yikes-inc-easy-mailchimp-extender' ); ?></h1>
15
+ <!-- Support Page Description -->
16
+ <p class="yikes-easy-mc-about-text about-text"><?php _e( 'If you have questions, we have answers!' , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
17
+
18
  <?php if( get_option( 'yikes-easy-mc-active-addons' , array() ) == array() ) { ?>
19
+ <p><?php _e( 'Users of the free version of Easy Forms for MailChimp can post questions to our support forum on the WordPress Plugin Directory. We aim to respond to support requests for the free version of the plugin within a week.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
20
+ <p><?php printf( __( 'Purchasers of our paid add-ons qualify for premium support. <a href="%s" target="_blank" title="' . __( 'Check out our paid add-ons', 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Check out our paid add-ons', 'yikes-inc-easy-mailchimp-extender' ) . '</a>!' , 'yikes-inc-easy-mailchimp-extender' ), esc_url( 'https://yikesplugins.com/' ) ); ?></p>
21
  <?php } else { ?>
22
  <p><?php _e( "It looks like you are one of our premium users! Fill out the form below to submit a priority support request." , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
23
  <p><?php _e( "If you have any problems with the form, send an email to <a href='mailto:support@yikesinc.com'>support@yikesinc.com</a> and a ticket will be created." , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
24
  <?php } ?>
25
 
26
+ <p><?php printf( __( 'Before submitting a support request, please visit our %s.' , 'yikes-inc-easy-mailchimp-extender' ), '<a target="_blank" href="' . esc_url( 'https://yikesplugins.com/support/knowledge-base/product/easy-forms-for-mailchimp/' ) . '" title="' . __( 'Knowledge Base', 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'knowledge base', 'yikes-inc-easy-mailchimp-extender' ) . '</a> where we have step-by-step guides and troubleshooting help' ); ?></p>
27
 
28
  <hr />
29
 
30
  <div id="col-container" class="free-support-container">
31
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  <div id="col-left">
33
 
34
  <div class="col-wrap">
36
  <div class="inside">
37
  <p><?php _e( 'Use your WordPress.org username to submit support requests on the WordPress Directory support forum.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
38
  <img class="support-page-logo" src="<?php echo YIKES_MC_URL; ?>includes/images/Support_Page/wordpress-issue-screenshot.png" title="<?php esc_attr_e( 'WordPress.org Issue Tracker Screenshot' , 'yikes-inc-easy-mailchimp-extender' ); ?>" >
39
+ <a href="https://wordpress.org/support/plugin/yikes-inc-easy-mailchimp-extender" target="_blank" class="button-secondary support-page-button"><?php _e( 'Submit a New WordPress.org Support Request', 'yikes-inc-easy-mailchimp-extender' ); ?></a>
40
  </div>
41
  </div>
42
  <!-- /col-wrap -->
admin/partials/upgrade-helpers/upgrade-migrate-options.php CHANGED
@@ -5,7 +5,7 @@
5
  * Helper File , called inside class-yikes-inc-easy-mailchimp-extender-admin.php ( migrate_old_yks_mc_options() )
6
  * @since v6.0
7
  * @Author: Yikes Inc.
8
- * @Contact: http://www.yikesinc.com/
9
  */
10
 
11
  // enqueue the styles for our migration page..
@@ -18,8 +18,11 @@
18
  $global_error_messages = array(
19
  'success' => __( $old_plugin_options['single-optin-message'] , 'yikes-inc-easy-mailchimp-extender' ),
20
  'general-error' => __( "Whoops! It looks like something went wrong. Please try again." , 'yikes-inc-easy-mailchimp-extender' ),
21
- 'invalid-email' => __( "Please provide a valid email address." , 'yikes-inc-easy-mailchimp-extender' ),
22
- 'email-exists-error' => __( "The provided email is already subscribed to this list." , 'yikes-inc-easy-mailchimp-extender' )
 
 
 
23
  );
24
 
25
  // if old options are defined...
5
  * Helper File , called inside class-yikes-inc-easy-mailchimp-extender-admin.php ( migrate_old_yks_mc_options() )
6
  * @since v6.0
7
  * @Author: Yikes Inc.
8
+ * @Contact: https://www.yikesplugins.com/
9
  */
10
 
11
  // enqueue the styles for our migration page..
18
  $global_error_messages = array(
19
  'success' => __( $old_plugin_options['single-optin-message'] , 'yikes-inc-easy-mailchimp-extender' ),
20
  'general-error' => __( "Whoops! It looks like something went wrong. Please try again." , 'yikes-inc-easy-mailchimp-extender' ),
21
+ 'email-exists-error' => __( "The email you entered is already a subscriber to this list." , 'yikes-inc-easy-mailchimp-extender' ),
22
+ 'success-single-optin' => __( 'Thank you for subscribing!' , 'yikes-inc-easy-mailchimp-extender' ),
23
+ 'success-resubscribed' => __( 'Thank you for already being a subscriber! Your profile info has been updated.', 'yikes-inc-easy-mailchimp-extender' ),
24
+ 'update-link' => __( "To update your MailChimp profile, please [link]click to send yourself an update link[/link].", 'yikes-inc-easy-mailchimp-extender' ),
25
+ 'email-subject' => __( 'MailChimp Profile Update', 'yikes-inc-easy-mailchimp-extender' ),
26
  );
27
 
28
  // if old options are defined...
admin/partials/view-list.php CHANGED
@@ -1,147 +1,91 @@
1
  <?php
2
- if( isset( $_REQUEST['list-id'] ) ) {
3
- $list_id = sanitize_key( $_REQUEST['list-id'] );
4
- $api_key = yikes_get_mc_api_key();
5
- $dash_position = strpos( $api_key, '-' );
6
- if( $dash_position !== false ) {
7
- $api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/list.json';
8
- }
9
- $list_data = wp_remote_post( $api_endpoint, array(
10
- 'body' => array(
11
- 'apikey' => $api_key,
12
- 'filters' => array( 'list_id' => $list_id ),
13
- ),
14
- 'timeout' => 10,
15
- 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true ),
16
- ) );
17
- $list_data = json_decode( wp_remote_retrieve_body( $list_data ), true );
18
- if( isset( $list_data['error'] ) ) {
19
- if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
20
- require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
21
- $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
22
- $error_logging->yikes_easy_mailchimp_write_to_error_log( $list_data['error'], __( "Get Account Lists" , 'yikes-inc-easy-mailchimp-extender' ), "View Lists Page" );
23
- }
24
- }
25
- // reset our data so we can easily use it
26
- $list_data = $list_data['data'][0];
27
-
28
- if( $dash_position !== false ) {
29
- $api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/merge-vars.json';
30
- }
31
- $merge_variables = wp_remote_post( $api_endpoint, array(
32
- 'body' => array(
33
- 'apikey' => $api_key,
34
- 'id' => array( $list_id ) ,
35
- ),
36
- 'timeout' => 10,
37
- 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true ),
38
- ) );
39
- $merge_variables = json_decode( wp_remote_retrieve_body( $merge_variables ), true );
40
- if( isset( $merge_variables['error'] ) ) {
41
- if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
42
- require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
43
- $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
44
- $error_logging->yikes_easy_mailchimp_write_to_error_log( $merge_variables['error'], __( "Get Merge Variables" , 'yikes-inc-easy-mailchimp-extender' ), "View Lists Page" );
45
- }
46
- }
47
- // re-store our data
48
- $merge_variables = $merge_variables['data'][0]['merge_vars'];
49
-
50
- // get the interest group data
51
- if( $dash_position !== false ) {
52
- $api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/interest-groupings.json';
53
- }
54
- $interest_groupings = wp_remote_post( $api_endpoint, array(
55
- 'body' => array(
56
- 'apikey' => $api_key,
57
- 'id' => $list_id,
58
- 'counts' => true
59
- ),
60
- 'timeout' => 10,
61
- 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true ),
62
- ) );
63
- $interest_groupings = json_decode( wp_remote_retrieve_body( $interest_groupings ), true );
64
-
65
- if( isset( $interest_groupings['error'] ) ) {
66
- if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
67
- require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
68
- $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
69
- $error_logging->yikes_easy_mailchimp_write_to_error_log( $interest_groupings['error'], __( "Get Interest Groups" , 'yikes-inc-easy-mailchimp-extender' ), "View Lists Page" );
70
- }
71
- }
72
-
73
- $no_interest_groupings = '<p class="description">' . __( 'Interest groups are not enabled for this list.', 'yikes-inc-easy-mailchimp-extender' ) . '</p>';
74
-
75
-
76
- $no_segments = __( 'No segments set up for this list.' , 'yikes-inc-easy-mailchimp-extender' );
77
- // get the segment data
78
- if( $dash_position !== false ) {
79
- $api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/segments.json';
80
- }
81
- $segments = wp_remote_post( $api_endpoint, array(
82
- 'body' => array(
83
- 'apikey' => $api_key,
84
- 'id' => $list_id,
85
- 'type' => 'saved'
86
- ),
87
- 'timeout' => 10,
88
- 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true ),
89
- ) );
90
-
91
-
92
- // setup pagination variables
93
- $paged = isset( $_REQUEST['paged'] ) ? $_REQUEST['paged'] : '0';
94
-
95
- $limit = apply_filters( 'yikes_admin_list_subscriber_limit' , '20' );
96
-
97
- $sort_dir = isset( $_REQUEST['sort'] ) ? $_REQUEST['sort'] : 'DESC';
98
- $column = isset( $_REQUEST['column'] ) ? $_REQUEST['column'] : 'optin_time';
99
-
100
- if( $sort_dir == 'DESC' ) {
101
- $opposite_sort_dir = 'ASC';
102
- $icon = '<span class="dashicons dashicons-arrow-down"></span>';
103
- } else {
104
- $opposite_sort_dir = 'DESC';
105
- $icon = '<span class="dashicons dashicons-arrow-up"></span>';
106
- }
107
-
108
- if( !isset( $_REQUEST['sort'] ) ) {
109
- $icon = '';
110
- }
111
-
112
- // get all subscribed members
113
- if( $dash_position !== false ) {
114
- $api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/members.json';
115
- }
116
- $subscribers_list = wp_remote_post( $api_endpoint, array(
117
- 'body' => array(
118
- 'apikey' => $api_key,
119
- 'id' => $list_id,
120
- 'opts' => array(
121
- 'start' => $paged,
122
- 'limit' => $limit,
123
- 'sort_field' => $column,
124
- 'sort_dir' => $sort_dir
125
- )
126
- ),
127
- 'timeout' => 10,
128
- 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true ),
129
- ) );
130
- $subscribers_list = json_decode( wp_remote_retrieve_body( $subscribers_list ), true );
131
- if( isset( $subscribers_list['error'] ) ) {
132
- if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
133
- require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
134
- $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
135
- $error_logging->yikes_easy_mailchimp_write_to_error_log( $subscribers_list['error'], __( "Get Subscriber Count" , 'yikes-inc-easy-mailchimp-extender' ), "View Lists Page" );
136
- }
137
- }
138
-
139
- $total_pages = ceil( $subscribers_list['total'] / $limit );
140
- if( $total_pages == 0 ) {
141
- $total_pages = '1';
142
- }
143
-
144
- }
145
 
146
  ?>
147
  <div class="wrap">
@@ -177,7 +121,7 @@
177
  <h4><?php _e( 'Add New Subscriber' , 'yikes-inc-easy-mailchimp-extender' ); ?></h4>
178
  <form id="add-new-subcscriber">
179
  <input type="text" class="regular-text" placeholder="<?php _e( 'User Email Address' , 'yikes-inc-easy-mailchimp-extender' ); ?>" /></p>
180
- <p><?php echo submit_button( 'Add Subscriber' ); ?></p>
181
  </form>
182
  </section>
183
 
@@ -215,37 +159,39 @@
215
 
216
  <!-- TABLE BODY -->
217
  <tbody>
218
- <?php if( $subscribers_list['total'] > 0 ) {
219
- $i = 1;
220
- foreach( $subscribers_list['data'] as $subscriber ) {
221
- $user_id = $subscriber['leid'];
222
- // setup the email client name and icon
223
- if( !empty( $subscriber['clients'] ) ) {
224
- $user_email_client_name = $subscriber['clients']['name'];
225
- $user_email_client_icon = "<img src='" . esc_url_raw( $subscriber['clients']['icon_url'] ) . "' alt=" . $user_email_client_name . " title=" . $user_email_client_name . ">";
226
- } else {
227
- $path = YIKES_MC_URL . "includes/images/na.png";
228
- $user_email_client_icon = "<img width='35' src='" . $path . "' alt='" . __( 'not set' , 'yikes-inc-easy-mailchimp-extender' ) . "' title='" . __( 'not set' , 'yikes-inc-easy-mailchimp-extender' ) . "'>";
229
- }
230
-
231
- ?>
232
- <tr class="<?php if( $i % 2 == 0 ) { echo 'alternate'; } ?>">
233
- <td class="column-columnname">
234
- <a class="user-email row-title" href="mailto:<?php echo sanitize_email( $subscriber['email'] ); ?>">
235
- <?php echo sanitize_email( $subscriber['email'] ); ?>
236
- </a>
237
- <div class="row-actions">
238
- <?php $view_user_info_url = esc_url_raw( add_query_arg( array( 'mailchimp-list' => $list_id , 'email-id' => $user_id ), admin_url() . 'admin.php?page=yikes-mailchimp-view-user' ) ); ?>
239
- <span><a href="<?php echo $view_user_info_url; ?>"><?php _e( "View Info." , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |</span>
240
- <?php $url = esc_url_raw( add_query_arg( array( 'action' => 'yikes-easy-mc-unsubscribe-user', 'mailchimp-list' => $list_id , 'nonce' => wp_create_nonce( 'unsubscribe-user-'.$user_id ), 'email_id' => $user_id ) ) ); ?>
241
- <span><a href="<?php echo $url; ?>" onclick="return confirm('<?php printf( __( "Are you sure you want to unsubscribe %s from this mailing list?" , 'yikes-inc-easy-mailchimp-extender' ), sanitize_email( $subscriber['email'] ) ); ?>');" class="yikes-delete-subscriber"><?php _e( "Unsubscribe" , 'yikes-inc-easy-mailchimp-extender' ); ?></a>
242
- </div>
243
- </td>
244
- <td class="column-columnname num"><?php echo $user_email_client_icon; ?></td>
245
- </tr>
246
- <?php
247
- $i++;
248
- }
 
 
249
  } else { ?>
250
  <tr class="no-items">
251
  <td class="colspanchange no-current-subscriber-notice" colspan="2"><em><?php _e( 'No one is currently subscribed to this list.' , 'yikes-inc-easy-mailchimp-extender' ); ?></em></td>
@@ -322,7 +268,7 @@
322
  </tr>
323
  <tr valign="top">
324
  <td scope="row"><label for="tablecell"><strong><?php _e( 'List Fields' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td>
325
- <td><?php echo intval( $list_data['stats']['merge_var_count'] + 1 ); // add 1 for our email field.. ?></td>
326
  </tr>
327
  <tr valign="top">
328
  <td scope="row"><label for="tablecell"><strong><?php _e( 'Short Signup URL' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td>
@@ -330,11 +276,11 @@
330
  </tr>
331
  <tr valign="top">
332
  <td scope="row"><label for="tablecell"><strong><?php _e( 'Default From Email' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td>
333
- <td><input type="text" class="widefat view-list-sidebar-input" value="<?php echo sanitize_email( $list_data['default_from_email'] ); ?>" readonly onclick="jQuery(this).select();"></td>
334
  </tr>
335
  <tr valign="top">
336
  <td scope="row"><label for="tablecell"><strong><?php _e( 'Default From Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td>
337
- <td><?php echo $list_data['default_from_name']; ?></td>
338
  </tr>
339
  </table>
340
 
@@ -346,12 +292,12 @@
346
 
347
  <h3><?php _e( 'Form Fields' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
348
  <?php
349
- if( count( $merge_variables ) >= 1 ) {
350
  ?><ul class="merge-variable-ul"><?php
351
- echo '<li class="interest-group-count">' . sprintf( _n( '%d Field', '%d Fields', intval( count( $merge_variables ) ), 'yikes-inc-easy-mailchimp-extender' ), intval( count( $merge_variables ) ) ) . '</li>';
352
- foreach( $merge_variables as $merge_variable ) {
353
  // new action hook @since 6.0.3.8
354
- echo '<li class="' . $merge_variable['tag'] . '"><span class="dashicons dashicons-marker"></span>' . $merge_variable['name'] . ' ' . do_action( 'yikes-mailchimp-list-field', $merge_variable ) . '</li>';
355
  }
356
  ?></ul><?php
357
  }
@@ -370,25 +316,29 @@
370
 
371
  <h3><?php _e( 'Interest Groups Overview' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
372
  <?php
373
- if( isset( $interest_groupings ) && ! isset( $interest_groupings['error'] ) ) {
374
- ?><ul class="interest-group-ul"><?php
375
- echo '<li class="interest-group-count">' . sprintf( _n( '%d Interest Group', '%d Interest Groups', intval( count( $interest_groupings ) ), 'yikes-inc-easy-mailchimp-extender' ), intval( count( $interest_groupings ) ) ) . '</li>';
376
- foreach( $interest_groupings as $interest_group ) {
377
- echo '<li><span class="dashicons dashicons-marker"></span>' . $interest_group['name'] . '<span class="interest-group-title"></span><small title="' . $interest_group['groups'][0]['subscribers'] . ' ' . __( "subscribers assigned to this group" , 'yikes-inc-easy-mailchimp-extender' ) . '">(' . $interest_group['groups'][0]['subscribers'] . ')</small></li>';
378
- }
379
- ?></ul><?php
380
- } else {
381
- ?>
382
- <ul class="interest-group-ul">
383
- <li><?php echo $no_interest_groupings; ?></li>
384
- </ul>
385
- <?php
386
  }
387
- /**
388
- * Custom action hook for our add-ons to hook into
389
- * @since 6.0.3.8
390
- */
391
- do_action( 'yikes-mailchimp-list-interest-groups-metabox' );
 
 
 
 
 
 
 
 
 
392
  ?>
393
 
394
  </div>
1
  <?php
2
+ if ( ! isset( $_REQUEST['list-id'] ) ) {
3
+ wp_die( __( 'Oops, we can\'t determine what List to view. Please go back and try again.' ) );
4
+ }
5
+
6
+ $list_id = sanitize_key( $_REQUEST['list-id'] );
7
+ $list_helper = yikes_get_mc_api_manager()->get_list_handler();
8
+ $api_key = yikes_get_mc_api_key();
9
+ $dash_position = strpos( $api_key, '-' );
10
+
11
+
12
+ $list_data = $list_helper->get_list( $list_id );
13
+ if ( is_wp_error( $list_data ) ) {
14
+ $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
15
+ $error_logging->maybe_write_to_log(
16
+ $list_data->get_error_code(),
17
+ __( "Get Account Lists", 'yikes-inc-easy-mailchimp-extender' ),
18
+ "View Lists Page"
19
+ );
20
+ $list_data = array();
21
+ }
22
+
23
+ $merge_fields = $list_helper->get_merge_fields( $list_id );
24
+ if ( is_wp_error( $merge_fields ) ) {
25
+ $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
26
+ $error_logging->maybe_write_to_log(
27
+ $merge_fields->get_error_code(),
28
+ __( "Get Merge Variables", 'yikes-inc-easy-mailchimp-extender' ),
29
+ "View Lists Page"
30
+ );
31
+ $merge_fields = array();
32
+ }
33
+
34
+ // get the interest group data
35
+ $interest_groupings = $list_helper->get_interest_categories( $list_id );
36
+ if ( is_wp_error( $interest_groupings ) ) {
37
+ $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
38
+ $error_logging->maybe_write_to_log(
39
+ $interest_groupings->get_error_code(),
40
+ __( "Get Interest Groups", 'yikes-inc-easy-mailchimp-extender' ),
41
+ "View Lists Page"
42
+ );
43
+ $interest_groupings = array();
44
+ }
45
+
46
+ $no_interest_groupings = '<p class="description">' . __( 'Interest groups are not enabled for this list.', 'yikes-inc-easy-mailchimp-extender' ) . '</p>';
47
+ $no_segments = __( 'No segments set up for this list.', 'yikes-inc-easy-mailchimp-extender' );
48
+ $segments = $list_helper->get_segments( $list_id );
49
+
50
+ // Get the full list of members.
51
+ $members = $list_helper->get_members( $list_id );
52
+ if ( is_wp_error( $members ) ) {
53
+ $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
54
+ $error_logging->maybe_write_to_log(
55
+ $members->get_error_code(),
56
+ __( "Get Subscriber Count", 'yikes-inc-easy-mailchimp-extender' ),
57
+ "View Lists Page"
58
+ );
59
+ $members = array();
60
+ }
61
+
62
+ // setup pagination variables
63
+ $paged = isset( $_REQUEST['paged'] ) ? $_REQUEST['paged'] : '0';
64
+ $limit = apply_filters( 'yikes_admin_list_subscriber_limit', '20' );
65
+ $sort_dir = isset( $_REQUEST['sort'] ) ? $_REQUEST['sort'] : 'DESC';
66
+
67
+
68
+ if ( $sort_dir == 'DESC' ) {
69
+ $opposite_sort_dir = 'ASC';
70
+ $icon = '<span class="dashicons dashicons-arrow-down"></span>';
71
+ $sort_function = 'krsort';
72
+ } else {
73
+ $opposite_sort_dir = 'DESC';
74
+ $icon = '<span class="dashicons dashicons-arrow-up"></span>';
75
+ $sort_function = 'ksort';
76
+ }
77
+
78
+ // Sort the array based on the sort direction.
79
+ $sort_function( $members );
80
+
81
+ // Maybe split the array into pages
82
+ $total_pages = ceil( count( $members ) / $limit );
83
+ if ( $total_pages == 0 ) {
84
+ $total_pages = '1';
85
+ }
86
+
87
+ // Segment the members based on the page and limit
88
+ $subscribers_list = array_slice( $members, $paged, $limit );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
 
90
  ?>
91
  <div class="wrap">
121
  <h4><?php _e( 'Add New Subscriber' , 'yikes-inc-easy-mailchimp-extender' ); ?></h4>
122
  <form id="add-new-subcscriber">
123
  <input type="text" class="regular-text" placeholder="<?php _e( 'User Email Address' , 'yikes-inc-easy-mailchimp-extender' ); ?>" /></p>
124
+ <p><?php submit_button( 'Add Subscriber' ); ?></p>
125
  </form>
126
  </section>
127
 
159
 
160
  <!-- TABLE BODY -->
161
  <tbody>
162
+ <?php if ( count( $subscribers_list ) > 0 ) {
163
+ $i = 1;
164
+ foreach ( $subscribers_list as $subscriber ) {
165
+ $user_id = $subscriber['id'];
166
+ $path = YIKES_MC_URL . "includes/images/na.png";
167
+ $email_client_icon = "<img width='35' src='" . $path . "' alt='" . __( 'not set', 'yikes-inc-easy-mailchimp-extender' ) . "' title='" . __( 'not set', 'yikes-inc-easy-mailchimp-extender' ) . "'>";
168
+
169
+ ?>
170
+ <tr class="<?php if ( $i % 2 == 0 ) { echo 'alternate'; } ?>">
171
+ <td class="column-columnname">
172
+ <a class="user-email row-title" href="mailto:<?php echo sanitize_email( $subscriber['email_address'] ); ?>">
173
+ <?php echo sanitize_email( $subscriber['email_address'] ); ?>
174
+ </a>
175
+ <div class="row-actions">
176
+ <?php $view_user_info_url = esc_url_raw( add_query_arg( array(
177
+ 'mailchimp-list' => $list_id,
178
+ 'email-id' => $user_id,
179
+ ), admin_url() . 'admin.php?page=yikes-mailchimp-view-user' ) ); ?>
180
+ <span><a href="<?php echo $view_user_info_url; ?>"><?php _e( "View Info.", 'yikes-inc-easy-mailchimp-extender' ); ?></a> |</span>
181
+ <?php $url = esc_url_raw( add_query_arg( array(
182
+ 'action' => 'yikes-easy-mc-unsubscribe-user',
183
+ 'mailchimp-list' => $list_id,
184
+ 'nonce' => wp_create_nonce( 'unsubscribe-user-' . $user_id ),
185
+ 'email_id' => $user_id,
186
+ ) ) ); ?>
187
+ <span><a href="<?php echo $url; ?>" onclick="return confirm('<?php printf( __( "Are you sure you want to unsubscribe %s from this mailing list?", 'yikes-inc-easy-mailchimp-extender' ), sanitize_email( $subscriber['email_address'] ) ); ?>');" class="yikes-delete-subscriber"><?php _e( "Unsubscribe", 'yikes-inc-easy-mailchimp-extender' ); ?></a>
188
+ </div>
189
+ </td>
190
+ <td class="column-columnname num"><?php echo $email_client_icon; ?></td>
191
+ </tr>
192
+ <?php
193
+ $i ++;
194
+ }
195
  } else { ?>
196
  <tr class="no-items">
197
  <td class="colspanchange no-current-subscriber-notice" colspan="2"><em><?php _e( 'No one is currently subscribed to this list.' , 'yikes-inc-easy-mailchimp-extender' ); ?></em></td>
268
  </tr>
269
  <tr valign="top">
270
  <td scope="row"><label for="tablecell"><strong><?php _e( 'List Fields' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td>
271
+ <td><?php echo intval( $list_data['stats']['merge_field_count'] + 1 ); // add 1 for our email field.. ?></td>
272
  </tr>
273
  <tr valign="top">
274
  <td scope="row"><label for="tablecell"><strong><?php _e( 'Short Signup URL' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td>
276
  </tr>
277
  <tr valign="top">
278
  <td scope="row"><label for="tablecell"><strong><?php _e( 'Default From Email' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td>
279
+ <td><input type="text" class="widefat view-list-sidebar-input" value="<?php echo sanitize_email( $list_data['campaign_defaults']['from_email'] ); ?>" readonly onclick="jQuery(this).select();"></td>
280
  </tr>
281
  <tr valign="top">
282
  <td scope="row"><label for="tablecell"><strong><?php _e( 'Default From Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td>
283
+ <td><?php echo $list_data['campaign_defaults']['from_name']; ?></td>
284
  </tr>
285
  </table>
286
 
292
 
293
  <h3><?php _e( 'Form Fields' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
294
  <?php
295
+ if( count( $merge_fields['merge_fields'] ) >= 1 ) {
296
  ?><ul class="merge-variable-ul"><?php
297
+ echo '<li class="interest-group-count">' . sprintf( _n( '%d Field', '%d Fields', intval( count( $merge_fields['merge_fields'] ) ), 'yikes-inc-easy-mailchimp-extender' ), intval( count( $merge_fields['merge_fields'] ) ) ) . '</li>';
298
+ foreach( $merge_fields['merge_fields'] as $merge_field ) {
299
  // new action hook @since 6.0.3.8
300
+ echo '<li class="' . $merge_field['tag'] . '"><span class="dashicons dashicons-marker"></span>' . $merge_field['name'] . ' ' . do_action( 'yikes-mailchimp-list-field', $merge_field ) . '</li>';
301
  }
302
  ?></ul><?php
303
  }
316
 
317
  <h3><?php _e( 'Interest Groups Overview' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
318
  <?php
319
+ if ( ! empty( $interest_groupings ) ) {
320
+ ?>
321
+ <ul class="interest-group-ul"><?php
322
+ echo '<li class="interest-group-count">' . sprintf( _n( '%d Interest Group', '%d Interest Groups', intval( count( $interest_groupings ) ), 'yikes-inc-easy-mailchimp-extender' ), intval( count( $interest_groupings ) ) ) . '</li>';
323
+ foreach ( $interest_groupings as $interest_group ) {
324
+ // Build up the total subscribers
325
+ $count = array_sum( wp_list_pluck( $interest_group['items'], 'subscriber_count' ) );
326
+ echo '<li><span class="dashicons dashicons-marker"></span>' . $interest_group['title'] . '<span class="interest-group-title"></span><small title="' . $count . ' ' . __( "subscribers assigned to this group", 'yikes-inc-easy-mailchimp-extender' ) . '">(' . $count . ')</small></li>';
 
 
 
 
 
327
  }
328
+ ?></ul><?php
329
+ } else {
330
+ ?>
331
+ <ul class="interest-group-ul">
332
+ <li><?php echo $no_interest_groupings; ?></li>
333
+ </ul>
334
+ <?php
335
+ }
336
+ /**
337
+ * Custom action hook for our add-ons to hook into
338
+ *
339
+ * @since 6.0.3.8
340
+ */
341
+ do_action( 'yikes-mailchimp-list-interest-groups-metabox' );
342
  ?>
343
 
344
  </div>
admin/partials/view-user.php CHANGED
@@ -1,417 +1,334 @@
1
  <?php
2
- /*
3
- * Get and store our variables
4
- * @since 6.0
5
- */
6
- $list_id = $_GET['mailchimp-list'];
7
- $email_id = (int) esc_attr( $_GET['email-id'] );
8
-
9
- /*
10
- * Confirm that our data is set
11
- * or abort...
12
- */
13
- if( ! isset( $list_id ) || ! isset( $email_id ) ) {
14
- wp_die( "We've encountered an error. Please go back and try again", "yikes-inc-easy-mailchimp-extender" );
15
- exit;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  }
17
 
18
- // run our API call, to get list data..
19
- $api_key = yikes_get_mc_api_key();
20
- $dash_position = strpos( $api_key, '-' );
21
-
22
- // get this lists data
23
- if( $dash_position !== false ) {
24
- $api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/member-info.json';
 
 
25
  }
26
- $user_data = wp_remote_post( $api_endpoint, array(
27
- 'body' => array(
28
- 'apikey' => $api_key,
29
- 'id' => $list_id,
30
- 'emails' => array(
31
- array( 'leid' => $email_id )
32
- ),
33
- ),
34
- 'timeout' => 10,
35
- 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true ),
36
- ) );
37
- $user_data = json_decode( wp_remote_retrieve_body( $user_data ), true );
38
-
39
- if( isset( $user_data['error'] ) ) {
40
- if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
41
- require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
42
- $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
43
- $error_logging->yikes_easy_mailchimp_write_to_error_log( $user_data['error'], __( "Get Member Info" , 'yikes-inc-easy-mailchimp-extender' ), "View User Page" );
 
 
44
  }
45
  }
46
-
47
- /*
48
- * Check for MailChimp returned errors
49
- */
50
- if( isset( $user_data['error'] ) ) {
51
- echo '<h4>Error</h4>';
52
- echo $user_data['error'] . '.';
53
- return;
 
 
 
 
 
 
 
 
 
 
54
  }
55
-
56
- if( isset( $user_data['data'][0] ) ) {
57
- // reset our data so we can easily use it
58
- $user_data = $user_data['data'][0];
59
-
60
- $other_lists = ( isset( $user_data['lists'] ) && ! empty( $user_data['lists'] ) ) ? $user_data['lists'] : array();
61
- $merge_data_array = ( $user_data['merges'] && ! empty( $user_data['merges'] ) ) ? $user_data['merges'] : array();
62
-
63
- // print_r( $user_data );
64
-
65
- /* Empty array to populate with list names */
66
- $additional_lists = array();
67
- /* Merge Variable Fields */
68
- $merge_variable_fields = array();
69
-
70
- /* Build the array of mailing lists the user is subscribed to */
71
- if( isset( $other_lists ) && count( $other_lists ) >= 1 ) {
72
- foreach( $other_lists as $list ) {
73
- if( $list['status'] == 'subscribed' ) {
74
- if( $dash_position !== false ) {
75
- $api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/list.json';
76
- }
77
- $list_data = wp_remote_post( $api_endpoint, array(
78
- 'body' => array(
79
- 'apikey' => $api_key,
80
- 'filters' => array(
81
- 'list_id' => $list['id']
82
- )
83
- ),
84
- 'timeout' => 10,
85
- 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true )
86
- ) );
87
- $list_data = json_decode( wp_remote_retrieve_body( $list_data ), true );
88
- if( isset( $list_data['error'] ) ) {
89
- if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
90
- require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
91
- $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
92
- $error_logging->yikes_easy_mailchimp_write_to_error_log( $list_data['error'], __( "Get Account Lists" , 'yikes-inc-easy-mailchimp-extender' ), "View User Page" );
93
- }
94
- }
95
- if( $list_data && isset( $list_data['data'][0] ) ) {
96
- $additional_lists[$list_data['data'][0]['id']] = $list_data['data'][0]['name'];
97
- }
98
- }
99
- }
100
- }
101
-
102
- /* Build the array of merge variables => value */
103
- if( isset( $merge_data_array ) && count( $merge_data_array ) >= 1 ) {
104
- if( $dash_position !== false ) {
105
- $api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/merge-vars.json';
106
- }
107
- $merge_variables = wp_remote_post( $api_endpoint, array(
108
- 'body' => array(
109
- 'apikey' => $api_key,
110
- 'id' => array( $list_id ),
111
- ),
112
- 'timeout' => 10,
113
- 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true )
114
- ) );
115
- $merge_variables = json_decode( wp_remote_retrieve_body( $merge_variables ), true );
116
- if( isset( $merge_variables['error'] ) ) {
117
- if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
118
- require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
119
- $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
120
- $error_logging->yikes_easy_mailchimp_write_to_error_log( $merge_variables['error'], __( "Get Merge Variables" , 'yikes-inc-easy-mailchimp-extender' ), "View User Page" );
121
- }
122
- }
123
- // loop and display
124
- if( $merge_variables ) {
125
- foreach( $merge_variables['data'][0]['merge_vars'] as $merge_variable ) {
126
- if( $merge_variable['tag'] != 'EMAIL' ) {
127
- $merge_variable_fields[$merge_variable['name']] = ( isset( $merge_data_array[$merge_variable['tag']] ) ) ? $merge_data_array[$merge_variable['tag']] : '';
128
  }
129
  }
130
- }
131
- }
132
 
 
133
 
134
- // store usable data
135
- $user_email = sanitize_email( $user_data['email'] );
136
- // prepend our email address to the beginning
137
- $merge_variable_fields = array( 'Email Address' => $user_email ) + $merge_variable_fields;
138
- $gravatar_image = get_avatar( $user_email, 120 );
139
- $email_type = $user_data['email_type'];
140
- $member_rating = ( ! empty( $user_data['member_rating'] ) ) ? (int) $user_data['member_rating'] : 0;
141
- $member_rating_stars = '';
142
- if( $member_rating > 0 ) {
143
- $x = 1;
144
- while( $x <= 5 ) {
145
- if( $x <= $member_rating ) {
146
- $member_rating_stars .= '<span class="yikes-mc-member-rating-star dashicons dashicons-star-filled"></span>';
 
 
 
147
  } else {
148
- $member_rating_stars .= '<span class="yikes-mc-member-rating-star dashicons dashicons-star-empty"></span>';
 
 
149
  }
150
- $x++;
151
- }
152
- } else {
153
- $y = 1;
154
- while( $y <= 5 ) {
155
- $member_rating_stars .= '<span class="yikes-mc-member-rating-star dashicons dashicons-star-empty"></span>';
156
- $y++;
157
- }
158
- }
159
- $last_changed = strtotime( $user_data['info_changed'] );
160
- $user_language = ( $user_data['language'] && $user_data['language'] != '' ) ? $user_data['language'] : '';
161
- $list_name = $user_data['list_name'];
162
-
163
- // Generate our display page
164
- ?>
165
- <div class="wrap view-user-data-wrap">
166
- <!-- Freddie Logo -->
167
- <img src="<?php echo YIKES_MC_URL . 'includes/images/MailChimp_Assets/Freddie_60px.png'; ?>" alt="<?php __( 'Freddie - MailChimp Mascot' , 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-mc-freddie-logo" />
168
-
169
- <h1>YIKES Easy Forms for MailChimp | <?php _e( 'Subscriber Details' , 'yikes-inc-easy-mailchimp-extender' ); ?></h1>
170
-
171
- <!-- Settings Page Description -->
172
- <p class="yikes-easy-mc-about-text about-text"><?php printf( __( 'View %s subscriber details below.' , 'yikes-inc-easy-mailchimp-extender' ), $user_email ); ?></p>
173
-
174
- <section class="yikes-mc-view-list-breadcrumbs">
175
- <a href="<?php echo esc_url( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-lists' ) ); ?>" title="<?php _e( 'View List', 'yikes-inc-easy-mailchimp-extender' ); ?>">
176
- <?php _e( 'Optin Forms', 'yikes-inc-easy-mailchimp-extender' ); ?>
177
- </a>
178
- &nbsp;&#187;&nbsp;
179
- <a href="<?php echo esc_url( admin_url( 'admin.php?page=yikes-mailchimp-view-list&list-id=' . $list_id ) ); ?>" title="<?php echo $list_name; ?>">
180
- <?php echo $list_name; ?>
181
- </a>
182
- &nbsp;&#187;&nbsp;
183
- <span title="<?php echo $user_email; ?>">
184
- <?php echo $user_email; ?>
185
- </span>
186
- </section>
187
-
188
- <!-- Customer Container -->
189
- <div id="yikes-mc-subscriber-card-wrapper">
190
- <section class="yikes-mc-card-top">
191
- <?php echo $gravatar_image; ?>
192
- <h2><?php echo $user_email; ?></h2>
193
- <?php echo '<span class="member-star-rating-container" title="' . sprintf( _n( 'Member Rating: %s star', 'Member Rating: %s stars', $member_rating, 'yikes-inc-easy-mailchimp-extender' ), $member_rating ) . '">' . $member_rating_stars . '</span>'; ?>
194
- <span class="member-subscription-date">
195
- <?php echo __( 'Subscribed:', 'yikes-inc-easy-mailchimp-extender' ) . ' ' . get_date_from_gmt( $user_data['info_changed'], 'F jS, Y h:i a' ); ?>
196
- </span>
197
- <?php if( isset( $user_data['geo'] ) && ! empty( $user_data['geo'] ) ) { ?>
198
- <?php if( isset( $user_data['geo']['latitude'] ) && isset( $user_data['geo']['longitude'] ) ) { ?>
199
- <span class="member-location-data">
200
- <?php echo __( 'Location:', 'yikes-inc-easy-mailchimp-extender' ) . ' ' . yikes_mc_geocode_subscriber_data( $user_data['geo']['latitude'], $user_data['geo']['longitude'] ); ?>
201
- </span>
202
- <?php } else { ?>
203
- <span class="member-location-data">
204
- <?php echo __( 'Location:', 'yikes-inc-easy-mailchimp-extender' ) . ' ' . $user_data['geo']['region'] . ', ' . $user_data['geo']['cc']; ?>
205
- </span>
206
- <?php
207
- }
208
- }
209
- ?>
210
- </section>
211
-
212
- <hr class="yikes-mc-subscriber-hr" />
213
-
214
  <?php
215
- if( ! isset( $_GET['section'] ) || ( isset( $_GET['section'] ) && $_GET['section'] == 'subscriber-data' ) ) {
216
- ?>
217
- <section class="yikes-mc-card-body merge-variable-section">
218
- <h3><?php _e( 'Fields:', 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
219
- <?php
220
- if( ! empty( $merge_variable_fields ) ) {
221
- foreach( $merge_variable_fields as $field_name => $value ) { ?>
222
- <li>
223
- <label>
224
- <strong class="section-label"><?php echo $field_name; ?></strong>
225
-
226
- <?php if ( strtolower( $field_name ) === 'address' && is_array( $value ) ) { ?>
227
- <p class="section-value"><em><?php echo yikes_mc_format_address_field( $value ); ?></em></p>
228
- <?php } else { ?>
229
- <p class="section-value"><em><?php echo $value; ?></em></p>
230
- <?php } ?>
231
- </label>
232
- </li>
233
- <?php }
234
- } else {
235
- ?>
236
- <strong><?php _e( 'No Subscriber Data Found', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
237
- <?php
238
- }
239
- if( isset( $user_data['ip_signup'] ) && $user_data['ip_signup'] != '' ) {
240
- ?>
241
- <li>
242
- <label>
243
- <strong class="section-label"><?php echo __( 'Signup IP', 'yikes-inc-easy-mailchimp-extender' ) . '</strong><p class="section-value"><em>' . $user_data['ip_signup']; ?></strong></p>
244
- </label>
245
- </li>
246
- <?php
247
- }
248
- }
249
- ?>
250
- </section>
251
- <?php
252
 
253
 
254
- if( isset( $_GET['section'] ) && $_GET['section'] == 'additional-subscriptions' ) {
 
 
 
 
 
 
 
255
  ?>
256
- <section class="yikes-mc-card-body">
 
257
  <?php
258
- if( ! empty( $additional_lists ) ) {
259
- // remove this list from the additional lists list
260
- unset( $additional_lists[$list_id] );
261
- if( ! empty( $additional_lists ) ) {
262
- ?>
263
- <h3><?php _e( 'Additional Subscriptions:', 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
264
- <?php foreach( $additional_lists as $listid => $name ) { ?>
265
- <?php
266
- $user_redirect_url = esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-view-list&list-id=' . $listid ) );
267
- ?>
268
- <li><a href="<?php echo $user_redirect_url; ?>"><?php echo $name; ?></a></li>
269
- <?php }
270
- }
271
- } else {
272
  ?>
273
- <strong><?php _e( 'No Other Subscriptions Found.', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
274
- <?php
275
- }
276
- ?>
277
- </section>
278
- <?php
279
- }
280
- ?>
281
-
282
- <?php
283
- if( isset( $_GET['section'] ) && $_GET['section'] == 'delete-subscriber' ) {
284
- $unsubscribe_subscriber_url = esc_url_raw( add_query_arg( array( 'action' => 'yikes-easy-mc-unsubscribe-user', 'mailchimp-list' => $list_id , 'nonce' => wp_create_nonce( 'unsubscribe-user-'.$email_id ), 'email_id' => $email_id ) ) );
285
- ?>
286
- <form id="delete_subscriber" method="POST" action="<?php echo $unsubscribe_subscriber_url; ?>">
287
- <p class="description">
288
- <?php printf( __( 'Deleting this subscriber will completely remove %s from the "%s" MailChimp list.', 'yikes-inc-easy-mailchimp-extender' ), '<strong>' . $user_email . '</strong>', '<strong>' . $list_name . '</strong>' ); ?>
289
- </p>
290
- <br />
291
- <label>
292
- <input type="checkbox" name="confirm_delete_subscriber" value="1" onclick="toggleDeleteSubscriberButton(jQuery(this));">
293
- <?php printf( __( 'Are you sure you want to delete "%s" from "%s?"', 'yikes-inc-easy-mailchimp-extender' ), '<strong>' . $user_email . '</strong>', '<strong>' . $list_name . '</strong>' ); ?>
294
- </label>
295
- <?php echo submit_button( __( 'Delete Subscriber', 'yikes-inc-easy-mailchimp-extender' ), 'primary', 'delete-mailchimp-subscriber', true, array( 'disabled' => 'disabled' ) ); ?>
296
- </form>
297
- <?php
298
  }
 
 
 
 
 
299
  ?>
300
-
301
- </div>
302
-
303
  <?php
304
- // setup the redirect url for our additional subscriptions
305
- $subscriber_details = esc_url_raw(
306
- add_query_arg(
307
- array(
308
- 'section' => 'subscriber-data'
309
- )
310
- )
311
- );
312
- // setup the redirect url for our additional subscriptions
313
- $additional_subscription_url = esc_url_raw(
314
- add_query_arg(
315
- array(
316
- 'section' => 'additional-subscriptions'
317
- )
318
- )
319
- );
320
- // setup the redirect url for our delete subscriber
321
- $delete_subscriber_url = esc_url_raw(
322
- add_query_arg(
323
- array(
324
- 'section' => 'delete-subscriber'
325
- )
326
- )
327
- );
328
  ?>
329
- <!-- Tabs -->
330
- <div id="customer-tab-wrapper">
331
- <ul id="customer-tab-wrapper-list">
 
 
 
 
 
 
 
 
 
 
 
332
 
333
- <?php if( isset( $_GET['section'] ) && $_GET['section'] != 'subscriber-data' ) { ?>
334
- <a title="<?php _e( 'Subscriber Details', 'yikes-inc-easy-mailchimp-extender' ); ?>" aria-label="<?php _e( 'Subscriber Details', 'yikes-inc-easy-mailchimp-extender' ); ?>" href="<?php echo $subscriber_details; ?>">
335
- <?php } ?>
336
 
337
- <li <?php if( ! isset( $_GET['section'] ) || ( isset( $_GET['section'] ) && $_GET['section'] == 'subscriber-data' ) ) { ?>class="active"<?php } else { ?>class="inactive"<?php } ?>><span class="dashicons dashicons-id"></span></li>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
338
 
339
- <?php if( isset( $_GET['section'] ) && $_GET['section'] != 'subscriber-data' ) { ?>
340
- </a>
341
- <?php } ?>
342
 
343
- <?php if( ! isset( $_GET['section'] ) || ( isset( $_GET['section'] ) && $_GET['section'] != 'additional-subscriptions' ) ) { ?>
344
- <a title="<?php _e( 'Additional Subscriptions', 'yikes-inc-easy-mailchimp-extender' ); ?>" aria-label="<?php _e( 'Additional Subscriptions', 'yikes-inc-easy-mailchimp-extender' ); ?>" href="<?php echo $additional_subscription_url; ?>">
345
- <?php } ?>
346
 
347
- <li <?php if( isset( $_GET['section'] ) && $_GET['section'] == 'additional-subscriptions' ) { ?>class="active"<?php } else { ?>class="inactive"<?php } ?>><span class="dashicons dashicons-portfolio"></span></li>
 
 
348
 
349
- <?php if( ! isset( $_GET['section'] ) || ( isset( $_GET['section'] ) && $_GET['section'] == 'additional-subscriptions' ) ) { ?>
350
- </a>
351
- <?php } ?>
352
 
353
- <?php if( ! isset( $_GET['section'] ) || isset( $_GET['section'] ) && $_GET['section'] != 'delete-subscriber' ) { ?>
354
- <a title="<?php _e( 'Delete Subscriber', 'yikes-inc-easy-mailchimp-extender' ); ?>" aria-label="<?php _e( 'Delete Subscriber', 'yikes-inc-easy-mailchimp-extender' ); ?>" href="<?php echo $delete_subscriber_url; ?>">
355
- <?php } ?>
356
 
357
- <li <?php if( isset( $_GET['section'] ) && $_GET['section'] == 'delete-subscriber' ) { ?>class="active"<?php } else { ?>class="inactive"<?php } ?>><span class="dashicons dashicons-trash"></span></li>
 
 
358
 
359
- <?php if( ! isset( $_GET['section'] ) || ( isset( $_GET['section'] ) && $_GET['section'] == 'delete-subscriber' ) ) { ?>
360
- </a>
361
- <?php } ?>
362
 
363
- </ul>
364
- </div>
365
 
366
- </div>
367
- <?php
368
- }
369
 
 
 
370
 
371
- function yikes_mc_geocode_subscriber_data( $latitude, $longitude ) {
372
- $geocode_url = 'https://maps.googleapis.com/maps/api/geocode/json?latlng=' . $latitude . ',' . $longitude;
373
- $geocode_response = wp_remote_get( $geocode_url );
374
- if( is_wp_error( $geocode_response ) ) {
375
- return;
376
- }
377
- $geocode_response_body = json_decode( wp_remote_retrieve_body( $geocode_response ), true );
378
- if( is_wp_error( $geocode_response_body ) ) {
379
- return;
380
- }
381
- $city = $geocode_response_body['results'][0]['address_components'][2]['short_name'];
382
- $state = $geocode_response_body['results'][0]['address_components'][5]['short_name'];
383
- $country = $geocode_response_body['results'][0]['address_components'][6]['short_name'];
384
- return $link = '<a href="http://maps.google.com/maps?q=' . $latitude . ',' . $longitude . '" target="_blank" title="' . __( 'View Google Map', 'yikes-inc-easy-mailchimp-extender' ) . '">' . $city . ', ' . $state . ', ' . $country . '</a>&nbsp;<span class="flag-icon flag-icon-' . strtolower( $country ) . '"></span>';
385
- }
386
 
387
- function yikes_mc_format_address_field( $address_array ) {
388
- $address_string = '';
389
 
390
- if ( isset( $address_array['addr1'] ) && ! empty( $address_array['addr1'] ) && ! trim( $address_array['addr1'] ) === '-' ) {
391
- $address_string .= $address_array['addr1'];
392
- }
393
- if ( isset( $address_array['addr2'] ) && ! empty( $address_array['addr2'] ) ) {
394
- $address_string .= ', ';
395
- $address_string .= $address_array['addr2'];
396
- }
397
- if ( isset( $address_array['city'] ) && ! empty( $address_array['city'] ) ) {
398
- $address_string .= ', ';
399
- $address_string .= $address_array['city'];
400
- }
401
- if ( isset( $address_array['state'] ) && ! empty( $address_array['state'] ) ) {
402
- $address_string .= ', ';
403
- $address_string .= $address_array['state'];
404
- }
405
- if ( isset( $address_array['zip'] ) && ! empty( $address_array['zip'] ) ) {
406
- $address_string .= $address_array['zip'];
407
- }
408
- if ( isset( $address_array['country'] ) && ! empty( $address_array['country'] ) ) {
409
- $address_string .= ', ';
410
- $address_string .= $address_array['country'];
411
- }
412
-
413
- //trim any initial whitespace and commas
414
- $address_string = ltrim( $address_string, ',' );
415
 
416
- return $address_string;
 
 
 
 
417
  }
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
+ /*
3
+ * Get and store our variables
4
+ * @since 6.0
5
+ */
6
+ $list_id = $_GET['mailchimp-list'];
7
+ $email_id = esc_attr( $_GET['email-id'] );
8
+ $list_helper = yikes_get_mc_api_manager()->get_list_handler();
9
+
10
+ /*
11
+ * Confirm that our data is set
12
+ * or abort...
13
+ */
14
+ if ( ! isset( $list_id ) || ! isset( $email_id ) ) {
15
+ wp_die( "We've encountered an error. Please go back and try again", 'yikes-inc-easy-mailchimp-extender' );
16
+ exit;
17
+ }
18
+
19
+ $user_data = $list_helper->get_member( $list_id, $email_id );
20
+ if ( is_wp_error( $user_data ) ) {
21
+ $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
22
+ $error_logging->maybe_write_to_log(
23
+ $user_data->get_error_code(),
24
+ __( 'Get Member Info', 'yikes-inc-easy-mailchimp-extender' ),
25
+ 'View User Page'
26
+ );
27
+
28
+ echo '<h4>Error</h4>';
29
+ echo $user_data->get_error_code() . '.';
30
+
31
+ return;
32
+ }
33
+
34
+ if ( empty( $user_data ) ) {
35
+ return;
36
+ }
37
+
38
+ $other_lists = $list_helper->get_members_lists( $email_id );
39
+ $merge_data_array = $user_data['merge_fields'];
40
+
41
+ $additional_lists = array();
42
+ $merge_variable_fields = array();
43
+
44
+ /* Build the array of mailing lists the user is subscribed to */
45
+ foreach ( $other_lists as $id => $value ) {
46
+ if ( 'subscribed' !== $value['status'] ) {
47
+ continue;
48
  }
49
 
50
+ $list_data = $list_helper->get_list( $id );
51
+ if ( is_wp_error( $list_data ) ) {
52
+ $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
53
+ $error_logging->maybe_write_to_log(
54
+ $list_data->get_error_code(),
55
+ __( "Get Account Lists", 'yikes-inc-easy-mailchimp-extender' ),
56
+ "View User Page"
57
+ );
58
+ continue;
59
  }
60
+
61
+ $additional_lists[ $list_data['id'] ] = $list_data['name'];
62
+ }
63
+
64
+ /* Build the array of merge variables => value */
65
+ $merge_variables = $list_helper->get_merge_fields( $list_id );
66
+ if ( is_wp_error( $merge_variables ) ) {
67
+ $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
68
+ $error_logging->maybe_write_to_log(
69
+ $merge_variables->get_error_code(),
70
+ __( "Get Merge Variables", 'yikes-inc-easy-mailchimp-extender' ),
71
+ "View User Page"
72
+ );
73
+ $merge_variables = array();
74
+ }
75
+ // loop and display
76
+ if ( $merge_variables ) {
77
+ foreach ( $merge_variables['merge_fields'] as $merge_variable ) {
78
+ if ( $merge_variable['tag'] != 'EMAIL' ) {
79
+ $merge_variable_fields[ $merge_variable['name'] ] = ( isset( $merge_data_array[ $merge_variable['tag'] ] ) ) ? $merge_data_array[ $merge_variable['tag'] ] : '';
80
  }
81
  }
82
+ }
83
+
84
+
85
+ // store usable data
86
+ $user_email = sanitize_email( $user_data['email_address'] );
87
+ // prepend our email address to the beginning
88
+ $merge_variable_fields = array( 'Email Address' => $user_email ) + $merge_variable_fields;
89
+ $gravatar_image = get_avatar( $user_email, 120 );
90
+ $email_type = $user_data['email_type'];
91
+ $member_rating = ( ! empty( $user_data['member_rating'] ) ) ? (int) $user_data['member_rating'] : 0;
92
+ $member_rating_stars = '';
93
+
94
+ // Create member rating stars
95
+ for ( $i = 1; $i <= 5; $i++ ) {
96
+ if ( $i <= $member_rating ) {
97
+ $member_rating_stars .= '<span class="yikes-mc-member-rating-star dashicons dashicons-star-filled"></span>';
98
+ } else {
99
+ $member_rating_stars .= '<span class="yikes-mc-member-rating-star dashicons dashicons-star-empty"></span>';
100
  }
101
+ }
102
+
103
+ $last_changed = strtotime( $user_data['last_changed'] );
104
+ $user_language = ( ! empty( $user_data['language'] ) ) ? $user_data['language'] : '';
105
+ $list_name = $additional_lists[ $list_id ];
106
+
107
+ // Generate our display page
108
+ ?>
109
+ <div class="wrap view-user-data-wrap">
110
+ <!-- Freddie Logo -->
111
+ <img src="<?php echo YIKES_MC_URL . 'includes/images/MailChimp_Assets/Freddie_60px.png'; ?>" alt="<?php __( 'Freddie - MailChimp Mascot', 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-mc-freddie-logo" />
112
+
113
+ <h1>YIKES Easy Forms for MailChimp | <?php _e( 'Subscriber Details', 'yikes-inc-easy-mailchimp-extender' ); ?></h1>
114
+
115
+ <!-- Settings Page Description -->
116
+ <p class="yikes-easy-mc-about-text about-text"><?php printf( __( 'View %s subscriber details below.', 'yikes-inc-easy-mailchimp-extender' ), $user_email ); ?></p>
117
+
118
+ <section class="yikes-mc-view-list-breadcrumbs">
119
+ <a href="<?php echo esc_url( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-lists' ) ); ?>" title="<?php _e( 'View List', 'yikes-inc-easy-mailchimp-extender' ); ?>">
120
+ <?php _e( 'Optin Forms', 'yikes-inc-easy-mailchimp-extender' ); ?>
121
+ </a>
122
+ &nbsp;&#187;&nbsp;
123
+ <a href="<?php echo esc_url( admin_url( 'admin.php?page=yikes-mailchimp-view-list&list-id=' . $list_id ) ); ?>" title="<?php echo $list_name; ?>">
124
+ <?php echo $list_name; ?>
125
+ </a>
126
+ &nbsp;&#187;&nbsp;
127
+ <span title="<?php echo $user_email; ?>">
128
+ <?php echo $user_email; ?>
129
+ </span>
130
+ </section>
131
+
132
+ <!-- Customer Container -->
133
+ <div id="yikes-mc-subscriber-card-wrapper">
134
+ <section class="yikes-mc-card-top">
135
+ <?php echo $gravatar_image; ?>
136
+ <h2><?php echo $user_email; ?></h2>
137
+ <?php echo '<span class="member-star-rating-container" title="' . sprintf( _n( 'Member Rating: %s star', 'Member Rating: %s stars', $member_rating, 'yikes-inc-easy-mailchimp-extender' ), $member_rating ) . '">' . $member_rating_stars . '</span>'; ?>
138
+ <span class="member-subscription-date">
139
+ <?php echo __( 'Subscribed:', 'yikes-inc-easy-mailchimp-extender' ) . ' ' . gmdate( 'F jS, Y h:i a', $last_changed ); ?>
140
+ </span>
141
+ <?php if ( isset( $user_data['location'] ) && ! empty( $user_data['location'] ) ) { ?>
142
+ <?php if ( isset( $user_data['location']['latitude'] ) && isset( $user_data['location']['longitude'] ) ) { ?>
143
+ <span class="member-location-data">
144
+ <?php echo __( 'Location:', 'yikes-inc-easy-mailchimp-extender' ) . ' ' . yikes_mc_geocode_subscriber_data( $user_data['location']['latitude'], $user_data['location']['longitude'] ); ?>
145
+ </span>
146
+ <?php } else { ?>
147
+ <span class="member-location-data">
148
+ <?php echo __( 'Location:', 'yikes-inc-easy-mailchimp-extender' ) . ' ' . $user_data['location']['timezone'] . ', ' . $user_data['location']['country_code']; ?>
149
+ </span>
150
+ <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
151
  }
152
  }
153
+ ?>
154
+ </section>
155
 
156
+ <hr class="yikes-mc-subscriber-hr" />
157
 
158
+ <?php
159
+ if ( ! isset( $_GET['section'] ) || ( isset( $_GET['section'] ) && $_GET['section'] == 'subscriber-data' ) ) {
160
+ ?>
161
+ <section class="yikes-mc-card-body merge-variable-section">
162
+ <h3><?php _e( 'Fields:', 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
163
+ <?php
164
+ if ( ! empty( $merge_variable_fields ) ) {
165
+ ?>
166
+ <?php foreach ( $merge_variable_fields as $field_name => $value ) { ?>
167
+ <li>
168
+ <label>
169
+ <strong class="section-label"><?php echo $field_name; ?></strong>
170
+ <p class="section-value"><em><?php echo $value; ?></em></p>
171
+ </label>
172
+ </li>
173
+ <?php }
174
  } else {
175
+ ?>
176
+ <strong><?php _e( 'No Subscriber Data Found', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
177
+ <?php
178
  }
179
+ if ( isset( $user_data['ip_signup'] ) && $user_data['ip_signup'] != '' ) {
180
+ ?>
181
+ <li>
182
+ <label>
183
+ <strong class="section-label"><?php echo __( 'Signup IP', 'yikes-inc-easy-mailchimp-extender' ) . '</strong><p class="section-value"><em>' . $user_data['ip_signup']; ?></strong></p>
184
+ </label>
185
+ </li>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
186
  <?php
187
+ }
188
+ }
189
+ ?>
190
+ </section>
191
+ <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
192
 
193
 
194
+ if ( isset( $_GET['section'] ) && $_GET['section'] == 'additional-subscriptions' ) {
195
+ ?>
196
+ <section class="yikes-mc-card-body">
197
+ <?php
198
+ if ( ! empty( $additional_lists ) ) {
199
+ // remove this list from the additional lists list
200
+ unset( $additional_lists[ $list_id ] );
201
+ if ( ! empty( $additional_lists ) ) {
202
  ?>
203
+ <h3><?php _e( 'Additional Subscriptions:', 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
204
+ <?php foreach ( $additional_lists as $listid => $name ) { ?>
205
  <?php
206
+ $user_redirect_url = esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-view-list&list-id=' . $listid ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
207
  ?>
208
+ <li><a href="<?php echo $user_redirect_url; ?>"><?php echo $name; ?></a></li>
209
+ <?php }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
210
  }
211
+ } else {
212
+ ?>
213
+ <strong><?php _e( 'No Other Subscriptions Found.', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
214
+ <?php
215
+ }
216
  ?>
217
+ </section>
 
 
218
  <?php
219
+ }
220
+ ?>
221
+
222
+ <?php
223
+ if ( isset( $_GET['section'] ) && $_GET['section'] == 'delete-subscriber' ) {
224
+ $unsubscribe_subscriber_url = esc_url_raw( add_query_arg( array(
225
+ 'action' => 'yikes-easy-mc-unsubscribe-user',
226
+ 'mailchimp-list' => $list_id,
227
+ 'nonce' => wp_create_nonce( 'unsubscribe-user-' . $email_id ),
228
+ 'email_id' => $email_id,
229
+ ) ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
230
  ?>
231
+ <form id="delete_subscriber" method="POST" action="<?php echo $unsubscribe_subscriber_url; ?>">
232
+ <p class="description">
233
+ <?php printf( __( 'Deleting this subscriber will completely remove %s from the "%s" MailChimp list.', 'yikes-inc-easy-mailchimp-extender' ), '<strong>' . $user_email . '</strong>', '<strong>' . $list_name . '</strong>' ); ?>
234
+ </p>
235
+ <br />
236
+ <label>
237
+ <input type="checkbox" name="confirm_delete_subscriber" value="1" onclick="toggleDeleteSubscriberButton(jQuery(this));">
238
+ <?php printf( __( 'Are you sure you want to delete "%s" from "%s?"', 'yikes-inc-easy-mailchimp-extender' ), '<strong>' . $user_email . '</strong>', '<strong>' . $list_name . '</strong>' ); ?>
239
+ </label>
240
+ <?php submit_button( __( 'Delete Subscriber', 'yikes-inc-easy-mailchimp-extender' ), 'primary', 'delete-mailchimp-subscriber', true, array( 'disabled' => 'disabled' ) ); ?>
241
+ </form>
242
+ <?php
243
+ }
244
+ ?>
245
 
246
+ </div>
 
 
247
 
248
+ <?php
249
+ // setup the redirect url for our additional subscriptions
250
+ $subscriber_details = esc_url_raw(
251
+ add_query_arg(
252
+ array(
253
+ 'section' => 'subscriber-data',
254
+ )
255
+ )
256
+ );
257
+ // setup the redirect url for our additional subscriptions
258
+ $additional_subscription_url = esc_url_raw(
259
+ add_query_arg(
260
+ array(
261
+ 'section' => 'additional-subscriptions',
262
+ )
263
+ )
264
+ );
265
+ // setup the redirect url for our delete subscriber
266
+ $delete_subscriber_url = esc_url_raw(
267
+ add_query_arg(
268
+ array(
269
+ 'section' => 'delete-subscriber',
270
+ )
271
+ )
272
+ );
273
+ ?>
274
+ <!-- Tabs -->
275
+ <div id="customer-tab-wrapper">
276
+ <ul id="customer-tab-wrapper-list">
277
 
278
+ <?php if ( isset( $_GET['section'] ) && $_GET['section'] != 'subscriber-data' ) { ?>
279
+ <a title="<?php _e( 'Subscriber Details', 'yikes-inc-easy-mailchimp-extender' ); ?>" aria-label="<?php _e( 'Subscriber Details', 'yikes-inc-easy-mailchimp-extender' ); ?>" href="<?php echo $subscriber_details; ?>">
280
+ <?php } ?>
281
 
282
+ <li <?php if ( ! isset( $_GET['section'] ) || ( isset( $_GET['section'] ) && $_GET['section'] == 'subscriber-data' ) ) { ?>class="active" <?php } else { ?>class="inactive"<?php } ?>>
283
+ <span class="dashicons dashicons-id"></span></li>
 
284
 
285
+ <?php if ( isset( $_GET['section'] ) && $_GET['section'] != 'subscriber-data' ) { ?>
286
+ </a>
287
+ <?php } ?>
288
 
289
+ <?php if ( ! isset( $_GET['section'] ) || ( isset( $_GET['section'] ) && $_GET['section'] != 'additional-subscriptions' ) ) { ?>
290
+ <a title="<?php _e( 'Additional Subscriptions', 'yikes-inc-easy-mailchimp-extender' ); ?>" aria-label="<?php _e( 'Additional Subscriptions', 'yikes-inc-easy-mailchimp-extender' ); ?>" href="<?php echo $additional_subscription_url; ?>">
291
+ <?php } ?>
292
 
293
+ <li <?php if ( isset( $_GET['section'] ) && $_GET['section'] == 'additional-subscriptions' ) { ?>class="active" <?php } else { ?>class="inactive"<?php } ?>>
294
+ <span class="dashicons dashicons-portfolio"></span></li>
 
295
 
296
+ <?php if ( ! isset( $_GET['section'] ) || ( isset( $_GET['section'] ) && $_GET['section'] == 'additional-subscriptions' ) ) { ?>
297
+ </a>
298
+ <?php } ?>
299
 
300
+ <?php if ( ! isset( $_GET['section'] ) || isset( $_GET['section'] ) && $_GET['section'] != 'delete-subscriber' ) { ?>
301
+ <a title="<?php _e( 'Delete Subscriber', 'yikes-inc-easy-mailchimp-extender' ); ?>" aria-label="<?php _e( 'Delete Subscriber', 'yikes-inc-easy-mailchimp-extender' ); ?>" href="<?php echo $delete_subscriber_url; ?>">
302
+ <?php } ?>
303
 
304
+ <li <?php if ( isset( $_GET['section'] ) && $_GET['section'] == 'delete-subscriber' ) { ?>class="active" <?php } else { ?>class="inactive"<?php } ?>>
305
+ <span class="dashicons dashicons-trash"></span></li>
306
 
307
+ <?php if ( ! isset( $_GET['section'] ) || ( isset( $_GET['section'] ) && $_GET['section'] == 'delete-subscriber' ) ) { ?>
308
+ </a>
309
+ <?php } ?>
310
 
311
+ </ul>
312
+ </div>
313
 
314
+ </div>
315
+ <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
316
 
 
 
317
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
318
 
319
+ function yikes_mc_geocode_subscriber_data( $latitude, $longitude ) {
320
+ $geocode_url = 'https://maps.googleapis.com/maps/api/geocode/json?latlng=' . $latitude . ',' . $longitude;
321
+ $geocode_response = wp_remote_get( $geocode_url );
322
+ if ( is_wp_error( $geocode_response ) ) {
323
+ return;
324
  }
325
+ $geocode_response_body = json_decode( wp_remote_retrieve_body( $geocode_response ), true );
326
+ if ( is_wp_error( $geocode_response_body ) ) {
327
+ return;
328
+ }
329
+ $city = $geocode_response_body['results'][0]['address_components'][2]['short_name'];
330
+ $state = $geocode_response_body['results'][0]['address_components'][5]['short_name'];
331
+ $country = $geocode_response_body['results'][0]['address_components'][6]['short_name'];
332
+
333
+ return $link = '<a href="http://maps.google.com/maps?q=' . $latitude . ',' . $longitude . '" target="_blank" title="' . __( 'View Google Map', 'yikes-inc-easy-mailchimp-extender' ) . '">' . $city . ', ' . $state . ', ' . $country . '</a>&nbsp;<span class="flag-icon flag-icon-' . strtolower( $country ) . '"></span>';
334
+ }
admin/partials/welcome-page/welcome-sections/credits-section.php DELETED
@@ -1,97 +0,0 @@
1
- <?php
2
- // get the YIKES Inc. MailChimp contributors via the Github API
3
- if ( false === ( $contributors = get_transient( 'yikes-mailchimp-contributor-transient' ) ) ) {
4
- // It wasn't there, so regenerate the data and save the transient
5
- $contributors = wp_remote_get( 'https://api.github.com/repos/yikesinc/yikes-inc-easy-mailchimp-extender/contributors?per_page=100', array( 'timeout' => 120 ) );
6
- $contributors = json_decode( $contributors['body'] , true );
7
- set_transient( 'yikes-mailchimp-contributor-transient', $contributors, 60*60*12 );
8
- }
9
- // get the YIKES Inc. MailChimp translators via the Github API
10
- if ( false === ( $translators = get_transient( 'yikes-mailchimp-translators-transient' ) ) ) {
11
- /*
12
- * If a new user contributes a translation, append them to the end of the 'translator_username' array in the following format
13
- * github_username => language translated to,
14
- */
15
- $translator_usernames = array(
16
- 'mialevesque' => 'French',
17
- 'hiwhatsup' => 'Spanish',
18
- 'enxaqueca' => 'Portuguese (Brazilian)'
19
- );
20
- // create an empty array to store with translator data to loop over
21
- $translators = array();
22
- foreach( $translator_usernames as $username => $language ) {
23
- $translator_data = wp_remote_get( 'https://api.github.com/users/' . $username, array( 'timeout' => 120 ) );
24
- // if( $translator_data['status'] == 200 ) {
25
- $translators_data_decoded = json_decode( $translator_data['body'] , true );
26
- $translators[] = array(
27
- 'login' => $translators_data_decoded['login'],
28
- 'avatar_url' => $translators_data_decoded['avatar_url'],
29
- 'html_url' => $translators_data_decoded['html_url'],
30
- 'name' => $translators_data_decoded['name'],
31
- 'translation_language' => $language,
32
- );
33
- // }
34
- }
35
- set_transient( 'yikes-mailchimp-translators-transient', $translators, 60*60*12 );
36
- }
37
- ?>
38
- <div class="wrap about-wrap">
39
-
40
- <div class="feature-section">
41
-
42
- <p class="description">
43
- <?php printf( __( 'YIKES Easy Forms for MailChimp is a free plugin licensed under GPL v2, and was meticulously constructed with a whole lot of love by the folks at <a href="%s" target="_blank" title="YIKES Inc.">YIKES Inc.</a> in Philadelphia, PA.', 'yikes-inc-easy-mailchimp-extender' ), esc_url( 'http://www.yikesinc.com' ) ); ?>
44
- </p>
45
-
46
- <div id="credit-container">
47
- <h2><?php _e( 'Developers', 'yikes-inc-easy-mailchimp-extender' ); ?></h2>
48
- <?php
49
- if( ! empty( $contributors ) ) {
50
- $old_contributors = array( 'seriouslysean' , 'Apfelbiss', 'hiwhatsup', 'mialevesque' );
51
- foreach( $contributors as $contributor ) {
52
- // skip contributors from our old plugin (this is a new re-write)
53
- if( ! in_array( $contributor['login'] , $old_contributors ) ) {
54
- ?>
55
- <a href="<?php echo esc_url_raw( $contributor['html_url'] ); ?>" title="<?php echo $contributor['login']; ?>" target="_blank" class="github-avatar-url">
56
- <div class="team-member">
57
- <img src="<?php echo esc_url_raw( $contributor['avatar_url'] ); ?>" class="github-avatar-image">
58
- <p class="member-blurb">
59
- <p><strong><?php echo $contributor['login']; ?></strong></p>
60
- </p>
61
- </div>
62
- </a>
63
- <?php
64
- }
65
- }
66
- } else {
67
- ?>
68
- <h4><?php _e( 'There was an error retrieving the contributors list. Please try again later.' , 'yikes-inc-easy-mailchimp-extender' ); ?></h4>
69
- <?php
70
- }
71
- ?>
72
- </div>
73
-
74
- <?php if( ! empty( $translators ) ) { ?>
75
- <div id="translators-container">
76
- <h2><?php _e( 'Translators', 'yikes-inc-easy-mailchimp-extender' ); ?></h2>
77
- <?php
78
- foreach( $translators as $translator ) {
79
- ?>
80
- <a href="<?php echo esc_url_raw( $translator['html_url'] ); ?>" title="<?php echo $translator['name']; ?>" target="_blank" class="github-avatar-url">
81
- <div class="translator">
82
- <img src="<?php echo esc_url_raw( $translator['avatar_url'] ); ?>" class="github-avatar-image">
83
- <p class="member-blurb">
84
- <p><strong><?php echo $translator['login']; ?></strong></p>
85
- <em class="translation-language"><?php echo $translator['translation_language']; ?></em>
86
- </p>
87
- </div>
88
- </a>
89
- <?php
90
- }
91
- ?>
92
- </div>
93
- <?php } ?>
94
-
95
- </div>
96
-
97
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/partials/welcome-page/welcome-sections/getting-started-section.php CHANGED
@@ -1,24 +1,24 @@
1
  <?php if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) == 'invalid_api_key' ) { ?>
2
  <div class="about-description">
3
- <?php printf( __( "Before you can create any opt-in forms, you'll first need to enter your MailChimp API key into the <a href='%s' title='Yikes Easy MailChimp Settings'>settings page</a>" , 'yikes-inc-easy-mailchimp-extender' ), esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=general-settings' ) ) ); ?>
4
  </div>
5
  <?php } ?>
6
 
7
  <div class="changelog">
8
 
9
- <h3><?php _e( 'Creating Your First Opt-In Form' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
10
 
11
  <div class="feature-section">
12
 
13
  <img src="<?php echo YIKES_MC_URL . 'includes/images/Welcome_Page/create-first-optin-form.jpg'; ?>" alt="<?php _e( 'Create first optin form screenshot', 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-easy-mc-feature-image">
14
 
15
  <h4><a href="<?php echo esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ); ?>" title="<?php _e( 'Manage Forms' , 'yikes-inc-easy-mailchimp-extender' ); ?>">Easy MailChimp → <?php _e( 'Forms', 'yikes-inc-easy-mailchimp-extender' ); ?></a></h4>
16
- <p><?php _e( "Before you can start collecting users email addresses and building your mailing list, you'll need to create your first form. You can create as many forms as you'd like and assign each form to the same or different mailing lists.", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
17
 
18
  <p>&nbsp;</p>
19
 
20
  <h4><?php _e( 'Additional Options' , 'yikes-inc-easy-mailchimp-extender' ); ?></h4>
21
- <p><?php _e( "Once you create a form, you can choose which fields you want to add to it and customize the success and error messages returned by MailChimp.", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
22
 
23
  </div>
24
 
@@ -47,21 +47,17 @@
47
  </div>
48
 
49
  <div class="feature-section">
50
- <h3><span class="dashicons dashicons-format-status need-support-icon"></span> <?php _e( "Need Support?" , 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
 
 
 
51
 
52
  <h4><?php _e( 'Free Support' , 'yikes-inc-easy-mailchimp-extender' ); ?></h4>
53
- <p><?php _e( "If you need help using the free version of the plugin, you can post support inquiries to one of two locations.", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
54
- <ul class="support-option-list">
55
- <li class="support-option support-option-first"><a href="https://wordpress.org/plugins/yikes-inc-easy-mailchimp-extender/" title="<?php esc_attr_e( 'WordPress Plugin Directory' , 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'WordPress Plugin Directory' , 'yikes-inc-easy-mailchimp-extender' ); ?></a></li>
56
- <li class="support-option support-option-second"><a href="https://github.com/yikesinc/yikes-inc-easy-mailchimp-extender/issues" target="_blank" title="<?php esc_attr_e( 'GitHub Issue Tracker' , 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'GitHub Issue Tracker' , 'yikes-inc-easy-mailchimp-extender' ); ?></a></li>
57
- </ul>
58
 
59
  <h4><?php _e( 'Priority Support' , 'yikes-inc-easy-mailchimp-extender' ); ?></h4>
60
- <p><?php _e( "If you want immediate support, please consider purchasing an add-on or developer License. Not only will you get 1 full year of automatic updates and priority support, you will enjoy the tons of features packed into our add-ons that are not available in the free version." , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
61
-
62
- <h4><?php _e( 'Knowledge Base' , 'yikes-inc-easy-mailchimp-extender' ); ?></h4>
63
- <p><?php printf( __( 'For plugin documentation, visit our <a href="%s" title="Knowledge Base" target="_blank">knowledge base</a>.' , 'yikes-inc-easy-mailchimp-extender' ), esc_url_raw( 'https://yikesplugins.com/support/knowledge-base/product/easy-forms-for-mailchimp/' ) ); ?>
64
-
65
  </div>
66
 
67
  </div>
1
  <?php if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) == 'invalid_api_key' ) { ?>
2
  <div class="about-description">
3
+ <?php printf( __( "Before you can create any forms, you first need to enter your MailChimp API key into our <a href='%s' title='Easy MailChimp Forms Settings'>settings page</a>" , 'yikes-inc-easy-mailchimp-extender' ), esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=general-settings' ) ) ); ?>
4
  </div>
5
  <?php } ?>
6
 
7
  <div class="changelog">
8
 
9
+ <h3><?php _e( 'Creating Your First Form' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
10
 
11
  <div class="feature-section">
12
 
13
  <img src="<?php echo YIKES_MC_URL . 'includes/images/Welcome_Page/create-first-optin-form.jpg'; ?>" alt="<?php _e( 'Create first optin form screenshot', 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-easy-mc-feature-image">
14
 
15
  <h4><a href="<?php echo esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ); ?>" title="<?php _e( 'Manage Forms' , 'yikes-inc-easy-mailchimp-extender' ); ?>">Easy MailChimp → <?php _e( 'Forms', 'yikes-inc-easy-mailchimp-extender' ); ?></a></h4>
16
+ <p><?php _e( "To start collecting email addresses and building your mailing list, you need to create your first form. You can create as many forms as you like and assign each form to one of your lists.", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
17
 
18
  <p>&nbsp;</p>
19
 
20
  <h4><?php _e( 'Additional Options' , 'yikes-inc-easy-mailchimp-extender' ); ?></h4>
21
+ <p><?php _e( "For each form, you can choose the fields you want added to it and customize the success and error messages returned by MailChimp.", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
22
 
23
  </div>
24
 
47
  </div>
48
 
49
  <div class="feature-section">
50
+ <h3><span class="dashicons dashicons-format-status need-support-icon"></span> <?php _e( "Need Support?" , 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
51
+
52
+ <h4><?php _e( 'Knowledge Base' , 'yikes-inc-easy-mailchimp-extender' ); ?></h4>
53
+ <p><?php printf( __( 'For full plugin documentation, visit our <a href="%s" title="Knowledge Base" target="_blank">Knowledge Base</a> where we have step-by-step guides and troubleshooting help..' , 'yikes-inc-easy-mailchimp-extender' ), esc_url_raw( 'https://yikesplugins.com/support/knowledge-base/product/easy-forms-for-mailchimp/' ) ); ?>
54
 
55
  <h4><?php _e( 'Free Support' , 'yikes-inc-easy-mailchimp-extender' ); ?></h4>
56
+ <p><?php _e( "If you need help using the free version of the plugin, please post your questions to our support forum on the WordPress Plugin Directory.", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
57
+ <p><strong><a href="https://wordpress.org/support/plugin/yikes-inc-easy-mailchimp-extender" title="<?php esc_attr_e( 'WordPress Plugin Directory' , 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'Easy Forms for MailChimp Free Support Forum' , 'yikes-inc-easy-mailchimp-extender' ); ?></a></strong></p>
 
 
 
58
 
59
  <h4><?php _e( 'Priority Support' , 'yikes-inc-easy-mailchimp-extender' ); ?></h4>
60
+ <p><?php _e( "If you want immediate support, please consider purchasing an add-on or Unlimited License. Not only will you get 1 full year of automatic updates and priority support, you will enjoy all of the features packed into our add-ons not available in the free version." , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
 
 
 
 
61
  </div>
62
 
63
  </div>
admin/partials/welcome-page/welcome-sections/whats-new-section.php CHANGED
@@ -2,69 +2,13 @@
2
 
3
  <div class="feature-section">
4
 
5
- <h2><?php _e( 'All New Form Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?></h2>
6
 
7
- <img src="<?php echo YIKES_MC_URL . 'includes/images/Welcome_Page/form-layout-option.jpg'; ?>" alt="<?php _e( 'New Form Settings', 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-easy-mc-feature-image yikes-easy-mc-whats-new-section-image">
8
 
9
- <img src="<?php echo YIKES_MC_URL . 'includes/images/Welcome_Page/inline-form-frontend.png'; ?>" style="margin-top:2em;padding-bottom: 2em;" alt="<?php _e( 'New Form Settings', 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-easy-mc-feature-image yikes-easy-mc-whats-new-section-image">
10
-
11
- <p><?php _e( "In version 6.0.3.8 of Easy Forms for MailChimp by YIKES we've added an additional layer of customization. You now have a whole new set of options to tweak on the edit form page - allowing an additional depth of customization.", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
12
- <hr />
13
- <ul class="new-feature-list">
14
- <li><?php _e( 'Additional Form Classes', 'yikes-inc-easy-mailchimp-extender' ); ?></li>
15
- <li><?php _e( 'Form Layout (inline vs. standard)', 'yikes-inc-easy-mailchimp-extender' ); ?></li>
16
- <li><?php _e( 'Submit Button Text', 'yikes-inc-easy-mailchimp-extender' ); ?></li>
17
- <li><?php _e( 'Submit Button Image', 'yikes-inc-easy-mailchimp-extender' ); ?></li>
18
- <li><?php _e( 'Submit Button Classes', 'yikes-inc-easy-mailchimp-extender' ); ?></li>
19
- <li><?php _e( 'Schedule Form by Date/Time', 'yikes-inc-easy-mailchimp-extender' ); ?></li>
20
- <li><?php _e( 'Require Users Be Logged In', 'yikes-inc-easy-mailchimp-extender' ); ?></li>
21
- </ul>
22
-
23
- </div>
24
-
25
- <hr />
26
-
27
- <div class="feature-section">
28
-
29
- <h2><?php _e( 'Translated & Localized' , 'yikes-inc-easy-mailchimp-extender' ); ?></h2>
30
-
31
- <p style="float:left;width:55%;max-width:55%;"><?php _e( "YIKES Easy Forms for MailChimp was developed with our international users in mind. Not only will you find the plugin to be i18n ready, but you'll also find our datepickers to be localized for mm/dd/yyyy or dd/mm/yyyy formats. Everything is automatic and gets localized based on the language of your site. It's like magic!", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
32
-
33
- <img style="width:40%;max-width:400px;display:block;" src="<?php echo YIKES_MC_URL . 'includes/images/Welcome_Page/arabic-calendar.png'; ?>" alt="<?php _e( 'Localized Arabic Calendar', 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-easy-mc-feature-image yikes-easy-mc-whats-new-section-image">
34
-
35
- </div>
36
-
37
- <hr />
38
-
39
- <div class="feature-section">
40
-
41
- <h2><?php _e( 'Knowledge Base & GlotPress Support' , 'yikes-inc-easy-mailchimp-extender' ); ?></h2>
42
-
43
- <img style="float:left;max-width:300px;margin-right:20px;margin-left:0 !important;" src="<?php echo YIKES_MC_URL . 'includes/images/Welcome_Page/glotpress-translation-percentage.png'; ?>" alt="<?php _e( 'GlotPress Localized Precentage', 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-easy-mc-feature-image yikes-easy-mc-whats-new-section-image">
44
-
45
- <p><?php _e( "Since the initial release of this Easy Forms for MailChimp by YIKES we've been tirelessly working on putting together a collection of help articles ranging from troubleshooting tips to customization options. We've also included a collection of code snippets from some of our most widely asked questions. Now you can access some of our most popular articles right from within the plugin.", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
46
-
47
- <p><h4><a href="<?php echo esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-support#knowledge-base-articles' ) ); ?>" title="<?php _e( 'Support | Knowledge Base' , 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'Support → Knowledge Base Articles', 'yikes-inc-easy-mailchimp-extender' ); ?></a></h4></p>
48
-
49
- <p>&nbsp;</p>
50
-
51
- <p><?php _e( "With a ton of help from the WordPress community, we've been able to support 7 international languages. We're always looking for additional translators, so if you are multi-lingual and can help translate things - hop into glotpress and help contribute to future development of this plugin.", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
52
-
53
- <p><h4><a href="<?php echo esc_url_raw( 'https://translate.wordpress.org/projects/wp-plugins/yikes-inc-easy-mailchimp-extender' ); ?>" target="_blank"title="<?php _e( 'Easy Forms for MailChimp | GlotPress' , 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'GlotPress', 'yikes-inc-easy-mailchimp-extender' ); ?></a></h4></p>
54
-
55
-
56
- </div>
57
-
58
- <hr />
59
-
60
- <div class="feature-section">
61
-
62
- <h2><?php _e( 'Intuitive Settings Page' , 'yikes-inc-easy-mailchimp-extender' ); ?></h2>
63
-
64
- <img src="<?php echo YIKES_MC_URL . 'includes/images/Welcome_Page/settings-page.png'; ?>" alt="<?php _e( 'Settings Page', 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-easy-mc-feature-image yikes-easy-mc-whats-new-section-image">
65
-
66
- <p style="float:left; padding-left:15px;margin-top:5px;"><?php _e( "We've re-laid out the settings page to allow for a more intuitive workflow. All of your settings are neatly tucked away in their respective setting tab.", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
67
 
 
68
  </div>
69
 
70
  </div>
2
 
3
  <div class="feature-section">
4
 
5
+ <h2><?php _e( 'MailChimp API 3.0' , 'yikes-inc-easy-mailchimp-extender' ); ?></h2>
6
 
7
+ <img src="<?php echo YIKES_MC_URL . 'includes/images/Welcome_Page/api-v3-animated.png'; ?>" alt="<?php _e( 'MailChimp API 3.0', 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-easy-mc-feature-image yikes-easy-mc-feature-v3-image yikes-easy-mc-whats-new-section-image">
8
 
9
+ <p><?php _e( "In version 6.3 of Easy Forms for MailChimp we've upgraded to version 3 of the MailChimp API.", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
 
11
+ <p><?php _e( "Upgrading to version 3 will allow us to build bigger and better features for the plugin well into the future!", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
12
  </div>
13
 
14
  </div>
admin/partials/welcome-page/welcome.php CHANGED
@@ -22,9 +22,6 @@
22
  <a class="nav-tab <?php echo $section == 'knowledge-base' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url_raw( admin_url( add_query_arg( array( 'page' => 'yikes-mailchimp-welcome' , 'section' => 'knowledge-base' ), 'admin.php' ) ) ); ?>">
23
  <span class="dashicons dashicons-welcome-learn-more"></span> <?php _e( 'Knowledge Base', 'yikes-inc-easy-mailchimp-extender' ); ?>
24
  </a>
25
- <a class="nav-tab <?php echo $section == 'credits' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url_raw( admin_url( add_query_arg( array( 'page' => 'yikes-mailchimp-welcome' , 'section' => 'credits' ), 'admin.php' ) ) ); ?>">
26
- <span class="dashicons dashicons-arrow-left-alt2"></span><?php _e( 'Credits', 'yikes-inc-easy-mailchimp-extender' ); ?><span class="dashicons dashicons-arrow-right-alt2"></span>
27
- </a>
28
  </h2>
29
  <?php
30
  }
@@ -44,17 +41,17 @@
44
  <div id="yikes-mailchimp-logo"></div>
45
 
46
  <h2 class="welcome-title">
47
- Easy Forms for MailChimp by YIKES | <?php echo __( 'MailChimp Done Right' , 'yikes-inc-easy-mailchimp-extender' ); ?>
48
  </h2>
49
 
50
  <p class="about-text">
51
  <?php
52
  // check if this is a fresh install
53
  if( get_option( 'yikes_easy_mailchimp_activation_date', strtotime( 'now' ) ) == strtotime( 'now' ) ) {
54
- echo sprintf( __( 'Welcome to the most powerful MailChimp integration for WordPress. Easy Forms for MailChimp by YIKES v%s is ready to help take your mailing lists to the next level!' , 'yikes-inc-easy-mailchimp-extender' ) , $this->version );
55
  } else {
56
  // else thank you for updating :)
57
- echo sprintf( __( 'Thank you for updating to the latest version! Easy Forms for MailChimp by YIKES v%s is ready to help take your mailing lists to the next level!' , 'yikes-inc-easy-mailchimp-extender' ) , $this->version );
58
  }
59
  ?>
60
  </p>
22
  <a class="nav-tab <?php echo $section == 'knowledge-base' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url_raw( admin_url( add_query_arg( array( 'page' => 'yikes-mailchimp-welcome' , 'section' => 'knowledge-base' ), 'admin.php' ) ) ); ?>">
23
  <span class="dashicons dashicons-welcome-learn-more"></span> <?php _e( 'Knowledge Base', 'yikes-inc-easy-mailchimp-extender' ); ?>
24
  </a>
 
 
 
25
  </h2>
26
  <?php
27
  }
41
  <div id="yikes-mailchimp-logo"></div>
42
 
43
  <h2 class="welcome-title">
44
+ Easy Forms for MailChimp | <?php echo __( 'MailChimp Done Right' , 'yikes-inc-easy-mailchimp-extender' ); ?>
45
  </h2>
46
 
47
  <p class="about-text">
48
  <?php
49
  // check if this is a fresh install
50
  if( get_option( 'yikes_easy_mailchimp_activation_date', strtotime( 'now' ) ) == strtotime( 'now' ) ) {
51
+ echo sprintf( __( 'Welcome to the most powerful MailChimp integration for WordPress. Easy Forms for MailChimp v%s is ready to help take your mailing lists to the next level!' , 'yikes-inc-easy-mailchimp-extender' ) , $this->version );
52
  } else {
53
  // else thank you for updating :)
54
+ echo sprintf( __( 'Thank you for updating to the latest version! Easy Forms for MailChimp v%s is ready to help take your mailing lists to the next level!' , 'yikes-inc-easy-mailchimp-extender' ) , $this->version );
55
  }
56
  ?>
57
  </p>
class-map.php CHANGED
@@ -6,6 +6,14 @@ return array (
6
  'yikes_inc_easy_mailchimp_dashboard_widgets' => 'admin/partials/dashboard-widgets/class.list-activity-widget.php',
7
  'yikes_inc_easy_mailchimp_extender_widget' => 'admin/partials/front-end-widgets/front-end-widget-form.php',
8
  'yikes_inc_easy_mailchimp_extender_helper' => 'admin/partials/helpers/init.php',
 
 
 
 
 
 
 
 
9
  'yikes_inc_easy_mailchimp_extender_activator' => 'includes/class-yikes-inc-easy-mailchimp-extender-activator.php',
10
  'yikes_inc_easy_mailchimp_extender_form_interface' => 'includes/class-yikes-inc-easy-mailchimp-extender-form-interface.php',
11
  'yikes_inc_easy_mailchimp_extender_forms_abstract' => 'includes/class-yikes-inc-easy-mailchimp-extender-forms-abstract.php',
@@ -29,4 +37,5 @@ return array (
29
  'yikes_easy_mc_woocommerce_checkbox_class' => 'public/classes/checkbox-integrations/class.woocommerce_checkout_form-checkbox.php',
30
  'yikes_easy_mc_checkbox_integration_class' => 'public/classes/checkbox-integrations.php',
31
  'yikes_inc_easy_mailchimp_public_ajax' => 'public/partials/ajax/class.public_ajax.php',
 
32
  );
6
  'yikes_inc_easy_mailchimp_dashboard_widgets' => 'admin/partials/dashboard-widgets/class.list-activity-widget.php',
7
  'yikes_inc_easy_mailchimp_extender_widget' => 'admin/partials/front-end-widgets/front-end-widget-form.php',
8
  'yikes_inc_easy_mailchimp_extender_helper' => 'admin/partials/helpers/init.php',
9
+ 'yikes_inc_easy_mailchimp_api_account' => 'includes/api/class-yikes-inc-eacy-mailchimp-api-account.php',
10
+ 'yikes_inc_easy_mailchimp_api_abstract_items' => 'includes/api/class-yikes-inc-easy-mailchimp-api-abstract-items.php',
11
+ 'yikes_inc_easy_mailchimp_api_account_details' => 'includes/api/class-yikes-inc-easy-mailchimp-api-account-details.php',
12
+ 'yikes_inc_easy_mailchimp_api_chimp_chatter' => 'includes/api/class-yikes-inc-easy-mailchimp-api-chimp-chatter.php',
13
+ 'yikes_inc_easy_mailchimp_api_lists' => 'includes/api/class-yikes-inc-easy-mailchimp-api-lists.php',
14
+ 'yikes_inc_easy_mailchimp_api_manager' => 'includes/api/class-yikes-inc-easy-mailchimp-api-manager.php',
15
+ 'yikes_inc_easy_mailchimp_api_profile' => 'includes/api/class-yikes-inc-easy-mailchimp-api-profile.php',
16
+ 'yikes_inc_easy_mailchimp_api' => 'includes/api/class-yikes-inc-easy-mailchimp-api.php',
17
  'yikes_inc_easy_mailchimp_extender_activator' => 'includes/class-yikes-inc-easy-mailchimp-extender-activator.php',
18
  'yikes_inc_easy_mailchimp_extender_form_interface' => 'includes/class-yikes-inc-easy-mailchimp-extender-form-interface.php',
19
  'yikes_inc_easy_mailchimp_extender_forms_abstract' => 'includes/class-yikes-inc-easy-mailchimp-extender-forms-abstract.php',
37
  'yikes_easy_mc_woocommerce_checkbox_class' => 'public/classes/checkbox-integrations/class.woocommerce_checkout_form-checkbox.php',
38
  'yikes_easy_mc_checkbox_integration_class' => 'public/classes/checkbox-integrations.php',
39
  'yikes_inc_easy_mailchimp_public_ajax' => 'public/partials/ajax/class.public_ajax.php',
40
+ 'yikes_inc_easy_mailchimp_extender_process_submission_handler' => 'public/classes/process/class.process_form_submission_handler.php',
41
  );
includes/api/class-yikes-inc-eacy-mailchimp-api-account.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ */
6
+ class Yikes_Inc_Easy_MailChimp_API_Account extends Yikes_Inc_Easy_MailChimp_API_Abstract_Items {
7
+
8
+ /**
9
+ * Get general account info.
10
+ *
11
+ * @author Jeremy Pry
12
+ *
13
+ * @param bool $use_transient Whether to use a transient.
14
+ *
15
+ * @return array|WP_Error
16
+ */
17
+ public function get_account( $use_transient = true ) {
18
+ $transient_key = 'yikes_eme_account';
19
+ $transient = get_transient( $transient_key );
20
+ if ( false !== $transient && $use_transient ) {
21
+ return $transient;
22
+ }
23
+
24
+ $response = $this->maybe_return_error( $this->get_from_api() );
25
+ if ( ! is_wp_error( $response ) ) {
26
+ set_transient( $transient_key, $response, HOUR_IN_SECONDS );
27
+ }
28
+
29
+ return $response;
30
+ }
31
+ }
includes/api/class-yikes-inc-easy-mailchimp-api-abstract-items.php ADDED
@@ -0,0 +1,272 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Abstract class for retrieving items from the API.
5
+ *
6
+ * @author Jeremy Pry
7
+ * @since 6.3.0
8
+ */
9
+ abstract class Yikes_Inc_Easy_MailChimp_API_Abstract_Items {
10
+
11
+ /**
12
+ * Our API object.
13
+ *
14
+ * @since 6.3.0
15
+ * @var Yikes_Inc_Easy_MailChimp_API
16
+ */
17
+ protected $api;
18
+
19
+ /**
20
+ * The base API path.
21
+ *
22
+ * @since 6.3.0
23
+ * @var string
24
+ */
25
+ protected $base_path = '';
26
+
27
+ /**
28
+ * Whether a V2 API connection is required.
29
+ *
30
+ * @since 6.3.0
31
+ * @var bool
32
+ */
33
+ protected $requires_v2 = false;
34
+
35
+ /**
36
+ * Yikes_Inc_Easy_MailChimp_API_Lists constructor.
37
+ *
38
+ * @since 6.3.0
39
+ *
40
+ * @param Yikes_Inc_Easy_MailChimp_API $api The API connection.
41
+ *
42
+ * @throws \Exception When a V2 API connection is required and not received.
43
+ */
44
+ public function __construct( Yikes_Inc_Easy_MailChimp_API $api ) {
45
+ // If a V2 API is required, throw an exception if we don't have it.
46
+ if ( $this->requires_v2 && ! version_compare( '3.0', $api->get_version(), '>' ) ) {
47
+ throw new \Exception( sprintf( 'The %s class requires a V2 API instance.', get_class( $this ) ) );
48
+ }
49
+
50
+ $this->api = $api;
51
+ }
52
+
53
+ /**
54
+ * Retrieve items from the API, looping as needed.
55
+ *
56
+ * @author Jeremy Pry
57
+ * @since 6.3.0
58
+ *
59
+ * @param string $query The relative path, including any query args.
60
+ * @param string $item_key The item key to look for in results.
61
+ * @param string $index_field The item field to use as an index.
62
+ * @param int $offset_start The offset to start at.
63
+ *
64
+ * @return array|WP_Error
65
+ */
66
+ protected function loop_items( $query, $item_key, $index_field = 'id', $offset_start = 0 ) {
67
+ // Set some initial variables.
68
+ $items = array();
69
+ $offset = $offset_start;
70
+ $total = 0;
71
+
72
+ // Retrieve items, looping if needed.
73
+ do {
74
+ // Add the offset to the query.
75
+ $query = add_query_arg( 'offset', $offset, $query );
76
+ $response = $this->get_from_api( $query );
77
+ if ( is_wp_error( $response ) ) {
78
+ return $response;
79
+ }
80
+
81
+ // If the API gave an error or there are no more lists, break.
82
+ if ( isset( $response['error'] ) ) {
83
+ return new WP_Error( $response['title'], $response['detail'] );
84
+ }
85
+
86
+ if ( empty( $response[ $item_key ] ) ) {
87
+ break;
88
+ }
89
+
90
+ // Update the total number of items if it's still zero.
91
+ if ( 0 === $total ) {
92
+ $total = intval( $response['total_items'] );
93
+ }
94
+
95
+ // Store each new list.
96
+ foreach ( $response[ $item_key ] as $item ) {
97
+ $items[ $item[ $index_field ] ] = $item;
98
+ }
99
+
100
+ $offset += 10;
101
+ } while ( $offset <= $total );
102
+
103
+ return $items;
104
+ }
105
+
106
+ /**
107
+ * Get data from the API
108
+ *
109
+ * @author Jeremy Pry
110
+ * @since 6.3.0
111
+ *
112
+ * @param string $path The relative API path. Leading slash not required.
113
+ * @param array $headers Array of headers to send with the request.
114
+ * @param array $params An array of additional parameters to pass to the request. See WP_Http::request().
115
+ *
116
+ * @return array|WP_Error
117
+ */
118
+ protected function get_from_api( $path = '', $headers = array(), $params = array() ) {
119
+ $response = $this->api->get( $path, $headers, $params );
120
+
121
+ return $this->parse_response( $response );
122
+ }
123
+
124
+ /**
125
+ * Send a PATCH request to the API.
126
+ *
127
+ * @author Jeremy Pry
128
+ * @since 6.3.0
129
+ *
130
+ * @param string $path The relative API path. Leading slash not required.
131
+ * @param mixed $body The body data for the request.
132
+ * @param array $headers Array of headers to send with the request.
133
+ * @param array $params Additional parameters to pass to the request. See WP_Http::request().
134
+ *
135
+ * @return array|WP_Error
136
+ */
137
+ protected function patch_to_api( $path, $body, $headers = array(), $params = array() ) {
138
+ $params = wp_parse_args( array( 'body' => $body ), $params );
139
+ $response = $this->api->patch( $path, $headers, $params );
140
+
141
+ return $this->parse_response( $response );
142
+ }
143
+
144
+ /**
145
+ * Send a POST request to the API.
146
+ *
147
+ * @author Jeremy Pry
148
+ * @since 6.3.0
149
+ *
150
+ * @param string $path The relative API path. Leading slash not required.
151
+ * @param mixed $body The body data for the request.
152
+ * @param array $headers The array of headers to send with the request.
153
+ * @param array $params Additional parameters to pass to the request. See WP_Http::request().
154
+ *
155
+ * @return array|WP_Error
156
+ */
157
+ protected function post_to_api( $path, $body, $headers = array(), $params = array() ) {
158
+ $params = wp_parse_args( array( 'body' => $body ), $params );
159
+ $response = $this->api->post( $path, $headers, $params );
160
+
161
+ return $this->parse_response( $response );
162
+ }
163
+
164
+ /**
165
+ * Send a PUT request to the API.
166
+ *
167
+ * @author Jeremy Pry
168
+ * @since 6.3.0
169
+ *
170
+ * @param string $path The relative API path. Leading slash not required.
171
+ * @param mixed $body The body data for the request.
172
+ * @param array $headers Array of headers to send with the request.
173
+ * @param array $params Additional parameters to pass to the request. See WP_Http::request().
174
+ *
175
+ * @return array|WP_Error
176
+ */
177
+ protected function put_to_api( $path, $body, $headers = array(), $params = array() ) {
178
+ $params = wp_parse_args( array( 'body' => $body ), $params );
179
+ $response = $this->api->put( $path, $headers, $params );
180
+
181
+ return $this->parse_response( $response );
182
+ }
183
+
184
+ /**
185
+ * Return either the valid response, or a WP_Error.
186
+ *
187
+ * @author Jeremy Pry
188
+ * @since 6.3.0
189
+ *
190
+ * @param mixed $response The API response.
191
+ *
192
+ * @return array|WP_Error Array of data when there was no error, or a WP_Error.
193
+ */
194
+ protected function maybe_return_error( $response ) {
195
+ if ( is_wp_error( $response ) ) {
196
+ return $response;
197
+ }
198
+
199
+ if ( isset( $response['error'] ) ) {
200
+ $title = isset( $response['title'] ) ? $response['title'] : $response['name'];
201
+ $detail = isset( $response['detail'] ) ? $response['detail'] : $response['error'];
202
+ $data = isset( $response['errors'] ) ? $response['errors'] : array();
203
+
204
+ return new WP_Error(
205
+ $title,
206
+ $detail,
207
+ array(
208
+ 'status' => (int) $response['status'],
209
+ 'data' => $data,
210
+ )
211
+ );
212
+ }
213
+
214
+ return $response;
215
+ }
216
+
217
+ /**
218
+ * Parse the response and retrieve the body.
219
+ *
220
+ * @author Jeremy Pry
221
+ * @since 6.3.0
222
+ *
223
+ * @param array|WP_Error $response
224
+ *
225
+ * @return array|WP_Error
226
+ */
227
+ protected function parse_response( $response ) {
228
+ if ( is_wp_error( $response ) ) {
229
+ return $response;
230
+ }
231
+
232
+ // JSON-decode the body.
233
+ $body = json_decode( wp_remote_retrieve_body( $response ), true );
234
+
235
+ // MailChimp uses the application/problem+json type for errors
236
+ $headers = wp_remote_retrieve_headers( $response );
237
+ if ( isset( $headers['content-type'] ) ) {
238
+ if ( false !== strpos( $headers['content-type'], 'application/problem+json' ) ) {
239
+ $body['error'] = true;
240
+ }
241
+ }
242
+
243
+ return $body;
244
+ }
245
+
246
+ /**
247
+ * Get a post response from the API.
248
+ *
249
+ * This is an abstracted method to retrieve a POST response from the API using only the base path.
250
+ *
251
+ * @author Jeremy Pry
252
+ * @since 6.3.0
253
+ *
254
+ * @param string $transient_key The string to use for returning a stored transient.
255
+ * @param bool $use_transient Whether to use transients.
256
+ *
257
+ * @return array|WP_Error
258
+ */
259
+ protected function post_base_path( $transient_key, $use_transient = true ) {
260
+ $transient = get_transient( $transient_key );
261
+ if ( false !== $transient && $use_transient ) {
262
+ return $transient;
263
+ }
264
+
265
+ $response = $this->maybe_return_error( $this->post_to_api( $this->base_path, array() ) );
266
+ if ( ! is_wp_error( $response ) ) {
267
+ set_transient( $transient_key, $response, HOUR_IN_SECONDS );
268
+ }
269
+
270
+ return $response;
271
+ }
272
+ }
includes/api/class-yikes-inc-easy-mailchimp-api-account-details.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Get Account details.
5
+ *
6
+ * This uses the V2 API.
7
+ *
8
+ * @deprecated
9
+ *
10
+ * @author Jeremy Pry
11
+ * @since 6.3.0
12
+ */
13
+ class Yikes_Inc_Easy_MailChimp_API_Account_Details extends Yikes_Inc_Easy_MailChimp_API_Abstract_Items {
14
+
15
+ /**
16
+ * The base API path.
17
+ *
18
+ * @since 6.3.0
19
+ * @var string
20
+ */
21
+ protected $base_path = 'helper/account-details.json';
22
+
23
+ /**
24
+ * Whether a V2 API connection is required.
25
+ *
26
+ * @since 6.3.0
27
+ * @var bool
28
+ */
29
+ protected $requires_v2 = true;
30
+
31
+ /**
32
+ * Get the account details.
33
+ *
34
+ * This is meant to use the V2 API.
35
+ *
36
+ * @author Jeremy Pry
37
+ * @since 6.3.0
38
+ *
39
+ * @param bool $use_transient Whether to use a transient in the response.
40
+ *
41
+ * @return array|WP_Error
42
+ */
43
+ public function account_details( $use_transient = true ) {
44
+ $transient_key = 'yikes_eme_account_details';
45
+
46
+ return $this->post_base_path( $transient_key, $use_transient );
47
+ }
48
+ }
includes/api/class-yikes-inc-easy-mailchimp-api-chimp-chatter.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Chimp Chatter handler.
5
+ *
6
+ * Note that this expects a V2 API object.
7
+ *
8
+ * @deprecated
9
+ *
10
+ * @author Jeremy Pry
11
+ * @since 6.3.0
12
+ */
13
+ class Yikes_Inc_Easy_MailChimp_API_Chimp_Chatter extends Yikes_Inc_Easy_MailChimp_API_Abstract_Items {
14
+
15
+ /**
16
+ * The base API path.
17
+ *
18
+ * @since 6.3.0
19
+ * @var string
20
+ */
21
+ protected $base_path = 'helper/chimp-chatter.json';
22
+
23
+ /**
24
+ * Whether a V2 API connection is required.
25
+ *
26
+ * @since 6.3.0
27
+ * @var bool
28
+ */
29
+ protected $requires_v2 = true;
30
+
31
+ /**
32
+ * Retrieve the Chimp Chatter
33
+ *
34
+ * @author Jeremy Pry
35
+ * @since 6.3.0
36
+ *
37
+ * @param bool $use_transient Whether to use a transient in the response.
38
+ *
39
+ * @return array|WP_Error
40
+ */
41
+ public function chimp_chatter( $use_transient = true ) {
42
+ $transient_key = 'yikes_eme_chimp_chatter';
43
+
44
+ return $this->post_base_path( $transient_key, $use_transient );
45
+ }
46
+ }
includes/api/class-yikes-inc-easy-mailchimp-api-lists.php ADDED
@@ -0,0 +1,419 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ */
6
+ class Yikes_Inc_Easy_MailChimp_API_Lists extends Yikes_Inc_Easy_MailChimp_API_Abstract_Items {
7
+
8
+ /**
9
+ * Our API object.
10
+ *
11
+ * @var Yikes_Inc_Easy_MailChimp_API
12
+ */
13
+ protected $api;
14
+
15
+ /**
16
+ * The base API path.
17
+ *
18
+ * @var string
19
+ */
20
+ protected $base_path = 'lists';
21
+
22
+ /**
23
+ * Get all of the lists from the API.
24
+ *
25
+ * @author Jeremy Pry
26
+ *
27
+ * @param array $limit_fields Array of fields to limit the results. The fields should be keys in the array.
28
+ * @param bool $use_transient Whether to use a transient.
29
+ *
30
+ * @return array|WP_Error The array of lists, indexed by list ID, or WP_Error if the API gave us an error.
31
+ */
32
+ public function get_lists( $limit_fields = array(), $use_transient = true ) {
33
+ // Ensure the ID and total_items are always present in the limit fields
34
+ $limit_fields = $this->compute_limit_fields(
35
+ $limit_fields,
36
+ array(
37
+ 'lists.id' => true,
38
+ 'total_items' => true,
39
+ )
40
+ );
41
+
42
+ $joined_fields = join( ',', array_keys( $limit_fields ) );
43
+ $transient_key = empty( $limit_fields ) ? 'yikes_eme_lists' : "yikes_eme_lists_{$joined_fields}";
44
+ $transient = get_transient( $transient_key );
45
+ if ( false !== $transient && $use_transient ) {
46
+ return $transient;
47
+ }
48
+
49
+ // Add the limiting fields to the query.
50
+ $query = add_query_arg( 'fields', $joined_fields, $this->base_path );
51
+ $lists = $this->maybe_return_error( $this->loop_items( $query, 'lists' ) );
52
+
53
+ if ( is_wp_error( $lists ) ) {
54
+ return $lists;
55
+ }
56
+
57
+ set_transient( $transient_key, $lists, HOUR_IN_SECONDS );
58
+
59
+ return $lists;
60
+ }
61
+
62
+ /**
63
+ * Get a single list from the API.
64
+ *
65
+ * @author Jeremy Pry
66
+ *
67
+ * @param string $list_id The list ID in MailChimp.
68
+ * @param array $limit_fields Array of fields to limit the results. The fields should be keys in the array.
69
+ * @param bool $use_transient Whether to use a transient.
70
+ *
71
+ * @return array|WP_Error
72
+ */
73
+ public function get_list( $list_id, $limit_fields = array(), $use_transient = true ) {
74
+ $transient_key = "yikes_eme_list_{$list_id}";
75
+ $limit_fields = $this->compute_limit_fields( $limit_fields, array() );
76
+ $joined_fields = join( ',', array_keys( $limit_fields ) );
77
+
78
+ if ( ! empty( $limit_fields ) ) {
79
+ $transient_key .= "_{$joined_fields}";
80
+ }
81
+
82
+ $transient = get_transient( $transient_key );
83
+
84
+ if ( false !== $transient && $use_transient ) {
85
+ return $transient;
86
+ }
87
+
88
+ $path = "{$this->base_path}/{$list_id}";
89
+ $response = $this->maybe_return_error( $this->get_from_api( $path ) );
90
+
91
+ if ( ! is_wp_error( $response ) ) {
92
+ set_transient( $transient_key, $response, HOUR_IN_SECONDS );
93
+ }
94
+
95
+ return $response;
96
+ }
97
+
98
+ /**
99
+ * Get an array of list IDs from the API.
100
+ *
101
+ * Utilizes a transient for caching.
102
+ *
103
+ * @author Jeremy Pry
104
+ *
105
+ * @param bool $use_transient Whether to use the transient.
106
+ *
107
+ * @return array|WP_Error Array of list IDs or WP_Error object.
108
+ */
109
+ public function get_list_ids( $use_transient = true ) {
110
+ $transient = get_transient( 'yikesinc_eme_list_ids' );
111
+ if ( false !== $transient && $use_transient ) {
112
+ return $transient;
113
+ }
114
+
115
+ $lists = $this->get_lists( array( 'lists.id' => true ) );
116
+ if ( is_wp_error( $lists ) ) {
117
+ return $lists;
118
+ }
119
+
120
+ $list_ids = array_keys( $lists );
121
+ set_transient( 'yikesinc_eme_list_ids', $list_ids, HOUR_IN_SECONDS );
122
+
123
+ return $list_ids;
124
+ }
125
+
126
+ /**
127
+ * Get the merge fields for a particular list.
128
+ *
129
+ * @author Jeremy Pry
130
+ *
131
+ * @param string $list_id The list ID in MailChimp.
132
+ * @param bool $use_transient Whether to use a transient.
133
+ *
134
+ * @return array|WP_Error
135
+ */
136
+ public function get_merge_fields( $list_id, $use_transient = true ) {
137
+ $transient = get_transient( "yikes_eme_merge_variables_{$list_id}" );
138
+ if ( false !== $transient && $use_transient ) {
139
+ return $transient;
140
+ }
141
+
142
+ $path = "{$this->base_path}/{$list_id}/merge-fields";
143
+ $merge_fields = $this->loop_items( $path, 'merge_fields', 'merge_id' );
144
+
145
+ if ( is_wp_error( $merge_fields ) ) {
146
+ return $merge_fields;
147
+ }
148
+
149
+ // Get the whole merge object, minus the fields we already retrieved.
150
+ $path = add_query_arg( 'exclude_fields', 'merge_fields', $path );
151
+ $merge_object = $this->get_from_api( $path );
152
+
153
+ if ( is_wp_error( $merge_object ) ) {
154
+ return $merge_object;
155
+ }
156
+
157
+ // The API doesn't give us the email field, so let's create that ourselves.
158
+ $email_field = array(
159
+ 'merge_id' => 0,
160
+ 'tag' => 'EMAIL',
161
+ 'name' => __( 'Email Address' ),
162
+ 'type' => 'email',
163
+ 'required' => true,
164
+ 'default_value' => '',
165
+ 'public' => true,
166
+ 'display_order' => 1,
167
+ 'options' => array(
168
+ 'size' => 25,
169
+ ),
170
+ 'list_id' => $list_id,
171
+ '_links' => array(),
172
+ );
173
+
174
+ array_unshift( $merge_fields, $email_field );
175
+ $merge_object['merge_fields'] = $merge_fields;
176
+ set_transient( "yikes_eme_merge_variables_{$list_id}", $merge_object, HOUR_IN_SECONDS );
177
+
178
+ return $merge_object;
179
+ }
180
+
181
+ /**
182
+ * Get the Interest Categories for a particular list.
183
+ *
184
+ * @author Jeremy Pry
185
+ *
186
+ * @param string $list_id The list ID.
187
+ * @param bool $use_transient Whether to use a transient.
188
+ *
189
+ * @return array|WP_Error
190
+ */
191
+ public function get_interest_categories( $list_id, $use_transient = true ) {
192
+ $transient = get_transient( "yikes_eme_interest_categories_{$list_id}" );
193
+ if ( false !== $transient && $use_transient ) {
194
+ return $transient;
195
+ }
196
+
197
+ $base_path = "{$this->base_path}/{$list_id}/interest-categories";
198
+ $categories = $this->loop_items( $base_path, 'categories' );
199
+
200
+ // Check for Error, and maybe return early.
201
+ if ( is_wp_error( $categories ) ) {
202
+ return $categories;
203
+ }
204
+
205
+ // Loop through each interest category and attach the items.
206
+ foreach ( $categories as $id => &$category ) {
207
+ $path = "{$base_path}/{$id}/interests";
208
+ $interests = $this->loop_items( $path, 'interests' );
209
+
210
+ // Check for Error, and maybe return early.
211
+ if ( is_wp_error( $interests ) ) {
212
+ return $interests;
213
+ }
214
+
215
+ $category['items'] = $interests;
216
+ }
217
+
218
+ set_transient( "yikes_eme_interest_categories_{$list_id}", $categories, HOUR_IN_SECONDS );
219
+
220
+ return $categories;
221
+ }
222
+
223
+ /**
224
+ * Get segments for a list.
225
+ *
226
+ * @author Jeremy Pry
227
+ *
228
+ * @param string $list_id The list ID.
229
+ * @param bool $use_transient Whether to use a transient.
230
+ *
231
+ * @return array|WP_Error
232
+ */
233
+ public function get_segments( $list_id, $use_transient = true ) {
234
+ $transient = get_transient( "yikes_eme_segments_{$list_id}" );
235
+ if ( false !== $transient && $use_transient ) {
236
+ return $transient;
237
+ }
238
+
239
+ // @todo: Include members in the segments?
240
+ $base_path = "{$this->base_path}/{$list_id}/segments";
241
+ $base_path = add_query_arg( 'type', 'saved', $base_path );
242
+ $segments = $this->maybe_return_error( $this->loop_items( $base_path, 'segments' ) );
243
+
244
+ if ( is_wp_error( $segments ) ) {
245
+ return $segments;
246
+ }
247
+
248
+ set_transient( "yikes_eme_segments_{$list_id}", $segments, HOUR_IN_SECONDS );
249
+
250
+ return $segments;
251
+ }
252
+
253
+ /**
254
+ * Get the members associated with a list.
255
+ *
256
+ * The members will be keyed to their email address.
257
+ *
258
+ * @author Jeremy Pry
259
+ *
260
+ * @param string $list_id The list ID.
261
+ * @param string $status The subscriber status.
262
+ * @param bool $use_transient Whether to use a transient.
263
+ *
264
+ * @return array|WP_Error
265
+ */
266
+ public function get_members( $list_id, $status = 'subscribed', $use_transient = true ) {
267
+ $transient = get_transient( "yikes_eme_members_{$list_id}" );
268
+ if ( false !== $transient && $use_transient ) {
269
+ return $transient;
270
+ }
271
+
272
+ $base_path = add_query_arg( 'status', $status, "{$this->base_path}/{$list_id}/members" );
273
+ $members = $this->maybe_return_error( $this->loop_items( $base_path, 'members', 'email_address' ) );
274
+
275
+ if ( is_wp_error( $members ) ) {
276
+ return $members;
277
+ }
278
+
279
+ set_transient( "yikes_eme_members_{$list_id}", $members, HOUR_IN_SECONDS );
280
+
281
+ return $members;
282
+ }
283
+
284
+ /**
285
+ * Get data for an individual member.
286
+ *
287
+ * @author Jeremy Pry
288
+ *
289
+ * @param string $list_id The list ID.
290
+ * @param string $member_id The member ID. This is the MD5 hash of the email address.
291
+ * @param bool $use_transient Whether to use a transient.
292
+ *
293
+ * @return array|WP_Error
294
+ */
295
+ public function get_member( $list_id, $member_id, $use_transient = true ) {
296
+ $transient = get_transient( "yikes_eme_member_{$list_id}_{$member_id}" );
297
+ if ( false !== $transient && $use_transient ) {
298
+ return $transient;
299
+ }
300
+
301
+ $path = "{$this->base_path}/{$list_id}/members/{$member_id}";
302
+ $member = $this->maybe_return_error( $this->get_from_api( $path ) );
303
+
304
+ if ( is_wp_error( $member ) ) {
305
+ return $member;
306
+ }
307
+
308
+ set_transient( "yikes_eme_member_{$list_id}_{$member_id}", $member, HOUR_IN_SECONDS );
309
+
310
+ return $member;
311
+ }
312
+
313
+ /**
314
+ * Get the lists that a member belongs to.
315
+ *
316
+ * @author Jeremy Pry
317
+ *
318
+ * @param string $member_id The unique member ID. This is the MD5 hash of the email address.
319
+ * @param bool $use_transient Whether to use a transient.
320
+ *
321
+ * @return array
322
+ */
323
+ public function get_members_lists( $member_id, $use_transient = true ) {
324
+ $transient = get_transient( "yikes_eme_member_lists_{$member_id}" );
325
+ if ( false !== $transient && $use_transient ) {
326
+ return $transient;
327
+ }
328
+
329
+ $member_lists = array();
330
+ $list_ids = $this->get_list_ids();
331
+ if ( is_wp_error( $list_ids ) ) {
332
+ return array();
333
+ }
334
+
335
+ foreach ( $list_ids as $list_id ) {
336
+ $member = $this->get_member( $list_id, $member_id );
337
+ if ( is_wp_error( $member ) ) {
338
+ continue;
339
+ }
340
+ $member_lists[ $list_id ] = $member;
341
+ }
342
+
343
+ set_transient( "yikes_eme_member_lists_{$member_id}", $member_lists, HOUR_IN_SECONDS );
344
+
345
+ return $member_lists;
346
+ }
347
+
348
+ /**
349
+ * Subscribe a member to the list.
350
+ *
351
+ * For keys to include in the $member_data array, see the MailChimp API documentation (link below).
352
+ *
353
+ * @author Jeremy Pry
354
+ * @see http://developer.mailchimp.com/documentation/mailchimp/reference/lists/members/#edit-put_lists_list_id_members_subscriber_hash
355
+ *
356
+ * @param string $list_id The list ID.
357
+ * @param string $member_id The unique member ID. This is the MD5 hash of the email address.
358
+ * @param array $member_data Array of member data.
359
+ *
360
+ * @return array|WP_Error
361
+ */
362
+ public function member_subscribe( $list_id, $member_id, $member_data ) {
363
+ $path = "{$this->base_path}/{$list_id}/members/{$member_id}";
364
+ $response = $this->put_to_api( $path, $member_data );
365
+
366
+ // Clear the list members transient
367
+ delete_transient( "yikes_eme_members_{$list_id}" );
368
+
369
+ return $this->maybe_return_error( $response );
370
+ }
371
+
372
+ /**
373
+ * Unsubscribe a member from the list.
374
+ *
375
+ * @author Jeremy Pry
376
+ *
377
+ * @param string $list_id The list ID.
378
+ * @param string $member_id The member ID. This is the MD5 hash of the email address.
379
+ *
380
+ * @return array|WP_Error
381
+ */
382
+ public function member_unsubscribe( $list_id, $member_id ) {
383
+ $path = "{$this->base_path}/{$list_id}/members/{$member_id}";
384
+ $body = array( 'status' => 'unsubscribed' );
385
+ $response = $this->patch_to_api( $path, $body );
386
+
387
+ // Clear the list members transient
388
+ delete_transient( "yikes_eme_members_{$list_id}" );
389
+
390
+ return $this->maybe_return_error( $response );
391
+ }
392
+
393
+ /**
394
+ * Ensure that an array of limit fields includes defaults.
395
+ *
396
+ * Both the $fields and $required arrays should be key-based arrays.
397
+ *
398
+ * @author Jeremy Pry
399
+ *
400
+ * @param array $fields The limit fields.
401
+ * @param array $required The required fields.
402
+ *
403
+ * @return array
404
+ */
405
+ protected function compute_limit_fields( $fields, $required ) {
406
+ // Don't add required fields if there aren't any limits at all.
407
+ if ( empty( $fields ) || empty( $required ) ) {
408
+ return $fields;
409
+ }
410
+
411
+ foreach ( $required as $key => $value ) {
412
+ if ( ! isset( $fields[ $key ] ) ) {
413
+ $fields[ $key ] = true;
414
+ }
415
+ }
416
+
417
+ return $fields;
418
+ }
419
+ }
includes/api/class-yikes-inc-easy-mailchimp-api-manager.php ADDED
@@ -0,0 +1,255 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * The MailChimp API manager.
5
+ *
6
+ * Used to retrieve API functionality for use elsewhere.
7
+ *
8
+ * @author Jeremy Pry
9
+ * @since 6.3.0
10
+ */
11
+ class Yikes_Inc_Easy_MailChimp_API_Manager {
12
+
13
+ /**
14
+ * The account details instance.
15
+ *
16
+ * @since 6.3.0
17
+ * @var Yikes_Inc_Easy_MailChimp_API_Account_Details
18
+ */
19
+ protected $account_details = null;
20
+
21
+ /**
22
+ * The account manager instance.
23
+ *
24
+ * @since 6.3.0
25
+ * @var Yikes_Inc_Easy_MailChimp_API_Account
26
+ */
27
+ protected $account_manager = null;
28
+
29
+ /**
30
+ * Our API instance.
31
+ *
32
+ * @since 6.3.0
33
+ * @var Yikes_Inc_Easy_MailChimp_API[]
34
+ */
35
+ protected $api = array();
36
+
37
+ /**
38
+ * The whole API key.
39
+ *
40
+ * @since 6.3.0
41
+ * @var string
42
+ */
43
+ protected $api_key = '';
44
+
45
+ /**
46
+ * Yikes_Inc_Easy_MailChimp_API_Chimp_Chatter instance.
47
+ *
48
+ * @since 6.3.0
49
+ * @var Yikes_Inc_Easy_MailChimp_API_Chimp_Chatter
50
+ */
51
+ protected $chimp_chatter = null;
52
+
53
+ /**
54
+ * The Datacenter for the MailChimp account.
55
+ *
56
+ * @since 6.3.0
57
+ * @var string
58
+ */
59
+ protected $dc = '';
60
+
61
+ /**
62
+ * The API key with the datacenter portion removed.
63
+ *
64
+ * @since 6.3.0
65
+ * @var string
66
+ */
67
+ protected $key = '';
68
+
69
+ /**
70
+ * The list manager instance.
71
+ *
72
+ * @since 6.3.0
73
+ * @var Yikes_Inc_Easy_MailChimp_API_Lists
74
+ */
75
+ protected $list_manager = null;
76
+
77
+ /**
78
+ * Yikes_Inc_Easy_MailChimp_API_Profile instance.
79
+ *
80
+ * @since 6.3.0
81
+ * @var Yikes_Inc_Easy_MailChimp_API_Profile
82
+ */
83
+ protected $profile = null;
84
+
85
+ /**
86
+ * Yikes_Inc_Easy_MailChimp_API_Manager constructor.
87
+ *
88
+ * @since 6.3.0
89
+ *
90
+ * @param string $api_key The full API key from MailChimp.
91
+ */
92
+ public function __construct( $api_key = '' ) {
93
+ if ( empty( $api_key ) ) {
94
+ $api_key = yikes_get_mc_api_key();
95
+ }
96
+
97
+ $this->api_key = $api_key;
98
+ $parts = $this->get_api_key_parts();
99
+ $this->key = $parts['key'];
100
+ $this->dc = $parts['dc'];
101
+ }
102
+
103
+ /**
104
+ * Get the API key.
105
+ *
106
+ * @author Jeremy Pry
107
+ * @since 6.3.0
108
+ * @return string The API key with the datacenter portion removed.
109
+ */
110
+ public function get_api_key() {
111
+ return $this->key;
112
+ }
113
+
114
+ /**
115
+ * Get the array of API Key parts.
116
+ *
117
+ * @author Jeremy Pry
118
+ * @since 6.3.0
119
+ * @return array Associative array of API key parts.
120
+ */
121
+ protected function get_api_key_parts() {
122
+ $parts = explode( '-', $this->api_key );
123
+
124
+ return array(
125
+ 'key' => $parts[0],
126
+ 'dc' => isset( $parts[1] ) ? $parts[1] : '',
127
+ );
128
+ }
129
+
130
+ /**
131
+ * Get the Datacenter for the MailChimp account.
132
+ *
133
+ * @author Jeremy Pry
134
+ * @since 6.3.0
135
+ * @return string The datacenter for the MailChimp Account.
136
+ */
137
+ public function get_datacenter() {
138
+ return $this->dc;
139
+ }
140
+
141
+ /**
142
+ * Get the default version of the API to use.
143
+ *
144
+ * @author Jeremy Pry
145
+ * @since 6.3.0
146
+ * @return string
147
+ */
148
+ public function get_default_api_version() {
149
+ /**
150
+ * Filter the default MailChimp API version.
151
+ *
152
+ * @since 6.3.0
153
+ *
154
+ * @param string $version The default MailChimp API version.
155
+ */
156
+ return apply_filters( 'yikesinc_eme_default_api_version', '3.0' );
157
+ }
158
+
159
+ /**
160
+ * Get the API instance.
161
+ *
162
+ * @author Jeremy Pry
163
+ * @since 6.3.0
164
+ *
165
+ * @param string $version The API version instance to retrieve.
166
+ *
167
+ * @return Yikes_Inc_Easy_MailChimp_API
168
+ */
169
+ public function get_api( $version = '' ) {
170
+ $version = $version ?: $this->get_default_api_version();
171
+
172
+ if ( ! array_key_exists( $version, $this->api ) || null === $this->api[ $version ] ) {
173
+ $this->api[ $version ] = new Yikes_Inc_Easy_MailChimp_API( $this->get_datacenter(), $this->get_api_key(), $version );
174
+ }
175
+
176
+ return $this->api[ $version ];
177
+ }
178
+
179
+ /**
180
+ * Get the List Manager instance.
181
+ *
182
+ * @author Jeremy Pry
183
+ * @since 6.3.0
184
+ * @return Yikes_Inc_Easy_MailChimp_API_Lists
185
+ */
186
+ public function get_list_handler() {
187
+ if ( null == $this->list_manager ) {
188
+ $this->list_manager = new Yikes_Inc_Easy_MailChimp_API_Lists( $this->get_api() );
189
+ }
190
+
191
+ return $this->list_manager;
192
+ }
193
+
194
+ /**
195
+ * Get the Account Manager instance.
196
+ *
197
+ * @author Jeremy Pry
198
+ * @since 6.3.0
199
+ * @return Yikes_Inc_Easy_MailChimp_API_Account
200
+ */
201
+ public function get_account_handler() {
202
+ if ( null === $this->account_manager ) {
203
+ $this->account_manager = new Yikes_Inc_Easy_MailChimp_API_Account( $this->get_api() );
204
+ }
205
+
206
+ return $this->account_manager;
207
+ }
208
+
209
+ /**
210
+ * Get the chimp chatter instance.
211
+ *
212
+ * @author Jeremy Pry
213
+ * @since 6.3.0
214
+ * @return Yikes_Inc_Easy_MailChimp_API_Chimp_Chatter
215
+ */
216
+ public function get_chimp_chatter() {
217
+ if ( null === $this->chimp_chatter ) {
218
+ $this->chimp_chatter = new Yikes_Inc_Easy_MailChimp_API_Chimp_Chatter( $this->get_api( '2.0' ) );
219
+ }
220
+
221
+ return $this->chimp_chatter;
222
+ }
223
+
224
+ /**
225
+ * Get the User Profile instance.
226
+ *
227
+ * This uses the V2 API.
228
+ *
229
+ * @author Jeremy Pry
230
+ * @since 6.3.0
231
+ * @return Yikes_Inc_Easy_MailChimp_API_Profile
232
+ */
233
+ public function get_profile_handler() {
234
+ if ( null === $this->profile ) {
235
+ $this->profile = new Yikes_Inc_Easy_MailChimp_API_Profile( $this->get_api( '2.0' ) );
236
+ }
237
+
238
+ return $this->profile;
239
+ }
240
+
241
+ /**
242
+ * Get the Account Details instance.
243
+ *
244
+ * @author Jeremy Pry
245
+ * @since 6.3.0
246
+ * @return Yikes_Inc_Easy_MailChimp_API_Account_Details
247
+ */
248
+ public function get_account_details_handler() {
249
+ if ( null === $this->account_details ) {
250
+ $this->account_details = new Yikes_Inc_Easy_MailChimp_API_Account_Details( $this->get_api( '2.0' ) );
251
+ }
252
+
253
+ return $this->account_details;
254
+ }
255
+ }
includes/api/class-yikes-inc-easy-mailchimp-api-profile.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * User Profile handler.
5
+ *
6
+ * Note: This needs the V2 endpoint.
7
+ *
8
+ * @deprecated
9
+ *
10
+ * @author Jeremy Pry
11
+ * @since 6.3.0
12
+ */
13
+ class Yikes_Inc_Easy_MailChimp_API_Profile extends Yikes_Inc_Easy_MailChimp_API_Abstract_Items {
14
+
15
+ /**
16
+ * The base API path.
17
+ *
18
+ * @since 6.3.0
19
+ * @var string
20
+ */
21
+ protected $base_path = 'users/profile.json';
22
+
23
+ /**
24
+ * Whether a V2 API connection is required.
25
+ *
26
+ * @since 6.3.0
27
+ * @var bool
28
+ */
29
+ protected $requires_v2 = true;
30
+
31
+ /**
32
+ * Get profile data from the API.
33
+ *
34
+ * @author Jeremy Pry
35
+ * @since 6.3.0
36
+ *
37
+ * @param bool $use_transients Whether to use a transient in the response.
38
+ *
39
+ * @return array|WP_Error
40
+ */
41
+ public function get_profile( $use_transients = true ) {
42
+ $transient_key = 'yikes_eme_user_profile';
43
+
44
+ return $this->post_base_path( $transient_key, $use_transients );
45
+ }
46
+ }
includes/api/class-yikes-inc-easy-mailchimp-api.php ADDED
@@ -0,0 +1,382 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * A class to handle requests to the MailChimp API.
5
+ *
6
+ * @author Jeremy Pry
7
+ * @since 6.3.0
8
+ */
9
+ class Yikes_Inc_Easy_MailChimp_API {
10
+
11
+ /**
12
+ * The API key.
13
+ *
14
+ * @since 6.3.0
15
+ * @var string
16
+ */
17
+ protected $api_key = '';
18
+
19
+ /**
20
+ * The URL for the API.
21
+ *
22
+ * @since 6.3.0
23
+ * @var string
24
+ */
25
+ protected $api_url = '';
26
+
27
+ /**
28
+ * The API version.
29
+ *
30
+ * @since 6.3.0
31
+ * @var string
32
+ */
33
+ protected $api_version = '';
34
+
35
+ /**
36
+ * The datacenter where the MailChimp account is located.
37
+ *
38
+ * This is typically part of the API Key.
39
+ *
40
+ * @since 6.3.0
41
+ * @var string
42
+ */
43
+ protected $datacenter = '';
44
+
45
+ /**
46
+ * Yikes_Inc_Easy_MailChimp_API constructor.
47
+ *
48
+ * @since 6.3.0
49
+ *
50
+ * @param string $datacenter The datacenter string where the MailChimp account is located.
51
+ * @param string $api_key The base API key, without the datacenter appended.
52
+ * @param string $api_version The API version to use.
53
+ */
54
+ public function __construct( $datacenter, $api_key, $api_version ) {
55
+ $this->datacenter = $datacenter;
56
+ $this->api_key = $api_key;
57
+ $this->api_version = $api_version;
58
+ $this->api_url = "https://{$this->datacenter}.api.mailchimp.com/{$this->api_version}";
59
+ }
60
+
61
+ /**
62
+ * Send a DELETE request to the MailChimp API.
63
+ *
64
+ * @author Jeremy Pry
65
+ * @since 6.3.0
66
+ *
67
+ * @param string $path The relative path for the request.
68
+ * @param array $headers Array of headers to send with the request.
69
+ * @param array $params An array of additional parameters to pass to the request. See WP_Http::request().
70
+ *
71
+ * @return array|WP_Error
72
+ */
73
+ public function delete( $path = '', $headers = array(), $params = array() ) {
74
+ return $this->send_request( $path, 'DELETE', $headers, $params );
75
+ }
76
+
77
+ /**
78
+ * Send a GET request to the MailChimp API.
79
+ *
80
+ * @author Jeremy Pry
81
+ * @since 6.3.0
82
+ *
83
+ * @param string $path The relative path for the request.
84
+ * @param array $headers Array of headers to send with the request.
85
+ * @param array $params An array of additional parameters to pass to the request. See WP_Http::request().
86
+ *
87
+ * @return array|WP_Error
88
+ */
89
+ public function get( $path = '', $headers = array(), $params = array() ) {
90
+ return $this->send_request( $path, 'GET', $headers, $params );
91
+ }
92
+
93
+ /**
94
+ * Send a PATCH request to the MailChimp API.
95
+ *
96
+ * @author Jeremy Pry
97
+ * @since 6.3.0
98
+ *
99
+ * @param string $path The relative path for the request.
100
+ * @param array $headers Array of headers to send with the request.
101
+ * @param array $params An array of additional parameters to pass to the request. See WP_Http::request().
102
+ *
103
+ * @return array|WP_Error
104
+ */
105
+ public function patch( $path = '', $headers = array(), $params = array() ) {
106
+ if ( ! isset( $params['body'] ) ) {
107
+ return new WP_Error(
108
+ 'yikesinc_eme_missing_body',
109
+ sprintf(
110
+ /* translators: %s refers to the request method. */
111
+ __( '%s requests require a body as one of the parameters.', 'yikes-inc-easy-mailchimp-extender' ),
112
+ 'PATCH'
113
+ )
114
+ );
115
+ }
116
+
117
+ return $this->send_request( $path, 'PATCH', $headers, $params );
118
+ }
119
+
120
+ /**
121
+ * Send a POST request to the MailChimp API.
122
+ *
123
+ * @author Jeremy Pry
124
+ * @since 6.3.0
125
+ *
126
+ * @param string $path The relative path for the request.
127
+ * @param array $headers Array of headers to send with the request.
128
+ * @param array $params An array of additional parameters to pass to the request. See WP_Http::request().
129
+ *
130
+ * @return array|WP_Error
131
+ */
132
+ public function post( $path = '', $headers = array(), $params = array() ) {
133
+ if ( ! isset( $params['body'] ) ) {
134
+ return new WP_Error(
135
+ 'yikesinc_eme_missing_body',
136
+ sprintf(
137
+ /* translators: %s refers to the request method. */
138
+ __( '%s requests require a body as one of the parameters.', 'yikes-inc-easy-mailchimp-extender' ),
139
+ 'POST'
140
+ )
141
+ );
142
+ }
143
+
144
+ return $this->send_request( $path, 'POST', $headers, $params );
145
+ }
146
+
147
+ /**
148
+ * Send a PUT request to the MailChimp API.
149
+ *
150
+ * @author Jeremy Pry
151
+ * @since 6.3.0
152
+ *
153
+ * @param string $path The relative path for the request.
154
+ * @param array $headers Array of headers to send with the request.
155
+ * @param array $params An array of additional parameters to pass to the request. See WP_Http::request().
156
+ *
157
+ * @return array|WP_Error
158
+ */
159
+ public function put( $path = '', $headers = array(), $params = array() ) {
160
+ if ( ! isset( $params['body'] ) ) {
161
+ return new WP_Error(
162
+ 'yikesinc_eme_missing_body',
163
+ sprintf(
164
+ /* translators: %s refers to the request method. */
165
+ __( '%s requests require a body as one of the parameters.', 'yikes-inc-easy-mailchimp-extender' ),
166
+ 'PUT'
167
+ )
168
+ );
169
+ }
170
+
171
+ return $this->send_request( $path, 'PUT', $headers, $params );
172
+ }
173
+
174
+ /**
175
+ * Send a request to the MailChimp API.
176
+ *
177
+ * @author Jeremy Pry
178
+ * @since 6.3.0
179
+ *
180
+ * @param string $path The relative path for the request.
181
+ * @param string $method The method to use for the request.
182
+ * @param array $headers Array of headers to send with the request.
183
+ * @param array $params An array of additional parameters to pass to the request. See WP_Http::request().
184
+ *
185
+ * @return array|WP_Error
186
+ */
187
+ protected function send_request( $path, $method, $headers = array(), $params = array() ) {
188
+
189
+ // Remove leading slashes from $path, as we'll add that ourselves later.
190
+ $path = ltrim( $path, '/' );
191
+
192
+ $args = $this->build_request_args( $path, $method, $headers, $params );
193
+
194
+ /**
195
+ * Filter the URL used for a request to the MailChimp API.
196
+ *
197
+ * @since 6.3.0
198
+ *
199
+ * @param string $url The URL to use.
200
+ * @param string $path The relative path for the request.
201
+ */
202
+ $url = apply_filters( 'yikesinc_eme_api_url', sprintf( '%s/%s', $this->api_url, $path ), $path );
203
+
204
+ return wp_remote_request( $url, $args );
205
+ }
206
+
207
+ /**
208
+ * Get the user agent to use with a request to the API.
209
+ *
210
+ * @author Jeremy Pry
211
+ * @since 6.3.0
212
+ * @return string The user agent string.
213
+ */
214
+ protected function get_user_agent() {
215
+ global $wp_version;
216
+
217
+ $user_agent = 'WordPress/' . $wp_version . '; Yikes Easy MailChimp Extender; ' . get_bloginfo( 'url' );
218
+ /**
219
+ * Filter the User Agent used in API requests.
220
+ *
221
+ * @since 6.3.0
222
+ *
223
+ * @param string $user_agent The user agent to send with API requests.
224
+ */
225
+ $user_agent = apply_filters( 'yikesinc_eme_api_user_agent', $user_agent );
226
+
227
+ return $user_agent;
228
+ }
229
+
230
+ /**
231
+ * Get the Auth Headers for an API requests.
232
+ *
233
+ * @author Jeremy Pry
234
+ * @since 6.3.0
235
+ * @return array The array of auth headers for an API request.
236
+ */
237
+ protected function get_auth_headers() {
238
+ /*
239
+ * According to the MailChimp API docs, you can use any string you want, and the API
240
+ * key as the password. We're just going to use "yikesmailchimp" as the user.
241
+ */
242
+ $user_pass = base64_encode( "yikesmailchimp:{$this->api_key}" );
243
+ $auth_headers = array(
244
+ 'Authorization' => "Basic {$user_pass}",
245
+ );
246
+
247
+ /**
248
+ * Filter the Auth Headers used for an API request.
249
+ *
250
+ * @since 6.3.0
251
+ *
252
+ * @param array $auth_headers The array of auth headers for an API request.
253
+ * @param string $api_version The version of the API being used.
254
+ */
255
+ return apply_filters( 'yikesinc_eme_api_auth_headers', $auth_headers, $this->api_version );
256
+ }
257
+
258
+ /**
259
+ * Get a body array with authorization included.
260
+ *
261
+ * @author Jeremy Pry
262
+ * @return array
263
+ */
264
+ protected function get_auth_body() {
265
+ return array(
266
+ 'apikey' => $this->api_key,
267
+ );
268
+ }
269
+
270
+ /**
271
+ * Build the arguments for the request.
272
+ *
273
+ * @author Jeremy Pry
274
+ * @since 6.3.0
275
+ *
276
+ * @param string $path The relative path for the request.
277
+ * @param string $method The method to use for the request.
278
+ * @param array $headers Array of headers to send with the request.
279
+ * @param array $params An array of additional parameters to pass to the request. See WP_Http::request().
280
+ *
281
+ * @return array
282
+ */
283
+ protected function build_request_args( $path, $method, $headers = array(), $params = array() ) {
284
+ // Ensure our method is uppercase
285
+ $method = strtoupper( $method );
286
+
287
+ // Get the authorized array
288
+ $authorized_args = $this->get_authorized_args();
289
+
290
+ // If we have body data, maybe convert it to JSON.
291
+ if ( isset( $params['body'] ) && ( is_array( $params['body'] ) || is_object( $params['body'] ) ) ) {
292
+ $params['body'] = json_encode( wp_parse_args( $authorized_args['body'], $params['body'] ) );
293
+ $headers['Content-Type'] = 'application/json';
294
+ }
295
+
296
+ // Combine the given headers and auth headers
297
+ $headers = wp_parse_args( $authorized_args['headers'], $headers );
298
+ /**
299
+ * Filter the headers used for a request to the MailChimp API.
300
+ *
301
+ * @since 6.3.0
302
+ *
303
+ * @param array $headers The array of headers to send with the request.
304
+ * @param string $path The relative path for the request.
305
+ * @param string $method The method used for the request.
306
+ * @param array $params The array of additional parameters passed to the request.
307
+ */
308
+ $headers = apply_filters( 'yikesinc_eme_api_headers', $headers, $path, $method, $params );
309
+
310
+ // Build the args for the request.
311
+ $args = array(
312
+ 'method' => $method,
313
+ 'headers' => $headers,
314
+ 'user-agent' => $this->get_user_agent(),
315
+ /**
316
+ * Filter the timeout used when sending an API request.
317
+ *
318
+ * @since 6.3.0
319
+ *
320
+ * @param int $timeout The number of seconds after which the request will time out.
321
+ */
322
+ 'timeout' => apply_filters( 'yikesinc_eme_api_timeout', 15 ),
323
+ /**
324
+ * Filter whether our requests should verify the SSL certificate.
325
+ *
326
+ * @since 6.3.0
327
+ *
328
+ * @param bool $sslverify
329
+ */
330
+ 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true ),
331
+ );
332
+
333
+ /**
334
+ * Filter the args used for a request to the MailChimp API.
335
+ *
336
+ * @since 6.3.0
337
+ *
338
+ * @param array $args The arguments for the request.
339
+ * @param string $path The relative path for the request.
340
+ * @param string $method The method used for the request.
341
+ * @param array $params The array of additional params passed to the request.
342
+ */
343
+ return apply_filters( 'yikesinc_eme_api_args', wp_parse_args( $params, $args ), $path, $method, $params );
344
+ }
345
+
346
+ /**
347
+ * Get an authorized request based on the API version.
348
+ *
349
+ * @author Jeremy Pry
350
+ * @since 6.3.0
351
+ * @return array
352
+ */
353
+ protected function get_authorized_args() {
354
+ $args = array(
355
+ 'body' => array(),
356
+ 'headers' => array(),
357
+ );
358
+
359
+ // Version 2.0 uses body authorization
360
+ if ( version_compare( '3.0', $this->api_version, '>' ) ) {
361
+ $args['body'] = $this->get_auth_body();
362
+ }
363
+
364
+ // Version 3.0 uses authorization headers.
365
+ if ( version_compare( '3.0', $this->api_version, '<=' ) ) {
366
+ $args['headers'] = $this->get_auth_headers();
367
+ }
368
+
369
+ return $args;
370
+ }
371
+
372
+ /**
373
+ * Get the API version for this instance.
374
+ *
375
+ * @author Jeremy Pry
376
+ * @since 6.3.0
377
+ * @return string The API version.
378
+ */
379
+ public function get_version() {
380
+ return $this->api_version;
381
+ }
382
+ }
includes/class-yikes-inc-easy-mailchimp-extender-activator.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Fired during plugin activation
4
  *
5
- * @link http://www.yikesinc.com/
6
  * @since 6.0.0
7
  *
8
  * @package Yikes_Inc_Easy_Mailchimp_Extender
@@ -16,7 +16,7 @@
16
  * @since 6.0.0
17
  * @package Yikes_Inc_Easy_Mailchimp_Extender
18
  * @subpackage Yikes_Inc_Easy_Mailchimp_Extender/includes
19
- * @author YIKES Inc. <info@yikesinc.com>
20
  */
21
  class Yikes_Inc_Easy_Mailchimp_Extender_Activator {
22
  /**
2
  /**
3
  * Fired during plugin activation
4
  *
5
+ * @link https://www.yikesplugins.com/
6
  * @since 6.0.0
7
  *
8
  * @package Yikes_Inc_Easy_Mailchimp_Extender
16
  * @since 6.0.0
17
  * @package Yikes_Inc_Easy_Mailchimp_Extender
18
  * @subpackage Yikes_Inc_Easy_Mailchimp_Extender/includes
19
+ * @author YIKES Inc. <plugins@yikesinc.com>
20
  */
21
  class Yikes_Inc_Easy_Mailchimp_Extender_Activator {
22
  /**
includes/class-yikes-inc-easy-mailchimp-extender-forms-abstract.php CHANGED
@@ -23,7 +23,6 @@ abstract class Yikes_Inc_Easy_MailChimp_Extender_Forms_Abstract implements Yikes
23
  'fields' => array(),
24
  'custom_styles' => '',
25
  'custom_template' => '',
26
- 'send_welcome_email' => 0,
27
  'redirect_user_on_submit' => 0,
28
  'redirect_page' => '',
29
  'submission_settings' => array(
@@ -36,7 +35,6 @@ abstract class Yikes_Inc_Easy_MailChimp_Extender_Forms_Abstract implements Yikes
36
  'optin' => 1,
37
  'update_existing_user' => 1,
38
  'send_update_email' => 1,
39
- 'send_welcome_email' => 1,
40
  ),
41
  'form_settings' => array(
42
  'yikes-easy-mc-form-class-names' => '',
@@ -53,12 +51,14 @@ abstract class Yikes_Inc_Easy_MailChimp_Extender_Forms_Abstract implements Yikes
53
  'yikes-easy-mc-form-login-required' => 0,
54
  'yikes-easy-mc-form-restriction-login-message' => __( 'You need to be logged in to sign up for this mailing list.', 'yikes-inc-easy-mailchimp-extender' ),
55
  ),
56
- 'error_messages' => array(
57
- 'success' => '',
58
- 'general-error' => '',
59
- 'invalid-email' => '',
60
- 'already-subscribed' => '',
61
- 'update-link' => '',
 
 
62
  ),
63
  'custom_notifications' => '',
64
  'impressions' => 0,
23
  'fields' => array(),
24
  'custom_styles' => '',
25
  'custom_template' => '',
 
26
  'redirect_user_on_submit' => 0,
27
  'redirect_page' => '',
28
  'submission_settings' => array(
35
  'optin' => 1,
36
  'update_existing_user' => 1,
37
  'send_update_email' => 1,
 
38
  ),
39
  'form_settings' => array(
40
  'yikes-easy-mc-form-class-names' => '',
51
  'yikes-easy-mc-form-login-required' => 0,
52
  'yikes-easy-mc-form-restriction-login-message' => __( 'You need to be logged in to sign up for this mailing list.', 'yikes-inc-easy-mailchimp-extender' ),
53
  ),
54
+ 'error_messages' => array(
55
+ 'success' => '',
56
+ 'success-single-optin' => '',
57
+ 'success-resubscribed' => '',
58
+ 'general-error' => '',
59
+ 'already-subscribed' => '',
60
+ 'update-link' => '',
61
+ 'email-subject' => '',
62
  ),
63
  'custom_notifications' => '',
64
  'impressions' => 0,
includes/class-yikes-inc-easy-mailchimp-extender-forms.php CHANGED
@@ -189,10 +189,6 @@ class Yikes_Inc_Easy_MailChimp_Extender_Forms extends Yikes_Inc_Easy_MailChimp_E
189
  $value = json_decode( $value, true );
190
  break;
191
 
192
- case 'send_welcome_email':
193
- $key = 'send_welcome';
194
- break;
195
-
196
  case 'custom_notifications':
197
  $key = 'notifications';
198
  // Deliberately omit break, to fall through to the next group.
@@ -241,11 +237,6 @@ class Yikes_Inc_Easy_MailChimp_Extender_Forms extends Yikes_Inc_Easy_MailChimp_E
241
  $value = json_encode( $value );
242
  break;
243
 
244
- case 'send_welcome':
245
- $key = 'send_welcome_email';
246
- // Deliberately omit break, to fall through to the next group.
247
-
248
- case 'send_welcome_email':
249
  case 'redirect_user_on_submit':
250
  $value = intval( (bool) $value );
251
  break;
@@ -296,7 +287,6 @@ class Yikes_Inc_Easy_MailChimp_Extender_Forms extends Yikes_Inc_Easy_MailChimp_E
296
  $formats = array();
297
  foreach ( $form_data as $key => $value ) {
298
  switch ( $key ) {
299
- case 'send_welcome_email':
300
  case 'impressions':
301
  case 'submissions':
302
  case 'redirect_user_on_submit':
189
  $value = json_decode( $value, true );
190
  break;
191
 
 
 
 
 
192
  case 'custom_notifications':
193
  $key = 'notifications';
194
  // Deliberately omit break, to fall through to the next group.
237
  $value = json_encode( $value );
238
  break;
239
 
 
 
 
 
 
240
  case 'redirect_user_on_submit':
241
  $value = intval( (bool) $value );
242
  break;
287
  $formats = array();
288
  foreach ( $form_data as $key => $value ) {
289
  switch ( $key ) {
 
290
  case 'impressions':
291
  case 'submissions':
292
  case 'redirect_user_on_submit':
includes/class-yikes-inc-easy-mailchimp-extender-loader.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Register all actions and filters for the plugin
4
  *
5
- * @link http://www.yikesinc.com/
6
  * @since 6.0.0
7
  *
8
  * @package Yikes_Inc_Easy_Mailchimp_Extender
@@ -17,7 +17,7 @@
17
  *
18
  * @package Yikes_Inc_Easy_Mailchimp_Extender
19
  * @subpackage Yikes_Inc_Easy_Mailchimp_Extender/includes
20
- * @author YIKES Inc. <info@yikesinc.com>
21
  */
22
  class Yikes_Inc_Easy_Mailchimp_Extender_Loader {
23
  /**
2
  /**
3
  * Register all actions and filters for the plugin
4
  *
5
+ * @link https://www.yikesplugins.com/
6
  * @since 6.0.0
7
  *
8
  * @package Yikes_Inc_Easy_Mailchimp_Extender
17
  *
18
  * @package Yikes_Inc_Easy_Mailchimp_Extender
19
  * @subpackage Yikes_Inc_Easy_Mailchimp_Extender/includes
20
+ * @author YIKES Inc. <plugins@yikesinc.com>
21
  */
22
  class Yikes_Inc_Easy_Mailchimp_Extender_Loader {
23
  /**
includes/class-yikes-inc-easy-mailchimp-extender.php CHANGED
@@ -5,7 +5,7 @@
5
  * A class definition that includes attributes and functions used across both the
6
  * public-facing side of the site and the admin area.
7
  *
8
- * @link http://www.yikesinc.com/
9
  * @since 1.0.0
10
  *
11
  * @package Yikes_Inc_Easy_Mailchimp_Extender
@@ -23,7 +23,7 @@
23
  * @since 1.0.0
24
  * @package Yikes_Inc_Easy_Mailchimp_Extender
25
  * @subpackage Yikes_Inc_Easy_Mailchimp_Extender/includes
26
- * @author YIKES Inc. <info@yikesinc.com>
27
  */
28
  class Yikes_Inc_Easy_Mailchimp_Extender {
29
  /**
5
  * A class definition that includes attributes and functions used across both the
6
  * public-facing side of the site and the admin area.
7
  *
8
+ * @link https://www.yikesplugins.com/
9
  * @since 1.0.0
10
  *
11
  * @package Yikes_Inc_Easy_Mailchimp_Extender
23
  * @since 1.0.0
24
  * @package Yikes_Inc_Easy_Mailchimp_Extender
25
  * @subpackage Yikes_Inc_Easy_Mailchimp_Extender/includes
26
+ * @author YIKES Inc. <plugins@yikesinc.com>
27
  */
28
  class Yikes_Inc_Easy_Mailchimp_Extender {
29
  /**
includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php CHANGED
@@ -5,7 +5,7 @@
5
  * A class definition that includes attributes and functions used across both the
6
  * public-facing side of the site and the admin area.
7
  *
8
- * @link http://www.yikesinc.com/
9
  * @since 1.0.0
10
  *
11
  * @package Yikes_Inc_Easy_Mailchimp_Extender
@@ -23,9 +23,17 @@
23
  * @since 1.0.0
24
  * @package Yikes_Inc_Easy_Mailchimp_Extender
25
  * @subpackage Yikes_Inc_Easy_Mailchimp_Extender/includes
26
- * @author YIKES Inc. <info@yikesinc.com>
27
  */
28
  class Yikes_Inc_Easy_Mailchimp_Error_Logging {
 
 
 
 
 
 
 
 
29
  /**
30
  * Define the core functionality of the plugin.
31
  *
@@ -36,7 +44,26 @@ class Yikes_Inc_Easy_Mailchimp_Error_Logging {
36
  * @since 1.0.0
37
  */
38
  public function __construct() {
39
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  }
41
 
42
 
@@ -166,4 +193,4 @@ class Yikes_Inc_Easy_Mailchimp_Error_Logging {
166
  }
167
  }
168
 
169
- }
5
  * A class definition that includes attributes and functions used across both the
6
  * public-facing side of the site and the admin area.
7
  *
8
+ * @link https://www.yikesplugins.com/
9
  * @since 1.0.0
10
  *
11
  * @package Yikes_Inc_Easy_Mailchimp_Extender
23
  * @since 1.0.0
24
  * @package Yikes_Inc_Easy_Mailchimp_Extender
25
  * @subpackage Yikes_Inc_Easy_Mailchimp_Extender/includes
26
+ * @author YIKES Inc. <plugins@yikesinc.com>
27
  */
28
  class Yikes_Inc_Easy_Mailchimp_Error_Logging {
29
+
30
+ /**
31
+ * Whether we're doing debugging.
32
+ *
33
+ * @var bool
34
+ */
35
+ protected $is_debugging;
36
+
37
  /**
38
  * Define the core functionality of the plugin.
39
  *
44
  * @since 1.0.0
45
  */
46
  public function __construct() {
47
+ $this->is_debugging = WP_DEBUG || get_option( 'yikes-mailchimp-debug-status', '' ) == '1';
48
+ }
49
+
50
+ /**
51
+ * Maybe write to the error log.
52
+ *
53
+ * This will do nothing if debugging is not enabled.
54
+ *
55
+ * @author Jeremy Pry
56
+ *
57
+ * @param string $returned_error The returned error.
58
+ * @param string $error_type The error type.
59
+ * @param string $page The page information.
60
+ */
61
+ public function maybe_write_to_log( $returned_error, $error_type, $page = '' ) {
62
+ if ( ! $this->is_debugging ) {
63
+ return;
64
+ }
65
+
66
+ $this->yikes_easy_mailchimp_write_to_error_log( $returned_error, $error_type, $page );
67
  }
68
 
69
 
193
  }
194
  }
195
 
196
+ }
includes/images/Support_Page/Octocat.png DELETED
Binary file
includes/images/Support_Page/github-issue-screenshot.png DELETED
Binary file
includes/images/Support_Page/wordpress-issue-screenshot.png CHANGED
Binary file
includes/images/Welcome_Page/api-v3-animated.png ADDED
Binary file
includes/images/Welcome_Page/yikes-mailchimp-welcome-logo.png CHANGED
Binary file
includes/third-party-integrations/visual-composer/visual-composer.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
 
3
  /*
4
- * Custom class to allow for YIKES MailChimp to extend visual composer
5
  * @since 6.0.3
6
  */
7
 
@@ -90,7 +90,7 @@ class YIKES_MailChimp_Visual_Composer_Extension {
90
  * @since 6.0.3
91
  */
92
  public function yikes_mailchimp_logo_vc_section() {
93
- return '<img style="width:250px;display:block;margin:0 auto;" src="' . YIKES_MC_URL . 'includes/images/Welcome_Page/mailchimp-logo.png" title="' . __( 'Easy Forms for MailChimp by YIKES', 'yikes-inc-easy-mailchimp-extender' ) . '" />';
94
  }
95
 
96
  /**
1
  <?php
2
 
3
  /*
4
+ * Custom class to allow Easy Forms for MailChimp to extend visual composer
5
  * @since 6.0.3
6
  */
7
 
90
  * @since 6.0.3
91
  */
92
  public function yikes_mailchimp_logo_vc_section() {
93
+ return '<img style="width:250px;display:block;margin:0 auto;" src="' . YIKES_MC_URL . 'includes/images/Welcome_Page/mailchimp-logo.png" title="' . __( 'Easy Forms for MailChimp', 'yikes-inc-easy-mailchimp-extender' ) . '" />';
94
  }
95
 
96
  /**
package.json DELETED
@@ -1,26 +0,0 @@
1
- {
2
- "name": "yikes-inc-easy-mailchimp-extender",
3
- "version": "6.2.2",
4
- "description": "Easy MailChimp opt-in forms for your site.",
5
- "main": "index.js",
6
- "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
8
- },
9
- "author": "Yikes Inc.",
10
- "license": "GPLv2",
11
- "dependencies": {
12
- "grunt": "^0.4.5"
13
- },
14
- "devDependencies": {
15
- "autoprefixer-core": "^5.2.1",
16
- "grunt-auto-install": "^0.2.4",
17
- "grunt-browser-sync": "^2.1.3",
18
- "grunt-contrib-clean": "^1.0.0",
19
- "grunt-contrib-cssmin": "^0.12.3",
20
- "grunt-contrib-uglify": "^0.9.1",
21
- "grunt-contrib-watch": "^0.6.1",
22
- "grunt-postcss": "^0.5.0",
23
- "grunt-replace": "^1.0.1",
24
- "grunt-wp-i18n": "^0.5.2"
25
- }
26
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
phpunit.xml.dist DELETED
@@ -1,14 +0,0 @@
1
- <phpunit
2
- bootstrap="tests/bootstrap.php"
3
- backupGlobals="false"
4
- colors="true"
5
- convertErrorsToExceptions="true"
6
- convertNoticesToExceptions="true"
7
- convertWarningsToExceptions="true"
8
- >
9
- <testsuites>
10
- <testsuite>
11
- <directory prefix="test-" suffix=".php">./tests/</directory>
12
- </testsuite>
13
- </testsuites>
14
- </phpunit>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
public/class-yikes-inc-easy-mailchimp-extender-public.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * The public-facing functionality of the plugin.
4
  *
5
- * @link http://www.yikesinc.com/
6
  * @since 6.0.0
7
  *
8
  * @package Yikes_Inc_Easy_Mailchimp_Extender
@@ -12,7 +12,7 @@
12
  *
13
  * @package Yikes_Inc_Easy_Mailchimp_Extender
14
  * @subpackage Yikes_Inc_Easy_Mailchimp_Extender/public
15
- * @author YIKES Inc. <info@yikesinc.com>
16
  */
17
  class Yikes_Inc_Easy_Mailchimp_Extender_Public {
18
  /**
@@ -66,7 +66,7 @@ class Yikes_Inc_Easy_Mailchimp_Extender_Public {
66
  // Filter the user already subscribed response with a custom message
67
  add_filter( 'yikes-easy-mailchimp-update-existing-subscriber-text', array( $this, 'yikes_custom_already_subscribed_response' ), 10, 3 );
68
  // Filter the user already subscribed response with a custom message
69
- add_filter( 'yikes-easy-mailchimp-user-already-subscribed-text', array( $this, 'yikes_custom_already_subscribed_text' ), 10, 3 );
70
  }
71
 
72
  /**
@@ -93,8 +93,8 @@ class Yikes_Inc_Easy_Mailchimp_Extender_Public {
93
  **/
94
  public function load_checkbox_integration_classes() {
95
  // store our options
96
- $integrations = get_option( 'optin-checkbox-init' , '' );
97
- if( !empty( $integrations ) ) {
98
  // load our mail integrations class
99
  require_once YIKES_MC_PATH . 'public/classes/checkbox-integrations.php';
100
  // loop over selected classes and load them up!
@@ -134,7 +134,8 @@ class Yikes_Inc_Easy_Mailchimp_Extender_Public {
134
  $form_settings = self::yikes_retrieve_form_settings( $form_id );
135
  if( isset( $_POST ) && !empty( $_POST ) && isset( $form_id ) && $form_settings['submission_settings']['ajax'] == 0 ) {
136
  if( $_POST['yikes-mailchimp-submitted-form'] == $form_id ) { // ensure we only process the form that was submitted
137
- // lets include our form processing file
 
138
  include_once( YIKES_MC_PATH . 'public/partials/shortcodes/process/process_form_submission.php' );
139
  if( $form_settings['submission_settings']['redirect_on_submission'] == '1' ) {
140
  if( $form_submitted == 1 ) {
2
  /**
3
  * The public-facing functionality of the plugin.
4
  *
5
+ * @link https://www.yikesplugins.com/
6
  * @since 6.0.0
7
  *
8
  * @package Yikes_Inc_Easy_Mailchimp_Extender
12
  *
13
  * @package Yikes_Inc_Easy_Mailchimp_Extender
14
  * @subpackage Yikes_Inc_Easy_Mailchimp_Extender/public
15
+ * @author YIKES Inc. <plugins@yikesinc.com>
16
  */
17
  class Yikes_Inc_Easy_Mailchimp_Extender_Public {
18
  /**
66
  // Filter the user already subscribed response with a custom message
67
  add_filter( 'yikes-easy-mailchimp-update-existing-subscriber-text', array( $this, 'yikes_custom_already_subscribed_response' ), 10, 3 );
68
  // Filter the user already subscribed response with a custom message
69
+ // add_filter( 'yikes-easy-mailchimp-user-already-subscribed-text', array( $this, 'yikes_custom_already_subscribed_text' ), 10, 3 );
70
  }
71
 
72
  /**
93
  **/
94
  public function load_checkbox_integration_classes() {
95
  // store our options
96
+ $integrations = get_option( 'optin-checkbox-init' , array() );
97
+ if( ! empty( $integrations ) && is_array( $integrations ) ) {
98
  // load our mail integrations class
99
  require_once YIKES_MC_PATH . 'public/classes/checkbox-integrations.php';
100
  // loop over selected classes and load them up!
134
  $form_settings = self::yikes_retrieve_form_settings( $form_id );
135
  if( isset( $_POST ) && !empty( $_POST ) && isset( $form_id ) && $form_settings['submission_settings']['ajax'] == 0 ) {
136
  if( $_POST['yikes-mailchimp-submitted-form'] == $form_id ) { // ensure we only process the form that was submitted
137
+
138
+ // Lets include our form processing file
139
  include_once( YIKES_MC_PATH . 'public/partials/shortcodes/process/process_form_submission.php' );
140
  if( $form_settings['submission_settings']['redirect_on_submission'] == '1' ) {
141
  if( $form_submitted == 1 ) {
public/classes/checkbox-integrations.php CHANGED
@@ -17,88 +17,80 @@
17
 
18
  }
19
 
20
- /*
21
- * Check if a user is already subscribed to
22
- * a given list, if so don't show the checkbox integration
23
- * @since 6.0.0
24
- * @$integration_type - pass in the type of checkbox integration
25
- */
26
- public function is_user_already_subscribed( $integration_type ) {
27
- // first check if the user is logged in
28
- if( is_user_logged_in() ) {
29
- $checkbox_options = get_option( 'optin-checkbox-init' , '' );
 
 
 
 
 
 
 
30
  $current_user = wp_get_current_user();
31
- $email = $current_user->user_email;
 
32
 
33
- $api_key = yikes_get_mc_api_key();
34
- $dash_position = strpos( $api_key, '-' );
35
- if( $dash_position !== false ) {
36
- $api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/member-info.json';
37
- }
38
- $already_subscribed = wp_remote_post( $api_endpoint, array(
39
- 'body' => array(
40
- 'apikey' => $api_key,
41
- 'id' => $checkbox_options[$integration_type]['associated-list'],
42
- 'emails' => array( array( 'email' => sanitize_email( $email ) ) )
43
- ),
44
- 'timeout' => 10,
45
- 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true )
46
- ) );
47
- $already_subscribed = json_decode( wp_remote_retrieve_body( $already_subscribed ), true );
48
- if( isset( $already_subscribed['error'] ) ) {
49
- if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
50
- require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
51
- $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
52
- $error_logging->yikes_easy_mailchimp_write_to_error_log( $already_subscribed['error'], __( "Get Member Info" , 'yikes-inc-easy-mailchimp-extender' ), "Checkbox Integrations Page" );
53
- }
54
- }
55
- if( ! Isset( $already_subscribed['error'] ) ) {
56
- return $already_subscribed['success_count'];
57
- }
58
- } else {
59
- // if the user isn't logged in
60
- // we'll always display it
61
- return '0';
62
  }
 
 
63
  }
64
 
65
- /*
66
- * Check if a new user registration email already subscribed
67
- * a given list, if so don't show the checkbox integration
68
- * @since 6.0.0
69
- * @$email - users email address entered into the form
70
- * @$integration_type - pass in the type of checkbox integration
71
- */
72
- public function is_new_registration_already_subscribed( $email , $integration_type ) {
73
- // first check if the user is logged in
74
- $checkbox_options = get_option( 'optin-checkbox-init' , '' );
75
- try {
76
- $api_key = yikes_get_mc_api_key();
77
- $dash_position = strpos( $api_key, '-' );
78
- if( $dash_position !== false ) {
79
- $api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/member-info.json';
80
- }
81
- $already_subscribed = wp_remote_post( $api_endpoint, array(
82
- 'body' => array(
83
- 'apikey' => $api_key,
84
- 'id' => $checkbox_options[$integration_type]['associated-list'],
85
- 'emails' => array( array( 'email' => sanitize_email( $email ) ) )
86
- ),
87
- 'timeout' => 10,
88
- 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true )
89
- ) );
90
- $already_subscribed = json_decode( wp_remote_retrieve_body( $already_subscribed ), true );
91
- if( isset( $already_subscribed['error'] ) ) {
92
- if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
93
- require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
94
- $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
95
- $error_logging->yikes_easy_mailchimp_write_to_error_log( $already_subscribed['error'], __( "Get Member Info" , 'yikes-inc-easy-mailchimp-extender' ), "Checkbox Integrations Page" );
96
- }
97
  }
98
- return $already_subscribed['success_count'];
99
- } catch ( Exception $error ) {
100
- return $error->getMessage();
101
  }
 
 
 
102
  }
103
 
104
  /**
@@ -114,7 +106,7 @@
114
  if( isset( $checkbox_options[$this->type]['associated-list'] ) && $checkbox_options[$this->type]['associated-list'] != '-' ) {
115
  $checked = ( $checkbox_options[$this->type]['precheck'] == 'true' ) ? 'checked' : '';
116
  // before checkbox HTML (comment, ...)
117
- $before = '<!-- Easy Forms for MailChimp by YIKES, Inc. - https://www.yikesinc.com/ -->';
118
  $before .= apply_filters( 'yikes-mailchimp-before-checkbox-html', '' );
119
  // checkbox
120
  $content = '<p id="yikes-easy-mailchimp-' . $this->type . '-checkbox" class="yikes-easy-mailchimp-' . $this->type . '-checkbox">';
@@ -125,75 +117,76 @@
125
  $content .= '</p>';
126
  // after checkbox HTML (..., honeypot, closing comment)
127
  $after = apply_filters( 'yikes-mailchimp-after-checkbox-html', '' );
128
- $after .= '<!-- Easy Forms for MailChimp by YIKES, Inc. -->';
129
  return $before . $content . $after;
130
  }
131
  }
132
 
133
  /**
134
- * Hook to submit the data to MailChimp when
135
- * a new integration type is submitted
136
  *
137
- * @since 6.0.0
138
- **/
 
 
 
 
139
  public function subscribe_user_integration( $email, $type, $merge_vars ) {
140
  // get checkbox data
141
- $checkbox_options = get_option( 'optin-checkbox-init' , '' );
142
- if( $type != 'registration_form' ) {
143
- $update = '1';
144
- } else {
145
- $update = '0';
146
- }
147
- // set ip address
148
- if( ! isset( $merge_vars['OPTIN_IP'] ) && isset( $_SERVER['REMOTE_ADDR'] ) ) {
149
- $merge_vars['OPTIN_IP'] = sanitize_text_field( $_SERVER['REMOTE_ADDR'] );
150
- }
151
- // set the optin time
152
- $merge_vars['OPTIN_TIME'] = current_time( 'Y-m-d H:i:s', 1 );
153
- // check for interest groups
154
- $interest_groups = ( isset( $checkbox_options[$type]['interest-groups'] ) ) ? $checkbox_options[$type]['interest-groups'] : false;
155
- // if interest groups were found, push them to the merge variable array
156
- if( $interest_groups ) {
157
- $merge_vars['groupings'] = array();
158
- foreach( $interest_groups as $interest_group_id => $interest_group_selections ) {
159
- // merge variable interest groups array
160
- $merge_vars['groupings'][] = array(
161
- 'id' => $interest_group_id,
162
- 'groups' => $interest_group_selections,
163
- );
164
- }
165
- // replace the interest groups - to avoid any errors thrown if the admin switches lists, or interest groups
166
- $merge_vars['replace_interests'] = 1;
167
  }
168
- // initialize MailChimp API
169
- $api_key = yikes_get_mc_api_key();
170
- $dash_position = strpos( $api_key, '-' );
171
- if( $dash_position !== false ) {
172
- $api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/subscribe.json';
173
  }
174
- $subscribe_response = wp_remote_post( $api_endpoint, array(
175
- 'body' => apply_filters( 'yikes-mailchimp-checkbox-integration-subscribe-api-request', array(
176
- 'apikey' => yikes_get_mc_api_key(),
177
- 'id' => $checkbox_options[$type]['associated-list'],
178
- 'email' => array( 'email' => sanitize_email( $email ) ),
179
- 'merge_vars' => apply_filters( 'yikes-mailchimp-checkbox-integration-merge-variables', $merge_vars, $type ), // filter merge variables
180
- 'double_optin' => 1,
181
- 'update_existing' => $update,
182
- 'send_welcome' => 1
183
- ), $type ),
184
- 'timeout' => 10,
185
- 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true )
186
- ) );
187
- if( ! Is_wp_error( $subscribe_response ) ) {
188
- $response_body = json_decode( wp_remote_retrieve_body( $subscribe_response ), true );
189
- if( WP_DEBUG || isset( $response_body['error'] ) ) {
190
- if( get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
191
- require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
192
- $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
193
- $error_logging->yikes_easy_mailchimp_write_to_error_log( $response_body['error'], __( "Checkbox Integration Subscribe User" , 'yikes-inc-easy-mailchimp-extender' ), "Checkbox Integrations" );
 
 
 
 
194
  }
195
  }
 
 
196
  }
 
 
 
 
 
 
 
 
 
 
 
 
197
  return;
198
  }
199
 
17
 
18
  }
19
 
20
+ /**
21
+ * Determine whether the current user is already subscribed to a given list.
22
+ *
23
+ * @author Jeremy Pry
24
+ *
25
+ * @param string $type The integration type to check.
26
+ * @param string $email The email address to check.
27
+ *
28
+ * @return bool Whether the current user is subscribed to a list.
29
+ */
30
+ public function is_user_already_subscribed( $type, $email = '' ) {
31
+ // Make sure we have an email address to use.
32
+ if ( empty( $email ) ) {
33
+ if ( ! is_user_logged_in() ) {
34
+ return false;
35
+ }
36
+
37
  $current_user = wp_get_current_user();
38
+ $email = $current_user->user_email;
39
+ }
40
 
41
+ // Ensure we have a valid email.
42
+ if ( ! is_email( $email ) ) {
43
+ return false;
44
+ }
45
+
46
+ // Convert the integration type to a list ID
47
+ $checkbox_options = get_option( 'optin-checkbox-init', '' );
48
+ if ( empty( $checkbox_options ) ) {
49
+ return false;
50
+ }
51
+ if ( ! isset( $checkbox_options[ $type ] ) || ! isset( $checkbox_options[ $type ]['associated-list'] ) ) {
52
+ return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  }
54
+
55
+ return $this->is_user_subscribed( $email, $checkbox_options[ $type ]['associated-list'] );
56
  }
57
 
58
+ /**
59
+ * Determine whether a given email is subscribed to a given list.
60
+ *
61
+ * @author Jeremy Pry
62
+ *
63
+ * @param string $email The email address to check.
64
+ * @param string $list_id The list ID to check.
65
+ *
66
+ * @return bool Whether the email is subscribed to the list.
67
+ */
68
+ public function is_user_subscribed( $email, $list_id ) {
69
+ $email_hash = md5( $email );
70
+
71
+ // Check the API to see the status
72
+ $response = yikes_get_mc_api_manager()->get_list_handler()->get_member( $list_id, $email_hash, false );
73
+ if ( is_wp_error( $response ) ) {
74
+ $data = $response->get_error_data();
75
+
76
+ // If the error response is a 404, they are not subscribed.
77
+ if ( isset( $data['status'] ) && 404 == $data['status'] ) {
78
+ return false;
79
+ } else {
80
+ $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
81
+ $error_logging->maybe_write_to_log(
82
+ $response->get_error_code(),
83
+ __( "Get Member Info", 'yikes-inc-easy-mailchimp-extender' ),
84
+ "Checkbox Integrations Page"
85
+ );
86
+
87
+ // If there was some other error, let's just assume they're not subscribed
88
+ return false;
 
89
  }
 
 
 
90
  }
91
+
92
+ // Look at the status from the API
93
+ return 'subscribed' == $response['status'];
94
  }
95
 
96
  /**
106
  if( isset( $checkbox_options[$this->type]['associated-list'] ) && $checkbox_options[$this->type]['associated-list'] != '-' ) {
107
  $checked = ( $checkbox_options[$this->type]['precheck'] == 'true' ) ? 'checked' : '';
108
  // before checkbox HTML (comment, ...)
109
+ $before = '<!-- Easy Forms for MailChimp - https://www.yikesplugins.com/ -->';
110
  $before .= apply_filters( 'yikes-mailchimp-before-checkbox-html', '' );
111
  // checkbox
112
  $content = '<p id="yikes-easy-mailchimp-' . $this->type . '-checkbox" class="yikes-easy-mailchimp-' . $this->type . '-checkbox">';
117
  $content .= '</p>';
118
  // after checkbox HTML (..., honeypot, closing comment)
119
  $after = apply_filters( 'yikes-mailchimp-after-checkbox-html', '' );
120
+ $after .= '<!-- Easy Forms for MailChimp -->';
121
  return $before . $content . $after;
122
  }
123
  }
124
 
125
  /**
126
+ * Hook to submit the data to MailChimp when a new integration type is submitted.
 
127
  *
128
+ * @since 6.0.0
129
+ *
130
+ * @param string $email The email address.
131
+ * @param string $type The integration type.
132
+ * @param array $merge_vars The array of form data to send.
133
+ */
134
  public function subscribe_user_integration( $email, $type, $merge_vars ) {
135
  // get checkbox data
136
+ $options = get_option( 'optin-checkbox-init', '' );
137
+
138
+ // Make sure we have a list ID.
139
+ if ( ! isset( $options[ $type ] ) || ! isset( $options[ $type ]['associated-list'] ) ) {
140
+ // @todo: Throw some kind of error?
141
+ return;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
142
  }
143
+
144
+ // Check for an IP address.
145
+ $user_ip = sanitize_text_field( $_SERVER['REMOTE_ADDR'] );
146
+ if ( isset( $merge_vars['OPTIN_IP'] ) ) {
147
+ $user_ip = sanitize_text_field( $merge_vars['OPTIN_IP'] );
148
  }
149
+
150
+ // Build our data
151
+ $list_id = $options[ $type ]['associated-list'];
152
+ $interests = isset( $options[ $type ]['interest-groups'] ) ? $options[ $type ]['interest-groups'] : array();
153
+ $id = md5( $email );
154
+ $data = array(
155
+ 'email_address' => sanitize_email( $email ),
156
+ 'merge_fields' => apply_filters( 'yikes-mailchimp-checkbox-integration-merge-variables', $merge_vars, $type ),
157
+ 'status_if_new' => 'pending',
158
+ 'timestamp_signup' => (string) current_time( 'timestamp', true ),
159
+ 'ip_signup' => $user_ip,
160
+ );
161
+
162
+ // Only re-format and add interest groups if not empty
163
+ if ( ! empty( $interests ) ) {
164
+
165
+ $groups = array();
166
+
167
+ // Need to reformat interest groups array as $interest_group_ID => true
168
+ foreach( $interests as $interest ) {
169
+ if ( is_array( $interest ) ) {
170
+ foreach( $interest as $group_id ) {
171
+ $groups[ $group_id ] = true;
172
+ }
173
  }
174
  }
175
+
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 ) ) {
182
+ $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
183
+ $error_logging->maybe_write_to_log(
184
+ $response->get_error_code(),
185
+ __( "Checkbox Integration Subscribe User", 'yikes-inc-easy-mailchimp-extender' ),
186
+ "Checkbox Integrations"
187
+ );
188
+ }
189
+
190
  return;
191
  }
192
 
public/classes/checkbox-integrations/class.bbpress_forms-checkbox.php CHANGED
@@ -31,7 +31,7 @@
31
  */
32
  public function output_checkbox() {
33
  // if the user is already subscribed, abort and don't render the checkbox
34
- if( $this->is_user_already_subscribed( $this->type ) == '1' ) {
35
  return;
36
  }
37
  echo $this->yikes_get_checkbox();
@@ -62,4 +62,3 @@
62
 
63
  }
64
  new Yikes_Easy_MC_bbPress_Checkbox_Class;
65
- ?>
31
  */
32
  public function output_checkbox() {
33
  // if the user is already subscribed, abort and don't render the checkbox
34
+ if ( $this->is_user_already_subscribed( $this->type ) ) {
35
  return;
36
  }
37
  echo $this->yikes_get_checkbox();
62
 
63
  }
64
  new Yikes_Easy_MC_bbPress_Checkbox_Class;
 
public/classes/checkbox-integrations/class.buddypress_form-checkbox.php CHANGED
@@ -21,7 +21,7 @@
21
  * Outputs a checkbox, if user is not already subscribed
22
  */
23
  public function output_checkbox() {
24
- if( $this->is_user_already_subscribed( $this->type ) == '1' ) {
25
  return;
26
  }
27
  ?>
@@ -60,5 +60,3 @@
60
 
61
  }
62
  new Yikes_Easy_MC_BuddyPress_Checkbox_Class;
63
-
64
- ?>
21
  * Outputs a checkbox, if user is not already subscribed
22
  */
23
  public function output_checkbox() {
24
+ if ( $this->is_user_already_subscribed( $this->type ) ) {
25
  return;
26
  }
27
  ?>
60
 
61
  }
62
  new Yikes_Easy_MC_BuddyPress_Checkbox_Class;
 
 
public/classes/checkbox-integrations/class.comment_form-checkbox.php CHANGED
@@ -27,13 +27,14 @@
27
  * Outputs a checkbox, if user is not already subscribed
28
  */
29
  public function output_checkbox( $comment_field ) {
30
- if( $this->is_user_already_subscribed( $this->type ) == '1' ) {
31
  return $comment_field;
32
  }
33
- echo do_action( 'yikes-mailchimp-before-checkbox' , $this->type );
34
- echo $comment_field . $this->yikes_get_checkbox();
35
- echo do_action( 'yikes-mailchimp-after-checkbox' , $this->type );
36
- }
 
37
 
38
  /**
39
  * Hook to submit the data to MailChimp when
@@ -63,4 +64,3 @@
63
 
64
  }
65
  new Yikes_Easy_MC_Comment_Checkbox_Class;
66
- ?>
27
  * Outputs a checkbox, if user is not already subscribed
28
  */
29
  public function output_checkbox( $comment_field ) {
30
+ if ( $this->is_user_already_subscribed( $this->type ) ) {
31
  return $comment_field;
32
  }
33
+
34
+ do_action( 'yikes-mailchimp-before-checkbox', $this->type );
35
+ echo $comment_field . $this->yikes_get_checkbox();
36
+ do_action( 'yikes-mailchimp-after-checkbox', $this->type );
37
+ }
38
 
39
  /**
40
  * Hook to submit the data to MailChimp when
64
 
65
  }
66
  new Yikes_Easy_MC_Comment_Checkbox_Class;
 
public/classes/checkbox-integrations/class.contact_form_7-checkbox.php CHANGED
@@ -35,10 +35,10 @@ class Yikes_Easy_MC_CF7_Checkbox_Class extends Yikes_Easy_MC_Checkbox_Integratio
35
  * @return boolean
36
  */
37
  public function init() {
38
- if( ! function_exists( 'wpcf7_add_shortcode' ) ) {
39
  return false;
40
  }
41
- wpcf7_add_shortcode( 'yikes_mailchimp_checkbox', array( $this, 'yikes_get_checkbox' ) );
42
  return true;
43
  }
44
 
@@ -73,8 +73,10 @@ class Yikes_Easy_MC_CF7_Checkbox_Class extends Yikes_Easy_MC_Checkbox_Integratio
73
  $posted_data = $submission->get_posted_data();
74
  // store the email -- this needs to be more dynamic (find string with containing string email?)
75
  $email = ( isset( $posted_data['your-email'] ) ) ? $posted_data['your-email'] : '';
 
 
76
  // submit this subscriber
77
- return $this->subscribe_user_integration( $email, $this->type, apply_filters( 'yikes-mailchimp-contact-form-7', array(), $posted_data ) );
78
  }
79
  }
80
 
35
  * @return boolean
36
  */
37
  public function init() {
38
+ if( ! function_exists( 'wpcf7_add_form_tag' ) ) {
39
  return false;
40
  }
41
+ wpcf7_add_form_tag( 'yikes_mailchimp_checkbox', array( $this, 'yikes_get_checkbox' ) );
42
  return true;
43
  }
44
 
73
  $posted_data = $submission->get_posted_data();
74
  // store the email -- this needs to be more dynamic (find string with containing string email?)
75
  $email = ( isset( $posted_data['your-email'] ) ) ? $posted_data['your-email'] : '';
76
+ // Default the merge_values
77
+ $merge_values = array( 'email' => $email );
78
  // submit this subscriber
79
+ return $this->subscribe_user_integration( $email, $this->type, apply_filters( 'yikes-mailchimp-contact-form-7', $merge_values, $posted_data ) );
80
  }
81
  }
82
 
public/classes/checkbox-integrations/class.easy_digital_downloads_checkout_form-checkbox.php CHANGED
@@ -30,14 +30,15 @@
30
  * Outputs a checkbox
31
  */
32
  public function output_checkbox() {
33
- if( $this->is_user_already_subscribed( $this->type ) == '1' ) {
34
  return;
35
  }
 
36
  // render our field if the user isn't current subscribed
37
- echo do_action( 'yikes-mailchimp-before-checkbox' , $this->type );
38
- echo $this->yikes_get_checkbox();
39
- echo do_action( 'yikes-mailchimp-after-checkbox' , $this->type );
40
- }
41
 
42
 
43
  /**
@@ -83,6 +84,3 @@
83
 
84
  }
85
  new Yikes_Easy_MC_EDD_Checkbox_Class;
86
-
87
-
88
- ?>
30
  * Outputs a checkbox
31
  */
32
  public function output_checkbox() {
33
+ if ( $this->is_user_already_subscribed( $this->type ) ) {
34
  return;
35
  }
36
+
37
  // render our field if the user isn't current subscribed
38
+ do_action( 'yikes-mailchimp-before-checkbox', $this->type );
39
+ echo $this->yikes_get_checkbox();
40
+ do_action( 'yikes-mailchimp-after-checkbox', $this->type );
41
+ }
42
 
43
 
44
  /**
84
 
85
  }
86
  new Yikes_Easy_MC_EDD_Checkbox_Class;
 
 
 
public/classes/checkbox-integrations/class.registration_form-checkbox.php CHANGED
@@ -22,7 +22,7 @@ class Yikes_Easy_MC_Registration_Checkbox_Class extends Yikes_Easy_MC_Checkbox_I
22
  // alter the error message, if there was an error with the users email address
23
  add_filter( 'wp_login_errors', array( $this , 'yikes_reg_complete_msg' ), 10, 2 );
24
  }
25
-
26
  /**
27
  * Outputs a checkbox
28
  */
@@ -51,17 +51,15 @@ class Yikes_Easy_MC_Registration_Checkbox_Class extends Yikes_Easy_MC_Checkbox_I
51
  // build our merge vars
52
  $merge_variables = $this->user_merge_vars( $user );
53
  // only subscribe the user if they aren't already on the list
54
- if( $this->is_new_registration_already_subscribed( $user->user_email , 'registration_form' ) != '1' ) {
55
  $this->subscribe_user_integration( sanitize_email( $user->user_email ) , $this->type , $merge_variables );
56
  } else {
57
  // add a temporary option to pass our email address and let the user know they are already subscribed
58
- $user_already_subscirbed_message = sprintf( __( "You have not been subscribed to our mailing list. %s is already subscribed to this list.", "yikes-inc-easy-mailchimp-extender" ), $user->user_email );
59
- add_option( 'yikes_register_subscription_error' , $user_already_subscirbed_message );
60
  }
61
  }
62
 
63
  /* End registration form functions */
64
  }
65
  new Yikes_Easy_MC_Registration_Checkbox_Class;
66
-
67
- ?>
22
  // alter the error message, if there was an error with the users email address
23
  add_filter( 'wp_login_errors', array( $this , 'yikes_reg_complete_msg' ), 10, 2 );
24
  }
25
+
26
  /**
27
  * Outputs a checkbox
28
  */
51
  // build our merge vars
52
  $merge_variables = $this->user_merge_vars( $user );
53
  // only subscribe the user if they aren't already on the list
54
+ if ( $this->is_user_already_subscribed( 'registration_form', $user->user_email ) === false ) {
55
  $this->subscribe_user_integration( sanitize_email( $user->user_email ) , $this->type , $merge_variables );
56
  } else {
57
  // add a temporary option to pass our email address and let the user know they are already subscribed
58
+ $user_already_subscribed_message = sprintf( __( "You have not been subscribed to our mailing list. %s is already subscribed to this list.", "yikes-inc-easy-mailchimp-extender" ), $user->user_email );
59
+ add_option( 'yikes_register_subscription_error' , $user_already_subscribed_message );
60
  }
61
  }
62
 
63
  /* End registration form functions */
64
  }
65
  new Yikes_Easy_MC_Registration_Checkbox_Class;
 
 
public/classes/checkbox-integrations/class.woocommerce_checkout_form-checkbox.php CHANGED
@@ -45,7 +45,7 @@ class Yikes_Easy_MC_WooCommerce_Checkbox_Class extends Yikes_Easy_MC_Checkbox_In
45
  $checkbox_options = get_option( 'optin-checkbox-init' , '' );
46
  // only display the field if a list is set
47
  if( isset( $checkbox_options ) && $checkbox_options[$this->type]['associated-list'] != '-' ) {
48
- if( $this->is_user_already_subscribed( $this->type ) == '1' ) {
49
  return $fields;
50
  }
51
  if( isset( $checkbox_options[$this->type]['precheck'] ) && $checkbox_options[$this->type]['precheck'] == 'true' ) {
@@ -94,5 +94,3 @@ class Yikes_Easy_MC_WooCommerce_Checkbox_Class extends Yikes_Easy_MC_Checkbox_In
94
 
95
  }
96
  new Yikes_Easy_MC_WooCommerce_Checkbox_Class;
97
-
98
- ?>
45
  $checkbox_options = get_option( 'optin-checkbox-init' , '' );
46
  // only display the field if a list is set
47
  if( isset( $checkbox_options ) && $checkbox_options[$this->type]['associated-list'] != '-' ) {
48
+ if( $this->is_user_already_subscribed( $this->type ) ) {
49
  return $fields;
50
  }
51
  if( isset( $checkbox_options[$this->type]['precheck'] ) && $checkbox_options[$this->type]['precheck'] == 'true' ) {
94
 
95
  }
96
  new Yikes_Easy_MC_WooCommerce_Checkbox_Class;
 
 
public/classes/process/class.process_form_submission_handler.php ADDED
@@ -0,0 +1,1348 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Yikes_Inc_Easy_MailChimp_Extender_Process_Submission_Handler {
4
+
5
+ /**
6
+ * A flag signifying whether we're dealing with an AJAX submission or standard form submission
7
+ *
8
+ * @since 6.3.0
9
+ * @access protected
10
+ * @var bool | $is_ajax
11
+ */
12
+ protected $is_ajax;
13
+
14
+ /**** Hardcoded Internal Variables ****/
15
+
16
+ /**
17
+ * An array of form fields we don't process
18
+ *
19
+ * @since 6.3.0
20
+ * @access protected
21
+ * @var array | $skipped_form_fields
22
+ */
23
+ protected $skipped_form_fields;
24
+
25
+ /**
26
+ * The default time in milliseconds to wait before redirecting a user
27
+ *
28
+ * @since 6.3.0
29
+ * @access protected
30
+ * @var int | $default_redirect_time_ms
31
+ */
32
+ protected $default_redirect_time_ms;
33
+
34
+ /**** Form Variables ****/
35
+
36
+ /**
37
+ * The ID of the corresponding YIKES MailChimp form
38
+ *
39
+ * @since 6.3.0
40
+ * @access public
41
+ * @var int | $form_id
42
+ */
43
+ public $form_id;
44
+
45
+ /**
46
+ * The ID of the corresponding MailChimp list
47
+ *
48
+ * @since 6.3.0
49
+ * @access public
50
+ * @var int | $list_id
51
+ */
52
+ public $list_id;
53
+
54
+ /**
55
+ * The submitted email
56
+ *
57
+ * @since 6.3.0
58
+ * @access public
59
+ * @var string | $email
60
+ */
61
+ public $email;
62
+
63
+ /**
64
+ * The array of error messages defined by the user and attached to this form
65
+ *
66
+ * @since 6.3.0
67
+ * @access public
68
+ * @var array | $error_messages
69
+ */
70
+ public $error_messages;
71
+
72
+ /**** Default Error Messages ****/
73
+
74
+ /**
75
+ * The error message for no form ID
76
+ *
77
+ * @since 6.3.0
78
+ * @access public
79
+ * @var string | $handle_empty_form_id_message
80
+ */
81
+ public $handle_empty_form_id_message;
82
+
83
+ /**
84
+ * The error message for no form found
85
+ *
86
+ * @since 6.3.0
87
+ * @access public
88
+ * @var string | $handle_empty_form_message
89
+ */
90
+ public $handle_empty_form_message;
91
+
92
+ /**
93
+ * The error message for missing form fields
94
+ *
95
+ * @since 6.3.0
96
+ * @access public
97
+ * @var string | $handle_empty_fields_generic_message
98
+ */
99
+ public $handle_empty_fields_generic_message;
100
+
101
+ /**
102
+ * The error message for missing $list_handler class
103
+ *
104
+ * @since 6.3.0
105
+ * @access public
106
+ * @var string | $handle_empty_list_handler_message
107
+ */
108
+ public $handle_empty_list_handler_message;
109
+
110
+ /**
111
+ * The error message for no email
112
+ *
113
+ * @since 6.3.0
114
+ * @access public
115
+ * @var string | $handle_empty_email_message
116
+ */
117
+ public $handle_empty_email_message;
118
+
119
+ /**
120
+ * The error message for a filled in honeypot
121
+ *
122
+ * @since 6.3.0
123
+ * @access public
124
+ * @var string | $handle_non_empty_honeypot_message
125
+ */
126
+ public $handle_non_empty_honeypot_message;
127
+
128
+ /**
129
+ * The error message for existing users trying to update when it's disallowed
130
+ *
131
+ * @since 6.3.0
132
+ * @access public
133
+ * @var string | $handle_disallowed_existing_user_update_message
134
+ */
135
+ public $handle_disallowed_existing_user_update_message;
136
+
137
+ /**
138
+ * The first half of the error message for updating an existing user when it's done via a profile link
139
+ *
140
+ * @since 6.3.0
141
+ * @access public
142
+ * @var string | $handle_updating_existing_user_message
143
+ */
144
+ public $handle_updating_existing_user_message;
145
+
146
+ /**
147
+ * The second half of the error message (the link) for updating an existing user when it's done via a profile link
148
+ *
149
+ * @since 6.3.0
150
+ * @access public
151
+ * @var string | $handle_updating_existing_user_link_message
152
+ */
153
+ public $handle_updating_existing_user_link_message;
154
+
155
+ /**
156
+ * A default, generic error message
157
+ *
158
+ * @since 6.3.0
159
+ * @access public
160
+ * @var string | $default_error_response_message
161
+ */
162
+ public $default_error_response_message;
163
+
164
+ /**
165
+ * The error message for not filling out a required form field
166
+ *
167
+ * @since 6.3.0
168
+ * @access public
169
+ * @var string | $handle_empty_required_field_message
170
+ */
171
+ public $handle_empty_required_field_message;
172
+
173
+ /**
174
+ * The error message for not filling out a required interest group
175
+ *
176
+ * @since 6.3.0
177
+ * @access public
178
+ * @var string | $handle_empty_required_interest_group_message
179
+ */
180
+ public $handle_empty_required_interest_group_message;
181
+
182
+ /**
183
+ * The error message for nonce failures
184
+ *
185
+ * @since 6.3.0
186
+ * @access public
187
+ * @var string | $handle_nonce_message
188
+ */
189
+ public $handle_nonce_message;
190
+
191
+ /**
192
+ * The error message for a recaptcha that is not checked/filled out
193
+ *
194
+ * @since 6.3.0
195
+ * @access public
196
+ * @var string | $handle_nonce_message
197
+ */
198
+ public $handle_non_filled_recaptcha_message_message;
199
+
200
+ /**
201
+ * The error message for recaptcha errors that we're not sure of
202
+ *
203
+ * @since 6.3.0
204
+ * @access public
205
+ * @var string | $handle_nonce_message
206
+ */
207
+ public $generic_recaptcha_error_message;
208
+
209
+ /**** Default Success Messages ****/
210
+
211
+ /**
212
+ * The success message for single-optin forms
213
+ *
214
+ * @since 6.3.0
215
+ * @access public
216
+ * @var string | $default_response_single_optin_success_message
217
+ */
218
+ public $default_response_single_optin_success_message;
219
+
220
+ /**
221
+ * The default success message for double-optin forms
222
+ *
223
+ * @since 6.3.0
224
+ * @access public
225
+ * @var string | $default_response_double_optin_success_message
226
+ */
227
+ public $default_response_double_optin_success_message;
228
+
229
+ /**
230
+ * The default success message for already subscribed users re-subscribing
231
+ *
232
+ * @since 6.3.0
233
+ * @access public
234
+ * @var string | $existing_subscriber_profile_update_message
235
+ */
236
+ public $existing_subscriber_profile_update_message;
237
+
238
+ /**
239
+ * The construct function - sets all of our hardcoded variables
240
+ *
241
+ * @param bool | $is_ajax | Flag signifying whether this submission request is coming from an AJAX response or basic form submission
242
+ */
243
+ public function __construct( $is_ajax ) {
244
+
245
+ // Set up our variables
246
+ $this->is_ajax = $is_ajax;
247
+
248
+ // Define our hardcoded fields
249
+ $this->skipped_form_fields = array(
250
+ 'yikes_easy_mc_new_subscriber' => 1,
251
+ '_wp_http_referer' => 1,
252
+ );
253
+ $this->default_redirect_time_ms = 1500;
254
+
255
+ // Define our error messages
256
+ $this->handle_empty_form_id_message = __( 'Error: We were unable to find the form ID.', 'yikes-inc-easy-mailchimp-extender' );
257
+ $this->handle_empty_form_message = __( 'Error: We were unable to find the form data.', 'yikes-inc-easy-mailchimp-extender' );
258
+ $this->handle_empty_fields_generic_message = __( 'Error: We were unable to find the form fields.', 'yikes-inc-easy-mailchimp-extender' );
259
+ $this->handle_empty_list_handler_message = __( 'Error: We were unable to find the list handler.', 'yikes-inc-easy-mailchimp-extender' );
260
+ $this->handle_empty_email_message = __( 'Error: The email is invalid.', 'yikes-inc-easy-mailchimp-extender' );
261
+ $this->handle_non_empty_honeypot_message = __( 'Error: It looks like the honeypot was filled out and the form was not properly submitted.', 'yikes-inc-easy-mailchimp-extender' );
262
+ $this->handle_disallowed_existing_user_update_message = __( 'The email you entered is already a subscriber to this list.', 'yikes-inc-easy-mailchimp-extender' );
263
+ $this->default_error_response_message = __( 'Whoops! It looks like something went wrong. Please try again.', 'yikes-inc-easy-mailchimp-extender' );
264
+ $this->handle_updating_existing_user_message = __( 'You\'re already subscribed. ', 'yikes-inc-easy-mailchimp-extender' );
265
+ $this->handle_updating_existing_user_link_message = __( 'To update your MailChimp profile, please click to send yourself an update link', 'yikes-inc-easy-mailchimp-extender' );
266
+ $this->handle_empty_required_field_message = __( 'A required field is missing.', 'yikes-inc-easy-mailchimp-extender' );
267
+ $this->handle_empty_required_interest_group_message = __( 'A required interest group is missing.', 'yikes-inc-easy-mailchimp-extender' );
268
+ $this->handle_nonce_message = __( 'Error: Sorry, the nonce security check didn\'t pass. Please reload the page and try again. You may want to try clearing your browser cache as a last attempt.' , 'yikes-inc-easy-mailchimp-extender' );
269
+ $this->handle_non_filled_recaptcha_message_message = __( 'Please check the reCAPTCHA field.', 'yikes-inc-easy-mailchimp-extender' );
270
+ $this->generic_recaptcha_error_message = __( 'Please refresh the page and try again.', 'yikes-inc-easy-mailchimp-extender' );
271
+
272
+ // Define our success messages
273
+ $this->default_response_single_optin_success_message = __( 'Thank you for subscribing!' , 'yikes-inc-easy-mailchimp-extender' );
274
+ $this->default_response_double_optin_success_message = __( 'Thank you for subscribing. Check your email for the confirmation message.' , 'yikes-inc-easy-mailchimp-extender' );
275
+ $this->existing_subscriber_profile_update_message = __( 'Thank you for already being a subscriber! Your profile info has been updated.', 'yikes-inc-easy-mailchimp-extender' );
276
+ }
277
+
278
+ /**** Setters for our Form Variables ****/
279
+
280
+ /**
281
+ * Set the form ID class property
282
+ *
283
+ * @since 6.3.0
284
+ *
285
+ * @param int | $form_id | ID of the corresponding YIKES MailChimp form
286
+ */
287
+ public function set_form_id( $form_id ) {
288
+ $this->form_id = $form_id;
289
+ }
290
+
291
+ /**
292
+ * Set the list ID class property
293
+ *
294
+ * @since 6.3.0
295
+ *
296
+ * @param int | $list_id | ID of the corresponding MailChimp list
297
+ */
298
+ public function set_list_id( $list_id ) {
299
+ $this->list_id = $list_id;
300
+ }
301
+
302
+ /**
303
+ * Set the email class property
304
+ *
305
+ * @since 6.3.0
306
+ *
307
+ * @param string | $sanitized_email | The sanitized email
308
+ */
309
+ public function set_email( $sanitized_email ) {
310
+ $this->email = $sanitized_email;
311
+ }
312
+
313
+ /**
314
+ * Set the $error_messages class property
315
+ *
316
+ * @since 6.3.0
317
+ *
318
+ * @param array | $error_messages | The array of user-defined error messages for this form
319
+ */
320
+ public function set_error_messages( $error_messages ) {
321
+ $this->error_messages = $error_messages;
322
+ }
323
+
324
+
325
+ /**** Simple Return Functions ****/
326
+
327
+ /**
328
+ * Return a sanitized email
329
+ *
330
+ * @since 6.3.0
331
+ *
332
+ * @param string | $email | The user's email
333
+ * @return string| $email | The user's email, sanitized
334
+ */
335
+ public function get_sanitized_email( $email ) {
336
+ return sanitize_email( $email );
337
+ }
338
+
339
+ /**
340
+ * Return the class property $skipped_form_fields
341
+ *
342
+ * @since 6.3.0
343
+ *
344
+ * @return array | $skipped_form_fields
345
+ */
346
+ protected function get_skipped_merge_tags() {
347
+ return $this->skipped_form_fields;
348
+ }
349
+
350
+
351
+ /**** Collection of functions handling the incoming form and interest group data ****/
352
+
353
+ /**
354
+ * Loop through form data to sanitize, format, filter, and return.
355
+ *
356
+ * @since 6.3.0
357
+ *
358
+ * @param array | $data | The array of user-submitted form values
359
+ * @param array | $form_fields | The array of form field definitions for this YIKES MailChimp form
360
+ * @return array| $merge_variables| The array of sanitized and formatted form values
361
+ */
362
+ public function get_submitted_merge_values( $data, $form_fields ) {
363
+
364
+ // loop to push variables to our array
365
+ foreach ( $data as $merge_tag => $value ) {
366
+
367
+ $skip_merge_tags = $this->get_skipped_merge_tags(); // Tested
368
+
369
+ // Skip any merge tags that aren't in the field settings, or that should be skipped.
370
+ if ( ! isset( $form_fields[ $merge_tag ] ) || isset( $skip_merge_tags[ $merge_tag ] ) ) {
371
+ continue;
372
+ }
373
+
374
+ // Sanitize the value to start with.
375
+ $sanitized = $this->sanitize_form_values( $merge_tag, $value );
376
+
377
+ // If the field is empty, don't include it.
378
+ if ( empty( $sanitized ) ) {
379
+ continue;
380
+ }
381
+
382
+ // Check if the current iteration has a 'date_format' key set (i.e. date/birthday fields)
383
+ if ( isset( $form_fields[ $merge_tag ]['date_format'] ) ) {
384
+ $sanitized = $this->handle_date_format_merge_values( $sanitized, $form_fields[ $merge_tag ]['date_format'] );
385
+ }
386
+
387
+ $merge_variables[ $merge_tag ] = $sanitized;
388
+ }
389
+
390
+ /**
391
+ * yikes-mailchimp-filter-before-submission || yikes-mailchimp-filter-before-submission-{$form_id}
392
+ *
393
+ * Catch the merge variables before they get sent over to MailChimp
394
+ * @since 6.0.0
395
+ *
396
+ * @param array | $merge_variables | The user submitted form data
397
+ */
398
+ $merge_variables = apply_filters( 'yikes-mailchimp-filter-before-submission', $merge_variables );
399
+ $merge_variables = apply_filters( 'yikes-mailchimp-filter-before-submission-{$this->form_id}', $merge_variables );
400
+
401
+ return $merge_variables;
402
+ }
403
+
404
+ /**
405
+ * Sanitize form values and return them
406
+ *
407
+ * @since 6.3.0
408
+ *
409
+ * @param string | $key | The MERGE/Field-name for this value
410
+ * @param mixed | $value | The form value - this could be an array or a string
411
+ * @return mixed | $sanitized | The $value sanitized
412
+ */
413
+ protected function sanitize_form_values( $key, $value ) {
414
+ if ( is_scalar( $value ) ) {
415
+ $sanitized = sanitize_text_field( $value );
416
+ } else {
417
+ $sanitized = array();
418
+ foreach ( $value as $key => $val ) {
419
+ $sanitized[ sanitize_text_field( $key ) ] = sanitize_text_field( $val );
420
+ }
421
+ }
422
+ return $sanitized;
423
+ }
424
+
425
+ /**
426
+ * Check a date field's date format and pass it along to the appropriate function
427
+ *
428
+ * @since 6.3.0
429
+ *
430
+ * @param string | $date | The unformatted date value
431
+ * @param string | $date_format | The date format
432
+ * @return string| $date | The date formatted according to the $date_format
433
+ */
434
+ protected function handle_date_format_merge_values( $date, $date_format ) {
435
+ // Check if EU date format (for dates: 'DD/MM/YYYY', for birthdays: 'DD/MM')
436
+ if ( 'DD/MM/YYYY' === $date_format ) {
437
+ $date = $this->handle_dd_mm_yyyy_date( $date );
438
+ } else if ( 'DD/MM' === $date_format ) {
439
+ $date = $this->handle_dd_mm_birthday( $date );
440
+ }
441
+
442
+ return $date;
443
+ }
444
+
445
+ /**
446
+ * Format a date field whose date format is dd/mm/yyyy
447
+ *
448
+ * @since 6.3.0
449
+ *
450
+ * @param string | $date | A date in the format dd/mm/yyyy
451
+ * @return string| $date | A date in the format mm/dd/yyyy
452
+ */
453
+ protected function handle_dd_mm_yyyy_date( $date ) {
454
+
455
+ // MailChimp wants the dates as 'MM/DD/YYYY' regardless of user-specified format, so convert
456
+
457
+ // Explode the date and then swap the pieces
458
+ $pieces = explode( '/', $date );
459
+
460
+ // Verify we have exactly three pieces
461
+ if ( count( $pieces ) === 3 ) {
462
+
463
+ // $pieces[1] = MM. $pieces[0] = DD. $date = MM/DD/YYYY
464
+ $date = $pieces[1] . '/' . $pieces[0] . '/' . $pieces[2];
465
+ }
466
+
467
+ return $date;
468
+ }
469
+
470
+ /**
471
+ * Format a birthday field whose date format is dd/mm
472
+ *
473
+ * @since 6.3.0
474
+ *
475
+ * @param string | $birthday | A date in the format dd/mm
476
+ * @return string| $birthday | A date in the format mm/dd
477
+ */
478
+ protected function handle_dd_mm_birthday( $birthday ) {
479
+
480
+ // MailChimp wants the birthdays as 'MM/DD' regardless of user-specified format, so convert
481
+
482
+ // Explode the date and then swap the pieces
483
+ $pieces = explode( '/', $birthday );
484
+
485
+ // Verify we have exactly two pieces
486
+ if ( count( $pieces ) === 2 ) {
487
+
488
+ // $pieces[1] = MM. $pieces[0] = DD. $birthday = MM/DD
489
+ $birthday = $pieces[1] . '/' . $pieces[0];
490
+ }
491
+
492
+ return $birthday;
493
+ }
494
+
495
+
496
+ /**
497
+ * Create an array of available interest groups based on the $replace_interests flag
498
+ *
499
+ * @since 6.3.0
500
+ *
501
+ * @param bool | $replace_interests| True if we're replacing interest groups, false if updating interest groups
502
+ * @param class | $list_class | Class for interacting with the current list
503
+ * @return array | $groups | Array of interest groups
504
+ */
505
+ public function get_default_interest_groups( $replace_interests, $list_class ) {
506
+
507
+ // If $replace_interests flag is true then loop through interst groups and set them all to false to start.
508
+ // If $replace_interests flag is false, return an empty array
509
+
510
+ // Set up our return array
511
+ $groups = array();
512
+
513
+ // Check our replace interests setting
514
+ if ( $replace_interests === true ) {
515
+
516
+ // Get all the interest groups for this list
517
+ $interest_groupings = $list_class->get_interest_categories( $this->list_id );
518
+
519
+ // Loop through the interest groups and create a single array like {group_id} => false
520
+ foreach ( $interest_groupings as $group_data ) {
521
+ $item_ids = array_keys( $group_data['items'] );
522
+ $keyed = array_fill_keys( $item_ids, false );
523
+ $groups = array_merge( $groups, $keyed );
524
+ }
525
+ return $groups;
526
+ } else {
527
+
528
+ // If we're not replacing interest groups, simply return an array
529
+ return $groups;
530
+ }
531
+ }
532
+
533
+
534
+ /**
535
+ * Loop through the interest group form data to sanitize, format, filter, and return.
536
+ *
537
+ * @since 6.3.0
538
+ *
539
+ * @param array | $data | The array of user-submitted form values
540
+ * @param array | $form_fields | The array of form field definitions for this YIKES MailChimp form
541
+ * @param array | $groups | The array of interest groups created by `get_default_interest_groups()`
542
+ * @return array| $groups | The array of sanitized and formatted form values
543
+ */
544
+ public function get_submitted_interest_groups( $data, $form_fields, $groups ) {
545
+
546
+ // loop to push variables to our array
547
+ foreach ( $data as $merge_tag => $value ) {
548
+
549
+ // Only look for interest groups (data comes in as group-{$group_id})
550
+ if ( strpos( $merge_tag, 'group-' ) !== false ) {
551
+
552
+ // Sanitize form values
553
+ $sanitized = $this->sanitize_form_values( $merge_tag, $value );
554
+
555
+ if ( is_array( $sanitized ) ) {
556
+ foreach ( $sanitized as $val ) {
557
+ $groups[ $val ] = true;
558
+ }
559
+ continue;
560
+ }
561
+
562
+ $groups[ $sanitized ] = true;
563
+ continue;
564
+ }
565
+ }
566
+
567
+ /**
568
+ * yikes-mailchimp-filter-groups-before-submission
569
+ *
570
+ * Catch the interest groups before they get sent over to MailChimp
571
+ * @param array | $groups | User submitted interest group data
572
+ * @optional int| $form_id| the ID of the form to filter
573
+ * @since 6.3.0
574
+ */
575
+ $groups = apply_filters( 'yikes-mailchimp-filter-groups-before-submission', $groups, $this->form_id );
576
+ $groups = apply_filters( 'yikes-mailchimp-filter-groups-before-submission-{$this->form_id}', $groups, $this->form_id );
577
+
578
+ return $groups;
579
+ }
580
+
581
+
582
+ /**** Functions to Handle Subscribe API Response ****/
583
+
584
+ /**
585
+ * Handle a successful subscribe request
586
+ *
587
+ * @since 6.3.0
588
+ *
589
+ * @param array | $submission_settings | Array of the form's submission settings
590
+ * @param array | $page_data | Array of the page data
591
+ * @param array | $merge_variables | Array of the submitted form variables
592
+ * @param array | $notifications | Literally don't know what this is yet.
593
+ * @param array | $optin_settings | Array of the form's optin settings
594
+ * @param bool | $new_subscriber | True if a new subscriber, false if an existing one
595
+ */
596
+ public function handle_submission_response_success( $submission_settings, $page_data, $merge_variables, $notifications, $optin_settings, $new_subscriber ) {
597
+
598
+ // Check if we should redirect
599
+ $redirect_array = $this->handle_submission_response_success_redirect( $submission_settings, $page_data );
600
+
601
+ // Fire off our actions
602
+
603
+ /**
604
+ * yikes-mailchimp-after-submission || yikes-mailchimp-after-submission-{$form_id}
605
+ *
606
+ * Catch the merge variables after they've been sent over to MailChimp
607
+ * @since 6.0.0
608
+ *
609
+ * @param array | $merge_variables | The array of user submitted form data
610
+ */
611
+ do_action( 'yikes-mailchimp-after-submission', $merge_variables );
612
+ do_action( "yikes-mailchimp-after-submission-{$this->form_id}", $merge_variables );
613
+
614
+ /**
615
+ * yikes-mailchimp-form-submission || yikes-mailchimp-form-submission-{$form_id}
616
+ *
617
+ * Catch our notifications and other form data
618
+ *
619
+ * @param string | $email | The user's email
620
+ * @param array | $merge_variables | The array of user submitted form data
621
+ * @param string | $form_id | The form ID
622
+ * @param array | $notifications | Array of notification messages
623
+ *
624
+ */
625
+ do_action( 'yikes-mailchimp-form-submission', $this->email, $merge_variables, $this->form_id, $notifications );
626
+ do_action( "yikes-mailchimp-form-submission-{$this->form_id}", $this->email, $merge_variables, $this->form_id, $notifications );
627
+
628
+ // Get the optin value
629
+ $optin = isset( $optin_settings['optin'] ) ? (int) $optin_settings['optin'] : 0;
630
+
631
+ if ( 1 === $optin ) {
632
+
633
+ // Allow the user-defined 'success' message to overwrite the default double opt-in response
634
+ $default_response = $this->check_for_user_defined_response_message( 'success', $this->default_response_double_optin_success_message );
635
+ } else {
636
+
637
+ // Allow the user-defined 'success-single-optin' message to overwrite the default single opt-in response
638
+ $default_response = $this->check_for_user_defined_response_message( 'success-single-optin', $this->default_response_single_optin_success_message );
639
+ }
640
+
641
+ // If they're not a new subscriber and we're updating their profile, then show them this message
642
+ // Allow the user-defined 'success-resubscribed' message to overwrite the default already subscribed response
643
+ $default_response = ( $new_subscriber === false ) ? $this->check_for_user_defined_response_message( 'success-resubscribed', $this->existing_subscriber_profile_update_message ) : $default_response;
644
+
645
+ /**
646
+ * yikes-mailchimp-success-response
647
+ *
648
+ * Filter the success message displayed to the user
649
+ *
650
+ * @param string | $default_response | The response message that will be shown to the user if unchanged (see above for logic)
651
+ * @param string | $form_id | The form ID
652
+ * @param array | $merge_variables | The array of user submitted form data
653
+ *
654
+ */
655
+ $response_message = apply_filters( 'yikes-mailchimp-success-response', $default_response, $this->form_id, $merge_variables );
656
+
657
+ // Construct our success array variables
658
+ $return_success_array = array(
659
+ 'hide' => $submission_settings['hide_form_post_signup'],
660
+ 'error' => 0,
661
+ 'response' => $response_message,
662
+ 'redirection' => $redirect_array['redirection'],
663
+ 'redirect' => $redirect_array['redirect']
664
+ );
665
+
666
+ // Return success array
667
+ return $this->yikes_success( $return_success_array );
668
+ }
669
+
670
+ /**
671
+ * Handle an unsuccessful/error subscribe request
672
+ *
673
+ * @since 6.3.0
674
+ *
675
+ * @param object | $subscribe_response | The response from the API
676
+ * @param array | $form_fields | The array of form field definitions for this YIKES MailChimp form
677
+ */
678
+ public function handle_submission_response_error( $subscribe_response, $form_fields ) {
679
+
680
+ // Get the error data
681
+ $error_data = $subscribe_response->get_error_data();
682
+ $details = '';
683
+
684
+ // Loop through the error data and retrieve any fields and messages
685
+ if ( isset( $error_data['data'] ) ) {
686
+ foreach ( $error_data['data'] as $datum ) {
687
+ if ( ! isset( $datum['field'], $datum['message'] ) ) {
688
+ continue;
689
+ }
690
+ $details .= sprintf( '<br>Error with %1$s field: <strong>%2$s</strong>', $form_fields[ $datum['field'] ]['label'], $datum['message'] );
691
+ }
692
+ }
693
+
694
+ // Get the error message and concat it to the error details string
695
+ $error_message = $subscribe_response->get_error_message();
696
+ if ( ! empty( $details ) ) {
697
+ $error_message .= $details;
698
+ }
699
+
700
+ // Log the error
701
+ $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
702
+ $error_logging->maybe_write_to_log( $error_message, __( 'New Subscriber', 'yikes-inc-easy-mailchimp-extender' ), 'process_form_submission_ajax.php' );
703
+
704
+ // Check for a user-defined 'general-error' message
705
+ $error_message = $this->check_for_user_defined_response_message( 'general-error', $error_message );
706
+
707
+ // Set up our return fields and send error
708
+ $additional_response_fields = array( 'security_response' => 'test', 'data' => $subscribe_response->get_error_data() );
709
+
710
+ return $this->yikes_fail( $hide = 0, $subscribe_response->get_error_code(), $error_message, $additional_response_fields, $return_response_non_ajax = true );
711
+ }
712
+
713
+ /**
714
+ * Handle the redirect logic for successful submissions
715
+ *
716
+ * @since 6.3.0
717
+ *
718
+ * @param array | $submission_settings | Array of the form's submission settings
719
+ * @param array | $page_data | Array of the page data
720
+ * @return array| $redirect_array | Array with two values: Redirection flag, Redirect URL
721
+ */
722
+ protected function handle_submission_response_success_redirect( $submission_settings, $page_data ) {
723
+
724
+ // Set up our return array with default values
725
+ $redirect_array = array(
726
+ 'redirection' => 0,
727
+ 'redirect' => ''
728
+ );
729
+
730
+ // Let's confirm we have a value before trying to use it
731
+ $redirect_setting = isset( $submission_settings['redirect_on_submission'] ) ? $submission_settings['redirect_on_submission'] : false;
732
+
733
+ // Check the redirect flag
734
+ if ( '1' === $redirect_setting ) {
735
+
736
+ // Set up our return array
737
+ $redirect_array = array();
738
+
739
+ // Supply return array with default value of 1
740
+ $redirect_array['redirection'] = 1;
741
+
742
+ // Let's confirm we have redirect_page/custom_redirect_url values
743
+ $redirect_page_setting = isset( $submission_settings['redirect_page'] ) ? $submission_settings['redirect_page'] : false;
744
+ $custom_redirect_setting = isset( $submission_settings['custom_redirect_url'] ) ? $submission_settings['custom_redirect_url'] : false;
745
+
746
+ // Check if we're redirecting to a custom_url or just the redirect_page
747
+ $redirect_url = ( 'custom_url' !== $redirect_page_setting ) ? get_permalink( $redirect_page_setting ) : $custom_redirect_setting;
748
+
749
+ /**
750
+ * yikes-mailchimp-redirect-url
751
+ *
752
+ * Catch the redirect URL before it's shown to the user
753
+ *
754
+ * @param string | $redirect_url | The URL that we will redirect to
755
+ * @param string | $form_id | The ID of the current form being subscribed to
756
+ * @param array | $page_data | An array of data related to the page the form is on
757
+ */
758
+ $redirect_url = apply_filters( 'yikes-mailchimp-redirect-url', esc_url( $redirect_url ), $this->form_id, $page_data );
759
+
760
+ /**
761
+ * yikes-mailchimp-redirect-timer
762
+ *
763
+ * Catch the redirect timer before it's sent to the JavaScript file
764
+ *
765
+ * @param int | $default_redirect_time_ms | The default time (1500 milliseconds) to wait before redirecting
766
+ */
767
+ $redirect_timer = apply_filters( 'yikes-mailchimp-redirect-timer', $this->default_redirect_time_ms, $this->form_id );
768
+
769
+ // Well this definitely has to change... why are we writing JavaScript in PHP?
770
+ $redirect_array['redirect'] = '<script type="text/javascript">setTimeout(function() { window.location="' . $redirect_url . '"; }, ' . $redirect_timer . ');</script>';
771
+ }
772
+
773
+ return $redirect_array;
774
+ }
775
+
776
+
777
+ /**** Handle empty fields / Check for required form data / Handle checks for things like honeypot, nonce, etc. ****/
778
+
779
+ // Note: All of these functions return `return $this->yikes_fail()`. Check function for more info.
780
+
781
+ /**
782
+ * Check if the submitted form data is missing any required fields
783
+ *
784
+ * @since 6.3.0
785
+ *
786
+ * @param array | $data | The array of user-submitted form values
787
+ * @param array | $form_fields | The array of form field definitions for this YIKES MailChimp form
788
+ */
789
+ public function check_for_required_form_fields( $data, $form_fields ) {
790
+
791
+ // Set up our defaults
792
+ $field_is_missing = false;
793
+ $missing_fields = array();
794
+
795
+ // Loop through submitted form data
796
+ foreach( $data as $merge_tag => $value ) {
797
+
798
+ // Skip interest groups
799
+ if ( isset( $form_fields[ $merge_tag ]['group_id'] ) ) {
800
+ continue;
801
+ }
802
+
803
+ // check if this field is required
804
+ if (isset( $form_fields[ $merge_tag ] ) && isset( $form_fields[ $merge_tag ]['require'] ) && $form_fields[ $merge_tag ]['require'] === '1' ) {
805
+
806
+ // Check if the field(s) are empty
807
+ if ( is_array( $value ) ) {
808
+
809
+ // Loop through the data and check if any are empty
810
+ foreach( $value as $val ) {
811
+ if ( empty( $val ) ) {
812
+ $field_is_missing = true;
813
+
814
+ // Set the merge label (e.g. MMERGE6) as the key so we don't get the same field multiple times
815
+ // (e.g. For arrays, like an address, where multiple address fields are empty)
816
+ $missing_fields[ $form_fields[ $merge_tag ]['merge'] ] = $form_fields[ $merge_tag ];
817
+ }
818
+ }
819
+
820
+ } else if ( empty( $value ) ) {
821
+ $field_is_missing = true;
822
+ $missing_fields[ $form_fields[ $merge_tag ]['merge'] ] = $form_fields[ $merge_tag ];
823
+ }
824
+ }
825
+ }
826
+
827
+ // After we've looped through all the fields, check if we've found a missing field
828
+ // Note: we do this at the end so we can highlight ALL of the missing fields, instead of the first one we found
829
+ if ( $field_is_missing === true ) {
830
+
831
+ // Construct our return array
832
+ $additional_fields = array(
833
+ 'missing_required_field' => true,
834
+ 'missing_required_field_data' => $missing_fields,
835
+ 'is_interest_group' => false
836
+ );
837
+
838
+ /**
839
+ * yikes-mailchimp-required-form-field-missing
840
+ *
841
+ * Alter the response message shown to the user for missing required form fields
842
+ *
843
+ * @param string | $handle_empty_required_field_message | The default message displayed to the user
844
+ * @param int | $form_id | The ID of the form
845
+ * @param array | $missing_fields | Array of the missing required fields
846
+ */
847
+ $default_response = apply_filters( 'yikes-mailchimp-required-form-field-missing', $this->handle_empty_required_field_message, $this->form_id, $missing_fields );
848
+
849
+ // If we've found a missing field, return the array of field data
850
+ return $this->yikes_fail( $hide = 0, $error = 1, $default_response, $additional_fields );
851
+ }
852
+ }
853
+
854
+ /**
855
+ * Check if the submitted form interest group data is missing any required fields
856
+ *
857
+ * @since 6.3.0
858
+ *
859
+ * @param array | $data | The array of user-submitted form values
860
+ * @param array | $form_fields | The array of form field definitions for this YIKES MailChimp form
861
+ */
862
+ public function check_for_required_interest_groups( $data, $form_fields ) {
863
+
864
+ // Set up our defaults
865
+ $field_is_missing = false;
866
+ $missing_fields = array();
867
+
868
+ // Loop through the form fields
869
+ foreach ( $form_fields as $merge_tag => $field_data ) {
870
+
871
+ // If an interest group and it's required
872
+ if ( isset( $field_data['group_id'] ) && isset( $field_data['require'] ) && $field_data['require'] === '1' ) {
873
+
874
+ // Check if it was submitted (meaning, check if it's set in our $data array)
875
+ if ( ! isset( $data[ 'group-' . $merge_tag ] ) ) {
876
+
877
+ $field_is_missing = true;
878
+ $missing_fields[ $merge_tag ] = $field_data;
879
+ }
880
+ }
881
+ }
882
+
883
+ // After we've looped through all the fields, check if we've found a missing field
884
+ // Note: we do this at the end so we can highlight ALL of the missing fields, instead of the first one we found
885
+ if ( $field_is_missing === true ) {
886
+
887
+ // Construct our return array
888
+ $additional_fields = array(
889
+ 'missing_required_field' => true,
890
+ 'missing_required_field_data' => $missing_fields,
891
+ 'is_interest_group' => true
892
+ );
893
+
894
+ /**
895
+ * yikes-mailchimp-required-interest-group-missing
896
+ *
897
+ * Alter the response message shown to the user for missing required form fields
898
+ *
899
+ * @param string | $handle_empty_required_interest_group_message | The default message displayed to the user
900
+ * @param int | $form_id | The ID of the form
901
+ * @param array | $missing_fields | Array of the missing required fields
902
+ */
903
+ $default_response = apply_filters( 'yikes-mailchimp-required-interest-group-missing', $this->handle_empty_required_interest_group_message, $this->form_id, $missing_fields );
904
+
905
+ // If we find a required interest group with an empty value, send an error
906
+ return $this->yikes_fail( $hide = 0, $error = 1, $default_response, $additional_fields );
907
+ }
908
+ }
909
+
910
+ /**
911
+ * Handle the reCAPTCHA
912
+ *
913
+ * @since 6.3.0
914
+ *
915
+ * @param string | $recaptcha_response | The form value of the recaptcha field
916
+ */
917
+ public function handle_recaptcha( $recaptcha_response ) {
918
+
919
+ // Construct the API URL
920
+ $url = esc_url_raw( 'https://www.google.com/recaptcha/api/siteverify?secret=' . get_option( 'yikes-mc-recaptcha-secret-key', '' ) . '&response=' . $recaptcha_response . '&remoteip=' . $_SERVER['REMOTE_ADDR'] );
921
+ $response = wp_remote_get( $url );
922
+ $response_body = json_decode( $response['body'], true );
923
+
924
+ // Set up errors array
925
+ $recaptcha_errors = array();
926
+
927
+ // if we've hit an error, lets return the error!
928
+ if ( true !== $response_body['success'] ) {
929
+
930
+ if( isset( $response_body['error-codes'] ) ) {
931
+
932
+ // Loop through response error codes
933
+ foreach ( $response_body['error-codes'] as $error_code ) {
934
+ if ( 'missing-input-response' === $error_code ) {
935
+ $error_code = $this->handle_non_filled_recaptcha_message;
936
+ }
937
+
938
+ // Add our error_code to the errors array
939
+ $recaptcha_errors[] = $error_code;
940
+ }
941
+
942
+ } else {
943
+ $recaptcha_errors[] = $this->generic_recaptcha_error_message;
944
+ }
945
+
946
+ /**
947
+ * yikes-mailchimp-recaptcha-required-error
948
+ *
949
+ * Catch the recaptcha errors before they're returned to the user
950
+ * @param string | $recaptcha_errors | A string of recaptcha errors separated by a space
951
+ */
952
+ $response = apply_filters( 'yikes-mailchimp-recaptcha-required-error', implode( ' ', $recaptcha_errors ), $this->form_id );
953
+ return $this->yikes_fail( $hide = 0, $error = 1, $response, false, $return_response_non_ajax = true );
954
+ }
955
+ }
956
+
957
+ /**
958
+ * Handle the nonce field
959
+ *
960
+ * @since 6.3.0
961
+ *
962
+ * @param string | $nonce_value | The form value of the nonce
963
+ * @param string | $nonce_name | The name of the nonce
964
+ */
965
+ public function handle_nonce( $nonce_value, $nonce_name ) {
966
+ if ( wp_verify_nonce( $nonce_value, $nonce_name ) === false ) {
967
+ return $this->yikes_fail( $hide = 0, $error = 1, $this->handle_nonce_message );
968
+ }
969
+ }
970
+
971
+ /**
972
+ * Handle a merge_variables error
973
+ *
974
+ * @since 6.3.0
975
+ *
976
+ * @param int | $error | Int $error = 1 if an error
977
+ * @param string | $message | The message shown to the user
978
+ */
979
+ public function handle_merge_variables_error( $error, $message ) {
980
+ return $this->yikes_fail( $hide = 0, $error, $message, false, $return_response_non_ajax = true );
981
+ }
982
+
983
+ /**
984
+ * Handle an empty email field and return the corresponding error message
985
+ *
986
+ * @since 6.3.0
987
+ *
988
+ * @param string | $email
989
+ */
990
+ public function handle_empty_email( $email ) {
991
+ if ( empty( $email ) ) {
992
+ return $this->yikes_fail( $hide = 0, $error = 1, $this->handle_empty_email_message );
993
+ }
994
+ }
995
+
996
+ /**
997
+ * Check if the form is empty and return the corresponding error message
998
+ *
999
+ * @since 6.3.0
1000
+ *
1001
+ * @param array | $form_data
1002
+ */
1003
+ public function handle_empty_form( $form_data ) {
1004
+ if ( empty( $form_data ) ) {
1005
+ return $this->yikes_fail( $hide = 0, $error = 1, $this->handle_empty_form_message );
1006
+ }
1007
+ }
1008
+
1009
+ /**
1010
+ * Check if the honeypot is NOT empty and return the corresponding error message
1011
+ *
1012
+ * @since 6.3.0
1013
+ *
1014
+ * @param bool | $honey_pot_filled | True if the honeypot was filled out
1015
+ */
1016
+ public function handle_non_empty_honeypot( $honey_pot_filled ) {
1017
+ if ( $honey_pot_filled === true ) {
1018
+ return $this->yikes_fail( $hide = 0, $error = 1, $this->handle_non_empty_honeypot_message );
1019
+ }
1020
+ }
1021
+
1022
+ /**
1023
+ * Loop through fields looking for null and return the corresponding error message
1024
+ *
1025
+ * @since 6.3.0
1026
+ *
1027
+ * @param array | $fields_array | An array of fields to loop through and make sure they're not null
1028
+ */
1029
+ public function handle_empty_fields_generic( $fields_array ) {
1030
+ foreach( $fields_array as $field ) {
1031
+ if ( $field === null ) {
1032
+ return $this->yikes_fail( $hide = 0, $error = 1, $this->handle_empty_fields_generic_message );
1033
+ }
1034
+ }
1035
+ }
1036
+
1037
+ /**
1038
+ * Check if the list handler is empty and return the corresponding error message
1039
+ *
1040
+ * @since 6.3.0
1041
+ *
1042
+ * @param class | $list_handler | A class that handles list functions
1043
+ */
1044
+ public function handle_empty_list_handler( $list_handler ) {
1045
+ if ( empty( $list_handler ) ) {
1046
+ return $this->yikes_fail( $hide = 0, $error = 1, $this->handle_empty_list_handler_message );
1047
+ }
1048
+ }
1049
+
1050
+ /**
1051
+ * Check if the form id is empty and return the corresponding error message
1052
+ *
1053
+ * @since 6.3.0
1054
+ *
1055
+ * @param int | $form_id | The form ID
1056
+ */
1057
+ public function handle_empty_form_id( $form_id ) {
1058
+ if ( empty( $form_id ) ) {
1059
+ return $this->yikes_fail( $hide = 0, $error = 1, $this->handle_empty_form_id_message );
1060
+ }
1061
+ }
1062
+
1063
+ /**
1064
+ * Construct and filter the error message related to user's re-subscribing when it's not allowed
1065
+ *
1066
+ * @since 6.3.0
1067
+ */
1068
+ public function handle_disallowed_existing_user_update() {
1069
+
1070
+ // Get the default response
1071
+ $default_response = $this->handle_disallowed_existing_user_update_message;
1072
+
1073
+ // Run the default response through our function to check for a user-defined response message
1074
+ $response = $this->check_for_user_defined_response_message( 'already-subscribed', $default_response );
1075
+
1076
+ return $this->yikes_fail( $hide = 0, $error = 1, $response, false, $return_response_non_ajax = true );
1077
+ }
1078
+
1079
+ /**
1080
+ * Construct and filter the error message related to the profile link to update user's profile
1081
+ *
1082
+ * @since 6.3.0
1083
+ */
1084
+ public function handle_updating_existing_user() {
1085
+
1086
+ // Get the first half of the message
1087
+ $response = $this->handle_updating_existing_user_message;
1088
+
1089
+ // Create our link variables
1090
+ $link_start_tag = '<a class="send-update-email" data-form-id="' . $this->form_id . '" data-list-id="' . $this->list_id . '" data-user-email="' . $this->email . '" href="#">';
1091
+ $link_close_tag = '</a>';
1092
+ $link_array = array( 'link_start_tag' => $link_start_tag, 'link_close_tag' => $link_close_tag );
1093
+
1094
+ // Append our 'send-update-email' link and text
1095
+ $response .= $link_start_tag;
1096
+ $response .= $this->handle_updating_existing_user_link_message;
1097
+ $response .= $link_close_tag;
1098
+
1099
+ // Check for a user-defined message
1100
+ $response = $this->check_for_user_defined_response_message( 'update-link', $response, $link_array );
1101
+
1102
+ return $this->yikes_fail( $hide = 0, $error = 1, $response, false, $return_response_non_ajax = true );
1103
+ }
1104
+
1105
+ /**** Helper Functions ****/
1106
+
1107
+ /**
1108
+ * Check the user-defined $error_messages array for a message, filter it, and return it. These messages overwrite the defaults.
1109
+ *
1110
+ * @since 6.3.0
1111
+ *
1112
+ * @param string | $slug | The type of message we're looking for
1113
+ * @param string | $response_text| The default response message
1114
+ * @param array | $data | An array of data that may be needed to construct the user's error message
1115
+ * @return string| $response_text| The $response_text (after it's potentially been changed)
1116
+ */
1117
+ protected function check_for_user_defined_response_message( $slug, $response_text, $data = false ) {
1118
+
1119
+ switch( $slug ) {
1120
+ case 'already-subscribed':
1121
+
1122
+ // Check if this error message exists
1123
+ if ( isset( $this->error_messages['already-subscribed'] ) && ! empty( $this->error_messages['already-subscribed'] ) ) {
1124
+
1125
+ // Check if the substring (that we replace) '[email]' is located in the string and replace it
1126
+ $response_text = str_replace( '[email]', $this->email, $this->error_messages['already-subscribed'] );
1127
+ }
1128
+
1129
+ /**
1130
+ * yikes-easy-mailchimp-user-already-subscribed-text
1131
+ *
1132
+ * Catch the message for user's already subscrbed before we show it to the user
1133
+ * @param string | $message | The response message
1134
+ * @param int | $form_id | The form id
1135
+ * @param string | $email | The user's email
1136
+ */
1137
+ $response_text = apply_filters( 'yikes-mailchimp-user-already-subscribed-text', $response_text, $this->form_id, $this->email );
1138
+
1139
+ return $response_text;
1140
+ break;
1141
+
1142
+ case 'update-link':
1143
+
1144
+ // Check if this error message exists
1145
+ if ( $data !== false && isset( $this->error_messages['update-link'] ) && ! empty( $this->error_messages['update-link'] ) ) {
1146
+
1147
+ // Check if the substring (that we replace) '[link]' is located in the string and replace it
1148
+ $response_text = str_replace( '[link]', $data['link_start_tag'], $this->error_messages['update-link'] );
1149
+
1150
+ // Remove [/link]
1151
+ $response_text = str_replace( '[/link]', $data['link_close_tag'], $response_text );
1152
+ }
1153
+
1154
+ /**
1155
+ * yikes-easy-mailchimp-user-already-subscribed-link-text
1156
+ *
1157
+ * Catch the message for user's already subscrbed link text before we show it to the user
1158
+ *
1159
+ * @param string | $response_text | The response message that will be shown to the user
1160
+ * @param string | $form_id | The form ID
1161
+ */
1162
+ $response_text = apply_filters( 'yikes-mailchimp-user-already-subscribed-link-text', $response_text, $this->form_id );
1163
+
1164
+ return $response_text;
1165
+ break;
1166
+
1167
+ case 'success':
1168
+
1169
+ // 'success' is the user-defined success message for double opt-in
1170
+ if ( isset( $this->error_messages['success'] ) && ! empty( $this->error_messages['success'] ) ) {
1171
+ $response_text = $this->error_messages['success'];
1172
+ }
1173
+
1174
+ /**
1175
+ * yikes-mailchimp-success-double-optin-response
1176
+ *
1177
+ * Filter the success message displayed to the user
1178
+ *
1179
+ * @param string | $response_text | The response message that will be shown to the user
1180
+ * @param string | $form_id | The form ID
1181
+ *
1182
+ */
1183
+ $response_text = apply_filters( 'yikes-mailchimp-success-double-optin-response', $response_text, $this->form_id );
1184
+
1185
+ return $response_text;
1186
+ break;
1187
+
1188
+ case 'success-single-optin':
1189
+
1190
+ if ( isset( $this->error_messages['success-single-optin'] ) && ! empty( $this->error_messages['success-single-optin'] ) ) {
1191
+ $response_text = $this->error_messages['success-single-optin'];
1192
+ }
1193
+
1194
+ /**
1195
+ * yikes-mailchimp-success-single-optin-response
1196
+ *
1197
+ * Filter the success message displayed to the user
1198
+ *
1199
+ * @param string | $response_text | The response message that will be shown to the user
1200
+ * @param string | $form_id | The form ID
1201
+ *
1202
+ */
1203
+ $response_text = apply_filters( 'yikes-mailchimp-success-single-optin-response', $response_text, $this->form_id );
1204
+
1205
+ return $response_text;
1206
+ break;
1207
+
1208
+ case 'success-resubscribed':
1209
+
1210
+ if ( isset( $this->error_messages['success-resubscribed'] ) && ! empty( $this->error_messages['success-resubscribed'] ) ) {
1211
+ $response_text = $this->error_messages['success-resubscribed'];
1212
+ }
1213
+
1214
+ /**
1215
+ * yikes-mailchimp-success-resubscribed-response
1216
+ *
1217
+ * Filter the success message displayed to the user
1218
+ *
1219
+ * @param string | $response_text | The response message that will be shown to the user
1220
+ * @param string | $form_id | The form ID
1221
+ *
1222
+ */
1223
+ $response_text = apply_filters( 'yikes-mailchimp-success-resubscribed-response', $response_text, $this->form_id );
1224
+
1225
+ return $response_text;
1226
+ break;
1227
+
1228
+ case 'general-error':
1229
+
1230
+ if ( isset( $this->error_messages['general-error'] ) && ! empty( $this->error_messages['general-error'] ) ) {
1231
+ $response_text = $this->error_messages['general-error'];
1232
+ }
1233
+
1234
+ /**
1235
+ * yikes-mailchimp-general-error-response
1236
+ *
1237
+ * Filter the error message displayed to the user
1238
+ *
1239
+ * @param string | $response_text | The response message that will be shown to the user
1240
+ * @param string | $form_id | The form ID
1241
+ *
1242
+ */
1243
+ $response_text = apply_filters( 'yikes-mailchimp-general-error-response', $response_text, $this->form_id );
1244
+
1245
+ return $response_text;
1246
+ break;
1247
+
1248
+ // Default to just returning the message supplied to us
1249
+ case 'default':
1250
+ return $response_text;
1251
+ break;
1252
+ }
1253
+ }
1254
+
1255
+ /**
1256
+ * Wrap the response message in HTML for Non-AJAX form submissions
1257
+ *
1258
+ * @since 6.3.0
1259
+ *
1260
+ * @param string | $message | The response message
1261
+ * @param bool | $is_success | Boolean signifying if we're returning a success message or an error message
1262
+ * @return string| The $message wrapping in HTML
1263
+ */
1264
+ public function wrap_form_submission_response( $message, $is_success ) {
1265
+
1266
+ // If we're successful, we wrap the $message differently
1267
+ if ( $is_success === true ) {
1268
+ return '<p class="yikes-easy-mc-success-message yikes-easy-mc-hidden">' . $message . '</p>';
1269
+ } else {
1270
+ return '<p class="yikes-easy-mc-error-message yikes-easy-mc-hidden">' . $message . '</p>';
1271
+ }
1272
+ }
1273
+
1274
+ /**** Returning Success / Failure Functions ****/
1275
+
1276
+ /**
1277
+ * Return success. Method of returning success based on the $is_ajax flag
1278
+ *
1279
+ * @since 6.3.0
1280
+ *
1281
+ * @param array | $success_array | Array of success values to return
1282
+ *
1283
+ * @return If AJAX, return wp_send_json_success(). If not AJAX, set the global $process_submission_response variable and simply `return`.
1284
+ */
1285
+ protected function yikes_success( $success_array ) {
1286
+ if ( $this->is_ajax === true ) {
1287
+ wp_send_json_success( $success_array );
1288
+ } else {
1289
+ global $process_submission_response;
1290
+
1291
+ $process_submission_response = isset( $success_array['response'] ) ? $success_array['response'] : ''; // DEFAULT SUCCESS?
1292
+ $process_submission_response = $this->wrap_form_submission_response( $process_submission_response, $is_success = true );
1293
+ }
1294
+ }
1295
+
1296
+ /**
1297
+ * Return failure. Method of returning failure based on the $is_ajax flag
1298
+ *
1299
+ * @since 6.3.0
1300
+ *
1301
+ * @param int | $hide | Flag whether to hide the form (1 = hide, 0 = do not hide)
1302
+ * @param int | $error | Flag whether this is an error (1 = error, 0 = no error)
1303
+ * @param string | $response | The response message to display to the user
1304
+ * @param array | $additional_fields | An array of additional fields to return
1305
+ * @param bool | $return_response_non_ajax | Boolean deciding if we need to return a message
1306
+ *
1307
+ * @return If AJAX, return $this->yikes_send_json_error(). If not AJAX, return an array || false.
1308
+ */
1309
+ protected function yikes_fail( $hide, $error, $response, $additional_fields = array(), $return_response_non_ajax = false ) {
1310
+ if ( $this->is_ajax === true ) {
1311
+ $this->yikes_send_json_error( $hide, $error, $response, $additional_fields );
1312
+ } else {
1313
+ if ( $return_response_non_ajax === true ) {
1314
+ return array( 'success' => false, 'message' => $response );
1315
+ }
1316
+ return false;
1317
+ }
1318
+ }
1319
+
1320
+ /**
1321
+ * Wrapper function for wp_send_json_error()
1322
+ *
1323
+ * @since 6.3.0
1324
+ *
1325
+ * @param int | $hide | Flag whether to hide the form (1 = hide, 0 = do not hide)
1326
+ * @param int | $error | Flag whether this is an error (1 = error, 0 = no error)
1327
+ * @param string | $translated_string | The response message to display to the user
1328
+ * @param array | $additional_fields | An array of additional fields to return
1329
+ * @return func | wp_send_json_error()
1330
+ */
1331
+ protected function yikes_send_json_error( $hide, $error, $translated_string, $additional_fields = array() ) {
1332
+
1333
+ // Default response array
1334
+ $response_array = array(
1335
+ 'hide' => $hide,
1336
+ 'error' => $error,
1337
+ 'response' => $translated_string
1338
+ );
1339
+
1340
+ // Add additional fields we've been supplied
1341
+ foreach( $additional_fields as $key => $value ) {
1342
+ $response_array[$key] = $value;
1343
+ }
1344
+
1345
+ wp_send_json_error( $response_array );
1346
+ }
1347
+
1348
+ }
public/css/yikes-inc-easy-mailchimp-extender-public.css CHANGED
@@ -1,2 +1 @@
1
- /**
2
  * All of the CSS for your public-facing functionality should be
3
  * included in this file.
4
  */
5
  .yikes-easy-mc-form {
6
  }
7
  /* Input heights */
8
  .yikes-easy-mc-form select,
9
  .yikes-easy-mc-form input[type="text"],
10
  .yikes-easy-mc-form input[type="url"],
11
  .yikes-easy-mc-form input[type="email"],
12
  .yikes-easy-mc-form input[type="number"] {
13
  }
14
  .yikes-easy-mc-form select:focus,
15
  .yikes-easy-mc-form input[type="text"]:focus,
16
  .yikes-easy-mc-form input[type="url"]:focus,
17
  .yikes-easy-mc-form input[type="email"]:focus,
18
  .yikes-easy-mc-form input[type="number"]:focus {
19
  }
20
  /* Datepicker */
21
  }
22
  /* Submit Button */
23
  .yikes-easy-mc-form .yikes-easy-mc-submit-button {
24
  }
25
  /* Form Description */
26
  .yikes-easy-mc-form .form-field-description {
27
  /* Labels & Descriptions */
28
  .yikes-easy-mc-form label,
29
  .yikes-easy-mc-form .field-no-label {
30
  }
31
  /* Interest Group Required Error Notice */
32
  p.yikes-mailchimp-required-interest-group-error {
33
  }
34
  /* No Label Descriptions */
35
  .yikes-easy-mc-form select,
36
  .yikes-easy-mc-form input[type="number"],
37
  .yikes-easy-mc-form input[type="text"],
38
  .yikes-easy-mc-form input[type="email"],
39
  .yikes-easy-mc-form input[type="url"],
40
  .yikes-easy-mc-form input[type="password"],
41
  .yikes-easy-mc-form textarea {
42
  }
43
  /** Radio Form Buttons **/
44
  .checkbox-parent-label {
45
  }
46
  .yikes-easy-mc-form .yikes-easy-mc-checkbox-label {
47
  }
48
  .yikes-easy-mc-display-none,
49
  .mailchimp-field-hidden {
50
  }
51
  .yikes-easy-mc-text-align-right {
52
  }
53
  /******************************************/
54
  /* Front End Pre-defined Classes */
55
  /******************************************/
56
- /*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInlpa2VzLWluYy1lYXN5LW1haWxjaGltcC1leHRlbmRlci1wdWJsaWMuY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGtHQUFBLEdBQWtHLHVCQUFJLGVBQUEsRUFBQSxZQUFBLEdBQUEsR0FBQSx5Q0FBd0MsZUFBbUIsR0FBeUMsbUJBQUEsR0FBQSxHQUFBLDhDQUFBLEVBQUEsb0RBQTRDLHNCQUFBLEdBQUEsWUFBQSxHQUFBLEdBQUEsbUJBQUEsRUFBQSxvTUFBQSxrQkFBcUIsRUFBQSwwQkFBQSxFQUFBLHdDQUFBLEVBQUEsZUFBQSxFQUFBLDRCQUFBLEVBQUEsbUJBQUEsR0FBQSxHQUFBLGtPQUFBLDBDQUFBLEVBQUEsMENBQTRTLEdBQUEsR0FBQSxnQkFBQSxDQUFBLDhGQUF3VCxpQkFBQSxHQUFBLEdBQUEsbUJBQThMLEVBQUEsb0RBQUEsZUFBQSxDQUFBLGtGQUFBLEVBQUEsWUFBQSxFQUFBLGlCQUE2SSxFQUFBLGlCQUEwRSxFQUFBLGNBQUEsRUFBQSxnQkFBQSxHQUFBLEVBQUEscUVBQUEsbUJBQUEsR0FBQSxHQUFBLHdEQUFpRyxHQUFBLDRFQUFzSSxjQUF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S1mb3Jtcy9cclx0XHRcclx0LyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqL1xyXHQvKiAgICAgICAgSW5saW5lIFJhZGlvICYgQ2hlY2tib3hlcyAgICAgICAqL1xyXHQvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi9cclx0Lnlpa2VzLWVhc3ktbWMtZm9ybSBsYWJlbC5vcHRpb24taW5saW5lID4gbGFiZWwge1xyXHRcdGRpc3BsYXk6IGlubGluZS1ibG9jaztcclx0XHRmbG9hdDogbGVmdDtcclx0XHR3aWR0aDogYXV0bztcclx0XHRtYXJnaW4tcmlnaHQ6IDE1cHg7XHJcdH1cdFxyXHRcdFxyXHQvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovXHJcdC8qICAgXHQgIFx0XHQyLUNvbHVtbiBSYWRpbyAgICAgICAgICAgKi9cclx0LyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovXHJcdC55aWtlcy1lYXN5LW1jLWZvcm0gbGFiZWwub3B0aW9uLTItY29sID4gbGFiZWwge1xyXHRcdGRpc3BsYXk6IGlubGluZS1ibG9jaztcclx0XHRmbG9hdDogbGVmdDtcclx0XHR3aWR0aDogNTAlO1xyXHR9XHJcdFxyXHQvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovXHJcdC8qICAgXHQgIFx0XHQzLUNvbHVtbiBSYWRpbyAgICAgICAgICAgKi9cclx0LyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovXHJcdC55aWtlcy1lYXN5LW1jLWZvcm0gbGFiZWwub3B0aW9uLTMtY29sID4gbGFiZWwge1xyXHRcdGRpc3BsYXk6IGlubGluZS1ibG9jaztcclx0XHRmbG9hdDogbGVmdDtcclx0XHR3aWR0aDogMzMlO1xyXHR9XHJcdFxyXHQvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovXH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dCB9XHJcdCBcclx0IC55aWtlcy1lYXN5LW1jLWZvcm0gbGFiZWwuZmllbGQtcmlnaHQtdGhpcmQge1xyXHRcdHdpZHRoOiAzMiU7XHJcdFx0ZmxvYXQ6IHJpZ2h0O1xyXHRcdG1hcmdpbi1sZWZ0OiAxLjMzMzMzJTtcclx0IH1cclx0IFxyXHQgXHJcdC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovXHJcdC8qXHRcdENoZWNrYm94IEludGVncmF0aW9uIFN0eWxlc1x0ICovXHJcdC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi9cclx0Il19 */
57
  * All of the CSS for your public-facing functionality should be
58
  * included in this file.
59
  */
60
  .yikes-easy-mc-form {
61
  }
62
  /* Input heights */
63
  .yikes-easy-mc-form select,
64
  .yikes-easy-mc-form input[type="text"],
65
  .yikes-easy-mc-form input[type="url"],
66
  .yikes-easy-mc-form input[type="email"],
67
  .yikes-easy-mc-form input[type="number"] {
68
  }
69
  .yikes-easy-mc-form select:focus,
70
  .yikes-easy-mc-form input[type="text"]:focus,
71
  .yikes-easy-mc-form input[type="url"]:focus,
72
  .yikes-easy-mc-form input[type="email"]:focus,
73
  .yikes-easy-mc-form input[type="number"]:focus {
74
  }
75
  /* Datepicker */
76
  }
77
  /* Submit Button */
78
  .yikes-easy-mc-form .yikes-easy-mc-submit-button {
79
  }
80
  /* Form Description */
81
  .yikes-easy-mc-form .form-field-description {
82
  /* Labels & Descriptions */
83
  .yikes-easy-mc-form label,
84
  .yikes-easy-mc-form .field-no-label {
85
  }
86
  /* Interest Group Required Error Notice */
87
  p.yikes-mailchimp-required-interest-group-error {
88
  }
89
  /* No Label Descriptions */
90
  .yikes-easy-mc-form select,
91
  .yikes-easy-mc-form input[type="number"],
92
  .yikes-easy-mc-form input[type="text"],
93
  .yikes-easy-mc-form input[type="email"],
94
  .yikes-easy-mc-form input[type="url"],
95
  .yikes-easy-mc-form input[type="password"],
96
  .yikes-easy-mc-form textarea {
97
  }
98
  /** Radio Form Buttons **/
99
  .checkbox-parent-label {
100
  }
101
  .yikes-easy-mc-form .yikes-easy-mc-checkbox-label {
102
  }
103
  .yikes-easy-mc-display-none,
104
  .mailchimp-field-hidden {
105
  }
106
  .yikes-easy-mc-text-align-right {
107
  }
108
  /******************************************/
109
  /* Front End Pre-defined Classes */
110
  /******************************************/
 
1
  * All of the CSS for your public-facing functionality should be
2
  * included in this file.
3
  */
4
  .yikes-easy-mc-form {
5
  }
6
  /* Input heights */
7
  .yikes-easy-mc-form select,
8
  .yikes-easy-mc-form input[type="text"],
9
  .yikes-easy-mc-form input[type="url"],
10
  .yikes-easy-mc-form input[type="email"],
11
  .yikes-easy-mc-form input[type="number"] {
12
  }
13
  .yikes-easy-mc-form select:focus,
14
  .yikes-easy-mc-form input[type="text"]:focus,
15
  .yikes-easy-mc-form input[type="url"]:focus,
16
  .yikes-easy-mc-form input[type="email"]:focus,
17
  .yikes-easy-mc-form input[type="number"]:focus {
18
  }
19
  /* Datepicker */
20
  }
21
  /* Submit Button */
22
  .yikes-easy-mc-form .yikes-easy-mc-submit-button {
23
  }
24
  /* Form Description */
25
  .yikes-easy-mc-form .form-field-description {
26
  /* Labels & Descriptions */
27
  .yikes-easy-mc-form label,
28
  .yikes-easy-mc-form .field-no-label {
29
  }
30
  /* Interest Group Required Error Notice */
31
  p.yikes-mailchimp-required-interest-group-error {
32
  }
33
  /* No Label Descriptions */
34
  .yikes-easy-mc-form select,
35
  .yikes-easy-mc-form input[type="number"],
36
  .yikes-easy-mc-form input[type="text"],
37
  .yikes-easy-mc-form input[type="email"],
38
  .yikes-easy-mc-form input[type="url"],
39
  .yikes-easy-mc-form input[type="password"],
40
  .yikes-easy-mc-form textarea {
41
  }
42
  /** Radio Form Buttons **/
43
  .checkbox-parent-label {
44
  }
45
  .yikes-easy-mc-form .yikes-easy-mc-checkbox-label {
46
  }
47
  .yikes-easy-mc-display-none,
48
  .mailchimp-field-hidden {
49
  }
50
  .yikes-easy-mc-text-align-right {
51
  }
52
  /******************************************/
53
  /* Front End Pre-defined Classes */
54
  /******************************************/
55
+ /**
56
  * All of the CSS for your public-facing functionality should be
57
  * included in this file.
58
  */
59
  .yikes-easy-mc-form {
60
  }
61
  /* Input heights */
62
  .yikes-easy-mc-form select,
63
  .yikes-easy-mc-form input[type="text"],
64
  .yikes-easy-mc-form input[type="url"],
65
  .yikes-easy-mc-form input[type="email"],
66
  .yikes-easy-mc-form input[type="number"] {
67
  }
68
  .yikes-easy-mc-form select:focus,
69
  .yikes-easy-mc-form input[type="text"]:focus,
70
  .yikes-easy-mc-form input[type="url"]:focus,
71
  .yikes-easy-mc-form input[type="email"]:focus,
72
  .yikes-easy-mc-form input[type="number"]:focus {
73
  }
74
  /* Datepicker */
75
  }
76
  /* Submit Button */
77
  .yikes-easy-mc-form .yikes-easy-mc-submit-button {
78
  }
79
  /* Form Description */
80
  .yikes-easy-mc-form .form-field-description {
81
  /* Labels & Descriptions */
82
  .yikes-easy-mc-form label,
83
  .yikes-easy-mc-form .field-no-label {
84
  }
85
  /* Interest Group Required Error Notice */
86
  p.yikes-mailchimp-required-interest-group-error {
87
  }
88
  /* No Label Descriptions */
89
  .yikes-easy-mc-form select,
90
  .yikes-easy-mc-form input[type="number"],
91
  .yikes-easy-mc-form input[type="text"],
92
  .yikes-easy-mc-form input[type="email"],
93
  .yikes-easy-mc-form input[type="url"],
94
  .yikes-easy-mc-form input[type="password"],
95
  .yikes-easy-mc-form textarea {
96
  }
97
  /** Radio Form Buttons **/
98
  .checkbox-parent-label {
99
  }
100
  .yikes-easy-mc-form .yikes-easy-mc-checkbox-label {
101
  }
102
  .yikes-easy-mc-display-none,
103
  .mailchimp-field-hidden {
104
  }
105
  .yikes-easy-mc-text-align-right {
106
  }
107
  /******************************************/
108
  /* Front End Pre-defined Classes */
109
  /******************************************/
public/css/yikes-inc-easy-mailchimp-extender-public.min.css CHANGED
@@ -1,2 +1 @@
1
- .yikes-easy-mc-form{display:block;width:100%}.yikes-easy-mailchimp-edit-form-link{display:block;margin-bottom:1em}.yikes-easy-mc-form.yikes-mailchimp-form-inline{display:inline-block;width:100%}.yikes-easy-mc-form input[type=text],.yikes-easy-mc-form input[type=url],.yikes-easy-mc-form input[type=email],.yikes-easy-mc-form input[type=number],.yikes-easy-mc-form select{padding:.5278em;background-color:#F1F1F1;border:2px solid rgba(51,51,51,.1);-moz-box-sizing:border-box;margin-bottom:8px}.yikes-easy-mc-form input[type=text]:focus,.yikes-easy-mc-form input[type=url]:focus,.yikes-easy-mc-form input[type=email]:focus,.yikes-easy-mc-form input[type=number]:focus,.yikes-easy-mc-form select:focus{outline:rgba(51,51,51,.3) solid 2px}.datepicker.datepicker-dropdown.dropdown-menu.datepicker-orient-left.datepicker-orient-top{min-width:258px}.yikes-easy-mc-form .yikes-easy-mc-submit-button{display:block;width:100%;margin-top:.5em;min-height:40px;padding:10px;cursor:pointer}.yikes-easy-mc-form .yikes-easy-mc-submit-button.admin-logged-in{margin-bottom:1em}.yikes-easy-mc-form .empty-form-inline-label .empty-label.labels-hidden{display:none}.yikes-easy-mc-form .submit-button-inline-label{width:20%;min-width:90px;float:left}.yikes-easy-mc-form .submit-button-inline-label .yikes-easy-mc-submit-button{margin-top:0;margin-bottom:.5em}.yikes-easy-mc-form .form-field-description{display:block;margin-top:-.25em;margin-bottom:.75em;font-style:italic}.yikes-easy-mc-form label>.form-field-description{display:block;margin-bottom:5px;font-style:italic}.yikes-easy-mc-error-message{color:rgba(216,48,57,.87);background:#FFBABA;padding:12px;position:relative}.yikes-easy-mc-success-message{color:#4F8A10;background:#DFF2BF;padding:12px;position:relative}.yikes-easy-mc-form .field-no-label,.yikes-easy-mc-form label{display:inline-block;margin-bottom:.5em;width:100%}p.yikes-mailchimp-required-interest-group-error{color:rgba(216,48,57,.87);margin:8px 0}.yikes-easy-mc-form input[type=text],.yikes-easy-mc-form input[type=url],.yikes-easy-mc-form input[type=email],.yikes-easy-mc-form input[type=number],.yikes-easy-mc-form input[type=password],.yikes-easy-mc-form select,.yikes-easy-mc-form textarea{box-sizing:border-box;display:block;width:100%;max-width:100%}.yikes-easy-mc-form .yikes-easy-mc-submit-button-image{padding:0;width:16%;min-width:140px;max-width:200px}.yikes-easy-mc-form .submit-button-inline-label .yikes-easy-mc-submit-button-image{width:100%;max-width:100%}.checkbox-parent-label{width:100%;display:block}.yikes-easy-mc-form .yikes-easy-mc-checkbox-label{display:inline-block}.mailchimp-field-hidden,.yikes-easy-mc-display-none{display:none!important}.yikes-easy-mc-text-align-right{text-align:right}#yikes-mailchimp-container .yikes-form-title{margin-top:0}.yikes-mailchimp-disclaimer-text{display:block;margin-top:1em}.update-email-preloader,.yikes-mailchimp-preloader{position:absolute;top:40%;left:0;right:0;bottom:0;margin:0 auto}.g-recaptcha{transform:scale(.81);-webkit-transform:scale(.81);transform-origin:0 0;-webkit-transform-origin:0 0;margin:7px 0 -3px}@media screen and (max-height:575px){#rc-imageselect,.g-recaptcha{transform:scale(.81);-webkit-transform:scale(.81);transform-origin:0 0;-webkit-transform-origin:0 0}}.yikes-easy-mc-form label.option-inline>label{display:inline-block;float:left;width:auto!important;margin-right:15px}.yikes-easy-mc-form label.option-height-25{height:25px}.yikes-easy-mc-form label.option-height-50{height:50px}.yikes-easy-mc-form label.option-height-75{height:75px}.yikes-easy-mc-form label.option-height-100{height:100px}.yikes-easy-mc-form label.option-height-125{height:125px}.yikes-easy-mc-form label.option-height-150{height:150px}.yikes-easy-mc-form label.option-2-col>label{display:inline-block;float:left;width:50%}.yikes-easy-mc-form label.option-3-col>label{display:inline-block;float:left;width:33%}.yikes-easy-mc-form label.option-4-col>label{display:inline-block;float:left;width:25%}.yikes-easy-mc-form input.field-left-half,.yikes-easy-mc-form label.field-left-half{width:48%;float:left;margin-right:2%}.yikes-easy-mc-form input.field-right-half,.yikes-easy-mc-form label.field-right-half{width:48%;float:right;margin-left:2%}.yikes-easy-mc-form input.field-third,.yikes-easy-mc-form label.field-third{width:32%;float:left;margin-right:1.33333%}@media only screen and (max-width:525px){.yikes-easy-mc-form input.field-left-half,.yikes-easy-mc-form input.field-right-half,.yikes-easy-mc-form label.field-left-half,.yikes-easy-mc-form label.field-right-half{width:100%}}@media only screen and (max-width:955px){.yikes-easy-mc-form input.field-third:nth-child(odd),.yikes-easy-mc-form label.field-third:nth-child(odd){width:48%;float:left;margin-right:2%}.yikes-easy-mc-form input.field-third:nth-child(even),.yikes-easy-mc-form label.field-third:nth-child(even){width:48%;float:right;margin-left:0}}@media only screen and (max-width:525px){.yikes-easy-mc-form input.field-third,.yikes-easy-mc-form label.field-third{width:100%!important;margin-right:0;margin-left:0;float:none}.datepicker.datepicker-dropdown.dropdown-menu.datepicker-orient-left.datepicker-orient-top{min-width:84%}}
2
- /*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInlpa2VzLWluYy1lYXN5LW1haWxjaGltcC1leHRlbmRlci1wdWJsaWMubWluLmNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxvQkFBb0IsY0FBYyxVQUFVLENBQUMscUNBQXFDLGNBQWMsaUJBQWlCLENBQUMsZ0RBQWdELHFCQUFxQixVQUFVLENBQUMsaUxBQWlMLGdCQUFnQix5QkFBeUIsbUNBQW1DLDJCQUEyQixpQkFBaUIsQ0FBQywrTUFBK00sbUNBQW1DLENBQUMsMkZBQTJGLGVBQWUsQ0FBQyxpREFBaUQsY0FBYyxXQUFXLGdCQUFnQixnQkFBZ0IsYUFBYSxjQUFjLENBQUMsaUVBQWlFLGlCQUFpQixDQUFDLHdFQUF3RSxZQUFZLENBQUMsZ0RBQWdELFVBQVUsZUFBZSxVQUFVLENBQUMsNkVBQTZFLGFBQWEsa0JBQWtCLENBQUMsNENBQTRDLGNBQWMsa0JBQWtCLG9CQUFvQixpQkFBaUIsQ0FBQyxrREFBa0QsY0FBYyxrQkFBa0IsaUJBQWlCLENBQUMsNkJBQTZCLDBCQUEwQixtQkFBbUIsYUF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BzY3JlZW4gYW5kIChtYXgtd2lkdGg6OTU1cHgpey55aWtlcy1lYXN5LW1jLWZvcm0gaW5wdXQuZmllbGQtdGhpcmQ6bnRoLWNoaWxkKG9kZCksLnlpa2VzLWVhc3ktbWMtZm9ybSBsYWJlbC5maWVsZC10aGlyZDpudGgtY2hpbGQob2RkKXt3aWR0aDo0OCU7ZmxvYXQ6bGVmdDttYXJnaW4tcmlnaHQ6MiV9Lnlpa2VzLWVhc3ktbWMtZm9ybSBpbnB1dC5maWVsZC10aGlyZDpudGgtY2hpbGQoZXZlbiksLnlpa2VzLWVhc3ktbWMtZm9ybSBsYWJlbC5maWVsZC10aGlyZDpudGgtY2hpbGQoZXZlbil7d2lkdGg6NDglO2Zsb2F0OnJpZ2h0O21hcmdpbi1sZWZ0OjB9fUBtZWRpYSBvbmx5IHNjcmVlbiBhbmQgKG1heC13aWR0aDo1MjVweCl7Lnlpa2VzLWVhc3ktbWMtZm9ybSBpbnB1dC5maWVsZC10aGlyZCwueWlrZXMtZWFzeS1tYy1mb3JtIGxhYmVsLmZpZWxkLXRoaXJke3dpZHRoOjEwMCUhaW1wb3J0YW50O21hcmdpbi1yaWdodDowO21hcmdpbi1sZWZ0OjA7ZmxvYXQ6bm9uZX0uZGF0ZXBpY2tlci5kYXRlcGlja2VyLWRyb3Bkb3duLmRyb3Bkb3duLW1lbnUuZGF0ZXBpY2tlci1vcmllbnQtbGVmdC5kYXRlcGlja2VyLW9yaWVudC10b3B7bWluLXdpZHRoOjg0JX19Il19 */
1
+ .yikes-easy-mc-form{display:block;width:100%}.yikes-easy-mailchimp-edit-form-link{display:block;margin-bottom:1em}.yikes-easy-mc-form.yikes-mailchimp-form-inline{display:inline-block;width:100%}.yikes-easy-mc-form input[type=text],.yikes-easy-mc-form input[type=url],.yikes-easy-mc-form input[type=email],.yikes-easy-mc-form input[type=number],.yikes-easy-mc-form select{padding:.5278em;background-color:#F1F1F1;border:2px solid rgba(51,51,51,.1);-moz-box-sizing:border-box;margin-bottom:8px}.yikes-easy-mc-form input[type=text]:focus,.yikes-easy-mc-form input[type=url]:focus,.yikes-easy-mc-form input[type=email]:focus,.yikes-easy-mc-form input[type=number]:focus,.yikes-easy-mc-form select:focus{outline:rgba(51,51,51,.3) solid 2px}.datepicker.datepicker-dropdown.dropdown-menu.datepicker-orient-left.datepicker-orient-top{min-width:258px}.yikes-easy-mc-form .yikes-easy-mc-submit-button{display:block;width:100%;margin-top:.5em;min-height:40px;padding:10px;cursor:pointer}.yikes-easy-mc-form .yikes-easy-mc-submit-button.admin-logged-in{margin-bottom:1em}.yikes-easy-mc-form .empty-form-inline-label .empty-label.labels-hidden{display:none}.yikes-easy-mc-form .submit-button-inline-label{width:20%;min-width:90px;float:left}.yikes-easy-mc-form .submit-button-inline-label .yikes-easy-mc-submit-button{margin-top:0;margin-bottom:.5em}.yikes-easy-mc-form .form-field-description{display:block;margin-top:-.25em;margin-bottom:.75em;font-style:italic}.yikes-easy-mc-form label>.form-field-description{display:block;margin-bottom:5px;font-style:italic}.yikes-easy-mc-error-message{color:rgba(216,48,57,.87);background:#FFBABA;padding:12px;position:relative}.yikes-easy-mc-success-message{color:#4F8A10;background:#DFF2BF;padding:12px;position:relative}.yikes-easy-mc-form .field-no-label,.yikes-easy-mc-form label{display:inline-block;margin-bottom:.5em;width:100%}p.yikes-mailchimp-required-interest-group-error{color:rgba(216,48,57,.87);margin:8px 0}.yikes-easy-mc-form input[type=text],.yikes-easy-mc-form input[type=url],.yikes-easy-mc-form input[type=email],.yikes-easy-mc-form input[type=number],.yikes-easy-mc-form input[type=password],.yikes-easy-mc-form select,.yikes-easy-mc-form textarea{box-sizing:border-box;display:block;width:100%;max-width:100%}.yikes-easy-mc-form .yikes-easy-mc-submit-button-image{padding:0;width:16%;min-width:140px;max-width:200px}.yikes-easy-mc-form .submit-button-inline-label .yikes-easy-mc-submit-button-image{width:100%;max-width:100%}.checkbox-parent-label{width:100%;display:block}.yikes-easy-mc-form .yikes-easy-mc-checkbox-label{display:inline-block}.mailchimp-field-hidden,.yikes-easy-mc-display-none{display:none!important}.yikes-easy-mc-text-align-right{text-align:right}#yikes-mailchimp-container .yikes-form-title{margin-top:0}.yikes-mailchimp-disclaimer-text{display:block;margin-top:1em}.update-email-preloader,.yikes-mailchimp-preloader{position:absolute;top:40%;left:0;right:0;bottom:0;margin:0 auto}.g-recaptcha{transform:scale(.81);-webkit-transform:scale(.81);transform-origin:0 0;-webkit-transform-origin:0 0;margin:7px 0 -3px}.yikes-mc-required-field-not-filled{background-color:#FFBABA!important}@media screen and (max-height:575px){#rc-imageselect,.g-recaptcha{transform:scale(.81);-webkit-transform:scale(.81);transform-origin:0 0;-webkit-transform-origin:0 0}}.yikes-easy-mc-form label.option-inline>label{display:inline-block;float:left;width:auto!important;margin-right:15px}.yikes-easy-mc-form label.option-height-25{height:25px}.yikes-easy-mc-form label.option-height-50{height:50px}.yikes-easy-mc-form label.option-height-75{height:75px}.yikes-easy-mc-form label.option-height-100{height:100px}.yikes-easy-mc-form label.option-height-125{height:125px}.yikes-easy-mc-form label.option-height-150{height:150px}.yikes-easy-mc-form label.option-2-col>label{display:inline-block;float:left;width:50%}.yikes-easy-mc-form label.option-3-col>label{display:inline-block;float:left;width:33%}.yikes-easy-mc-form label.option-4-col>label{display:inline-block;float:left;width:25%}.yikes-easy-mc-form input.field-left-half,.yikes-easy-mc-form label.field-left-half{width:48%;float:left;margin-right:2%}.yikes-easy-mc-form input.field-right-half,.yikes-easy-mc-form label.field-right-half{width:48%;float:right;margin-left:2%}.yikes-easy-mc-form input.field-third,.yikes-easy-mc-form label.field-third{width:32%;float:left;margin-right:1.33333%}@media only screen and (max-width:525px){.yikes-easy-mc-form input.field-left-half,.yikes-easy-mc-form input.field-right-half,.yikes-easy-mc-form label.field-left-half,.yikes-easy-mc-form label.field-right-half{width:100%}}@media only screen and (max-width:955px){.yikes-easy-mc-form input.field-third:nth-child(odd),.yikes-easy-mc-form label.field-third:nth-child(odd){width:48%;float:left;margin-right:2%}.yikes-easy-mc-form input.field-third:nth-child(even),.yikes-easy-mc-form label.field-third:nth-child(even){width:48%;float:right;margin-left:0}}@media only screen and (max-width:525px){.yikes-easy-mc-form input.field-third,.yikes-easy-mc-form label.field-third{width:100%!important;margin-right:0;margin-left:0;float:none}.datepicker.datepicker-dropdown.dropdown-menu.datepicker-orient-left.datepicker-orient-top{min-width:84%}}
 
public/js/yikes-mc-ajax-forms.js CHANGED
@@ -1 +1,226 @@
1
- window.Yikes_Mailchimp_Ajax = window.Yikes_Mailchimp_Ajax || {};
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ window.Yikes_Mailchimp_Ajax = window.Yikes_Mailchimp_Ajax || {};
2
+
3
+ (function( window, document, $, app, undefined ) {
4
+ 'use strict';
5
+
6
+ app.l10n = window.yikes_mailchimp_ajax || {};
7
+
8
+ $( document ).ready( function() {
9
+ var body = $( 'body' );
10
+
11
+ /* On Submission, run our ajax shtuff */
12
+ body.on( 'submit' , '.yikes-easy-mc-form' , function() {
13
+
14
+ // Store which form was submitted
15
+ var submitted_form = $( this );
16
+
17
+ // Add a class to the form while it's submitted (as of 6.3.0)
18
+ submitted_form.addClass( 'yikes-mc-submitted-form-loading' );
19
+
20
+ // Fade down the form
21
+ submitted_form.find( 'input, label, button' ).not( ':hidden' ).fadeTo( 'fast', .5 );
22
+
23
+ // Append our preloader
24
+ submitted_form.append( '<img src="' + app.l10n.preloader_url + '" class="yikes-mailchimp-preloader" />')
25
+
26
+ // Remove the missing required fields class
27
+ $( '.yikes-mc-required-field-not-filled' ).removeClass( 'yikes-mc-required-field-not-filled' );
28
+
29
+ // As of 6.3.0 we just hide the button text instead of removing it, so hide:
30
+ $( '.yikes-mailchimp-submit-button-span-text' ).hide();
31
+
32
+ // And then append the loading dots gif
33
+ submitted_form.find( '.yikes-easy-mc-submit-button' ).append( '<img src="' + app.l10n.loading_dots + '" class="loading-dots yikes-mc-loading-dots" />' );
34
+
35
+ // Get the form id
36
+ var form_id = submitted_form.attr( 'data-attr-form-id' );
37
+
38
+ /* Checkbox Interest Group Error */
39
+ var required_fields_left_blank = [];
40
+
41
+ /* Check for any required interest groups */
42
+ if( submitted_form.find( '.yikes-interest-group-required' ).length > 0 ) {
43
+ /* loop and make sure that it's checked */
44
+ submitted_form.find( '.yikes-interest-group-required' ).each( function() {
45
+ var id = jQuery( this ).attr( 'name' );
46
+ var interest_group_id = id.replace( '[]', '' );
47
+ if( submitted_form.find( 'input[name="'+interest_group_id+'[]"]:checked' ).length == 0 ) {
48
+ required_fields_left_blank[interest_group_id] = submitted_form.find( 'span.' + interest_group_id + '-label' ).text();
49
+ }
50
+ });
51
+ }
52
+
53
+ /* Loop, display the errors and prevent form submission from occuring */
54
+ if ( required_fields_left_blank.length > 0 ) {
55
+ /* Remove any visible checkbox group errors */
56
+ if( submitted_form.find( '.yikes-mailchimp-required-interest-group-error' ).length > 0 ) {
57
+ submitted_form.find( '.yikes-mailchimp-required-interest-group-error' ).fadeOut( 'fast', function() {
58
+ submitted_form.find( '.yikes-mailchimp-required-interest-group-error' ).remove();
59
+ for ( var field_id in required_fields_left_blank ) {
60
+ submitted_form.find( 'span.'+field_id+'-label' ).after( '<p class="yikes-mailchimp-required-interest-group-error">'+app.l10n.interest_group_checkbox_error+'</p>' );
61
+ }
62
+ });
63
+ } else {
64
+ for ( var field_id in required_fields_left_blank ) {
65
+ submitted_form.find( 'span.'+field_id+'-label' ).after( '<p class="yikes-mailchimp-required-interest-group-error">'+app.l10n.interest_group_checkbox_error+'</p>' );
66
+ }
67
+ }
68
+
69
+ submitted_form.find( '.yikes-easy-mc-submit-button' ).removeAttr( 'disabled', 'disabled' );
70
+ submitted_form.find( 'input, label, button' ).not( ':hidden' ).fadeTo( 'fast', 1 );
71
+ submitted_form.find( '.yikes-mailchimp-preloader' ).remove();
72
+
73
+ //submitted_form.find( '.yikes-easy-mc-submit-button' ).html( '' ).html( original_submit_button_text );
74
+
75
+ // As of 6.3.0 we just show/hide the button text instead of removing it, so:
76
+ // Remove loading dots && show button text
77
+ $( '.yikes-mc-loading-dots' ).remove();
78
+ $( '.yikes-mailchimp-submit-button-span-text' ).show();
79
+
80
+ // As of 6.3.0 we add a class to the form, so remove it if we're here
81
+ submitted_form.removeClass( 'yikes-mc-submitted-form-loading' );
82
+
83
+ return false;
84
+ }
85
+
86
+ /* disable the button to prevent double click */
87
+ submitted_form.find( '.yikes-easy-mc-submit-button' ).attr( 'disabled' , 'disabled' );
88
+
89
+ /* hide our previously displayed success and error messages */
90
+ $( '.yikes-easy-mc-error-message' ).remove();
91
+ $( '.yikes-easy-mc-success-message' ).remove();
92
+
93
+ /* build our data */
94
+ var data = {
95
+ 'action' : 'process_form_submission',
96
+ 'form_data' : submitted_form.serialize(),
97
+ 'form_id' : form_id,
98
+ 'page_data' : app.l10n.page_data,
99
+ 'ajax_security_nonce' : app.l10n.ajax_security_nonce
100
+ };
101
+
102
+ /* submit our ajax request */
103
+ $.ajax({
104
+ url: app.l10n.ajax_url,
105
+ type: 'POST',
106
+ data: data,
107
+ success : function( response, textStatus, jqXHR) {
108
+
109
+ submitted_form.find( 'input, label, button' ).not( ':hidden' ).fadeTo( 'fast', 1 );
110
+ submitted_form.find( '.yikes-mailchimp-preloader' ).remove();
111
+
112
+ // As of 6.3.0 we just show/hide the button text instead of removing it, so:
113
+ // Remove loading dots && show button text
114
+ $( '.yikes-mc-loading-dots' ).remove();
115
+ $( '.yikes-mailchimp-submit-button-span-text' ).show();
116
+
117
+ // As of 6.3.0 we add a class to the form, so remove it if we're here
118
+ submitted_form.removeClass( 'yikes-mc-submitted-form-loading' );
119
+
120
+ /* Success */
121
+ if( response.success ) {
122
+ response = response.data;
123
+ if( response.hide == 1 ) {
124
+ /* hide the description if visible */
125
+ if( $( '.yikes-easy-mc-form-description-'+form_id ).length > 0 ) {
126
+ $( '.yikes-easy-mc-form-description-'+form_id ).hide();
127
+ }
128
+ /* hide the form */
129
+ submitted_form.hide();
130
+ }
131
+ if( $( '.yikes-easy-mc-form-description-'+form_id ).length > 0 ) {
132
+ $( '.yikes-easy-mc-form-description-'+form_id ).before( '<p class="yikes-easy-mc-success-message yikes-easy-mc-success-message-'+form_id+' yikes-easy-mc-hidden">'+response.response+'</p>' );
133
+ } else {
134
+ submitted_form.before( '<p class="yikes-easy-mc-success-message yikes-easy-mc-success-message-'+form_id+' yikes-easy-mc-hidden">'+response.response+'</p>' );
135
+ }
136
+ /* fade in our success message */
137
+ $( '.yikes-easy-mc-success-message-'+form_id ).fadeIn();
138
+ $( '.yikes-mailchimp-required-interest-group-error' ).remove();
139
+
140
+ /* redirect if setup */
141
+ if( response.redirection == 1 ) {
142
+ submitted_form.before( response.redirect );
143
+ }
144
+ /* clear the inputs - but don't clear submit button, radio, select, list_id, or form */
145
+ submitted_form.find( 'input' ).not( '.yikes-easy-mc-submit-button, input[type="radio"], input[type="select"], input[type="checkbox"], #yikes-mailchimp-associated-list-id, #yikes-mailchimp-submitted-form' ).val( '' );
146
+ /* ajax to increase submission count by 1 */
147
+ var new_data = {
148
+ 'action' : 'increase_submission_count',
149
+ 'form_id' : form_id
150
+ };
151
+ $.ajax({
152
+ url: app.l10n.ajax_url,
153
+ type: 'POST',
154
+ data: new_data,
155
+ success : function( response, textStatus, jqXHR) {
156
+ /* console.log( 'submission count increased by 1' ); */
157
+ },
158
+ error : function( jqXHR, textStatus, errorThrown ) {
159
+ /* display the error back to the user in the console */
160
+ console.error( errorThrown );
161
+ }
162
+ });
163
+ /* console.log( 'Successfully submit subscriber data to MailChimp.' ); */
164
+ } else {
165
+ response = response.data;
166
+ if( $( '.yikes-easy-mc-form-description-' + form_id ).length > 0 ) {
167
+ $( '.yikes-easy-mc-form-description-' + form_id ).before( '<p class="yikes-easy-mc-error-message yikes-easy-mc-error-message-' + form_id + '" yikes-easy-mc-hidden"> ' + response.response + '</p>' );
168
+ } else {
169
+ var response_message = ( typeof( response ) !== 'undefined' && typeof( response.response ) !== 'undefined' ) ? response.response : 'Error collecting the API response.'
170
+ submitted_form.before( '<p class="yikes-easy-mc-error-message yikes-easy-mc-error-message-' + form_id + ' yikes-easy-mc-hidden">' + response_message + '</p>' );
171
+ }
172
+
173
+ // Check if we found a required field that's missing (server side check)
174
+ if ( typeof( response ) !== 'undefined' && typeof( response.missing_required_field ) !== 'undefined' && response.missing_required_field === true ) {
175
+ if ( typeof ( response.missing_required_field_data ) !== 'undefined' ) {
176
+
177
+ // Capture the field data and highlight the field
178
+ var field_data = response.missing_required_field_data;
179
+ var is_interest_group = ( typeof( response.is_interest_group ) !== 'undefined' ) ? response.is_interest_group : false;
180
+ highlight_missing_required_fields( field_data, is_interest_group );
181
+ }
182
+ }
183
+
184
+ // Fade in the error message
185
+ $( '.yikes-easy-mc-error-message' ).fadeIn();
186
+ }
187
+ },
188
+ error : function( jqXHR, textStatus, errorThrown ) { /* someother error is happening, and should be investigated... */
189
+ /* alert( errorThrown ); */
190
+ console.error( errorThrown );
191
+ console.log( jqXHR );
192
+ console.log( textStatus );
193
+ },
194
+ complete : function( jqXHR, textStatus ) {
195
+ /* console.log( 'Yikes Easy MailChimp AJAX submission complete.' ); */
196
+ /* enable the button to prevent double click */
197
+ submitted_form.find( '.yikes-easy-mc-submit-button' ).removeAttr( 'disabled' , 'disabled' );
198
+ }
199
+ });
200
+ /* prevent default form action */
201
+ return false;
202
+ });
203
+
204
+ });
205
+
206
+ function highlight_missing_required_fields( field_data, is_interest_group ) {
207
+ if ( typeof ( field_data ) !== 'undefined' ) {
208
+
209
+ $.each( field_data, function( merge_label, field ) {
210
+ if ( is_interest_group === true ) {
211
+
212
+ // We might be hiding labels, so for interest groups we need to check if the label.span (label text) exists
213
+ if ( $( 'span.' + merge_label + '-label' ).length > 0 ) {
214
+ $( 'span.' + merge_label + '-label' ).addClass( 'yikes-mc-required-field-not-filled' );
215
+ } else {
216
+ // If it doesn't exist, then try to add it to the label (the label wraps the whole input/select/radio field)
217
+ $( '.' + merge_label + '-label' ).addClass( 'yikes-mc-required-field-not-filled' );
218
+ }
219
+ } else {
220
+ $( 'label[for="' + merge_label + '"]' ).children( 'input').addClass( 'yikes-mc-required-field-not-filled' );
221
+ }
222
+ });
223
+ }
224
+ }
225
+
226
+ })( window, document, jQuery, Yikes_Mailchimp_Ajax );
public/js/yikes-mc-ajax-forms.min.js CHANGED
@@ -1 +1 @@
1
- window.Yikes_Mailchimp_Ajax=window.Yikes_Mailchimp_Ajax||{},function(a,b,c,d,e){"use strict";d.l10n=a.yikes_mailchimp_ajax||{},c(b).ready(function(){c("body").on("submit",".yikes-easy-mc-form",function(){var a=c(this);a.find("input, label, button").not(":hidden").fadeTo("fast",.5),a.append('<img src="'+d.l10n.preloader_url+'" class="yikes-mailchimp-preloader" />');var b=a.find(".yikes-easy-mc-submit-button").text();a.find(".yikes-easy-mc-submit-button").text("").html('<img src="'+d.l10n.loading_dots+'" class="loading-dots" />');var e=a.attr("data-attr-form-id"),f=[];if(a.find(".yikes-interest-group-required").length>0&&a.find(".yikes-interest-group-required").each(function(){var b=jQuery(this).attr("name"),c=b.replace("[]","");if(0==a.find('input[name="'+c+'[]"]:checked').length){var d=a.find("span."+c+"-label").text();f[c]=d}}),!jQuery.isEmptyObject(f)){if(a.find(".yikes-mailchimp-required-interest-group-error").length>0)a.find(".yikes-mailchimp-required-interest-group-error").fadeOut("fast",function(){a.find(".yikes-mailchimp-required-interest-group-error").remove();for(var b in f)a.find("span."+b+"-label").after('<p class="yikes-mailchimp-required-interest-group-error">'+d.l10n.interest_group_checkbox_error+"</p>")});else for(var g in f)a.find("span."+g+"-label").after('<p class="yikes-mailchimp-required-interest-group-error">'+d.l10n.interest_group_checkbox_error+"</p>");return!1}a.find(".yikes-easy-mc-submit-button").attr("disabled","disabled"),c(".yikes-easy-mc-error-message").remove(),c(".yikes-easy-mc-success-message").remove();var h={action:"process_form_submission",form_data:a.serialize(),form_id:e,page_data:d.l10n.page_data};return c.ajax({url:d.l10n.ajax_url,type:"POST",data:h,success:function(f,g,h){if(a.find("input, label, button").not(":hidden").fadeTo("fast",1),a.find(".yikes-mailchimp-preloader").remove(),a.find(".yikes-easy-mc-submit-button").html("").text(b),f.success){f=f.data,1==f.hide&&(c(".yikes-easy-mc-form-description-"+e).length>0&&c(".yikes-easy-mc-form-description-"+e).hide(),a.hide()),c(".yikes-easy-mc-form-description-"+e).length>0?c(".yikes-easy-mc-form-description-"+e).before('<p class="yikes-easy-mc-success-message yikes-easy-mc-success-message-'+e+' yikes-easy-mc-hidden">'+f.response+"</p>"):a.before('<p class="yikes-easy-mc-success-message yikes-easy-mc-success-message-'+e+' yikes-easy-mc-hidden">'+f.response+"</p>"),c(".yikes-easy-mc-success-message-"+e).fadeIn(),c(".yikes-mailchimp-required-interest-group-error").remove(),1==f.redirection&&a.before(f.redirect),a.find("input").not(".yikes-easy-mc-submit-button").val("");var i={action:"increase_submission_count",form_id:e};c.ajax({url:d.l10n.ajax_url,type:"POST",data:i,success:function(a,b,c){},error:function(a,b,c){console.error(c)}})}else f=f.data,c(".yikes-easy-mc-form-description-"+e).length>0?c(".yikes-easy-mc-form-description-"+e).before('<p class="yikes-easy-mc-error-message yikes-easy-mc-error-message-'+e+'" yikes-easy-mc-hidden"> '+f.response+"</p>"):a.before('<p class="yikes-easy-mc-error-message yikes-easy-mc-error-message-'+e+' yikes-easy-mc-hidden">'+f.response+"</p>"),c(".yikes-easy-mc-error-message").fadeIn()},error:function(a,b,c){console.error(c),console.log(a),console.log(b)},complete:function(b,c){a.find(".yikes-easy-mc-submit-button").removeAttr("disabled","disabled")}}),!1}),c("body").on("click",".send-update-email",function(){var a={action:"easy_forms_send_email",user_email:jQuery(this).attr("data-user-email"),list_id:jQuery(this).attr("data-list-id")};return jQuery(this).parent("p").fadeTo("fast",.75).append('<img src="'+d.l10n.preloader_url+'" class="update-email-preloader" />'),jQuery.post(d.l10n.ajax_url,a,function(a){a.success?jQuery(".yikes-easy-mc-error-message").removeClass("yikes-easy-mc-error-message").addClass("yikes-easy-mc-success-message").html(a.data.response_text):jQuery(".yikes-easy-mc-error-message").fadeTo("fast",1).html(a.data.response_text)}),!1})})}(window,document,jQuery,Yikes_Mailchimp_Ajax);
1
+ window.Yikes_Mailchimp_Ajax=window.Yikes_Mailchimp_Ajax||{},function(a,b,c,d,e){"use strict";function f(a,b){"undefined"!=typeof a&&c.each(a,function(a,d){b===!0?c("span."+a+"-label").length>0?c("span."+a+"-label").addClass("yikes-mc-required-field-not-filled"):c("."+a+"-label").addClass("yikes-mc-required-field-not-filled"):c('label[for="'+a+'"]').children("input").addClass("yikes-mc-required-field-not-filled")})}d.l10n=a.yikes_mailchimp_ajax||{},c(b).ready(function(){var a=c("body");a.on("submit",".yikes-easy-mc-form",function(){var a=c(this);a.addClass("yikes-mc-submitted-form-loading"),a.find("input, label, button").not(":hidden").fadeTo("fast",.5),a.append('<img src="'+d.l10n.preloader_url+'" class="yikes-mailchimp-preloader" />'),c(".yikes-mc-required-field-not-filled").removeClass("yikes-mc-required-field-not-filled"),c(".yikes-mailchimp-submit-button-span-text").hide(),a.find(".yikes-easy-mc-submit-button").append('<img src="'+d.l10n.loading_dots+'" class="loading-dots yikes-mc-loading-dots" />');var b=a.attr("data-attr-form-id"),e=[];if(a.find(".yikes-interest-group-required").length>0&&a.find(".yikes-interest-group-required").each(function(){var b=jQuery(this).attr("name"),c=b.replace("[]","");0==a.find('input[name="'+c+'[]"]:checked').length&&(e[c]=a.find("span."+c+"-label").text())}),e.length>0){if(a.find(".yikes-mailchimp-required-interest-group-error").length>0)a.find(".yikes-mailchimp-required-interest-group-error").fadeOut("fast",function(){a.find(".yikes-mailchimp-required-interest-group-error").remove();for(var b in e)a.find("span."+b+"-label").after('<p class="yikes-mailchimp-required-interest-group-error">'+d.l10n.interest_group_checkbox_error+"</p>")});else for(var g in e)a.find("span."+g+"-label").after('<p class="yikes-mailchimp-required-interest-group-error">'+d.l10n.interest_group_checkbox_error+"</p>");return a.find(".yikes-easy-mc-submit-button").removeAttr("disabled","disabled"),a.find("input, label, button").not(":hidden").fadeTo("fast",1),a.find(".yikes-mailchimp-preloader").remove(),c(".yikes-mc-loading-dots").remove(),c(".yikes-mailchimp-submit-button-span-text").show(),a.removeClass("yikes-mc-submitted-form-loading"),!1}a.find(".yikes-easy-mc-submit-button").attr("disabled","disabled"),c(".yikes-easy-mc-error-message").remove(),c(".yikes-easy-mc-success-message").remove();var h={action:"process_form_submission",form_data:a.serialize(),form_id:b,page_data:d.l10n.page_data,ajax_security_nonce:d.l10n.ajax_security_nonce};return c.ajax({url:d.l10n.ajax_url,type:"POST",data:h,success:function(e,g,h){if(a.find("input, label, button").not(":hidden").fadeTo("fast",1),a.find(".yikes-mailchimp-preloader").remove(),c(".yikes-mc-loading-dots").remove(),c(".yikes-mailchimp-submit-button-span-text").show(),a.removeClass("yikes-mc-submitted-form-loading"),e.success){e=e.data,1==e.hide&&(c(".yikes-easy-mc-form-description-"+b).length>0&&c(".yikes-easy-mc-form-description-"+b).hide(),a.hide()),c(".yikes-easy-mc-form-description-"+b).length>0?c(".yikes-easy-mc-form-description-"+b).before('<p class="yikes-easy-mc-success-message yikes-easy-mc-success-message-'+b+' yikes-easy-mc-hidden">'+e.response+"</p>"):a.before('<p class="yikes-easy-mc-success-message yikes-easy-mc-success-message-'+b+' yikes-easy-mc-hidden">'+e.response+"</p>"),c(".yikes-easy-mc-success-message-"+b).fadeIn(),c(".yikes-mailchimp-required-interest-group-error").remove(),1==e.redirection&&a.before(e.redirect),a.find("input").not('.yikes-easy-mc-submit-button, input[type="radio"], input[type="select"], input[type="checkbox"], #yikes-mailchimp-associated-list-id, #yikes-mailchimp-submitted-form').val("");var i={action:"increase_submission_count",form_id:b};c.ajax({url:d.l10n.ajax_url,type:"POST",data:i,success:function(a,b,c){},error:function(a,b,c){console.error(c)}})}else{if(e=e.data,c(".yikes-easy-mc-form-description-"+b).length>0)c(".yikes-easy-mc-form-description-"+b).before('<p class="yikes-easy-mc-error-message yikes-easy-mc-error-message-'+b+'" yikes-easy-mc-hidden"> '+e.response+"</p>");else{var j="undefined"!=typeof e&&"undefined"!=typeof e.response?e.response:"Error collecting the API response.";a.before('<p class="yikes-easy-mc-error-message yikes-easy-mc-error-message-'+b+' yikes-easy-mc-hidden">'+j+"</p>")}if("undefined"!=typeof e&&"undefined"!=typeof e.missing_required_field&&e.missing_required_field===!0&&"undefined"!=typeof e.missing_required_field_data){var k=e.missing_required_field_data,l="undefined"!=typeof e.is_interest_group&&e.is_interest_group;f(k,l)}c(".yikes-easy-mc-error-message").fadeIn()}},error:function(a,b,c){console.error(c),console.log(a),console.log(b)},complete:function(b,c){a.find(".yikes-easy-mc-submit-button").removeAttr("disabled","disabled")}}),!1})})}(window,document,jQuery,Yikes_Mailchimp_Ajax);
public/js/yikes-update-existing-subscriber.js CHANGED
@@ -5,14 +5,15 @@
5
  */
6
  jQuery( document ).ready( function() {
7
  jQuery( 'body' ).on( 'click', '.send-update-email', function() {
 
8
  /* Submit an ajax request to send off the update email */
9
  var data = {
10
  'action': 'easy_forms_send_email',
11
  'user_email': jQuery( this ).attr( 'data-user-email' ),
12
- 'list_id': jQuery( this ).attr( 'data-list-id' ),
 
13
  };
14
  jQuery( this ).parent( 'p' ).fadeTo( 'fast', .75 ).append( '<img src="' + update_subscriber_details_data.preloader_url + '" class="update-email-preloader" />' );
15
- /* We can also pass the url value separately from ajaxurl for front end AJAX implementations */
16
  jQuery.post( update_subscriber_details_data.ajax_url, data, function(response) {
17
  if( response.success ) {
18
  jQuery( '.yikes-easy-mc-error-message' ).removeClass( 'yikes-easy-mc-error-message' ).addClass( 'yikes-easy-mc-success-message' ).html( response.data.response_text );
5
  */
6
  jQuery( document ).ready( function() {
7
  jQuery( 'body' ).on( 'click', '.send-update-email', function() {
8
+
9
  /* Submit an ajax request to send off the update email */
10
  var data = {
11
  'action': 'easy_forms_send_email',
12
  'user_email': jQuery( this ).attr( 'data-user-email' ),
13
+ 'list_id': jQuery( this ).attr( 'data-list-id' ),
14
+ 'form_id': jQuery( this ).attr( 'data-form-id' ),
15
  };
16
  jQuery( this ).parent( 'p' ).fadeTo( 'fast', .75 ).append( '<img src="' + update_subscriber_details_data.preloader_url + '" class="update-email-preloader" />' );
 
17
  jQuery.post( update_subscriber_details_data.ajax_url, data, function(response) {
18
  if( response.success ) {
19
  jQuery( '.yikes-easy-mc-error-message' ).removeClass( 'yikes-easy-mc-error-message' ).addClass( 'yikes-easy-mc-success-message' ).html( response.data.response_text );
public/js/yikes-update-existing-subscriber.min.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery(document).ready(function(){jQuery("body").on("click",".send-update-email",function(){var a={action:"easy_forms_send_email",user_email:jQuery(this).attr("data-user-email"),list_id:jQuery(this).attr("data-list-id"),form_id:jQuery(this).attr("data-form-id")};return jQuery(this).parent("p").fadeTo("fast",.75).append('<img src="'+update_subscriber_details_data.preloader_url+'" class="update-email-preloader" />'),jQuery.post(update_subscriber_details_data.ajax_url,a,function(a){a.success?jQuery(".yikes-easy-mc-error-message").removeClass("yikes-easy-mc-error-message").addClass("yikes-easy-mc-success-message").html(a.data.response_text):jQuery(".yikes-easy-mc-error-message").fadeTo("fast",1).html(a.data.response_text)}),!1})});
public/partials/ajax/class.public_ajax.php CHANGED
@@ -58,132 +58,121 @@ class YIKES_Inc_Easy_MailChimp_Public_Ajax {
58
  @since v6.0.4.1
59
  */
60
  public function sendUpdateProfileEmail() {
61
- $user_email = $_POST['user_email'];
62
- $list_id = $_POST['list_id'];
63
-
64
- $api_key = yikes_get_mc_api_key();
65
- $dash_position = strpos( $api_key, '-' );
66
- $explode_key = explode( '-' , $api_key );
67
- $data_center = $explode_key[1];
68
- $full_site_url = get_bloginfo('url');
69
-
70
- // list details api call
71
- if( $dash_position !== false ) {
72
- $api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/list.json';
73
- }
74
- $list_details = wp_remote_post( $api_endpoint, array(
75
- 'body' => array(
76
- 'apikey' => $api_key,
77
- 'filters' => array(
78
- 'list_id' => $list_id
79
- ),
80
- ),
81
- 'timeout' => 10,
82
- 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true )
83
- ) );
84
- $list_details = json_decode( wp_remote_retrieve_body( $list_details ), true );
85
- if( isset( $list_details['error'] ) ) {
86
- if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
87
- require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
88
- $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
89
- $error_logging->yikes_easy_mailchimp_write_to_error_log( $list_details['error'], __( "Send Update Profile Email - Get Account Lists" , 'yikes-inc-easy-mailchimp-extender' ), "class.public_ajax.php" );
90
- }
91
  }
92
 
93
- // account details api call
94
- if( $dash_position !== false ) {
95
- $api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/helper/account-details.json';
96
- }
97
- $account_details = wp_remote_post( $api_endpoint, array(
98
- 'body' => array(
99
- 'apikey' => $api_key
100
- ),
101
- 'timeout' => 10,
102
- 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true )
103
- ) );
104
- $account_details = json_decode( wp_remote_retrieve_body( $account_details ), true );
105
- if( isset( $account_details['error'] ) ) {
106
- if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
107
- require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
108
- $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
109
- $error_logging->yikes_easy_mailchimp_write_to_error_log( $account_details['error'], __( "Send Update Profile Email - Get Account Details" , 'yikes-inc-easy-mailchimp-extender' ), "class.public_ajax.php" );
110
- }
111
  }
112
 
113
- // subscriber details api call
114
- if( $dash_position !== false ) {
115
- $api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/member-info.json';
116
- }
117
- $subscriber_account_details = wp_remote_post( $api_endpoint, array(
118
- 'body' => array(
119
- 'apikey' => $api_key,
120
- 'id' => $list_id,
121
- 'emails' => array(
122
- array( 'email' => $user_email ),
123
- ),
124
- ),
125
- 'timeout' => 10,
126
- 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true )
127
- ) );
128
- $subscriber_account_details = json_decode( wp_remote_retrieve_body( $subscriber_account_details ), true );
129
- if( isset( $subscriber_account_details['error'] ) ) {
130
- if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
131
- require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
132
- $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
133
- $error_logging->yikes_easy_mailchimp_write_to_error_log( $subscriber_account_details['error'], __( "Send Update Profile Email - Get Member Info." , 'yikes-inc-easy-mailchimp-extender' ), "class.public_ajax.php" );
134
- }
135
  }
136
 
137
- // check for errors in any of the calls
138
- if( isset( $list_details['error'] ) || isset( $account_details['error'] ) || isset( $subscriber_account_details['error'] ) ) {
139
- $error_message = ( isset( $list_details['error'] ) ) ? $list_details['error'] : false;
140
- if( ! $error_message ) {
141
- $error_message = ( isset( $account_details['error'] ) ) ? $account_details['error'] : false;
142
- if( ! $error_message ) {
143
- $error_message = ( isset( $subscriber_account_details['error'] ) ) ? $subscriber_account_details['error'] : false;
144
- if( ! $error_message ) {
145
- $error_message = '';
 
 
146
  }
147
  }
148
  }
149
- $errorMessage = sprintf( __( 'Error sending update profile email. <strong>Error: %s</strong>. Please contact the site administrator.' , 'yikes-inc-easy-mailchimp-extender' ), $error_message );
 
 
 
 
 
150
  wp_send_json_error(
151
  array(
152
  'response_text' => '<div class="yikes-easy-mc-error-message">&#10005; ' . $errorMessage . '</div>',
153
  )
154
  );
 
155
  return;
156
  }
157
 
158
- // send the email!
159
- $subscriber_id = $subscriber_account_details['data'][0]['id'];
160
- $explode_url = explode( '.' , $account_details['contact']['url'] );
161
- $update_link_href = 'http://' . $explode_url[1] . '.' . $data_center . '.list-manage1.com/profile?u=' . $account_details['user_id'] . '&id=' . $list_id .'&e=' . $subscriber_id;
162
- $subject = 'MailChimp Profile Update';
163
- $headers = 'From: ' . $list_details['data'][0]['default_from_name'] . ' <' . $list_details['data'][0]['default_from_email'] . '>' . "\r\n";
164
- $headers .= 'Content-type: text/html';
165
- $email_content = '<p>Greetings,</p> <p>A request has been made to update your MailChimp account profile information. To do so please use the following link: <a href="' . $update_link_href . '" title="Update MailChimp Profile">Update MailChimp Profile Info.</a>';
166
- $email_content .= "<p>If you did not request this update, please disregard this email.</p>";
167
- $email_content .= '<p>&nbsp;</p>';
168
- $email_content .= '<p>This email was sent from : ' . $full_site_url . '</p>';
169
- $email_content .= '<p>&nbsp;</p>';
170
- $email_content .= '<p>&nbsp;</p>';
171
- $email_content .= '<p style="font-size:13px;margin-top:5em;"><em>This email was generated by the <a href="http://www.wordpress.org/plugins/yikes-inc-easy-mailchimp-extender/" target="_blank">Easy Forms for MailChimp</a> plugin, created by <a href="http://www.yikesinc.com" target="_blank">YIKES Inc.</a></em></p>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
172
  /* Confirm that the email was sent */
173
- if ( wp_mail( $user_email, apply_filters( 'yikes-mailchimp-update-email-subject', $subject ), apply_filters( 'yikes-mailchimp-update-email-content', $email_content, $update_link_href ), $headers ) ) {
174
  wp_send_json_success(
175
  array(
176
- 'response_text' => '<div class="yikes-easy-mc-success-message">' . sprintf( __( '%s Update email successfully sent. Please check your inbox for the message.' , 'yikes-inc-easy-mailchimp-extender' ), '&#10004;' ) . '</div>',
177
  )
178
  );
179
- exit;
180
  } else {
181
  wp_send_json_error(
182
  array(
183
- 'response_text' => '<div class="yikes-easy-mc-error-message">' . sprintf( __( '%s Email failed to send. Please contact the site administrator.' , 'yikes-inc-easy-mailchimp-extender' ), '&#10005;' ) . '</div>',
184
  )
185
  );
186
- exit;
187
  }
188
  }
189
  }
58
  @since v6.0.4.1
59
  */
60
  public function sendUpdateProfileEmail() {
61
+ $user_email = $_POST['user_email'];
62
+ $user_id = md5( $user_email );
63
+ $list_id = $_POST['list_id'];
64
+ $form_id = $_POST['form_id'];
65
+ $full_site_url = get_bloginfo( 'url' );
66
+ $manager = yikes_get_mc_api_manager();
67
+
68
+ // Possibly handle errors.
69
+ $errors = array();
70
+ $is_error = false;
71
+
72
+ // List details API call
73
+ $list_details = $manager->get_list_handler()->get_list( $list_id );
74
+ if ( is_wp_error( $list_details ) ) {
75
+ $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
76
+ $error_logging->maybe_write_to_log( $list_details->get_error_code(),
77
+ __( "Send Update Profile Email - Get Account Lists", 'yikes-inc-easy-mailchimp-extender' ),
78
+ "class.public_ajax.php"
79
+ );
80
+ $is_error = true;
81
+ $errors[] = $list_details->get_error_message();
 
 
 
 
 
 
 
 
 
82
  }
83
 
84
+ // Account details API call
85
+ $account_details = $manager->get_account_handler()->get_account( false );
86
+ if ( is_wp_error( $account_details ) ) {
87
+ $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
88
+ $error_logging->maybe_write_to_log( $account_details->get_error_code(), __( "Send Update Profile Email - Get Account Details", 'yikes-inc-easy-mailchimp-extender' ), "class.public_ajax.php" );
89
+ $is_error = true;
90
+ $errors[] = $account_details->get_error_message();
 
 
 
 
 
 
 
 
 
 
 
91
  }
92
 
93
+ // Subscriber details API call
94
+ $subscriber_account_details = $manager->get_list_handler()->get_member( $list_id, $user_id );
95
+ if ( is_wp_error( $subscriber_account_details ) ) {
96
+ $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
97
+ $error_logging->maybe_write_to_log( $subscriber_account_details->get_error_code(), __( "Send Update Profile Email - Get Member Info.", 'yikes-inc-easy-mailchimp-extender' ), "class.public_ajax.php" );
98
+ $is_error = true;
99
+ $errors[] = $subscriber_account_details->get_error_message();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
  }
101
 
102
+ // Form details API call
103
+ $interface = yikes_easy_mailchimp_extender_get_form_interface();
104
+ if ( ! empty( $interface ) && method_exists( $interface, 'get_form' ) && isset( $form_id ) ) {
105
+ $form_data = $interface->get_form( $form_id );
106
+ if ( ! empty( $form_data ) ) {
107
+ if ( isset( $form_data['error_messages'] ) ) {
108
+ if ( isset( $form_data['error_messages']['email-body'] ) && ! empty( $form_data['error_messages']['email-body'] ) ) {
109
+ $email_body = apply_filters( 'the_content', $form_data['error_messages']['email-body'] );
110
+ }
111
+ if ( isset( $form_data['error_messages']['email-subject'] ) && ! empty( $form_data['error_messages']['email-subject'] ) ) {
112
+ $email_subject = $form_data['error_messages']['email-subject'];
113
  }
114
  }
115
  }
116
+ }
117
+
118
+ // check for errors in any of the calls
119
+ if ( $is_error ) {
120
+ $error_message = '<br>' . join( '<br>', $errors );
121
+ $errorMessage = sprintf( __( 'Error sending update profile email. <strong>Error(s): %s</strong>. Please contact the site administrator.', 'yikes-inc-easy-mailchimp-extender' ), $error_message );
122
  wp_send_json_error(
123
  array(
124
  'response_text' => '<div class="yikes-easy-mc-error-message">&#10005; ' . $errorMessage . '</div>',
125
  )
126
  );
127
+
128
  return;
129
  }
130
 
131
+ // Construct the headers & email message content
132
+ $subscriber_id = $subscriber_account_details['unique_email_id'];
133
+ $update_link_href = str_replace( '/subscribe', '/profile', $list_details['subscribe_url_long'] );
134
+ $update_link_href = add_query_arg( 'e', $subscriber_id, $update_link_href );
135
+ $update_link_tag = '<a href="' . $update_link_href . '">';
136
+ $headers = 'From: ' . $list_details['campaign_defaults']['from_name'] . ' <' . $list_details['campaign_defaults']['from_email'] . '>' . "\r\n";
137
+ $headers .= 'Content-type: text/html';
138
+
139
+ if ( ! isset( $email_subject ) ) {
140
+ $email_subject = __( 'MailChimp Profile Update', 'yikes-inc-easy-mailchimp-extender' );
141
+ }
142
+
143
+ // Check if the email_body was set
144
+ if ( ! isset( $email_body ) || empty( $email_body ) ) {
145
+
146
+ // The email_body should always be set, but we've made this function static just in case so we can grab our default
147
+ $email_body = Yikes_Inc_Easy_Mailchimp_Forms_Admin::generate_default_email_body();
148
+ }
149
+
150
+ // Run our replacement strings for the email body
151
+
152
+ // We let the user use [link] text [/link] for the update profile link
153
+ // So replace [link] with the <a> tag
154
+ $email_body = str_replace( '[link]', $update_link_tag, $email_body );
155
+
156
+ // And replace [/link] with the closing </a> tag
157
+ $email_body = str_replace( '[/link]', '</a>', $email_body );
158
+
159
+ // We let the user use [url] for their website
160
+ // So replace [url] with get_home_url()
161
+ $email_body = str_replace( '[url]', get_home_url(), $email_body );
162
+
163
  /* Confirm that the email was sent */
164
+ if ( wp_mail( $user_email, apply_filters( 'yikes-mailchimp-update-email-subject', $email_subject ), apply_filters( 'yikes-mailchimp-update-email-content', $email_body, $update_link_href ), $headers ) ) {
165
  wp_send_json_success(
166
  array(
167
+ 'response_text' => '<div class="yikes-easy-mc-success-message">' . sprintf( __( '%s Update email successfully sent. Please check your inbox for the message.', 'yikes-inc-easy-mailchimp-extender' ), '&#10004;' ) . '</div>',
168
  )
169
  );
 
170
  } else {
171
  wp_send_json_error(
172
  array(
173
+ 'response_text' => '<div class="yikes-easy-mc-error-message">' . sprintf( __( '%s Email failed to send. Please contact the site administrator.', 'yikes-inc-easy-mailchimp-extender' ), '&#10005;' ) . '</div>',
174
  )
175
  );
 
176
  }
177
  }
178
  }
public/partials/shortcodes/process/process_form_submission.php CHANGED
@@ -1,316 +1,263 @@
1
  <?php
2
  /*
3
  * Process Non-Ajax forms
4
- * @Updated for v6.0.3.5
5
  */
6
 
7
- // set the global variable to 1, to trigger a successful submission
8
  global $form_submitted, $process_submission_response;
9
 
10
- // confirm we have a form id to work with
11
- $form_id = ( ! empty( $_POST['yikes-mailchimp-submitted-form'] ) ) ? $_POST['yikes-mailchimp-submitted-form'] : false;
12
- if( ! $form_id ) {
 
 
 
 
 
 
13
  return;
14
  }
15
 
16
- $form_settings = Yikes_Inc_Easy_Mailchimp_Extender_Public::yikes_retrieve_form_settings( $_POST['yikes-mailchimp-submitted-form'] );
 
17
 
18
- // Process our form submissions (non ajax forms)
19
- if ( ! isset( $_POST['yikes_easy_mc_new_subscriber'] ) || ! wp_verify_nonce( $_POST['yikes_easy_mc_new_subscriber'], 'yikes_easy_mc_form_submit' ) ) {
20
 
21
- $process_submission_response = '<p><small class="form_submission_error">' . __( "Error : Sorry, the nonce security check didn't pass. Please reload the page and try again. You may want to try clearing your browser cache as a last attempt." , 'yikes-inc-easy-mailchimp-extender' ) . '</small></p>';
 
 
 
 
22
  return;
 
23
 
24
- } else {
 
 
25
 
26
- /* Check for Honeypot filled */
27
- $honey_pot_filled = ( isset( $_POST['yikes-mailchimp-honeypot'] ) && $_POST['yikes-mailchimp-honeypot'] != '' ) ? true : false;
28
- // if it was filled out, return an error...
29
- if ( $honey_pot_filled ) {
30
- $process_submission_response = '<p><small class="form_submission_error">' . __( "Error: It looks like the honeypot was filled out and the form was not properly be submitted." , 'yikes-inc-easy-mailchimp-extender' ) . '</small></p>';
31
- return;
32
- }
33
 
34
- // Check reCAPTCHA Response
35
- if( isset( $_POST['g-recaptcha-response'] ) ) {
36
- $url = esc_url_raw( 'https://www.google.com/recaptcha/api/siteverify?secret=' . get_option( 'yikes-mc-recaptcha-secret-key' , '' ) . '&response=' . $_POST['g-recaptcha-response'] . '&remoteip=' . $_SERVER["REMOTE_ADDR"] );
37
- $response = wp_remote_get( $url );
38
- $response_body = json_decode( $response['body'] , true );
39
-
40
- // if we've hit an error, lets return the error!
41
- if( $response_body['success'] != 1 ) {
42
- $recaptcha_error = array(); // empty array to store error messages
43
- foreach( $response_body['error-codes'] as $error_code ) {
44
- if( $error_code == 'missing-input-response' ) {
45
- $error_code = __( 'Please check the reCAPTCHA field.', 'yikes-inc-easy-mailchimp-extender' );
46
- }
47
- $recaptcha_error[] = $error_code;
48
- }
49
- $process_submission_response .= "<p class='yikes-easy-mc-error-message'>" . apply_filters( 'yikes-mailchimp-recaptcha-required-error', __( 'Error' , 'yikes-inc-easy-mailchimp-extender' ) . ': ' . implode( ' ' , $recaptcha_error ) ) . "</p>";
50
- return;
51
- }
52
- }
53
 
54
- /*
55
- * Confirm that all required checkbox groups were submitted
56
- * No HTML5 validation, and don't want to use jQuery for non-ajax forms
57
- */
58
- $missing_required_checkbox_interest_groups = array();
59
- foreach( $form_settings['fields'] as $merge_tag => $field_data ) {
60
- if( is_numeric( $merge_tag ) ) {
61
- // check if the checkbox group was set to required, if so return an error
62
- if( isset( $field_data['require'] ) && $field_data['require'] == 1 ) {
63
- if( $field_data['type'] == 'checkboxes' ) {
64
- if( ! isset( $_POST[$merge_tag] ) ) {
65
- $missing_required_checkbox_interest_groups[] = $merge_tag;
66
- }
67
- }
68
- }
69
- }
70
- }
71
 
72
- if( ! empty( $missing_required_checkbox_interest_groups ) ) {
73
- $process_submission_response = '<p class="yikes-easy-mc-error-message">' . apply_filters( 'yikes-mailchimp-interest-group-required-top-error', sprintf( _n( 'It looks like you forgot to fill in a required field.', 'It looks like you forgot to fill in %s required fields.', count( $missing_required_checkbox_interest_groups ), 'yikes-inc-easy-mailchimp-extender' ), count( $missing_required_checkbox_interest_groups ) ), count( $missing_required_checkbox_interest_groups ), $form_id ) . '</p>';
74
- return;
75
- }
 
 
 
 
 
 
76
 
77
- // Empty array to build up merge variables
78
- $merge_variables = array();
79
-
80
- // loop to push variables to our array
81
- foreach ( $_POST as $merge_tag => $value ) {
82
- if( $merge_tag != 'yikes_easy_mc_new_subscriber' && $merge_tag != '_wp_http_referer' ) {
83
- // check if the current iteration has a 'date_format' key set
84
- // (aka - date/birthday fields)
85
- if( isset( $form_settings['fields'][$merge_tag]['date_format'] ) ) {
86
- // check if EU date format
87
- if( $form_settings['fields'][$merge_tag]['date_format'] == 'DD/MM/YYYY' ) {
88
- // convert '/' to '.' and to UNIX timestamp
89
- $value = ( '' != $value ) ? date( 'Y-m-d', strtotime( str_replace( '/', '.', $value ) ) ) : '';
90
- } else {
91
- // convert to UNIX timestamp
92
- $value = ( '' != $value ) ? date( 'Y-m-d', strtotime( $value ) ) : '';
93
- }
94
- }
95
- if( is_numeric( $merge_tag ) ) { // this is is an interest group!
96
- $merge_variables['groupings'][] = array( 'id' => $merge_tag , 'groups' => ( is_array( $value ) ) ? $value : array( $value ) );
97
- } else { // or else it's just a standard merge variable
98
- $merge_variables[$merge_tag] = $value;
99
- }
100
- }
101
- }
 
 
 
 
 
102
 
103
- // store the opt-in time
104
- $merge_variables['optin_time'] = current_time( 'Y-m-d H:i:s', 1 );
105
 
106
- // Submit our form data
107
- $api_key = yikes_get_mc_api_key();
108
- $dash_position = strpos( $api_key, '-' );
 
 
109
 
110
- // setup the end point
111
- if( $dash_position !== false ) {
112
- $api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/subscribe.json';
 
 
 
 
113
  }
 
114
 
115
- /*
116
- * yikes-mailchimp-before-submission
117
- *
118
- * Catch the merge variables before they get sent over to MailChimp
119
- * param @merge_variables - user submitted form data
120
- * optional @form - the ID of the form to filter
121
- * @since 6.0.0
122
- */
123
- $merge_variables = apply_filters( 'yikes-mailchimp-before-submission', $merge_variables );
124
- $merge_variables = apply_filters( 'yikes-mailchimp-before-submission-' . $form_id, $merge_variables );
125
-
126
- /**
127
- * Action hooks fired before API request
128
- * @since 6.0.5.5
129
- * @param $merge_variables array Array of merge variable to use
130
- * @param $form_id integer The form ID to target (eg: 1, 2 etc.)
131
- */
132
- do_action( 'yikes-mailchimp-before-submission', $merge_variables );
133
- do_action( 'yikes-mailchimp-before-submission-' . $form_id, $merge_variables );
134
-
135
- /*
136
- * Allow users to check for submit value
137
- * and pass back an error to the user
138
- */
139
- if( isset( $merge_variables['error'] ) ) {
140
- $process_submission_response = apply_filters( 'yikes-mailchimp-frontend-content' , $merge_variables['message'] );
 
 
 
 
141
  return;
142
  }
 
143
 
144
- /**
145
- * Setup whether or not we should update the user, or display the error with email generation
146
- * @since 6.1
147
- */
148
- if ( isset( $form_settings['optin_settings']['update_existing_user'] ) && 1 === absint( $form_settings['optin_settings']['update_existing_user'] ) ) {
149
- $update_existing_user = 1;
150
- // Should we send the update email
151
- if ( isset( $form_settings['optin_settings']['send_update_email'] ) && 1 === absint( $form_settings['optin_settings']['send_update_email'] ) ) {
152
- $update_existing_user = 0;
153
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
154
  } else {
155
- $update_existing_user = 0;
 
 
156
  }
 
157
 
158
- // submit the request & data, using the form settings
159
- // subscribe the user
160
- $subscribe_response = wp_remote_post( $api_endpoint, array(
161
- 'body' => apply_filters( 'yikes-mailchimp-user-subscribe-api-request', array(
162
- 'apikey' => $api_key,
163
- 'id' => $_POST['yikes-mailchimp-associated-list-id'],
164
- 'email' => array( 'email' => sanitize_email( $_POST['EMAIL'] ) ),
165
- 'merge_vars' => $merge_variables,
166
- 'double_optin' => $form_settings['optin_settings']['optin'],
167
- 'update_existing' => $update_existing_user, // Decide if we should update the user or not
168
- 'send_welcome' => $form_settings['optin_settings']['send_welcome_email'],
169
- 'replace_interests' => ( isset( $form_settings['submission_settings']['replace_interests'] ) ) ? $form_settings['submission_settings']['replace_interests'] : 1, // defaults to replace
170
- ), $form_id, $_POST['yikes-mailchimp-associated-list-id'], $_POST['EMAIL'] ),
171
- 'timeout' => 10,
172
- 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true )
173
- ) );
174
-
175
- $subscribe_response = json_decode( wp_remote_retrieve_body( $subscribe_response ), true );
176
-
177
- // check for any errors
178
- if( isset( $subscribe_response['error'] ) ) {
179
-
180
- if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
181
- require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
182
- $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
183
- $error_logging->yikes_easy_mailchimp_write_to_error_log( $subscribe_response['error'], __( "Subscribe New User" , 'yikes-inc-easy-mailchimp-extender' ), "process_form_submission.php" );
184
- }
185
-
186
- $update_account_details_link = '';
187
- switch( $subscribe_response['code'] ) {
188
- // user already subscribed
189
- case '214':
190
- $custom_already_subscribed_text = apply_filters( 'yikes-easy-mailchimp-update-existing-subscriber-text', sprintf( __( ' To update your MailChimp profile, please %s.', 'yikes-inc-easy-mailchimp-extender' ), '<a class="send-update-email" data-list-id="' . $_POST['yikes-mailchimp-associated-list-id'] . '" data-user-email="' . sanitize_email( $_POST['EMAIL'] ) . '" href="#">' . __( 'click to send yourself an update link', 'yikes-inc-easy-mailchimp-extender' ) . '</a>' ), $form_id, '<a class="send-update-email" data-list-id="' . $_POST['yikes-mailchimp-associated-list-id'] . '" data-user-email="' . sanitize_email( $_POST['EMAIL'] ) . '" href="#">' . __( 'click to send yourself an update link', 'yikes-inc-easy-mailchimp-extender' ) . '</a>' );
191
- $update_account_details_link = ( 1 === absint( $form_settings['optin_settings']['update_existing_user'] ) && 1 === absint( $form_settings['optin_settings']['send_update_email'] ) ) ? $custom_already_subscribed_text : false;
192
- if( $update_account_details_link ) {
193
- // if update account details is set, we need to include our script to send out the update email
194
- wp_enqueue_script( 'update-existing-subscriber.js', YIKES_MC_URL . 'public/js/yikes-update-existing-subscriber.js' , array( 'jquery' ), 'all' );
195
- wp_localize_script( 'update-existing-subscriber.js', 'update_subscriber_details_data', array(
196
- 'ajax_url' => esc_url( admin_url( 'admin-ajax.php' ) ),
197
- 'preloader_url' => apply_filters( 'yikes-mailchimp-preloader', esc_url_raw( admin_url( 'images/wpspin_light.gif' ) ) ),
198
- ) );
199
- }
200
- if( ! empty( $form_settings['error_messages']['already-subscribed'] ) ) {
201
- $process_submission_response = '<p class="yikes-easy-mc-error-message">' . apply_filters( 'yikes-easy-mailchimp-user-already-subscribed-text', $form_settings['error_messages']['already-subscribed'], $form_id, $_POST['EMAIL'] ) . ' ' . $update_account_details_link . '</p>';
202
- } else {
203
- $process_submission_response = '<p class="yikes-easy-mc-error-message">' . $subscribe_response['error'] . ' ' . $update_account_details_link . '</p>';
204
- }
205
- break;
206
- // missing a required field
207
- case '250':
208
- // get all merge variables in array, loop and str_replace error code with field name
209
- $api_key = yikes_get_mc_api_key();
210
- $dash_position = strpos( $api_key, '-' );
211
- if( $dash_position !== false ) {
212
- $api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/merge-vars.json';
213
- }
214
- $merge_variables = wp_remote_post( $api_endpoint, array(
215
- 'body' => array(
216
- 'apikey' => $api_key,
217
- 'id' => array( $_POST['yikes-mailchimp-associated-list-id'] ) ,
218
- ),
219
- 'timeout' => 10,
220
- 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true ),
221
- ) );
222
- $merge_variables = json_decode( wp_remote_retrieve_body( $merge_variables ), true );
223
- if( isset( $merge_variables['error'] ) ) {
224
- if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
225
- require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
226
- $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
227
- $error_logging->yikes_easy_mailchimp_write_to_error_log( $merge_variables['error'], __( "Get Merge Variables" , 'yikes-inc-easy-mailchimp-extender' ), "process_form_submission.php" );
228
- }
229
- }
230
- // re-store our data
231
- $merge_variables = $merge_variables['data'][0]['merge_vars'];
232
- $merge_variable_name_array = array();
233
- foreach( $merge_variables as $merge_var ) {
234
- $merge_variables_name_array[$merge_var['tag']] = $merge_var['name'];
235
- }
236
- $error_message = $subscribe_response['error'];
237
- // replace tag with name in the error message.
238
- foreach( $merge_variables_name_array as $tag => $name ) {
239
- $error_message = str_replace( $tag, $name, $error_message );
240
- }
241
- $process_submission_response = '<p class="yikes-easy-mc-error-message">' . $error_message . '.</p>';
242
- break;
243
- // test@email.com is not allowed
244
- case '-99':
245
- // generic error
246
- $process_submission_response = '<p class="yikes-easy-mc-error-message">' . str_replace( ' and cannot be imported', '', str_replace( 'List_RoleEmailMember:', '', $subscribe_response['error'] ) ) . '</p>';
247
- break;
248
- // invalid email (or no email at all)
249
- case '-100':
250
- $process_submission_response = ( ! empty( $form_settings['error_messages']['invalid-email'] ) ) ? '<p class="yikes-easy-mc-error-message">' . $form_settings['error_messages']['invalid-email'] . '</p>' : '<p class="yikes-easy-mc-error-message">' . __( 'Please provide a valid email address.', 'yikes-inc-easy-mailchimp-extender' ) . '</p>';
251
- break;
252
- default:
253
- // generic error
254
- if( ! empty( $form_settings['error_messages']['general-error'] ) ) {
255
- $process_submission_response = '<p class="yikes-easy-mc-error-message">' . $form_settings['error_messages']['general-error'] . '</p>';
256
- } else {
257
- $process_submission_response = '<p class="yikes-easy-mc-error-message">' . $subscribe_response['error'] . '</p>';
258
- }
259
- break;
260
- }
261
  return;
262
  }
 
263
 
264
- // setup our submission response
265
- $form_submitted = 1;
266
-
267
- // Display the success message
268
- if( ! empty( $form_settings['error_messages']['success'] ) ) {
269
- $process_submission_response = '<p class="yikes-easy-mc-success-message">' . apply_filters( 'yikes-mailchimp-success-response', stripslashes( esc_html( $form_settings['error_messages']['success'] ) ), $form_id, $merge_variables ) . '</p>';
270
- // echo stripslashes( esc_html( $error_messages['success'] ) );
271
- } else {
272
- $default_success_response = ( 1 === $form_settings['optin_settings']['optin'] ) ? __( 'Thank you for subscribing! Check your email for the confirmation message.' , 'yikes-inc-easy-mailchimp-extender' ) : __( 'Thank you for subscribing!' , 'yikes-inc-easy-mailchimp-extender' );
273
- $process_submission_response = '<p class="yikes-easy-mc-success-message">' . apply_filters( 'yikes-mailchimp-success-response', $default_success_response, $form_id, $merge_variables ) . '</p>';
274
- // echo $default_success_response;
275
  }
 
 
 
 
276
 
277
- /*
278
- * yikes-mailchimp-after-submission
279
- *
280
- * Catch the merge variables after they've been sent over to MailChimp
281
- * param @merge_variables - user submitted form data
282
- * optional @form - the ID of the form to filter
283
- * @since 6.0.0
284
- */
285
- do_action( 'yikes-mailchimp-after-submission' , $merge_variables );
286
- do_action( 'yikes-mailchimp-after-submission-' . $form_id , $merge_variables );
287
-
288
- /*
289
- * Non-AJAX redirects now handled in class-yikes-inc-easy-mailchimp-extender-public.php
290
- * function: redirect_user_non_ajax_forms
291
- */
292
-
293
- /*
294
- * yikes-mailchimp-form-submission
295
- *
296
- * Do something with the email address, merge variables,
297
- * form ID or notifications
298
- * @$_POST['EMAIL'] - users email address
299
- * @$merge_variables - the merge variables attached to the form ie. form field
300
- * @$form_id - the form ID
301
- * @$notifications - the notification array
302
- * @since 6.0.0
303
- */
304
- do_action( 'yikes-mailchimp-form-submission' , $_POST['EMAIL'] , $merge_variables , $form_id , $form_settings['notifications'] );
305
- do_action( 'yikes-mailchimp-form-submission-' . $form_id , $_POST['EMAIL'] , $merge_variables , $form_id , $form_settings['notifications'] );
306
-
307
- /*
308
- * Increase the submission count for this form
309
- * on a successful submission
310
- * @since 6.0.0
311
- */
312
- $interface = yikes_easy_mailchimp_extender_get_form_interface();
313
- $submissions = $form_settings['submissions'] + 1;
314
- $interface->update_form_field( $form_id, 'submissions', $submissions );
315
  }
316
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
  /*
3
  * Process Non-Ajax forms
4
+ * Overhauled for @6.3.0
5
  */
6
 
7
+ // Define our globals - $form_submitted is a flag, $process_submission_response is a string with a message
8
  global $form_submitted, $process_submission_response;
9
 
10
+ // Instantiate our submission handler class
11
+ $submission_handler = new Yikes_Inc_Easy_MailChimp_Extender_Process_Submission_Handler( $is_ajax = false );
12
+
13
+ // Capture our form data
14
+ $data = $_POST;
15
+
16
+ // Check our nonce
17
+ if ( $submission_handler->handle_nonce( $_POST['yikes_easy_mc_new_subscriber'], 'yikes_easy_mc_form_submit' ) === false ) {
18
+ $process_submission_response = $submission_handler->wrap_form_submission_response( $submission_handler->handle_nonce_message, $is_success = false );
19
  return;
20
  }
21
 
22
+ // Confirm we have a form id to work with
23
+ $form_id = ( isset( $data['yikes-mailchimp-submitted-form'] ) ) ? absint( $data['yikes-mailchimp-submitted-form'] ) : false;
24
 
25
+ // Set the form id in our class
26
+ $submission_handler->set_form_id( $form_id );
27
 
28
+ // For non-AJAX, we need to wrap our 'empty' calls in an if statement and if false `return;`
29
+
30
+ // Send an error if for some reason we can't find the $form_id
31
+ if ( $submission_handler->handle_empty_form_id( $form_id ) === false ) {
32
+ $process_submission_response = $submission_handler->wrap_form_submission_response( $submission_handler->handle_empty_form_id_message, $is_success = false );
33
  return;
34
+ }
35
 
36
+ // Get the form data
37
+ $interface = yikes_easy_mailchimp_extender_get_form_interface();
38
+ $form_data = $interface->get_form( $form_id );
39
 
40
+ // Send an error if for some reason we can't find the form.
41
+ if ( $submission_handler->handle_empty_form( $form_data ) === false ) {
42
+ $process_submission_response = $submission_handler->wrap_form_submission_response( $submission_handler->handle_empty_form_message, $is_success = false );
43
+ return;
44
+ }
 
 
45
 
46
+ // Set up some variables from the form data -- these are required
47
+ $list_id = isset( $form_data['list_id'] ) ? $form_data['list_id'] : null;
48
+ $submission_settings = isset( $form_data['submission_settings'] ) ? $form_data['submission_settings'] : null;
49
+ $optin_settings = isset( $form_data['optin_settings'] ) ? $form_data['optin_settings'] : null;
50
+ $form_fields = isset( $form_data['fields'] ) ? $form_data['fields'] : null;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
 
52
+ // Send an error if for some reason we can't find the required form data
53
+ if ( $submission_handler->handle_empty_fields_generic( array( $list_id, $submission_settings, $optin_settings, $form_fields ) ) === false ) {
54
+ $process_submission_response = $submission_handler->wrap_form_submission_response( $submission_handler->handle_empty_fields_generic_message, $is_success = false );
55
+ return;
56
+ }
 
 
 
 
 
 
 
 
 
 
 
 
57
 
58
+ // Check for required fields and send an error if a required field is empty
59
+ // This is a server side check for required fields because some browsers (e.g. Safari) do not recognize the `required` HTML 5 attribute
60
+ if ( $submission_handler->check_for_required_form_fields( $data, $form_fields ) === false ) {
61
+ $process_submission_response = $submission_handler->wrap_form_submission_response( $submission_handler->handle_empty_required_field_message, $is_success = false );
62
+ return;
63
+ }
64
+ if ( $submission_handler->check_for_required_interest_groups( $data, $form_fields ) === false ) {
65
+ $process_submission_response = $submission_handler->wrap_form_submission_response( $submission_handler->handle_empty_required_interest_group_message, $is_success = false );
66
+ return;
67
+ }
68
 
69
+ // Set the list id in our class
70
+ $submission_handler->set_list_id( $list_id );
71
+
72
+ // Set up some variables from the form data -- these are not required
73
+ $error_messages = isset( $form_data['error_messages'] ) ? $form_data['error_messages'] : array();
74
+ $notifications = isset( $form_data['custom_notifications'] ) ? $form_data['custom_notifications'] : array(); // Do we need this?
75
+
76
+ // Set the error messages in our class
77
+ $submission_handler->set_error_messages( $error_messages );
78
+
79
+ // Some other variables we'll need.
80
+ $merge_variables = array();
81
+ $list_handler = yikes_get_mc_api_manager()->get_list_handler();
82
+
83
+ // Send an error if for some reason we can't find the list_handler
84
+ if ( $submission_handler->handle_empty_list_handler( $list_handler ) === false ) {
85
+ $process_submission_response = $submission_handler->wrap_form_submission_response( $submission_handler->handle_empty_list_handler_message, $is_success = false );
86
+ return;
87
+ }
88
+
89
+ // Get and sanitize the email
90
+ $submitted_email = isset( $data['EMAIL'] ) ? $data['EMAIL'] : '';
91
+ $sanitized_email = $submission_handler->get_sanitized_email( $submitted_email );
92
+ $submission_handler->set_email( $sanitized_email );
93
+
94
+ // Send an error if for some reason we can't find the email
95
+ if ( $submission_handler->handle_empty_email( $sanitized_email ) === false ) {
96
+ $process_submission_response = $submission_handler->wrap_form_submission_response( $submission_handler->handle_empty_email_message, $is_success = false );
97
+ return;
98
+ }
99
 
100
+ // Check for Honeypot filled
101
+ $honey_pot_filled = ( isset( $data['yikes-mailchimp-honeypot'] ) && '' !== $data['yikes-mailchimp-honeypot'] ) ? true : false;
102
 
103
+ // Send an error if honey pot is not empty
104
+ if ( $submission_handler->handle_non_empty_honeypot( $honey_pot_filled ) === false ) {
105
+ $process_submission_response = $submission_handler->wrap_form_submission_response( $submission_handler->handle_non_empty_honeypot_message, $is_success = false );
106
+ return;
107
+ }
108
 
109
+ // Check if reCAPTCHA Response was submitted with the form data, and handle it if needed
110
+ if ( isset( $data['g-recaptcha-response'] ) ) {
111
+ $recaptcha_response = $data['g-recaptcha-response'];
112
+ $recaptcha_handle = $submission_handler->handle_recaptcha( $recaptcha_response );
113
+ if ( isset( $recaptcha_handle['success'] ) && $recaptcha_handle['success'] === false ) {
114
+ $process_submission_response = $submission_handler->wrap_form_submission_response( $recaptcha_handle['message'], $is_success = false );
115
+ return;
116
  }
117
+ }
118
 
119
+ // Loop through the submitted data to sanitize and format values
120
+ $merge_variables = $submission_handler->get_submitted_merge_values( $data, $form_fields );
121
+
122
+ // Submission Setting: Replace interest groups or update interest groups
123
+ $replace_interests = isset( $submission_settings['replace_interests'] ) ? (bool) $submission_settings['replace_interests'] : true;
124
+
125
+ // Get the default groups
126
+ $groups = $submission_handler->get_default_interest_groups( $replace_interests, $list_handler );
127
+
128
+ // Loop through the submitted data and update the default groups array
129
+ $groups = $submission_handler->get_submitted_interest_groups( $data, $form_fields, $groups );
130
+
131
+ /**
132
+ * Action hooks fired before data is sent over to the API
133
+ *
134
+ * @since 6.0.5.5
135
+ *
136
+ * @param $merge_variables array Array of merge variable to use
137
+ */
138
+ do_action( 'yikes-mailchimp-before-submission', $merge_variables );
139
+ do_action( "yikes-mailchimp-before-submission-{$form_id}", $merge_variables );
140
+
141
+ // Allow users to check for form values (using the `yikes-mailchimp-filter-before-submission` filter hook in function `get_submitted_merge_values`)
142
+ // and pass back an error and message to the user
143
+ // If error is set and no message, default to our class variable's default error message
144
+ if ( isset( $merge_variables['error'] ) ) {
145
+ $merge_error_message = isset( $merge_variables['message'] ) ? $merge_variables['message'] : $submission_handler->default_error_response_message;
146
+ $merge_vars_error_array = $submission_handler->handle_merge_variables_error( $merge_variables['error'], $merge_error_message );
147
+ if ( $merge_vars_error_array['success'] === false ) {
148
+ $process_submission_response = $submission_handler->wrap_form_submission_response( $merge_vars_error_array['message'], $is_success = false );
149
  return;
150
  }
151
+ }
152
 
153
+ // This is the array we're going to pass through to the MailChimp API
154
+ $member_data = array(
155
+ 'email_address' => $sanitized_email,
156
+ 'merge_fields' => $merge_variables,
157
+ 'timestamp_opt' => current_time( 'Y-m-d H:i:s', 1 ),
158
+ 'status' => 'subscribed'
159
+ );
160
+
161
+ // Only add groups if they exist
162
+ if ( ! empty( $groups ) ) {
163
+ $member_data['interests'] = $groups;
164
+ }
165
+
166
+ // Check if this member already exists
167
+ $member_exists = $list_handler->get_member( $list_id, md5( strtolower( $sanitized_email ) ), $use_transient = true );
168
+
169
+ // If this member does not exist, then we need to add the status_if_new flag and set our $new_subscriber variable
170
+ if ( is_wp_error( $member_exists ) ) {
171
+ $new_subscriber = true;
172
+
173
+ // Check the opt-in value - is it double or single?
174
+ // Double opt-in means 'status_if_new' => 'pending'
175
+ $double_optin = isset( $optin_settings['optin'] ) ? (int) $optin_settings['optin'] : 0;
176
+
177
+ if ( $double_optin === 1 ) {
178
+
179
+ // Double opt-in
180
+ $member_data['status_if_new'] = 'pending';
181
  } else {
182
+
183
+ // Single opt-in
184
+ $member_data['status_if_new'] = 'subscribed';
185
  }
186
+ } else {
187
 
188
+ // If this member already exists, then we need to go through our optin settings and run some more logic
189
+
190
+ // But first let's set our flag
191
+ $new_subscriber = false;
192
+
193
+ // Check our update_existing_user optin setting
194
+ $update_existing_user = ( $optin_settings['update_existing_user'] === '1' ) ? true : false;
195
+
196
+ // If update_existing_user is false (not allowed) then simply fail and return a response message
197
+ if ( $update_existing_user === false ) {
198
+ $disallow_update_array = $submission_handler->handle_disallowed_existing_user_update();
199
+ if ( $disallow_update_array['success'] === false ) {
200
+ $process_submission_response = $submission_handler->wrap_form_submission_response( $disallow_update_array['message'], $is_success = false );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
201
  return;
202
  }
203
+ }
204
 
205
+ // If update_existing_user is true, we need to check our 'send_update_email' option
206
+ $send_update_email = ( $optin_settings['send_update_email'] === '1' ) ? true : false;
207
+
208
+ // If $send_update_email is true (we send the email) then we need to fire off the 'send update email' logic
209
+ if ( $send_update_email === true ) {
210
+ $update_existing_user_array = $submission_handler->handle_updating_existing_user();
211
+ if ( $update_existing_user_array['success'] === false ) {
212
+ $process_submission_response = $submission_handler->wrap_form_submission_response( $update_existing_user_array['message'], $is_success = false );
213
+ return;
 
 
214
  }
215
+ }
216
+
217
+ // If $send_update_email is false (we don't send the email) then simply continue (we allow them to update their profile via only an email)
218
+ }
219
 
220
+ /**
221
+ * Filters for the subscribe body
222
+ *
223
+ * @since 6.3.0
224
+ *
225
+ * @param array | $member_data | Array of all the variables sent to the MailChimp API
226
+ * @param string | $form_id | The form ID
227
+ */
228
+ $member_data = apply_filters( 'yikes-mailchimp-filter-subscribe-request', $member_data, $form_id );
229
+ $member_data = apply_filters( "yikes-mailchimp-filter-subscribe-request-{$form_id}", $member_data, $form_id );
230
+
231
+ // Send the API request to create a new subscriber! (Or update an existing one)
232
+ $subscribe_response = $list_handler->member_subscribe( $list_id, md5( strtolower( $sanitized_email ) ), $member_data );
233
+
234
+ // Handle the response
235
+
236
+ // Was our submission successful or did it create an error?
237
+ if ( is_wp_error( $subscribe_response ) ) {
238
+ $success_array = $submission_handler->handle_submission_response_error( $subscribe_response, $form_fields );
239
+ } else {
240
+ $submission_handler->handle_submission_response_success( $submission_settings, array(), $merge_variables, $notifications, $optin_settings, $new_subscriber );
241
+ }
242
+
243
+ // Handle errors in the response
244
+ if ( isset( $success_array ) && isset( $success_array['success'] ) && $success_array['success'] === false ) {
245
+ $process_submission_response = isset( $success_array['message'] ) ? $success_array['message'] : '';
246
+ $process_submission_response = $submission_handler->wrap_form_submission_response( $success_array['message'], $is_success = false );
247
+ return;
 
 
 
 
 
 
 
 
 
 
248
  }
249
 
250
+ // Set our global submission response
251
+ $form_submitted = 1;
252
+
253
+ // For non-AJAX submissions, if we have a new subscriber we need to increment our submissions count by 1
254
+ // For AJAX, this is an AJAX call that gets fired off after form submission
255
+ if ( $new_subscriber === true ) {
256
+ $submissions = (int) $form_settings['submissions'] + 1;
257
+ $interface->update_form_field( $form_id, 'submissions', $submissions );
258
+ }
259
+
260
+ // End execution
261
+ return;
262
+
263
+ // That's all folks.
public/partials/shortcodes/process/process_form_submission_ajax.php CHANGED
@@ -4,303 +4,196 @@
4
  * Begin below young grasshopper
5
  */
6
 
 
 
 
7
  // parse our form data
8
  parse_str( $_POST['form_data'], $data );
9
- // store the form ID to use in our hooks and filters
10
- $form = $_POST['form_id'];
11
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  $interface = yikes_easy_mailchimp_extender_get_form_interface();
13
- $form_data = $interface->get_form( $form );
14
-
15
- if( $form_data ) {
16
- // List ID
17
- $list_id = $form_data['list_id'];
18
-
19
- // decode our submission settings
20
- $submission_settings = $form_data['submission_settings'];
21
-
22
- // decode our optin settings
23
- $optin_settings = $form_data['optin_settings'];
24
-
25
- // decode our fields
26
- $form_fields = $form_data['fields'];
27
-
28
- /* Decode our error messages
29
- * Workaround for international characters (cyrillic etc)
30
- * See: https://wordpress.org/support/topic/custom-messages-do-not-support-cyrillic-characters?replies=11#post-7629620
31
- */
32
- $error_messages = $form_data['error_messages'];
33
- /** Submit Process **/
34
- $notifications = isset( $form_data['custom_notifications'] ) ? $form_data['custom_notifications'] : array();
35
- /* Page Data */
36
- $page_data = $_POST['page_data'];
37
- }
 
 
 
38
 
39
- // Empty array to build up merge variables
 
40
  $merge_variables = array();
 
 
41
 
42
- // set variable
43
- $error = 0;
44
-
45
- /* Check for Honeypot filled */
46
- $honey_pot_filled = ( isset( $data['yikes-mailchimp-honeypot'] ) && $data['yikes-mailchimp-honeypot'] != '' ) ? true : false;
47
- // if it was filled out, return an error...
48
- if( $honey_pot_filled ) {
49
- wp_send_json_error( array(
50
- 'hide' => '0',
51
- 'error' => 1,
52
- 'response' => __( "Error: It looks like the honeypot was filled out and the form was not properly be submitted." , 'yikes-inc-easy-mailchimp-extender' )
53
- ) );
54
- return;
55
- }
56
 
57
- // Check reCAPTCHA Response was submitted with the form data
58
- if( isset( $data['g-recaptcha-response'] ) ) {
59
- $url = esc_url_raw( 'https://www.google.com/recaptcha/api/siteverify?secret=' . get_option( 'yikes-mc-recaptcha-secret-key' , '' ) . '&response=' . $data['g-recaptcha-response'] . '&remoteip=' . $_SERVER["REMOTE_ADDR"] );
60
- $response = wp_remote_get( $url );
61
- $response_body = json_decode( $response['body'] , true );
62
- // if we've hit an error, lets return the error!
63
- if( $response_body['success'] != 1 ) {
64
- $error_messages = array(); // empty array to store error messages
65
- if( isset( $response_body['error-codes'] ) ) {
66
- foreach( $response_body['error-codes'] as $error_code ) {
67
- if( $error_code == 'missing-input-response' ) {
68
- $error_code = __( 'Please check the reCAPTCHA field.', 'yikes-inc-easy-mailchimp-extender' );
69
- }
70
- $error_messages[] = __( 'Error', 'yikes-inc-easy-mailchimp-extender' ) . ': ' . $error_code;
71
- }
72
- } else {
73
- $error_messages[] = __( 'Please refresh the page and try again.', 'yikes-inc-easy-mailchimp-extender' );
74
- }
75
- $error = 1;
76
- wp_send_json_error( array(
77
- 'hide' => '0',
78
- 'error' => $error ,
79
- 'response' => apply_filters( 'yikes-mailchimp-recaptcha-required-error', implode( ' ', $error_messages ) ),
80
- ) );
81
- exit();
82
- }
83
- }
84
 
85
- // loop to push variables to our array
86
- foreach ( $data as $merge_tag => $value ) {
87
- if( $merge_tag != 'yikes_easy_mc_new_subscriber' && $merge_tag != '_wp_http_referer' ) {
88
- // check if the current iteration has a 'date_format' key set
89
- // (aka - date/birthday fields)
90
- if( isset( $form_fields[$merge_tag]['date_format'] ) ) {
91
- // check if EU date format
92
- if( $form_fields[$merge_tag]['date_format'] == 'DD/MM/YYYY' ) {
93
- // convert '/' to '.' and to UNIX timestamp
94
- $value = date( 'Y-m-d', strtotime( str_replace( '/', '.', $value ) ) );
95
- } else if ( $form_fields[$merge_tag]['date_format'] == 'MM/DD' ) {
96
- // Birthday MM/DD
97
- $value = date( 'm-d', strtotime( $value ) );
98
- } else if ( $form_fields[$merge_tag]['date_format'] == 'DD/MM' ) {
99
- // Birthday DD/MM
100
- $value = date( 'd-m', strtotime( $value ) );
101
- } else {
102
- // convert to UNIX timestamp
103
- $value = date( 'Y-m-d', strtotime( $value ) );
104
- }
105
- }
106
- if( is_numeric( $merge_tag ) ) { // this is is an interest group!
107
- $merge_variables['groupings'][] = array( 'id' => $merge_tag , 'groups' => ( is_array( $value ) ) ? $value : array( $value ) );
108
- } else { // or else it's just a standard merge variable
109
- $merge_variables[$merge_tag] = $value;
110
- }
111
- }
112
- }
113
- // store the opt-in time
114
- $merge_variables['optin_time'] = current_time( 'Y-m-d H:i:s', 1 );
115
 
116
- // Submit our form data
117
- $api_key = yikes_get_mc_api_key();
118
- $dash_position = strpos( $api_key, '-' );
119
 
120
- // setup the end point
121
- if( $dash_position !== false ) {
122
- $api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/subscribe.json';
 
123
  }
124
 
125
- /*
126
- * yikes-mailchimp-before-submission
127
- *
128
- * Catch the merge variables before they get sent over to MailChimp
129
- * param @merge_variables - user submitted form data
130
- * optional @form - the ID of the form to filter
131
- * @since 6.0.0
132
- */
133
- $merge_variables = apply_filters( 'yikes-mailchimp-before-submission', $merge_variables );
134
- $merge_variables = apply_filters( 'yikes-mailchimp-before-submission-' . $form, $merge_variables );
135
 
136
- /**
137
- * Action hooks fired before API request
138
- * @since 6.0.5.5
139
- */
140
- do_action( 'yikes-mailchimp-before-submission', $merge_variables );
141
- do_action( 'yikes-mailchimp-before-submission-' . $form, $merge_variables );
142
 
143
- /*
144
- * Allow users to check for submit value
145
- * and pass back an error to the user
146
- */
147
- if( isset( $merge_variables['error'] ) ) {
148
- // send our error response back
149
- wp_send_json_error( array( 'hide' => '0', 'error' => $merge_variables['error'] , 'response' => $merge_variables['message'] ) );
150
- return;
151
- }
152
 
153
  /**
154
- * Setup whether or not we should update the user, or display the error with email generation
155
- * @since 6.1
 
 
 
156
  */
157
- if ( isset( $optin_settings['update_existing_user'] ) && 1 === absint( $optin_settings['update_existing_user'] ) ) {
158
- // Should we send the update email
159
- if ( isset( $optin_settings['send_update_email'] ) && 1 === absint( $optin_settings['send_update_email'] ) ) {
160
- $update_existing_user = 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
161
  } else {
162
- $update_existing_user = 1;
 
 
163
  }
 
164
  } else {
165
- $update_existing_user = 0;
166
- }
167
 
168
- // submit the request & data, using the form settings
169
- // subscribe the user
170
- $subscribe_response = wp_remote_post( $api_endpoint, array(
171
- 'body' => apply_filters( 'yikes-mailchimp-user-subscribe-api-request', array(
172
- 'apikey' => $api_key,
173
- 'id' => $list_id,
174
- 'email' => array( 'email' => sanitize_email( $data['EMAIL'] ) ),
175
- 'merge_vars' => $merge_variables,
176
- 'double_optin' => $optin_settings['optin'],
177
- 'update_existing' => $update_existing_user, // Decide if we should update the user or not
178
- 'send_welcome' => $optin_settings['send_welcome_email'],
179
- 'replace_interests' => ( isset( $submission_settings['replace_interests'] ) ) ? $submission_settings['replace_interests'] : 1, // defaults to replace
180
- ), $form, $list_id, $data['EMAIL'] ),
181
- 'timeout' => 10,
182
- 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true )
183
- ) );
184
-
185
- $subscribe_response = json_decode( wp_remote_retrieve_body( $subscribe_response ), true );
186
-
187
- if( isset( $subscribe_response['error'] ) ) {
188
-
189
- if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
190
- require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
191
- $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
192
- $error_logging->yikes_easy_mailchimp_write_to_error_log( $subscribe_response['error'], __( "Subscribe New User" , 'yikes-inc-easy-mailchimp-extender' ), "process_form_submission_ajax.php" );
193
- }
194
-
195
- $update_account_details_link = '';
196
- $error = 1;
197
- switch( $subscribe_response['code'] ) {
198
- // user already subscribed
199
- case '214':
200
- $custom_already_subscribed_text = apply_filters( 'yikes-easy-mailchimp-update-existing-subscriber-text', sprintf( __( ' To update your MailChimp profile, please %s.', 'yikes-inc-easy-mailchimp-extender' ), '<a class="send-update-email" data-list-id="' . $list_id . '" data-user-email="' . sanitize_email( $data['EMAIL'] ) . '" href="#">' . __( 'click to send yourself an update link', 'yikes-inc-easy-mailchimp-extender' ) . '</a>' ), $form, '<a class="send-update-email" data-list-id="' . $_POST['yikes-mailchimp-associated-list-id'] . '" data-user-email="' . sanitize_email( $data['EMAIL'] ) . '" href="#">' . __( 'click to send yourself an update link', 'yikes-inc-easy-mailchimp-extender' ) . '</a>' );
201
- $update_account_details_link = ( 1 === absint( $optin_settings['update_existing_user'] ) && 1 === absint( $optin_settings['send_update_email'] ) ) ? $custom_already_subscribed_text : false;
202
- if( ! empty( $error_messages['already-subscribed'] ) ) {
203
- $error_response = apply_filters( 'yikes-easy-mailchimp-user-already-subscribed-text', $error_messages['already-subscribed'] , $form, $data['EMAIL'] ) . ' ' . $update_account_details_link;
204
- } else {
205
- $error_response = $subscribe_response['error'] . ' ' . $update_account_details_link;
206
- }
207
- break;
208
- // missing a required field
209
- case '250':
210
- // get all merge variables in array, loop and str_replace error code with field name
211
- $api_key = yikes_get_mc_api_key();
212
- $dash_position = strpos( $api_key, '-' );
213
- if( $dash_position !== false ) {
214
- $api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/merge-vars.json';
215
- }
216
- $merge_variables = wp_remote_post( $api_endpoint, array(
217
- 'body' => array(
218
- 'apikey' => $api_key,
219
- 'id' => array( $list_id ) ,
220
- ),
221
- 'timeout' => 10,
222
- 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true ),
223
- ) );
224
- $merge_variables = json_decode( wp_remote_retrieve_body( $merge_variables ), true );
225
- if( is_wp_error( $merge_variables ) || isset( $merge_variables['error'] ) ) {
226
- if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
227
- require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
228
- $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
229
- $error_logging->yikes_easy_mailchimp_write_to_error_log( $merge_variables['error'], __( "Get Merge Variables" , 'yikes-inc-easy-mailchimp-extender' ), "process_form_submission_ajax.php" );
230
- }
231
- }
232
- // re-store our data
233
- $merge_variables = $merge_variables['data'][0]['merge_vars'];
234
- $merge_variable_name_array = array();
235
- foreach( $merge_variables as $merge_var ) {
236
- $merge_variables_name_array[$merge_var['tag']] = $merge_var['name'];
237
- }
238
- $error_message = $subscribe_response['error'];
239
- // replace tag with name in the error message.
240
- foreach( $merge_variables_name_array as $tag => $name ) {
241
- $error_message = str_replace( $tag, $name, $error_message );
242
- }
243
- $error_response = $error_message;
244
- break;
245
- // test@email.com is not allowed
246
- case '-99':
247
- // generic error
248
- $error_response = str_replace( ' and cannot be imported', '', str_replace( 'List_RoleEmailMember:', '', $subscribe_response['error'] ) );
249
- break;
250
- // invalid email (or no email at all)
251
- case '-100':
252
- $error_response = ( ! empty( $error_messages['invalid-email'] ) ) ? $error_messages['invalid-email'] : __( 'Please provide a valid email address.', 'yikes-inc-easy-mailchimp-extender' );
253
- break;
254
- default:
255
- $error_response = ( ! empty( $error_messages['general-error'] ) ) ? $error_messages['general-error'] : $subscribe_response['error'];
256
- break;
257
- }
258
- // send the response
259
- wp_send_json_error( array(
260
- 'hide' => '0',
261
- 'error' => $error,
262
- 'response' => $error_response,
263
- 'security_response' => $update_account_details_link
264
- ) );
265
- return;
266
  }
267
 
268
- // set the global variable to 1, to trigger a successful submission
269
- $form_submitted = 1;
270
- /*
271
- * Successful form submission redirect
272
- */
273
- if( $submission_settings['redirect_on_submission'] == '1' ) {
274
- $redirection = '1';
275
- $redirect_url = ( 'custom_url' != $submission_settings['redirect_page'] ) ? get_permalink( $submission_settings['redirect_page'] ) : $submission_settings['custom_redirect_url'];
276
- $redirect = '<script type="text/javascript">setTimeout(function() { window.location="' . apply_filters( 'yikes-mailchimp-redirect-url', esc_url( $redirect_url ), $form, $page_data ) . '"; }, ' . apply_filters( 'yikes-mailchimp-redirect-timer', 1500 ) . ');</script>';
277
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
278
 
279
- /*
280
- * yikes-mailchimp-after-submission
281
- *
282
- * Catch the merge variables after they've been sent over to MailChimp
283
- * param @merge_variables - user submitted form data
284
- * optional @form - the ID of the form to filter
285
- * @since 6.0.0
286
- */
287
- do_action( 'yikes-mailchimp-after-submission', $merge_variables );
288
- do_action( 'yikes-mailchimp-after-submission-' . $form, $merge_variables );
289
-
290
- // send our notifications if setup (must go before wp_send_json())
291
- do_action( 'yikes-mailchimp-form-submission' , sanitize_email( $data['EMAIL'] ), $merge_variables , $form , $notifications );
292
- do_action( 'yikes-mailchimp-form-submission-' . $form, sanitize_email( $data['EMAIL'] ), $merge_variables , $form , $notifications );
293
-
294
- $default_success_response = ( 1 === $optin_settings['optin'] ) ? __( "Thank you for subscribing! Check your email for the confirmation message." , 'yikes-inc-easy-mailchimp-extender' ) : __( "Thank you for subscribing!" , 'yikes-inc-easy-mailchimp-extender' );
295
-
296
- wp_send_json_success(
297
- array(
298
- 'hide' => $submission_settings['hide_form_post_signup'],
299
- 'error' => $error,
300
- 'response' => apply_filters( 'yikes-mailchimp-success-response', ( ! empty( $error_messages['success'] ) ? $error_messages['success'] : $default_success_response ), $form, $merge_variables ),
301
- 'redirection' => isset( $redirection ) ? '1' : '0',
302
- 'redirect' => isset( $redirect ) ? $redirect : '',
303
- )
304
- );
305
-
306
- // end successful submission
4
  * Begin below young grasshopper
5
  */
6
 
7
+ // Instantiate our submission handler class
8
+ $submission_handler = new Yikes_Inc_Easy_MailChimp_Extender_Process_Submission_Handler( $is_ajax = true );
9
+
10
  // parse our form data
11
  parse_str( $_POST['form_data'], $data );
 
 
12
 
13
+ // Check our nonce
14
+ $submission_handler->handle_nonce( $_POST['ajax_security_nonce'], 'yikes_mc_form_submission_security_nonce' );
15
+
16
+ // Get the form_id
17
+ $form_id = absint( $_POST['form_id'] );
18
+
19
+ // Send an error if for some reason we can't find the $form_id
20
+ $submission_handler->handle_empty_form_id( $form_id );
21
+
22
+ // Set the form id in our class
23
+ $submission_handler->set_form_id( $form_id );
24
+
25
+ // Get the form data
26
  $interface = yikes_easy_mailchimp_extender_get_form_interface();
27
+ $form_data = $interface->get_form( $form_id );
28
+
29
+ // Send an error if for some reason we can't find the form.
30
+ $submission_handler->handle_empty_form( $form_data );
31
+
32
+ // Set up some variables from the form data -- these are required
33
+ $list_id = isset( $form_data['list_id'] ) ? $form_data['list_id'] : null;
34
+ $submission_settings = isset( $form_data['submission_settings'] ) ? $form_data['submission_settings'] : null;
35
+ $optin_settings = isset( $form_data['optin_settings'] ) ? $form_data['optin_settings'] : null;
36
+ $form_fields = isset( $form_data['fields'] ) ? $form_data['fields'] : null;
37
+
38
+ // Send an error if for some reason we can't find the required form data
39
+ $submission_handler->handle_empty_fields_generic( array( $list_id, $submission_settings, $optin_settings, $form_fields ) );
40
+
41
+ // Set the list id in our class
42
+ $submission_handler->set_list_id( $list_id );
43
+
44
+ // Check for required fields and send an error if a required field is empty
45
+ // This is a server side check for required fields because some browsers (e.g. Safari) do not recognize the `required` HTML 5 attribute
46
+ $submission_handler->check_for_required_form_fields( $data, $form_fields );
47
+ $submission_handler->check_for_required_interest_groups( $data, $form_fields );
48
+
49
+ // Set up some variables from the form data -- these are not required
50
+ $error_messages = isset( $form_data['error_messages'] ) ? $form_data['error_messages'] : array();
51
+ $notifications = isset( $form_data['custom_notifications'] ) ? $form_data['custom_notifications'] : array();
52
+
53
+ // Set the error messages in our class
54
+ $submission_handler->set_error_messages( $error_messages );
55
 
56
+ // Some other variables we'll need.
57
+ $page_data = $_POST['page_data'];
58
  $merge_variables = array();
59
+ $error = 0;
60
+ $list_handler = yikes_get_mc_api_manager()->get_list_handler();
61
 
62
+ // Send an error if for some reason we can't find the list_handler
63
+ $submission_handler->handle_empty_list_handler( $list_handler );
 
 
 
 
 
 
 
 
 
 
 
 
64
 
65
+ // Get and sanitize the email
66
+ $submitted_email = isset( $data['EMAIL'] ) ? $data['EMAIL'] : '';
67
+ $sanitized_email = $submission_handler->get_sanitized_email( $submitted_email );
68
+ $submission_handler->set_email( $sanitized_email );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69
 
70
+ // Send an error if for some reason we can't find the email
71
+ $submission_handler->handle_empty_email( $sanitized_email );
72
+
73
+ // Check for Honeypot filled
74
+ $honey_pot_filled = ( isset( $data['yikes-mailchimp-honeypot'] ) && '' !== $data['yikes-mailchimp-honeypot'] ) ? true : false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
 
76
+ // Send an error if honey pot is not empty
77
+ $submission_handler->handle_non_empty_honeypot( $honey_pot_filled );
 
78
 
79
+ // Check if reCAPTCHA Response was submitted with the form data, and handle it if needed
80
+ if ( isset( $data['g-recaptcha-response'] ) ) {
81
+ $recaptcha_response = $data['g-recaptcha-response'];
82
+ $submission_handler->handle_recaptcha( $recaptcha_response );
83
  }
84
 
85
+ // Loop through the submitted data to sanitize and format values
86
+ $merge_variables = $submission_handler->get_submitted_merge_values( $data, $form_fields );
 
 
 
 
 
 
 
 
87
 
88
+ // Submission Setting: Replace interest groups or update interest groups
89
+ $replace_interests = isset( $submission_settings['replace_interests'] ) ? (bool) $submission_settings['replace_interests'] : true;
 
 
 
 
90
 
91
+ // Get the default groups
92
+ $groups = $submission_handler->get_default_interest_groups( $replace_interests, $list_handler );
93
+
94
+ // Loop through the submitted data and update the default groups array
95
+ $groups = $submission_handler->get_submitted_interest_groups( $data, $form_fields, $groups );
 
 
 
 
96
 
97
  /**
98
+ * Action hooks fired before data is sent over to the API
99
+ *
100
+ * @since 6.0.5.5
101
+ *
102
+ * @param $merge_variables array Array of merge variable to use
103
  */
104
+ do_action( 'yikes-mailchimp-before-submission', $merge_variables );
105
+ do_action( "yikes-mailchimp-before-submission-{$form_id}", $merge_variables );
106
+
107
+ // Allow users to check for form values (using the `yikes-mailchimp-filter-before-submission` filter hook in function `get_submitted_merge_values`)
108
+ // and pass back an error and message to the user
109
+ // If error is set and no message, default to our class variable's default error message
110
+ if ( isset( $merge_variables['error'] ) ) {
111
+ $merge_error_message = isset( $merge_variables['message'] ) ? $merge_variables['message'] : $submission_handler->default_error_response_message;
112
+ $submission_handler->handle_merge_variables_error( $merge_variables['error'], $merge_error_message );
113
+ }
114
+
115
+ // This is the array we're going to pass through to the MailChimp API
116
+ $member_data = array(
117
+ 'email_address' => $sanitized_email,
118
+ 'merge_fields' => $merge_variables,
119
+ 'timestamp_opt' => current_time( 'Y-m-d H:i:s', 1 ),
120
+ 'status' => 'subscribed'
121
+ );
122
+
123
+ // Only add groups if they exist
124
+ if ( ! empty( $groups ) ) {
125
+ $member_data['interests'] = $groups;
126
+ }
127
+
128
+ // Check if this member already exists
129
+ $member_exists = $list_handler->get_member( $list_id, md5( strtolower( $sanitized_email ) ), $use_transient = true );
130
+
131
+ // If this member does not exist, then we need to add the status_if_new flag and set our $new_subscriber variable
132
+ if ( is_wp_error( $member_exists ) ) {
133
+
134
+ $new_subscriber = true;
135
+
136
+ // Check the opt-in value - is it double or single?
137
+ // Double opt-in means 'status_if_new' => 'pending'
138
+ $double_optin = isset( $optin_settings['optin'] ) ? (int) $optin_settings['optin'] : 0;
139
+
140
+ if ( $double_optin === 1 ) {
141
+
142
+ // Double opt-in
143
+ $member_data['status_if_new'] = 'pending';
144
  } else {
145
+
146
+ // Single opt-in
147
+ $member_data['status_if_new'] = 'subscribed';
148
  }
149
+
150
  } else {
 
 
151
 
152
+ // If this member already exists, then we need to go through our optin settings and run some more logic
153
+
154
+ // But first let's set our flag
155
+ $new_subscriber = false;
156
+
157
+ // Check our update_existing_user optin setting
158
+ $update_existing_user = ( $optin_settings['update_existing_user'] === '1' ) ? true : false;
159
+
160
+ // If update_existing_user is false (not allowed) then simply fail and return a response message
161
+ if ( $update_existing_user === false ) {
162
+ $submission_handler->handle_disallowed_existing_user_update();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
163
  }
164
 
165
+ // If update_existing_user is true, we need to check our 'send_update_email' option
166
+ $send_update_email = ( $optin_settings['send_update_email'] === '1' ) ? true : false;
167
+
168
+ // If $send_update_email is true (we send the email) then we need to fire off the 'send update email' logic
169
+ if ( $send_update_email === true ) {
170
+ $submission_handler->handle_updating_existing_user();
 
 
 
171
  }
172
+
173
+ // If $send_update_email is false (we don't send the email) then simply continue (we allow them to update their profile via only an email)
174
+ }
175
+
176
+ /**
177
+ * Filters for the subscribe body
178
+ *
179
+ * @since 6.3.0
180
+ *
181
+ * @param array | $member_data | Array of all the variables sent to the MailChimp API
182
+ * @param string | $form_id | The form ID
183
+ */
184
+ $member_data = apply_filters( 'yikes-mailchimp-filter-subscribe-request', $member_data, $form_id );
185
+ $member_data = apply_filters( "yikes-mailchimp-filter-subscribe-request-{$form_id}", $member_data, $form_id );
186
+
187
+ // Send the API request to create a new subscriber! (Or update an existing one)
188
+ $subscribe_response = $list_handler->member_subscribe( $list_id, md5( strtolower( $sanitized_email ) ), $member_data );
189
+
190
+ // Handle the response
191
+
192
+ // Was our submission successful or did it create an error?
193
+ if ( is_wp_error( $subscribe_response ) ) {
194
+ $submission_handler->handle_submission_response_error( $subscribe_response, $form_fields );
195
+ } else {
196
+ $submission_handler->handle_submission_response_success( $submission_settings, $page_data, $merge_variables, $notifications, $optin_settings, $new_subscriber );
197
+ }
198
 
199
+ // That's all folks.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
public/partials/shortcodes/process_form_shortcode.php CHANGED
@@ -207,8 +207,12 @@ function process_mailchimp_shortcode( $atts ) {
207
 
208
  // grab the last enqueued style, so we can use it as a dependency of our styles (for override)
209
  global $wp_styles;
210
- end( $wp_styles->groups );
211
- $last_key = key( $wp_styles->groups );
 
 
 
 
212
 
213
  /*
214
  * Check for the constant to prevent styles from loading
@@ -338,16 +342,25 @@ function process_mailchimp_shortcode( $atts ) {
338
  // Check for AJAX
339
  if( ( ! empty( $atts['ajax'] ) && $atts['ajax'] == 1 ) || $form_data['submission_settings']['ajax'] == 1 ) {
340
  // enqueue our ajax script
341
- wp_enqueue_script( 'yikes-easy-mc-ajax' , YIKES_MC_URL . 'public/js/yikes-mc-ajax-forms.min.js' , array( 'jquery' ) , YIKES_MC_VERSION, false );
 
342
  wp_localize_script( 'yikes-easy-mc-ajax', 'yikes_mailchimp_ajax', array(
343
  'ajax_url' => esc_url( admin_url( 'admin-ajax.php' ) ),
344
  'page_data' => $page_data,
345
  'interest_group_checkbox_error' => apply_filters( 'yikes-mailchimp-interest-group-checkbox-error', __( 'This field is required.', 'yikes-inc-easy-mailchimp-extender' ), $form_id ),
346
  'preloader_url' => apply_filters( 'yikes-mailchimp-preloader', esc_url_raw( admin_url( 'images/wpspin_light.gif' ) ) ),
347
  'loading_dots' => apply_filters( 'yikes-mailchimp-loading-dots', YIKES_MC_URL . 'includes/images/loading-dots.gif' ),
 
348
  ) );
349
  }
350
 
 
 
 
 
 
 
 
351
  /*
352
  * If a form was submitted, and the response was returned
353
  * let's display it back to the user
@@ -438,14 +451,16 @@ function process_mailchimp_shortcode( $atts ) {
438
 
439
  /* Store tag variable based on field type */
440
  if( isset( $field['merge'] ) ) {
 
441
  $tag = 'merge';
442
  } else {
 
443
  $tag = 'group_id';
444
  }
445
 
446
  // build up our array
447
  $field_array['id'] = 'id="yikes-easy-mc-form-' . $form_id . '-' . esc_attr( $field[$tag] ) . '" ';
448
- $field_array['name'] = 'name="' . esc_attr( $field[$tag] ) . '" ';
449
  $field_array['placeholder'] = isset( $field['placeholder'] ) ? 'placeholder="' . esc_attr( stripslashes( $field['placeholder'] ) ) . '" ' : '';
450
  $field_array['classes'] = 'class="yikes-easy-mc-'.$field['type'] . ' ' . esc_attr( trim( implode( ' ' , $custom_classes ) ) ) . '" ';
451
 
@@ -530,8 +545,11 @@ function process_mailchimp_shortcode( $atts ) {
530
  <script type="text/javascript">
531
  function properlyFormatURLField( e ) {
532
  var url_value = jQuery( e ).val();
533
- if( url_value.indexOf("http://") == '-1' ) {
 
 
534
  jQuery( e ).val( 'http://' + url_value );
 
535
  }
536
  }
537
  </script>
@@ -585,7 +603,7 @@ function process_mailchimp_shortcode( $atts ) {
585
  </span>
586
  <?php } ?>
587
 
588
- <input <?php echo implode( ' ' , $field_array ); ?> type="text" <?php if( $phone_format != 'US' ) { ?> title="<?php _e( 'International Phone Number' , 'yikes-inc-easy-mailchimp-extender' ); ?>" pattern="<?php echo apply_filters( 'yikes-mailchimp-international-phone-pattern' , '[0-9,-]{1,}' ); ?>" <?php } else { ?> title="<?php _e( 'US Phone Number (###) ### - ####' , 'yikes-inc-easy-mailchimp-extender' ); ?>" pattern="<?php echo apply_filters( 'yikes-mailchimp-us-phone-pattern' , '^(\([0-9]{3}\)|[0-9]{3}-)[0-9]{3}-[0-9]{4}$' ); ?>" onblur="formatUSPhoneNumber(this);"<?php } ?> value="<?php if( isset( $_POST[$field['merge']] ) && $form_submitted != 1 ) { echo $_POST[$field['merge']]; } else { echo esc_attr( $default_value ); } ?>">
589
 
590
  <!-- description -->
591
  <?php if( isset( $field['description'] ) && trim( $field['description'] ) != '' ) { ?>
@@ -652,6 +670,12 @@ function process_mailchimp_shortcode( $atts ) {
652
  }
653
  }
654
 
 
 
 
 
 
 
655
  switch( $type ) {
656
 
657
  default:
@@ -669,9 +693,8 @@ function process_mailchimp_shortcode( $atts ) {
669
  <?php echo ucwords( apply_filters( 'yikes-mailchimp-address-'.$type.'-label' , esc_attr( $label ) ) ); ?>
670
  </span>
671
  <?php } ?>
672
-
673
-
674
- <input <?php echo implode( ' ' , $field_array ); ?> type="text" value="<?php if( isset( $_POST[$field['merge']] ) && $form_submitted != 1 ) { echo $_POST[$field['merge']]; } ?>">
675
 
676
  </label>
677
  <?php
@@ -711,7 +734,21 @@ function process_mailchimp_shortcode( $atts ) {
711
  </span>
712
  <?php } ?>
713
 
714
- <input <?php echo implode( ' ' , $field_array ); ?> type="text" pattern="<?php echo apply_filters( 'yikes-mailchimp-zip-pattern', '\d{5,5}(-\d{4,4})?' ); ?>" title="<?php _e( '5 digit zip code, numbers only' , 'yikes-inc-easy-mailchimp-extender' ); ?>" value="<?php if( isset( $_POST[$field['merge']] ) && $form_submitted != 1 ) { echo $_POST[$field['merge']]; } else { echo esc_attr( $default_value ); } ?>">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
715
 
716
  </label>
717
  <?php
@@ -790,7 +827,7 @@ function process_mailchimp_shortcode( $atts ) {
790
  switch ( $field['type'] ) {
791
  default:
792
  case 'date':
793
- $date_format = ( isset( $field['date_format'] ) ) ? $field['date_format'] : 'mm/dd/yy';
794
  break;
795
 
796
  case 'birthday':
@@ -886,7 +923,7 @@ function process_mailchimp_shortcode( $atts ) {
886
  break;
887
 
888
  case 'dropdown':
889
- $default_value = $field['default_choice'];
890
  // store empty number for looping
891
  $x = 0;
892
  // hidden labels
@@ -904,8 +941,18 @@ function process_mailchimp_shortcode( $atts ) {
904
  <?php
905
  // decode for looping
906
  $choices = json_decode( $field['choices'], true );
907
- foreach( $choices as $choice ) {
908
- ?><option value="<?php echo $choice; ?>" <?php selected( $default_value , $x ); ?>><?php echo esc_attr( stripslashes( $choice ) ); ?></option><?php
 
 
 
 
 
 
 
 
 
 
909
  $x++;
910
  }
911
  ?>
@@ -931,12 +978,16 @@ function process_mailchimp_shortcode( $atts ) {
931
  // remove the ID (as to not assign the same ID to every radio button)
932
  unset( $field_array['id'] );
933
  $choices = json_decode( $field['choices'], true );
 
934
  // assign a default choice
935
- $default_value = ( isset( $field['default_choice'] ) && $field['default_choice'] != '' ) ? $field['default_choice'] : $choices[0];
936
- // if the form was submit, but failed, let's reset the post data
937
- if( isset( $_POST[$field['merge']] ) && $form_submitted != 1 ) {
938
- $default_value = $_POST[$field['merge']];
 
 
939
  }
 
940
  $count = count( $choices );
941
  $i = 1;
942
  $x = 0;
@@ -956,7 +1007,12 @@ function process_mailchimp_shortcode( $atts ) {
956
  foreach( $choices as $choice ) {
957
  ?>
958
  <label for="<?php echo esc_attr( $field['merge'] ) . '-' . $i; ?>" class="yikes-easy-mc-checkbox-label <?php echo implode( ' ' , $custom_classes ); if( $i === $count ) { ?> last-selection<?php } ?>" <?php if( $i == 1 ) { echo $field_array['required']; } ?>>
959
- <input type="<?php echo esc_attr( $field['type'] ); ?>" name="<?php echo $field['merge']; ?>" id="<?php echo $field['merge'] . '-' . $i; ?>" <?php checked( $default_value , $x ); ?> value="<?php echo esc_attr( $choice ); ?>">
 
 
 
 
 
960
  <span class="<?php echo esc_attr( $field['merge'] ). '-label'; ?>"><?php echo stripslashes( $choice ); ?></span>
961
  </label>
962
  <?php
@@ -980,16 +1036,11 @@ function process_mailchimp_shortcode( $atts ) {
980
 
981
  }
982
 
983
- } else { // loop over interest groups
984
-
985
 
986
- // store default choice
987
- $default_choice = ( isset( $field['default_choice'] ) && ! empty( $field['default_choice'] ) ) ? ( is_array( $field['default_choice'] ) ? $field['default_choice'] : $field['default_choice'] ) : ( isset( $field['default_choice'] ) ? $field['default_choice'] : '' );
988
-
989
- // if the form was submit, but failed, let's reset the post data
990
- if( isset( $_POST[$field['group_id']] ) && $form_submitted != 1 ) {
991
- $default_choice = $_POST[$field['group_id']];
992
- }
993
 
994
  // get our groups
995
  $groups = ( isset( $field['groups'] ) && ! empty( $field['groups'] ) ) ? json_decode( $field['groups'], true ) : array();
@@ -1031,21 +1082,26 @@ function process_mailchimp_shortcode( $atts ) {
1031
  }
1032
  }
1033
 
 
1034
 
 
 
1035
 
1036
- foreach( $groups as $group ) {
1037
- if( $field['type'] == 'checkboxes' ) {
1038
- /* Setup the defaults for this field - varies if the field was previously submitted */
1039
- if( isset( $_POST[$field['group_id']] ) && $form_submitted != 1 ) {
1040
- $default_choice = $_POST[$field['group_id']];
1041
- } elseif( ( ! isset( $_POST['yikes-mailchimp-honeypot'] ) && $form_submitted != 1 ) || ( isset( $_POST['yikes-mailchimp-honeypot'] ) && $form_submitted == 1 ) ) {
1042
- $default_choice = ( isset( $field['default_choice'] ) && ! empty( $field['default_choice'] ) ) ? ( is_array( $field['default_choice'] ) ? $field['default_choice'] : $field['default_choice'] ) : array();
1043
- }
1044
  }
 
1045
  ?>
1046
  <label for="<?php echo $field['group_id'] . '-' . $i; ?>" class="yikes-easy-mc-checkbox-label <?php echo implode( ' ' , $custom_classes ); if( $x === $count ) { ?> last-selection<?php } ?>">
1047
- <input <?php if( isset( $field['require'] ) && $field['require'] == 1 ) { ?> class="yikes-interest-group-required" <?php } ?> type="<?php echo $type; ?>" name="<?php echo $field['group_id']; ?>[]" id="<?php echo $field['group_id'] . '-' . $i; ?>" <?php if( $field['type'] == 'checkboxes' ) { if( ( ( isset( $_POST['yikes-mailchimp-honeypot' ] ) && $form_submitted == 1 && in_array( $i , $default_choice )) || ! isset( $_POST['yikes-mailchimp-honeypot' ] ) && $form_submitted != 1 && in_array( $i , $default_choice ) ) || ( ( $form_submitted != 1 && isset( $_POST[$field['group_id']] ) ) && in_array( esc_attr( $group['name'] ), $default_choice ) ) ) { echo 'checked="checked"'; } } else { checked( ( isset( $default_choice ) && is_array( $default_choice ) ) ? $default_choice[0] : $default_choice , $i ); } ?> value="<?php echo esc_attr( $group['name'] ); ?>">
1048
- <?php echo $group['name']; ?>
 
 
 
 
 
 
 
1049
  </label>
1050
  <?php
1051
  $i++;
@@ -1081,9 +1137,22 @@ function process_mailchimp_shortcode( $atts ) {
1081
  <select <?php echo implode( ' ' , $field_array ); ?>>
1082
  <?php
1083
  $i = 0;
1084
- foreach( $groups as $group ) {
1085
- ?><option <?php selected( $i , $default_choice ); ?> value="<?php echo $group['name']; ?>"><?php echo esc_attr( $group['name'] ); ?></option><?php
1086
- $i++;
 
 
 
 
 
 
 
 
 
 
 
 
 
1087
  }
1088
  ?>
1089
  </select>
@@ -1160,13 +1229,13 @@ function process_mailchimp_shortcode( $atts ) {
1160
  }
1161
  ?>
1162
 
1163
- <!-- Honepot Trap -->
1164
  <input type="hidden" name="yikes-mailchimp-honeypot" id="yikes-mailchimp-honeypot" value="">
1165
 
1166
  <!-- List ID -->
1167
  <input type="hidden" name="yikes-mailchimp-associated-list-id" id="yikes-mailchimp-associated-list-id" value="<?php echo $form_data['list_id']; ?>">
1168
 
1169
- <!-- Form that is being submitted! Used to display error/success messages above the correct form -->
1170
  <input type="hidden" name="yikes-mailchimp-submitted-form" id="yikes-mailchimp-submitted-form" value="<?php echo $form_id; ?>">
1171
 
1172
  <!-- Submit Button -->
@@ -1182,7 +1251,7 @@ function process_mailchimp_shortcode( $atts ) {
1182
  }
1183
  // display the image or text based button
1184
  if( $submit_button_type == 'text' ) {
1185
- echo apply_filters( 'yikes-mailchimp-form-submit-button', '<button type="submit" class="' . apply_filters( 'yikes-mailchimp-form-submit-button-classes', 'yikes-easy-mc-submit-button yikes-easy-mc-submit-button-' . esc_attr( $form_data['id'] ) . ' btn btn-primary' . $submit_button_classes . $admin_class, $form_data['id'] ) . '">' . apply_filters( 'yikes-mailchimp-form-submit-button-text', esc_attr( stripslashes( $submit ) ), $form_data['id'] ) . '</button>', $form_data['id'] );
1186
  } else {
1187
  echo apply_filters( 'yikes-mailchimp-form-submit-button', '<input type="image" alt="' . apply_filters( 'yikes-mailchimp-form-submit-button-text', esc_attr( stripslashes( $submit ) ), $form_data['id'] ) . '" src="' . $submit_button_image . '" class="' . apply_filters( 'yikes-mailchimp-form-submit-button-classes', 'yikes-easy-mc-submit-button yikes-easy-mc-submit-button-image yikes-easy-mc-submit-button-' . esc_attr( $form_data['id'] ) . ' btn btn-primary' . $submit_button_classes . $admin_class, $form_data['id'] ) . '">', $form_data['id'] );
1188
  }
@@ -1194,7 +1263,7 @@ function process_mailchimp_shortcode( $atts ) {
1194
  <?php wp_nonce_field( 'yikes_easy_mc_form_submit', 'yikes_easy_mc_new_subscriber' ); ?>
1195
 
1196
  </form>
1197
- <!-- MailChimp Form generated using Easy Forms for MailChimp v<?php echo YIKES_MC_VERSION; ?> by YIKES, Inc. (https://wordpress.org/plugins/yikes-inc-easy-mailchimp-extender/) -->
1198
 
1199
  <?php
1200
  /* If the current user is logged in, and an admin...lets display our 'Edit Form' link */
207
 
208
  // grab the last enqueued style, so we can use it as a dependency of our styles (for override)
209
  global $wp_styles;
210
+
211
+ $last_key = '';
212
+ if ( isset( $wp_styles ) && isset( $wp_styles->groups ) ) {
213
+ end( $wp_styles->groups );
214
+ $last_key = key( $wp_styles->groups );
215
+ }
216
 
217
  /*
218
  * Check for the constant to prevent styles from loading
342
  // Check for AJAX
343
  if( ( ! empty( $atts['ajax'] ) && $atts['ajax'] == 1 ) || $form_data['submission_settings']['ajax'] == 1 ) {
344
  // enqueue our ajax script
345
+ $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
346
+ wp_enqueue_script( 'yikes-easy-mc-ajax' , YIKES_MC_URL . "public/js/yikes-mc-ajax-forms{$min}.js" , array( 'jquery' ) , YIKES_MC_VERSION, false );
347
  wp_localize_script( 'yikes-easy-mc-ajax', 'yikes_mailchimp_ajax', array(
348
  'ajax_url' => esc_url( admin_url( 'admin-ajax.php' ) ),
349
  'page_data' => $page_data,
350
  'interest_group_checkbox_error' => apply_filters( 'yikes-mailchimp-interest-group-checkbox-error', __( 'This field is required.', 'yikes-inc-easy-mailchimp-extender' ), $form_id ),
351
  'preloader_url' => apply_filters( 'yikes-mailchimp-preloader', esc_url_raw( admin_url( 'images/wpspin_light.gif' ) ) ),
352
  'loading_dots' => apply_filters( 'yikes-mailchimp-loading-dots', YIKES_MC_URL . 'includes/images/loading-dots.gif' ),
353
+ 'ajax_security_nonce' => wp_create_nonce( 'yikes_mc_form_submission_security_nonce' ),
354
  ) );
355
  }
356
 
357
+ // If update account details is set, we need to include our script to send out the update email
358
+ wp_enqueue_script( 'update-existing-subscriber.js', YIKES_MC_URL . 'public/js/yikes-update-existing-subscriber.min.js' , array( 'jquery' ), 'all' );
359
+ wp_localize_script( 'update-existing-subscriber.js', 'update_subscriber_details_data', array(
360
+ 'ajax_url' => esc_url( admin_url( 'admin-ajax.php' ) ),
361
+ 'preloader_url' => apply_filters( 'yikes-mailchimp-preloader', esc_url_raw( admin_url( 'images/wpspin_light.gif' ) ) ),
362
+ ) );
363
+
364
  /*
365
  * If a form was submitted, and the response was returned
366
  * let's display it back to the user
451
 
452
  /* Store tag variable based on field type */
453
  if( isset( $field['merge'] ) ) {
454
+ $group = '';
455
  $tag = 'merge';
456
  } else {
457
+ $group = 'group-';
458
  $tag = 'group_id';
459
  }
460
 
461
  // build up our array
462
  $field_array['id'] = 'id="yikes-easy-mc-form-' . $form_id . '-' . esc_attr( $field[$tag] ) . '" ';
463
+ $field_array['name'] = 'name="' . $group . esc_attr( $field[ $tag ] ) . '" ';
464
  $field_array['placeholder'] = isset( $field['placeholder'] ) ? 'placeholder="' . esc_attr( stripslashes( $field['placeholder'] ) ) . '" ' : '';
465
  $field_array['classes'] = 'class="yikes-easy-mc-'.$field['type'] . ' ' . esc_attr( trim( implode( ' ' , $custom_classes ) ) ) . '" ';
466
 
545
  <script type="text/javascript">
546
  function properlyFormatURLField( e ) {
547
  var url_value = jQuery( e ).val();
548
+
549
+ if ( url_value.indexOf( "http://" ) === -1 && url_value.indexOf( "https://" ) === -1 ) {
550
+
551
  jQuery( e ).val( 'http://' + url_value );
552
+
553
  }
554
  }
555
  </script>
603
  </span>
604
  <?php } ?>
605
 
606
+ <input <?php echo implode( ' ' , $field_array ); ?> type="text" <?php if( $phone_format != 'US' ) { ?> title="<?php _e( 'International Phone Number' , 'yikes-inc-easy-mailchimp-extender' ); ?>" pattern="<?php echo apply_filters( 'yikes-mailchimp-international-phone-pattern' , '[0-9,-,+]{1,}' ); ?>" <?php } else { ?> title="<?php _e( 'US Phone Number (###) ### - ####' , 'yikes-inc-easy-mailchimp-extender' ); ?>" pattern="<?php echo apply_filters( 'yikes-mailchimp-us-phone-pattern' , '^(\([0-9]{3}\)|[0-9]{3}-)[0-9]{3}-[0-9]{4}$' ); ?>" onblur="formatUSPhoneNumber(this);"<?php } ?> value="<?php if( isset( $_POST[$field['merge']] ) && $form_submitted != 1 ) { echo $_POST[$field['merge']]; } else { echo esc_attr( $default_value ); } ?>">
607
 
608
  <!-- description -->
609
  <?php if( isset( $field['description'] ) && trim( $field['description'] ) != '' ) { ?>
670
  }
671
  }
672
 
673
+ // Never force addr2 to be required
674
+ if ( $type === 'addr2' ) {
675
+ $addr2_field_array = $field_array;
676
+ $addr2_field_array['required'] = apply_filters( 'yikes-mailchimp-address-2-required', '', $form_id );
677
+ }
678
+
679
  switch( $type ) {
680
 
681
  default:
693
  <?php echo ucwords( apply_filters( 'yikes-mailchimp-address-'.$type.'-label' , esc_attr( $label ) ) ); ?>
694
  </span>
695
  <?php } ?>
696
+
697
+ <input <?php if ( $type === 'addr2' ) { echo implode( ' ' , $addr2_field_array ); } else { echo implode( ' ' , $field_array ); } ?> type="text" value="<?php if( isset( $_POST[$field['merge']][$type] ) && $form_submitted != 1 ) { echo $_POST[$field['merge']][$type]; } ?>">
 
698
 
699
  </label>
700
  <?php
734
  </span>
735
  <?php } ?>
736
 
737
+ <?php
738
+ // If zip lookup plugin is installed, the ZIP field comes back as an array and we need to handle it differently...
739
+ $zip_value_to_echo = '';
740
+ if( isset( $_POST[$field['merge']] ) && $form_submitted != 1 ) {
741
+ if ( is_array( $_POST[$field['merge']] ) && isset( $_POST[$field['merge']]['zip'] ) ) {
742
+ $zip_value_to_echo = $_POST[$field['merge']]['zip'];
743
+ } else {
744
+ $zip_value_to_echo = $_POST[$field['merge']];
745
+ }
746
+ } else {
747
+ $zip_value_to_echo = esc_attr( $default_value );
748
+ }
749
+ ?>
750
+
751
+ <input <?php echo implode( ' ' , $field_array ); ?> type="text" pattern="<?php echo apply_filters( 'yikes-mailchimp-zip-pattern', '\d{5,5}(-\d{4,4})?' ); ?>" title="<?php _e( '5 digit zip code, numbers only' , 'yikes-inc-easy-mailchimp-extender' ); ?>" value="<?php echo $zip_value_to_echo ?>">
752
 
753
  </label>
754
  <?php
827
  switch ( $field['type'] ) {
828
  default:
829
  case 'date':
830
+ $date_format = ( isset( $field['date_format'] ) ) ? $field['date_format'] : 'mm/dd';
831
  break;
832
 
833
  case 'birthday':
923
  break;
924
 
925
  case 'dropdown':
926
+ $default_choice = ( is_array( $field['default_choice'] ) ) ? $field['default_choice'] : array( $field['default_choice'] );
927
  // store empty number for looping
928
  $x = 0;
929
  // hidden labels
941
  <?php
942
  // decode for looping
943
  $choices = json_decode( $field['choices'], true );
944
+
945
+ // If the form was submitted, but failed, let's default to the chosen option
946
+ if( isset( $_POST[ $field['merge'] ] ) && $form_submitted === 0 ) {
947
+ $default_choice = is_array( $_POST[ $field['merge'] ] ) ? $_POST[ $field['merge'] ] : array( $_POST[ $field['merge'] ] );
948
+ }
949
+
950
+ foreach( $choices as $choice ) { ?>
951
+ <option
952
+ value="<?php echo $choice; ?>"
953
+ <?php if ( in_array( $x, $default_choice ) || in_array( $choice, $default_choice ) ) { echo 'selected="selected"'; } ?>>
954
+ <?php echo esc_attr( stripslashes( $choice ) ); ?>
955
+ </option><?php
956
  $x++;
957
  }
958
  ?>
978
  // remove the ID (as to not assign the same ID to every radio button)
979
  unset( $field_array['id'] );
980
  $choices = json_decode( $field['choices'], true );
981
+
982
  // assign a default choice
983
+ $default_choice = ( isset( $field['default_choice'] ) && ! empty( $field['default_choice'] ) ) ? $field['default_choice'] : $choices[0];
984
+ $default_choice = ( is_array( $default_choice ) ) ? $default_choice : array( $default_choice );
985
+
986
+ // If the form was submitted, but failed, let's default to the chosen option
987
+ if( isset( $_POST[ $field['merge'] ] ) && $form_submitted === 0 ) {
988
+ $default_choice = is_array( $_POST[ $field['merge'] ] ) ? $_POST[ $field['merge'] ] : array( $_POST[ $field['merge'] ] );
989
  }
990
+
991
  $count = count( $choices );
992
  $i = 1;
993
  $x = 0;
1007
  foreach( $choices as $choice ) {
1008
  ?>
1009
  <label for="<?php echo esc_attr( $field['merge'] ) . '-' . $i; ?>" class="yikes-easy-mc-checkbox-label <?php echo implode( ' ' , $custom_classes ); if( $i === $count ) { ?> last-selection<?php } ?>" <?php if( $i == 1 ) { echo $field_array['required']; } ?>>
1010
+ <input
1011
+ type="<?php echo esc_attr( $field['type'] ); ?>"
1012
+ name="<?php echo $field['merge']; ?>"
1013
+ id="<?php echo $field['merge'] . '-' . $i; ?>"
1014
+ <?php if ( in_array( $x, $default_choice ) || in_array( $choice, $default_choice ) ) { echo 'checked="checked"'; } ?>
1015
+ value="<?php echo esc_attr( $choice ); ?>">
1016
  <span class="<?php echo esc_attr( $field['merge'] ). '-label'; ?>"><?php echo stripslashes( $choice ); ?></span>
1017
  </label>
1018
  <?php
1036
 
1037
  }
1038
 
1039
+ } else { // Loop over interest groups
 
1040
 
1041
+ // Get the default choice(s) from the field settings and turn them into an array if not already
1042
+ $default_choice = ( isset( $field['default_choice'] ) ) ? $field['default_choice'] : '';
1043
+ $default_choice = ( is_array( $default_choice ) ) ? $default_choice : array( $default_choice );
 
 
 
 
1044
 
1045
  // get our groups
1046
  $groups = ( isset( $field['groups'] ) && ! empty( $field['groups'] ) ) ? json_decode( $field['groups'], true ) : array();
1082
  }
1083
  }
1084
 
1085
+ foreach ( $groups as $group_id => $name ) {
1086
 
1087
+ // If the form was submitted and failed, set the submitted/chosen values as the default
1088
+ if( isset( $_POST[ 'group-' . $field['group_id'] ] ) && $form_submitted === 0 ) {
1089
 
1090
+ // Format default choice as array
1091
+ $default_choice = ( is_array( $_POST[ 'group-' . $field['group_id'] ] ) ) ? $_POST[ 'group-' . $field['group_id'] ] : array( $_POST[ 'group-' . $field['group_id'] ] );
 
 
 
 
 
 
1092
  }
1093
+
1094
  ?>
1095
  <label for="<?php echo $field['group_id'] . '-' . $i; ?>" class="yikes-easy-mc-checkbox-label <?php echo implode( ' ' , $custom_classes ); if( $x === $count ) { ?> last-selection<?php } ?>">
1096
+ <input
1097
+ <?php if( isset( $field['require'] ) && $field['require'] == 1 ) { if ( $field['type'] !== 'checkboxes' ) { ?> required="required" <?php } ?>
1098
+ class="yikes-interest-group-required" <?php } ?>
1099
+ type="<?php echo $type; ?>"
1100
+ name="group-<?php echo $field['group_id']; ?>[]"
1101
+ id="<?php echo $field['group_id'] . '-' . $i; ?>"
1102
+ <?php if ( in_array( $group_id, $default_choice ) ) { echo 'checked="checked"'; } ?>
1103
+ value="<?php echo $group_id; ?>">
1104
+ <?php echo $name; ?>
1105
  </label>
1106
  <?php
1107
  $i++;
1137
  <select <?php echo implode( ' ' , $field_array ); ?>>
1138
  <?php
1139
  $i = 0;
1140
+ foreach( $groups as $group_id => $name ) {
1141
+
1142
+ // If the form was submitted and failed, set the submitted/chosen values as the default
1143
+ if( isset( $_POST[ 'group-' . $field['group_id'] ] ) && $form_submitted === 0 ) {
1144
+
1145
+ // Format default choice as array
1146
+ $default_choice = ( is_array( $_POST[ 'group-' . $field['group_id'] ] ) ) ? $_POST[ 'group-' . $field['group_id'] ] : array( $_POST[ 'group-' . $field['group_id'] ] );
1147
+ }
1148
+ ?>
1149
+ <option
1150
+ <?php if ( in_array( $group_id, $default_choice ) ) { echo 'selected="selected"'; } ?>
1151
+ value="<?php echo $group_id; ?>">
1152
+ <?php echo esc_attr( $name ); ?>
1153
+ </option>
1154
+ <?php
1155
+ $i++;
1156
  }
1157
  ?>
1158
  </select>
1229
  }
1230
  ?>
1231
 
1232
+ <!-- Honeypot Trap -->
1233
  <input type="hidden" name="yikes-mailchimp-honeypot" id="yikes-mailchimp-honeypot" value="">
1234
 
1235
  <!-- List ID -->
1236
  <input type="hidden" name="yikes-mailchimp-associated-list-id" id="yikes-mailchimp-associated-list-id" value="<?php echo $form_data['list_id']; ?>">
1237
 
1238
+ <!-- The form that is being submitted! Used to display error/success messages above the correct form -->
1239
  <input type="hidden" name="yikes-mailchimp-submitted-form" id="yikes-mailchimp-submitted-form" value="<?php echo $form_id; ?>">
1240
 
1241
  <!-- Submit Button -->
1251
  }
1252
  // display the image or text based button
1253
  if( $submit_button_type == 'text' ) {
1254
+ echo apply_filters( 'yikes-mailchimp-form-submit-button', '<button type="submit" class="' . apply_filters( 'yikes-mailchimp-form-submit-button-classes', 'yikes-easy-mc-submit-button yikes-easy-mc-submit-button-' . esc_attr( $form_data['id'] ) . ' btn btn-primary' . $submit_button_classes . $admin_class, $form_data['id'] ) . '"> <span class="yikes-mailchimp-submit-button-span-text">' . apply_filters( 'yikes-mailchimp-form-submit-button-text', esc_attr( stripslashes( $submit ) ), $form_data['id'] ) . '</span></button>', $form_data['id'] );
1255
  } else {
1256
  echo apply_filters( 'yikes-mailchimp-form-submit-button', '<input type="image" alt="' . apply_filters( 'yikes-mailchimp-form-submit-button-text', esc_attr( stripslashes( $submit ) ), $form_data['id'] ) . '" src="' . $submit_button_image . '" class="' . apply_filters( 'yikes-mailchimp-form-submit-button-classes', 'yikes-easy-mc-submit-button yikes-easy-mc-submit-button-image yikes-easy-mc-submit-button-' . esc_attr( $form_data['id'] ) . ' btn btn-primary' . $submit_button_classes . $admin_class, $form_data['id'] ) . '">', $form_data['id'] );
1257
  }
1263
  <?php wp_nonce_field( 'yikes_easy_mc_form_submit', 'yikes_easy_mc_new_subscriber' ); ?>
1264
 
1265
  </form>
1266
+ <!-- MailChimp Form generated by Easy Forms for MailChimp v<?php echo YIKES_MC_VERSION; ?> (https://wordpress.org/plugins/yikes-inc-easy-mailchimp-extender/) -->
1267
 
1268
  <?php
1269
  /* If the current user is logged in, and an admin...lets display our 'Edit Form' link */
public/partials/shortcodes/templates/state-dropdown.php CHANGED
@@ -1,3 +1,4 @@
 
1
  <option value="AL">Alabama</option>
2
  <option value="AK">Alaska</option>
3
  <option value="AZ">Arizona</option>
@@ -48,4 +49,4 @@
48
  <option value="WA">Washington</option>
49
  <option value="WV">West Virginia</option>
50
  <option value="WI">Wisconsin</option>
51
- <option value="WY">Wyoming</option>
1
+ <option value="">---</option>
2
  <option value="AL">Alabama</option>
3
  <option value="AK">Alaska</option>
4
  <option value="AZ">Arizona</option>
49
  <option value="WA">Washington</option>
50
  <option value="WV">West Virginia</option>
51
  <option value="WI">Wisconsin</option>
52
+ <option value="WY">Wyoming</option>
public/partials/shortcodes/yikes-mailchimp-subscriber-count.php CHANGED
@@ -8,30 +8,34 @@
8
  function yikes_mailchimp_subscriber_count_shortcode( $attributes ) {
9
 
10
  // Attributes
11
- extract( shortcode_atts(
12
  array(
13
  'form' => '', // pass in a form, which will retreive the associated list ID -- takes precendence
14
  'list' => '', // pass in a specific list ID
15
- ), $attributes , 'yikes-mailchimp-subscriber-count' )
 
 
16
  );
17
 
18
  /* If the user hasn't authenticated yet - bail */
19
- if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) != 'valid_api_key' ) {
20
- if( WP_DEBUG ) {
21
  return '<strong>' . __( "You don't appear to be connected to MailChimp.", "yikes-inc-easy-mailchimp-extender" ) . '</strong>';
22
  }
23
- return;
 
24
  }
25
 
26
- $form = ( ! empty( $attributes['form'] ) ) ? str_replace( '&quot;', '', $attributes['form'] ) : false; // replace the sanitize quotes to perform a proper query
27
  $list_id = ( ! empty( $attributes['list'] ) ) ? $attributes['list'] : false;
28
 
29
  /* If no list ID was passed into the shortcode - bail */
30
- if( ! $list_id && ! $form) {
31
- if( WP_DEBUG ) {
32
  return '<strong>' . __( 'You forgot to include the list or form ID.', 'yikes-inc-easy-mailchimp-extender' ) . '</strong>';
33
  }
34
- return;
 
35
  }
36
 
37
  /* if a form ID and a list ID were passed in, use the form ID */
@@ -40,11 +44,12 @@ function yikes_mailchimp_subscriber_count_shortcode( $attributes ) {
40
  $form_data = $interface->get_form( $form );
41
 
42
  // confirm we have some results, or return an error
43
- if( ! $form_data ) {
44
- if( WP_DEBUG ) {
45
- return __( "Oh no...This form doesn't exist. Head back to the manage forms page and select a different form." , 'yikes-inc-easy-mailchimp-extender' );
46
  }
47
- return;
 
48
  }
49
 
50
  $list_id = sanitize_key( $form_data['list_id'] ); // associated list id (users who fill out the form will be subscribed to this list)
@@ -54,51 +59,22 @@ function yikes_mailchimp_subscriber_count_shortcode( $attributes ) {
54
  ob_start();
55
 
56
  // submit the request the get the subscriber count
57
- try {
58
-
59
- // get the api key
60
- $api_key = yikes_get_mc_api_key();
61
- $dash_position = strpos( $api_key, '-' );
62
- if( $dash_position !== false ) {
63
- $api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/list.json';
64
- }
65
-
66
- // run the request
67
- $subscriber_count_response = wp_remote_post( $api_endpoint, array(
68
- 'body' => apply_filters( 'yikes-mailchimp-user-subscriber-count-api-request', array(
69
- 'apikey' => $api_key,
70
- 'filters' => array(
71
- 'list_id' => $list_id,
72
- ),
73
- ), $list_id ),
74
- 'timeout' => 10,
75
- 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true )
76
- ) );
77
-
78
- $subscriber_count_response = json_decode( wp_remote_retrieve_body( $subscriber_count_response ), true );
79
- if( isset( $subscriber_count_response['error'] ) ) {
80
- if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) {
81
- require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php';
82
- $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
83
- $error_logging->yikes_easy_mailchimp_write_to_error_log( $subscriber_count_response['error'], __( "Get Account Lists" , 'yikes-inc-easy-mailchimp-extender' ), "yikes-mailchimp-subscriber-count.php" );
84
- }
85
- }
86
- // if more than one list is returned, something went wrong - bail
87
- if( $subscriber_count_response['total'] != 1 ) {
88
- if( WP_DEBUG ) {
89
- return '<strong>' . sprintf( __( "It looks like this list wasn't found. Double check the list with with ID '%s' exists.", "yikes-inc-easy-mailchimp-extender" ), $list_id ) . '</strong>';
90
- }
91
- return;
92
- }
93
-
94
- /* type cast the returned value as an integer */
95
- echo (int) apply_filters( 'yikes-mailchimp-subscriber-count-value', $subscriber_count_response['data'][0]['stats']['member_count'] );
96
-
97
- } catch ( Exception $error ) {
98
- echo $error->getMessage();
99
  }
100
 
 
 
 
101
  return ob_get_clean();
102
 
103
  }
 
104
  add_shortcode( 'yikes-mailchimp-subscriber-count', 'yikes_mailchimp_subscriber_count_shortcode' );
8
  function yikes_mailchimp_subscriber_count_shortcode( $attributes ) {
9
 
10
  // Attributes
11
+ shortcode_atts(
12
  array(
13
  'form' => '', // pass in a form, which will retreive the associated list ID -- takes precendence
14
  'list' => '', // pass in a specific list ID
15
+ ),
16
+ $attributes,
17
+ 'yikes-mailchimp-subscriber-count'
18
  );
19
 
20
  /* If the user hasn't authenticated yet - bail */
21
+ if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) != 'valid_api_key' ) {
22
+ if ( WP_DEBUG ) {
23
  return '<strong>' . __( "You don't appear to be connected to MailChimp.", "yikes-inc-easy-mailchimp-extender" ) . '</strong>';
24
  }
25
+
26
+ return '';
27
  }
28
 
29
+ $form = ( ! empty( $attributes['form'] ) ) ? str_replace( '&quot;', '', $attributes['form'] ) : false;
30
  $list_id = ( ! empty( $attributes['list'] ) ) ? $attributes['list'] : false;
31
 
32
  /* If no list ID was passed into the shortcode - bail */
33
+ if ( ! $list_id && ! $form ) {
34
+ if ( WP_DEBUG ) {
35
  return '<strong>' . __( 'You forgot to include the list or form ID.', 'yikes-inc-easy-mailchimp-extender' ) . '</strong>';
36
  }
37
+
38
+ return '';
39
  }
40
 
41
  /* if a form ID and a list ID were passed in, use the form ID */
44
  $form_data = $interface->get_form( $form );
45
 
46
  // confirm we have some results, or return an error
47
+ if ( ! $form_data ) {
48
+ if ( WP_DEBUG ) {
49
+ return __( "Oh no...This form doesn't exist. Head back to the manage forms page and select a different form.", 'yikes-inc-easy-mailchimp-extender' );
50
  }
51
+
52
+ return '';
53
  }
54
 
55
  $list_id = sanitize_key( $form_data['list_id'] ); // associated list id (users who fill out the form will be subscribed to this list)
59
  ob_start();
60
 
61
  // submit the request the get the subscriber count
62
+ $list_data = yikes_get_mc_api_manager()->get_list_handler()->get_list( $list_id, array( 'stats.member_count' => true ) );
63
+
64
+ if ( is_wp_error( $list_data ) ) {
65
+ $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
66
+ $error_logging->maybe_write_to_log(
67
+ $list_data->get_error_code(),
68
+ __( "Get Account Lists", 'yikes-inc-easy-mailchimp-extender' ),
69
+ "yikes-mailchimp-subscriber-count.php"
70
+ );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
  }
72
 
73
+ /* type cast the returned value as an integer */
74
+ echo (int) apply_filters( 'yikes-mailchimp-subscriber-count-value', $list_data['stats']['member_count'] );
75
+
76
  return ob_get_clean();
77
 
78
  }
79
+
80
  add_shortcode( 'yikes-mailchimp-subscriber-count', 'yikes_mailchimp_subscriber_count_shortcode' );
readme.md CHANGED
@@ -2,7 +2,7 @@
2
  [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/yikesinc/yikes-inc-easy-mailchimp-extender/badges/quality-score.png?b=staging)](https://scrutinizer-ci.com/g/yikesinc/yikes-inc-easy-mailchimp-extender/?branch=staging)
3
  [![Code Coverage](https://scrutinizer-ci.com/g/yikesinc/yikes-inc-easy-mailchimp-extender/badges/coverage.png?b=staging)](https://scrutinizer-ci.com/g/yikesinc/yikes-inc-easy-mailchimp-extender/?branch=staging)
4
  [![Build Status](https://scrutinizer-ci.com/g/yikesinc/yikes-inc-easy-mailchimp-extender/badges/build.png?b=staging)](https://scrutinizer-ci.com/g/yikesinc/yikes-inc-easy-mailchimp-extender/build-status/staging)
5
- YIKES Inc. Easy Forms for MailChimp
6
  =====================
7
  [![WordPress](https://img.shields.io/wordpress/plugin/dt/yikes-inc-easy-mailchimp-extender.svg)]()
8
  ![Rating](https://img.shields.io/wordpress/plugin/r/yikes-inc-easy-mailchimp-extender.svg)
@@ -12,7 +12,7 @@ YIKES Inc. Easy Forms for MailChimp
12
 
13
  <strong>Latest Stable Beta Release Candidate</strong>
14
 
15
- This is the development repo for the [YIKES Inc Easy MailChimp Extender](https://wordpress.org/plugins/yikes-inc-easy-mailchimp-extender/) plugin where we work on new features and bug fixes.
16
 
17
  Feel free to beta test this plugin now, but remember, it's not a stable release.
18
 
@@ -30,7 +30,7 @@ Feel free to beta test this plugin now, but remember, it's not a stable release.
30
  For full documentation, please visit [our Knowledge Base](https://yikesplugins.com/support/knowledge-base/product/easy-forms-for-mailchimp/).
31
 
32
  ####### Integrations
33
- Easy Forms for MailChimp by YIKES integrates well with many popular third party plugins for WordPress:
34
 
35
  * WooCommerce
36
  * Easy Digital Downloads
@@ -46,7 +46,7 @@ Have any questions? Feel free to open up an issue in the issue tracker and we'll
46
 
47
  #### Grunt.js
48
 
49
- To develop with grunt place Gruntfile.js file inside the plugin root during development (/wp-content/yikes-inc-easy-mailchimp-extender/). The paths inside Gruntfile.js are setup relative to the plugin root, so placing it anywhere else without changing the paths will cause an error.
50
 
51
  First, make sure you install the latest version of Grunt to the local project directory.
52
 
@@ -97,63 +97,74 @@ Example:
97
 
98
  ###### Filters
99
 
100
- - `yikes-mailchimp-form-title-FORM_ID` - alter the output of the form title of the specified form
101
- - `yikes-mailchimp-form-description-FORM_ID` - alter the output of the form description of the specified form
102
- - `yikes-mailchimp-redirect-timer` (ms : 1 second = 1000ms) alter the amount of time the user sees the success message before being redirected (default: 1500ms) (@parameters - $time, $form_id)
103
- - `yikes-mailchimp-redirect-url` - Alter the URL of the page that the user will be redirected too on a successful submission. (@parameters - $url, $form_id, $page_data)
104
- - `yikes-mailchimp-before-submission` - catch the merge variables of all forms before they get sent over to MailChimp
105
- - `yikes-mailchimp-before-submission-FORM_ID` - catch the merge variables of the specified form before they get sent over to MailChimp
106
- - `yikes-mailchimp-after-submission` - catch the merge variables of all forms after they get sent over to MailChimp
107
- - `yikes-mailchimp-after-submission-FORM_ID` - catch the merge variables of the specified form after they get sent over to MailChimp
108
- - `yikes-mailchimp-user-role-access` - Alter who can access this plugin page by capability (default 'manage_options' - admins)
109
- - `yikes-mailchimp-admin-widget-capability` - Set the minimum user capability for users who can see/access dashboard widgets (Note: you can also use the `yikes-mailchimp-user-role-access` filter)
110
- - `yikes-mailchimp-international-phone-pattern` - Alter the regex pattern for acceptable international phone number formats. (default: [0-9]{1,}) (process form shortcode.php - line 295)
111
- - `yikes-mailchimp-us-phone-pattern` - Alter the regex pattern for acceptable US phone number formats. (default: [^(\([0-9]{3}\)|[0-9]{3}-)[0-9]{3}-[0-9]{4}$) (process form shortcode.php - line 295)
112
- - `yikes-mailchimp-process-default-tag` - Pass the default tag through a filter to populate with dynamic content from the current site (process_form_shortcode.php - line 256)
113
- - `yikes-mailchimp-MERGE_TAG-label` - Alter the specified field label text (affects standard fields & interest groups) (process_form_shortcode.php)
114
- - `yikes-mailchimp-MERGE_TAG-description` - Alter the specified field description text (affects standard fields & interest groups) (process_form_shortcode.php) (if targeting an interest group, it will be the group_id)
115
- - `yikes-mailchimp-address-TYPE-label` - Alter the field sub-label text for a specified address field (affects only standard address fields) (process_form_shortcode.php)
116
- - `yikes-mailchimp-form-submit-button` - Alter the submit button to your liking (process_form_shortcode.php line 660) (@parameters - $submit_button, $form_id)
117
- - `yikes-mailchimp-form-submit-button-text` - Alter the submit button text value (process_form_shortcode.php line 660) (@parameters - $submit_button_text, $form_id )
118
- - `yikes-mailchimp-form-submit-button-classes` - Add additional classes to the submit button for further styling (process_form_shortcode.php line 660) (@parameters - $classes, $form_id )
119
- - `yikes-mailchimp-form-container-class` - add additional classes to the parent form container (process_form_shortcode.php line157) (@parameters - $content, $form_id)
120
- - `yikes-mailchimp-form-class` - add additional classes to <form> element of your opt-in form (process_form_shortcode.php line157) (@parameters - $content, $form_id)
121
- - `yikes-mailchimp-front-end-form-action-links` - Add custom front end action links alongside Edit Form, Customize Form etc. (@parameters - $form_action_links, $form_id, $form_name)
122
- - `yikes-mailchimp-custom-default-value-tags` - Define your own custom pre-defined tags to populate the default value fields with - these tags appear in the modal - (@parameters - $pre_defined_tags_array)
123
- - `yikes-mailchimp-parse-custom-default-value` - Process your custom default merge tag into a custom value to populate the form field with - (Goes hand in hand with `yikes-mailchimp-custom-default-value-tags` filter)
124
- - `yikes-mailchimp-field-data` - Filter form field data such as placeholder, label, etc. (@parameters - $field_array, $field, $form_id) (process_form_shortcode.php - line 258 & process_preview_form_shortcode.php - line 258)
125
- - `yikes-mailchimp-user-subscribe-api-request` - Alter the API request whenever a new user subscribed (@parameters - $api_request data, $form_id, $list_id, $email ) (process_form_shortcode.php/process_form_shortcode_ajax.php)
126
- - `yikes-mailchimp-subscriber-count-value` - Adjust the returned value for the total subscriber count of a given MailChimp mailing list as needed. (@parameters - $subscriber_count) (yikes-mailchimp-subscriber-count.php- line 80)
127
- - `yikes-mailchimp-interest-group-checkbox-error` - Alter the checkbox interest group required error response (displayed when a checkbox interest group is set to required, but is left blank)(@since 6.0.3)
128
  - `yikes-mailchimp-frontend-content` - Custom content filter for this plugin to prevent others from hooking in where not wanted.
129
- - `yikes-mailchimp-interest-group-required-top-error` - Alter the top of form error message. (displays only when interest group checkbox group is set to required and left blank (non-ajax only)) (@parameters - count of missing required fields (integer))
130
- - `yikes-mailchimp-interest-group-checkbox-error` - Alter the error displayed above each required interest group checkbox group only. Effects checkbox groups only.
131
- - `yikes-mailchimp-recaptcha-parameters` - Alter any of the possible reCaptcha shortcode parameters (process_form_shortcode.php line 68) (parameters: $recaptcha_parameter_array, $form_id)
132
- - `yikes-mailchimp-checkbox-integration-subscribe-api-request` - Filter the API request sent to MailChimp. (parameters: @type - the integration type (ie: comment, contact_form_7 etc.)
133
- - `yikes-mailchimp-frontend-date-picker-format` - Alter the date format. For additional help, see the [knowledge base](https://yikesplugins.com/support/knowledge-base/how-do-i-change-the-frontend-date-picker-format/).
134
- - `yikes-mailchimp-preloader` - Filter allowing users to setup a custom preloader image.
135
- - `yikes-mailchimp-update-email-subject` - Filter the subject line for the email that is generated and sent when a user needs to update their subscription info.
136
- - `yikes-mailchimp-update-email-content` - Filter the content of the email that is generated and sent when a user needs to update their subscription info.
137
- - `yikes-mailchimp-user-already-subscribed-error` - Filter the 'xxx@example.com' is already subscribed to the list. (@parameters - $response, $form_id, $user_email)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
138
 
139
  ###### Hooks
140
 
141
- - `yikes-mailchimp-form-submission` - do something with the user email + form data on form submission
142
- - `yikes-mailchimp-form-submission-FORM_ID` - do something with the user email + form data on form submission (specific form)
143
- - `yikes-mailchimp-before-form` - output content before all forms (@parameters - $form_id)
144
- - `yikes-mailchimp-after-form` - output content after all forms (@parameters - $form_id)
145
- - `yikes-mailchimp-before-checkbox` - output custom content before the opt-in checkbox for all integrations
146
- - `yikes-mailchimp-after-checkbox` - output custom content after the opt-in checkbox for all integrations
147
- - `yikes-mailchimp-support-page` - output custom content on the support page (used to add our support form for premium users)
148
- - `yikes-mailchimp-edit-form-section-links` - add additional links to the edit form page next to 'Custom Messages'
149
- - `yikes-mailchimp-edit-form-sections` - add custom section to the edit form page
150
- - `yikes-mailchimp-edit-form-notice` - hook to display a custom notice on the edit form page
151
- - `yikes-mailchimp-shortcode-enqueue-scripts-styles` - hook to enqueue custom scripts & styles wherever the shortcode is being used (@paremeter $form_id - pass the id of the current form)
152
- - `yikes-mailchimp-additional-form-fields` - define additional fields to add below all forms (@parameter $form_data - all data associated with the given form)
153
- - `yikes-mailchimp-custom-form-actions` - add custom action links on the manage forms page (alongside Edit, Duplicate, Shortcode, Delete ) (@parameter $form_id - the id of the form)
154
- - `yikes-mailchimp-api-curl-request` - custom action hook to disable curl verification (not recommended - see the following [KB article](https://yikesplugins.com/support/knowledge-base/i-receive-the-error-ssl-certificate-problem-unable-to-get-local-issuer-certificate-why/))
155
- - `yikes-mailchimp-list-form-fields-metabox` - action hook allowing additional content to be added to the 'Form Fields' metabox on the view list page.
156
- - `yikes-mailchimp-list-interest-groups-metabox` - action hook allowing users to add additional content inside of the interest groups metabox on the view list page.
157
 
158
  ###### Hooks for Extensions
159
 
2
  [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/yikesinc/yikes-inc-easy-mailchimp-extender/badges/quality-score.png?b=staging)](https://scrutinizer-ci.com/g/yikesinc/yikes-inc-easy-mailchimp-extender/?branch=staging)
3
  [![Code Coverage](https://scrutinizer-ci.com/g/yikesinc/yikes-inc-easy-mailchimp-extender/badges/coverage.png?b=staging)](https://scrutinizer-ci.com/g/yikesinc/yikes-inc-easy-mailchimp-extender/?branch=staging)
4
  [![Build Status](https://scrutinizer-ci.com/g/yikesinc/yikes-inc-easy-mailchimp-extender/badges/build.png?b=staging)](https://scrutinizer-ci.com/g/yikesinc/yikes-inc-easy-mailchimp-extender/build-status/staging)
5
+ Easy Forms for MailChimp
6
  =====================
7
  [![WordPress](https://img.shields.io/wordpress/plugin/dt/yikes-inc-easy-mailchimp-extender.svg)]()
8
  ![Rating](https://img.shields.io/wordpress/plugin/r/yikes-inc-easy-mailchimp-extender.svg)
12
 
13
  <strong>Latest Stable Beta Release Candidate</strong>
14
 
15
+ This is the development repo for the [Easy Forms for MailChimp](https://wordpress.org/plugins/yikes-inc-easy-mailchimp-extender/) plugin by [YIKES, Inc.](https://yikesinc.com/) where we work on new features and bug fixes.
16
 
17
  Feel free to beta test this plugin now, but remember, it's not a stable release.
18
 
30
  For full documentation, please visit [our Knowledge Base](https://yikesplugins.com/support/knowledge-base/product/easy-forms-for-mailchimp/).
31
 
32
  ####### Integrations
33
+ Easy Forms for MailChimp integrates well with many popular third party plugins for WordPress:
34
 
35
  * WooCommerce
36
  * Easy Digital Downloads
46
 
47
  #### Grunt.js
48
 
49
+ To develop with Grunt place Gruntfile.js file inside the plugin root during development (/wp-content/yikes-inc-easy-mailchimp-extender/). The paths inside Gruntfile.js are setup relative to the plugin root, so placing it anywhere else without changing the paths will cause an error.
50
 
51
  First, make sure you install the latest version of Grunt to the local project directory.
52
 
97
 
98
  ###### Filters
99
 
100
+ - `yikes-mailchimp-form-title` - Alter the output of the form title of the specified form. @params: $title, $form_id
101
+ - `yikes-mailchimp-form-description` - Alter the output of the form description of the specified form. @params: $description, $form_id
102
+ - `yikes-mailchimp-redirect-timer` - Alter the amount of time in *milliseconds* the user sees the success message before being redirected. Default: `1500` - @params: $time, $form_id
103
+ - `yikes-mailchimp-redirect-url` - Alter the URL of the page that the user will be redirected to on a successful submission. @params: $url, $form_id, $page_data
104
+ - `yikes-mailchimp-filter-before-submission` and `yikes-mailchimp-filter-before-submission-{$form_id}` - Catch the merge variables before they get sent over to MailChimp. @params: $merge_variables
105
+ - `yikes-mailchimp-after-submission` and `yikes-mailchimp-after-submission-{$form_id}` - Catch the merge variables after they get sent over to MailChimp. @params: $merge_variables
106
+ - `yikes-mailchimp-user-role-access` - Alter who can access this plugin page by capability. Default: `manage_options` - @params: $capability
107
+ - `yikes-mailchimp-international-phone-pattern` - Alter the regex pattern for acceptable international phone number formats. Default: `'[0-9,-,+]{1,}'` - @params: $regex_pattern
108
+ - `yikes-mailchimp-us-phone-pattern` - Alter the regex pattern for acceptable US phone number formats. Default: `^(\([0-9]{3}\)|[0-9]{3}-)[0-9]{3}-[0-9]{4}$` - @params: $regex_pattern
109
+ - `yikes-mailchimp-zip-pattern` - Alter the zip code regex pattern. Default: `\d{5,5}(-\d{4,4})?` - @params: $regex_pattern
110
+ - `yikes-mailchimp-process-default-tag` - Alter the default form field value for text fields. @params: $default_value
111
+ - `yikes-mailchimp-{$merge_tag}-label` - Alter the specified form field's or interest group's label text. @params: $label
112
+ - `yikes-mailchimp-{$merge_tag}-description` - Alter the specified form field's or interest group's description text (note: if targeting an interest group, it will be the group_id instead of the merge tag). @params: $description_content, $form_id.
113
+ - `yikes-mailchimp-address-{$type}-label` - Alter the field sub-label text for a specific address field (e.g. addr1). @params: $label
114
+ - `yikes-mailchimp-form-submit-button` - Alter the submit button to your liking. @params: $submit_button, $form_id
115
+ - `yikes-mailchimp-form-submit-button-text` - Alter the submit button text. Default: `submit` - @params: $submit_button_text, $form_id
116
+ - `yikes-mailchimp-form-submit-button-classes` - Add additional classes to the submit button for further styling. @params: $classes, $form_id
117
+ - `yikes-mailchimp-form-container-class` - Add additional classes to the `<section>` element container that wraps the form. @params: $class_name, $form_id
118
+ - `yikes-mailchimp-form-class` - Add additional classes to `<form>` element of your opt-in form. @params: $class_name, $form_id
119
+ - `yikes-mailchimp-front-end-form-action-links` - Add custom front end action links alongside Edit Form, Customize Form etc. @params: $form_action_links, $form_id, $form_name
120
+ - `yikes-mailchimp-custom-default-value-tags` - Define your own custom pre-defined tags to populate the default value fields with - these tags appear in the modal. @params: $pre_defined_tags_array
121
+ - `yikes-mailchimp-parse-custom-default-value` - Process your custom default merge tag into a custom value to populate the form field with (note: Goes hand in hand with `yikes-mailchimp-custom-default-value-tags` filter). @params: $default_tag
122
+ - `yikes-mailchimp-field-data` - Filter form field data such as placeholder, label, etc. @params: $field_array, $field, $form_id
123
+ - `yikes-mailchimp-subscriber-count-value` - Alter the returned value for the total subscriber count of a given MailChimp list. @params: $subscriber_count
 
 
 
 
124
  - `yikes-mailchimp-frontend-content` - Custom content filter for this plugin to prevent others from hooking in where not wanted.
125
+ - `yikes-mailchimp-recaptcha-parameters` - Alter any of the possible reCAPTCHA shortcode parameters. @params: $recaptcha_parameter_array, $form_id
126
+ - `yikes-mailchimp-preloader` - Add a custom preloader image. Default: WordPress's wpspin_light.gif. @params: $url_to_spinner_gif
127
+ - `yikes-mailchimp-update-email-subject` - Filter the subject line for the email that is generated and sent when a user needs to update their subscription info. @params: $email_subject
128
+ - `yikes-mailchimp-update-email-content` - Filter the content of the email that is generated and sent when a user needs to update their subscription info. @params: $email_body
129
+ - `yikes-mailchimp-success-response` - Alter *any* success response text. @params: $response_text, $form_id, $submitted_form_variables
130
+ - `yikes-mailchimp-default-country-value` - Alter the default country selected in the country dropdown. Default: `US` - @params: $country_slug
131
+ - `yikes-mailchimp-recaptcha-required-error` - Filter the error displayed back to the user when an error occurs during the reCAPTCHA submission process. @params: $error_text, $form_id
132
+ - `yikes-mailchimp-sslverify` - Toggle sslverify on/off when attempting to validate your API key with the MailChimp API servers. Default: `true` (on) - @params: $use_ssl
133
+ - Version 6.3.0:
134
+ * `yikes-mailchimp-success-double-optin-response` - Filter the "Success: Double opt-in" custom message. @params: $message, $form_id
135
+ * `yikes-mailchimp-success-single-optin-response` - Filter the "Success: Single opt-in" custom message. @params: $message, $form_id
136
+ * `yikes-mailchimp-success-resubscribed-response` - Filter the "Success: Re-subscriber" custom message. @params: $message, $form_id
137
+ * `yikes-mailchimp-user-already-subscribed-link-text` - Filter the "Success: Re-subscriber with link to email profile update message" custom message. @params: $message, $form_id
138
+ * `yikes-mailchimp-general-error-response` - Filter the "Error: General" custom message. @params: $message, $form_id
139
+ * `yikes-mailchimp-user-already-subscribed-text` - Filter the "Error: Re-subscribers not permitted" custom message (note: this replaced `yikes-mailchimp-user-already-subscribed-error`). @params: $message, $form_id
140
+ * `yikes-mailchimp-filter-groups-before-submission` and `yikes-mailchimp-filter-groups-before-submission-{$form_id}` - Filter the interest groups before they're submitted. @params: $groups, $form_id
141
+ * `yikes-mailchimp-address-2-required` - Change the address 2 field's `required` value. Default: `''` (it is never required) - @params: $required, $form_id
142
+ * `yikes-mailchimp-filter-subscribe-request` and `yikes-mailchimp-filter-subscribe-request-{$form_id}` - Filter all of the fields sent over to the MailChimp API (not just the form fields). @params: $subscribe_body, $form_id
143
+ * `yikesinc_eme_default_api_version` - Filter the API version. Default: `3.0` - @params: $version
144
+ * `yikesinc_eme_api_url` - Filter the URL used for a request to the MailChimp API. @params: $full_path, $path
145
+ * `yikesinc_eme_api_user_agent` - Filter the user agent used in API request. @params: $user_agent
146
+ * `yikesinc_eme_api_auth_headers` - Filter the authentication headers used in the API request. @params: $auth_headers, $api_version
147
+ * `yikesinc_eme_api_headers` - Filter the headers used for a request to the MailChimp API. @params: $headers, $path, $method, $params
148
+ * `yikesinc_eme_api_timeout` - Filter the timeout (in *seconds*) used when sending an API request. Default: `15` @params: $timeout
149
+ * `yikesinc_eme_api_args` - Filter the arguments used for a request to the MailChimp API. @params: $args, $path, $method, $params
150
 
151
  ###### Hooks
152
 
153
+ - `yikes-mailchimp-form-submission` and `yikes-mailchimp-form-submission-{$form_id}` - Do something with the user email + form data on form submission. @params: $email, $merge_variables, $form_id, $notifications
154
+ - `yikes-mailchimp-after-submission` and `yikes-mailchimp-after-submission-{$form_id}` - Do something with only the $merge_variables (note: these actions are fired off directly after `yikes-mailchimp-form-submission`).
155
+ - `yikes-mailchimp-before-submission` and `yikes-mailchimp-before-submission-{$form_id}` - Do something with the $merge_variables before the API request. @params: $merge_variables
156
+ - `yikes-mailchimp-after-form` - Do something after a form has been loaded. @params: $form_id
157
+ - `yikes-mailchimp-before-checkbox` - Do something (e.g. output custom content) before the opt-in checkbox for all integrations.
158
+ - `yikes-mailchimp-after-checkbox` - Do something (e.g. output custom content) after the opt-in checkbox for all integrations
159
+ - `yikes-mailchimp-support-page` - Do something (e.g. output custom content) on the support page (note: we use this to add our support form for premium users).
160
+ - `yikes-mailchimp-edit-form-section-links` - Add additional links to the edit form page next to 'Custom Messages'.
161
+ - `yikes-mailchimp-edit-form-sections` - Add custom section to the edit form page.
162
+ - `yikes-mailchimp-edit-form-notice` - Hook to display a custom notice on the edit form page.
163
+ - `yikes-mailchimp-shortcode-enqueue-scripts-styles` - Hook to enqueue custom scripts & styles wherever the shortcode is being used. @params: $form_id
164
+ - `yikes-mailchimp-additional-form-fields` - Define additional fields to add below all forms. @params: $form_data
165
+ - `yikes-mailchimp-custom-form-actions` - Add custom action links on the manage forms page (alongside Edit, Duplicate, Shortcode, Delete). @params: $form_id
166
+ - `yikes-mailchimp-list-form-fields-metabox` - Add additional content to the 'Form Fields' metabox on the view list page.
167
+ - `yikes-mailchimp-list-interest-groups-metabox` - Add additional content inside of the interest groups metabox on the view list page.
 
168
 
169
  ###### Hooks for Extensions
170
 
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: yikesinc, eherman24, liljimmi, hiwhatsup, JPry
3
  Donate link: https://yikesplugins.com/?utm_source=wp_plugin_repo&utm_medium=donate_link&utm_campaign=easy_forms_for_mailchimp
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
7
- Stable tag: 6.2.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -12,7 +12,7 @@ The ultimate MailChimp WordPress plugin. Easily build unlimited forms for your M
12
 
13
  == Description ==
14
 
15
- Easy Forms for MailChimp allows you to add unlimited MailChimp sign up forms to your WordPress site. You can add forms to posts, pages, sidebars and other widgetized areas. Your MailChimp API Key connects your site to your MailChimp account and pulls in all of your MailChimp list information.
16
 
17
  MailChimp List statistics and user activity can be viewed right from your dashboard. From there, you can manage users and list settings.
18
 
@@ -25,33 +25,33 @@ https://www.youtube.com/watch?v=NRZbW-Da1XA
25
  **Features**
26
 
27
  * Build **unlimited** forms for any of your MailChimp lists with an easy-to-use admin, including multiple forms for the same list.
28
- * Connect your website to your MailChimp account with a MailChimp API key and a click.
29
- * Toggle inline forms with the click of a button.
30
- * Schedule form visibility by date/time.
31
- * Limit opt-ins by logged in users.
32
- * Localized data/time pickers
33
  * Duplicate forms with a click.
34
- * Easily add MailChimp forms to any post or page with our custom editor button or with a shortcode.
35
- * Toggle on/off AJAX functionality on a per form basis.
36
- * Add MailChimp forms to widgetized areas with our custom widget.
37
- * Allow users to sign up for MailChimp interest groups, or pre-check groups in a hidden field.
38
- * Use our built-in CSS classes or add your own additional classes to form fields to easily style and customize forms.
39
  * Customize the MailChimp submission button text.
40
- * Shortcode available to display the number of subscribers on a given MailChimp list.
 
 
 
 
41
  * Fully customize the success and error messages displayed back to the user.
42
  * Quickly toggle between single or double opt-in.
43
  * Disable or Enable the default MailChimp welcome email.
44
- * Remove bogus subscribers from your MailChimp list through the admin interface.
45
- * Allow existing subscribers to update their account info (**new** now including two factor authentication).
46
  * Redirect users to another post or page after form submission.
47
  * Enable Google reCAPTCHA protection on your forms.
 
 
 
 
48
  * Import/Export all MailChimp forms and associated settings for use on other sites with Easy Forms for MailChimp installed.
49
- * Seamless integration with core WordPress forms: comments and registration.
50
- * Seamless integration with many popular third party plugins: WooCommerce, Easy Digital Downloads, BuddyPress, BbPress, Contact Form 7.
51
  * View your MailChimp account activity like subscribes and unsubscribes.
52
  * View your MailChimp list statistics and manage users and list settings.
53
- * Advanced debugging to log MailChimp errors as they occur, for easy troubleshooting.
54
- * Developer friendly! We've provided hooks and filters to allow developers to extend the plugin.
55
  * Add-ons available to extend the core functionality of the plugin. [Check them out](https://yikesplugins.com/?utm_source=wp_plugin_repo&utm_medium=link&utm_campaign=easy_forms_for_mailchimp)!
56
 
57
  **Integrations**
@@ -158,83 +158,128 @@ Example:
158
  14. MailChimp Form Widget in the Sidebar on Live Website
159
  15. Editor Button to easily add Forms to Page and Posts
160
  16. MailChimp Form on a Page on Live Website
161
- 17. *New* Additional Form Settings
162
- 18. *New* Inline Form on a Page on Live Website
163
 
164
  == Other Notes ==
165
 
166
- Alongside the default functionality of Easy Forms for MailChimp by YIKES we've included a number of hooks and filters to allow for a higher level of customization of your MailChimp forms.
167
 
168
- For information and code examples on how to implement the hooks and filters provided by Easy Forms for MailChimp by YIKES, please see our [Developer Documentation in the Knowledge Base](https://yikesplugins.com/support/knowledge-base/product/developer-documentation/?utm_source=wp_plugin_repo&utm_medium=link&utm_campaign=easy_forms_for_mailchimp).
169
 
170
- Below you'll find a complete list of the hooks and filters available in Easy Forms for MailChimp by YIKES.
171
 
172
  **Filters**
173
 
174
- * yikes-mailchimp-form-title-FORM_ID - alter the output of the form title of the specified form
175
- * yikes-mailchimp-form-description-FORM_ID - alter the output of the form description of the specified form
176
- * yikes-mailchimp-redirect-timer (ms : 1 second = 1000ms) alter the amount of time the user sees the success message before being redirected (default: 1500ms) (@parameters - $time, $form_id)
177
- * yikes-mailchimp-redirect-url - Alter the URL of the page that the user will be redirected too on a successful submission. (@parameters - $url, $form_id, $page_data)
178
- * yikes-mailchimp-before-submission - catch the merge variables of all forms before they get sent over to MailChimp
179
- * yikes-mailchimp-before-submission-FORM_ID - catch the merge variables of the specified form before they get sent over to MailChimp
180
- * yikes-mailchimp-after-submission - catch the merge variables of all forms after they get sent over to MailChimp
181
- * yikes-mailchimp-after-submission-FORM_ID - catch the merge variables of the specified form after they get sent over to MailChimp
182
- * yikes-mailchimp-user-role-access - Alter who can access this plugin page by capability (default 'manage_options' - admins)
183
- * yikes-mailchimp-international-phone-pattern - Alter the regex pattern for acceptable international phone number formats. (process form shortcode.php - line 295)
184
- * yikes-mailchimp-us-phone-pattern - Alter the regex pattern for acceptable US phone number formats. (process form shortcode.php - line 295)
185
- * yikes-mailchimp-zip-pattern - Alter the zip code regex pattern (Defaults to: \d{5,5}(-\d{4,4})?)
186
- * yikes-mailchimp-process-default-tag - Pass the default tag through a filter to populate with dynamic content from the current site (process_form_shortcode.php - line 256)
187
- * yikes-mailchimp-MERGE_TAG-label - Alter the specified field label text (affects standard fields & interest groups) (process_form_shortcode.php)
188
- * yikes-mailchimp-MERGE_TAG-description - Alter the specified field description text (affects standard fields & interest groups) (process_form_shortcode.php) (if targeting an interest group, it will be the group_id instead of the merge tag) ($parameter - $description_content, $form_id)
189
- * yikes-mailchimp-address-TYPE-label - Alter the field sub-label text for a specified address field (affects only standard address fields) (process_form_shortcode.php)
190
- * yikes-mailchimp-form-submit-button - Alter the submit button to your liking (process_form_shortcode.php line 660) (@parameters - $submit_button, $form_id)
191
- * yikes-mailchimp-form-submit-button-text - Alter the submit button text value (process_form_shortcode.php line 660) (@parameters - $submit_button_text, $form_id )
192
- * yikes-mailchimp-form-submit-button-classes - Add additional classes to the submit button for further styling (process_form_shortcode.php line 660) (@parameters - $classes, $form_id )
193
- * yikes-mailchimp-form-container-class - add additional classes to the parent form container (process_form_shortcode.php line 91) (@parameters - $class_name, $form_id)
194
- * yikes-mailchimp-form-class - add additional classes to `<form>` element of your opt-in form (process_form_shortcode.php line 157) (@parameters - $class_name, $form_id)
195
- * yikes-mailchimp-front-end-form-action-links - Add custom front end action links alongside Edit Form, Customize Form etc. (@parameters - $form_action_links, $form_id, $form_name)
196
- * yikes-mailchimp-custom-default-value-tags - Define your own custom pre-defined tags to populate the default value fields with - these tags appear in the modal - (@parameters - $pre_defined_tags_array)
197
- * yikes-mailchimp-parse-custom-default-value - Process your custom default merge tag into a custom value to populate the form field with - (Goes hand in hand with `yikes-mailchimp-custom-default-value-tags` filter)
198
- * yikes-mailchimp-field-data - Filter form field data such as placeholder, label, etc. (@parameters - $field_array, $field, $form_id) (process_form_shortcode.php - line 258 & process_preview_form_shortcode.php - line 258)
199
- * yikes-mailchimp-user-subscribe-api-request - Alter the API request whenever a new user subscribed (@parameters - $api_request data, $form_id, $list_id, $email ) (process_form_shortcode.php/process_form_shortcode_ajax.php)
200
- * yikes-mailchimp-subscriber-count-value - Adjust the returned value for the total subscriber count of a given MailChimp mailing list as needed. (@parameters - $subscriber_count) (yikes-mailchimp-subscriber-count.php- line 80)
201
- * yikes-mailchimp-interest-group-checkbox-error - Alter the checkbox interest group required error response (displayed when a checkbox interest group is set to required, but is left blank)(@since 6.0.3)
202
- * yikes-mailchimp-frontend-content - Custom content filter for this plugin to prevent others from hooking in where not wanted.
203
- * yikes-mailchimp-interest-group-required-top-error - Alter the top of form error message. (displays only when interest group checkbox group is set to required and left blank (non-ajax only)) (@parameters - $count (# ofmissing required fields (integer)), $form_id )
204
- * yikes-mailchimp-interest-group-checkbox-error - Alter the error displayed above each required interest group checkbox group only. Effects checkbox groups only. (@ajax forms only) (@parameter - $form_id)
205
- * yikes-mailchimp-recaptcha-parameters - Alter any of the possible reCAPTCHA shortcode parameters (process_form_shortcode.php line 68) (parameters: $recaptcha_parameter_array, $form_id)
206
- * yikes-mailchimp-checkbox-integration-subscribe-api-request - Filter the API request sent to MailChimp. (parameters: @type - the integration type (ie: comment, contact_form_7 etc.)
207
- * yikes-mailchimp-frontend-date-picker-format - Alter the date format. For additional help, see the [knowledge base](https://yikesplugins.com/support/knowledge-base/how-do-i-change-the-frontend-date-picker-format/).
208
- * yikes-mailchimp-preloader - Filter allowing users to setup a custom preloader image.
209
- * yikes-mailchimp-update-email-subject - Filter the subject line for the email that is generated and sent when a user needs to update their subscription info.
210
- * yikes-mailchimp-update-email-content - Filter the content of the email that is generated and sent when a user needs to update their subscription info.
211
- * yikes-mailchimp-success-response - Alter the success response text (@parameters: $response_text, $form_id, $submitted_form_variables)
212
- * yikes-mailchimp-default-country-value - Alter the default country selected in the country dropdown.
213
- * yikes-mailchimp-recaptcha-required-error - Filter the error displayed back to the user when an error occurs during the reCAPTCHA submission process. (@parameters: $error_text)
214
- * yikes-mailchimp-sslverify - Toggle sslverify on/off when attempting to validate your API key with the MailChimp API servers.
215
- * yikes-mailchimp-user-already-subscribed-error - Filter the 'xxx@example.com' is already subscribed to the list. (@parameters - $response, $form_id, $user_email)
 
 
 
 
 
 
 
 
216
 
217
  **Actions**
218
 
219
- * yikes-mailchimp-form-submission - do something with the user email + form data on form submission
220
- * yikes-mailchimp-form-submission-FORM_ID - do something with the user email + form data on form submission (specific form)
221
- * yikes-mailchimp-before-form - output content before all forms (@parameters - $form_id)
222
- * yikes-mailchimp-after-form - output content after all forms (@parameters - $form_id)
223
- * yikes-mailchimp-before-checkbox - output custom content before the opt-in checkbox for all integrations
224
- * yikes-mailchimp-after-checkbox - output custom content after the opt-in checkbox for all integrations
225
- * yikes-mailchimp-support-page - output custom content on the support page (used to add our support form for premium users)
226
- * yikes-mailchimp-edit-form-section-links - add additional links to the edit form page next to 'Custom Messages'
227
- * yikes-mailchimp-edit-form-sections - add custom section to the edit form page
228
- * yikes-mailchimp-edit-form-notice - hook to display a custom notice on the edit form page
229
- * yikes-mailchimp-shortcode-enqueue-scripts-styles - hook to enqueue custom scripts & styles wherever the shortcode is being used (@paremeter $form_id - pass the id of the current form)
230
- * yikes-mailchimp-additional-form-fields - define additional fields to add below all forms (@parameter $form_data - all data associated with the given form)
231
- * yikes-mailchimp-custom-form-actions - add custom action links on the manage forms page (alongside Edit, Duplicate, Shortcode, Delete ) (@parameter $form_id - the id of the form)
232
- * yikes-mailchimp-api-curl-request - custom action hook to disable curl verification (not recommended - see the following [KB article](https://yikesplugins.com/support/knowledge-base/i-receive-the-error-ssl-certificate-problem-unable-to-get-local-issuer-certificate-why/))
233
- * yikes-mailchimp-list-form-fields-metabox - action hook allowing additional content to be added to the 'Form Fields' metabox on the view list page.
234
- * yikes-mailchimp-list-interest-groups-metabox - action hook allowing users to add additional content inside of the interest groups metabox on the view list page.
235
 
236
  == Changelog ==
237
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
238
  = Easy Forms for MailChimp 6.2.4 - December 6th, 2016 =
239
  * Fixed the way birthday field data was being handled / stored
240
  * Added version number to main AJAX JavaScript file - Thanks goes to Viktor Szépe for committing this change
3
  Donate link: https://yikesplugins.com/?utm_source=wp_plugin_repo&utm_medium=donate_link&utm_campaign=easy_forms_for_mailchimp
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.1
7
+ Stable tag: 6.3.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
12
 
13
  == Description ==
14
 
15
+ Easy Forms for MailChimp allows you to add **unlimited** MailChimp sign up forms to your WordPress site. You can add forms to posts, pages, sidebars and other widgetized areas. Your MailChimp API Key connects your site to your MailChimp account and pulls in all of your MailChimp list information.
16
 
17
  MailChimp List statistics and user activity can be viewed right from your dashboard. From there, you can manage users and list settings.
18
 
25
  **Features**
26
 
27
  * Build **unlimited** forms for any of your MailChimp lists with an easy-to-use admin, including multiple forms for the same list.
28
+ * Connect your website to your MailChimp account with a MailChimp API key.
29
+ * Add MailChimp forms to any post or page with our editor button or a shortcode.
 
 
 
30
  * Duplicate forms with a click.
 
 
 
 
 
31
  * Customize the MailChimp submission button text.
32
+ * Display forms with inline fields.
33
+ * Add MailChimp forms to widgetized areas with our widget.
34
+ * Allow users to sign up for MailChimp interest groups, or pre-check groups in a hidden field.
35
+ * Use our built-in CSS classes or add your own additional classes to form fields to style and customize forms.
36
+ * Use a shortcode to display the number of subscribers on a given MailChimp list.
37
  * Fully customize the success and error messages displayed back to the user.
38
  * Quickly toggle between single or double opt-in.
39
  * Disable or Enable the default MailChimp welcome email.
40
+ * Remove subscribers from your MailChimp list through our admin interface.
41
+ * Allow existing subscribers to update their MailChimp profile information.
42
  * Redirect users to another post or page after form submission.
43
  * Enable Google reCAPTCHA protection on your forms.
44
+ * Schedule form visibility by date/time.
45
+ * Limit opt-ins by logged in users.
46
+ * Use localized data/time pickers
47
+ * Toggle on/off AJAX functionality on a per form basis.
48
  * Import/Export all MailChimp forms and associated settings for use on other sites with Easy Forms for MailChimp installed.
49
+ * Integrate with core WordPress forms: comments and registration.
50
+ * Integrate with many popular third party plugins: WooCommerce, Easy Digital Downloads, BuddyPress, BbPress, Contact Form 7.
51
  * View your MailChimp account activity like subscribes and unsubscribes.
52
  * View your MailChimp list statistics and manage users and list settings.
53
+ * Use advanced debugging to log MailChimp errors as they occur, for easy troubleshooting.
54
+ * Developer friendly! Use our many hooks and filters to extend the plugin.
55
  * Add-ons available to extend the core functionality of the plugin. [Check them out](https://yikesplugins.com/?utm_source=wp_plugin_repo&utm_medium=link&utm_campaign=easy_forms_for_mailchimp)!
56
 
57
  **Integrations**
158
  14. MailChimp Form Widget in the Sidebar on Live Website
159
  15. Editor Button to easily add Forms to Page and Posts
160
  16. MailChimp Form on a Page on Live Website
161
+ 17. Additional Form Settings
162
+ 18. Inline Form on a Page on Live Website
163
 
164
  == Other Notes ==
165
 
166
+ Alongside the default functionality of Easy Forms for MailChimp we've included a number of hooks and filters to allow for a higher level of customization of your MailChimp forms.
167
 
168
+ For information and code examples on how to implement the hooks and filters provided by Easy Forms for MailChimp, please see our [Developer Documentation in the Knowledge Base](https://yikesplugins.com/support/knowledge-base/product/developer-documentation/?utm_source=wp_plugin_repo&utm_medium=link&utm_campaign=easy_forms_for_mailchimp).
169
 
170
+ Below you'll find a complete list of the hooks and filters available in Easy Forms for MailChimp.
171
 
172
  **Filters**
173
 
174
+ * `yikes-mailchimp-form-title` - Alter the output of the form title of the specified form. @params: $title, $form_id
175
+ * `yikes-mailchimp-form-description` - Alter the output of the form description of the specified form. @params: $description, $form_id
176
+ * `yikes-mailchimp-redirect-timer` - Alter the amount of time in *milliseconds* the user sees the success message before being redirected. Default: `1500` - @params: $time, $form_id
177
+ * `yikes-mailchimp-redirect-url` - Alter the URL of the page that the user will be redirected to on a successful submission. @params: $url, $form_id, $page_data
178
+ * `yikes-mailchimp-filter-before-submission` and `yikes-mailchimp-filter-before-submission-{$form_id}` - Catch the merge variables before they get sent over to MailChimp. @params: $merge_variables
179
+ * `yikes-mailchimp-after-submission` and `yikes-mailchimp-after-submission-{$form_id}` - Catch the merge variables after they get sent over to MailChimp. @params: $merge_variables
180
+ * `yikes-mailchimp-user-role-access` - Alter who can access this plugin page by capability. Default: `manage_options` - @params: $capability
181
+ * `yikes-mailchimp-international-phone-pattern` - Alter the regex pattern for acceptable international phone number formats. Default: `'[0-9,-,+]{1,}'` - @params: $regex_pattern
182
+ * `yikes-mailchimp-us-phone-pattern` - Alter the regex pattern for acceptable US phone number formats. Default: `^(\([0-9]{3}\)|[0-9]{3}-)[0-9]{3}-[0-9]{4}$` - @params: $regex_pattern
183
+ * `yikes-mailchimp-zip-pattern` - Alter the zip code regex pattern. Default: `\d{5,5}(-\d{4,4})?` - @params: $regex_pattern
184
+ * `yikes-mailchimp-process-default-tag` - Alter the default form field value for text fields. @params: $default_value
185
+ * `yikes-mailchimp-{$merge_tag}-label` - Alter the specified form field's or interest group's label text. @params: $label
186
+ * `yikes-mailchimp-{$merge_tag}-description` - Alter the specified form field's or interest group's description text (note: if targeting an interest group, it will be the group_id instead of the merge tag). @params: $description_content, $form_id.
187
+ * `yikes-mailchimp-address-{$type}-label` - Alter the field sub-label text for a specific address field (e.g. addr1). @params: $label
188
+ * `yikes-mailchimp-form-submit-button` - Alter the submit button to your liking. @params: $submit_button, $form_id
189
+ * `yikes-mailchimp-form-submit-button-text` - Alter the submit button text. Default: `submit` - @params: $submit_button_text, $form_id
190
+ * `yikes-mailchimp-form-submit-button-classes` - Add additional classes to the submit button for further styling. @params: $classes, $form_id
191
+ * `yikes-mailchimp-form-container-class` - Add additional classes to the `<section>` element container that wraps the form. @params: $class_name, $form_id
192
+ * `yikes-mailchimp-form-class` - Add additional classes to `<form>` element of your opt-in form. @params: $class_name, $form_id
193
+ * `yikes-mailchimp-front-end-form-action-links` - Add custom front end action links alongside Edit Form, Customize Form etc. @params: $form_action_links, $form_id, $form_name
194
+ * `yikes-mailchimp-custom-default-value-tags` - Define your own custom pre-defined tags to populate the default value fields with - these tags appear in the modal. @params: $pre_defined_tags_array
195
+ * `yikes-mailchimp-parse-custom-default-value` - Process your custom default merge tag into a custom value to populate the form field with (note: Goes hand in hand with `yikes-mailchimp-custom-default-value-tags` filter). @params: $default_tag
196
+ * `yikes-mailchimp-field-data` - Filter form field data such as placeholder, label, etc. @params: $field_array, $field, $form_id
197
+ * `yikes-mailchimp-subscriber-count-value` - Alter the returned value for the total subscriber count of a given MailChimp list. @params: $subscriber_count
198
+ * `yikes-mailchimp-frontend-content` - Custom content filter for this plugin to prevent others from hooking in where not wanted.
199
+ * `yikes-mailchimp-recaptcha-parameters` - Alter any of the possible reCAPTCHA shortcode parameters. @params: $recaptcha_parameter_array, $form_id
200
+ * `yikes-mailchimp-preloader` - Add a custom preloader image. Default: WordPress's wpspin_light.gif. @params: $url_to_spinner_gif
201
+ * `yikes-mailchimp-update-email-subject` - Filter the subject line for the email that is generated and sent when a user needs to update their subscription info. @params: $email_subject
202
+ * `yikes-mailchimp-update-email-content` - Filter the content of the email that is generated and sent when a user needs to update their subscription info. @params: $email_body
203
+ * `yikes-mailchimp-success-response` - Alter *any* success response text. @params: $response_text, $form_id, $submitted_form_variables
204
+ * `yikes-mailchimp-default-country-value` - Alter the default country selected in the country dropdown. Default: `US` - @params: $country_slug
205
+ * `yikes-mailchimp-recaptcha-required-error` - Filter the error displayed back to the user when an error occurs during the reCAPTCHA submission process. @params: $error_text, $form_id
206
+ * `yikes-mailchimp-sslverify` - Toggle sslverify on/off when attempting to validate your API key with the MailChimp API servers. Default: `true` (on) - @params: $use_ssl
207
+ * Version 6.3.0:
208
+ * `yikes-mailchimp-success-double-optin-response` - Filter the "Success: Double opt-in" custom message. @params: $message, $form_id
209
+ * `yikes-mailchimp-success-single-optin-response` - Filter the "Success: Single opt-in" custom message. @params: $message, $form_id
210
+ * `yikes-mailchimp-success-resubscribed-response` - Filter the "Success: Re-subscriber" custom message. @params: $message, $form_id
211
+ * `yikes-mailchimp-user-already-subscribed-link-text` - Filter the "Success: Re-subscriber with link to email profile update message" custom message. @params: $message, $form_id
212
+ * `yikes-mailchimp-general-error-response` - Filter the "Error: General" custom message. @params: $message, $form_id
213
+ * `yikes-mailchimp-user-already-subscribed-text` - Filter the "Error: Re-subscribers not permitted" custom message (note: this replaced `yikes-mailchimp-user-already-subscribed-error`). @params: $message, $form_id
214
+ * `yikes-mailchimp-filter-groups-before-submission` and `yikes-mailchimp-filter-groups-before-submission-{$form_id}` - Filter the interest groups before they're submitted. @params: $groups, $form_id
215
+ * `yikes-mailchimp-address-2-required` - Change the address 2 field's `required` value. Default: `''` (it is never required) - @params: $required, $form_id
216
+ * `yikes-mailchimp-filter-subscribe-request` and `yikes-mailchimp-filter-subscribe-request-{$form_id}` - Filter all of the fields sent over to the MailChimp API (not just the form fields). @params: $subscribe_body, $form_id
217
+ * `yikesinc_eme_default_api_version` - Filter the API version. Default: `3.0` - @params: $version
218
+ * `yikesinc_eme_api_url` - Filter the URL used for a request to the MailChimp API. @params: $full_path, $path
219
+ * `yikesinc_eme_api_user_agent` - Filter the user agent used in API request. @params: $user_agent
220
+ * `yikesinc_eme_api_auth_headers` - Filter the authentication headers used in the API request. @params: $auth_headers, $api_version
221
+ * `yikesinc_eme_api_headers` - Filter the headers used for a request to the MailChimp API. @params: $headers, $path, $method, $params
222
+ * `yikesinc_eme_api_timeout` - Filter the timeout (in *seconds*) used when sending an API request. Default: `15` @params: $timeout
223
+ * `yikesinc_eme_api_args` - Filter the arguments used for a request to the MailChimp API. @params: $args, $path, $method, $params
224
 
225
  **Actions**
226
 
227
+ * `yikes-mailchimp-form-submission` and `yikes-mailchimp-form-submission-{$form_id}` - Do something with the user email + form data on form submission. @params: $email, $merge_variables, $form_id, $notifications
228
+ * `yikes-mailchimp-after-submission` and `yikes-mailchimp-after-submission-{$form_id}` - Do something with only the $merge_variables (note: these actions are fired off directly after `yikes-mailchimp-form-submission`).
229
+ * `yikes-mailchimp-before-submission` and `yikes-mailchimp-before-submission-{$form_id}` - Do something with the $merge_variables before the API request. @params: $merge_variables
230
+ * `yikes-mailchimp-after-form` - Do something after a form has been loaded. @params: $form_id
231
+ * `yikes-mailchimp-before-checkbox` - Do something (e.g. output custom content) before the opt-in checkbox for all integrations.
232
+ * `yikes-mailchimp-after-checkbox` - Do something (e.g. output custom content) after the opt-in checkbox for all integrations
233
+ * `yikes-mailchimp-support-page` - Do something (e.g. output custom content) on the support page (note: we use this to add our support form for premium users).
234
+ * `yikes-mailchimp-edit-form-section-links` - Add additional links to the edit form page next to 'Custom Messages'.
235
+ * `yikes-mailchimp-edit-form-sections` - Add custom section to the edit form page.
236
+ * `yikes-mailchimp-edit-form-notice` - Hook to display a custom notice on the edit form page.
237
+ * `yikes-mailchimp-shortcode-enqueue-scripts-styles` - Hook to enqueue custom scripts & styles wherever the shortcode is being used. @params: $form_id
238
+ * `yikes-mailchimp-additional-form-fields` - Define additional fields to add below all forms. @params: $form_data
239
+ * `yikes-mailchimp-custom-form-actions` - Add custom action links on the manage forms page (alongside Edit, Duplicate, Shortcode, Delete). @params: $form_id
240
+ * `yikes-mailchimp-list-form-fields-metabox` - Add additional content to the 'Form Fields' metabox on the view list page.
241
+ * `yikes-mailchimp-list-interest-groups-metabox` - Add additional content inside of the interest groups metabox on the view list page.
 
242
 
243
  == Changelog ==
244
 
245
+ = Easy Forms for MailChimp 6.3.0 - January 17th, 2016 =
246
+ * Version 6.3.0's biggest change is migrating the plugin to use MailChimp's v3 API.
247
+ * Created API classes to interact with the MailChimp API
248
+ * Converted all supported v2 endpoints to the corresponding v3 endpoint
249
+ * Refactored all v2 endpoints that are unsupported in v3 to use the new API classes
250
+ * Added filters to customize API requests
251
+
252
+ * Version 6.3.0 includes a suite of custom message updates:
253
+ * Removed the "invalid email" custom message (MailChimp v3 no longer supports error codes to detect things like an invalid email error)
254
+ * Updated the custom messages descriptions text
255
+ * Updated the success message - it is now specifically for successful double opt-in subscriptions
256
+ * Added two new custom success messages: "Success: Single opt-in" for successful single opt-in subscriptions, and "Success: Re-subscriber" for successful re-subscriptions
257
+ * Added two new custom messages for customizing the "update your profile link" email: "Email Subject" to customize the subject of the email, and "Email body" to customize the body of the email
258
+ * Added/Updated filters for each custom message type. See the `Filters` section for more details.
259
+
260
+ * Version 6.3.0 includes a suite of bug fixes, enhancements, and changes:
261
+ * Added server-side validation to check for required form fields and required interest groups; this supports browsers like Safari that do not support the HTML 5 `required` attribute, or situations where the JavaScript validation fails
262
+ * Added the HTML 5 required attribute to radio button and dropdown formatted interest groups
263
+ * Wrapped the subscription form submit button's text in a span to better support adding custom HTML to the submit button text
264
+ * Changed the types of values that are wiped out after submission to better support subscribing multiple times without refreshing the page
265
+ * Added a nonce to the subscription form submission
266
+ * Multiple interest groups can now be highlighted and added to the form at the same time (instead of one at a time)
267
+ * Fixed the way default values work for interest groups and checkbox/dropdown/radio form fields
268
+ * Changed the way the datepicker displays birthdays when the date format is DD/MM
269
+ * Added error handling and a default error message for fatal server errors ('Error collecting the API response')
270
+ * Allowing + signs for phone fields using MailChimp's international phone format (supports country codes)
271
+ * Added transients throughout the application for common requests (e.g. MailChimp API requests and internal form data requests)
272
+ * The "Send Welcome Email" option is no longer supported by MailChimp and has been removed
273
+ * The second address line (addr2) is never required by default (this can be changed using a filter - see `yikes-mailchimp-address-2-required`).
274
+
275
+ * Version 6.3.0 includes a lot of new filters, some renamed filters, some new parameters added, and some filters removed. For a complete list of available filters, please see the newly updated filters section. Here are some of the highlights:
276
+ * Renamed filters `yikes-mailchimp-before-submission` and `yikes-mailchimp-before-submission-{$form_id}` to `yikes-mailchimp-filter-before-submission` and `yikes-mailchimp-filter-before-submission-{$form_id}`. This prevents conflicts between the actions of the same name.
277
+ * Renamed filter `yikes-mailchimp-user-already-subscribed-error` to `yikes-mailchimp-user-already-subscribed-text`
278
+ * Added filters `yikes-mailchimp-filter-groups-before-submission` and `yikes-mailchimp-filter-groups-before-submission-{$form_id}` to filter the interest groups before they're submitted
279
+ * Removed filters `yikes-mailchimp-user-subscribe-api-request`, `yikes-mailchimp-checkbox-integration-subscribe-api-request`
280
+ * Removed filter `yikes-mailchimp-interest-group-required-top-error` - replaced by `yikes-mailchimp-required-interest-group-missing` - this handles all types of interest group fields, not just checkboxes
281
+ * Removed filter `yikes-mailchimp-interest-group-checkbox-error` - missing fields are now highlighted
282
+
283
  = Easy Forms for MailChimp 6.2.4 - December 6th, 2016 =
284
  * Fixed the way birthday field data was being handled / stored
285
  * Added version number to main AJAX JavaScript file - Thanks goes to Viktor Szépe for committing this change
yikes-inc-easy-mailchimp-extender.php CHANGED
@@ -1,21 +1,21 @@
1
  <?php
2
  /**
3
- * Plugin Name: Easy Forms for MailChimp by YIKES
4
- * Plugin URI: http://www.yikesinc.com/services/yikes-inc-easy-mailchimp-extender/
5
- * Description: YIKES Easy Forms for MailChimp links your site to MailChimp and allows you to generate and display mailing list opt-in forms anywhere on your site with ease.
6
- * Version: 6.2.4
7
- * Author: YIKES
8
- * Author URI: http://www.yikesinc.com/
9
  * License: GPL-3.0+
10
  * License URI: http://www.gnu.org/licenses/gpl-3.0.txt
11
  * Text Domain: yikes-inc-easy-mailchimp-extender
12
  *
13
- * YIKES Easy Forms for MailChimp is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License as published by
15
  * the Free Software Foundation, either version 2 of the License, or
16
  * any later version.
17
  *
18
- * YIKES Easy Forms for MailChimp is distributed in the hope that it will be useful,
19
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
  * GNU General Public License for more details.
@@ -23,8 +23,8 @@
23
  * You should have received a copy of the GNU General Public License
24
  * along with Easy Forms for MailChimp. If not, see <http://www.gnu.org/licenses/>.
25
  *
26
- * We at YIKES Inc. embrace the open source philosophy on a daily basis. We donate company time back to the WordPress project,
27
- * and constantly strive to improve the WordPress project and community as a whole. We eat, sleep and breathe WordPress.
28
  *
29
  * "'Free software' is a matter of liberty, not price. To understand the concept, you should think of 'free' as in 'free speech,' not as in 'free beer'."
30
  * - Richard Stallman
@@ -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.2.1' );
46
  }
47
 
48
  /**
@@ -193,17 +193,33 @@ yikes_inc_easy_mailchimp_extender()->run();
193
  * Helper function to return our API key
194
  * Support the use of a PHP constant
195
  * @return string MailChimp API key from the PHP constant, or the options
196
- * @security strip away tags and patch security
197
  * @since 6.2.2
198
  */
199
  function yikes_get_mc_api_key() {
200
  if ( defined( 'YIKES_MC_API_KEY' ) ) {
201
- return trim( strip_tags ( YIKES_MC_API_KEY ) );
202
  }
203
 
204
  return trim( strip_tags( get_option( 'yikes-mc-api-key', '' ) ) );
205
  }
206
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
207
  add_action( 'plugins_loaded', 'yikes_mailchimp_plugin_textdomain' );
208
  function yikes_mailchimp_plugin_textdomain() {
209
  load_plugin_textdomain( 'yikes-inc-easy-mailchimp-extender', false, plugin_basename( dirname( __FILE__ ) ) . '/languages' );
1
  <?php
2
  /**
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.0
7
+ * Author: YIKES, Inc.
8
+ * Author URI: https://www.yikesplugins.com/
9
  * License: GPL-3.0+
10
  * License URI: http://www.gnu.org/licenses/gpl-3.0.txt
11
  * Text Domain: yikes-inc-easy-mailchimp-extender
12
  *
13
+ * Easy Forms for MailChimp is free software: you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License as published by
15
  * the Free Software Foundation, either version 2 of the License, or
16
  * any later version.
17
  *
18
+ * Easy Forms for MailChimp is distributed in the hope that it will be useful,
19
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
  * GNU General Public License for more details.
23
  * You should have received a copy of the GNU General Public License
24
  * along with Easy Forms for MailChimp. If not, see <http://www.gnu.org/licenses/>.
25
  *
26
+ * We at YIKES, Inc. embrace the open source philosophy on a daily basis. We donate company time back to the WordPress project,
27
+ * and constantly strive to improve the WordPress project and community as a whole.
28
  *
29
  * "'Free software' is a matter of liberty, not price. To understand the concept, you should think of 'free' as in 'free speech,' not as in 'free beer'."
30
  * - Richard Stallman
42
  * @since 6.1.3
43
  */
44
  if ( ! defined( 'YIKES_MC_VERSION' ) ) {
45
+ define( 'YIKES_MC_VERSION' , '6.3.0' );
46
  }
47
 
48
  /**
193
  * Helper function to return our API key
194
  * Support the use of a PHP constant
195
  * @return string MailChimp API key from the PHP constant, or the options
196
+ * @security strip away tags and patch security
197
  * @since 6.2.2
198
  */
199
  function yikes_get_mc_api_key() {
200
  if ( defined( 'YIKES_MC_API_KEY' ) ) {
201
+ return trim( strip_tags( YIKES_MC_API_KEY ) );
202
  }
203
 
204
  return trim( strip_tags( get_option( 'yikes-mc-api-key', '' ) ) );
205
  }
206
 
207
+ /**
208
+ * Get the API Manager instance.
209
+ *
210
+ * @author Jeremy Pry
211
+ * @return Yikes_Inc_Easy_MailChimp_API_Manager
212
+ */
213
+ function yikes_get_mc_api_manager() {
214
+ static $manager = null;
215
+
216
+ if ( null === $manager ) {
217
+ $manager = new Yikes_Inc_Easy_MailChimp_API_Manager( yikes_get_mc_api_key() );
218
+ }
219
+
220
+ return $manager;
221
+ }
222
+
223
  add_action( 'plugins_loaded', 'yikes_mailchimp_plugin_textdomain' );
224
  function yikes_mailchimp_plugin_textdomain() {
225
  load_plugin_textdomain( 'yikes-inc-easy-mailchimp-extender', false, plugin_basename( dirname( __FILE__ ) ) . '/languages' );