Completed
Push — master ( 858e26...d8c2cf )
by
unknown
28:10 queued 25:49
created
blocks/easy-forms-block/easy-forms-block.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -66,46 +66,46 @@
 block discarded – undo
66 66
 	 */
67 67
 	public function render_block( $attributes, $content ) {
68 68
 
69
-		if ( ! isset( $attributes['form_id'] ) ) {
69
+		if ( ! isset( $attributes[ 'form_id' ] ) ) {
70 70
 			return;
71 71
 		}
72 72
 
73 73
 		$shortcode_attributes = array(
74
-			'form'                       => $attributes['form_id'],
75
-			'submit'                     => isset( $attributes['submit_button_text'] ) && ! empty( $attributes['submit_button_text'] ) ? $attributes['submit_button_text'] : '',
76
-			'title'                      => isset( $attributes['show_title'] ) && true === $attributes['show_title'] ? '1' : '0',
77
-			'custom_title'               => isset( $attributes['form_title'] ) ? $attributes['form_title'] : '',
78
-			'description'                => isset( $attributes['show_description'] ) && true === $attributes['show_description'] ? '1' : '0',
79
-			'custom_description'         => isset( $attributes['form_description'] ) ? $attributes['form_description'] : '',
80
-			'ajax'                       => isset( $attributes['is_ajax'] ) && true === $attributes['is_ajax'] ? '1' : '0',
81
-			'recaptcha'                  => ! isset( $attributes['recaptcha'] ) || isset( $attributes['recaptcha'] ) && false === $attributes['recaptcha'] ? '0' : '',
82
-			'recaptcha_lang'             => isset( $attributes['recaptcha_lang'] ) ? $attributes['recaptcha_lang'] : '',
83
-			'recaptcha_type'             => isset( $attributes['recaptcha_type'] ) ? $attributes['recaptcha_type'] : '',
84
-			'recaptcha_theme'            => isset( $attributes['recaptcha_theme'] ) ? $attributes['recaptcha_theme'] : '',
85
-			'recaptcha_size'             => isset( $attributes['recaptcha_size'] ) ? $attributes['recaptcha_size'] : '',
86
-			'recaptcha_data_callback'    => isset( $attributes['recaptcha_verify_callback'] ) ? $attributes['recaptcha_verify_callback'] : '',
87
-			'recaptcha_expired_callback' => isset( $attributes['recaptcha_expired_callback'] ) ? $attributes['recaptcha_expired_callback'] : '',
88
-			'inline'                     => isset( $attributes['inline'] ) && true === $attributes['inline'] ? '1' : '0',
74
+			'form'                       => $attributes[ 'form_id' ],
75
+			'submit'                     => isset( $attributes[ 'submit_button_text' ] ) && ! empty( $attributes[ 'submit_button_text' ] ) ? $attributes[ 'submit_button_text' ] : '',
76
+			'title'                      => isset( $attributes[ 'show_title' ] ) && true === $attributes[ 'show_title' ] ? '1' : '0',
77
+			'custom_title'               => isset( $attributes[ 'form_title' ] ) ? $attributes[ 'form_title' ] : '',
78
+			'description'                => isset( $attributes[ 'show_description' ] ) && true === $attributes[ 'show_description' ] ? '1' : '0',
79
+			'custom_description'         => isset( $attributes[ 'form_description' ] ) ? $attributes[ 'form_description' ] : '',
80
+			'ajax'                       => isset( $attributes[ 'is_ajax' ] ) && true === $attributes[ 'is_ajax' ] ? '1' : '0',
81
+			'recaptcha'                  => ! isset( $attributes[ 'recaptcha' ] ) || isset( $attributes[ 'recaptcha' ] ) && false === $attributes[ 'recaptcha' ] ? '0' : '',
82
+			'recaptcha_lang'             => isset( $attributes[ 'recaptcha_lang' ] ) ? $attributes[ 'recaptcha_lang' ] : '',
83
+			'recaptcha_type'             => isset( $attributes[ 'recaptcha_type' ] ) ? $attributes[ 'recaptcha_type' ] : '',
84
+			'recaptcha_theme'            => isset( $attributes[ 'recaptcha_theme' ] ) ? $attributes[ 'recaptcha_theme' ] : '',
85
+			'recaptcha_size'             => isset( $attributes[ 'recaptcha_size' ] ) ? $attributes[ 'recaptcha_size' ] : '',
86
+			'recaptcha_data_callback'    => isset( $attributes[ 'recaptcha_verify_callback' ] ) ? $attributes[ 'recaptcha_verify_callback' ] : '',
87
+			'recaptcha_expired_callback' => isset( $attributes[ 'recaptcha_expired_callback' ] ) ? $attributes[ 'recaptcha_expired_callback' ] : '',
88
+			'inline'                     => isset( $attributes[ 'inline' ] ) && true === $attributes[ 'inline' ] ? '1' : '0',
89 89
 		);
90 90
 
91 91
 		// We want to run process_mailchimp_shortcode() but we need to return the plaintext shortcode or Gutenberg will autop() the shortcode content.
92 92
 		return sprintf(
93 93
 			'[yikes-mailchimp form="%s" submit="%s" title="%s" custom_title="%s" description="%s" custom_description="%s" ajax="%s" recaptcha="%s"  recaptcha_lang="%s" recaptcha_type="%s" recaptcha_theme="%s" recaptcha_size="%s" recaptcha_data_callback="%s" recaptcha_expired_callback="%s" inline="%s"]',
94
-			$shortcode_attributes['form'],
95
-			$shortcode_attributes['submit'],
96
-			$shortcode_attributes['title'],
97
-			$shortcode_attributes['custom_title'],
98
-			$shortcode_attributes['description'],
99
-			$shortcode_attributes['custom_description'],
100
-			$shortcode_attributes['ajax'],
101
-			$shortcode_attributes['recaptcha'],
102
-			$shortcode_attributes['recaptcha_lang'],
103
-			$shortcode_attributes['recaptcha_type'],
104
-			$shortcode_attributes['recaptcha_theme'],
105
-			$shortcode_attributes['recaptcha_size'],
106
-			$shortcode_attributes['recaptcha_data_callback'],
107
-			$shortcode_attributes['recaptcha_expired_callback'],
108
-			$shortcode_attributes['inline']
94
+			$shortcode_attributes[ 'form' ],
95
+			$shortcode_attributes[ 'submit' ],
96
+			$shortcode_attributes[ 'title' ],
97
+			$shortcode_attributes[ 'custom_title' ],
98
+			$shortcode_attributes[ 'description' ],
99
+			$shortcode_attributes[ 'custom_description' ],
100
+			$shortcode_attributes[ 'ajax' ],
101
+			$shortcode_attributes[ 'recaptcha' ],
102
+			$shortcode_attributes[ 'recaptcha_lang' ],
103
+			$shortcode_attributes[ 'recaptcha_type' ],
104
+			$shortcode_attributes[ 'recaptcha_theme' ],
105
+			$shortcode_attributes[ 'recaptcha_size' ],
106
+			$shortcode_attributes[ 'recaptcha_data_callback' ],
107
+			$shortcode_attributes[ 'recaptcha_expired_callback' ],
108
+			$shortcode_attributes[ 'inline' ]
109 109
 		);
110 110
 	}
111 111
 }
Please login to merge, or discard this patch.
admin/partials/ajax/add_field_to_form.php 1 patch
Spacing   +83 added lines, -83 removed lines patch added patch discarded remove patch
@@ -1,15 +1,15 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 $form_data = array(
3
-	'field_name' => $_POST['field_name'],
4
-	'merge_tag'  => $_POST['merge_tag'],
5
-	'field_type' => $_POST['field_type'],
6
-	'list_id'    => $_POST['list_id'],
3
+	'field_name' => $_POST[ 'field_name' ],
4
+	'merge_tag'  => $_POST[ 'merge_tag' ],
5
+	'field_type' => $_POST[ 'field_type' ],
6
+	'list_id'    => $_POST[ 'list_id' ],
7 7
 );
8 8
 
9 9
 // Grab our list handler.
10 10
 $list_handler = yikes_get_mc_api_manager()->get_list_handler();
11 11
 
12
-$available_merge_variables = $list_handler->get_merge_fields( $form_data['list_id'] );
12
+$available_merge_variables = $list_handler->get_merge_fields( $form_data[ 'list_id' ] );
13 13
 if ( is_wp_error( $available_merge_variables ) ) {
14 14
 	$error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging();
15 15
 	$error_logging->maybe_write_to_log(
@@ -28,17 +28,17 @@  discard block
 block discarded – undo
28 28
 }
29 29
 
30 30
 // find and return the location of this merge field in the array
31
-$index = $this->findMCListIndex( $form_data['merge_tag'], $available_merge_variables['merge_fields'], 'tag' );
31
+$index = $this->findMCListIndex( $form_data[ 'merge_tag' ], $available_merge_variables[ 'merge_fields' ], 'tag' );
32 32
 
33 33
 // store it and use it to pre-populate field data (only on initial add to form)
34
-$merge_field_data = $available_merge_variables['merge_fields'][ $index ];
34
+$merge_field_data = $available_merge_variables[ 'merge_fields' ][ $index ];
35 35
 ?>
36
-<section class="draggable" id="<?php echo $form_data['field_name']; ?>">
36
+<section class="draggable" id="<?php echo $form_data[ 'field_name' ]; ?>">
37 37
 	<!-- top -->
38 38
 	<a href="#" class="expansion-section-title settings-sidebar">
39
-		<span class="dashicons dashicons-plus yikes-mc-expansion-toggle" title="<?php _e( 'Expand Field' , 'yikes-inc-easy-mailchimp-extender' ); ?>"></span>
40
-		<?php echo stripslashes( $form_data['field_name'] ); ?>
41
-		<span class="field-type-text"><small><?php echo __( 'type' , 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $form_data['field_type']; ?></small></span>
39
+		<span class="dashicons dashicons-plus yikes-mc-expansion-toggle" title="<?php _e( 'Expand Field', 'yikes-inc-easy-mailchimp-extender' ); ?>"></span>
40
+		<?php echo stripslashes( $form_data[ 'field_name' ] ); ?>
41
+		<span class="field-type-text"><small><?php echo __( 'type', 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $form_data[ 'field_type' ]; ?></small></span>
42 42
 	</a>
43 43
 	<!-- expansion section -->
44 44
 	<div class="yikes-mc-settings-expansion-section">
@@ -46,14 +46,14 @@  discard block
 block discarded – undo
46 46
 		<!-- Single or Double Opt-in -->
47 47
 		<p class="type-container form-field-container"><!-- necessary to prevent skipping on slideToggle(); -->
48 48
 			<!-- store the label -->
49
-			<input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][label]" value="<?php echo htmlspecialchars( $form_data['field_name'] ); ?>" />
50
-			<input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][type]" value="<?php echo $form_data['field_type']; ?>" />
51
-			<input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][merge]" value="<?php echo $merge_field_data['tag']; ?>" />
52
-			<input type="hidden" class="field-<?php echo $merge_field_data['tag']; ?>-position position-input" name="field[<?php echo $merge_field_data['tag']; ?>][position]" value="" />
49
+			<input type="hidden" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][label]" value="<?php echo htmlspecialchars( $form_data[ 'field_name' ] ); ?>" />
50
+			<input type="hidden" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][type]" value="<?php echo $form_data[ 'field_type' ]; ?>" />
51
+			<input type="hidden" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][merge]" value="<?php echo $merge_field_data[ 'tag' ]; ?>" />
52
+			<input type="hidden" class="field-<?php echo $merge_field_data[ 'tag' ]; ?>-position position-input" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][position]" value="" />
53 53
 
54
-			<?php if ( $form_data['field_type'] == 'radio' || $form_data['field_type'] == 'dropdown' ) { ?>
55
-				<?php $choices = ( isset( $merge_field_data['options']['choices'] ) ) ? esc_attr( json_encode( $merge_field_data['options']['choices'] ) ) : ''; ?>
56
-				<input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][choices]" value='<?php echo $choices; ?>' />
54
+			<?php if ( $form_data[ 'field_type' ] == 'radio' || $form_data[ 'field_type' ] == 'dropdown' ) { ?>
55
+				<?php $choices = ( isset( $merge_field_data[ 'options' ][ 'choices' ] ) ) ? esc_attr( json_encode( $merge_field_data[ 'options' ][ 'choices' ] ) ) : ''; ?>
56
+				<input type="hidden" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][choices]" value='<?php echo $choices; ?>' />
57 57
 			<?php } ?>
58 58
 
59 59
 			<table class="form-table form-field-container">
@@ -62,15 +62,15 @@  discard block
 block discarded – undo
62 62
 					<tr valign="top">
63 63
 						<td scope="row">
64 64
 							<label for="merge-tag">
65
-								<?php _e( 'Merge Tag' , 'yikes-inc-easy-mailchimp-extender' ); ?>
65
+								<?php _e( 'Merge Tag', 'yikes-inc-easy-mailchimp-extender' ); ?>
66 66
 							</label>
67 67
 						</td>
68 68
 						<td>
69
-							<input class="widefat merge-tag-text" type="text" readonly value="<?php echo $merge_field_data['tag']; ?>">
69
+							<input class="widefat merge-tag-text" type="text" readonly value="<?php echo $merge_field_data[ 'tag' ]; ?>">
70 70
 						</td>
71 71
 					</tr>
72 72
 
73
-			<?php switch( $form_data['field_type'] ) {
73
+			<?php switch ( $form_data[ 'field_type' ] ) {
74 74
 
75 75
 					default:
76 76
 						break;
@@ -87,12 +87,12 @@  discard block
 block discarded – undo
87 87
 					<tr valign="top">
88 88
 						<td scope="row">
89 89
 							<label for="placeholder">
90
-								<?php _e( 'Placeholder' , 'yikes-inc-easy-mailchimp-extender' ); ?>
90
+								<?php _e( 'Placeholder', 'yikes-inc-easy-mailchimp-extender' ); ?>
91 91
 							</label>
92 92
 						</td>
93 93
 						<td>
94
-						<input type="text" class="widefat" name="field[<?php echo $merge_field_data['tag']; ?>][placeholder]" value="<?php echo isset( $merge_field_data['placeholder'] ) ? stripslashes( wp_strip_all_tags( $merge_field_data['placeholder'] ) ): '' ; ?>" />
95
-							<p class="description"><small><?php _e( "Assign a placeholder value to this field.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
94
+						<input type="text" class="widefat" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][placeholder]" value="<?php echo isset( $merge_field_data[ 'placeholder' ] ) ? stripslashes( wp_strip_all_tags( $merge_field_data[ 'placeholder' ] ) ) : ''; ?>" />
95
+							<p class="description"><small><?php _e( "Assign a placeholder value to this field.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
96 96
 						</td>
97 97
 					</tr>
98 98
 
@@ -101,27 +101,27 @@  discard block
 block discarded – undo
101 101
 					*	Loop over field types and store necessary formats
102 102
 					*	( date, birthday - dateformat ; phone - phoneformat )
103 103
 					*/
104
-					switch( $form_data['field_type'] ) {
104
+					switch ( $form_data[ 'field_type' ] ) {
105 105
 
106 106
 						/* Store the date format, for properly rendering dates on the front end */
107 107
 						case 'date':
108
-							$date_format = isset( $merge_field_data['options']['dateformat'] ) ? $merge_field_data['options']['dateformat'] : 'MM/DD/YYYY';
108
+							$date_format = isset( $merge_field_data[ 'options' ][ 'dateformat' ] ) ? $merge_field_data[ 'options' ][ 'dateformat' ] : 'MM/DD/YYYY';
109 109
 							?>
110
-							<input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][date_format]" value="<?php echo strtolower( $date_format ); ?>" />
110
+							<input type="hidden" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][date_format]" value="<?php echo strtolower( $date_format ); ?>" />
111 111
 							<?php
112 112
 						break;
113 113
 
114 114
 						case 'birthday':
115
-							$date_format = isset( $merge_field_data['options']['dateformat'] ) ? $merge_field_data['options']['dateformat'] : 'MM/DD';
115
+							$date_format = isset( $merge_field_data[ 'options' ][ 'dateformat' ] ) ? $merge_field_data[ 'options' ][ 'dateformat' ] : 'MM/DD';
116 116
 							?>
117
-							<input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][date_format]" value="<?php echo strtolower( $date_format ); ?>" />
117
+							<input type="hidden" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][date_format]" value="<?php echo strtolower( $date_format ); ?>" />
118 118
 							<?php
119 119
 						break;
120 120
 
121 121
 						/* Store the phone format, for properly regex pattern */
122 122
 						case 'phone':
123 123
 							?>
124
-							<input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][phone_format]" value="<?php echo $merge_field_data['options']['phone_format']; ?>" />
124
+							<input type="hidden" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][phone_format]" value="<?php echo $merge_field_data[ 'options' ][ 'phone_format' ]; ?>" />
125 125
 							<?php
126 126
 						break;
127 127
 					}
@@ -132,13 +132,13 @@  discard block
 block discarded – undo
132 132
 						?>
133 133
 							<tr valign="top">
134 134
 								<td scope="row">
135
-									<label for="placeholder_<?php echo esc_attr( $field['merge'] ); ?>">
136
-										<?php _e( 'Placeholder' , 'yikes-inc-easy-mailchimp-extender' ); ?>
135
+									<label for="placeholder_<?php echo esc_attr( $field[ 'merge' ] ); ?>">
136
+										<?php _e( 'Placeholder', 'yikes-inc-easy-mailchimp-extender' ); ?>
137 137
 									</label>
138 138
 								</td>
139 139
 								<td>
140
-									<input type="checkbox" class="widefat" name="field[<?php echo $merge_field_data['tag']; ?>][placeholder]" value="1" />
141
-									<span class="description"><small><?php _e( "Use placeholders for this field (these will be automatically filled in with field names).", 'yikes-inc-easy-mailchimp-extender' );?></small></span>
140
+									<input type="checkbox" class="widefat" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][placeholder]" value="1" />
141
+									<span class="description"><small><?php _e( "Use placeholders for this field (these will be automatically filled in with field names).", 'yikes-inc-easy-mailchimp-extender' ); ?></small></span>
142 142
 								</td>
143 143
 							</tr>
144 144
 						<?php
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 			?>
149 149
 
150 150
 				<!-- Default Value -->
151
-				<?php switch( $form_data['field_type'] ) {
151
+				<?php switch ( $form_data[ 'field_type' ] ) {
152 152
 
153 153
 					default:
154 154
 					case 'text':
@@ -156,17 +156,17 @@  discard block
 block discarded – undo
156 156
 						<tr valign="top">
157 157
 							<td scope="row">
158 158
 								<label for="placeholder">
159
-									<?php _e( 'Default Value' , 'yikes-inc-easy-mailchimp-extender' ); ?>
159
+									<?php _e( 'Default Value', 'yikes-inc-easy-mailchimp-extender' ); ?>
160 160
 								</label>
161 161
 							</td>
162 162
 							<td>
163
-								<input type="text" class="widefat" name="field[<?php echo $merge_field_data['tag']; ?>][default]" <?php if( $form_data['field_type'] != 'url' ) { ?> value="<?php echo isset( $merge_field_data['default_value'] ) ? stripslashes( wp_strip_all_tags( $merge_field_data['default_value'] ) ) : ''; ?>" <?php } else { ?> value="<?php echo isset( $merge_field_data['default_value'] ) ? stripslashes( wp_strip_all_tags( esc_url_raw( $merge_field_data['default_value'] ) ) ) : ''; } ?>" />
164
-								<p class="description"><small><?php _e( "Assign a default value to populate this field with on initial page load.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
163
+								<input type="text" class="widefat" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][default]" <?php if ( $form_data[ 'field_type' ] != 'url' ) { ?> value="<?php echo isset( $merge_field_data[ 'default_value' ] ) ? stripslashes( wp_strip_all_tags( $merge_field_data[ 'default_value' ] ) ) : ''; ?>" <?php } else { ?> value="<?php echo isset( $merge_field_data[ 'default_value' ] ) ? stripslashes( wp_strip_all_tags( esc_url_raw( $merge_field_data[ 'default_value' ] ) ) ) : ''; } ?>" />
164
+								<p class="description"><small><?php _e( "Assign a default value to populate this field with on initial page load.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
165 165
 								<?php
166
-								switch ( $form_data['field_type'] ) {
166
+								switch ( $form_data[ 'field_type' ] ) {
167 167
 									case 'text':
168 168
 										?>
169
-										<p><small class="pre-defined-tag-link"><a href="#TB_inline?width=600&height=550&inlineId=pre-defined-tag-container" class="thickbox" onclick="storeGlobalClicked( jQuery( this ) );"><?php _e( 'View Pre-Defined Tags' , 'yikes-inc-easy-mailchimp-extender' ); ?></a></small></p>
169
+										<p><small class="pre-defined-tag-link"><a href="#TB_inline?width=600&height=550&inlineId=pre-defined-tag-container" class="thickbox" onclick="storeGlobalClicked( jQuery( this ) );"><?php _e( 'View Pre-Defined Tags', 'yikes-inc-easy-mailchimp-extender' ); ?></a></small></p>
170 170
 										<?php
171 171
 									break;
172 172
 								} ?>
@@ -180,28 +180,28 @@  discard block
 block discarded – undo
180 180
 							<tr valign="top">
181 181
 								<td scope="row">
182 182
 									<label for="placeholder">
183
-										<?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?>
183
+										<?php _e( 'Default Selection', 'yikes-inc-easy-mailchimp-extender' ); ?>
184 184
 									</label>
185 185
 								</td>
186 186
 								<td>
187
-									<?php $pre_selected = ! empty( $merge_field_data['default_choice'] ) ? $merge_field_data['default_choice'] : 'no-default'; ?>
188
-									<label for="<?php echo $merge_field_data['tag'] . '-no-default'; ?>">
189
-										<input id="<?php echo $merge_field_data['tag'] . '-no-default'; ?>"
187
+									<?php $pre_selected = ! empty( $merge_field_data[ 'default_choice' ] ) ? $merge_field_data[ 'default_choice' ] : 'no-default'; ?>
188
+									<label for="<?php echo $merge_field_data[ 'tag' ] . '-no-default'; ?>">
189
+										<input id="<?php echo $merge_field_data[ 'tag' ] . '-no-default'; ?>"
190 190
 										       type="radio"
191
-										       name="field[<?php echo $merge_field_data['tag']; ?>][default_choice]"
191
+										       name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][default_choice]"
192 192
 										       value="no-default" <?php checked( $pre_selected, 'no-default' ); ?>
193 193
 										>
194 194
 										No Default&nbsp;
195 195
 									</label>
196 196
 									<?php
197 197
 									$x = 0;
198
-									foreach ( $merge_field_data['options']['choices'] as $choice => $value ) { ?>
198
+									foreach ( $merge_field_data[ 'options' ][ 'choices' ] as $choice => $value ) { ?>
199 199
 										<label>
200
-											<input type="radio" name="field[<?php echo $merge_field_data['tag']; ?>][default_choice]" value="<?php echo $x; ?>" <?php checked( $pre_selected, $choice ); ?>><?php echo $value; ?>
200
+											<input type="radio" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][default_choice]" value="<?php echo $x; ?>" <?php checked( $pre_selected, $choice ); ?>><?php echo $value; ?>
201 201
 										</label>
202 202
 										<?php $x++;
203 203
 									} ?>
204
-									<p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
204
+									<p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
205 205
 								</td>
206 206
 							</tr>
207 207
 
@@ -213,18 +213,18 @@  discard block
 block discarded – undo
213 213
 							<tr valign="top">
214 214
 								<td scope="row">
215 215
 									<label for="placeholder">
216
-										<?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?>
216
+										<?php _e( 'Default Selection', 'yikes-inc-easy-mailchimp-extender' ); ?>
217 217
 									</label>
218 218
 								</td>
219 219
 								<td>
220
-									<select type="default" name="field[<?php echo $merge_field_data['tag']; ?>][default_choice]">
221
-										<?php $pre_selected = ! empty( $merge_field_data['default_choice'] ) ? $merge_field_data['default_choice'] : 'no-default'; ?>
220
+									<select type="default" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][default_choice]">
221
+										<?php $pre_selected = ! empty( $merge_field_data[ 'default_choice' ] ) ? $merge_field_data[ 'default_choice' ] : 'no-default'; ?>
222 222
 										<option value="no-default" <?php selected( $pre_selected, $choice ); ?>>No Default</option>
223
-										<?php foreach ( $merge_field_data['options']['choices'] as $choice => $value ) { ?>
223
+										<?php foreach ( $merge_field_data[ 'options' ][ 'choices' ] as $choice => $value ) { ?>
224 224
 											<option value="<?php echo $choice; ?>" <?php selected( $pre_selected, $choice ); ?>><?php echo stripslashes( $value ); ?></option>
225 225
 										<?php } ?>
226 226
 									</select>
227
-									<p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
227
+									<p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
228 228
 								</td>
229 229
 							</tr>
230 230
 
@@ -237,77 +237,77 @@  discard block
 block discarded – undo
237 237
 				<tr valign="top">
238 238
 					<td scope="row">
239 239
 						<label for="placeholder">
240
-							<?php _e( 'Description' , 'yikes-inc-easy-mailchimp-extender' ); ?>
240
+							<?php _e( 'Description', 'yikes-inc-easy-mailchimp-extender' ); ?>
241 241
 						</label>
242 242
 					</td>
243 243
 					<td>
244
-						<textarea class="widefat field-description-input" name="field[<?php echo $merge_field_data['tag']; ?>][description]"></textarea>
245
-						<p class="description"><small><?php _e( "Enter the description for the form field. This will be displayed to the user and provide some direction on how the field should be filled out or selected.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
244
+						<textarea class="widefat field-description-input" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][description]"></textarea>
245
+						<p class="description"><small><?php _e( "Enter the description for the form field. This will be displayed to the user and provide some direction on how the field should be filled out or selected.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
246 246
 					</td>
247 247
 				</tr>
248 248
 				<!-- Description Above Field -->
249 249
 				<tr valign="top" class="yikes-checkbox-container">
250 250
 					<td scope="row">
251
-						<label for="description_above_<?php echo esc_attr( $merge_field_data['tag'] ); ?>">
252
-							<?php _e( 'Description Above Field' , 'yikes-inc-easy-mailchimp-extender' ); ?>
251
+						<label for="description_above_<?php echo esc_attr( $merge_field_data[ 'tag' ] ); ?>">
252
+							<?php _e( 'Description Above Field', 'yikes-inc-easy-mailchimp-extender' ); ?>
253 253
 						</label>
254 254
 					</td>
255 255
 					<td>
256
-						<input type="checkbox" id="description_above_<?php echo esc_attr( $merge_field_data['tag'] ); ?>" class="widefat field-description-input" name="field[<?php echo $merge_field_data['tag']; ?>][description_above]" value="1" />
257
-						<p class="description"><small><?php _e( "By default the description will appear undearneath the field. Check this box if you'd like the description to appear above the field.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
256
+						<input type="checkbox" id="description_above_<?php echo esc_attr( $merge_field_data[ 'tag' ] ); ?>" class="widefat field-description-input" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][description_above]" value="1" />
257
+						<p class="description"><small><?php _e( "By default the description will appear undearneath the field. Check this box if you'd like the description to appear above the field.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
258 258
 					</td>
259 259
 				</tr>
260 260
 				<!-- Additional Classes -->
261 261
 				<tr valign="top">
262 262
 					<td scope="row">
263 263
 						<label for="placeholder">
264
-							<?php _e( 'Additional Classes' , 'yikes-inc-easy-mailchimp-extender' ); ?>
264
+							<?php _e( 'Additional Classes', 'yikes-inc-easy-mailchimp-extender' ); ?>
265 265
 						</label>
266 266
 					</td>
267 267
 					<td>
268
-						<input type="text" class="widefat" name="field[<?php echo $merge_field_data['tag']; ?>][additional-classes]" value="<?php echo isset( $form_data['classes'] ) ? stripslashes( wp_strip_all_tags( $form_data['classes'] ) ) : '' ; ?>" />
269
-						<p class="description"><small><?php printf( __( "Assign additional classes to this field. %s.", 'yikes-inc-easy-mailchimp-extender' ), '<a target="_blank" href="' . esc_url( 'https://yikesplugins.com/support/knowledge-base/bundled-css-classes/' ) . '">' . __( 'View bundled classes', 'yikes-inc-easy-mailchimp-extender' ) . '</a>' );?></small></p>
268
+						<input type="text" class="widefat" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][additional-classes]" value="<?php echo isset( $form_data[ 'classes' ] ) ? stripslashes( wp_strip_all_tags( $form_data[ 'classes' ] ) ) : ''; ?>" />
269
+						<p class="description"><small><?php printf( __( "Assign additional classes to this field. %s.", 'yikes-inc-easy-mailchimp-extender' ), '<a target="_blank" href="' . esc_url( 'https://yikesplugins.com/support/knowledge-base/bundled-css-classes/' ) . '">' . __( 'View bundled classes', 'yikes-inc-easy-mailchimp-extender' ) . '</a>' ); ?></small></p>
270 270
 					</td>
271 271
 				</tr>
272 272
 					<!-- Required Toggle -->
273 273
 					<tr valign="top" class="yikes-checkbox-container">
274 274
 						<td scope="row">
275 275
 							<label for="field-required">
276
-								<?php _e( 'Field Required?' , 'yikes-inc-easy-mailchimp-extender' ); ?>
276
+								<?php _e( 'Field Required?', 'yikes-inc-easy-mailchimp-extender' ); ?>
277 277
 							</label>
278 278
 						</td>
279 279
 						<td>
280
-							<input type="checkbox" class="widefat" value="1" name="field[<?php echo $merge_field_data['tag']; ?>][require]" <?php checked( $merge_field_data['required'], 1 ); ?> <?php if( $merge_field_data['tag'] == 'EMAIL' ) {  ?> disabled="disabled" checked="checked" title="<?php echo __( 'Email is a required field.' , 'yikes-inc-easy-mailchimp-extender' ); } ?>">
281
-							<p class="description"><small><?php _e( "Require this field to be filled in before the form can be submitted.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
280
+							<input type="checkbox" class="widefat" value="1" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][require]" <?php checked( $merge_field_data[ 'required' ], 1 ); ?> <?php if ( $merge_field_data[ 'tag' ] == 'EMAIL' ) {  ?> disabled="disabled" checked="checked" title="<?php echo __( 'Email is a required field.', 'yikes-inc-easy-mailchimp-extender' ); } ?>">
281
+							<p class="description"><small><?php _e( "Require this field to be filled in before the form can be submitted.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
282 282
 						</td>
283 283
 					</tr>
284 284
 					<!-- Visible Toggle -->
285 285
 					<tr valign="top" class="yikes-checkbox-container">
286 286
 						<td scope="row">
287 287
 							<label for="hide-field">
288
-								<?php _e( 'Hide Field' , 'yikes-inc-easy-mailchimp-extender' ); ?>
288
+								<?php _e( 'Hide Field', 'yikes-inc-easy-mailchimp-extender' ); ?>
289 289
 							</label>
290 290
 						</td>
291 291
 						<td>
292
-							<input type="checkbox" class="widefat" value="1" name="field[<?php echo $merge_field_data['tag']; ?>][hide]" <?php checked( $merge_field_data['public'], '' ); ?> <?php if( $merge_field_data['tag'] == 'EMAIL' ) {  ?> disabled="disabled" title="<?php echo __( 'Cannot toggle email field visibility.' , 'yikes-inc-easy-mailchimp-extender' ); } ?>">
293
-							<p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
292
+							<input type="checkbox" class="widefat" value="1" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][hide]" <?php checked( $merge_field_data[ 'public' ], '' ); ?> <?php if ( $merge_field_data[ 'tag' ] == 'EMAIL' ) {  ?> disabled="disabled" title="<?php echo __( 'Cannot toggle email field visibility.', 'yikes-inc-easy-mailchimp-extender' ); } ?>">
293
+							<p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
294 294
 						</td>
295 295
 					</tr>
296 296
 					<!-- Toggle Field Label Visibility -->
297 297
 					<tr valign="top" class="yikes-checkbox-container">
298 298
 						<td scope="row">
299 299
 							<label for="placeholder">
300
-								<?php _e( 'Hide Label' , 'yikes-inc-easy-mailchimp-extender' ); ?>
300
+								<?php _e( 'Hide Label', 'yikes-inc-easy-mailchimp-extender' ); ?>
301 301
 							</label>
302 302
 						</td>
303 303
 						<td>
304
-							<input type="checkbox" name="field[<?php echo $merge_field_data['tag']; ?>][hide-label]" value="1" />
305
-							<p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' );?></small></p>
304
+							<input type="checkbox" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][hide-label]" value="1" />
305
+							<p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p>
306 306
 						</td>
307 307
 					</tr>
308 308
 					<!-- Display Phone/Date Formats back to the user -->
309 309
 					<?php
310
-						switch( $form_data['field_type'] ) {
310
+						switch ( $form_data[ 'field_type' ] ) {
311 311
 
312 312
 							/* Store the phone format, for properly regex pattern */
313 313
 							case 'phone':
@@ -318,23 +318,23 @@  discard block
 block discarded – undo
318 318
 									<td scope="row">
319 319
 										<label for="placeholder">
320 320
 										<?php
321
-											switch( $form_data['field_type'] ) {
321
+											switch ( $form_data[ 'field_type' ] ) {
322 322
 												default:
323 323
 												case 'birthday':
324
-													$type = __( 'Date Format' , 'yikes-inc-easy-mailchimp-extender' );
325
-													$format = $merge_field_data['options']['date_format'];
324
+													$type = __( 'Date Format', 'yikes-inc-easy-mailchimp-extender' );
325
+													$format = $merge_field_data[ 'options' ][ 'date_format' ];
326 326
 													$format_name = 'date_format';
327 327
 													break;
328 328
 
329 329
 												case 'date':
330
-													$type = __( 'Date Format' , 'yikes-inc-easy-mailchimp-extender' );
331
-													$format = $merge_field_data['options']['date_format'];
330
+													$type = __( 'Date Format', 'yikes-inc-easy-mailchimp-extender' );
331
+													$format = $merge_field_data[ 'options' ][ 'date_format' ];
332 332
 													$format_name = 'date_format';
333 333
 													break;
334 334
 
335 335
 												case 'phone':
336
-													$type = __( 'Phone Format' , 'yikes-inc-easy-mailchimp-extender' );
337
-													$format = ( ( $merge_field_data['options']['phone_format'] == 'none' ) ? __( 'International', 'yikes-inc-easy-mailchimp-extender' ) : $merge_field_data['options']['phone_format'] );
336
+													$type = __( 'Phone Format', 'yikes-inc-easy-mailchimp-extender' );
337
+													$format = ( ( $merge_field_data[ 'options' ][ 'phone_format' ] == 'none' ) ? __( 'International', 'yikes-inc-easy-mailchimp-extender' ) : $merge_field_data[ 'options' ][ 'phone_format' ] );
338 338
 													$format_name = 'phone_format';
339 339
 													break;
340 340
 											}
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
 									</td>
345 345
 									<td>
346 346
 										<strong><?php echo $format; ?></strong>
347
-										<input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][<?php echo $format_name; ?>]" value="<?php echo $format; ?>" />
347
+										<input type="hidden" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][<?php echo $format_name; ?>]" value="<?php echo $format; ?>" />
348 348
 										<p class="description"><small>
349 349
 											<?php printf( __( 'To change the %s please head over to <a href="%s" title="Mailchimp" target="_blank">Mailchimp</a>. If you alter the format, you should re-import this field.', 'yikes-inc-easy-mailchimp-extender' ), strtolower( $type ), esc_url( 'http://www.mailchimp.com' ) ); ?>
350 350
 										</small></p>
@@ -365,8 +365,8 @@  discard block
 block discarded – undo
365 365
 						</td>
366 366
 						<td>
367 367
 							<span class="toggle-container">
368
-								<a href="#" class="hide-field"><?php _e( "Close" , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
369
-								<a href="#" class="remove-field" alt="<?php echo $merge_field_data['tag']; ?>"><?php _e( "Remove Field" , 'yikes-inc-easy-mailchimp-extender' ); ?></a>
368
+								<a href="#" class="hide-field"><?php _e( "Close", 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
369
+								<a href="#" class="remove-field" alt="<?php echo $merge_field_data[ 'tag' ]; ?>"><?php _e( "Remove Field", 'yikes-inc-easy-mailchimp-extender' ); ?></a>
370 370
 							</span>
371 371
 						</td>
372 372
 					</tr>
Please login to merge, or discard this patch.
admin/partials/menu/options-sections/import-export-forms.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -3,15 +3,15 @@  discard block
 block discarded – undo
3 3
 $form_interface = yikes_easy_mailchimp_extender_get_form_interface();
4 4
 $all_forms = $form_interface->get_all_forms();
5 5
 ?>
6
-<h3><span><?php _e( 'Import/Export Forms & Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3>
6
+<h3><span><?php _e( 'Import/Export Forms & Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3>
7 7
 
8 8
 <div class="inside">
9 9
 
10 10
 	<!-- Export Form -->
11
-	<form action="<?php echo esc_url_raw( add_query_arg( array( 'action' => 'yikes-easy-mc-export-forms' , 'nonce' => wp_create_nonce( 'export-forms' ) ) ) ); ?>" method="post">
12
-		<p><strong><?php _e( "Export Forms" , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></p>
11
+	<form action="<?php echo esc_url_raw( add_query_arg( array( 'action' => 'yikes-easy-mc-export-forms', 'nonce' => wp_create_nonce( 'export-forms' ) ) ) ); ?>" method="post">
12
+		<p><strong><?php _e( "Export Forms", 'yikes-inc-easy-mailchimp-extender' ); ?></strong></p>
13 13
 		<p class="description">
14
-			<?php _e( "Select the forms you would like to export. When you click the download button below, Easy Forms for Mailchimp will create a CSV file for you to save to your computer. Once you've saved the download file, you can use the Import tool to import the forms to this or any other site." , "yikes-inc-easy-mailchimp-extender" ); ?>
14
+			<?php _e( "Select the forms you would like to export. When you click the download button below, Easy Forms for Mailchimp will create a CSV file for you to save to your computer. Once you've saved the download file, you can use the Import tool to import the forms to this or any other site.", "yikes-inc-easy-mailchimp-extender" ); ?>
15 15
 		</p>
16 16
 
17 17
 		<?php if ( empty( $all_forms ) ) { ?>
@@ -20,44 +20,44 @@  discard block
 block discarded – undo
20 20
 			</p>
21 21
 		<?php } else { ?>
22 22
 			<!-- custom list so users can export specific forms -->
23
-			<a class="toggle-custom-lists button-secondary" onclick="jQuery(this).next().slideToggle();return false;"><?php _e( 'Select Forms' , 'yikes-inc-easy-mailchimp-extender' ); ?></a>
23
+			<a class="toggle-custom-lists button-secondary" onclick="jQuery(this).next().slideToggle();return false;"><?php _e( 'Select Forms', 'yikes-inc-easy-mailchimp-extender' ); ?></a>
24 24
 			<ul class="export-custom-forms-list">
25
-				<p class="description"><?php _e( 'Select which forms to export. Leave all checkboxes unchecked to export all of your forms.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
26
-				<?php foreach( $all_forms as $id => $form ) { ?>
27
-					<li><label><input type="checkbox" name="yikes_export_forms[]" value="<?php echo (int) $id; ?>"><?php echo esc_html( $form['form_name'] ); ?></label></li>
25
+				<p class="description"><?php _e( 'Select which forms to export. Leave all checkboxes unchecked to export all of your forms.', 'yikes-inc-easy-mailchimp-extender' ); ?></p>
26
+				<?php foreach ( $all_forms as $id => $form ) { ?>
27
+					<li><label><input type="checkbox" name="yikes_export_forms[]" value="<?php echo (int) $id; ?>"><?php echo esc_html( $form[ 'form_name' ] ); ?></label></li>
28 28
 				<?php } ?>
29 29
 			</ul>
30 30
 		<?php } ?>
31 31
 		<!-- check if any of our transients contain data -->
32
-		<p><input type="submit" class="button-primary" value="<?php _e( 'Export Opt-in Forms' , 'yikes-inc-easy-mailchimp-extender' ); ?>" /></p>
32
+		<p><input type="submit" class="button-primary" value="<?php _e( 'Export Opt-in Forms', 'yikes-inc-easy-mailchimp-extender' ); ?>" /></p>
33 33
 	</form>
34 34
 	
35 35
 	<hr />
36 36
 	
37 37
 	<!-- Export Form -->
38
-	<form action="<?php echo esc_url_raw( add_query_arg( array( 'action' => 'yikes-easy-mc-export-settings' , 'nonce' => wp_create_nonce( 'export-settings' ) ) ) ); ?>" method="post">
39
-		<p><strong><?php _e( "Export Settings" , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></p>
38
+	<form action="<?php echo esc_url_raw( add_query_arg( array( 'action' => 'yikes-easy-mc-export-settings', 'nonce' => wp_create_nonce( 'export-settings' ) ) ) ); ?>" method="post">
39
+		<p><strong><?php _e( "Export Settings", 'yikes-inc-easy-mailchimp-extender' ); ?></strong></p>
40 40
 		<p class="description">
41
-			<?php _e( "Export YIKES Easy Forms for Mailchimp plugin settings." , 'yikes-inc-easy-mailchimp-extender' ); ?>
41
+			<?php _e( "Export YIKES Easy Forms for Mailchimp plugin settings.", 'yikes-inc-easy-mailchimp-extender' ); ?>
42 42
 		</p>
43 43
 
44 44
 		<!-- check if any of our transients contain data -->
45
-		<p><input type="submit" class="button-primary" value="<?php _e( 'Export Plugin Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?>" /></p>
45
+		<p><input type="submit" class="button-primary" value="<?php _e( 'Export Plugin Settings', 'yikes-inc-easy-mailchimp-extender' ); ?>" /></p>
46 46
 	</form>
47 47
 	
48 48
 	<hr />
49 49
 	
50 50
 	<!-- Import Form -->
51
-	<form action="<?php echo esc_url_raw( add_query_arg( array( 'action' => 'yikes-easy-mc-import-forms' , 'nonce' => wp_create_nonce( 'import-forms' ) ) ) ); ?>" method="post" enctype="multipart/form-data">
52
-		<p><strong><?php _e( "Import" , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></p>
51
+	<form action="<?php echo esc_url_raw( add_query_arg( array( 'action' => 'yikes-easy-mc-import-forms', 'nonce' => wp_create_nonce( 'import-forms' ) ) ) ); ?>" method="post" enctype="multipart/form-data">
52
+		<p><strong><?php _e( "Import", 'yikes-inc-easy-mailchimp-extender' ); ?></strong></p>
53 53
 		<p class="description">
54
-			<?php _e( "Select the Easy Forms for Mailchimp export file you would like to import. You can use this field to import your opt-in forms or settings. " , 'yikes-inc-easy-mailchimp-extender' ); ?>
54
+			<?php _e( "Select the Easy Forms for Mailchimp export file you would like to import. You can use this field to import your opt-in forms or settings. ", 'yikes-inc-easy-mailchimp-extender' ); ?>
55 55
 		</p>
56 56
 		<label>
57 57
 			<input type="file" name="csv" id="forms_to_import">
58 58
 		</label>
59 59
 		<!-- check if any of our transients contain data -->
60
-		<p><input type="submit" class="button-primary" value="<?php _e( 'Import' , 'yikes-inc-easy-mailchimp-extender' ); ?>" /></p>
60
+		<p><input type="submit" class="button-primary" value="<?php _e( 'Import', 'yikes-inc-easy-mailchimp-extender' ); ?>" /></p>
61 61
 	</form>
62 62
 	
63 63
 </div> <!-- .inside -->
Please login to merge, or discard this patch.
admin/partials/menu/options-sections/debug-settings.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
 	- php version, wp version, plugin version and debug log
5 5
 -->
6 6
 
7
-<h3><span><?php _e( 'Debug Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3>
7
+<h3><span><?php _e( 'Debug Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3>
8 8
 
9 9
 <div class="inside">
10 10
 	
@@ -13,10 +13,10 @@  discard block
 block discarded – undo
13 13
 	
14 14
 		<?php settings_fields( 'yikes_inc_easy_mc_debug_settings_page' ); ?>
15 15
 	
16
-		<label for="yikes-mailchimp-debug-status"><strong><?php _e( 'Enable Debugging' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
17
-			<input type="checkbox" name="yikes-mailchimp-debug-status" id="yikes-mailchimp-debug-status" value="1" <?php checked( get_option( 'yikes-mailchimp-debug-status' , '' ) , '1' ); ?>>
16
+		<label for="yikes-mailchimp-debug-status"><strong><?php _e( 'Enable Debugging', 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
17
+			<input type="checkbox" name="yikes-mailchimp-debug-status" id="yikes-mailchimp-debug-status" value="1" <?php checked( get_option( 'yikes-mailchimp-debug-status', '' ), '1' ); ?>>
18 18
 		</label>
19
-		<p class="description"><?php _e( "If you encounter an issue with Easy Forms for Mailchimp you can toggle on debugging to display advanced error messages and start logging errors." , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
19
+		<p class="description"><?php _e( "If you encounter an issue with Easy Forms for Mailchimp you can toggle on debugging to display advanced error messages and start logging errors.", 'yikes-inc-easy-mailchimp-extender' ); ?></p>
20 20
 		
21 21
 		<?php submit_button(); ?>
22 22
 									
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 				)
36 36
 			);
37 37
 		?>
38
-		<h2><?php _e( "Debug Log" , 'yikes-inc-easy-mailchimp-extender' ); ?> &nbsp; <a href="<?php echo $url; ?>" class="button-secondary"><?php _e( 'Clear Log', 'yikes-inc-easy-mailchimp-extender' ); ?></a></h2>
38
+		<h2><?php _e( "Debug Log", 'yikes-inc-easy-mailchimp-extender' ); ?> &nbsp; <a href="<?php echo $url; ?>" class="button-secondary"><?php _e( 'Clear Log', 'yikes-inc-easy-mailchimp-extender' ); ?></a></h2>
39 39
 		
40 40
 		<table class="widefat" id="yikes-mailchimp-error-log">
41 41
 			<!-- table header -->
Please login to merge, or discard this patch.
admin/partials/dashboard-widgets/class.list-activity-widget.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 	// Construction
10 10
 	public function __construct() {
11 11
 
12
-		if ( apply_filters( 'yikes-mailchimp-dashboard-widgets-enabled', true ) === true &&  yikes_get_mc_api_key() != '' && get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) == 'valid_api_key' ) {
12
+		if ( apply_filters( 'yikes-mailchimp-dashboard-widgets-enabled', true ) === true && yikes_get_mc_api_key() != '' && get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) == 'valid_api_key' ) {
13 13
 
14 14
 			// hook in and display our list stats dashboard widget
15 15
 			add_action( 'wp_dashboard_setup', array( $this, 'yks_mc_add_dashboard_widget' ), 10 );
@@ -54,8 +54,8 @@  discard block
 block discarded – undo
54 54
 
55 55
 			/* List Stats Dashboard Widget */
56 56
 			wp_add_dashboard_widget(
57
-				'yikes_easy_mc_list_stats_widget',         // Widget slug.
58
-				__( 'Mailchimp List Stats', 'yikes-inc-easy-mailchimp-extender' ),         // Title.
57
+				'yikes_easy_mc_list_stats_widget', // Widget slug.
58
+				__( 'Mailchimp List Stats', 'yikes-inc-easy-mailchimp-extender' ), // Title.
59 59
 				array( $this, 'list_stats_dashboard_widget' ) // Display function.
60 60
 			);
61 61
 		}
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 					<?php
88 88
 					foreach ( $list_data as $list ) {
89 89
 						?>
90
-						<option value="<?php echo $list['id']; ?>"><?php echo $list['name']; ?></option>
90
+						<option value="<?php echo $list[ 'id' ]; ?>"><?php echo $list[ 'name' ]; ?></option>
91 91
 						<?php
92 92
 					}
93 93
 					?>
Please login to merge, or discard this patch.
admin/partials/front-end-widgets/front-end-widget-form.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 			// Widget name will appear in UI
26 26
 			__( 'Easy Mailchimp Forms', 'yikes-inc-easy-mailchimp-extender' ),
27 27
 			// Widget description
28
-			array( 'description' => __( 'Mailchimp opt-in widget for your sidebar.', 'yikes-inc-easy-mailchimp-extender' ), )
28
+			array( 'description' => __( 'Mailchimp opt-in widget for your sidebar.', 'yikes-inc-easy-mailchimp-extender' ),)
29 29
 		);
30 30
 	}
31 31
 
@@ -39,10 +39,10 @@  discard block
 block discarded – undo
39 39
 		// Get all form IDs so we can use the first one as a default.
40 40
 		$form_ids = $this->form_interface->get_form_ids();
41 41
 
42
-		$title              = isset( $instance['title'] ) ? apply_filters( 'widget_title', $instance['title'] ) : __( 'Mailchimp Signup Form', 'yikes-inc-easy-mailchimp-extender' );
43
-		$form_id            = isset( $instance['form_id'] ) ? $instance['form_id'] : $form_ids[0];
44
-		$form_description   = isset( $instance['form_description'] ) ? $instance['form_description'] : '';
45
-		$submit_button_text = isset( $instance['submit_text'] ) ? $instance['submit_text'] : __( 'Submit', 'yikes-inc-easy-mailchimp-extender' );
42
+		$title              = isset( $instance[ 'title' ] ) ? apply_filters( 'widget_title', $instance[ 'title' ] ) : __( 'Mailchimp Signup Form', 'yikes-inc-easy-mailchimp-extender' );
43
+		$form_id            = isset( $instance[ 'form_id' ] ) ? $instance[ 'form_id' ] : $form_ids[ 0 ];
44
+		$form_description   = isset( $instance[ 'form_description' ] ) ? $instance[ 'form_description' ] : '';
45
+		$submit_button_text = isset( $instance[ 'submit_text' ] ) ? $instance[ 'submit_text' ] : __( 'Submit', 'yikes-inc-easy-mailchimp-extender' );
46 46
 
47 47
 		// Build our array based on settings chosen
48 48
 		$shortcode_attributes = array(
@@ -54,10 +54,10 @@  discard block
 block discarded – undo
54 54
 		$shortcode_attributes = apply_filters( 'yikes_mailchimp_widget_shortcode_attributes', $shortcode_attributes, $instance );
55 55
 
56 56
 		// before and after widget arguments are defined by themes
57
-		echo $args['before_widget'];
57
+		echo $args[ 'before_widget' ];
58 58
 
59 59
 		if ( ! empty( $title ) ) {
60
-			echo $args['before_title'] . $title . $args['after_title'];
60
+			echo $args[ 'before_title' ] . $title . $args[ 'after_title' ];
61 61
 		}
62 62
 
63 63
 		// Custom action hooks to place content in the widget before the form
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 		do_action( 'yikes-mailchimp-after-form-' . $form_id );
74 74
 		do_action( 'yikes-mailchimp-after-form' );
75 75
 
76
-		echo $args['after_widget'];
76
+		echo $args[ 'after_widget' ];
77 77
 	}
78 78
 
79 79
 	// Widget Backend 
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 		if ( empty( $all_forms ) ) {
84 84
 			?>
85 85
 				<section class="no-forms-widget">
86
-				<strong><span class="dashicons dashicons-no-alt no-forms-found-icon"></span><?php echo sprintf( __( 'No forms found. It looks like you need to <a href="%s" title="%s">%s</a>.', 'yikes-inc-easy-mailchimp-extender' ), esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ), __( 'Create a form' , 'yikes-inc-easy-mailchimp-extender' ), __( 'create a form' , 'yikes-inc-easy-mailchimp-extender' ) ); ?></strong>
86
+				<strong><span class="dashicons dashicons-no-alt no-forms-found-icon"></span><?php echo sprintf( __( 'No forms found. It looks like you need to <a href="%s" title="%s">%s</a>.', 'yikes-inc-easy-mailchimp-extender' ), esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ), __( 'Create a form', 'yikes-inc-easy-mailchimp-extender' ), __( 'create a form', 'yikes-inc-easy-mailchimp-extender' ) ); ?></strong>
87 87
 				</section>
88 88
 			<?php
89 89
 			return;
@@ -110,9 +110,9 @@  discard block
 block discarded – undo
110 110
 			$submit_text = __( 'Submit', 'yikes-inc-easy-mailchimp-extender' );
111 111
 		}
112 112
 
113
-		 if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) == 'invalid_api_key' ) {
113
+		 if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) == 'invalid_api_key' ) {
114 114
 			?>
115
-				<p class="enter-valid-api-error-widget"><strong><?php _e( 'Please enter a valid Mailchimp API key to connect your site to Mailchimp.' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></p>
115
+				<p class="enter-valid-api-error-widget"><strong><?php _e( 'Please enter a valid Mailchimp API key to connect your site to Mailchimp.', 'yikes-inc-easy-mailchimp-extender' ); ?></strong></p>
116 116
 			<?php
117 117
 			return;
118 118
 		}
@@ -129,9 +129,9 @@  discard block
 block discarded – undo
129 129
 			<select id="<?php echo $this->get_field_id( 'form_id' ); ?>" name="<?php echo $this->get_field_name( 'form_id' ); ?>" class="widefat">
130 130
 				<?php
131 131
 				// build our array
132
-				foreach( $all_forms as $id => $form ) {
132
+				foreach ( $all_forms as $id => $form ) {
133 133
 					?>
134
-						<option <?php selected( $selected_form , $id ); ?> name="<?php echo $this->get_field_name( 'form_id' ); ?>" value="<?php echo $id; ?>"><?php echo stripslashes( $form['form_name'] ); ?></option>
134
+						<option <?php selected( $selected_form, $id ); ?> name="<?php echo $this->get_field_name( 'form_id' ); ?>" value="<?php echo $id; ?>"><?php echo stripslashes( $form[ 'form_name' ] ); ?></option>
135 135
 					<?php
136 136
 				}
137 137
 				?>
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 
141 141
 		<p>
142 142
 			<label for="<?php echo $this->get_field_id( 'form_description' ); ?>"><?php _e( 'Display Form Description:' ); ?></label>
143
-			<input class="widefat" id="<?php echo $this->get_field_id( 'form_description' ); ?>" name="<?php echo $this->get_field_name( 'form_description' ); ?>" type="checkbox" value="1" <?php if( isset( $instance['form_description'] ) ) { checked( $instance['form_description'] , 1 ); } ?> />
143
+			<input class="widefat" id="<?php echo $this->get_field_id( 'form_description' ); ?>" name="<?php echo $this->get_field_name( 'form_description' ); ?>" type="checkbox" value="1" <?php if ( isset( $instance[ 'form_description' ] ) ) { checked( $instance[ 'form_description' ], 1 ); } ?> />
144 144
 		</p>
145 145
 
146 146
 		<p>
@@ -153,10 +153,10 @@  discard block
 block discarded – undo
153 153
 	// Updating widget replacing old instances with new
154 154
 	public function update( $new_instance, $old_instance ) {
155 155
 		$instance = array();
156
-		$instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : '';
157
-		$instance['form_id'] = $new_instance['form_id'];
158
-		$instance['form_description'] = isset( $new_instance['form_description'] ) ? '1' : '';
159
-		$instance['submit_text'] = ( ! empty( $new_instance['submit_text'] ) ) ? strip_tags( $new_instance['submit_text'] ) : 'Submit';
156
+		$instance[ 'title' ] = ( ! empty( $new_instance[ 'title' ] ) ) ? strip_tags( $new_instance[ 'title' ] ) : '';
157
+		$instance[ 'form_id' ] = $new_instance[ 'form_id' ];
158
+		$instance[ 'form_description' ] = isset( $new_instance[ 'form_description' ] ) ? '1' : '';
159
+		$instance[ 'submit_text' ] = ( ! empty( $new_instance[ 'submit_text' ] ) ) ? strip_tags( $new_instance[ 'submit_text' ] ) : 'Submit';
160 160
 		return $instance;
161 161
 	}
162 162
 	
Please login to merge, or discard this patch.
includes/third-party-integrations/visual-composer/visual-composer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -115,7 +115,7 @@
 block discarded – undo
115 115
 		if ( ! empty( $all_forms ) ) {
116 116
 			// build an array to pass to our javascript
117 117
 			foreach ( $all_forms as $id => $form ) {
118
-				$lists[ $form['form_name'] ] = $id;
118
+				$lists[ $form[ 'form_name' ] ] = $id;
119 119
 			}
120 120
 		} else {
121 121
 			$lists[ __( 'Please Import Some Mailchimp Lists', 'yikes-inc-easy-mailchimp-extender' ) ] = '-';
Please login to merge, or discard this patch.
public/classes/process/class.process_form_submission_handler.php 1 patch
Spacing   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -255,13 +255,13 @@  discard block
 block discarded – undo
255 255
 		$this->handle_updating_existing_user_link_message     = __( 'To update your Mailchimp profile, please click to send yourself an update link', 'yikes-inc-easy-mailchimp-extender' );
256 256
 		$this->handle_empty_required_field_message            = __( 'A required field is missing.', 'yikes-inc-easy-mailchimp-extender' );
257 257
 		$this->handle_empty_required_interest_group_message   = __( 'A required interest group is missing.', 'yikes-inc-easy-mailchimp-extender' );
258
-		$this->handle_nonce_message                           = __( 'Error: Sorry, the nonce security check didn\'t pass. Please reload the page and try again. You may want to try clearing your browser cache as a last attempt.' , 'yikes-inc-easy-mailchimp-extender' );
258
+		$this->handle_nonce_message                           = __( 'Error: Sorry, the nonce security check didn\'t pass. Please reload the page and try again. You may want to try clearing your browser cache as a last attempt.', 'yikes-inc-easy-mailchimp-extender' );
259 259
 		$this->handle_non_filled_recaptcha_message_message    = __( 'Please check the reCAPTCHA field.', 'yikes-inc-easy-mailchimp-extender' );
260 260
 		$this->generic_recaptcha_error_message                = __( 'Please refresh the page and try again.', 'yikes-inc-easy-mailchimp-extender' );
261 261
 
262 262
 		// Define our success messages
263
-		$this->default_response_single_optin_success_message  = __( 'Thank you for subscribing!' , 'yikes-inc-easy-mailchimp-extender' );
264
-		$this->default_response_double_optin_success_message  = __( 'Thank you for subscribing. Check your email for the confirmation message.' , 'yikes-inc-easy-mailchimp-extender' );
263
+		$this->default_response_single_optin_success_message  = __( 'Thank you for subscribing!', 'yikes-inc-easy-mailchimp-extender' );
264
+		$this->default_response_double_optin_success_message  = __( 'Thank you for subscribing. Check your email for the confirmation message.', 'yikes-inc-easy-mailchimp-extender' );
265 265
 		$this->existing_subscriber_profile_update_message     = __( 'Thank you for already being a subscriber! Your profile info has been updated.', 'yikes-inc-easy-mailchimp-extender' );
266 266
 	}
267 267
 
@@ -373,16 +373,16 @@  discard block
 block discarded – undo
373 373
 			}
374 374
 
375 375
 			// Check if the current iteration has a 'date_format' key set (i.e. date/birthday fields)
376
-			if ( isset( $form_fields[ $merge_tag ]['date_format'] ) ) {
377
-				$sanitized = $this->handle_date_format_merge_values( $sanitized, $form_fields[ $merge_tag ]['date_format'] );
376
+			if ( isset( $form_fields[ $merge_tag ][ 'date_format' ] ) ) {
377
+				$sanitized = $this->handle_date_format_merge_values( $sanitized, $form_fields[ $merge_tag ][ 'date_format' ] );
378 378
 			}
379 379
 
380 380
 			$merge_variables[ $merge_tag ] = $sanitized;
381 381
 		}
382 382
 
383 383
 		// Make sure we send the lower-cased, sanitized email so it matches the one we're sending in the body of the request.
384
-		if ( isset( $merge_variables['EMAIL'] ) ) {
385
-			$merge_variables['EMAIL'] = $this->email;
384
+		if ( isset( $merge_variables[ 'EMAIL' ] ) ) {
385
+			$merge_variables[ 'EMAIL' ] = $this->email;
386 386
 		}
387 387
 
388 388
 		/**
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
 		if ( count( $pieces ) === 3 ) {
460 460
 
461 461
 			// $pieces[1] = MM. $pieces[0] = DD. $date = MM/DD/YYYY
462
-			$date = $pieces[1] . '/' . $pieces[0] . '/' . $pieces[2];
462
+			$date = $pieces[ 1 ] . '/' . $pieces[ 0 ] . '/' . $pieces[ 2 ];
463 463
 		}
464 464
 
465 465
 		return $date;
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
 		if ( count( $pieces ) === 2 ) {
485 485
 
486 486
 			// $pieces[1] = MM. $pieces[0] = DD. $birthday = MM/DD
487
-			$birthday = $pieces[1] . '/' . $pieces[0];
487
+			$birthday = $pieces[ 1 ] . '/' . $pieces[ 0 ];
488 488
 		}
489 489
 
490 490
 		return $birthday;
@@ -517,12 +517,12 @@  discard block
 block discarded – undo
517 517
 			// Loop through the interest groups and create a single array like {group_id} => false
518 518
 			foreach ( $interest_groupings as $group_data ) {
519 519
 
520
-				if ( empty( $group_data['items'] ) || ! is_array( $group_data['items'] ) ) {
520
+				if ( empty( $group_data[ 'items' ] ) || ! is_array( $group_data[ 'items' ] ) ) {
521 521
 					continue;
522 522
 				}
523 523
 
524
-				foreach ( $group_data['items'] as $item ) {
525
-					$groups[ $item['id'] ] = false;
524
+				foreach ( $group_data[ 'items' ] as $item ) {
525
+					$groups[ $item[ 'id' ] ] = false;
526 526
 				}
527 527
 
528 528
 			}
@@ -635,7 +635,7 @@  discard block
 block discarded – undo
635 635
 		do_action( "yikes-mailchimp-form-submission-{$this->form_id}", $this->email, $merge_variables, $this->form_id, $notifications );
636 636
 
637 637
 		// Get the optin value
638
-		$optin = isset( $optin_settings['optin'] ) ? (int) $optin_settings['optin'] : 0;
638
+		$optin = isset( $optin_settings[ 'optin' ] ) ? (int) $optin_settings[ 'optin' ] : 0;
639 639
 
640 640
 		if ( 1 === $optin ) {
641 641
 
@@ -665,13 +665,13 @@  discard block
 block discarded – undo
665 665
 
666 666
 		// Construct our success array variables
667 667
 		$return_success_array = array(
668
-			'hide'        		=> $submission_settings['hide_form_post_signup'],
668
+			'hide'        		=> $submission_settings[ 'hide_form_post_signup' ],
669 669
 			'error'       		=> 0,
670 670
 			'response'    		=> $response_message,
671
-			'redirection' 		=> $redirect_array['redirection'],
672
-			'redirect'    		=> $redirect_array['redirect'],
673
-			'new_window' 		=> $redirect_array['new_window'],
674
-			'redirect_timer'	=> $redirect_array['redirect_timer'],
671
+			'redirection' 		=> $redirect_array[ 'redirection' ],
672
+			'redirect'    		=> $redirect_array[ 'redirect' ],
673
+			'new_window' 		=> $redirect_array[ 'new_window' ],
674
+			'redirect_timer'	=> $redirect_array[ 'redirect_timer' ],
675 675
 		);
676 676
 
677 677
 		// Return success array
@@ -693,12 +693,12 @@  discard block
 block discarded – undo
693 693
 		$details    = '';
694 694
 
695 695
 		// Loop through the error data and retrieve any fields and messages
696
-		if ( isset( $error_data['data'] ) ) {
697
-			foreach ( $error_data['data'] as $datum ) {
698
-				if ( ! isset( $datum['field'], $datum['message'] ) ) {
696
+		if ( isset( $error_data[ 'data' ] ) ) {
697
+			foreach ( $error_data[ 'data' ] as $datum ) {
698
+				if ( ! isset( $datum[ 'field' ], $datum[ 'message' ] ) ) {
699 699
 					continue;
700 700
 				}
701
-				$details .= sprintf( '<br>Error with %1$s field: <strong>%2$s</strong>', $form_fields[ $datum['field'] ]['label'], $datum['message'] );
701
+				$details .= sprintf( '<br>Error with %1$s field: <strong>%2$s</strong>', $form_fields[ $datum[ 'field' ] ][ 'label' ], $datum[ 'message' ] );
702 702
 			}
703 703
 		}
704 704
 
@@ -741,21 +741,21 @@  discard block
 block discarded – undo
741 741
 		$missing_fields = array();
742 742
 
743 743
 		// Loop through submitted form data
744
-		foreach( $data as $merge_tag => $value ) {
744
+		foreach ( $data as $merge_tag => $value ) {
745 745
 
746 746
 			// Skip interest groups
747
-			if ( isset( $form_fields[ $merge_tag ]['group_id'] ) ) {
747
+			if ( isset( $form_fields[ $merge_tag ][ 'group_id' ] ) ) {
748 748
 				continue;
749 749
 			}
750 750
 
751 751
 			// check if this field is required
752
-			if ( isset( $form_fields[ $merge_tag ] ) && isset( $form_fields[ $merge_tag ]['require'] ) && $form_fields[ $merge_tag ]['require'] === '1' ) {
752
+			if ( isset( $form_fields[ $merge_tag ] ) && isset( $form_fields[ $merge_tag ][ 'require' ] ) && $form_fields[ $merge_tag ][ 'require' ] === '1' ) {
753 753
 
754 754
 				// Check if the field(s) are empty
755 755
 				if ( is_array( $value ) ) {
756 756
 
757 757
 					// Loop through the data and check if any are empty
758
-					foreach( $value as $field => $val ) {
758
+					foreach ( $value as $field => $val ) {
759 759
 
760 760
 						/**
761 761
 						*	'yikes-mailchimp-ignore-required-array-field'
@@ -774,13 +774,13 @@  discard block
 block discarded – undo
774 774
 
775 775
 							// Set the merge label (e.g. MMERGE6) as the key so we don't get the same field multiple times
776 776
 							// (e.g. For arrays, like an address, where multiple address fields are empty)
777
-							$missing_fields[ $form_fields[ $merge_tag ]['merge'] ] = $form_fields[ $merge_tag ];
777
+							$missing_fields[ $form_fields[ $merge_tag ][ 'merge' ] ] = $form_fields[ $merge_tag ];
778 778
 						}
779 779
 					}
780 780
 
781 781
 				} else if ( empty( $value ) ) {
782 782
 					$field_is_missing = true;
783
-					$missing_fields[ $form_fields[ $merge_tag ]['merge'] ] = $form_fields[ $merge_tag ];
783
+					$missing_fields[ $form_fields[ $merge_tag ][ 'merge' ] ] = $form_fields[ $merge_tag ];
784 784
 				}
785 785
 			}
786 786
 		}
@@ -830,7 +830,7 @@  discard block
 block discarded – undo
830 830
 		foreach ( $form_fields as $merge_tag => $field_data ) {
831 831
 
832 832
 			// If an interest group and it's required
833
-			if ( isset( $field_data['group_id'] ) && isset( $field_data['require'] ) && $field_data['require'] === '1' ) {
833
+			if ( isset( $field_data[ 'group_id' ] ) && isset( $field_data[ 'require' ] ) && $field_data[ 'require' ] === '1' ) {
834 834
 				
835 835
 				// Check if it was submitted (meaning, check if it's set in our $data array)
836 836
 				if ( ! isset( $data[ 'group-' . $merge_tag ] ) ) {
@@ -892,30 +892,30 @@  discard block
 block discarded – undo
892 892
 		}
893 893
 
894 894
 		// Construct the API URL
895
-		$url           = esc_url_raw( 'https://www.google.com/recaptcha/api/siteverify?secret=' . get_option( 'yikes-mc-recaptcha-secret-key', '' ) . '&response=' . $recaptcha_response . '&remoteip=' . $_SERVER['REMOTE_ADDR'] );
895
+		$url           = esc_url_raw( 'https://www.google.com/recaptcha/api/siteverify?secret=' . get_option( 'yikes-mc-recaptcha-secret-key', '' ) . '&response=' . $recaptcha_response . '&remoteip=' . $_SERVER[ 'REMOTE_ADDR' ] );
896 896
 		$response      = wp_remote_get( $url );
897
-		$response_body = json_decode( $response['body'], true );
897
+		$response_body = json_decode( $response[ 'body' ], true );
898 898
 
899 899
 		// Set up errors array
900 900
 		$recaptcha_errors = array();
901 901
 
902 902
 		// if we've hit an error, lets return the error!
903
-		if ( true !== $response_body['success'] ) {
903
+		if ( true !== $response_body[ 'success' ] ) {
904 904
 
905
-			if( isset( $response_body['error-codes'] ) ) {
905
+			if ( isset( $response_body[ 'error-codes' ] ) ) {
906 906
 
907 907
 				// Loop through response error codes
908
-				foreach ( $response_body['error-codes'] as $error_code ) {
908
+				foreach ( $response_body[ 'error-codes' ] as $error_code ) {
909 909
 					if ( 'missing-input-response' === $error_code ) {
910 910
 						$error_code = $this->handle_non_filled_recaptcha_message;
911 911
 					}
912 912
 
913 913
 					// Add our error_code to the errors array
914
-					$recaptcha_errors[] = $error_code;
914
+					$recaptcha_errors[ ] = $error_code;
915 915
 				}
916 916
 
917 917
 			} else {
918
-				$recaptcha_errors[] = $this->generic_recaptcha_error_message;
918
+				$recaptcha_errors[ ] = $this->generic_recaptcha_error_message;
919 919
 			}
920 920
 
921 921
 			/**
@@ -1023,7 +1023,7 @@  discard block
 block discarded – undo
1023 1023
 	* @param array | $fields_array | An array of fields to loop through and make sure they're not null
1024 1024
 	*/
1025 1025
 	public function handle_empty_fields_generic( $fields_array ) {
1026
-		foreach( $fields_array as $field ) {
1026
+		foreach ( $fields_array as $field ) {
1027 1027
 			if ( $field === null ) {
1028 1028
 				return $this->yikes_fail( $hide = 0, $error = 1, $this->handle_empty_fields_generic_message );
1029 1029
 			}
@@ -1089,7 +1089,7 @@  discard block
 block discarded – undo
1089 1089
 
1090 1090
 		// Append our 'send-update-email' link and text
1091 1091
 		$response .= $link_start_tag;
1092
-		$response .= 	$this->handle_updating_existing_user_link_message;
1092
+		$response .= $this->handle_updating_existing_user_link_message;
1093 1093
 		$response .= $link_close_tag;
1094 1094
 
1095 1095
 		// Check for a user-defined message
@@ -1112,14 +1112,14 @@  discard block
 block discarded – undo
1112 1112
 	*/
1113 1113
 	protected function check_for_user_defined_response_message( $slug, $response_text, $data = false ) {
1114 1114
 
1115
-		switch( $slug ) {
1115
+		switch ( $slug ) {
1116 1116
 			case 'already-subscribed':
1117 1117
 
1118 1118
 				// Check if this error message exists
1119
-				if ( isset( $this->error_messages['already-subscribed'] ) && ! empty( $this->error_messages['already-subscribed'] ) ) {
1119
+				if ( isset( $this->error_messages[ 'already-subscribed' ] ) && ! empty( $this->error_messages[ 'already-subscribed' ] ) ) {
1120 1120
 
1121 1121
 					// Check if the substring (that we replace) '[email]' is located in the string and replace it
1122
-					$response_text = str_replace( '[email]', $this->email, $this->error_messages['already-subscribed'] );
1122
+					$response_text = str_replace( '[email]', $this->email, $this->error_messages[ 'already-subscribed' ] );
1123 1123
 				}
1124 1124
 
1125 1125
 				/**
@@ -1138,13 +1138,13 @@  discard block
 block discarded – undo
1138 1138
 			case 'update-link':
1139 1139
 
1140 1140
 				// Check if this error message exists
1141
-				if ( $data !== false && isset( $this->error_messages['update-link'] ) && ! empty( $this->error_messages['update-link'] ) ) {
1141
+				if ( $data !== false && isset( $this->error_messages[ 'update-link' ] ) && ! empty( $this->error_messages[ 'update-link' ] ) ) {
1142 1142
 
1143 1143
 					// Check if the substring (that we replace) '[link]' is located in the string and replace it
1144
-					$response_text = str_replace( '[link]', $data['link_start_tag'], $this->error_messages['update-link'] );
1144
+					$response_text = str_replace( '[link]', $data[ 'link_start_tag' ], $this->error_messages[ 'update-link' ] );
1145 1145
 
1146 1146
 					// Remove [/link]
1147
-					$response_text = str_replace( '[/link]', $data['link_close_tag'], $response_text );
1147
+					$response_text = str_replace( '[/link]', $data[ 'link_close_tag' ], $response_text );
1148 1148
 				}
1149 1149
 
1150 1150
 				/**
@@ -1163,8 +1163,8 @@  discard block
 block discarded – undo
1163 1163
 			case 'success':
1164 1164
 
1165 1165
 				// 'success' is the user-defined success message for double opt-in
1166
-				if ( isset( $this->error_messages['success'] ) && ! empty( $this->error_messages['success'] ) ) {
1167
-					$response_text = $this->error_messages['success'];
1166
+				if ( isset( $this->error_messages[ 'success' ] ) && ! empty( $this->error_messages[ 'success' ] ) ) {
1167
+					$response_text = $this->error_messages[ 'success' ];
1168 1168
 				}
1169 1169
 
1170 1170
 				/**
@@ -1183,8 +1183,8 @@  discard block
 block discarded – undo
1183 1183
 
1184 1184
 			case 'success-single-optin':
1185 1185
 
1186
-				if ( isset( $this->error_messages['success-single-optin'] ) && ! empty( $this->error_messages['success-single-optin'] ) ) {
1187
-					$response_text = $this->error_messages['success-single-optin'];
1186
+				if ( isset( $this->error_messages[ 'success-single-optin' ] ) && ! empty( $this->error_messages[ 'success-single-optin' ] ) ) {
1187
+					$response_text = $this->error_messages[ 'success-single-optin' ];
1188 1188
 				}
1189 1189
 
1190 1190
 				/**
@@ -1203,8 +1203,8 @@  discard block
 block discarded – undo
1203 1203
 
1204 1204
 			case 'success-resubscribed':
1205 1205
 
1206
-				if ( isset( $this->error_messages['success-resubscribed'] ) && ! empty( $this->error_messages['success-resubscribed'] ) ) {
1207
-					$response_text = $this->error_messages['success-resubscribed'];
1206
+				if ( isset( $this->error_messages[ 'success-resubscribed' ] ) && ! empty( $this->error_messages[ 'success-resubscribed' ] ) ) {
1207
+					$response_text = $this->error_messages[ 'success-resubscribed' ];
1208 1208
 				}
1209 1209
 
1210 1210
 				/**
@@ -1226,8 +1226,8 @@  discard block
 block discarded – undo
1226 1226
 				$original_response_text     = $response_text;
1227 1227
 				$user_defined_response_text = '';
1228 1228
 
1229
-				if ( isset( $this->error_messages['general-error'] ) && ! empty( $this->error_messages['general-error'] ) ) {
1230
-					$user_defined_response_text = $this->error_messages['general-error'];
1229
+				if ( isset( $this->error_messages[ 'general-error' ] ) && ! empty( $this->error_messages[ 'general-error' ] ) ) {
1230
+					$user_defined_response_text = $this->error_messages[ 'general-error' ];
1231 1231
 				}
1232 1232
 
1233 1233
 				/**
@@ -1289,7 +1289,7 @@  discard block
 block discarded – undo
1289 1289
 		} else {
1290 1290
 			global $process_submission_response;
1291 1291
 
1292
-			$process_submission_response = isset( $success_array['response'] ) ? $success_array['response'] : ''; // DEFAULT SUCCESS?
1292
+			$process_submission_response = isset( $success_array[ 'response' ] ) ? $success_array[ 'response' ] : ''; // DEFAULT SUCCESS?
1293 1293
 			$process_submission_response = $this->wrap_form_submission_response( $process_submission_response, $is_success = true );
1294 1294
 		}
1295 1295
 	}
@@ -1342,8 +1342,8 @@  discard block
 block discarded – undo
1342 1342
 		// Add additional fields we've been supplied
1343 1343
 		if ( ! empty( $additional_fields ) ) {
1344 1344
 
1345
-			foreach( $additional_fields as $key => $value ) {
1346
-				$response_array[$key] = $value;
1345
+			foreach ( $additional_fields as $key => $value ) {
1346
+				$response_array[ $key ] = $value;
1347 1347
 			}
1348 1348
 		}
1349 1349
 
@@ -1374,20 +1374,20 @@  discard block
 block discarded – undo
1374 1374
 		);
1375 1375
 
1376 1376
 		// Let's confirm we have a value before trying to use it
1377
-		$redirect_setting = isset( $submission_settings['redirect_on_submission'] ) ? $submission_settings['redirect_on_submission'] : false;
1377
+		$redirect_setting = isset( $submission_settings[ 'redirect_on_submission' ] ) ? $submission_settings[ 'redirect_on_submission' ] : false;
1378 1378
 
1379 1379
 		// Check the redirect flag
1380 1380
 		if ( '1' === $redirect_setting ) {
1381 1381
 
1382 1382
 			// Supply return array with default value of 1
1383
-			$redirect_array['redirection']	= apply_filters( 'yikes-mailchimp-redirection', 1, $form_id, $page_data );
1383
+			$redirect_array[ 'redirection' ] = apply_filters( 'yikes-mailchimp-redirection', 1, $form_id, $page_data );
1384 1384
 
1385 1385
 			// Let's confirm we have redirect_page/custom_redirect_url/new_window values
1386
-			$redirect_page_setting	 = isset( $submission_settings['redirect_page'] ) ? $submission_settings['redirect_page'] : false;
1387
-			$custom_redirect_setting = isset( $submission_settings['custom_redirect_url'] ) ? $submission_settings['custom_redirect_url'] : false;
1388
-			$redirect_new_window	 = isset( $submission_settings['redirect_new_window'] ) ? $submission_settings['redirect_new_window'] : false;
1386
+			$redirect_page_setting = isset( $submission_settings[ 'redirect_page' ] ) ? $submission_settings[ 'redirect_page' ] : false;
1387
+			$custom_redirect_setting = isset( $submission_settings[ 'custom_redirect_url' ] ) ? $submission_settings[ 'custom_redirect_url' ] : false;
1388
+			$redirect_new_window = isset( $submission_settings[ 'redirect_new_window' ] ) ? $submission_settings[ 'redirect_new_window' ] : false;
1389 1389
 
1390
-			$redirect_array['new_window'] = apply_filters( 'yikes-mailchimp-redirect-new-window', $redirect_new_window, $form_id, $page_data );
1390
+			$redirect_array[ 'new_window' ] = apply_filters( 'yikes-mailchimp-redirect-new-window', $redirect_new_window, $form_id, $page_data );
1391 1391
 
1392 1392
 			// Check if we're redirecting to a custom_url or just the redirect_page
1393 1393
 			$redirect_url = 'custom_url' !== $redirect_page_setting ? get_permalink( $redirect_page_setting ) : $custom_redirect_setting;
@@ -1412,9 +1412,9 @@  discard block
 block discarded – undo
1412 1412
 			*/
1413 1413
 			$redirect_timer = apply_filters( 'yikes-mailchimp-redirect-timer', $default_redirect_time_ms, $form_id, $page_data );
1414 1414
 
1415
-			$redirect_array['redirect_timer'] = $redirect_timer;
1415
+			$redirect_array[ 'redirect_timer' ] = $redirect_timer;
1416 1416
 
1417
-			$redirect_array['redirect'] = $redirect_url;
1417
+			$redirect_array[ 'redirect' ] = $redirect_url;
1418 1418
 		}
1419 1419
 
1420 1420
 		return $redirect_array;
@@ -1423,7 +1423,7 @@  discard block
 block discarded – undo
1423 1423
 	public function maybe_add_tags( $form_data, $subscriber_data ) {
1424 1424
 
1425 1425
 		// Add the form's tags
1426
-		$form_tags = isset( $form_data['tags'] ) ? $form_data['tags'] : array();
1426
+		$form_tags = isset( $form_data[ 'tags' ] ) ? $form_data[ 'tags' ] : array();
1427 1427
 		$form_tags = apply_filters( 'yikes_mailchimp_subscriber_tags', $form_tags, $form_data, $this->list_id, $subscriber_data );
1428 1428
 
1429 1429
 		if ( ! empty( $form_tags ) ) {
@@ -1432,7 +1432,7 @@  discard block
 block discarded – undo
1432 1432
 				$add_tag = apply_filters( 'yikes_mailchimp_subscriber_tag_active', true, $tag, $this->list_id, $subscriber_data );
1433 1433
 
1434 1434
 				if ( $add_tag ) {
1435
-					$list_handler->create_member_tags( $this->list_id, $tag['id'], array( 'email_address' => $this->email ) );
1435
+					$list_handler->create_member_tags( $this->list_id, $tag[ 'id' ], array( 'email_address' => $this->email ) );
1436 1436
 				}
1437 1437
 			}
1438 1438
 		}
Please login to merge, or discard this patch.
includes/api/class-yikes-inc-easy-mailchimp-api-abstract-items.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -79,8 +79,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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.
@@ -196,16 +196,16 @@  discard block
 block discarded – undo
196 196
 			return $response;
197 197
 		}
198 198
 
199
-		if ( isset( $response['error'] ) ) {
200
-			$title  = isset( $response['title'] )  ? $response['title']  : $response['name'];
201
-			$detail = isset( $response['detail'] ) ? $response['detail'] : $response['error'];
202
-			$data   = isset( $response['errors'] ) ? $response['errors'] : array();
199
+		if ( isset( $response[ 'error' ] ) ) {
200
+			$title  = isset( $response[ 'title' ] ) ? $response[ 'title' ] : $response[ 'name' ];
201
+			$detail = isset( $response[ 'detail' ] ) ? $response[ 'detail' ] : $response[ 'error' ];
202
+			$data   = isset( $response[ 'errors' ] ) ? $response[ 'errors' ] : array();
203 203
 
204 204
 			return new WP_Error(
205 205
 				$title,
206 206
 				$detail,
207 207
 				array(
208
-					'status' => (int) $response['status'],
208
+					'status' => (int) $response[ 'status' ],
209 209
 					'data'   => $data,
210 210
 				)
211 211
 			);
@@ -235,9 +235,9 @@  discard block
 block discarded – undo
235 235
 		// Mailchimp uses the application/problem+json type for errors.
236 236
 		$headers = wp_remote_retrieve_headers( $response );
237 237
 
238
-		if ( isset( $headers['content-type'] ) ) {
239
-			if ( false !== strpos( $headers['content-type'], 'application/problem+json' ) ) {
240
-				$body['error'] = true;
238
+		if ( isset( $headers[ 'content-type' ] ) ) {
239
+			if ( false !== strpos( $headers[ 'content-type' ], 'application/problem+json' ) ) {
240
+				$body[ 'error' ] = true;
241 241
 			}
242 242
 		}
243 243
 
Please login to merge, or discard this patch.