Version Description
Download this release
Release Info
| Developer | hiwhatsup |
| Plugin | |
| Version | 6.2.3 |
| Comparing to | |
| See all releases | |
Code changes from version 6.2.2 to 6.2.3
- admin/class-yikes-inc-easy-mailchimp-extender-admin.php +84 -26
- admin/js/min/yikes-inc-easy-mailchimp-tinymce-button.min.js +1 -1
- admin/js/yikes-inc-easy-mailchimp-tinymce-button.js +124 -1
- admin/partials/helpers/fields/yikes-mailchimp-checkbox-field.php +5 -1
- admin/partials/helpers/fields/yikes-mailchimp-file-field.php +6 -1
- admin/partials/helpers/fields/yikes-mailchimp-radio-field.php +5 -1
- admin/partials/helpers/fields/yikes-mailchimp-select-field.php +5 -1
- admin/partials/helpers/fields/yikes-mailchimp-text-field.php +5 -1
- admin/partials/helpers/fields/yikes-mailchimp-wysiwyg-field.php +6 -1
- admin/partials/menu/manage-forms.php +15 -1
- admin/partials/menu/manage-lists.php +15 -1
- admin/partials/view-user.php +41 -5
- admin/partials/welcome-page/welcome-sections/knowledge-base-section.php +10 -15
- readme.txt +10 -3
- yikes-inc-easy-mailchimp-extender.php +1 -1
admin/class-yikes-inc-easy-mailchimp-extender-admin.php
CHANGED
|
@@ -61,18 +61,25 @@ class Yikes_Inc_Easy_Mailchimp_Forms_Admin {
|
|
| 61 |
* @author Jeremy Pry
|
| 62 |
*/
|
| 63 |
public function hooks() {
|
|
|
|
| 64 |
// check for old plugin options and migrate if exist
|
| 65 |
add_action( 'admin_menu', array( $this, 'register_admin_pages' ), 11 );
|
|
|
|
| 66 |
// check for old plugin options and migrate if exist
|
| 67 |
add_action( 'admin_init', array( $this, 'check_for_old_yks_mc_options' ) );
|
|
|
|
| 68 |
// Ajax function to update new options...
|
| 69 |
add_action( 'wp_ajax_migrate_old_plugin_settings', array( $this, 'migrate_archived_options' ) );
|
|
|
|
| 70 |
// Ajax function to migrate our forms
|
| 71 |
add_action( 'wp_ajax_migrate_prevoious_forms', array( $this, 'migrate_previously_setup_forms' ) );
|
|
|
|
| 72 |
// fix menu icon spacing
|
| 73 |
add_action( 'admin_head', array( $this, 'fix_menu_icon_spacing' ) );
|
|
|
|
| 74 |
// register our plugin settings
|
| 75 |
add_action( 'admin_init', array( $this, 'yikes_easy_mc_settings_init' ) );
|
|
|
|
| 76 |
// plugin redirect on activation
|
| 77 |
add_action( 'admin_init', array( $this, 'yikes_easy_mc_activation_redirect' ) );
|
| 78 |
|
|
@@ -90,124 +97,181 @@ class Yikes_Inc_Easy_Mailchimp_Forms_Admin {
|
|
| 90 |
|
| 91 |
// load up our helper class
|
| 92 |
add_action( 'admin_init', array( $this, 'yikes_mailchimp_load_helper_class' ) );
|
|
|
|
| 93 |
// process the subscriber count shortcode in form descriptions
|
| 94 |
add_action( 'yikes-mailchimp-form-description', array( $this, 'process_subscriber_count_shortcode_in_form_descriptions' ), 10, 2 );
|
|
|
|
| 95 |
/***********************/
|
| 96 |
/** Create A Form **/
|
| 97 |
/**********************/
|
| 98 |
if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-create-form' ) {
|
|
|
|
| 99 |
add_action( 'init', array( $this, 'yikes_easy_mailchimp_create_form' ) );
|
|
|
|
| 100 |
}
|
|
|
|
| 101 |
/***********************/
|
| 102 |
/** Delete A Form **/
|
| 103 |
/**********************/
|
| 104 |
if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-delete-form' ) {
|
|
|
|
| 105 |
add_action( 'init', array( $this, 'yikes_easy_mailchimp_delete_form' ) );
|
|
|
|
| 106 |
}
|
|
|
|
| 107 |
/**********************************/
|
| 108 |
/** Duplicate/Clone A Form **/
|
| 109 |
/********************************/
|
| 110 |
if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-duplicate-form' ) {
|
|
|
|
| 111 |
add_action( 'init', array( $this, 'yikes_easy_mailchimp_duplicate_form' ) );
|
|
|
|
| 112 |
}
|
|
|
|
| 113 |
/*************************************/
|
| 114 |
/** Reset Form Impression Stats **/
|
| 115 |
/***********************************/
|
| 116 |
if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-reset-stats' ) {
|
|
|
|
| 117 |
add_action( 'init', array( $this, 'yikes_easy_mailchimp_reset_impression_stats' ) );
|
|
|
|
| 118 |
}
|
|
|
|
| 119 |
/**********************************/
|
| 120 |
/** Update A Form **/
|
| 121 |
/********************************/
|
| 122 |
if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-update-form' ) {
|
|
|
|
| 123 |
add_action( 'init', array( $this, 'yikes_easy_mailchimp_update_form' ) );
|
|
|
|
| 124 |
}
|
|
|
|
| 125 |
/**************************************************/
|
| 126 |
/** Clear Store MailChimp Transient Data **/
|
| 127 |
/*************************************************/
|
| 128 |
if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-clear-transient-data' ) {
|
|
|
|
| 129 |
add_action( 'init', array( $this, 'yikes_easy_mailchimp_clear_transient_data' ) );
|
|
|
|
| 130 |
}
|
|
|
|
| 131 |
/*******************************************/
|
| 132 |
/** Remove a user from a mailing list **/
|
| 133 |
/*****************************************/
|
| 134 |
if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-unsubscribe-user' ) {
|
|
|
|
| 135 |
add_action( 'init', array( $this, 'yikes_easy_mailchimp_unsubscribe_user' ) );
|
|
|
|
| 136 |
}
|
|
|
|
| 137 |
/*******************************************/
|
| 138 |
/** Create misisng error log file **/
|
| 139 |
/*****************************************/
|
| 140 |
if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-create-error-log' ) {
|
|
|
|
| 141 |
add_action( 'init', array( $this, 'yikes_easy_mailchimp_create_missing_error_log' ) );
|
|
|
|
| 142 |
}
|
|
|
|
| 143 |
/*******************************************/
|
| 144 |
/** TinyMCE Initialization Functions **/
|
| 145 |
/*****************************************/
|
| 146 |
add_action( 'admin_head', array( $this, 'add_tinyMCE_buttons' ) );
|
|
|
|
| 147 |
// pass our lists data to tinyMCE button for use
|
| 148 |
foreach ( array( 'post.php', 'post-new.php' ) as $hook ) {
|
| 149 |
-
|
|
|
|
|
|
|
| 150 |
}
|
|
|
|
| 151 |
// display an admin notice for users on PHP < 5.3
|
| 152 |
if ( phpversion() < '5.3' ) {
|
| 153 |
add_action( "admin_notices", array( $this, 'display_php_warning' ), 999 );
|
| 154 |
}
|
|
|
|
| 155 |
// two week , dismissable notification - check the users plugin installation date
|
| 156 |
add_action( 'admin_init', array( $this, 'yikes_easy_mailchimp_check_installation_date' ) );
|
|
|
|
| 157 |
// dismissable notice admin side
|
| 158 |
add_action( 'admin_init', array( $this, 'yikes_easy_mailchimp_stop_bugging_me' ), 5 );
|
|
|
|
| 159 |
/**************************************************/
|
| 160 |
/** Clear MailChimp Error Log Data **/
|
| 161 |
/*************************************************/
|
| 162 |
if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-clear-error-log' ) {
|
|
|
|
| 163 |
add_action( 'init', array( $this, 'yikes_easy_mailchimp_clear_error_log' ) );
|
|
|
|
| 164 |
}
|
|
|
|
| 165 |
/*********************************************/
|
| 166 |
/** Export MailChimp Opt-in Forms **/
|
| 167 |
/*******************************************/
|
| 168 |
if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-export-forms' ) {
|
|
|
|
| 169 |
add_action( 'init', array( $this, 'yikes_easy_mailchimp_export_forms' ) );
|
|
|
|
| 170 |
}
|
|
|
|
| 171 |
/*********************************************/
|
| 172 |
/** Export Plugin Settings **/
|
| 173 |
/*******************************************/
|
| 174 |
if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-export-settings' ) {
|
|
|
|
| 175 |
add_action( 'init', array( $this, 'yikes_easy_mailchimp_export_plugin_settings' ) );
|
|
|
|
| 176 |
}
|
|
|
|
| 177 |
/*******************************************/
|
| 178 |
/** Import Class Inclusion **/
|
| 179 |
/*****************************************/
|
| 180 |
if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-import-forms' ) {
|
|
|
|
| 181 |
add_action( 'init', array( $this, 'yikes_easy_mailchimp_import_forms' ) );
|
|
|
|
| 182 |
}
|
|
|
|
| 183 |
/*******************************************/
|
| 184 |
/** Premium Support Request **/
|
| 185 |
/*****************************************/
|
| 186 |
if ( isset( $_POST['submit-premium-support-request'] ) ) {
|
|
|
|
| 187 |
add_action( 'init', array( $this, 'yikes_easy_mailchimp_premium_support_request' ) );
|
|
|
|
| 188 |
}
|
|
|
|
| 189 |
/****************************************/
|
| 190 |
/** Dismiss Options Migrations **/
|
| 191 |
/****************************************/
|
| 192 |
if ( isset( $_REQUEST['dismiss_migration_nonce'] ) ) {
|
|
|
|
| 193 |
add_action( 'init', array( $this, 'yikes_easy_mailchimp_dismiss_option_migrate' ) );
|
|
|
|
| 194 |
}
|
|
|
|
| 195 |
/** Parse default value into usable dynamic data **/
|
| 196 |
add_filter( 'yikes-mailchimp-process-default-tag', array( $this, 'parse_mailchimp_default_tag' ) );
|
|
|
|
| 197 |
/** Add a disclaimer to ensure that we let people know we are not endorsed/backed by MailChimp at all **/
|
| 198 |
add_filter( 'admin_footer_text', array( $this, 'yikes_easy_forms_admin_disclaimer' ) );
|
|
|
|
| 199 |
/** Add custom plugin action links **/
|
| 200 |
add_filter( 'plugin_action_links_yikes-inc-easy-mailchimp-extender/yikes-inc-easy-mailchimp-extender.php', array( $this, 'easy_forms_plugin_action_links' ) );
|
|
|
|
| 201 |
/* Alter the color scheme based on the users selection */
|
| 202 |
add_action( 'admin_print_scripts', array( $this, 'alter_yikes_easy_mc_color_scheme' ) );
|
|
|
|
| 203 |
// hook in and display our knowledge base articles on the support page
|
| 204 |
add_action( 'yikes-mailchimp-support-page', array( $this, 'hook_and_display_kb_article_RSS' ) );
|
|
|
|
| 205 |
// ensure that the upgrade went smoothly, else we have to let the user know we need to upgrade the database
|
| 206 |
// after upgrading f rom 6.0.3.7 users need to upgrade the database as well
|
| 207 |
add_action( 'plugins_loaded', array( $this, 'check_yikes_mc_table_version' ) );
|
| 208 |
|
| 209 |
// Run a check to see if we need to convert the custom DB table to options.
|
| 210 |
add_action( 'plugins_loaded', array( $this, 'check_db_version' ) );
|
|
|
|
| 211 |
}
|
| 212 |
|
| 213 |
/*
|
|
@@ -216,9 +280,9 @@ class Yikes_Inc_Easy_Mailchimp_Forms_Admin {
|
|
| 216 |
* @ return array $links New array of plugin actions
|
| 217 |
*/
|
| 218 |
public function easy_forms_plugin_action_links( $links ) {
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
}
|
| 223 |
|
| 224 |
/**
|
|
@@ -554,10 +618,11 @@ class Yikes_Inc_Easy_Mailchimp_Forms_Admin {
|
|
| 554 |
|
| 555 |
// inlcude the js for tinymce
|
| 556 |
public function yks_mc_add_tinymce_plugin( $plugin_array ) {
|
|
|
|
| 557 |
$plugin_array['yks_mc_tinymce_button'] = plugins_url( '/js/min/yikes-inc-easy-mailchimp-tinymce-button.min.js', __FILE__ );
|
| 558 |
-
|
| 559 |
-
// var_dump( $plugin_array );
|
| 560 |
return $plugin_array;
|
|
|
|
| 561 |
}
|
| 562 |
|
| 563 |
/**
|
|
@@ -587,27 +652,20 @@ class Yikes_Inc_Easy_Mailchimp_Forms_Admin {
|
|
| 587 |
'value' => '-'
|
| 588 |
);
|
| 589 |
}
|
|
|
|
| 590 |
/* Pass our form data to our JS file for use */
|
| 591 |
-
|
| 592 |
-
|
| 593 |
-
|
| 594 |
-
|
| 595 |
-
|
| 596 |
-
|
| 597 |
-
|
| 598 |
-
|
| 599 |
-
|
| 600 |
-
|
| 601 |
-
|
| 602 |
-
|
| 603 |
-
'submit_button_message' : '<?php _e( '<em>If left empty, the button will use the default submit button text .</em>', 'yikes-inc-easy-mailchimp-extender' ); ?>'
|
| 604 |
-
};
|
| 605 |
-
<?php
|
| 606 |
-
$link = sprintf( __( 'You need to <a href="%s" title="%s">create a form</a> before you can add one to a page or post.', 'yikes-inc-easy-mailchimp-extender' ), esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ), __( 'Create a form', 'yikes-inc-easy-mailchimp-extender' ) );
|
| 607 |
-
?>
|
| 608 |
-
var alert_translated = '<?php echo $link; ?>';
|
| 609 |
-
</script>
|
| 610 |
-
<?php
|
| 611 |
}
|
| 612 |
/* End TinyMCE Functions */
|
| 613 |
|
| 61 |
* @author Jeremy Pry
|
| 62 |
*/
|
| 63 |
public function hooks() {
|
| 64 |
+
|
| 65 |
// check for old plugin options and migrate if exist
|
| 66 |
add_action( 'admin_menu', array( $this, 'register_admin_pages' ), 11 );
|
| 67 |
+
|
| 68 |
// check for old plugin options and migrate if exist
|
| 69 |
add_action( 'admin_init', array( $this, 'check_for_old_yks_mc_options' ) );
|
| 70 |
+
|
| 71 |
// Ajax function to update new options...
|
| 72 |
add_action( 'wp_ajax_migrate_old_plugin_settings', array( $this, 'migrate_archived_options' ) );
|
| 73 |
+
|
| 74 |
// Ajax function to migrate our forms
|
| 75 |
add_action( 'wp_ajax_migrate_prevoious_forms', array( $this, 'migrate_previously_setup_forms' ) );
|
| 76 |
+
|
| 77 |
// fix menu icon spacing
|
| 78 |
add_action( 'admin_head', array( $this, 'fix_menu_icon_spacing' ) );
|
| 79 |
+
|
| 80 |
// register our plugin settings
|
| 81 |
add_action( 'admin_init', array( $this, 'yikes_easy_mc_settings_init' ) );
|
| 82 |
+
|
| 83 |
// plugin redirect on activation
|
| 84 |
add_action( 'admin_init', array( $this, 'yikes_easy_mc_activation_redirect' ) );
|
| 85 |
|
| 97 |
|
| 98 |
// load up our helper class
|
| 99 |
add_action( 'admin_init', array( $this, 'yikes_mailchimp_load_helper_class' ) );
|
| 100 |
+
|
| 101 |
// process the subscriber count shortcode in form descriptions
|
| 102 |
add_action( 'yikes-mailchimp-form-description', array( $this, 'process_subscriber_count_shortcode_in_form_descriptions' ), 10, 2 );
|
| 103 |
+
|
| 104 |
/***********************/
|
| 105 |
/** Create A Form **/
|
| 106 |
/**********************/
|
| 107 |
if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-create-form' ) {
|
| 108 |
+
|
| 109 |
add_action( 'init', array( $this, 'yikes_easy_mailchimp_create_form' ) );
|
| 110 |
+
|
| 111 |
}
|
| 112 |
+
|
| 113 |
/***********************/
|
| 114 |
/** Delete A Form **/
|
| 115 |
/**********************/
|
| 116 |
if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-delete-form' ) {
|
| 117 |
+
|
| 118 |
add_action( 'init', array( $this, 'yikes_easy_mailchimp_delete_form' ) );
|
| 119 |
+
|
| 120 |
}
|
| 121 |
+
|
| 122 |
/**********************************/
|
| 123 |
/** Duplicate/Clone A Form **/
|
| 124 |
/********************************/
|
| 125 |
if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-duplicate-form' ) {
|
| 126 |
+
|
| 127 |
add_action( 'init', array( $this, 'yikes_easy_mailchimp_duplicate_form' ) );
|
| 128 |
+
|
| 129 |
}
|
| 130 |
+
|
| 131 |
/*************************************/
|
| 132 |
/** Reset Form Impression Stats **/
|
| 133 |
/***********************************/
|
| 134 |
if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-reset-stats' ) {
|
| 135 |
+
|
| 136 |
add_action( 'init', array( $this, 'yikes_easy_mailchimp_reset_impression_stats' ) );
|
| 137 |
+
|
| 138 |
}
|
| 139 |
+
|
| 140 |
/**********************************/
|
| 141 |
/** Update A Form **/
|
| 142 |
/********************************/
|
| 143 |
if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-update-form' ) {
|
| 144 |
+
|
| 145 |
add_action( 'init', array( $this, 'yikes_easy_mailchimp_update_form' ) );
|
| 146 |
+
|
| 147 |
}
|
| 148 |
+
|
| 149 |
/**************************************************/
|
| 150 |
/** Clear Store MailChimp Transient Data **/
|
| 151 |
/*************************************************/
|
| 152 |
if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-clear-transient-data' ) {
|
| 153 |
+
|
| 154 |
add_action( 'init', array( $this, 'yikes_easy_mailchimp_clear_transient_data' ) );
|
| 155 |
+
|
| 156 |
}
|
| 157 |
+
|
| 158 |
/*******************************************/
|
| 159 |
/** Remove a user from a mailing list **/
|
| 160 |
/*****************************************/
|
| 161 |
if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-unsubscribe-user' ) {
|
| 162 |
+
|
| 163 |
add_action( 'init', array( $this, 'yikes_easy_mailchimp_unsubscribe_user' ) );
|
| 164 |
+
|
| 165 |
}
|
| 166 |
+
|
| 167 |
/*******************************************/
|
| 168 |
/** Create misisng error log file **/
|
| 169 |
/*****************************************/
|
| 170 |
if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-create-error-log' ) {
|
| 171 |
+
|
| 172 |
add_action( 'init', array( $this, 'yikes_easy_mailchimp_create_missing_error_log' ) );
|
| 173 |
+
|
| 174 |
}
|
| 175 |
+
|
| 176 |
/*******************************************/
|
| 177 |
/** TinyMCE Initialization Functions **/
|
| 178 |
/*****************************************/
|
| 179 |
add_action( 'admin_head', array( $this, 'add_tinyMCE_buttons' ) );
|
| 180 |
+
|
| 181 |
// pass our lists data to tinyMCE button for use
|
| 182 |
foreach ( array( 'post.php', 'post-new.php' ) as $hook ) {
|
| 183 |
+
|
| 184 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'tinymce_yikes_easy_mc' ) );
|
| 185 |
+
|
| 186 |
}
|
| 187 |
+
|
| 188 |
// display an admin notice for users on PHP < 5.3
|
| 189 |
if ( phpversion() < '5.3' ) {
|
| 190 |
add_action( "admin_notices", array( $this, 'display_php_warning' ), 999 );
|
| 191 |
}
|
| 192 |
+
|
| 193 |
// two week , dismissable notification - check the users plugin installation date
|
| 194 |
add_action( 'admin_init', array( $this, 'yikes_easy_mailchimp_check_installation_date' ) );
|
| 195 |
+
|
| 196 |
// dismissable notice admin side
|
| 197 |
add_action( 'admin_init', array( $this, 'yikes_easy_mailchimp_stop_bugging_me' ), 5 );
|
| 198 |
+
|
| 199 |
/**************************************************/
|
| 200 |
/** Clear MailChimp Error Log Data **/
|
| 201 |
/*************************************************/
|
| 202 |
if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-clear-error-log' ) {
|
| 203 |
+
|
| 204 |
add_action( 'init', array( $this, 'yikes_easy_mailchimp_clear_error_log' ) );
|
| 205 |
+
|
| 206 |
}
|
| 207 |
+
|
| 208 |
/*********************************************/
|
| 209 |
/** Export MailChimp Opt-in Forms **/
|
| 210 |
/*******************************************/
|
| 211 |
if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-export-forms' ) {
|
| 212 |
+
|
| 213 |
add_action( 'init', array( $this, 'yikes_easy_mailchimp_export_forms' ) );
|
| 214 |
+
|
| 215 |
}
|
| 216 |
+
|
| 217 |
/*********************************************/
|
| 218 |
/** Export Plugin Settings **/
|
| 219 |
/*******************************************/
|
| 220 |
if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-export-settings' ) {
|
| 221 |
+
|
| 222 |
add_action( 'init', array( $this, 'yikes_easy_mailchimp_export_plugin_settings' ) );
|
| 223 |
+
|
| 224 |
}
|
| 225 |
+
|
| 226 |
/*******************************************/
|
| 227 |
/** Import Class Inclusion **/
|
| 228 |
/*****************************************/
|
| 229 |
if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-import-forms' ) {
|
| 230 |
+
|
| 231 |
add_action( 'init', array( $this, 'yikes_easy_mailchimp_import_forms' ) );
|
| 232 |
+
|
| 233 |
}
|
| 234 |
+
|
| 235 |
/*******************************************/
|
| 236 |
/** Premium Support Request **/
|
| 237 |
/*****************************************/
|
| 238 |
if ( isset( $_POST['submit-premium-support-request'] ) ) {
|
| 239 |
+
|
| 240 |
add_action( 'init', array( $this, 'yikes_easy_mailchimp_premium_support_request' ) );
|
| 241 |
+
|
| 242 |
}
|
| 243 |
+
|
| 244 |
/****************************************/
|
| 245 |
/** Dismiss Options Migrations **/
|
| 246 |
/****************************************/
|
| 247 |
if ( isset( $_REQUEST['dismiss_migration_nonce'] ) ) {
|
| 248 |
+
|
| 249 |
add_action( 'init', array( $this, 'yikes_easy_mailchimp_dismiss_option_migrate' ) );
|
| 250 |
+
|
| 251 |
}
|
| 252 |
+
|
| 253 |
/** Parse default value into usable dynamic data **/
|
| 254 |
add_filter( 'yikes-mailchimp-process-default-tag', array( $this, 'parse_mailchimp_default_tag' ) );
|
| 255 |
+
|
| 256 |
/** Add a disclaimer to ensure that we let people know we are not endorsed/backed by MailChimp at all **/
|
| 257 |
add_filter( 'admin_footer_text', array( $this, 'yikes_easy_forms_admin_disclaimer' ) );
|
| 258 |
+
|
| 259 |
/** Add custom plugin action links **/
|
| 260 |
add_filter( 'plugin_action_links_yikes-inc-easy-mailchimp-extender/yikes-inc-easy-mailchimp-extender.php', array( $this, 'easy_forms_plugin_action_links' ) );
|
| 261 |
+
|
| 262 |
/* Alter the color scheme based on the users selection */
|
| 263 |
add_action( 'admin_print_scripts', array( $this, 'alter_yikes_easy_mc_color_scheme' ) );
|
| 264 |
+
|
| 265 |
// hook in and display our knowledge base articles on the support page
|
| 266 |
add_action( 'yikes-mailchimp-support-page', array( $this, 'hook_and_display_kb_article_RSS' ) );
|
| 267 |
+
|
| 268 |
// ensure that the upgrade went smoothly, else we have to let the user know we need to upgrade the database
|
| 269 |
// after upgrading f rom 6.0.3.7 users need to upgrade the database as well
|
| 270 |
add_action( 'plugins_loaded', array( $this, 'check_yikes_mc_table_version' ) );
|
| 271 |
|
| 272 |
// Run a check to see if we need to convert the custom DB table to options.
|
| 273 |
add_action( 'plugins_loaded', array( $this, 'check_db_version' ) );
|
| 274 |
+
|
| 275 |
}
|
| 276 |
|
| 277 |
/*
|
| 280 |
* @ return array $links New array of plugin actions
|
| 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 |
/**
|
| 618 |
|
| 619 |
// inlcude the js for tinymce
|
| 620 |
public function yks_mc_add_tinymce_plugin( $plugin_array ) {
|
| 621 |
+
|
| 622 |
$plugin_array['yks_mc_tinymce_button'] = plugins_url( '/js/min/yikes-inc-easy-mailchimp-tinymce-button.min.js', __FILE__ );
|
| 623 |
+
|
|
|
|
| 624 |
return $plugin_array;
|
| 625 |
+
|
| 626 |
}
|
| 627 |
|
| 628 |
/**
|
| 652 |
'value' => '-'
|
| 653 |
);
|
| 654 |
}
|
| 655 |
+
|
| 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' ),
|
| 664 |
+
'submit_button_text_label' => __( 'Custom Submit Button Text' , 'yikes-inc-easy-mailchimp-extender' ),
|
| 665 |
+
'submit_button_message' => '<em>' . __( 'If left empty, the button will use the default submit button text .', 'yikes-inc-easy-mailchimp-extender' ) . '</em>',
|
| 666 |
+
'alert_translated' => sprintf( __( 'You need to <a href=%s title="%s">create a form</a> before you can add one to a page or post.', 'yikes-inc-easy-mailchimp-extender' ), esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ), __( 'Create a form', 'yikes-inc-easy-mailchimp-extender' ) ),
|
| 667 |
+
) );
|
| 668 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 669 |
}
|
| 670 |
/* End TinyMCE Functions */
|
| 671 |
|
admin/js/min/yikes-inc-easy-mailchimp-tinymce-button.min.js
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
!function(){for(var a=parseInt(
|
| 1 |
+
!function(){for(var a=JSON.parse(localized_data.forms),b=parseInt(a.length-1),c=0;c<=b;)a[c].text=decodeURI(a[c].text.replace(/\+/g," ")),c++;tinymce.PluginManager.add("yks_mc_tinymce_button",function(b){b.addButton("yks_mc_tinymce_button_key",{image:a.tinymce_icon,title:localized_data.button_title,onclick:function(){b.windowManager.open({title:localized_data.popup_title,body:[{type:"listbox",name:"list_id",label:localized_data.list_id_label,values:a},{type:"checkbox",name:"show_title",label:localized_data.show_title_label},{type:"checkbox",name:"show_description",label:localized_data.show_description_label},{type:"textbox",name:"submit_button_text",label:localized_data.submit_button_text_label},{type:"container",name:"submit_button_message",html:localized_data.submit_button_message}],id:"yikes_mailchimp_tinyMCE_modal",onsubmit:function(a){var c=a.data.list_id,d=a.data.submit_button_text,e=a.data.show_title,f=a.data.show_description;if("-"==c)return jQuery("#yikes_mailchimp_tinyMCE_modal").find(".mce-foot").find(".mce-widget").hide(),jQuery("#yikes_mailchimp_tinyMCE_modal-absend").next().prepend('<div class="error"><p>'+localized_data.alert_translated+"</p></div>"),!1;var g=[];g.push('form="'+c+'"'),!0===e&&g.push('title="1"'),!0===f&&g.push('description="1"'),""!==d&&g.push('submit="'+d+'"'),b.insertContent("[yikes-mailchimp "+g.join(" ")+"]")}})}})})}();
|
admin/js/yikes-inc-easy-mailchimp-tinymce-button.js
CHANGED
|
@@ -1 +1,124 @@
|
|
| 1 |
-
( function() {
|
| 2 |
tinymce.PluginManager.add( 'yks_mc_tinymce_button', function( editor ) {
|
| 3 |
/* Add a button that opens a window */
|
| 4 |
editor.addButton( 'yks_mc_tinymce_button_key', {
|
| 5 |
image: forms.tinymce_icon,
|
| 6 |
onclick: function() {
|
| 7 |
/* Open window */
|
| 8 |
}
|
| 9 |
} );
|
| 10 |
} );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
tinymce.PluginManager.add( 'yks_mc_tinymce_button', function( editor ) {
|
| 2 |
/* Add a button that opens a window */
|
| 3 |
editor.addButton( 'yks_mc_tinymce_button_key', {
|
| 4 |
image: forms.tinymce_icon,
|
| 5 |
onclick: function() {
|
| 6 |
/* Open window */
|
| 7 |
}
|
| 8 |
} );
|
| 9 |
} );
|
| 10 |
+
( function() {
|
| 11 |
+
|
| 12 |
+
var forms = JSON.parse( localized_data.forms );
|
| 13 |
+
|
| 14 |
+
/* loop over the stored options and decode them for display back to the user */
|
| 15 |
+
/* used to escape quotes and add appropriate spaces */
|
| 16 |
+
var array_length = parseInt( forms.length - 1 );
|
| 17 |
+
|
| 18 |
+
var i = 0;
|
| 19 |
+
while( i <= array_length ) {
|
| 20 |
+
forms[i].text = decodeURI(forms[i].text.replace( /\+/g , ' ' ) );
|
| 21 |
+
i++;
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
tinymce.PluginManager.add( 'yks_mc_tinymce_button', function( editor ) {
|
| 25 |
+
|
| 26 |
+
/* Add a button that opens a window */
|
| 27 |
+
editor.addButton( 'yks_mc_tinymce_button_key', {
|
| 28 |
+
|
| 29 |
+
image: forms.tinymce_icon,
|
| 30 |
+
|
| 31 |
+
title: localized_data.button_title,
|
| 32 |
+
|
| 33 |
+
onclick: function() {
|
| 34 |
+
|
| 35 |
+
/* Open window */
|
| 36 |
+
editor.windowManager.open( {
|
| 37 |
+
|
| 38 |
+
title: localized_data.popup_title,
|
| 39 |
+
|
| 40 |
+
body: [
|
| 41 |
+
{
|
| 42 |
+
type: 'listbox',
|
| 43 |
+
name: 'list_id',
|
| 44 |
+
label: localized_data.list_id_label,
|
| 45 |
+
values: forms
|
| 46 |
+
},
|
| 47 |
+
{
|
| 48 |
+
type: 'checkbox',
|
| 49 |
+
name: 'show_title',
|
| 50 |
+
label: localized_data.show_title_label
|
| 51 |
+
},
|
| 52 |
+
{
|
| 53 |
+
type: 'checkbox',
|
| 54 |
+
name: 'show_description',
|
| 55 |
+
label: localized_data.show_description_label
|
| 56 |
+
},
|
| 57 |
+
{
|
| 58 |
+
type: 'textbox',
|
| 59 |
+
name: 'submit_button_text',
|
| 60 |
+
label: localized_data.submit_button_text_label
|
| 61 |
+
},
|
| 62 |
+
{
|
| 63 |
+
type: 'container',
|
| 64 |
+
name: 'submit_button_message',
|
| 65 |
+
html: localized_data.submit_button_message
|
| 66 |
+
}
|
| 67 |
+
],
|
| 68 |
+
|
| 69 |
+
id: 'yikes_mailchimp_tinyMCE_modal', /* and an ID to the modal, to target it easier */
|
| 70 |
+
|
| 71 |
+
onsubmit: function( e ) {
|
| 72 |
+
|
| 73 |
+
/* Insert content when the window form is submitted */
|
| 74 |
+
/* store the mailchimp list ID */
|
| 75 |
+
var mailChimp_form_id = e.data.list_id;
|
| 76 |
+
|
| 77 |
+
/* store the submit button text */
|
| 78 |
+
var submit_button_text = e.data.submit_button_text;
|
| 79 |
+
|
| 80 |
+
/* store if we should show the description */
|
| 81 |
+
var show_title = e.data.show_title;
|
| 82 |
+
|
| 83 |
+
/* store if we should show the description */
|
| 84 |
+
var show_description = e.data.show_description;
|
| 85 |
+
|
| 86 |
+
if ( mailChimp_form_id == '-' ) {
|
| 87 |
+
|
| 88 |
+
jQuery( '#yikes_mailchimp_tinyMCE_modal' ).find( '.mce-foot' ).find( '.mce-widget' ).hide();
|
| 89 |
+
|
| 90 |
+
jQuery( '#yikes_mailchimp_tinyMCE_modal-absend' ).next().prepend( '<div class="error"><p>' + localized_data.alert_translated + '</p></div>' );
|
| 91 |
+
|
| 92 |
+
return false;
|
| 93 |
+
|
| 94 |
+
} else {
|
| 95 |
+
|
| 96 |
+
var shortcode_atts = [];
|
| 97 |
+
|
| 98 |
+
shortcode_atts.push( 'form="'+mailChimp_form_id+'"' );
|
| 99 |
+
|
| 100 |
+
if( true === show_title ) {
|
| 101 |
+
|
| 102 |
+
shortcode_atts.push( 'title="1"' );
|
| 103 |
+
|
| 104 |
+
}
|
| 105 |
+
|
| 106 |
+
if( true === show_description ) {
|
| 107 |
+
|
| 108 |
+
shortcode_atts.push( 'description="1"' );
|
| 109 |
+
|
| 110 |
+
}
|
| 111 |
+
|
| 112 |
+
// If they didn't enter something for submit, don't add it to the shortcode.
|
| 113 |
+
if ( '' !== submit_button_text ) {
|
| 114 |
+
|
| 115 |
+
shortcode_atts.push('submit="' + submit_button_text + '"');
|
| 116 |
+
|
| 117 |
+
}
|
| 118 |
+
|
| 119 |
+
editor.insertContent( '[yikes-mailchimp '+shortcode_atts.join( ' ' )+']' );
|
| 120 |
+
|
| 121 |
+
}
|
| 122 |
+
|
| 123 |
+
}
|
| 124 |
+
|
| 125 |
+
} );
|
| 126 |
+
|
| 127 |
+
}
|
| 128 |
+
|
| 129 |
+
} );
|
| 130 |
+
|
| 131 |
+
} );
|
| 132 |
+
|
| 133 |
+
} )();
|
admin/partials/helpers/fields/yikes-mailchimp-checkbox-field.php
CHANGED
|
@@ -5,7 +5,11 @@
|
|
| 5 |
* For help on using, see our documentation [https://yikesplugins.com/support/knowledge-base/product/easy-forms-for-mailchimp/]
|
| 6 |
* @since 6.0
|
| 7 |
*/
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
?>
|
| 10 |
<label class="custom-field-section">
|
| 11 |
<strong><?php echo $field['label']; ?></strong>
|
| 5 |
* For help on using, see our documentation [https://yikesplugins.com/support/knowledge-base/product/easy-forms-for-mailchimp/]
|
| 6 |
* @since 6.0
|
| 7 |
*/
|
| 8 |
+
if ( is_string( $form_data['custom_fields'] ) ) {
|
| 9 |
+
$field_data = json_decode( $form_data['custom_fields'] , true );
|
| 10 |
+
} elseif ( is_array( $form_data['custom_fields'] ) ) {
|
| 11 |
+
$field_data = $form_data['custom_fields'];
|
| 12 |
+
}
|
| 13 |
?>
|
| 14 |
<label class="custom-field-section">
|
| 15 |
<strong><?php echo $field['label']; ?></strong>
|
admin/partials/helpers/fields/yikes-mailchimp-file-field.php
CHANGED
|
@@ -5,7 +5,12 @@
|
|
| 5 |
* For help on using, see our documentation [https://yikesplugins.com/support/knowledge-base/product/easy-forms-for-mailchimp/]
|
| 6 |
* @since 6.0
|
| 7 |
*/
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
// This will enqueue the Media Uploader script
|
| 10 |
wp_enqueue_media();
|
| 11 |
// And let's not forget the script we wrote earlier
|
| 5 |
* For help on using, see our documentation [https://yikesplugins.com/support/knowledge-base/product/easy-forms-for-mailchimp/]
|
| 6 |
* @since 6.0
|
| 7 |
*/
|
| 8 |
+
if ( is_string( $form_data['custom_fields'] ) ) {
|
| 9 |
+
$field_data = json_decode( $form_data['custom_fields'] , true );
|
| 10 |
+
} elseif ( is_array( $form_data['custom_fields'] ) ) {
|
| 11 |
+
$field_data = $form_data['custom_fields'];
|
| 12 |
+
}
|
| 13 |
+
|
| 14 |
// This will enqueue the Media Uploader script
|
| 15 |
wp_enqueue_media();
|
| 16 |
// And let's not forget the script we wrote earlier
|
admin/partials/helpers/fields/yikes-mailchimp-radio-field.php
CHANGED
|
@@ -5,7 +5,11 @@
|
|
| 5 |
* For help on using, see our documentation [https://yikesplugins.com/support/knowledge-base/product/easy-forms-for-mailchimp/]
|
| 6 |
* @since 6.0
|
| 7 |
*/
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
?>
|
| 10 |
<div class="custom-field-section">
|
| 11 |
<!-- title -->
|
| 5 |
* For help on using, see our documentation [https://yikesplugins.com/support/knowledge-base/product/easy-forms-for-mailchimp/]
|
| 6 |
* @since 6.0
|
| 7 |
*/
|
| 8 |
+
if ( is_string( $form_data['custom_fields'] ) ) {
|
| 9 |
+
$field_data = json_decode( $form_data['custom_fields'] , true );
|
| 10 |
+
} elseif ( is_array( $form_data['custom_fields'] ) ) {
|
| 11 |
+
$field_data = $form_data['custom_fields'];
|
| 12 |
+
}
|
| 13 |
?>
|
| 14 |
<div class="custom-field-section">
|
| 15 |
<!-- title -->
|
admin/partials/helpers/fields/yikes-mailchimp-select-field.php
CHANGED
|
@@ -5,7 +5,11 @@
|
|
| 5 |
* For help on using, see our documentation [https://yikesplugins.com/support/knowledge-base/product/easy-forms-for-mailchimp/]
|
| 6 |
* @since 6.0
|
| 7 |
*/
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
?>
|
| 10 |
<div class="custom-field-section">
|
| 11 |
<!-- title -->
|
| 5 |
* For help on using, see our documentation [https://yikesplugins.com/support/knowledge-base/product/easy-forms-for-mailchimp/]
|
| 6 |
* @since 6.0
|
| 7 |
*/
|
| 8 |
+
if ( is_string( $form_data['custom_fields'] ) ) {
|
| 9 |
+
$field_data = json_decode( $form_data['custom_fields'] , true );
|
| 10 |
+
} elseif ( is_array( $form_data['custom_fields'] ) ) {
|
| 11 |
+
$field_data = $form_data['custom_fields'];
|
| 12 |
+
}
|
| 13 |
?>
|
| 14 |
<div class="custom-field-section">
|
| 15 |
<!-- title -->
|
admin/partials/helpers/fields/yikes-mailchimp-text-field.php
CHANGED
|
@@ -5,7 +5,11 @@
|
|
| 5 |
* For help on using, see our documentation [https://yikesplugins.com/support/knowledge-base/product/easy-forms-for-mailchimp/]
|
| 6 |
* @since 6.0
|
| 7 |
*/
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
?>
|
| 10 |
<label class="custom-field-section">
|
| 11 |
<strong><?php echo $field['label']; ?></strong>
|
| 5 |
* For help on using, see our documentation [https://yikesplugins.com/support/knowledge-base/product/easy-forms-for-mailchimp/]
|
| 6 |
* @since 6.0
|
| 7 |
*/
|
| 8 |
+
if ( is_string( $form_data['custom_fields'] ) ) {
|
| 9 |
+
$field_data = json_decode( $form_data['custom_fields'] , true );
|
| 10 |
+
} elseif ( is_array( $form_data['custom_fields'] ) ) {
|
| 11 |
+
$field_data = $form_data['custom_fields'];
|
| 12 |
+
}
|
| 13 |
?>
|
| 14 |
<label class="custom-field-section">
|
| 15 |
<strong><?php echo $field['label']; ?></strong>
|
admin/partials/helpers/fields/yikes-mailchimp-wysiwyg-field.php
CHANGED
|
@@ -6,7 +6,12 @@
|
|
| 6 |
* For help on using, see our documentation [https://yikesplugins.com/support/knowledge-base/product/easy-forms-for-mailchimp/]
|
| 7 |
* @since 6.0
|
| 8 |
*/
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
$content = ( isset( $field_data[$field['id']] ) ) ? $field_data[$field['id']] : ( isset( $field['default'] ) ? $field['default'] : '' );
|
| 11 |
$wysiwyg_id = 'custom-field['.$field['id'].']';
|
| 12 |
?>
|
| 6 |
* For help on using, see our documentation [https://yikesplugins.com/support/knowledge-base/product/easy-forms-for-mailchimp/]
|
| 7 |
* @since 6.0
|
| 8 |
*/
|
| 9 |
+
if ( is_string( $form_data['custom_fields'] ) ) {
|
| 10 |
+
$field_data = json_decode( $form_data['custom_fields'] , true );
|
| 11 |
+
} elseif ( is_array( $form_data['custom_fields'] ) ) {
|
| 12 |
+
$field_data = $form_data['custom_fields'];
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
$content = ( isset( $field_data[$field['id']] ) ) ? $field_data[$field['id']] : ( isset( $field['default'] ) ? $field['default'] : '' );
|
| 16 |
$wysiwyg_id = 'custom-field['.$field['id'].']';
|
| 17 |
?>
|
admin/partials/menu/manage-forms.php
CHANGED
|
@@ -51,7 +51,21 @@ if( $this->is_user_mc_api_valid_form( false ) == 'valid' ) {
|
|
| 51 |
|
| 52 |
/* If the user hasn't authenticated yet, lets kill off */
|
| 53 |
if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) != 'valid_api_key' ) {
|
| 54 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
}
|
| 56 |
|
| 57 |
/* Display our admin notices here */
|
| 51 |
|
| 52 |
/* If the user hasn't authenticated yet, lets kill off */
|
| 53 |
if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) != 'valid_api_key' ) {
|
| 54 |
+
|
| 55 |
+
$error_string = sprintf(
|
| 56 |
+
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' ),
|
| 57 |
+
sprintf(
|
| 58 |
+
'<a href="%s" title="Settings Page">' . esc_html__( 'Settings Page', 'yikes-inc-easy-mailchimp-extender' ) . '</a>',
|
| 59 |
+
admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings' )
|
| 60 |
+
)
|
| 61 |
+
);
|
| 62 |
+
|
| 63 |
+
echo wp_kses_post(
|
| 64 |
+
'<div class="error"><p>' . $error_string . '</p></div>'
|
| 65 |
+
);
|
| 66 |
+
|
| 67 |
+
exit;
|
| 68 |
+
|
| 69 |
}
|
| 70 |
|
| 71 |
/* Display our admin notices here */
|
admin/partials/menu/manage-lists.php
CHANGED
|
@@ -42,7 +42,21 @@
|
|
| 42 |
<?php
|
| 43 |
/* If the user hasn't authenticated yet, lets kill off */
|
| 44 |
if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) != 'valid_api_key' ) {
|
| 45 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
}
|
| 47 |
?>
|
| 48 |
|
| 42 |
<?php
|
| 43 |
/* If the user hasn't authenticated yet, lets kill off */
|
| 44 |
if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) != 'valid_api_key' ) {
|
| 45 |
+
|
| 46 |
+
$error_string = sprintf(
|
| 47 |
+
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' ),
|
| 48 |
+
sprintf(
|
| 49 |
+
'<a href="%s" title="Settings Page">' . esc_html__( 'Settings Page', 'yikes-inc-easy-mailchimp-extender' ) . '</a>',
|
| 50 |
+
admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings' )
|
| 51 |
+
)
|
| 52 |
+
);
|
| 53 |
+
|
| 54 |
+
echo wp_kses_post(
|
| 55 |
+
'<div class="error"><p>' . $error_string . '</p></div>'
|
| 56 |
+
);
|
| 57 |
+
|
| 58 |
+
exit;
|
| 59 |
+
|
| 60 |
}
|
| 61 |
?>
|
| 62 |
|
admin/partials/view-user.php
CHANGED
|
@@ -218,14 +218,18 @@
|
|
| 218 |
<h3><?php _e( 'Fields:', 'yikes-inc-easy-mailchimp-extender' ); ?></h3>
|
| 219 |
<?php
|
| 220 |
if( ! empty( $merge_variable_fields ) ) {
|
| 221 |
-
|
| 222 |
-
<?php foreach( $merge_variable_fields as $field_name => $value ) { ?>
|
| 223 |
<li>
|
| 224 |
<label>
|
| 225 |
<strong class="section-label"><?php echo $field_name; ?></strong>
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 229 |
<?php }
|
| 230 |
} else {
|
| 231 |
?>
|
|
@@ -379,3 +383,35 @@
|
|
| 379 |
$country = $geocode_response_body['results'][0]['address_components'][6]['short_name'];
|
| 380 |
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> <span class="flag-icon flag-icon-' . strtolower( $country ) . '"></span>';
|
| 381 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
?>
|
| 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> <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 |
+
}
|
admin/partials/welcome-page/welcome-sections/knowledge-base-section.php
CHANGED
|
@@ -1,22 +1,17 @@
|
|
| 1 |
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
$knowledge_base_articles = json_decode( $contributors['body'] , true );
|
| 7 |
-
set_transient( 'yikes-mailchimp-knowledge-base-transient', $contributors, 60*60*12 );
|
| 8 |
-
} */
|
| 9 |
-
|
| 10 |
-
|
| 11 |
?>
|
| 12 |
<div class="wrap about-wrap">
|
| 13 |
-
|
| 14 |
<div class="feature-section">
|
| 15 |
-
|
| 16 |
<div id="kb-container">
|
| 17 |
-
<?php include_once( YIKES_MC_PATH . 'admin/partials/helpers/knowledge-base-
|
| 18 |
</div>
|
| 19 |
-
|
| 20 |
</div>
|
| 21 |
-
|
| 22 |
-
</div>
|
| 1 |
<?php
|
| 2 |
+
/**
|
| 3 |
+
* Welcome Page - Knowledge Base Links
|
| 4 |
+
*/
|
| 5 |
+
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
?>
|
| 7 |
<div class="wrap about-wrap">
|
| 8 |
+
|
| 9 |
<div class="feature-section">
|
| 10 |
+
|
| 11 |
<div id="kb-container">
|
| 12 |
+
<?php include_once( YIKES_MC_PATH . 'admin/partials/helpers/knowledge-base-article-links.php' ); ?>
|
| 13 |
</div>
|
| 14 |
+
|
| 15 |
</div>
|
| 16 |
+
|
| 17 |
+
</div>
|
readme.txt
CHANGED
|
@@ -1,10 +1,10 @@
|
|
| 1 |
-
=== Easy Forms for MailChimp ===
|
| 2 |
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.6.1
|
| 7 |
-
Stable tag: 6.2.
|
| 8 |
License: GPLv2 or later
|
| 9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
| 10 |
|
|
@@ -235,8 +235,15 @@ Below you'll find a complete list of the hooks and filters available in Easy For
|
|
| 235 |
|
| 236 |
== Changelog ==
|
| 237 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 238 |
= Easy Forms for MailChimp 6.2.2 - October 25th, 2016 =
|
| 239 |
-
* Minor security patch - Thanks goes to the Tristan
|
| 240 |
* Fixed a bug where request variable "section" was not sanitize before execution and rendering
|
| 241 |
* Fixed a bug where global constant "YIKES_MC_API_KEY" was not sanitize before execution and rendering
|
| 242 |
* Fixed a bug where WP option "yikes-mc-api-key" was not sanitize before validating and saving
|
| 1 |
+
=== Easy Forms for MailChimp ===
|
| 2 |
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.6.1
|
| 7 |
+
Stable tag: 6.2.3
|
| 8 |
License: GPLv2 or later
|
| 9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
| 10 |
|
| 235 |
|
| 236 |
== Changelog ==
|
| 237 |
|
| 238 |
+
= Easy Forms for MailChimp 6.2.3 - November 1st, 2016 =
|
| 239 |
+
* Changed the way HTML field data is retrieved for compatibility with the options DB table and the Incentives Add-on
|
| 240 |
+
* Fixed the path to the Knowledge Base on the welcome page
|
| 241 |
+
* Refactored and localized the tinyMCE JS file
|
| 242 |
+
* Fixed an i18n issue where an incorrect URL was being displayed in an error message
|
| 243 |
+
* Changed the way the address field is displayed when viewing a mailing list user's info
|
| 244 |
+
|
| 245 |
= Easy Forms for MailChimp 6.2.2 - October 25th, 2016 =
|
| 246 |
+
* Minor security patch - Thanks goes to the Tristan Madani for locating and disclosing the issues below.
|
| 247 |
* Fixed a bug where request variable "section" was not sanitize before execution and rendering
|
| 248 |
* Fixed a bug where global constant "YIKES_MC_API_KEY" was not sanitize before execution and rendering
|
| 249 |
* Fixed a bug where WP option "yikes-mc-api-key" was not sanitize before validating and saving
|
yikes-inc-easy-mailchimp-extender.php
CHANGED
|
@@ -3,7 +3,7 @@
|
|
| 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.
|
| 7 |
* Author: YIKES
|
| 8 |
* Author URI: http://www.yikesinc.com/
|
| 9 |
* License: GPL-3.0+
|
| 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.3
|
| 7 |
* Author: YIKES
|
| 8 |
* Author URI: http://www.yikesinc.com/
|
| 9 |
* License: GPL-3.0+
|
