@@ -30,10 +30,10 @@ discard block |
||
30 | 30 | } |
31 | 31 | |
32 | 32 | /** |
33 | - * Registers the CF7 shortcode |
|
33 | + * Registers the CF7 shortcode |
|
34 | 34 | * |
35 | - * @return boolean |
|
36 | - */ |
|
35 | + * @return boolean |
|
36 | + */ |
|
37 | 37 | public function init() { |
38 | 38 | if( ! function_exists( 'wpcf7_add_shortcode' ) ) { |
39 | 39 | return false; |
@@ -43,21 +43,21 @@ discard block |
||
43 | 43 | } |
44 | 44 | |
45 | 45 | /** |
46 | - * Alter Contact Form 7 data. |
|
47 | - * |
|
48 | - * Adds yikes_mailchimp_checkbox to post data so users can use `yikes_mailchimp_checkbox` in their email templates |
|
49 | - * |
|
50 | - * @param array $data |
|
51 | - * @return array |
|
52 | - */ |
|
46 | + * Alter Contact Form 7 data. |
|
47 | + * |
|
48 | + * Adds yikes_mailchimp_checkbox to post data so users can use `yikes_mailchimp_checkbox` in their email templates |
|
49 | + * |
|
50 | + * @param array $data |
|
51 | + * @return array |
|
52 | + */ |
|
53 | 53 | public function alter_cf7_data( $data = array() ) { |
54 | 54 | $data['yikes_mailchimp_checkbox'] = $this->was_checkbox_checked( $this->type ) ? __( 'Yes', 'yikes-inc-easy-mailchimp-extender' ) : __( 'No', 'yikes-inc-easy-mailchimp-extender' ); |
55 | 55 | return $data; |
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
59 | - * Subscribe from Contact Form 7 Forms |
|
60 | - */ |
|
59 | + * Subscribe from Contact Form 7 Forms |
|
60 | + */ |
|
61 | 61 | public function new_cf7_subscription( $contact_form ) { |
62 | 62 | // was sign-up checkbox checked? |
63 | 63 | if ( $this->was_checkbox_checked( $this->type ) === false ) { |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | */ |
12 | 12 | |
13 | 13 | // Prevent direct access to the file |
14 | -defined('ABSPATH') or die( __( "Whoops, you shouldn't be accessing this file directly. Abort!" , 'yikes-inc-easy-mailchimp-extender' ) ); |
|
14 | +defined( 'ABSPATH' ) or die( __( "Whoops, you shouldn't be accessing this file directly. Abort!", 'yikes-inc-easy-mailchimp-extender' ) ); |
|
15 | 15 | |
16 | 16 | class Yikes_Easy_MC_CF7_Checkbox_Class extends Yikes_Easy_MC_Checkbox_Integration_Class { |
17 | 17 | /** |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | // initialize |
27 | 27 | $this->init(); |
28 | 28 | add_action( 'wpcf7_mail_sent', array( $this, 'new_cf7_subscription' ) ); |
29 | - add_action( 'wpcf7_posted_data', array( $this, 'alter_cf7_data') ); |
|
29 | + add_action( 'wpcf7_posted_data', array( $this, 'alter_cf7_data' ) ); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | /** |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | * @return boolean |
36 | 36 | */ |
37 | 37 | public function init() { |
38 | - if( ! function_exists( 'wpcf7_add_shortcode' ) ) { |
|
38 | + if ( ! function_exists( 'wpcf7_add_shortcode' ) ) { |
|
39 | 39 | return false; |
40 | 40 | } |
41 | 41 | wpcf7_add_shortcode( 'yikes_mailchimp_checkbox', array( $this, 'yikes_get_checkbox' ) ); |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | * @return array |
52 | 52 | */ |
53 | 53 | public function alter_cf7_data( $data = array() ) { |
54 | - $data['yikes_mailchimp_checkbox'] = $this->was_checkbox_checked( $this->type ) ? __( 'Yes', 'yikes-inc-easy-mailchimp-extender' ) : __( 'No', 'yikes-inc-easy-mailchimp-extender' ); |
|
54 | + $data[ 'yikes_mailchimp_checkbox' ] = $this->was_checkbox_checked( $this->type ) ? __( 'Yes', 'yikes-inc-easy-mailchimp-extender' ) : __( 'No', 'yikes-inc-easy-mailchimp-extender' ); |
|
55 | 55 | return $data; |
56 | 56 | } |
57 | 57 | |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | return false; |
65 | 65 | } |
66 | 66 | // get the integration options |
67 | - $integration_options = get_option( 'optin-checkbox-init' , '' ); |
|
67 | + $integration_options = get_option( 'optin-checkbox-init', '' ); |
|
68 | 68 | // get the contact form 7 submission instance |
69 | 69 | $submission = WPCF7_Submission::get_instance(); |
70 | 70 | // confirm the submission was received |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | // get the submission data |
73 | 73 | $posted_data = $submission->get_posted_data(); |
74 | 74 | // store the email -- this needs to be more dynamic (find string with containing string email?) |
75 | - $email = ( isset( $posted_data['your-email'] ) ) ? $posted_data['your-email'] : ''; |
|
75 | + $email = ( isset( $posted_data[ 'your-email' ] ) ) ? $posted_data[ 'your-email' ] : ''; |
|
76 | 76 | // submit this subscriber |
77 | 77 | return $this->subscribe_user_integration( $email, $this->type, apply_filters( 'yikes-mailchimp-contact-form-7', array(), $posted_data ) ); |
78 | 78 | } |
@@ -73,10 +73,10 @@ discard block |
||
73 | 73 | } |
74 | 74 | |
75 | 75 | /** |
76 | - * Create our own custom the_content(); filter to prevent plugins and such from hooking in where not wanted |
|
77 | - * |
|
78 | - * @since 6.0.3 |
|
79 | - */ |
|
76 | + * Create our own custom the_content(); filter to prevent plugins and such from hooking in where not wanted |
|
77 | + * |
|
78 | + * @since 6.0.3 |
|
79 | + */ |
|
80 | 80 | public function yikes_custom_frontend_content_filter() { |
81 | 81 | add_filter( 'yikes-mailchimp-frontend-content', 'wptexturize' ); |
82 | 82 | add_filter( 'yikes-mailchimp-frontend-content', 'convert_smilies' ); |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | * load our checkbox classes |
94 | 94 | * |
95 | 95 | * @since 6.0.0 |
96 | - **/ |
|
96 | + **/ |
|
97 | 97 | public function load_checkbox_integration_classes() { |
98 | 98 | // store our options |
99 | 99 | $integrations = get_option( 'optin-checkbox-init' , '' ); |
@@ -138,7 +138,8 @@ |
||
138 | 138 | if( $form_id ) { |
139 | 139 | $form_settings = self::yikes_retrieve_form_settings( $form_id ); |
140 | 140 | if( isset( $_POST ) && !empty( $_POST ) && isset( $form_id ) && $form_settings['submission_settings']['ajax'] == 0 ) { |
141 | - if( $_POST['yikes-mailchimp-submitted-form'] == $form_id ) { // ensure we only process the form that was submitted |
|
141 | + if( $_POST['yikes-mailchimp-submitted-form'] == $form_id ) { |
|
142 | +// ensure we only process the form that was submitted |
|
142 | 143 | // lets include our form processing file |
143 | 144 | include_once( YIKES_MC_PATH . 'public/partials/shortcodes/process/process_form_submission.php' ); |
144 | 145 | if( $form_settings['submission_settings']['redirect_on_submission'] == '1' ) { |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | * @since 6.0.0 |
47 | 47 | */ |
48 | 48 | if ( ! defined( 'YIKES_MC_VERSION' ) ) { |
49 | - define( 'YIKES_MC_VERSION' , $version ); |
|
49 | + define( 'YIKES_MC_VERSION', $version ); |
|
50 | 50 | } |
51 | 51 | /* |
52 | 52 | * Include our helper functions |
@@ -63,9 +63,9 @@ discard block |
||
63 | 63 | // include our ajax processing class |
64 | 64 | require_once( YIKES_MC_PATH . 'public/partials/ajax/class.public_ajax.php' ); |
65 | 65 | // Include our error logging class |
66 | - add_action( 'init' , array( $this , 'load_error_logging_class' ) , 1 ); |
|
66 | + add_action( 'init', array( $this, 'load_error_logging_class' ), 1 ); |
|
67 | 67 | // load our checkbox classes |
68 | - add_action( 'init' , array( $this , 'load_checkbox_integration_classes' ) , 1 ); |
|
68 | + add_action( 'init', array( $this, 'load_checkbox_integration_classes' ), 1 ); |
|
69 | 69 | // custom front end filter |
70 | 70 | add_action( 'init', array( $this, 'yikes_custom_frontend_content_filter' ) ); |
71 | 71 | // Process non-ajax forms in the header |
@@ -100,15 +100,15 @@ discard block |
||
100 | 100 | **/ |
101 | 101 | public function load_checkbox_integration_classes() { |
102 | 102 | // store our options |
103 | - $integrations = get_option( 'optin-checkbox-init' , '' ); |
|
104 | - if( !empty( $integrations ) ) { |
|
103 | + $integrations = get_option( 'optin-checkbox-init', '' ); |
|
104 | + if ( ! empty( $integrations ) ) { |
|
105 | 105 | // load our mail integrations class |
106 | 106 | require_once YIKES_MC_PATH . 'public/classes/checkbox-integrations.php'; |
107 | 107 | // loop over selected classes and load them up! |
108 | - foreach( $integrations as $integration => $value ) { |
|
109 | - if( isset( $value['value'] ) && $value['value'] == 'on' ) { |
|
108 | + foreach ( $integrations as $integration => $value ) { |
|
109 | + if ( isset( $value[ 'value' ] ) && $value[ 'value' ] == 'on' ) { |
|
110 | 110 | // load our class extensions |
111 | - require_once YIKES_MC_PATH . 'public/classes/checkbox-integrations/class.'.$integration.'-checkbox.php'; |
|
111 | + require_once YIKES_MC_PATH . 'public/classes/checkbox-integrations/class.' . $integration . '-checkbox.php'; |
|
112 | 112 | } |
113 | 113 | } |
114 | 114 | } |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | * @since 6.0.0 |
123 | 123 | */ |
124 | 124 | public function load_error_logging_class() { |
125 | - if( get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) { |
|
125 | + if ( get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) { |
|
126 | 126 | // if error logging is enabled we should include our error logging class |
127 | 127 | require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php'; |
128 | 128 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging; |
@@ -135,18 +135,18 @@ discard block |
||
135 | 135 | * @since 6.0.3.4 |
136 | 136 | */ |
137 | 137 | public function yikes_process_non_ajax_forms( $form_submitted ) { |
138 | - global $wpdb,$post; |
|
139 | - $form_id = ( ! empty( $_POST['yikes-mailchimp-submitted-form'] ) ) ? (int) $_POST['yikes-mailchimp-submitted-form'] : false; // store form id |
|
140 | - if( $form_id ) { |
|
138 | + global $wpdb, $post; |
|
139 | + $form_id = ( ! empty( $_POST[ 'yikes-mailchimp-submitted-form' ] ) ) ? (int) $_POST[ 'yikes-mailchimp-submitted-form' ] : false; // store form id |
|
140 | + if ( $form_id ) { |
|
141 | 141 | $form_settings = self::yikes_retrieve_form_settings( $form_id ); |
142 | - if( isset( $_POST ) && !empty( $_POST ) && isset( $form_id ) && $form_settings['submission_settings']['ajax'] == 0 ) { |
|
143 | - if( $_POST['yikes-mailchimp-submitted-form'] == $form_id ) { // ensure we only process the form that was submitted |
|
142 | + if ( isset( $_POST ) && ! empty( $_POST ) && isset( $form_id ) && $form_settings[ 'submission_settings' ][ 'ajax' ] == 0 ) { |
|
143 | + if ( $_POST[ 'yikes-mailchimp-submitted-form' ] == $form_id ) { // ensure we only process the form that was submitted |
|
144 | 144 | // lets include our form processing file |
145 | 145 | include_once( YIKES_MC_PATH . 'public/partials/shortcodes/process/process_form_submission.php' ); |
146 | - if( $form_settings['submission_settings']['redirect_on_submission'] == '1' ) { |
|
147 | - if( $form_submitted == 1 ) { |
|
146 | + if ( $form_settings[ 'submission_settings' ][ 'redirect_on_submission' ] == '1' ) { |
|
147 | + if ( $form_submitted == 1 ) { |
|
148 | 148 | // decode our settings |
149 | - $redirect_page = ( 'custom_url' != $form_settings['submission_settings']['redirect_page'] ) ? get_permalink( (int) $form_settings['submission_settings']['redirect_page'] ) : $form_settings['submission_settings']['custom_redirect_url']; |
|
149 | + $redirect_page = ( 'custom_url' != $form_settings[ 'submission_settings' ][ 'redirect_page' ] ) ? get_permalink( (int) $form_settings[ 'submission_settings' ][ 'redirect_page' ] ) : $form_settings[ 'submission_settings' ][ 'custom_redirect_url' ]; |
|
150 | 150 | wp_redirect( apply_filters( 'yikes-mailchimp-redirect-url', esc_url( $redirect_page ), $form_id, $post ) ); |
151 | 151 | exit; |
152 | 152 | } |
@@ -162,27 +162,27 @@ discard block |
||
162 | 162 | */ |
163 | 163 | public static function yikes_retrieve_form_settings( $form_id ) { |
164 | 164 | // if no form id, abort |
165 | - if( ! $form_id ) { |
|
165 | + if ( ! $form_id ) { |
|
166 | 166 | return; |
167 | 167 | } |
168 | 168 | global $wpdb; |
169 | 169 | $form_results = $wpdb->get_results( 'SELECT * FROM ' . $wpdb->prefix . 'yikes_easy_mc_forms WHERE id = ' . $form_id . '', ARRAY_A ); // query for our form data |
170 | - if( $form_results ) { |
|
170 | + if ( $form_results ) { |
|
171 | 171 | // empty array, to populate with form settings |
172 | 172 | $form_settings = array(); |
173 | - $form_data = $form_results[0]; // store the results |
|
173 | + $form_data = $form_results[ 0 ]; // store the results |
|
174 | 174 | // store the settings in our array |
175 | - $form_settings['list_id'] = sanitize_key( $form_data['list_id'] ); // associated list id (users who fill out the form will be subscribed to this list) |
|
176 | - $form_settings['form_name'] = esc_attr( $form_data['form_name'] ); // form name |
|
177 | - $form_settings['form_description'] = esc_attr( stripslashes( $form_data['form_description'] ) ); |
|
178 | - $form_settings['fields'] = json_decode( $form_data['fields'] , true ); |
|
179 | - $form_settings['styles'] = json_decode( stripslashes( $form_data['custom_styles'] ) , true ); |
|
180 | - $form_settings['send_welcome'] = $form_data['send_welcome_email']; |
|
181 | - $form_settings['submission_settings'] = json_decode( stripslashes( $form_data['submission_settings'] ) , true ); |
|
182 | - $form_settings['optin_settings'] = json_decode( stripslashes( $form_data['optin_settings'] ) , true ); |
|
183 | - $form_settings['error_messages'] = json_decode( $form_data['error_messages'] , true ); |
|
184 | - $form_settings['notifications'] = isset( $form_data['custom_notifications'] ) ? json_decode( stripslashes( $form_data['custom_notifications'] ) , true ) : ''; |
|
185 | - $form_settings['submissions'] = $form_data['submissions']; |
|
175 | + $form_settings[ 'list_id' ] = sanitize_key( $form_data[ 'list_id' ] ); // associated list id (users who fill out the form will be subscribed to this list) |
|
176 | + $form_settings[ 'form_name' ] = esc_attr( $form_data[ 'form_name' ] ); // form name |
|
177 | + $form_settings[ 'form_description' ] = esc_attr( stripslashes( $form_data[ 'form_description' ] ) ); |
|
178 | + $form_settings[ 'fields' ] = json_decode( $form_data[ 'fields' ], true ); |
|
179 | + $form_settings[ 'styles' ] = json_decode( stripslashes( $form_data[ 'custom_styles' ] ), true ); |
|
180 | + $form_settings[ 'send_welcome' ] = $form_data[ 'send_welcome_email' ]; |
|
181 | + $form_settings[ 'submission_settings' ] = json_decode( stripslashes( $form_data[ 'submission_settings' ] ), true ); |
|
182 | + $form_settings[ 'optin_settings' ] = json_decode( stripslashes( $form_data[ 'optin_settings' ] ), true ); |
|
183 | + $form_settings[ 'error_messages' ] = json_decode( $form_data[ 'error_messages' ], true ); |
|
184 | + $form_settings[ 'notifications' ] = isset( $form_data[ 'custom_notifications' ] ) ? json_decode( stripslashes( $form_data[ 'custom_notifications' ] ), true ) : ''; |
|
185 | + $form_settings[ 'submissions' ] = $form_data[ 'submissions' ]; |
|
186 | 186 | // return the given form settings in an array |
187 | 187 | return $form_settings; |
188 | 188 | } |
@@ -209,13 +209,13 @@ discard block |
||
209 | 209 | return; |
210 | 210 | } |
211 | 211 | // trim trailing period |
212 | - if ( isset( $form_settings['error_messages']['update-link'] ) && ! empty( $form_settings['error_messages']['update-link'] ) ) { |
|
213 | - $response_text = $form_settings['error_messages']['update-link']; |
|
212 | + if ( isset( $form_settings[ 'error_messages' ][ 'update-link' ] ) && ! empty( $form_settings[ 'error_messages' ][ 'update-link' ] ) ) { |
|
213 | + $response_text = $form_settings[ 'error_messages' ][ 'update-link' ]; |
|
214 | 214 | // extract the link text |
215 | 215 | preg_match( '/\[link].*?\[\/link\]/', $response_text, $link_text ); |
216 | 216 | if ( $link_text && ! empty( $link_text ) ) { |
217 | 217 | // Extract the custom link text ([link]*[/link]) |
218 | - $custom_link_text = str_replace( '[/link]', '', str_replace( '[link]', '', str_replace( 'click to send yourself an update link', $link_text[0], $link ) ) ); |
|
218 | + $custom_link_text = str_replace( '[/link]', '', str_replace( '[link]', '', str_replace( 'click to send yourself an update link', $link_text[ 0 ], $link ) ) ); |
|
219 | 219 | // Replace the link text, with our custom link text |
220 | 220 | $response_text = str_replace( $link_text, $custom_link_text, $response_text ); |
221 | 221 | } |
@@ -242,8 +242,8 @@ discard block |
||
242 | 242 | return; |
243 | 243 | } |
244 | 244 | // trim trailing period |
245 | - if ( isset( $form_settings['error_messages']['already-subscribed'] ) && ! empty( $form_settings['error_messages']['already-subscribed'] ) ) { |
|
246 | - $response_text = str_replace( '[email]', $email, $form_settings['error_messages']['already-subscribed'] ); |
|
245 | + if ( isset( $form_settings[ 'error_messages' ][ 'already-subscribed' ] ) && ! empty( $form_settings[ 'error_messages' ][ 'already-subscribed' ] ) ) { |
|
246 | + $response_text = str_replace( '[email]', $email, $form_settings[ 'error_messages' ][ 'already-subscribed' ] ); |
|
247 | 247 | } |
248 | 248 | // Return our new string |
249 | 249 | return $response_text; |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | * |
12 | 12 | * @since 6.0.0 |
13 | 13 | */ |
14 | -function yksemeProcessSnippet( $list=false, $submit_text ) { |
|
14 | +function yksemeProcessSnippet( $list = false, $submit_text ) { |
|
15 | 15 | $submit_text = ( isset( $submit_text ) ) ? 'submit="' . $submit_text . '"' : ''; |
16 | 16 | return do_shortcode( '[yikes-mailchimp form="' . $list . '" ' . $submit_text . ']' ); |
17 | 17 | } |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | * @since 6.0.3.4 |
22 | 22 | */ |
23 | 23 | function yikes_get_form_data( $form_id ) { |
24 | - if( ! $form_id ) { |
|
24 | + if ( ! $form_id ) { |
|
25 | 25 | return __( 'Whoops, you forgot to specify a form ID.', 'yikes-inc-easy-mailchimp-extender' ); |
26 | 26 | } |
27 | 27 | return Yikes_Inc_Easy_Mailchimp_Extender_Public::yikes_retrieve_form_settings( $form_id ); |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
9 | 9 | // users can only unisntall a plugin from the network dashboard page |
10 | 10 | // Get all blog ids |
11 | - $blogids = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs"); |
|
11 | + $blogids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" ); |
|
12 | 12 | foreach ( $blogids as $blog_id ) { |
13 | 13 | switch_to_blog( $blog_id ); |
14 | 14 | self::_uninstall_yikes_easy_mailchimp( $wpdb ); |
@@ -28,13 +28,13 @@ discard block |
||
28 | 28 | * @since 6.0.0 |
29 | 29 | */ |
30 | 30 | static function _uninstall_yikes_easy_mailchimp( $wpdb ) { |
31 | - require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); |
|
31 | + require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); |
|
32 | 32 | /* Clean up and delete our custom table from the databse */ |
33 | - $table = $wpdb->prefix."yikes_easy_mc_forms"; |
|
33 | + $table = $wpdb->prefix . "yikes_easy_mc_forms"; |
|
34 | 34 | $sql = 'DROP TABLE IF EXISTS ' . $table; |
35 | 35 | //Delete any options thats stored also? |
36 | 36 | $wpdb->query( $sql ); |
37 | - dbDelta($sql); |
|
37 | + dbDelta( $sql ); |
|
38 | 38 | /* Clear All Transient Data */ |
39 | 39 | // Delete list data transient data |
40 | 40 | delete_transient( 'yikes-easy-mailchimp-list-data' ); |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | * @return type The collection of actions and filters registered with WordPress. |
87 | 87 | */ |
88 | 88 | private function add( $hooks, $hook, $component, $callback, $priority, $accepted_args ) { |
89 | - $hooks[] = array( |
|
89 | + $hooks[ ] = array( |
|
90 | 90 | 'hook' => $hook, |
91 | 91 | 'component' => $component, |
92 | 92 | 'callback' => $callback, |
@@ -102,10 +102,10 @@ discard block |
||
102 | 102 | */ |
103 | 103 | public function run() { |
104 | 104 | foreach ( $this->filters as $hook ) { |
105 | - add_filter( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] ); |
|
105 | + add_filter( $hook[ 'hook' ], array( $hook[ 'component' ], $hook[ 'callback' ] ), $hook[ 'priority' ], $hook[ 'accepted_args' ] ); |
|
106 | 106 | } |
107 | 107 | foreach ( $this->actions as $hook ) { |
108 | - add_action( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] ); |
|
108 | + add_action( $hook[ 'hook' ], array( $hook[ 'component' ], $hook[ 'callback' ] ), $hook[ 'priority' ], $hook[ 'accepted_args' ] ); |
|
109 | 109 | } |
110 | 110 | } |
111 | 111 | } |
112 | 112 | \ No newline at end of file |
@@ -10,54 +10,54 @@ discard block |
||
10 | 10 | */ |
11 | 11 | public static function yikes_mailchimp_import_forms( $csv_file ) { |
12 | 12 | |
13 | - if( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-import-forms' ) { |
|
14 | - $name = $csv_file['csv']['name']; |
|
15 | - $ext_array = explode('.', $name); |
|
13 | + if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-import-forms' ) { |
|
14 | + $name = $csv_file[ 'csv' ][ 'name' ]; |
|
15 | + $ext_array = explode( '.', $name ); |
|
16 | 16 | $ext = end( $ext_array ); |
17 | - $tmpName = $csv_file['csv']['tmp_name']; |
|
18 | - if($ext === 'csv') { |
|
19 | - if(($handle = fopen($tmpName, 'r')) !== FALSE) { |
|
20 | - $num = count($handle); |
|
21 | - $file = fopen( $tmpName, 'r'); |
|
17 | + $tmpName = $csv_file[ 'csv' ][ 'tmp_name' ]; |
|
18 | + if ( $ext === 'csv' ) { |
|
19 | + if ( ( $handle = fopen( $tmpName, 'r' ) ) !== FALSE ) { |
|
20 | + $num = count( $handle ); |
|
21 | + $file = fopen( $tmpName, 'r' ); |
|
22 | 22 | $row = 1; |
23 | - while (($line = fgetcsv($file, 10000, ',')) !== FALSE) { |
|
24 | - if( count( $line ) > 1 ) { |
|
23 | + while ( ( $line = fgetcsv( $file, 10000, ',' ) ) !== FALSE ) { |
|
24 | + if ( count( $line ) > 1 ) { |
|
25 | 25 | // Check if this is a settings import by confirming the first option is 'yikes-mc-api-key' |
26 | - if( $line[0] == 'yikes-mc-api-key' ) { |
|
27 | - $options = fgetcsv($file, 10000, ','); |
|
26 | + if ( $line[ 0 ] == 'yikes-mc-api-key' ) { |
|
27 | + $options = fgetcsv( $file, 10000, ',' ); |
|
28 | 28 | $new_settings = array(); |
29 | 29 | $x = 0; |
30 | 30 | // build our new array $key => $value pair |
31 | - foreach( $line as $option_name ) { |
|
32 | - $new_settings[$option_name] = $options[$x]; |
|
31 | + foreach ( $line as $option_name ) { |
|
32 | + $new_settings[ $option_name ] = $options[ $x ]; |
|
33 | 33 | $x++; |
34 | 34 | } |
35 | 35 | // update the options in the databse |
36 | - foreach( $new_settings as $option_name => $option_value ) { |
|
36 | + foreach ( $new_settings as $option_name => $option_value ) { |
|
37 | 37 | update_option( $option_name, $option_value ); |
38 | 38 | } |
39 | 39 | } else { // if it's not, then it's an opt-in forms import |
40 | 40 | global $wpdb; |
41 | - if( $row != 1 ) { |
|
41 | + if ( $row != 1 ) { |
|
42 | 42 | $wpdb->insert( |
43 | 43 | $wpdb->prefix . 'yikes_easy_mc_forms', |
44 | 44 | array( |
45 | - 'list_id' => $line[1], |
|
46 | - 'form_name' => stripslashes( $line[2] ), |
|
47 | - 'form_description' => stripslashes( $line[3] ), |
|
48 | - 'fields' => $line[4], |
|
49 | - 'custom_styles' => $line[5], |
|
50 | - 'custom_template' => $line[6], |
|
51 | - 'send_welcome_email' => $line[7], |
|
52 | - 'redirect_user_on_submit' => $line[8], |
|
53 | - 'redirect_page' => $line[9], |
|
54 | - 'submission_settings' => $line[10], |
|
55 | - 'optin_settings' => $line[11], |
|
56 | - 'error_messages' => $line[12], |
|
57 | - 'custom_notifications' => $line[13], |
|
58 | - 'impressions' => $line[14], |
|
59 | - 'submissions' => $line[15], |
|
60 | - 'custom_fields' => $line[16], |
|
45 | + 'list_id' => $line[ 1 ], |
|
46 | + 'form_name' => stripslashes( $line[ 2 ] ), |
|
47 | + 'form_description' => stripslashes( $line[ 3 ] ), |
|
48 | + 'fields' => $line[ 4 ], |
|
49 | + 'custom_styles' => $line[ 5 ], |
|
50 | + 'custom_template' => $line[ 6 ], |
|
51 | + 'send_welcome_email' => $line[ 7 ], |
|
52 | + 'redirect_user_on_submit' => $line[ 8 ], |
|
53 | + 'redirect_page' => $line[ 9 ], |
|
54 | + 'submission_settings' => $line[ 10 ], |
|
55 | + 'optin_settings' => $line[ 11 ], |
|
56 | + 'error_messages' => $line[ 12 ], |
|
57 | + 'custom_notifications' => $line[ 13 ], |
|
58 | + 'impressions' => $line[ 14 ], |
|
59 | + 'submissions' => $line[ 15 ], |
|
60 | + 'custom_fields' => $line[ 16 ], |
|
61 | 61 | ), |
62 | 62 | array( |
63 | 63 | '%s', // list id |
@@ -65,16 +65,16 @@ discard block |
||
65 | 65 | '%s', // form description |
66 | 66 | '%s', // fields |
67 | 67 | '%s', // custom styles |
68 | - '%d', // custom template |
|
69 | - '%d', // send welcome email |
|
70 | - '%s', // redirect user |
|
71 | - '%s', // redirect page |
|
72 | - '%s', // submission |
|
73 | - '%s', // opt-in |
|
68 | + '%d', // custom template |
|
69 | + '%d', // send welcome email |
|
70 | + '%s', // redirect user |
|
71 | + '%s', // redirect page |
|
72 | + '%s', // submission |
|
73 | + '%s', // opt-in |
|
74 | 74 | '%s', // error |
75 | 75 | '%s', // custom notifications |
76 | - '%d', // impressions # |
|
77 | - '%d', // submissions # |
|
76 | + '%d', // impressions # |
|
77 | + '%d', // submissions # |
|
78 | 78 | '%s', // custom fields |
79 | 79 | ) |
80 | 80 | ); |
@@ -83,9 +83,9 @@ discard block |
||
83 | 83 | } |
84 | 84 | $row++; |
85 | 85 | } |
86 | - fclose($file); |
|
86 | + fclose( $file ); |
|
87 | 87 | } else { |
88 | - wp_die( __( 'There was an error during import. If you continue to run into issues, please reach out to the Yikes Inc. support team.' , 'yikes-inc-easy-mailchimp-extender' ) ); |
|
88 | + wp_die( __( 'There was an error during import. If you continue to run into issues, please reach out to the Yikes Inc. support team.', 'yikes-inc-easy-mailchimp-extender' ) ); |
|
89 | 89 | } |
90 | 90 | } |
91 | 91 | |
@@ -101,20 +101,20 @@ discard block |
||
101 | 101 | */ |
102 | 102 | public static function yikes_mailchimp_import_type( $csv_file ) { |
103 | 103 | // confirm |
104 | - if( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-import-forms' ) { |
|
105 | - $name = $csv_file['csv']['name']; |
|
106 | - $ext_array = explode('.', $name); |
|
104 | + if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-import-forms' ) { |
|
105 | + $name = $csv_file[ 'csv' ][ 'name' ]; |
|
106 | + $ext_array = explode( '.', $name ); |
|
107 | 107 | $ext = end( $ext_array ); |
108 | - $tmpName = $csv_file['csv']['tmp_name']; |
|
109 | - if($ext === 'csv') { |
|
110 | - if(($handle = fopen($tmpName, 'r')) !== FALSE) { |
|
111 | - $num = count($handle); |
|
112 | - $file = fopen( $tmpName, 'r'); |
|
108 | + $tmpName = $csv_file[ 'csv' ][ 'tmp_name' ]; |
|
109 | + if ( $ext === 'csv' ) { |
|
110 | + if ( ( $handle = fopen( $tmpName, 'r' ) ) !== FALSE ) { |
|
111 | + $num = count( $handle ); |
|
112 | + $file = fopen( $tmpName, 'r' ); |
|
113 | 113 | $row = 1; |
114 | - $first_line_data = fgetcsv($file, 10000, ','); |
|
115 | - if( count( $first_line_data ) > 1 ) { |
|
114 | + $first_line_data = fgetcsv( $file, 10000, ',' ); |
|
115 | + if ( count( $first_line_data ) > 1 ) { |
|
116 | 116 | // Check if this is a settings import by confirming the first option is 'yikes-mc-api-key' |
117 | - if( $first_line_data[0] == 'yikes-mc-api-key' ) { |
|
117 | + if ( $first_line_data[ 0 ] == 'yikes-mc-api-key' ) { |
|
118 | 118 | $import_type = 'import-settings'; |
119 | 119 | } else { |
120 | 120 | $import_type = 'import-forms'; |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | while (($line = fgetcsv($file, 10000, ',')) !== FALSE) { |
24 | 24 | if( count( $line ) > 1 ) { |
25 | 25 | // Check if this is a settings import by confirming the first option is 'yikes-mc-api-key' |
26 | - if( $line[0] == 'yikes-mc-api-key' ) { |
|
26 | + if( $line[0] == 'yikes-mc-api-key' ) { |
|
27 | 27 | $options = fgetcsv($file, 10000, ','); |
28 | 28 | $new_settings = array(); |
29 | 29 | $x = 0; |
@@ -36,7 +36,8 @@ discard block |
||
36 | 36 | foreach( $new_settings as $option_name => $option_value ) { |
37 | 37 | update_option( $option_name, $option_value ); |
38 | 38 | } |
39 | - } else { // if it's not, then it's an opt-in forms import |
|
39 | + } else { |
|
40 | +// if it's not, then it's an opt-in forms import |
|
40 | 41 | global $wpdb; |
41 | 42 | if( $row != 1 ) { |
42 | 43 | $wpdb->insert( |
@@ -51,19 +51,19 @@ discard block |
||
51 | 51 | * @returned_error |
52 | 52 | * @error_type - what was running when the error occured ie (new user subscription, remove user etc) |
53 | 53 | */ |
54 | - public function yikes_easy_mailchimp_write_to_error_log( $returned_error , $error_type , $page='' ) { |
|
54 | + public function yikes_easy_mailchimp_write_to_error_log( $returned_error, $error_type, $page = '' ) { |
|
55 | 55 | |
56 | 56 | // confirm error logging is toggled on, else lets exit |
57 | - if( get_option( 'yikes-mailchimp-debug-status' , '' ) != '1' ) { |
|
57 | + if ( get_option( 'yikes-mailchimp-debug-status', '' ) != '1' ) { |
|
58 | 58 | return; |
59 | 59 | } |
60 | 60 | |
61 | - $contents = file_get_contents( YIKES_MC_PATH . 'includes/error_log/yikes-easy-mailchimp-error-log.php' , true ); |
|
61 | + $contents = file_get_contents( YIKES_MC_PATH . 'includes/error_log/yikes-easy-mailchimp-error-log.php', true ); |
|
62 | 62 | |
63 | 63 | // if we pass in a custom page, don't set things up |
64 | - if( empty( $page ) ) { |
|
64 | + if ( empty( $page ) ) { |
|
65 | 65 | // get the current page, admin or front end? |
66 | - if( is_admin() ) { |
|
66 | + if ( is_admin() ) { |
|
67 | 67 | $page = __( 'Admin', 'yikes-inc-easy-mailchimp-extender' ); |
68 | 68 | } else { |
69 | 69 | $page = __( 'Front End', 'yikes-inc-easy-mailchimp-extender' ); |
@@ -79,14 +79,14 @@ discard block |
||
79 | 79 | </label> |
80 | 80 | </td> |
81 | 81 | <td> |
82 | - <?php _e( 'Page:' , 'yikes-inc-easy-mailchimp-extender' ); echo ' ' . $page; ?> || <?php _e( 'Type:' , 'yikes-inc-easy-mailchimp-extender' ); echo ' ' . $error_type; ?> || <?php _e( 'Time:' , 'yikes-inc-easy-mailchimp-extender' ); echo ' ' . date( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ) , current_time('timestamp') ); ?> |
|
82 | + <?php _e( 'Page:', 'yikes-inc-easy-mailchimp-extender' ); echo ' ' . $page; ?> || <?php _e( 'Type:', 'yikes-inc-easy-mailchimp-extender' ); echo ' ' . $error_type; ?> || <?php _e( 'Time:', 'yikes-inc-easy-mailchimp-extender' ); echo ' ' . date( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), current_time( 'timestamp' ) ); ?> |
|
83 | 83 | </td> |
84 | 84 | </tr> |
85 | 85 | <?php |
86 | 86 | $new_contents = ob_get_clean() . $contents; |
87 | 87 | |
88 | 88 | // file put contents $returned error + other data |
89 | - if( file_exists( YIKES_MC_PATH . 'includes/error_log/yikes-easy-mailchimp-error-log.php' ) ) { |
|
89 | + if ( file_exists( YIKES_MC_PATH . 'includes/error_log/yikes-easy-mailchimp-error-log.php' ) ) { |
|
90 | 90 | file_put_contents( |
91 | 91 | YIKES_MC_PATH . 'includes/error_log/yikes-easy-mailchimp-error-log.php', |
92 | 92 | $new_contents |
@@ -102,12 +102,12 @@ discard block |
||
102 | 102 | */ |
103 | 103 | public function yikes_easy_mailchimp_generate_error_log_table() { |
104 | 104 | // ensure file_get_contents exists |
105 | - if( function_exists( 'file_get_contents' ) ) { |
|
105 | + if ( function_exists( 'file_get_contents' ) ) { |
|
106 | 106 | // confirm that our file exists |
107 | - if( file_exists( YIKES_MC_PATH . 'includes/error_log/yikes-easy-mailchimp-error-log.php' ) ) { |
|
108 | - $error_log_contents = file_get_contents( YIKES_MC_PATH . 'includes/error_log/yikes-easy-mailchimp-error-log.php' , true ); |
|
109 | - if( $error_log_contents === FALSE ) { |
|
110 | - return _e( 'File get contents not available' , 'yikes-inc-easy-mailchimp-extender' ); |
|
107 | + if ( file_exists( YIKES_MC_PATH . 'includes/error_log/yikes-easy-mailchimp-error-log.php' ) ) { |
|
108 | + $error_log_contents = file_get_contents( YIKES_MC_PATH . 'includes/error_log/yikes-easy-mailchimp-error-log.php', true ); |
|
109 | + if ( $error_log_contents === FALSE ) { |
|
110 | + return _e( 'File get contents not available', 'yikes-inc-easy-mailchimp-extender' ); |
|
111 | 111 | } |
112 | 112 | if ( $error_log_contents != '' ) { |
113 | 113 | // return $error_log_contents; |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | <tr class="error-log-tr"> |
119 | 119 | <td class="row-title colspanchange" colspan="2"> |
120 | 120 | <strong><span class='dashicons dashicons-no-alt'></span> <?php _e( 'No errors logged.', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
121 | - <?php if( get_option( 'yikes-mailchimp-debug-status' , '' ) == '' ) { ?> |
|
121 | + <?php if ( get_option( 'yikes-mailchimp-debug-status', '' ) == '' ) { ?> |
|
122 | 122 | <br /> |
123 | 123 | <p class="to-start-logging-errors-notice"><em><?php _e( "To start logging errors toggle on the 'Enable Debugging' option above.", 'yikes-inc-easy-mailchimp-extender' ); ?></em></p> |
124 | 124 | <?php } ?> |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | ); |
147 | 147 | ?> |
148 | 148 | <form id="create-error-log" method="POST" action="<?php echo $url; ?>"> |
149 | - <?php submit_button( __( 'Attempt to Create Error Log' , 'yikes-inc-easy-mailchimp-extender' ) , 'secondary' , '' , '' , array() ); ?> |
|
149 | + <?php submit_button( __( 'Attempt to Create Error Log', 'yikes-inc-easy-mailchimp-extender' ), 'secondary', '', '', array() ); ?> |
|
150 | 150 | </form> |
151 | 151 | |
152 | 152 | </p> |
@@ -100,9 +100,9 @@ discard block |
||
100 | 100 | * |
101 | 101 | * @since 5.6 |
102 | 102 | */ |
103 | - public function yikes_easy_mailchimp_generate_error_log_table() { |
|
103 | + public function yikes_easy_mailchimp_generate_error_log_table() { |
|
104 | 104 | // ensure file_get_contents exists |
105 | - if( function_exists( 'file_get_contents' ) ) { |
|
105 | + if( function_exists( 'file_get_contents' ) ) { |
|
106 | 106 | // confirm that our file exists |
107 | 107 | if( file_exists( YIKES_MC_PATH . 'includes/error_log/yikes-easy-mailchimp-error-log.php' ) ) { |
108 | 108 | $error_log_contents = file_get_contents( YIKES_MC_PATH . 'includes/error_log/yikes-easy-mailchimp-error-log.php' , true ); |
@@ -154,7 +154,8 @@ discard block |
||
154 | 154 | </tr> |
155 | 155 | <?php |
156 | 156 | } |
157 | - } else { // if file_get_contents is disabled server side |
|
157 | + } else { |
|
158 | +// if file_get_contents is disabled server side |
|
158 | 159 | ?> |
159 | 160 | <!-- table body --> |
160 | 161 | <tr> |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | if ( $network_wide ) { |
36 | 36 | $old_blog = $wpdb->blogid; |
37 | 37 | // Get all blog ids |
38 | - $blogids = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs"); |
|
38 | + $blogids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" ); |
|
39 | 39 | foreach ( $blogids as $blog_id ) { |
40 | 40 | switch_to_blog( $blog_id ); |
41 | 41 | self::_activate_yikes_easy_mailchimp( $wpdb ); |
@@ -91,13 +91,13 @@ discard block |
||
91 | 91 | custom_fields LONGTEXT NOT NULL, |
92 | 92 | UNIQUE KEY id (id) |
93 | 93 | ) $charset_collate;"; |
94 | - require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); |
|
95 | - dbDelta($sql); |
|
94 | + require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); |
|
95 | + dbDelta( $sql ); |
|
96 | 96 | |
97 | 97 | // create an option for the date that the user initially activated the plugin |
98 | 98 | // used to display a two week notice, asking for a review or to upgrade |
99 | - if( !get_option( 'yikes_easy_mailchimp_activation_date' ) || get_option( 'yikes_easy_mailchimp_activation_date' ) == '' ) { |
|
100 | - update_option( 'yikes_easy_mailchimp_activation_date' , strtotime( 'now' ) ); |
|
99 | + if ( ! get_option( 'yikes_easy_mailchimp_activation_date' ) || get_option( 'yikes_easy_mailchimp_activation_date' ) == '' ) { |
|
100 | + update_option( 'yikes_easy_mailchimp_activation_date', strtotime( 'now' ) ); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | } |
@@ -45,7 +45,8 @@ |
||
45 | 45 | return; |
46 | 46 | } |
47 | 47 | self::_activate_yikes_easy_mailchimp( $wpdb ); |
48 | - } else { /* end network activate */ |
|
48 | + } else { |
|
49 | +/* end network activate */ |
|
49 | 50 | self::_activate_yikes_easy_mailchimp( $wpdb ); |
50 | 51 | } |
51 | 52 | } |
@@ -6,26 +6,26 @@ discard block |
||
6 | 6 | class YIKES_MailChimp_Visual_Composer_Extension { |
7 | 7 | |
8 | 8 | /** |
9 | - * Constructor |
|
10 | - * @since 6.0.3 |
|
11 | - */ |
|
9 | + * Constructor |
|
10 | + * @since 6.0.3 |
|
11 | + */ |
|
12 | 12 | function __construct() { |
13 | 13 | add_action( 'admin_init', array( $this, 'extend_visual_composer' ) ); |
14 | 14 | add_shortcode_param( 'yikes_mailchimp_logo', array( $this, 'yikes_mailchimp_logo_vc_section' ) ); |
15 | 15 | } |
16 | 16 | |
17 | 17 | /** |
18 | - * Extend Visual Composer with custom button |
|
19 | - * @since 6.0.3 |
|
20 | - */ |
|
18 | + * Extend Visual Composer with custom button |
|
19 | + * @since 6.0.3 |
|
20 | + */ |
|
21 | 21 | public function extend_visual_composer() { |
22 | 22 | vc_map( array( |
23 | - "name" => __( "Easy Forms for MailChimp", "yikes-inc-easy-mailchimp-extender" ), |
|
24 | - "base" => "yikes-mailchimp", |
|
25 | - "icon" => YIKES_MC_URL . "includes/images/Welcome_Page/yikes-mailchimp-welcome-logo.png", // Simply pass url to your icon here |
|
26 | - "category" => 'Content', // where is this buutton being displayed |
|
27 | - "description" => __( "Display a MailChimp Opt-In form", "yikes-inc-easy-mailchimp-extender" ), // add a description |
|
28 | - "params" => array( |
|
23 | + "name" => __( "Easy Forms for MailChimp", "yikes-inc-easy-mailchimp-extender" ), |
|
24 | + "base" => "yikes-mailchimp", |
|
25 | + "icon" => YIKES_MC_URL . "includes/images/Welcome_Page/yikes-mailchimp-welcome-logo.png", // Simply pass url to your icon here |
|
26 | + "category" => 'Content', // where is this buutton being displayed |
|
27 | + "description" => __( "Display a MailChimp Opt-In form", "yikes-inc-easy-mailchimp-extender" ), // add a description |
|
28 | + "params" => array( |
|
29 | 29 | array( |
30 | 30 | "type" => "yikes_mailchimp_logo", |
31 | 31 | "holder" => "div", |
@@ -75,22 +75,22 @@ discard block |
||
75 | 75 | "value" => __( "Submit", "yikes-inc-easy-mailchimp-extender" ), |
76 | 76 | "description" => __( "Enter a title to display", "yikes-inc-easy-mailchimp-extender" ) |
77 | 77 | ) |
78 | - ) |
|
78 | + ) |
|
79 | 79 | ) ); |
80 | 80 | } |
81 | 81 | |
82 | 82 | /** |
83 | - * Custom Callback Section |
|
84 | - * @since 6.0.3 |
|
85 | - */ |
|
83 | + * Custom Callback Section |
|
84 | + * @since 6.0.3 |
|
85 | + */ |
|
86 | 86 | public function yikes_mailchimp_logo_vc_section( $settings, $value ) { |
87 | 87 | return '<img style="width:250px;display:block;margin:0 auto;" src="' . YIKES_MC_URL . 'includes/images/Welcome_Page/mailchimp-logo.png" title="' . __( 'Easy Forms for MailChimp by YIKES', 'yikes-inc-easy-mailchimp-extender' ) . '" />'; |
88 | 88 | } |
89 | 89 | |
90 | 90 | /** |
91 | - * Retreive a list of forms created by the user that they can select from in the dropdown |
|
92 | - * @since 6.0.3 |
|
93 | - */ |
|
91 | + * Retreive a list of forms created by the user that they can select from in the dropdown |
|
92 | + * @since 6.0.3 |
|
93 | + */ |
|
94 | 94 | public function yikes_mailchimp_retreive_user_created_forms() { |
95 | 95 | global $wpdb; |
96 | 96 | $list_data = $wpdb->get_results( 'SELECT * FROM ' . $wpdb->prefix . 'yikes_easy_mc_forms', ARRAY_A ); |
@@ -95,13 +95,13 @@ |
||
95 | 95 | global $wpdb; |
96 | 96 | $list_data = $wpdb->get_results( 'SELECT * FROM ' . $wpdb->prefix . 'yikes_easy_mc_forms', ARRAY_A ); |
97 | 97 | $lists = array(); |
98 | - if( !empty( $list_data ) ) { |
|
98 | + if ( ! empty( $list_data ) ) { |
|
99 | 99 | // build an array to pass to our javascript |
100 | - foreach( $list_data as $form ) { |
|
101 | - $lists[$form['form_name']] = $form['id']; |
|
100 | + foreach ( $list_data as $form ) { |
|
101 | + $lists[ $form[ 'form_name' ] ] = $form[ 'id' ]; |
|
102 | 102 | } |
103 | 103 | } else { |
104 | - $lists[__( 'Please Import Some MailChimp Lists' , 'yikes-inc-easy-mailchimp-extender' )] = '-'; |
|
104 | + $lists[ __( 'Please Import Some MailChimp Lists', 'yikes-inc-easy-mailchimp-extender' ) ] = '-'; |
|
105 | 105 | } |
106 | 106 | return $lists; |
107 | 107 | } |
@@ -95,7 +95,7 @@ |
||
95 | 95 | global $wpdb; |
96 | 96 | $list_data = $wpdb->get_results( 'SELECT * FROM ' . $wpdb->prefix . 'yikes_easy_mc_forms', ARRAY_A ); |
97 | 97 | $lists = array(); |
98 | - if( !empty( $list_data ) ) { |
|
98 | + if( !empty( $list_data ) ) { |
|
99 | 99 | // build an array to pass to our javascript |
100 | 100 | foreach( $list_data as $form ) { |
101 | 101 | $lists[$form['form_name']] = $form['id']; |