Version Description
Download this release
Release Info
| Developer | JPry |
| Plugin | |
| Version | 6.2.1 |
| Comparing to | |
| See all releases | |
Code changes from version 6.2.0 to 6.2.1
- admin/class-yikes-inc-easy-mailchimp-extender-admin.php +3 -0
- admin/partials/front-end-widgets/front-end-widget-form.php +8 -18
- includes/class-yikes-inc-easy-mailchimp-extender-activator.php +3 -1
- package.json +1 -1
- public/partials/shortcodes/process_form_shortcode.php +39 -31
- readme.txt +5 -1
- yikes-inc-easy-mailchimp-extender.php +2 -2
admin/class-yikes-inc-easy-mailchimp-extender-admin.php
CHANGED
|
@@ -2906,6 +2906,9 @@ class Yikes_Inc_Easy_Mailchimp_Forms_Admin {
|
|
| 2906 |
$option = get_option( 'yikes_easy_mailchimp_extender_version', '0.0.0' );
|
| 2907 |
if ( version_compare( $option, '6.2.0', '<' ) ) {
|
| 2908 |
$this->convert_db_to_option();
|
|
|
|
|
|
|
|
|
|
| 2909 |
update_option( 'yikes_easy_mailchimp_extender_version', YIKES_MC_VERSION );
|
| 2910 |
}
|
| 2911 |
}
|
| 2906 |
$option = get_option( 'yikes_easy_mailchimp_extender_version', '0.0.0' );
|
| 2907 |
if ( version_compare( $option, '6.2.0', '<' ) ) {
|
| 2908 |
$this->convert_db_to_option();
|
| 2909 |
+
}
|
| 2910 |
+
|
| 2911 |
+
if ( version_compare( $option, YIKES_MC_VERSION, '<' ) ) {
|
| 2912 |
update_option( 'yikes_easy_mailchimp_extender_version', YIKES_MC_VERSION );
|
| 2913 |
}
|
| 2914 |
}
|
admin/partials/front-end-widgets/front-end-widget-form.php
CHANGED
|
@@ -38,11 +38,11 @@ class Yikes_Inc_Easy_Mailchimp_Extender_Widget extends WP_Widget {
|
|
| 38 |
public function widget( $args, $instance ) {
|
| 39 |
// Get all form IDs so we can use the first one as a default.
|
| 40 |
$form_ids = $this->form_interface->get_form_ids();
|
| 41 |
-
|
| 42 |
-
$title
|
| 43 |
-
$form_id
|
| 44 |
-
$form_description
|
| 45 |
-
$submit_button_text = isset( $instance['submit_text'] ) ? $instance['submit_text'] : __( 'Submit'
|
| 46 |
|
| 47 |
// Build our array based on settings chosen
|
| 48 |
$shortcode_attributes = array(
|
|
@@ -51,16 +51,6 @@ class Yikes_Inc_Easy_Mailchimp_Extender_Widget extends WP_Widget {
|
|
| 51 |
'description' => ( ! empty( $form_description ) ) ? '1' : '',
|
| 52 |
);
|
| 53 |
|
| 54 |
-
// Build the shortcode string.
|
| 55 |
-
$shortcode_string = '';
|
| 56 |
-
foreach ( $shortcode_attributes as $attribute => $value ) {
|
| 57 |
-
if ( empty( $value ) ) {
|
| 58 |
-
continue;
|
| 59 |
-
}
|
| 60 |
-
|
| 61 |
-
$shortcode_string .= " {$attribute}=\"{$value}\"";
|
| 62 |
-
}
|
| 63 |
-
|
| 64 |
// before and after widget arguments are defined by themes
|
| 65 |
echo $args['before_widget'];
|
| 66 |
|
|
@@ -70,15 +60,15 @@ class Yikes_Inc_Easy_Mailchimp_Extender_Widget extends WP_Widget {
|
|
| 70 |
|
| 71 |
// Custom action hooks to place content in the widget before the form
|
| 72 |
// See FAQ for examples on usage
|
| 73 |
-
do_action( 'yikes-mailchimp-before-form-'
|
| 74 |
do_action( 'yikes-mailchimp-before-form' );
|
| 75 |
|
| 76 |
// This is where you run the code and display the output
|
| 77 |
-
echo
|
| 78 |
|
| 79 |
// Custom action hooks to place content in the widget after the form
|
| 80 |
// See FAQ for examples on usage
|
| 81 |
-
do_action( 'yikes-mailchimp-after-form-'
|
| 82 |
do_action( 'yikes-mailchimp-after-form' );
|
| 83 |
|
| 84 |
echo $args['after_widget'];
|
| 38 |
public function widget( $args, $instance ) {
|
| 39 |
// Get all form IDs so we can use the first one as a default.
|
| 40 |
$form_ids = $this->form_interface->get_form_ids();
|
| 41 |
+
|
| 42 |
+
$title = isset( $instance['title'] ) ? apply_filters( 'widget_title', $instance['title'] ) : __( 'MailChimp Signup Form', 'yikes-inc-easy-mailchimp-extender' );
|
| 43 |
+
$form_id = isset( $instance['form_id'] ) ? $instance['form_id'] : $form_ids[0];
|
| 44 |
+
$form_description = isset( $instance['form_description'] ) ? $instance['form_description'] : '';
|
| 45 |
+
$submit_button_text = isset( $instance['submit_text'] ) ? $instance['submit_text'] : __( 'Submit', 'yikes-inc-easy-mailchimp-extender' );
|
| 46 |
|
| 47 |
// Build our array based on settings chosen
|
| 48 |
$shortcode_attributes = array(
|
| 51 |
'description' => ( ! empty( $form_description ) ) ? '1' : '',
|
| 52 |
);
|
| 53 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
// before and after widget arguments are defined by themes
|
| 55 |
echo $args['before_widget'];
|
| 56 |
|
| 60 |
|
| 61 |
// Custom action hooks to place content in the widget before the form
|
| 62 |
// See FAQ for examples on usage
|
| 63 |
+
do_action( 'yikes-mailchimp-before-form-' . $form_id );
|
| 64 |
do_action( 'yikes-mailchimp-before-form' );
|
| 65 |
|
| 66 |
// This is where you run the code and display the output
|
| 67 |
+
echo process_mailchimp_shortcode( $shortcode_attributes );
|
| 68 |
|
| 69 |
// Custom action hooks to place content in the widget after the form
|
| 70 |
// See FAQ for examples on usage
|
| 71 |
+
do_action( 'yikes-mailchimp-after-form-' . $form_id );
|
| 72 |
do_action( 'yikes-mailchimp-after-form' );
|
| 73 |
|
| 74 |
echo $args['after_widget'];
|
includes/class-yikes-inc-easy-mailchimp-extender-activator.php
CHANGED
|
@@ -104,6 +104,8 @@ class Yikes_Inc_Easy_Mailchimp_Extender_Activator {
|
|
| 104 |
$option_class = new Yikes_Inc_Easy_MailChimp_Extender_Option_Forms();
|
| 105 |
$option_class->create_option();
|
| 106 |
}
|
| 107 |
-
}
|
| 108 |
|
|
|
|
|
|
|
|
|
|
| 109 |
}
|
| 104 |
$option_class = new Yikes_Inc_Easy_MailChimp_Extender_Option_Forms();
|
| 105 |
$option_class->create_option();
|
| 106 |
}
|
|
|
|
| 107 |
|
| 108 |
+
// Add the DB version option.
|
| 109 |
+
add_option( 'yikes_easy_mailchimp_extender_version', YIKES_MC_VERSION );
|
| 110 |
+
}
|
| 111 |
}
|
package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"name": "yikes-inc-easy-mailchimp-extender",
|
| 3 |
-
"version": "6.1
|
| 4 |
"description": "Easy MailChimp opt-in forms for your site.",
|
| 5 |
"main": "index.js",
|
| 6 |
"scripts": {
|
| 1 |
{
|
| 2 |
"name": "yikes-inc-easy-mailchimp-extender",
|
| 3 |
+
"version": "6.2.1",
|
| 4 |
"description": "Easy MailChimp opt-in forms for your site.",
|
| 5 |
"main": "index.js",
|
| 6 |
"scripts": {
|
public/partials/shortcodes/process_form_shortcode.php
CHANGED
|
@@ -52,9 +52,9 @@ function process_mailchimp_shortcode( $atts ) {
|
|
| 52 |
/*
|
| 53 |
* Check if the user wants to use reCAPTCHA Spam Prevention
|
| 54 |
*/
|
| 55 |
-
if( get_option( 'yikes-mc-recaptcha-status' , '' ) == '1' ) {
|
| 56 |
// allow users to manually set recaptcha (instead of globally - recaptcha="1"/recaptcha="0" - but still needs to be globally enabled on the settings page)
|
| 57 |
-
if
|
| 58 |
// if either of the Private the Secret key is left blank, we should display an error back to the user
|
| 59 |
if( get_option( 'yikes-mc-recaptcha-site-key' , '' ) == '' ) {
|
| 60 |
return __( "Whoops! It looks like you enabled reCAPTCHA but forgot to enter the reCAPTCHA site key!" , 'yikes-inc-easy-mailchimp-extender' ) . '<span class="edit-link yikes-easy-mc-edit-link"><a class="post-edit-link" href="' . esc_url( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings§ion=recaptcha-settings' ) ) . '" title="' . __( 'ReCaptcha Settings' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Edit ReCaptcha Settings' , 'yikes-inc-easy-mailchimp-extender' ) . '</a></span>';
|
|
@@ -71,13 +71,13 @@ function process_mailchimp_shortcode( $atts ) {
|
|
| 71 |
$locale = get_locale();
|
| 72 |
$locale_split = explode( '_', $locale );
|
| 73 |
// Setup reCAPTCHA parameters
|
| 74 |
-
$lang = (
|
| 75 |
-
$lang = (
|
| 76 |
-
$type = (
|
| 77 |
-
$theme= (
|
| 78 |
-
$size = (
|
| 79 |
-
$data_callback = (
|
| 80 |
-
$expired_callback = (
|
| 81 |
// Pass the shortcode parameters through a filter
|
| 82 |
$recaptcha_shortcode_params = apply_filters( 'yikes-mailchimp-recaptcha-parameters', array(
|
| 83 |
'language' => $lang,
|
|
@@ -194,11 +194,7 @@ function process_mailchimp_shortcode( $atts ) {
|
|
| 194 |
|
| 195 |
// setup the submit button text
|
| 196 |
// shortcode parameter takes precedence over option
|
| 197 |
-
|
| 198 |
-
$submit = $atts['submit'];
|
| 199 |
-
} else {
|
| 200 |
-
$submit = $submit_button_text;
|
| 201 |
-
}
|
| 202 |
|
| 203 |
// used in yikes-mailchimp-redirect-url filter
|
| 204 |
global $post;
|
|
@@ -227,10 +223,10 @@ function process_mailchimp_shortcode( $atts ) {
|
|
| 227 |
/**
|
| 228 |
* Check for form inline parameter
|
| 229 |
*/
|
| 230 |
-
$form_inline = (
|
| 231 |
// recheck from our form options
|
| 232 |
-
if( ! $form_inline ) {
|
| 233 |
-
$form_inline = (
|
| 234 |
}
|
| 235 |
|
| 236 |
/* If the current user is logged in, and an admin...lets display our 'Edit Form' link */
|
|
@@ -303,28 +299,40 @@ function process_mailchimp_shortcode( $atts ) {
|
|
| 303 |
* Set a custom title using custom_title="lorem ipsum" parameter in the shortcode
|
| 304 |
* - This takes precedence over the title set
|
| 305 |
*/
|
| 306 |
-
if
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 313 |
}
|
|
|
|
|
|
|
| 314 |
}
|
| 315 |
|
| 316 |
/*
|
| 317 |
* Allow users to specify a custom description for this form, no html support
|
| 318 |
* @since 6.0.3.8
|
| 319 |
*/
|
| 320 |
-
if
|
| 321 |
-
|
| 322 |
-
|
| 323 |
-
|
| 324 |
-
|
| 325 |
-
|
| 326 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 327 |
}
|
|
|
|
|
|
|
| 328 |
}
|
| 329 |
|
| 330 |
// Check for AJAX
|
| 52 |
/*
|
| 53 |
* Check if the user wants to use reCAPTCHA Spam Prevention
|
| 54 |
*/
|
| 55 |
+
if ( get_option( 'yikes-mc-recaptcha-status' , '' ) == '1' ) {
|
| 56 |
// allow users to manually set recaptcha (instead of globally - recaptcha="1"/recaptcha="0" - but still needs to be globally enabled on the settings page)
|
| 57 |
+
if ( $atts['recaptcha'] != '0' ) {
|
| 58 |
// if either of the Private the Secret key is left blank, we should display an error back to the user
|
| 59 |
if( get_option( 'yikes-mc-recaptcha-site-key' , '' ) == '' ) {
|
| 60 |
return __( "Whoops! It looks like you enabled reCAPTCHA but forgot to enter the reCAPTCHA site key!" , 'yikes-inc-easy-mailchimp-extender' ) . '<span class="edit-link yikes-easy-mc-edit-link"><a class="post-edit-link" href="' . esc_url( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings§ion=recaptcha-settings' ) ) . '" title="' . __( 'ReCaptcha Settings' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Edit ReCaptcha Settings' , 'yikes-inc-easy-mailchimp-extender' ) . '</a></span>';
|
| 71 |
$locale = get_locale();
|
| 72 |
$locale_split = explode( '_', $locale );
|
| 73 |
// Setup reCAPTCHA parameters
|
| 74 |
+
$lang = ( ! empty( $locale_split ) ? $locale_split[0] : $locale );
|
| 75 |
+
$lang = ( ! empty( $atts['recaptcha_lang'] ) ) ? $atts['recaptcha_lang'] : $lang;
|
| 76 |
+
$type = ( ! empty( $atts['recaptcha_type'] ) ) ? strtolower( $atts['recaptcha_type'] ) : 'image'; // setup recaptcha type
|
| 77 |
+
$theme= ( ! empty( $atts['recaptcha_theme'] ) ) ? strtolower( $atts['recaptcha_theme'] ) : 'light'; // setup recaptcha theme
|
| 78 |
+
$size = ( ! empty( $atts['recaptcha_size'] ) ) ? strtolower( $atts['recaptcha_size'] ) : 'normal'; // setup recaptcha size
|
| 79 |
+
$data_callback = ( ! empty( $atts['recaptcha_data_callback'] ) ) ? $atts['recaptcha_data_callback'] : false; // setup recaptcha size
|
| 80 |
+
$expired_callback = ( ! empty( $atts['recaptcha_expired_callback'] ) ) ? $atts['recaptcha_expired_callback'] : false; // setup recaptcha size
|
| 81 |
// Pass the shortcode parameters through a filter
|
| 82 |
$recaptcha_shortcode_params = apply_filters( 'yikes-mailchimp-recaptcha-parameters', array(
|
| 83 |
'language' => $lang,
|
| 194 |
|
| 195 |
// setup the submit button text
|
| 196 |
// shortcode parameter takes precedence over option
|
| 197 |
+
$submit = ( ! empty( $atts['submit'] ) ) ? $atts['submit'] : $submit_button_text;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 198 |
|
| 199 |
// used in yikes-mailchimp-redirect-url filter
|
| 200 |
global $post;
|
| 223 |
/**
|
| 224 |
* Check for form inline parameter
|
| 225 |
*/
|
| 226 |
+
$form_inline = ( $atts['inline'] == 1 || $atts['inline'] == 'true' );
|
| 227 |
// recheck from our form options
|
| 228 |
+
if ( ! $form_inline ) {
|
| 229 |
+
$form_inline = (bool) $additional_form_settings['yikes-easy-mc-inline-form'];
|
| 230 |
}
|
| 231 |
|
| 232 |
/* If the current user is logged in, and an admin...lets display our 'Edit Form' link */
|
| 299 |
* Set a custom title using custom_title="lorem ipsum" parameter in the shortcode
|
| 300 |
* - This takes precedence over the title set
|
| 301 |
*/
|
| 302 |
+
if ( $atts['title'] ) {
|
| 303 |
+
if ( ! empty( $atts['custom_title'] ) ) {
|
| 304 |
+
/**
|
| 305 |
+
* Filter the title that is displayed through the shortcode.
|
| 306 |
+
*
|
| 307 |
+
* @param string $title The title to display.
|
| 308 |
+
* @param int $form_id The form ID.
|
| 309 |
+
*/
|
| 310 |
+
$title = apply_filters( 'yikes-mailchimp-form-title', apply_filters( 'the_title', $atts['custom_title'] ), $form_id );
|
| 311 |
+
} else {
|
| 312 |
+
$title = apply_filters( 'yikes-mailchimp-form-title', apply_filters( 'the_title', $form_data['form_name'] ), $form_id );
|
| 313 |
}
|
| 314 |
+
|
| 315 |
+
echo sprintf( '<h3 class="yikes-mailchimp-form-title yikes-mailchimp-form-title-%1$s">%2$s</h3>', $form_id, $title );
|
| 316 |
}
|
| 317 |
|
| 318 |
/*
|
| 319 |
* Allow users to specify a custom description for this form, no html support
|
| 320 |
* @since 6.0.3.8
|
| 321 |
*/
|
| 322 |
+
if ( $atts['description'] ) {
|
| 323 |
+
if ( ! empty( $atts['custom_description'] ) ) {
|
| 324 |
+
/**
|
| 325 |
+
* Filter the description that is displayed through the shortcode.
|
| 326 |
+
*
|
| 327 |
+
* @param string $title The title to display.
|
| 328 |
+
* @param int $form_id The form ID.
|
| 329 |
+
*/
|
| 330 |
+
$description = apply_filters( 'yikes-mailchimp-form-description', $atts['custom_description'], $form_id );
|
| 331 |
+
} else {
|
| 332 |
+
$description = apply_filters( 'yikes-mailchimp-form-description', $form_data['form_description'], $form_id );
|
| 333 |
}
|
| 334 |
+
|
| 335 |
+
echo sprintf( '<section class="yikes-mailchimp-form-description yikes-mailchimp-form-description-%1$s">%2$s</section>', $form_id, $description );
|
| 336 |
}
|
| 337 |
|
| 338 |
// Check for AJAX
|
readme.txt
CHANGED
|
@@ -4,7 +4,7 @@ Donate link: https://yikesplugins.com/?utm_source=wp_plugin_repo&utm_medium=dona
|
|
| 4 |
Tags: MailChimp, MailChimp forms, MailChimp lists, opt-in forms, sign up form, MailChimp, email, forms, mailing lists, marketing, newsletter, sign up
|
| 5 |
Requires at least: 4.0
|
| 6 |
Tested up to: 4.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,6 +235,10 @@ 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.0 - October 17th, 2016 =
|
| 239 |
* Fixed a bug where the default for a radio button would not show up if the first item was selected ([#587](https://github.com/yikesinc/yikes-inc-easy-mailchimp-extender/issues/587))
|
| 240 |
* Fixed a bug where the form settings would not import properly ([#572](https://github.com/yikesinc/yikes-inc-easy-mailchimp-extender/issues/572))
|
| 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.1
|
| 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.1 - October 19th, 2016 =
|
| 239 |
+
* Fixed a bug where the title and description will not display using the shortcode.
|
| 240 |
+
* Fixed a bug where the `recaptcha` shortcode parameter doesn't work properly.
|
| 241 |
+
|
| 242 |
= Easy Forms for MailChimp 6.2.0 - October 17th, 2016 =
|
| 243 |
* Fixed a bug where the default for a radio button would not show up if the first item was selected ([#587](https://github.com/yikesinc/yikes-inc-easy-mailchimp-extender/issues/587))
|
| 244 |
* Fixed a bug where the form settings would not import properly ([#572](https://github.com/yikesinc/yikes-inc-easy-mailchimp-extender/issues/572))
|
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+
|
|
@@ -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.
|
| 46 |
}
|
| 47 |
|
| 48 |
/**
|
| 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.1
|
| 7 |
* Author: YIKES
|
| 8 |
* Author URI: http://www.yikesinc.com/
|
| 9 |
* License: GPL-3.0+
|
| 42 |
* @since 6.1.3
|
| 43 |
*/
|
| 44 |
if ( ! defined( 'YIKES_MC_VERSION' ) ) {
|
| 45 |
+
define( 'YIKES_MC_VERSION' , '6.2.1' );
|
| 46 |
}
|
| 47 |
|
| 48 |
/**
|
