@@ -11,8 +11,8 @@ discard block |
||
11 | 11 | */ |
12 | 12 | |
13 | 13 | // enqueue jquery qtip for our tooltip |
14 | - wp_enqueue_script( 'jquery-qtip-tooltip', YIKES_MC_URL . 'admin/js/min/jquery.qtip.min.js' , array( 'jquery' ) ); |
|
15 | - wp_enqueue_style( 'jquery-qtip-style', YIKES_MC_URL . 'admin/css/jquery.qtip.min.css' ); |
|
14 | + wp_enqueue_script( 'jquery-qtip-tooltip', YIKES_MC_URL . 'admin/js/min/jquery.qtip.min.js', array( 'jquery' ) ); |
|
15 | + wp_enqueue_style( 'jquery-qtip-style', YIKES_MC_URL . 'admin/css/jquery.qtip.min.css' ); |
|
16 | 16 | |
17 | 17 | ?> |
18 | 18 | <script> |
@@ -43,40 +43,40 @@ discard block |
||
43 | 43 | ); |
44 | 44 | |
45 | 45 | $class_descriptions = array( |
46 | - 'comment_form' => '<img class="tooltip-integration-banner" src="' . YIKES_MC_URL . 'includes/images/Checkbox_Integration_Logos/wordpress-banner-logo.png" title="' . __( 'WordPress' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Enabling the WordPress core comment form opt-in checkbox will display a checkbox to your current users when leaving a comment (if they are not currently subscribed).' , 'yikes-inc-easy-mailchimp-extender' ), |
|
47 | - 'registration_form' => '<img class="tooltip-integration-banner" src="' . YIKES_MC_URL . 'includes/images/Checkbox_Integration_Logos/wordpress-banner-logo.png" title="' . __( 'WordPress' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Enabling the WordPress core registration form opt-in checkbox will display a checkbox to new users when registering for your site.' , 'yikes-inc-easy-mailchimp-extender' ), |
|
48 | - 'woocommerce_checkout_form' => '<img class="tooltip-integration-banner" src="' . YIKES_MC_URL . 'includes/images/Checkbox_Integration_Logos/woocommerce-banner.png" title="' . __( 'WooCommerce Store' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Enabling the WooCommerce checkout opt-in form allows you to capture email addresses from users who make purchases in your store. This option will add an opt-in checkbox to the checkout page.' , 'yikes-inc-easy-mailchimp-extender' ), |
|
49 | - 'easy_digital_downloads_checkout_form' => '<img class="tooltip-integration-banner" src="' . YIKES_MC_URL . 'includes/images/Checkbox_Integration_Logos/edd-banner.png" title="' . __( 'Easy Digital Downloads' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Enabling the Easy Digital Downloads checkout opt-in allows users who make a purchase to opt-in to your mailing list during checkout.' , 'yikes-inc-easy-mailchimp-extender' ), |
|
50 | - 'buddypress_form' => '<img class="tooltip-integration-banner" src="' . YIKES_MC_URL . 'includes/images/Checkbox_Integration_Logos/buddypress-banner.png" title="' . __( 'BuddyPress' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Enabling the BuddyPress opt-in allows users who register for your site to be automatically added to the mailing list of your choice.' , 'yikes-inc-easy-mailchimp-extender' ), |
|
51 | - 'bbpress_forms' => '<img class="tooltip-integration-banner" src="' . YIKES_MC_URL . 'includes/images/Checkbox_Integration_Logos/bbpress-banner.png" title="' . __( 'bbPress' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Enabling the bbPress opt-in enables users who register to use the forums on your site to be automatically added to the mailing list of your choice.' , 'yikes-inc-easy-mailchimp-extender' ), |
|
52 | - 'contact_form_7' => '<img class="tooltip-integration-banner" src="' . YIKES_MC_URL . 'includes/images/Checkbox_Integration_Logos/cf7-banner.png" title="' . __( 'Contact Form 7' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Once the Contact Form 7 integration is active you can use our custom shortcode [yikes_mailchimp_checkbox] in your contact forms to subscribe users to a pre-selected list.' , 'yikes-inc-easy-mailchimp-extender' ), |
|
46 | + 'comment_form' => '<img class="tooltip-integration-banner" src="' . YIKES_MC_URL . 'includes/images/Checkbox_Integration_Logos/wordpress-banner-logo.png" title="' . __( 'WordPress', 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Enabling the WordPress core comment form opt-in checkbox will display a checkbox to your current users when leaving a comment (if they are not currently subscribed).', 'yikes-inc-easy-mailchimp-extender' ), |
|
47 | + 'registration_form' => '<img class="tooltip-integration-banner" src="' . YIKES_MC_URL . 'includes/images/Checkbox_Integration_Logos/wordpress-banner-logo.png" title="' . __( 'WordPress', 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Enabling the WordPress core registration form opt-in checkbox will display a checkbox to new users when registering for your site.', 'yikes-inc-easy-mailchimp-extender' ), |
|
48 | + 'woocommerce_checkout_form' => '<img class="tooltip-integration-banner" src="' . YIKES_MC_URL . 'includes/images/Checkbox_Integration_Logos/woocommerce-banner.png" title="' . __( 'WooCommerce Store', 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Enabling the WooCommerce checkout opt-in form allows you to capture email addresses from users who make purchases in your store. This option will add an opt-in checkbox to the checkout page.', 'yikes-inc-easy-mailchimp-extender' ), |
|
49 | + 'easy_digital_downloads_checkout_form' => '<img class="tooltip-integration-banner" src="' . YIKES_MC_URL . 'includes/images/Checkbox_Integration_Logos/edd-banner.png" title="' . __( 'Easy Digital Downloads', 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Enabling the Easy Digital Downloads checkout opt-in allows users who make a purchase to opt-in to your mailing list during checkout.', 'yikes-inc-easy-mailchimp-extender' ), |
|
50 | + 'buddypress_form' => '<img class="tooltip-integration-banner" src="' . YIKES_MC_URL . 'includes/images/Checkbox_Integration_Logos/buddypress-banner.png" title="' . __( 'BuddyPress', 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Enabling the BuddyPress opt-in allows users who register for your site to be automatically added to the mailing list of your choice.', 'yikes-inc-easy-mailchimp-extender' ), |
|
51 | + 'bbpress_forms' => '<img class="tooltip-integration-banner" src="' . YIKES_MC_URL . 'includes/images/Checkbox_Integration_Logos/bbpress-banner.png" title="' . __( 'bbPress', 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Enabling the bbPress opt-in enables users who register to use the forums on your site to be automatically added to the mailing list of your choice.', 'yikes-inc-easy-mailchimp-extender' ), |
|
52 | + 'contact_form_7' => '<img class="tooltip-integration-banner" src="' . YIKES_MC_URL . 'includes/images/Checkbox_Integration_Logos/cf7-banner.png" title="' . __( 'Contact Form 7', 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Once the Contact Form 7 integration is active you can use our custom shortcode [yikes_mailchimp_checkbox] in your contact forms to subscribe users to a pre-selected list.', 'yikes-inc-easy-mailchimp-extender' ), |
|
53 | 53 | ); |
54 | 54 | |
55 | 55 | // Easy Digital Downloads |
56 | - if( class_exists( 'Easy_Digital_Downloads' ) ) { |
|
57 | - $active_plugins['easy_digital_downloads_checkout_form'] = __( 'Easy Digital Downloads Checkout', 'yikes-inc-easy-mailchimp-extender' ); |
|
56 | + if ( class_exists( 'Easy_Digital_Downloads' ) ) { |
|
57 | + $active_plugins[ 'easy_digital_downloads_checkout_form' ] = __( 'Easy Digital Downloads Checkout', 'yikes-inc-easy-mailchimp-extender' ); |
|
58 | 58 | } |
59 | 59 | // WooCommerce |
60 | - if( class_exists( 'WooCommerce' ) ) { |
|
61 | - $active_plugins['woocommerce_checkout_form'] = __( 'WooCommerce Checkout', 'yikes-inc-easy-mailchimp-extender' ); |
|
60 | + if ( class_exists( 'WooCommerce' ) ) { |
|
61 | + $active_plugins[ 'woocommerce_checkout_form' ] = __( 'WooCommerce Checkout', 'yikes-inc-easy-mailchimp-extender' ); |
|
62 | 62 | } |
63 | 63 | // BuddyPress |
64 | - if( class_exists( 'BuddyPress' ) ) { |
|
65 | - $active_plugins['buddypress_form'] = __( 'BuddyPress Registration', 'yikes-inc-easy-mailchimp-extender' ); |
|
64 | + if ( class_exists( 'BuddyPress' ) ) { |
|
65 | + $active_plugins[ 'buddypress_form' ] = __( 'BuddyPress Registration', 'yikes-inc-easy-mailchimp-extender' ); |
|
66 | 66 | } |
67 | 67 | // bbPress |
68 | - if( class_exists( 'bbPress' ) ) { |
|
69 | - $active_plugins['bbpress_forms'] = __( 'bbPress', 'yikes-inc-easy-mailchimp-extender' ); |
|
68 | + if ( class_exists( 'bbPress' ) ) { |
|
69 | + $active_plugins[ 'bbpress_forms' ] = __( 'bbPress', 'yikes-inc-easy-mailchimp-extender' ); |
|
70 | 70 | } |
71 | 71 | // Contact Form 7 |
72 | - if( is_plugin_active( 'contact-form-7/wp-contact-form-7.php' ) ) { |
|
73 | - $active_plugins['contact_form_7'] = __( 'Contact Form 7', 'yikes-inc-easy-mailchimp-extender' ); |
|
72 | + if ( is_plugin_active( 'contact-form-7/wp-contact-form-7.php' ) ) { |
|
73 | + $active_plugins[ 'contact_form_7' ] = __( 'Contact Form 7', 'yikes-inc-easy-mailchimp-extender' ); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | // store our checkbox options |
77 | - $options = get_option( 'optin-checkbox-init' , '' ); |
|
77 | + $options = get_option( 'optin-checkbox-init', '' ); |
|
78 | 78 | ?> |
79 | -<h3><span><?php _e( 'Integration Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3> |
|
79 | +<h3><span><?php _e( 'Integration Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3> |
|
80 | 80 | |
81 | 81 | |
82 | 82 | <?php |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
88 | 88 | $error_logging->maybe_write_to_log( |
89 | 89 | $list_data->get_error_code(), |
90 | - __( "Get Account Lists" , 'yikes-inc-easy-mailchimp-extender' ), |
|
90 | + __( "Get Account Lists", 'yikes-inc-easy-mailchimp-extender' ), |
|
91 | 91 | "Integration Settings Page" |
92 | 92 | ); |
93 | 93 | } |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | ?> |
96 | 96 | <div class="inside"> |
97 | 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§ion=general-settings' ) ) . '" title="' . __( 'General Settings' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'enter a valid MailChimp API key' , 'yikes-inc-easy-mailchimp-extender' ) . '</a>' ); |
|
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§ion=general-settings' ) ) . '" title="' . __( 'General Settings', 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'enter a valid MailChimp API key', 'yikes-inc-easy-mailchimp-extender' ) . '</a>' ); |
|
99 | 99 | ?> |
100 | 100 | </div> |
101 | 101 | <?php |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | <div class="inside"> |
107 | 107 | |
108 | 108 | <p> |
109 | - <?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' ); ?> |
|
109 | + <?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' ); ?> |
|
110 | 110 | </p> |
111 | 111 | |
112 | 112 | <!-- Settings Form --> |
@@ -116,30 +116,30 @@ discard block |
||
116 | 116 | |
117 | 117 | <ul> |
118 | 118 | <?php |
119 | - if( !empty( $active_plugins ) ) { |
|
119 | + if ( ! empty( $active_plugins ) ) { |
|
120 | 120 | |
121 | - foreach( $active_plugins as $class => $value ) { |
|
121 | + foreach ( $active_plugins as $class => $value ) { |
|
122 | 122 | // echo $class; |
123 | - $checked = isset( $options[$class]['value'] ) ? 'checked="checked"' : ''; |
|
124 | - $hidden = !isset( $options[$class]['value'] ) ? 'yikes-easy-mc-hidden' : ''; |
|
125 | - $checkbox_label = isset( $options[$class]['label'] ) ? esc_attr__( $options[$class]['label'] ) : ''; |
|
126 | - $precheck_checkbox = isset( $options[$class]['precheck'] ) ? $options[$class]['precheck'] : ''; |
|
127 | - $selected_list = isset( $options[$class]['associated-list'] ) ? $options[$class]['associated-list'] : '-'; |
|
128 | - $list_interest_groups = isset( $options[$class]['interest-groups'] ) ? $options[$class]['interest-groups'] : false; |
|
123 | + $checked = isset( $options[ $class ][ 'value' ] ) ? 'checked="checked"' : ''; |
|
124 | + $hidden = ! isset( $options[ $class ][ 'value' ] ) ? 'yikes-easy-mc-hidden' : ''; |
|
125 | + $checkbox_label = isset( $options[ $class ][ 'label' ] ) ? esc_attr__( $options[ $class ][ 'label' ] ) : ''; |
|
126 | + $precheck_checkbox = isset( $options[ $class ][ 'precheck' ] ) ? $options[ $class ][ 'precheck' ] : ''; |
|
127 | + $selected_list = isset( $options[ $class ][ 'associated-list' ] ) ? $options[ $class ][ 'associated-list' ] : '-'; |
|
128 | + $list_interest_groups = isset( $options[ $class ][ 'interest-groups' ] ) ? $options[ $class ][ 'interest-groups' ] : false; |
|
129 | 129 | ?> |
130 | 130 | <li> |
131 | 131 | <label> |
132 | - <input type="checkbox" name="optin-checkbox-init[<?php echo $class; ?>][value]" value="on" <?php echo $checked; ?> onclick="jQuery(this).parents('li').next().stop().slideToggle();"><?php echo ucwords( $value ); ?><span class="dashicons dashicons-editor-help"></span><div class="tooltiptext qtip-bootstrap" style="display:none;"><?php echo $class_descriptions[$class]; ?></div> |
|
132 | + <input type="checkbox" name="optin-checkbox-init[<?php echo $class; ?>][value]" value="on" <?php echo $checked; ?> onclick="jQuery(this).parents('li').next().stop().slideToggle();"><?php echo ucwords( $value ); ?><span class="dashicons dashicons-editor-help"></span><div class="tooltiptext qtip-bootstrap" style="display:none;"><?php echo $class_descriptions[ $class ]; ?></div> |
|
133 | 133 | </label> |
134 | 134 | </li> |
135 | 135 | <!-- checkbox settings, text - associated list etc. --> |
136 | 136 | <li class="optin-checkbox-init[<?php echo $class; ?>]-settings <?php echo $hidden; ?>"> |
137 | - <?php if( $class == 'contact_form_7' ) { ?> |
|
137 | + <?php if ( $class == 'contact_form_7' ) { ?> |
|
138 | 138 | <p style="margin-top:0;"><small class="contact-form-7-notice"><?php printf( __( 'Use %s in Contact Form 7 to display the checkbox.', 'yikes-inc-easy-mailchimp-extender' ), '<code>[yikes_mailchimp_checkbox]</code>' ); ?></small></p> |
139 | 139 | <?php } ?> |
140 | 140 | <p style="margin-top:0;padding-top:0;margin-bottom:0;padding-bottom:0;"> |
141 | 141 | <!-- checkbox associated list --> |
142 | - <label><?php _e( 'Associated List' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
142 | + <label><?php _e( 'Associated List', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
143 | 143 | <?php |
144 | 144 | if ( count( $list_data ) > 0 ) { |
145 | 145 | ?> |
@@ -147,26 +147,26 @@ discard block |
||
147 | 147 | data-attr-integration="<?php echo $class; ?>" |
148 | 148 | name="optin-checkbox-init[<?php echo $class; ?>][associated-list]" |
149 | 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> |
|
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 | 153 | <?php } ?> |
154 | 154 | </select> |
155 | 155 | <?php |
156 | 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>'; |
|
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>'; |
|
158 | 158 | } |
159 | 159 | ?> |
160 | 160 | </label> |
161 | 161 | <!-- checkbox text label --> |
162 | - <label><?php _e( 'Checkbox Label' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
162 | + <label><?php _e( 'Checkbox Label', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
163 | 163 | <input type="text" class="optin-checkbox-init[<?php echo $class; ?>][label] optin-checkbox-label-input" name="optin-checkbox-init[<?php echo $class; ?>][label]" value="<?php echo $checkbox_label; ?>"> |
164 | 164 | </label> |
165 | 165 | <!-- prechecked? --> |
166 | - <label><?php _e( 'Precheck Checkbox' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
166 | + <label><?php _e( 'Precheck Checkbox', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
167 | 167 | <select id="optin-checkbox-init[<?php echo $class; ?>][precheck]" name="optin-checkbox-init[<?php echo $class; ?>][precheck]" class="optin-checkbox-init[<?php echo $class; ?>][precheck] checkbox-settings-list-dropdown"> |
168 | - <option value="true" <?php selected( $precheck_checkbox , 'true' ); ?>><?php _e( 'Yes' , 'yikes-inc-easy-mailchimp-extender' ); ?></option> |
|
169 | - <option value="false" <?php selected( $precheck_checkbox , 'false' ); ?>><?php _e( 'No' , 'yikes-inc-easy-mailchimp-extender' ); ?></option> |
|
168 | + <option value="true" <?php selected( $precheck_checkbox, 'true' ); ?>><?php _e( 'Yes', 'yikes-inc-easy-mailchimp-extender' ); ?></option> |
|
169 | + <option value="false" <?php selected( $precheck_checkbox, 'false' ); ?>><?php _e( 'No', 'yikes-inc-easy-mailchimp-extender' ); ?></option> |
|
170 | 170 | </select> |
171 | 171 | </label> |
172 | 172 | |
@@ -177,8 +177,8 @@ discard block |
||
177 | 177 | $interest_groupings = get_transient( $selected_list . '_interest_group' ); |
178 | 178 | $integration_type = $class; |
179 | 179 | require( YIKES_MC_PATH . 'admin/partials/menu/options-sections/templates/integration-interest-groups.php' ); |
180 | - } else if( $selected_list != '-' && $list_interest_groups ) { |
|
181 | - $list_id = $options[$class]['associated-list']; |
|
180 | + } else if ( $selected_list != '-' && $list_interest_groups ) { |
|
181 | + $list_id = $options[ $class ][ 'associated-list' ]; |
|
182 | 182 | $integration_type = $class; |
183 | 183 | YIKES_Inc_Easy_MailChimp_Process_Ajax::check_list_for_interest_groups( $list_id, $integration_type, true ); |
184 | 184 | } |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | } else { |
194 | 194 | ?> |
195 | 195 | <li> |
196 | - <?php _e( 'Nothing is active.' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
196 | + <?php _e( 'Nothing is active.', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
197 | 197 | </li> |
198 | 198 | <?php |
199 | 199 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -$integration_options = get_option( 'optin-checkbox-init' , '' ); |
|
3 | +$integration_options = get_option( 'optin-checkbox-init', '' ); |
|
4 | 4 | |
5 | 5 | ?> |
6 | 6 | <br /> |
@@ -11,25 +11,25 @@ discard block |
||
11 | 11 | /* |
12 | 12 | * Loop over interest groups |
13 | 13 | */ |
14 | -foreach( $interest_groupings as $id => $interest_group ) { |
|
14 | +foreach ( $interest_groupings as $id => $interest_group ) { |
|
15 | 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(); |
|
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 | 19 | ?> |
20 | 20 | <section class="interest-group-section"> |
21 | - <strong class="interest-group-section-title"><?php echo ucwords( $interest_group['title'] ); ?></strong> |
|
21 | + <strong class="interest-group-section-title"><?php echo ucwords( $interest_group[ 'title' ] ); ?></strong> |
|
22 | 22 | <?php |
23 | 23 | /* |
24 | 24 | * Loop over the interest group types, and return the appropriate type |
25 | 25 | */ |
26 | 26 | $checked = $selected = ''; |
27 | - switch( $interest_group_type ) { |
|
27 | + switch ( $interest_group_type ) { |
|
28 | 28 | |
29 | 29 | default: |
30 | 30 | case 'hidden': |
31 | 31 | case 'checkboxes': |
32 | - foreach( $interest_groups_fields as $field_id => $field ) { |
|
32 | + foreach ( $interest_groups_fields as $field_id => $field ) { |
|
33 | 33 | if ( isset( $selected_interest_groups[ $id ] ) ) { |
34 | 34 | $checked = checked( true, in_array( $field_id, $selected_interest_groups[ $id ] ), false ); |
35 | 35 | } |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | <input type="checkbox" |
39 | 39 | name="optin-checkbox-init[<?php echo $integration_type; ?>][interest-groups][<?php echo $id; ?>][]" |
40 | 40 | value="<?php echo $field_id; ?>" <?php echo $checked ?>> |
41 | - <?php echo $field['name']; ?> |
|
41 | + <?php echo $field[ 'name' ]; ?> |
|
42 | 42 | </label> |
43 | 43 | <?php |
44 | 44 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | <input type="radio" |
55 | 55 | name="optin-checkbox-init[<?php echo $integration_type; ?>][interest-groups][<?php echo $id; ?>][]" |
56 | 56 | value="<?php echo $field_id; ?>" <?php echo $checked; ?>> |
57 | - <?php echo $field['name']; ?> |
|
57 | + <?php echo $field[ 'name' ]; ?> |
|
58 | 58 | </label> |
59 | 59 | <?php |
60 | 60 | } |
@@ -65,13 +65,13 @@ discard block |
||
65 | 65 | if ( ! empty( $interest_groups_fields ) ) { |
66 | 66 | ?> |
67 | 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 ) { |
|
68 | + <?php foreach ( $interest_groups_fields as $field_id => $field ) { |
|
69 | 69 | if ( isset( $selected_interest_groups[ $id ] ) ) { |
70 | 70 | $selected = checked( true, in_array( $field_id, $selected_interest_groups[ $id ] ), false ); |
71 | 71 | } |
72 | 72 | ?> |
73 | 73 | <option value="<?php echo $field_id; ?>" <?php echo $selected; ?>> |
74 | - <?php echo $field['name']; ?> |
|
74 | + <?php echo $field[ 'name' ]; ?> |
|
75 | 75 | </option> |
76 | 76 | <?php |
77 | 77 | } |
@@ -48,11 +48,11 @@ discard block |
||
48 | 48 | ?> |
49 | 49 | <div class="wrap" id="account-details"> |
50 | 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" /> |
|
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 | 52 | |
53 | - <h1><?php _e( 'Account Overview' , 'yikes-inc-easy-mailchimp-extender' ); echo ' | ' . $account_details['username']; ?></h1> |
|
53 | + <h1><?php _e( 'Account Overview', 'yikes-inc-easy-mailchimp-extender' ); echo ' | ' . $account_details[ 'username' ]; ?></h1> |
|
54 | 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> |
|
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 | 56 | |
57 | 57 | <div id="poststuff"> |
58 | 58 | <div id="post-body" class="metabox-holder columns-2"> |
@@ -62,17 +62,17 @@ discard block |
||
62 | 62 | <!-- <div class="postbox yikes-easy-mc-postbox" id="chimp-chatter"> |
63 | 63 | <div class="inside"> --> |
64 | 64 | |
65 | - <h1><?php _e( 'Chimp Chatter' , 'yikes-inc-easy-mailchimp-extender' ); ?></h1> |
|
65 | + <h1><?php _e( 'Chimp Chatter', 'yikes-inc-easy-mailchimp-extender' ); ?></h1> |
|
66 | 66 | |
67 | 67 | <?php |
68 | 68 | $date_format = get_option( 'date_format' ); |
69 | 69 | $time_format = get_option( 'time_format' ); |
70 | 70 | $x = 1; |
71 | 71 | $end = count( $account_activity ); |
72 | - foreach( $account_activity as $activity ) { |
|
73 | - $split_type = explode( ':',str_replace('-',' ',$activity['type'])); |
|
72 | + foreach ( $account_activity as $activity ) { |
|
73 | + $split_type = explode( ':', str_replace( '-', ' ', $activity[ 'type' ] ) ); |
|
74 | 74 | $section_class = ''; |
75 | - switch( $activity['type'] ) { |
|
75 | + switch ( $activity[ 'type' ] ) { |
|
76 | 76 | case 'lists:new-subscriber': |
77 | 77 | case 'lists:profile-updates': |
78 | 78 | case 'campaigns:facebook-likes': |
@@ -90,60 +90,60 @@ discard block |
||
90 | 90 | $section_class = 'chimp-chatter-neutral'; |
91 | 91 | break; |
92 | 92 | } |
93 | - if( $x < 5 ) { |
|
93 | + if ( $x < 5 ) { |
|
94 | 94 | ?> |
95 | 95 | <!--- <section class="chimp-chatter-container <?php echo esc_attr( $section_class ); ?>"> |
96 | - <div class="chatter-type"><?php echo ucwords( $split_type[1] ); ?></div> |
|
96 | + <div class="chatter-type"><?php echo ucwords( $split_type[ 1 ] ); ?></div> |
|
97 | 97 | <p class="chatter-message description"> |
98 | - <?php echo $activity['message']; ?> |
|
98 | + <?php echo $activity[ 'message' ]; ?> |
|
99 | 99 | </p> |
100 | 100 | <p class="chatter-time"> |
101 | - <?php echo get_date_from_gmt( $activity['update_time'], 'F jS, Y h:i a' ); ?> |
|
101 | + <?php echo get_date_from_gmt( $activity[ 'update_time' ], 'F jS, Y h:i a' ); ?> |
|
102 | 102 | </p> |
103 | 103 | </section> --> |
104 | 104 | |
105 | - <section class="postbox yikes-easy-mc-postbox chimp-chatter-postbox <?php echo esc_attr( $section_class ); if( $x % 2 == 0 ) { echo ' even'; } ?>"> |
|
105 | + <section class="postbox yikes-easy-mc-postbox chimp-chatter-postbox <?php echo esc_attr( $section_class ); if ( $x % 2 == 0 ) { echo ' even'; } ?>"> |
|
106 | 106 | <div class="inside"> |
107 | - <div class="chatter-type"><?php echo ucwords( $split_type[1] ); ?></div> |
|
107 | + <div class="chatter-type"><?php echo ucwords( $split_type[ 1 ] ); ?></div> |
|
108 | 108 | <p class="chatter-message description"> |
109 | - <?php echo $activity['message']; ?> |
|
109 | + <?php echo $activity[ 'message' ]; ?> |
|
110 | 110 | </p> |
111 | 111 | <p class="chatter-time"> |
112 | - <?php echo get_date_from_gmt( $activity['update_time'], 'F jS, Y h:i a' ); ?> |
|
112 | + <?php echo get_date_from_gmt( $activity[ 'update_time' ], 'F jS, Y h:i a' ); ?> |
|
113 | 113 | </p> |
114 | 114 | </div> |
115 | 115 | </section> |
116 | 116 | <?php |
117 | 117 | } else { |
118 | - if( $x == 7 ) { |
|
118 | + if ( $x == 7 ) { |
|
119 | 119 | ?> |
120 | 120 | <div id="hidden-chatter" class="yikes-easy-mc-hidden"> |
121 | 121 | <?php |
122 | 122 | } |
123 | 123 | ?> |
124 | 124 | <!-- <section class="chimp-chatter-container <?php echo esc_attr( $section_class ); ?>"> |
125 | - <div class="chatter-type"><?php echo ucwords( $split_type[1] ); ?></div> |
|
125 | + <div class="chatter-type"><?php echo ucwords( $split_type[ 1 ] ); ?></div> |
|
126 | 126 | <p class="chatter-message description"> |
127 | - <?php echo $activity['message']; ?> |
|
127 | + <?php echo $activity[ 'message' ]; ?> |
|
128 | 128 | </p> |
129 | 129 | <p class="chatter-time"> |
130 | - <?php echo get_date_from_gmt( $activity['update_time'], 'F jS, Y h:i a' ); ?> |
|
130 | + <?php echo get_date_from_gmt( $activity[ 'update_time' ], 'F jS, Y h:i a' ); ?> |
|
131 | 131 | </p> |
132 | 132 | </section> --> |
133 | 133 | |
134 | - <section class="postbox yikes-easy-mc-postbox chimp-chatter-postbox <?php echo esc_attr( $section_class ); if( $x % 2 == 0 ) { echo ' even'; } ?>"> |
|
134 | + <section class="postbox yikes-easy-mc-postbox chimp-chatter-postbox <?php echo esc_attr( $section_class ); if ( $x % 2 == 0 ) { echo ' even'; } ?>"> |
|
135 | 135 | <div class="inside"> |
136 | - <div class="chatter-type"><?php echo ucwords( $split_type[1] ); ?></div> |
|
136 | + <div class="chatter-type"><?php echo ucwords( $split_type[ 1 ] ); ?></div> |
|
137 | 137 | <p class="chatter-message description"> |
138 | - <?php echo $activity['message']; ?> |
|
138 | + <?php echo $activity[ 'message' ]; ?> |
|
139 | 139 | </p> |
140 | 140 | <p class="chatter-time"> |
141 | - <?php echo get_date_from_gmt( $activity['update_time'], 'F jS, Y h:i a' ); ?> |
|
141 | + <?php echo get_date_from_gmt( $activity[ 'update_time' ], 'F jS, Y h:i a' ); ?> |
|
142 | 142 | </p> |
143 | 143 | </div> |
144 | 144 | </section> |
145 | 145 | <?php |
146 | - if( $x == $end ) { |
|
146 | + if ( $x == $end ) { |
|
147 | 147 | ?> |
148 | 148 | </div> |
149 | 149 | <?php |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | ?> |
155 | 155 | |
156 | 156 | <div class="chimpchatter-button-container"> |
157 | - <a href="#" onclick="jQuery(this).parents().find('#hidden-chatter').slideToggle();jQuery(this).fadeOut();return false;" class="button-primary"><?php _e( 'View All Activity' , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
157 | + <a href="#" onclick="jQuery(this).parents().find('#hidden-chatter').slideToggle();jQuery(this).fadeOut();return false;" class="button-primary"><?php _e( 'View All Activity', 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
158 | 158 | </div> |
159 | 159 | |
160 | 160 | <!-- </div> --> |
@@ -175,8 +175,8 @@ discard block |
||
175 | 175 | <div class="postbox yikes-easy-mc-postbox"> |
176 | 176 | <div class="inside"> |
177 | 177 | |
178 | - <a href="https://us3.admin.mailchimp.com/" title="<?php _e( 'MailChimp Site' , 'yikes-inc-easy-mailchimp-extender' ); ?>" target="_blank"> |
|
179 | - <img src="<?php echo YIKES_MC_URL . 'includes/images/Welcome_Page/mailchimp-logo.png'; ?>" title="<?php _e( 'MailChimp Site' , 'yikes-inc-easy-mailchimp-extender' ); ?>" class="chimp-chatter-mailchimp-logo"> |
|
178 | + <a href="https://us3.admin.mailchimp.com/" title="<?php _e( 'MailChimp Site', 'yikes-inc-easy-mailchimp-extender' ); ?>" target="_blank"> |
|
179 | + <img src="<?php echo YIKES_MC_URL . 'includes/images/Welcome_Page/mailchimp-logo.png'; ?>" title="<?php _e( 'MailChimp Site', 'yikes-inc-easy-mailchimp-extender' ); ?>" class="chimp-chatter-mailchimp-logo"> |
|
180 | 180 | </a> |
181 | 181 | |
182 | 182 | </div> |
@@ -186,60 +186,60 @@ discard block |
||
186 | 186 | <div class="postbox yikes-easy-mc-postbox chimp-chatter-sidebar"> |
187 | 187 | <div class="inside"> |
188 | 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> |
|
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 | 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' ); ?>"> |
|
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 | 192 | |
193 | 193 | <table class="form-table" id="account-details-table"> |
194 | 194 | <tr valign="top"> |
195 | 195 | <td scope="row"> |
196 | 196 | <label for="tablecell"> |
197 | - <strong><?php _e( 'Company' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
197 | + <strong><?php _e( 'Company', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
198 | 198 | </label> |
199 | 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> |
|
200 | + <td><?php echo $new_account_details[ 'contact' ][ 'company' ]; ?><br /><?php echo $new_account_details[ 'contact' ][ 'city' ] . ', ' . $new_account_details[ 'contact' ][ 'state' ]; ?></td> |
|
201 | 201 | </tr> |
202 | 202 | <tr valign="top"> |
203 | 203 | <td scope="row"> |
204 | 204 | <label for="tablecell"> |
205 | - <strong><?php _e( 'Industry' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
205 | + <strong><?php _e( 'Industry', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
206 | 206 | </label> |
207 | 207 | </td> |
208 | - <td><?php echo $account_details['industry']; ?></td> |
|
208 | + <td><?php echo $account_details[ 'industry' ]; ?></td> |
|
209 | 209 | </tr> |
210 | 210 | <tr valign="top"> |
211 | 211 | <td scope="row"> |
212 | 212 | <label for="tablecell"> |
213 | - <strong><?php _e( 'Member Since' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
213 | + <strong><?php _e( 'Member Since', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
214 | 214 | </label> |
215 | 215 | </td> |
216 | - <td><?php echo date( get_option('date_format') , strtotime( $account_details['member_since'] ) ); ?></td> |
|
216 | + <td><?php echo date( get_option( 'date_format' ), strtotime( $account_details[ 'member_since' ] ) ); ?></td> |
|
217 | 217 | </tr> |
218 | 218 | <tr valign="top"> |
219 | 219 | <td scope="row"> |
220 | 220 | <label for="tablecell"> |
221 | - <strong><?php _e( 'Plan Type' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
221 | + <strong><?php _e( 'Plan Type', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
222 | 222 | </label> |
223 | 223 | </td> |
224 | - <td><?php echo ucwords( $account_details['plan_type'] ); ?></td> |
|
224 | + <td><?php echo ucwords( $account_details[ 'plan_type' ] ); ?></td> |
|
225 | 225 | </tr> |
226 | - <?php if( $account_details['plan_type'] == 'payasyougo' || $account_details['plan_type'] == 'free' ) { ?> |
|
226 | + <?php if ( $account_details[ 'plan_type' ] == 'payasyougo' || $account_details[ 'plan_type' ] == 'free' ) { ?> |
|
227 | 227 | <tr valign="top"> |
228 | 228 | <td scope="row"> |
229 | 229 | <label for="tablecell"> |
230 | - <strong><?php _e( 'Emails Left' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
230 | + <strong><?php _e( 'Emails Left', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
231 | 231 | </label> |
232 | 232 | </td> |
233 | - <td><?php echo number_format( $account_details['emails_left'] ); ?></td> |
|
233 | + <td><?php echo number_format( $account_details[ 'emails_left' ] ); ?></td> |
|
234 | 234 | </tr> |
235 | 235 | <?php } ?> |
236 | 236 | <tr valign="top"> |
237 | 237 | <td scope="row"> |
238 | 238 | <label for="tablecell"> |
239 | - <strong><?php _e( 'Affiliate Link' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
239 | + <strong><?php _e( 'Affiliate Link', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
240 | 240 | </label> |
241 | 241 | </td> |
242 | - <td><a href="#" onclick="jQuery(this).hide().next().fadeIn('fast');return false;" class="button-secondary"><?php _e( 'View Link', 'yikes-inc-easy-mailchimp-extender' ); ?></a><input type="text" class="widefat mailchimp-affiliate-link" readonly value="<?php echo esc_url_raw( $account_details['affiliate_link'] ); ?>" onclick="jQuery(this).select();return false;"></td> |
|
242 | + <td><a href="#" onclick="jQuery(this).hide().next().fadeIn('fast');return false;" class="button-secondary"><?php _e( 'View Link', 'yikes-inc-easy-mailchimp-extender' ); ?></a><input type="text" class="widefat mailchimp-affiliate-link" readonly value="<?php echo esc_url_raw( $account_details[ 'affiliate_link' ] ); ?>" onclick="jQuery(this).select();return false;"></td> |
|
243 | 243 | </tr> |
244 | 244 | </table> |
245 | 245 |
@@ -6,13 +6,13 @@ discard block |
||
6 | 6 | $all_forms = $form_interface->get_all_forms(); |
7 | 7 | |
8 | 8 | /* Store Data if User is Authorized */ |
9 | -if( $this->is_user_mc_api_valid_form( false ) == 'valid' ) { |
|
9 | +if ( $this->is_user_mc_api_valid_form( false ) == 'valid' ) { |
|
10 | 10 | $list_data = yikes_get_mc_api_manager()->get_list_handler()->get_lists(); |
11 | 11 | if ( is_wp_error( $list_data ) ) { |
12 | 12 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
13 | 13 | $error_logging->maybe_write_to_log( |
14 | 14 | $list_data->get_error_code(), |
15 | - __( "Get Account Lists" , 'yikes-inc-easy-mailchimp-extender' ), |
|
15 | + __( "Get Account Lists", 'yikes-inc-easy-mailchimp-extender' ), |
|
16 | 16 | "Manage Forms Page" |
17 | 17 | ); |
18 | 18 | $list_data = array(); |
@@ -23,24 +23,24 @@ discard block |
||
23 | 23 | ?> |
24 | 24 | <div class="wrap"> |
25 | 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" /> |
|
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 | 27 | |
28 | - <h1>YIKES Easy Forms for MailChimp | <?php _e( 'Manage Forms' , 'yikes-inc-easy-mailchimp-extender' ) ?></h1> |
|
28 | + <h1>YIKES Easy Forms for MailChimp | <?php _e( 'Manage Forms', 'yikes-inc-easy-mailchimp-extender' ) ?></h1> |
|
29 | 29 | |
30 | 30 | <!-- Settings Page Description --> |
31 | - <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> |
|
31 | + <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> |
|
32 | 32 | |
33 | 33 | <!-- Action Notices --> |
34 | 34 | <?php |
35 | 35 | |
36 | 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 ); |
|
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 | 39 | } |
40 | 40 | |
41 | 41 | /* Display our admin notices here */ |
42 | 42 | // delete form success |
43 | - if( isset( $_REQUEST['deleted-form'] ) && $_REQUEST['deleted-form'] == 'true' ) { |
|
43 | + if ( isset( $_REQUEST[ 'deleted-form' ] ) && $_REQUEST[ 'deleted-form' ] == 'true' ) { |
|
44 | 44 | ?> |
45 | 45 | <div class="updated manage-form-admin-notice"> |
46 | 46 | <p><?php _e( 'Opt-in form successfully deleted.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | <?php |
49 | 49 | } |
50 | 50 | // duplicate form success |
51 | - if( isset( $_REQUEST['duplicated-form'] ) && $_REQUEST['duplicated-form'] == 'true' ) { |
|
51 | + if ( isset( $_REQUEST[ 'duplicated-form' ] ) && $_REQUEST[ 'duplicated-form' ] == 'true' ) { |
|
52 | 52 | ?> |
53 | 53 | <div class="updated manage-form-admin-notice"> |
54 | 54 | <p><?php _e( 'MailChimp Form successfully cloned.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | <?php |
57 | 57 | } |
58 | 58 | // duplicate form error |
59 | - if( isset( $_REQUEST['duplicated-form'] ) && $_REQUEST['duplicated-form'] == 'false' ) { |
|
59 | + if ( isset( $_REQUEST[ 'duplicated-form' ] ) && $_REQUEST[ 'duplicated-form' ] == 'false' ) { |
|
60 | 60 | ?> |
61 | 61 | <div class="error manage-form-admin-notice"> |
62 | 62 | <p><?php _e( 'There was an error trying to clone your form. Please try again. If this error persists, please contact the YIKES Inc. support team.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | <?php |
65 | 65 | } |
66 | 66 | // reset form submission stats success |
67 | - if( isset( $_REQUEST['reset-stats'] ) && $_REQUEST['reset-stats'] == 'true' ) { |
|
67 | + if ( isset( $_REQUEST[ 'reset-stats' ] ) && $_REQUEST[ 'reset-stats' ] == 'true' ) { |
|
68 | 68 | ?> |
69 | 69 | <div class="updated manage-form-admin-notice"> |
70 | 70 | <p><?php _e( 'Form submission stats/rates successfully reset.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | <?php |
73 | 73 | } |
74 | 74 | // reset form submission stats error |
75 | - if( isset( $_REQUEST['reset-stats'] ) && $_REQUEST['reset-stats'] == 'false' ) { |
|
75 | + if ( isset( $_REQUEST[ 'reset-stats' ] ) && $_REQUEST[ 'reset-stats' ] == 'false' ) { |
|
76 | 76 | ?> |
77 | 77 | <div class="error manage-form-admin-notice"> |
78 | 78 | <p><?php _e( 'There was an error trying to reset the form submission stats/rates. Please try again. If this error persists, please contact the YIKES Inc. support team.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
@@ -99,13 +99,13 @@ discard block |
||
99 | 99 | <thead> |
100 | 100 | <tr> |
101 | 101 | <th id="cb" class="manage-column column-cb check-column num" scope="col"><input type="checkbox" /></th> |
102 | - <th id="columnname" class="manage-column column-columnname num yikes-form-id-number" scope="col"><?php _e( 'ID' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
103 | - <th id="columnname" class="manage-column column-columnname" scope="col"><?php _e( 'Form Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
104 | - <th id="columnname" class="manage-column column-columnname" scope="col"><?php _e( 'Form Description' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
105 | - <th id="columnname" class="manage-column column-columnname" scope="col"><?php _e( 'List' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
106 | - <th id="columnname" class="manage-column column-columnname num" scope="col"><?php _e( 'Impressions' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
107 | - <th id="columnname" class="manage-column column-columnname num" scope="col" ><?php _e( 'Submissions' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
108 | - <th id="columnname" class="manage-column column-columnname num" scope="col"><?php _e( 'Conversion Rate' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
102 | + <th id="columnname" class="manage-column column-columnname num yikes-form-id-number" scope="col"><?php _e( 'ID', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
103 | + <th id="columnname" class="manage-column column-columnname" scope="col"><?php _e( 'Form Name', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
104 | + <th id="columnname" class="manage-column column-columnname" scope="col"><?php _e( 'Form Description', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
105 | + <th id="columnname" class="manage-column column-columnname" scope="col"><?php _e( 'List', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
106 | + <th id="columnname" class="manage-column column-columnname num" scope="col"><?php _e( 'Impressions', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
107 | + <th id="columnname" class="manage-column column-columnname num" scope="col" ><?php _e( 'Submissions', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
108 | + <th id="columnname" class="manage-column column-columnname num" scope="col"><?php _e( 'Conversion Rate', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
109 | 109 | </tr> |
110 | 110 | </thead> |
111 | 111 | <!-- end header --> |
@@ -114,13 +114,13 @@ discard block |
||
114 | 114 | <tfoot> |
115 | 115 | <tr> |
116 | 116 | <th class="manage-column column-cb check-column num" scope="col"><input type="checkbox" /></th> |
117 | - <th id="columnname" class="manage-column column-columnname num yikes-form-id-number" scope="col"><?php _e( 'ID' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
118 | - <th id="columnname" class="manage-column column-columnname" scope="col"><?php _e( 'Form Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
119 | - <th id="columnname" class="manage-column column-columnname" scope="col"><?php _e( 'Form Description' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
120 | - <th class="manage-column column-columnname" scope="col"><?php _e( 'List' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
121 | - <th id="columnname" class="manage-column column-columnname num" scope="col"><?php _e( 'Impressions' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
122 | - <th id="columnname" class="manage-column column-columnname num" scope="col"><?php _e( 'Submissions' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
123 | - <th id="columnname" class="manage-column column-columnname num" scope="col"><?php _e( 'Conversion Rate' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
117 | + <th id="columnname" class="manage-column column-columnname num yikes-form-id-number" scope="col"><?php _e( 'ID', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
118 | + <th id="columnname" class="manage-column column-columnname" scope="col"><?php _e( 'Form Name', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
119 | + <th id="columnname" class="manage-column column-columnname" scope="col"><?php _e( 'Form Description', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
120 | + <th class="manage-column column-columnname" scope="col"><?php _e( 'List', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
121 | + <th id="columnname" class="manage-column column-columnname num" scope="col"><?php _e( 'Impressions', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
122 | + <th id="columnname" class="manage-column column-columnname num" scope="col"><?php _e( 'Submissions', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
123 | + <th id="columnname" class="manage-column column-columnname num" scope="col"><?php _e( 'Conversion Rate', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
124 | 124 | </tr> |
125 | 125 | </tfoot> |
126 | 126 | <!-- end footer --> |
@@ -130,40 +130,40 @@ discard block |
||
130 | 130 | <?php |
131 | 131 | if ( count( $all_forms ) > 0 ) { |
132 | 132 | $i = 1; |
133 | - foreach( $all_forms as $id => $form ) { |
|
133 | + foreach ( $all_forms as $id => $form ) { |
|
134 | 134 | ?> |
135 | - <tr class="<?php if( $i % 2 == 0 ) { echo 'alternate'; } ?>"> |
|
135 | + <tr class="<?php if ( $i % 2 == 0 ) { echo 'alternate'; } ?>"> |
|
136 | 136 | <th class="check-column num" scope="row"><input type="checkbox" /></th> |
137 | 137 | <td class="column-columnname num"><span class="form-id-container"><?php echo intval( $id ); ?></span></td> |
138 | 138 | <td class="column-columnname"> |
139 | 139 | <!-- row title/link --> |
140 | - <a href="<?php echo esc_url_raw( add_query_arg( array( 'id' => $id ) , admin_url( 'admin.php?page=yikes-mailchimp-edit-form' ) ) ); ?>" class="row-title"> |
|
141 | - <?php echo stripslashes( $form['form_name'] ); ?> |
|
140 | + <a href="<?php echo esc_url_raw( add_query_arg( array( 'id' => $id ), admin_url( 'admin.php?page=yikes-mailchimp-edit-form' ) ) ); ?>" class="row-title"> |
|
141 | + <?php echo stripslashes( $form[ 'form_name' ] ); ?> |
|
142 | 142 | </a> |
143 | 143 | <div class="row-actions"> |
144 | - <span><a href="<?php echo esc_url_raw( add_query_arg( array( 'id' => $id ) , admin_url( 'admin.php?page=yikes-mailchimp-edit-form' ) ) ); ?>"><?php _e( "Edit" , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |</span> |
|
145 | - <span><a href="<?php echo esc_url_raw( add_query_arg( array( 'action' => 'yikes-easy-mc-duplicate-form', 'mailchimp-form' => $id , 'nonce' => wp_create_nonce( 'duplicate-mailchimp-form-'.$id ) ) , admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ) ); ?>"><?php _e( "Duplicate" , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |</span> |
|
146 | - <span><a href="<?php echo esc_url_raw( add_query_arg( array( 'action' => 'yikes-easy-mc-reset-stats', 'mailchimp-form' => $id , 'nonce' => wp_create_nonce( 'reset-stats-mailchimp-form-'.$id ) ) , admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ) ); ?>"><?php _e( "Reset Stats" , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |</span> |
|
147 | - <span><a href="#" class="view-yikes-mc-form-shortcode" data-alt-text="<?php _e( 'Stats' , 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( "Shortcode" , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |</span> |
|
144 | + <span><a href="<?php echo esc_url_raw( add_query_arg( array( 'id' => $id ), admin_url( 'admin.php?page=yikes-mailchimp-edit-form' ) ) ); ?>"><?php _e( "Edit", 'yikes-inc-easy-mailchimp-extender' ); ?></a> |</span> |
|
145 | + <span><a href="<?php echo esc_url_raw( add_query_arg( array( 'action' => 'yikes-easy-mc-duplicate-form', 'mailchimp-form' => $id, 'nonce' => wp_create_nonce( 'duplicate-mailchimp-form-' . $id ) ), admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ) ); ?>"><?php _e( "Duplicate", 'yikes-inc-easy-mailchimp-extender' ); ?></a> |</span> |
|
146 | + <span><a href="<?php echo esc_url_raw( add_query_arg( array( 'action' => 'yikes-easy-mc-reset-stats', 'mailchimp-form' => $id, 'nonce' => wp_create_nonce( 'reset-stats-mailchimp-form-' . $id ) ), admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ) ); ?>"><?php _e( "Reset Stats", 'yikes-inc-easy-mailchimp-extender' ); ?></a> |</span> |
|
147 | + <span><a href="#" class="view-yikes-mc-form-shortcode" data-alt-text="<?php _e( 'Stats', 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( "Shortcode", 'yikes-inc-easy-mailchimp-extender' ); ?></a> |</span> |
|
148 | 148 | <?php |
149 | 149 | /* |
150 | 150 | * Custom action to allow users to add additional action links |
151 | 151 | * to each form. We use this in our add-ons. |
152 | 152 | * - Delete should remain last |
153 | 153 | */ |
154 | - do_action( 'yikes-mailchimp-custom-form-actions' , $id ); |
|
154 | + do_action( 'yikes-mailchimp-custom-form-actions', $id ); |
|
155 | 155 | ?> |
156 | - <span><a href="<?php echo esc_url_raw( add_query_arg( array( 'action' => 'yikes-easy-mc-delete-form', 'mailchimp-form' => $id , 'nonce' => wp_create_nonce( 'delete-mailchimp-form-'.$id ) ) , admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ) ); ?>" class="yikes-delete-mailchimp-form" onclick="return confirm('<?php printf( __( 'Are you sure you want to delete the %s form? This cannot be undone.' , 'yikes-inc-easy-mailchimp-extender' ), stripslashes( $form['form_name'] ) ); ?>');"><?php _e( "Delete" , 'yikes-inc-easy-mailchimp-extender' ); ?></a></span> |
|
156 | + <span><a href="<?php echo esc_url_raw( add_query_arg( array( 'action' => 'yikes-easy-mc-delete-form', 'mailchimp-form' => $id, 'nonce' => wp_create_nonce( 'delete-mailchimp-form-' . $id ) ), admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ) ); ?>" class="yikes-delete-mailchimp-form" onclick="return confirm('<?php printf( __( 'Are you sure you want to delete the %s form? This cannot be undone.', 'yikes-inc-easy-mailchimp-extender' ), stripslashes( $form[ 'form_name' ] ) ); ?>');"><?php _e( "Delete", 'yikes-inc-easy-mailchimp-extender' ); ?></a></span> |
|
157 | 157 | </div> |
158 | 158 | </td> |
159 | 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> |
|
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 | 161 | <td class="column-columnname"> |
162 | 162 | <?php |
163 | 163 | if ( $list_data && count( $list_data ) > 0 ) { |
164 | 164 | $parsed = wp_list_pluck( $list_data, 'name', 'id' ); |
165 | - if ( isset( $parsed[ $form['list_id'] ] ) ) { |
|
166 | - echo esc_textarea( $parsed[ $form['list_id'] ] ); |
|
165 | + if ( isset( $parsed[ $form[ 'list_id' ] ] ) ) { |
|
166 | + echo esc_textarea( $parsed[ $form[ 'list_id' ] ] ); |
|
167 | 167 | } else { |
168 | 168 | echo '<strong>' . __( 'List Not Found', 'yikes-inc-easy-mailchimp-extender' ) . '</strong>'; |
169 | 169 | } |
@@ -172,25 +172,25 @@ discard block |
||
172 | 172 | |
173 | 173 | <td class="column-columnname num stat-container"> |
174 | 174 | <?php |
175 | - $impressions = number_format( $form['impressions'] ); |
|
176 | - echo '<span title="' . __( 'Impressions' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . $impressions . '</span>'; |
|
175 | + $impressions = number_format( $form[ 'impressions' ] ); |
|
176 | + echo '<span title="' . __( 'Impressions', 'yikes-inc-easy-mailchimp-extender' ) . '">' . $impressions . '</span>'; |
|
177 | 177 | ?> |
178 | 178 | </td> |
179 | 179 | <td class="column-columnname num stat-container"> |
180 | 180 | <?php |
181 | - $submissions = number_format( $form['submissions'] ); |
|
182 | - echo '<span title="' . __( 'Submissions' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . $submissions . '</span>'; |
|
181 | + $submissions = number_format( $form[ 'submissions' ] ); |
|
182 | + echo '<span title="' . __( 'Submissions', 'yikes-inc-easy-mailchimp-extender' ) . '">' . $submissions . '</span>'; |
|
183 | 183 | ?> |
184 | 184 | </td> |
185 | 185 | <td class="column-columnname num stat-container"> |
186 | 186 | <?php |
187 | - if( $impressions != 0 ) { |
|
188 | - $conversion_rate = '%' . ( round( $form['submissions'] / $form['impressions'] , 2 ) * 100 ); |
|
189 | - if( $conversion_rate >= '%15' ) { |
|
187 | + if ( $impressions != 0 ) { |
|
188 | + $conversion_rate = '%' . ( round( $form[ 'submissions' ] / $form[ 'impressions' ], 2 ) * 100 ); |
|
189 | + if ( $conversion_rate >= '%15' ) { |
|
190 | 190 | $conversion_color = '#00cc00'; // green (unicorn!) |
191 | - } else if( $conversion_rate < '%15' && $conversion_rate >= '%10' ) { |
|
191 | + } else if ( $conversion_rate < '%15' && $conversion_rate >= '%10' ) { |
|
192 | 192 | $conversion_color = '#0080FF'; // light blue (good) |
193 | - } else if( $conversion_rate < '%10' && $conversion_rate >= '%5' ) { |
|
193 | + } else if ( $conversion_rate < '%10' && $conversion_rate >= '%5' ) { |
|
194 | 194 | $conversion_color = '#FFFF32'; // yellow (ok) |
195 | 195 | } else { |
196 | 196 | $conversion_color = '#FF0000'; // red (no bueno) |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | $conversion_rate = '%0'; |
200 | 200 | $conversion_color = '#333333'; |
201 | 201 | } |
202 | - echo '<span style="color:' . esc_attr( $conversion_color ) . ';" title="' . esc_attr__( 'Conversion Rate' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . $conversion_rate . '</span>'; |
|
202 | + echo '<span style="color:' . esc_attr( $conversion_color ) . ';" title="' . esc_attr__( 'Conversion Rate', 'yikes-inc-easy-mailchimp-extender' ) . '">' . $conversion_rate . '</span>'; |
|
203 | 203 | ?> |
204 | 204 | </td> |
205 | 205 | <!-- shortcode --> |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | } |
213 | 213 | } else { ?> |
214 | 214 | <tr class="no-items"> |
215 | - <td class="colspanchange no-mailchimp-forms-found" colspan="8"><em><?php _e( 'No MailChimp forms found. Use the form to the right to create a new one.' , 'yikes-inc-easy-mailchimp-extender' ); ?></em></td> |
|
215 | + <td class="colspanchange no-mailchimp-forms-found" colspan="8"><em><?php _e( 'No MailChimp forms found. Use the form to the right to create a new one.', 'yikes-inc-easy-mailchimp-extender' ); ?></em></td> |
|
216 | 216 | </tr> |
217 | 217 | <?php } ?> |
218 | 218 | </tbody> |
@@ -17,16 +17,16 @@ discard block |
||
17 | 17 | ?> |
18 | 18 | <div class="wrap"> |
19 | 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" /> |
|
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 | 21 | |
22 | - <h1>YIKES Easy Forms for MailChimp | <?php _e( 'Manage Mailing Lists' , 'yikes-inc-easy-mailchimp-extender' ); ?></h1> |
|
22 | + <h1>YIKES Easy Forms for MailChimp | <?php _e( 'Manage Mailing Lists', 'yikes-inc-easy-mailchimp-extender' ); ?></h1> |
|
23 | 23 | |
24 | 24 | <!-- Settings Page Description --> |
25 | - <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> |
|
25 | + <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> |
|
26 | 26 | |
27 | 27 | <?php |
28 | 28 | /* If the user hasn't authenticated yet, lets kill off */ |
29 | - if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) != 'valid_api_key' ) { |
|
29 | + if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) != 'valid_api_key' ) { |
|
30 | 30 | |
31 | 31 | $error_string = sprintf( |
32 | 32 | 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' ), |
@@ -62,8 +62,8 @@ discard block |
||
62 | 62 | <!-- TABLE HEAD --> |
63 | 63 | <thead> |
64 | 64 | <tr> |
65 | - <th id="columnname" class="manage-column column-columnname" scope="col"><?php _e( 'List Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
66 | - <th id="columnname" class="manage-column column-columnname num" scope="col"><?php _e( 'Subscriber Count' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
65 | + <th id="columnname" class="manage-column column-columnname" scope="col"><?php _e( 'List Name', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
66 | + <th id="columnname" class="manage-column column-columnname num" scope="col"><?php _e( 'Subscriber Count', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
67 | 67 | </tr> |
68 | 68 | </thead> |
69 | 69 | <!-- end header --> |
@@ -71,25 +71,25 @@ discard block |
||
71 | 71 | <!-- FOOTER --> |
72 | 72 | <tfoot> |
73 | 73 | <tr> |
74 | - <th class="manage-column column-columnname" scope="col"><?php _e( 'List Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
75 | - <th class="manage-column column-columnname num" scope="col"><?php _e( 'Subscriber Count' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
74 | + <th class="manage-column column-columnname" scope="col"><?php _e( 'List Name', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
75 | + <th class="manage-column column-columnname num" scope="col"><?php _e( 'Subscriber Count', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
76 | 76 | </tr> |
77 | 77 | </tfoot> |
78 | 78 | <!-- end footer --> |
79 | 79 | |
80 | 80 | <!-- TABLE BODY --> |
81 | 81 | <tbody> |
82 | - <?php if( count( $list_data ) > 0 ) { |
|
82 | + <?php if ( count( $list_data ) > 0 ) { |
|
83 | 83 | $i = 1; |
84 | - foreach( $list_data as $list ) { |
|
84 | + foreach ( $list_data as $list ) { |
|
85 | 85 | ?> |
86 | - <tr class="<?php if( $i % 2 == 0 ) { echo 'alternate'; } ?>"> |
|
86 | + <tr class="<?php if ( $i % 2 == 0 ) { echo 'alternate'; } ?>"> |
|
87 | 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'] ); ?> |
|
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 | 90 | </a> |
91 | 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> |
|
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 | 93 | <?php |
94 | 94 | /* |
95 | 95 | * Custom action to allow users to add additional action links |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | ?> |
100 | 100 | </div> |
101 | 101 | </td> |
102 | - <td class="column-columnname num"><?php echo $list['stats']['member_count']; ?></td> |
|
102 | + <td class="column-columnname num"><?php echo $list[ 'stats' ][ 'member_count' ]; ?></td> |
|
103 | 103 | </tr> |
104 | 104 | <?php |
105 | 105 | $i++; |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | } else { |
108 | 108 | ?> |
109 | 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> |
|
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 | 111 | </tr> |
112 | 112 | <?php } ?> |
113 | 113 | </tbody> |
@@ -2,36 +2,36 @@ |
||
2 | 2 | /* The template file for displaying our stats in the Admin dashboard widget */ |
3 | 3 | ?> |
4 | 4 | <section id="yikes-easy-mc-widget-stat-holder"> |
5 | - <h3><?php echo $list_data['lists'][0]['name']; ?> <small><a href="<?php echo esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-view-list&list-id=' . $list_data['lists'][0]['id'] . '' ) ); ?>" title="<?php _e( 'view List' , 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'view list' , 'yikes-inc-easy-mailchimp-extender' ); ?></a></small></h3> |
|
5 | + <h3><?php echo $list_data[ 'lists' ][ 0 ][ 'name' ]; ?> <small><a href="<?php echo esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-view-list&list-id=' . $list_data[ 'lists' ][ 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 | 6 | |
7 | 7 | <table class="yikes-easy-mc-stats-table"> |
8 | 8 | <thead class="yikes-easy-mc-hidden"> |
9 | 9 | <tr> |
10 | - <th><?php _e( 'Subscribers' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
11 | - <th><?php _e( 'Unsubscribed' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
12 | - <th><?php _e( 'New Since Send' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
13 | - <th><?php _e( 'Avg. Sub. Rate' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
10 | + <th><?php _e( 'Subscribers', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
11 | + <th><?php _e( 'Unsubscribed', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
12 | + <th><?php _e( 'New Since Send', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
13 | + <th><?php _e( 'Avg. Sub. Rate', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
14 | 14 | </tr> |
15 | 15 | </thead> |
16 | 16 | <tbody> |
17 | 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['lists'][0]['stats']['member_count']; ?></p> |
|
20 | - <p class="yikes-easy-mc-stat-list-label"><?php _e( 'subscribers' , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
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[ 'lists' ][ 0 ][ 'stats' ][ 'member_count' ]; ?></p> |
|
20 | + <p class="yikes-easy-mc-stat-list-label"><?php _e( 'subscribers', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
21 | 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['lists'][0]['stats']['unsubscribe_count']; ?></p> |
|
24 | - <p class="yikes-easy-mc-stat-list-label"><?php _e( 'unsubscribed' , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
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[ 'lists' ][ 0 ][ 'stats' ][ 'unsubscribe_count' ]; ?></p> |
|
24 | + <p class="yikes-easy-mc-stat-list-label"><?php _e( 'unsubscribed', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
25 | 25 | </td> |
26 | 26 | </tr> |
27 | 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['lists'][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> |
|
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[ 'lists' ][ 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 | 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['lists'][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> |
|
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[ 'lists' ][ 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 | 35 | </td> |
36 | 36 | </tr> |
37 | 37 | </tbody> |
@@ -48,14 +48,14 @@ discard block |
||
48 | 48 | if ( current_user_can( apply_filters( 'yikes-mailchimp-admin-widget-capability', apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ) ) ) ) { |
49 | 49 | /* List Stats Dashboard Widget */ |
50 | 50 | wp_add_dashboard_widget( |
51 | - 'yikes_easy_mc_list_stats_widget', // Widget slug. |
|
52 | - __( 'MailChimp List Stats', 'yikes-inc-easy-mailchimp-extender' ), // Title. |
|
51 | + 'yikes_easy_mc_list_stats_widget', // Widget slug. |
|
52 | + __( 'MailChimp List Stats', 'yikes-inc-easy-mailchimp-extender' ), // Title. |
|
53 | 53 | array( $this, 'list_stats_dashboard_widget' ) // Display function. |
54 | 54 | ); |
55 | 55 | /* Chimp Chatter Dashboard Widget */ |
56 | 56 | wp_add_dashboard_widget( |
57 | - 'yikes_easy_mc_account_activity_widget', // Widget slug. |
|
58 | - __( 'MailChimp Account Activity', 'yikes-inc-easy-mailchimp-extender' ), // Title. |
|
57 | + 'yikes_easy_mc_account_activity_widget', // Widget slug. |
|
58 | + __( 'MailChimp Account Activity', 'yikes-inc-easy-mailchimp-extender' ), // Title. |
|
59 | 59 | array( $this, 'account_activity_dashboard_widget' ) // Display function. |
60 | 60 | ); |
61 | 61 | } |
@@ -67,22 +67,22 @@ discard block |
||
67 | 67 | function list_stats_dashboard_widget() { |
68 | 68 | // Get our list data! |
69 | 69 | $list_data = yikes_get_mc_api_manager()->get_list_handler()->get_lists(); |
70 | - if ( isset( $list_data['error'] ) ) { |
|
70 | + if ( isset( $list_data[ 'error' ] ) ) { |
|
71 | 71 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
72 | - $error_logging->maybe_write_to_log( $list_data['error'], __( "Get Account Lists", 'yikes-inc-easy-mailchimp-extender' ), "Dashboard Activity Widget" ); |
|
72 | + $error_logging->maybe_write_to_log( $list_data[ 'error' ], __( "Get Account Lists", 'yikes-inc-easy-mailchimp-extender' ), "Dashboard Activity Widget" ); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | ?> |
76 | 76 | <!-- Dropdown to Change the list --> |
77 | - <?php if ( ! empty( $list_data['lists'] ) ) { |
|
77 | + <?php if ( ! empty( $list_data[ 'lists' ] ) ) { |
|
78 | 78 | ?> |
79 | 79 | <section class="inside-widget yikes-dashboard-widget-section"> |
80 | 80 | <strong class="select-list-title"><?php _e( 'Select a list', 'yikes-inc-easy-mailchimp-extender' ) ?>:</strong> |
81 | 81 | <select id="yikes-easy-mc-dashboard-change-list" class="widefat"> |
82 | 82 | <?php |
83 | - foreach ( $list_data['lists'] as $list ) { |
|
83 | + foreach ( $list_data[ 'lists' ] as $list ) { |
|
84 | 84 | ?> |
85 | - <option value="<?php echo $list['id']; ?>"><?php echo $list['name']; ?></option> |
|
85 | + <option value="<?php echo $list[ 'id' ]; ?>"><?php echo $list[ 'name' ]; ?></option> |
|
86 | 86 | <?php |
87 | 87 | } |
88 | 88 | ?> |
@@ -79,8 +79,8 @@ discard block |
||
79 | 79 | } |
80 | 80 | |
81 | 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'] ); |
|
82 | + if ( isset( $response[ 'error' ] ) ) { |
|
83 | + return new WP_Error( $response[ 'title' ], $response[ 'detail' ] ); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | if ( empty( $response[ $item_key ] ) ) { |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | |
90 | 90 | // Update the total number of items if it's still zero. |
91 | 91 | if ( 0 === $total ) { |
92 | - $total = intval( $response['total_items'] ); |
|
92 | + $total = intval( $response[ 'total_items' ] ); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | // Store each new list. |
@@ -192,15 +192,15 @@ discard block |
||
192 | 192 | * @return array|WP_Error Array of data when there was no error, or a WP_Error. |
193 | 193 | */ |
194 | 194 | protected function maybe_return_error( $response ) { |
195 | - if ( isset( $response['error'] ) ) { |
|
196 | - $title = isset( $response['title'] ) ? $response['title'] : $response['name']; |
|
197 | - $detail = isset( $response['detail'] ) ? $response['detail'] : $response['error']; |
|
195 | + if ( isset( $response[ 'error' ] ) ) { |
|
196 | + $title = isset( $response[ 'title' ] ) ? $response[ 'title' ] : $response[ 'name' ]; |
|
197 | + $detail = isset( $response[ 'detail' ] ) ? $response[ 'detail' ] : $response[ 'error' ]; |
|
198 | 198 | |
199 | 199 | return new WP_Error( |
200 | 200 | $title, |
201 | 201 | $detail, |
202 | 202 | array( |
203 | - 'status' => (int) $response['status'], |
|
203 | + 'status' => (int) $response[ 'status' ], |
|
204 | 204 | ) |
205 | 205 | ); |
206 | 206 | } |
@@ -228,9 +228,9 @@ discard block |
||
228 | 228 | |
229 | 229 | // MailChimp uses the application/problem+json type for errors |
230 | 230 | $headers = wp_remote_retrieve_headers( $response ); |
231 | - if ( isset( $headers['content-type'] ) ) { |
|
232 | - if ( false !== strpos( $headers['content-type'], 'application/problem+json' ) ) { |
|
233 | - $body['error'] = true; |
|
231 | + if ( isset( $headers[ 'content-type' ] ) ) { |
|
232 | + if ( false !== strpos( $headers[ 'content-type' ], 'application/problem+json' ) ) { |
|
233 | + $body[ 'error' ] = true; |
|
234 | 234 | } |
235 | 235 | } |
236 | 236 |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | * @return array|WP_Error |
104 | 104 | */ |
105 | 105 | public function patch( $path = '', $headers = array(), $params = array() ) { |
106 | - if ( ! isset( $params['body'] ) || empty( $params['body'] ) ) { |
|
106 | + if ( ! isset( $params[ 'body' ] ) || empty( $params[ 'body' ] ) ) { |
|
107 | 107 | return new WP_Error( |
108 | 108 | 'yikesinc_eme_missing_body', |
109 | 109 | sprintf( |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | * @return array|WP_Error |
131 | 131 | */ |
132 | 132 | public function post( $path = '', $headers = array(), $params = array() ) { |
133 | - if ( ! isset( $params['body'] ) || empty( $params['body'] ) ) { |
|
133 | + if ( ! isset( $params[ 'body' ] ) || empty( $params[ 'body' ] ) ) { |
|
134 | 134 | return new WP_Error( |
135 | 135 | 'yikesinc_eme_missing_body', |
136 | 136 | sprintf( |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | * @return array|WP_Error |
158 | 158 | */ |
159 | 159 | public function put( $path = '', $headers = array(), $params = array() ) { |
160 | - if ( ! isset( $params['body'] ) || empty( $params['body'] ) ) { |
|
160 | + if ( ! isset( $params[ 'body' ] ) || empty( $params[ 'body' ] ) ) { |
|
161 | 161 | return new WP_Error( |
162 | 162 | 'yikesinc_eme_missing_body', |
163 | 163 | sprintf( |
@@ -288,13 +288,13 @@ discard block |
||
288 | 288 | $authorized_args = $this->get_authorized_args(); |
289 | 289 | |
290 | 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'; |
|
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 | 294 | } |
295 | 295 | |
296 | 296 | // Combine the given headers and auth headers |
297 | - $headers = wp_parse_args( $authorized_args['headers'], $headers ); |
|
297 | + $headers = wp_parse_args( $authorized_args[ 'headers' ], $headers ); |
|
298 | 298 | /** |
299 | 299 | * Filter the headers used for a request to the MailChimp API. |
300 | 300 | * |
@@ -358,12 +358,12 @@ discard block |
||
358 | 358 | |
359 | 359 | // Version 2.0 uses body authorization |
360 | 360 | if ( version_compare( '3.0', $this->api_version, '>' ) ) { |
361 | - $args['body'] = $this->get_auth_body(); |
|
361 | + $args[ 'body' ] = $this->get_auth_body(); |
|
362 | 362 | } |
363 | 363 | |
364 | 364 | // Version 3.0 uses authorization headers. |
365 | 365 | if ( version_compare( '3.0', $this->api_version, '<=' ) ) { |
366 | - $args['headers'] = $this->get_auth_headers(); |
|
366 | + $args[ 'headers' ] = $this->get_auth_headers(); |
|
367 | 367 | } |
368 | 368 | |
369 | 369 | return $args; |