@@ -1,48 +1,48 @@ discard block |
||
1 | 1 | <?php |
2 | - $api_key = trim( get_option( 'yikes-mc-api-key' , '' ) ); |
|
2 | + $api_key = trim( get_option( 'yikes-mc-api-key', '' ) ); |
|
3 | 3 | $dash_position = strpos( $api_key, '-' ); |
4 | - if( $dash_position !== false ) { |
|
4 | + if ( $dash_position !== false ) { |
|
5 | 5 | $api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/interest-groupings.json'; |
6 | 6 | } |
7 | 7 | // get the interest group data |
8 | 8 | $interest_groupings = wp_remote_post( $api_endpoint, array( |
9 | 9 | 'body' => array( |
10 | 10 | 'apikey' => $api_key, |
11 | - 'id' => $form_data_array['list_id'] |
|
11 | + 'id' => $form_data_array[ 'list_id' ] |
|
12 | 12 | ), |
13 | 13 | 'timeout' => 10, |
14 | 14 | 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true ) |
15 | 15 | ) ); |
16 | 16 | $interest_groupings_body = json_decode( wp_remote_retrieve_body( $interest_groupings ), true ); |
17 | - if( ! is_wp_error( $interest_groupings_body ) ) { |
|
18 | - if( isset( $interest_groupings_body['error'] ) ) { |
|
19 | - if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) { |
|
17 | + if ( ! is_wp_error( $interest_groupings_body ) ) { |
|
18 | + if ( isset( $interest_groupings_body[ 'error' ] ) ) { |
|
19 | + if ( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) { |
|
20 | 20 | require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php'; |
21 | 21 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
22 | - $error_logging->yikes_easy_mailchimp_write_to_error_log( $interest_groupings_body['error'], __( "Get Interest Groups" , 'yikes-inc-easy-mailchimp-extender' ) , __( "Add Interest Group to Form" , 'yikes-inc-easy-mailchimp-extender' ) ); |
|
22 | + $error_logging->yikes_easy_mailchimp_write_to_error_log( $interest_groupings_body[ 'error' ], __( "Get Interest Groups", 'yikes-inc-easy-mailchimp-extender' ), __( "Add Interest Group to Form", 'yikes-inc-easy-mailchimp-extender' ) ); |
|
23 | 23 | } |
24 | 24 | ?> |
25 | 25 | <section class="draggable" id="error-container"> |
26 | - <p><span class="dashicons dashicons-no-alt"></span> <?php printf( __( 'Error: %s', 'yikes-inc-easy-mailchimp-extender' ), $interest_groupings_body['error'] ); ?></p> |
|
26 | + <p><span class="dashicons dashicons-no-alt"></span> <?php printf( __( 'Error: %s', 'yikes-inc-easy-mailchimp-extender' ), $interest_groupings_body[ 'error' ] ); ?></p> |
|
27 | 27 | </section> |
28 | 28 | <?php |
29 | 29 | return; |
30 | 30 | } |
31 | 31 | // find and return the location of this merge field in the array |
32 | - $index = $this->findMCListIndex( $form_data_array['group_id'], $interest_groupings_body, 'id' ); |
|
32 | + $index = $this->findMCListIndex( $form_data_array[ 'group_id' ], $interest_groupings_body, 'id' ); |
|
33 | 33 | // check for our index... |
34 | - if( isset( $index) ) { |
|
34 | + if ( isset( $index ) ) { |
|
35 | 35 | // store it and use it to pre-populate field data (only on initial add to form) |
36 | - $merge_field_data = $interest_groupings_body[$index]; |
|
36 | + $merge_field_data = $interest_groupings_body[ $index ]; |
|
37 | 37 | } |
38 | 38 | } |
39 | 39 | |
40 | 40 | ?> |
41 | -<section class="draggable" id="<?php echo $form_data_array['group_id']; ?>"> |
|
41 | +<section class="draggable" id="<?php echo $form_data_array[ 'group_id' ]; ?>"> |
|
42 | 42 | <!-- top --> |
43 | 43 | <a href="#" class="expansion-section-title settings-sidebar"> |
44 | - <span class="dashicons dashicons-plus" title="<?php _e( 'Expand Field' , 'yikes-inc-easy-mailchimp-extender' ); ?>"></span><?php echo stripslashes( $form_data_array['field_name'] ); ?> |
|
45 | - <span class="field-type-text"><small><?php echo __( 'type' , 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $form_data_array['field_type']; ?></small></span> |
|
44 | + <span class="dashicons dashicons-plus" title="<?php _e( 'Expand Field', 'yikes-inc-easy-mailchimp-extender' ); ?>"></span><?php echo stripslashes( $form_data_array[ 'field_name' ] ); ?> |
|
45 | + <span class="field-type-text"><small><?php echo __( 'type', 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $form_data_array[ 'field_type' ]; ?></small></span> |
|
46 | 46 | </a> |
47 | 47 | <!-- expansion section --> |
48 | 48 | <div class="yikes-mc-settings-expansion-section"> |
@@ -50,16 +50,16 @@ discard block |
||
50 | 50 | <!-- Single or Double Opt-in --> |
51 | 51 | <p class="type-container"><!-- necessary to prevent skipping on slideToggle(); --> |
52 | 52 | <!-- store the label --> |
53 | - <input type="hidden" name="field[<?php echo $form_data_array['group_id']; ?>][label]" value="<?php echo $form_data_array['field_name']; ?>" /> |
|
54 | - <input type="hidden" name="field[<?php echo $form_data_array['group_id']; ?>][type]" value="<?php echo $form_data_array['field_type']; ?>" /> |
|
55 | - <input type="hidden" name="field[<?php echo $form_data_array['group_id']; ?>][group_id]" value="<?php echo $form_data_array['group_id']; ?>" /> |
|
56 | - <input type="hidden" name="field[<?php echo $form_data_array['group_id']; ?>][groups]" value='<?php echo str_replace( '\'' , '~' , json_encode( $merge_field_data['groups'] ) ); ?>' /> |
|
53 | + <input type="hidden" name="field[<?php echo $form_data_array[ 'group_id' ]; ?>][label]" value="<?php echo $form_data_array[ 'field_name' ]; ?>" /> |
|
54 | + <input type="hidden" name="field[<?php echo $form_data_array[ 'group_id' ]; ?>][type]" value="<?php echo $form_data_array[ 'field_type' ]; ?>" /> |
|
55 | + <input type="hidden" name="field[<?php echo $form_data_array[ 'group_id' ]; ?>][group_id]" value="<?php echo $form_data_array[ 'group_id' ]; ?>" /> |
|
56 | + <input type="hidden" name="field[<?php echo $form_data_array[ 'group_id' ]; ?>][groups]" value='<?php echo str_replace( '\'', '~', json_encode( $merge_field_data[ 'groups' ] ) ); ?>' /> |
|
57 | 57 | |
58 | 58 | |
59 | 59 | <table class="form-table form-field-container"> |
60 | 60 | |
61 | 61 | <!-- Default Value --> |
62 | - <?php switch( $form_data_array['field_type'] ) { |
|
62 | + <?php switch ( $form_data_array[ 'field_type' ] ) { |
|
63 | 63 | |
64 | 64 | default: |
65 | 65 | case 'radio': |
@@ -67,19 +67,19 @@ discard block |
||
67 | 67 | <tr valign="top"> |
68 | 68 | <td scope="row"> |
69 | 69 | <label for="placeholder"> |
70 | - <?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
70 | + <?php _e( 'Default Selection', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
71 | 71 | </label> |
72 | 72 | </td> |
73 | 73 | <td> |
74 | - <?php $i = 0; foreach( $merge_field_data['groups'] as $interest_group ) { |
|
75 | - $pre_selected = !empty( $merge_field_data['default_choice'] ) ? $merge_field_data['default_choice'] : '0'; |
|
74 | + <?php $i = 0; foreach ( $merge_field_data[ 'groups' ] as $interest_group ) { |
|
75 | + $pre_selected = ! empty( $merge_field_data[ 'default_choice' ] ) ? $merge_field_data[ 'default_choice' ] : '0'; |
|
76 | 76 | ?> |
77 | - <input type="radio" name="field[<?php echo $form_data_array['group_id']; ?>][default_choice][]" value="<?php echo $i; ?>" <?php checked( $pre_selected , $i ); ?>><?php echo stripslashes( $interest_group['name'] ); ?> |
|
77 | + <input type="radio" name="field[<?php echo $form_data_array[ 'group_id' ]; ?>][default_choice][]" value="<?php echo $i; ?>" <?php checked( $pre_selected, $i ); ?>><?php echo stripslashes( $interest_group[ 'name' ] ); ?> |
|
78 | 78 | <?php |
79 | 79 | $i++; |
80 | 80 | } |
81 | 81 | ?> |
82 | - <p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' );?></small></p> |
|
82 | + <p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p> |
|
83 | 83 | </td> |
84 | 84 | </tr> |
85 | 85 | |
@@ -91,19 +91,19 @@ discard block |
||
91 | 91 | <tr valign="top"> |
92 | 92 | <td scope="row"> |
93 | 93 | <label for="placeholder"> |
94 | - <?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
94 | + <?php _e( 'Default Selection', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
95 | 95 | </label> |
96 | 96 | </td> |
97 | 97 | <td> |
98 | - <?php $i = 0; foreach( $merge_field_data['groups'] as $interest_group ) { |
|
99 | - $pre_selected = !empty( $merge_field_data['default_choice'] ) ? $merge_field_data['default_choice'] : '0'; |
|
98 | + <?php $i = 0; foreach ( $merge_field_data[ 'groups' ] as $interest_group ) { |
|
99 | + $pre_selected = ! empty( $merge_field_data[ 'default_choice' ] ) ? $merge_field_data[ 'default_choice' ] : '0'; |
|
100 | 100 | ?> |
101 | - <input type="checkbox" name="field[<?php echo $form_data_array['group_id']; ?>][default_choice][]" value="<?php echo $i; ?>" <?php checked( $pre_selected , $i ); ?>><?php echo stripslashes( $interest_group['name'] ); ?> |
|
101 | + <input type="checkbox" name="field[<?php echo $form_data_array[ 'group_id' ]; ?>][default_choice][]" value="<?php echo $i; ?>" <?php checked( $pre_selected, $i ); ?>><?php echo stripslashes( $interest_group[ 'name' ] ); ?> |
|
102 | 102 | <?php |
103 | 103 | $i++; |
104 | 104 | } |
105 | 105 | ?> |
106 | - <p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' );?></small></p> |
|
106 | + <p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p> |
|
107 | 107 | </td> |
108 | 108 | </tr> |
109 | 109 | |
@@ -115,18 +115,18 @@ discard block |
||
115 | 115 | <tr valign="top"> |
116 | 116 | <td scope="row"> |
117 | 117 | <label for="placeholder"> |
118 | - <?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
118 | + <?php _e( 'Default Selection', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
119 | 119 | </label> |
120 | 120 | </td> |
121 | 121 | <td> |
122 | - <select type="default" name="field[<?php echo $form_data_array['group_id']; ?>][default_choice]"> |
|
123 | - <?php $i = 0; foreach( $merge_field_data['groups'] as $interest_group ) { |
|
124 | - $pre_selected = !empty( $merge_field_data['default_choice'] ) ? $merge_field_data['default_choice'] : '0'; |
|
122 | + <select type="default" name="field[<?php echo $form_data_array[ 'group_id' ]; ?>][default_choice]"> |
|
123 | + <?php $i = 0; foreach ( $merge_field_data[ 'groups' ] as $interest_group ) { |
|
124 | + $pre_selected = ! empty( $merge_field_data[ 'default_choice' ] ) ? $merge_field_data[ 'default_choice' ] : '0'; |
|
125 | 125 | ?> |
126 | - <option value="<?php echo $i; ?>" <?php selected( $pre_selected , $i ); ?>><?php echo $interest_group['name']; ?></option> |
|
126 | + <option value="<?php echo $i; ?>" <?php selected( $pre_selected, $i ); ?>><?php echo $interest_group[ 'name' ]; ?></option> |
|
127 | 127 | <?php $i++; } ?> |
128 | 128 | </select> |
129 | - <p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' );?></small></p> |
|
129 | + <p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p> |
|
130 | 130 | </td> |
131 | 131 | </tr> |
132 | 132 | |
@@ -140,12 +140,12 @@ discard block |
||
140 | 140 | <tr valign="top"> |
141 | 141 | <td scope="row"> |
142 | 142 | <label for="placeholder"> |
143 | - <?php _e( 'Description' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
143 | + <?php _e( 'Description', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
144 | 144 | </label> |
145 | 145 | </td> |
146 | 146 | <td> |
147 | - <textarea class="widefat field-description-input" name="field[<?php echo $form_data_array['group_id']; ?>][description]"></textarea> |
|
148 | - <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> |
|
147 | + <textarea class="widefat field-description-input" name="field[<?php echo $form_data_array[ 'group_id' ]; ?>][description]"></textarea> |
|
148 | + <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> |
|
149 | 149 | </td> |
150 | 150 | </tr> |
151 | 151 | |
@@ -153,48 +153,48 @@ discard block |
||
153 | 153 | <tr valign="top"> |
154 | 154 | <td scope="row"> |
155 | 155 | <label for="placeholder"> |
156 | - <?php _e( 'Additional Classes' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
156 | + <?php _e( 'Additional Classes', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
157 | 157 | </label> |
158 | 158 | </td> |
159 | 159 | <td> |
160 | - <input type="text" class="widefat" name="field[<?php echo $form_data_array['group_id']; ?>][additional-classes]" value="<?php echo isset( $form_data_array['classes'] ) ? stripslashes( wp_strip_all_tags( $form_data_array['classes'] ) ) : '' ; ?>" /> |
|
161 | - <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> |
|
160 | + <input type="text" class="widefat" name="field[<?php echo $form_data_array[ 'group_id' ]; ?>][additional-classes]" value="<?php echo isset( $form_data_array[ 'classes' ] ) ? stripslashes( wp_strip_all_tags( $form_data_array[ 'classes' ] ) ) : ''; ?>" /> |
|
161 | + <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> |
|
162 | 162 | </td> |
163 | 163 | </tr> |
164 | 164 | <!-- Required Toggle --> |
165 | 165 | <tr valign="top"> |
166 | 166 | <td scope="row"> |
167 | 167 | <label for="field-required"> |
168 | - <?php _e( 'Field Required?' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
168 | + <?php _e( 'Field Required?', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
169 | 169 | </label> |
170 | 170 | </td> |
171 | 171 | <td> |
172 | - <input type="checkbox" class="widefat" value="1" name="field[<?php echo $form_data_array['group_id']; ?>][require]"> |
|
173 | - <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> |
|
172 | + <input type="checkbox" class="widefat" value="1" name="field[<?php echo $form_data_array[ 'group_id' ]; ?>][require]"> |
|
173 | + <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> |
|
174 | 174 | </td> |
175 | 175 | </tr> |
176 | 176 | <!-- Visible Toggle --> |
177 | 177 | <tr valign="top"> |
178 | 178 | <td scope="row"> |
179 | 179 | <label for="hide-field"> |
180 | - <?php _e( 'Hide Field' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
180 | + <?php _e( 'Hide Field', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
181 | 181 | </label> |
182 | 182 | </td> |
183 | 183 | <td> |
184 | - <input type="checkbox" class="widefat" value="1" name="field[<?php echo $form_data_array['group_id']; ?>][hide]"> |
|
185 | - <p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' );?></small></p> |
|
184 | + <input type="checkbox" class="widefat" value="1" name="field[<?php echo $form_data_array[ 'group_id' ]; ?>][hide]"> |
|
185 | + <p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p> |
|
186 | 186 | </td> |
187 | 187 | </tr> |
188 | 188 | <!-- Toggle Field Label Visibility --> |
189 | 189 | <tr valign="top"> |
190 | 190 | <td scope="row"> |
191 | 191 | <label for="placeholder"> |
192 | - <?php _e( 'Hide Label' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
192 | + <?php _e( 'Hide Label', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
193 | 193 | </label> |
194 | 194 | </td> |
195 | 195 | <td> |
196 | - <input type="checkbox" name="field[<?php echo $form_data_array['group_id']; ?>][hide-label]" value="1" /> |
|
197 | - <p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' );?></small></p> |
|
196 | + <input type="checkbox" name="field[<?php echo $form_data_array[ 'group_id' ]; ?>][hide-label]" value="1" /> |
|
197 | + <p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p> |
|
198 | 198 | </td> |
199 | 199 | </tr> |
200 | 200 | <!-- Toggle Buttons --> |
@@ -204,8 +204,8 @@ discard block |
||
204 | 204 | </td> |
205 | 205 | <td> |
206 | 206 | <span class="toggle-container"> |
207 | - <a href="#" class="hide-field"><?php _e( "Close" , 'yikes-inc-easy-mailchimp-extender' ); ?></a> | |
|
208 | - <a href="#" class="remove-field" alt="<?php echo $form_data_array['group_id']; ?>"><?php _e( "Remove Field" , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
207 | + <a href="#" class="hide-field"><?php _e( "Close", 'yikes-inc-easy-mailchimp-extender' ); ?></a> | |
|
208 | + <a href="#" class="remove-field" alt="<?php echo $form_data_array[ 'group_id' ]; ?>"><?php _e( "Remove Field", 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
209 | 209 | </span> |
210 | 210 | </td> |
211 | 211 | </tr> |
@@ -2,45 +2,45 @@ discard block |
||
2 | 2 | <?php |
3 | 3 | |
4 | 4 | // if an error was returned in the most recent query |
5 | - if( isset( $_GET['sql_error'] ) ) { |
|
5 | + if ( isset( $_GET[ 'sql_error' ] ) ) { |
|
6 | 6 | // if error logging is turned on, lets display a better error to help narrow things down |
7 | 7 | // lets also log things to the error log |
8 | - if( get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) { |
|
9 | - wp_die( '<strong>' . __( 'Error Creating Form' , 'yikes-inc-easy-mailchimp-extender' ) . '</strong> <p>' . stripslashes( urldecode( $_GET['sql_error'] ) ) . '</p>' , __( 'Error Creating Form' , 'yikes-inc-easy-mailchimp-extender' ) ); |
|
8 | + if ( get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) { |
|
9 | + wp_die( '<strong>' . __( 'Error Creating Form', 'yikes-inc-easy-mailchimp-extender' ) . '</strong> <p>' . stripslashes( urldecode( $_GET[ 'sql_error' ] ) ) . '</p>', __( 'Error Creating Form', 'yikes-inc-easy-mailchimp-extender' ) ); |
|
10 | 10 | } else { |
11 | - wp_die( '<strong>' . __( 'Error Creating Form' , 'yikes-inc-easy-mailchimp-extender' ) . '</strong><p>' . __( "Please try again. If the error persists please get in contact with the YIKES Inc. support team." , 'yikes-inc-easy-mailchimp-extender' ) . '</p>' ); |
|
11 | + wp_die( '<strong>' . __( 'Error Creating Form', 'yikes-inc-easy-mailchimp-extender' ) . '</strong><p>' . __( "Please try again. If the error persists please get in contact with the YIKES Inc. support team.", 'yikes-inc-easy-mailchimp-extender' ) . '</p>' ); |
|
12 | 12 | } |
13 | 13 | } |
14 | 14 | |
15 | 15 | /* Get The Form ID we need to edit */ |
16 | - if( isset( $_GET['id'] ) ) { |
|
16 | + if ( isset( $_GET[ 'id' ] ) ) { |
|
17 | 17 | global $wpdb; |
18 | 18 | // grab and store the form ID |
19 | - $form_id = (int) $_GET['id']; |
|
19 | + $form_id = (int) $_GET[ 'id' ]; |
|
20 | 20 | // return it as an array, so we can work with it to build our form below |
21 | 21 | $form_results = $wpdb->get_results( 'SELECT * FROM ' . $wpdb->prefix . 'yikes_easy_mc_forms WHERE id = ' . $form_id . '', ARRAY_A ); |
22 | 22 | // Get all results for our form switcher |
23 | 23 | $all_forms = $wpdb->get_results( 'SELECT * FROM ' . $wpdb->prefix . 'yikes_easy_mc_forms', ARRAY_A ); |
24 | 24 | |
25 | 25 | // if the form was not found return an error |
26 | - if( !$form_results ) { |
|
27 | - wp_die( printf( __( "Whoops! It looks like this form doesn't exist. If this error persists you may want to toggle on debugging on the <a href='%s'>%s</a> " , 'yikes-inc-easy-mailchimp-extender' ), esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings§ion=debug-settings' ) ), __( 'debug settings page' , 'yikes-inc-easy-mailchimp-extender' ) ), __( 'Error' , 'yikes-inc-easy-mailchimp-extender' ) ); |
|
26 | + if ( ! $form_results ) { |
|
27 | + wp_die( printf( __( "Whoops! It looks like this form doesn't exist. If this error persists you may want to toggle on debugging on the <a href='%s'>%s</a> ", 'yikes-inc-easy-mailchimp-extender' ), esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings§ion=debug-settings' ) ), __( 'debug settings page', 'yikes-inc-easy-mailchimp-extender' ) ), __( 'Error', 'yikes-inc-easy-mailchimp-extender' ) ); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | // store our results |
31 | - $form = $form_results[0]; |
|
31 | + $form = $form_results[ 0 ]; |
|
32 | 32 | // set global form data, mainly for use in custom form field declarations |
33 | - $GLOBALS["form_data"] = $form; |
|
33 | + $GLOBALS[ "form_data" ] = $form; |
|
34 | 34 | |
35 | - $custom_styles = json_decode( $form['custom_styles'] , true ); |
|
36 | - $optin_settings = json_decode( $form['optin_settings'] , true ); |
|
37 | - $submission_settings = json_decode( $form['submission_settings'] , true ); |
|
38 | - $error_messages = json_decode( $form['error_messages'] , true ); |
|
39 | - $form_settings = ( isset( $form['form_settings'] ) ) ? json_decode( $form['form_settings'] , true ) : false; |
|
40 | - $custom_notifications = json_decode( $form['custom_notifications'] , true ); |
|
35 | + $custom_styles = json_decode( $form[ 'custom_styles' ], true ); |
|
36 | + $optin_settings = json_decode( $form[ 'optin_settings' ], true ); |
|
37 | + $submission_settings = json_decode( $form[ 'submission_settings' ], true ); |
|
38 | + $error_messages = json_decode( $form[ 'error_messages' ], true ); |
|
39 | + $form_settings = ( isset( $form[ 'form_settings' ] ) ) ? json_decode( $form[ 'form_settings' ], true ) : false; |
|
40 | + $custom_notifications = json_decode( $form[ 'custom_notifications' ], true ); |
|
41 | 41 | |
42 | 42 | // get defaults if none are saved in the database yet |
43 | - if( ! isset( $form_settings ) || empty( $form_settings ) ) { |
|
43 | + if ( ! isset( $form_settings ) || empty( $form_settings ) ) { |
|
44 | 44 | // setup defaults if none are saved |
45 | 45 | $form_settings = array( |
46 | 46 | 'yikes-easy-mc-form-class-names' => '', |
@@ -52,19 +52,19 @@ discard block |
||
52 | 52 | 'yikes-easy-mc-form-schedule' => '0', |
53 | 53 | 'yikes-easy-mc-form-restriction-start' => strtotime( current_time( 'm/d/Y g:iA' ) ), // current date & time |
54 | 54 | 'yikes-easy-mc-form-restriction-end' => strtotime( current_time( 'm/d/Y g:iA' ) ) + ( 3600 * 24 ), // current date & time + 1 day |
55 | - 'yikes-easy-mc-form-restriction-pending-message' => sprintf( __( 'Signup is not yet open, and will be available on %s. Please come back then to signup.', 'yikes-inc-easy-mailchimp-extender' ), current_time( str_replace( '-', '/', get_option( 'date_format' ) ) ) . ' ' . __( 'at', 'yikes-inc-easy-mailchimp-extender' ) . ' ' . current_time( 'g:iA' ) ) , |
|
56 | - 'yikes-easy-mc-form-restriction-expired-message' => sprintf( __( 'This signup for this form ended on %s.', 'yikes-inc-easy-mailchimp-extender' ), date( str_replace( '-', '/', get_option( 'date_format' ) ), strtotime( current_time( str_replace( '-', '/', get_option( 'date_format' ) ) ) ) + ( 3600 * 24 ) ) . ' ' . __( 'at', 'yikes-inc-easy-mailchimp-extender' ) . ' ' . date( 'g:iA', strtotime( current_time( 'g:iA' ) ) + ( 3600 * 24 ) ) ) , |
|
55 | + 'yikes-easy-mc-form-restriction-pending-message' => sprintf( __( 'Signup is not yet open, and will be available on %s. Please come back then to signup.', 'yikes-inc-easy-mailchimp-extender' ), current_time( str_replace( '-', '/', get_option( 'date_format' ) ) ) . ' ' . __( 'at', 'yikes-inc-easy-mailchimp-extender' ) . ' ' . current_time( 'g:iA' ) ), |
|
56 | + 'yikes-easy-mc-form-restriction-expired-message' => sprintf( __( 'This signup for this form ended on %s.', 'yikes-inc-easy-mailchimp-extender' ), date( str_replace( '-', '/', get_option( 'date_format' ) ), strtotime( current_time( str_replace( '-', '/', get_option( 'date_format' ) ) ) ) + ( 3600 * 24 ) ) . ' ' . __( 'at', 'yikes-inc-easy-mailchimp-extender' ) . ' ' . date( 'g:iA', strtotime( current_time( 'g:iA' ) ) + ( 3600 * 24 ) ) ), |
|
57 | 57 | 'yikes-easy-mc-form-login-required' => '0', |
58 | 58 | 'yikes-easy-mc-form-restriction-login-message' => __( 'You need to be logged in to sign up for this mailing list.', 'yikes-inc-easy-mailchimp-extender' ), |
59 | 59 | ); |
60 | 60 | } |
61 | 61 | |
62 | - $api_key = trim( get_option( 'yikes-mc-api-key' , '' ) ); |
|
62 | + $api_key = trim( get_option( 'yikes-mc-api-key', '' ) ); |
|
63 | 63 | $dash_position = strpos( $api_key, '-' ); |
64 | 64 | |
65 | 65 | // Check for a transient, if not - set one up for one hour |
66 | 66 | if ( false === ( $list_data = get_transient( 'yikes-easy-mailchimp-list-data' ) ) ) { |
67 | - if( $dash_position !== false ) { |
|
67 | + if ( $dash_position !== false ) { |
|
68 | 68 | $api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/list.json'; |
69 | 69 | } |
70 | 70 | $list_data = wp_remote_post( $api_endpoint, array( |
@@ -76,11 +76,11 @@ discard block |
||
76 | 76 | 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true ) |
77 | 77 | ) ); |
78 | 78 | $list_data = json_decode( wp_remote_retrieve_body( $list_data ), true ); |
79 | - if( isset( $list_data['error'] ) ) { |
|
80 | - if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) { |
|
79 | + if ( isset( $list_data[ 'error' ] ) ) { |
|
80 | + if ( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) { |
|
81 | 81 | require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php'; |
82 | 82 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
83 | - $error_logging->yikes_easy_mailchimp_write_to_error_log( $list_data['error'], __( "Get Account Lists" , 'yikes-inc-easy-mailchimp-extender' ), "Edit Form Page" ); |
|
83 | + $error_logging->yikes_easy_mailchimp_write_to_error_log( $list_data[ 'error' ], __( "Get Account Lists", 'yikes-inc-easy-mailchimp-extender' ), "Edit Form Page" ); |
|
84 | 84 | } |
85 | 85 | } else { |
86 | 86 | // set our transient |
@@ -89,57 +89,57 @@ discard block |
||
89 | 89 | } |
90 | 90 | |
91 | 91 | // get the list data |
92 | - if( $dash_position !== false ) { |
|
92 | + if ( $dash_position !== false ) { |
|
93 | 93 | $api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/merge-vars.json'; |
94 | 94 | } |
95 | 95 | $available_merge_variables = wp_remote_post( $api_endpoint, array( |
96 | 96 | 'body' => array( |
97 | 97 | 'apikey' => $api_key, |
98 | - 'id' => array( $form['list_id'] ), |
|
98 | + 'id' => array( $form[ 'list_id' ] ), |
|
99 | 99 | ), |
100 | 100 | 'timeout' => 10, |
101 | 101 | 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true ) |
102 | 102 | ) ); |
103 | 103 | $available_merge_variables = json_decode( wp_remote_retrieve_body( $available_merge_variables ), true ); |
104 | - if( isset( $available_merge_variables['error'] ) ) { |
|
105 | - if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) { |
|
104 | + if ( isset( $available_merge_variables[ 'error' ] ) ) { |
|
105 | + if ( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) { |
|
106 | 106 | require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php'; |
107 | 107 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
108 | - $error_logging->yikes_easy_mailchimp_write_to_error_log( $available_merge_variables['error'], __( "Get Merge Variables" , 'yikes-inc-easy-mailchimp-extender' ), "Edit Form Page" ); |
|
108 | + $error_logging->yikes_easy_mailchimp_write_to_error_log( $available_merge_variables[ 'error' ], __( "Get Merge Variables", 'yikes-inc-easy-mailchimp-extender' ), "Edit Form Page" ); |
|
109 | 109 | } |
110 | 110 | } |
111 | 111 | |
112 | 112 | // get the interest group data |
113 | - if( $dash_position !== false ) { |
|
113 | + if ( $dash_position !== false ) { |
|
114 | 114 | $api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/interest-groupings.json'; |
115 | 115 | } |
116 | 116 | $interest_groupings = wp_remote_post( $api_endpoint, array( |
117 | 117 | 'body' => array( |
118 | 118 | 'apikey' => $api_key, |
119 | - 'id' => $form['list_id'] |
|
119 | + 'id' => $form[ 'list_id' ] |
|
120 | 120 | ), |
121 | 121 | 'timeout' => 10, |
122 | 122 | 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true ) |
123 | 123 | ) ); |
124 | 124 | $interest_groupings = json_decode( wp_remote_retrieve_body( $interest_groupings ), true ); |
125 | - $no_interest_groupings = '<p class="description error-descripion">' . __( 'No Interest Groups Found' , 'yikes-inc-easy-mailchimp-extender' ) . '.</p>'; |
|
126 | - if( isset( $interest_groupings['error'] ) ) { |
|
127 | - if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) { |
|
125 | + $no_interest_groupings = '<p class="description error-descripion">' . __( 'No Interest Groups Found', 'yikes-inc-easy-mailchimp-extender' ) . '.</p>'; |
|
126 | + if ( isset( $interest_groupings[ 'error' ] ) ) { |
|
127 | + if ( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) { |
|
128 | 128 | require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php'; |
129 | 129 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
130 | - $error_logging->yikes_easy_mailchimp_write_to_error_log( $interest_groupings['error'], __( "Get Interest Groups" , 'yikes-inc-easy-mailchimp-extender' ), "Edit Form Page" ); |
|
130 | + $error_logging->yikes_easy_mailchimp_write_to_error_log( $interest_groupings[ 'error' ], __( "Get Interest Groups", 'yikes-inc-easy-mailchimp-extender' ), "Edit Form Page" ); |
|
131 | 131 | } |
132 | 132 | } |
133 | 133 | |
134 | 134 | |
135 | 135 | } else { |
136 | - wp_die( __( 'Oh No!' , 'yikes-inc-easy-mailchimp-extender' ) , __( 'Error' , 'yikes-inc-easy-mailchimp-extender' ) ); |
|
136 | + wp_die( __( 'Oh No!', 'yikes-inc-easy-mailchimp-extender' ), __( 'Error', 'yikes-inc-easy-mailchimp-extender' ) ); |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | /* Confirm we've retreived our form data */ |
140 | - if( empty( $form ) ) { |
|
140 | + if ( empty( $form ) ) { |
|
141 | 141 | |
142 | - wp_die( __( "We've encountered an error. Please try again. If the error persists, please contact support." , 'yikes-inc-easy-mailchimp-extender' ) , __( 'Error' , 'yikes-inc-easy-mailchimp-extender' ) ); |
|
142 | + wp_die( __( "We've encountered an error. Please try again. If the error persists, please contact support.", 'yikes-inc-easy-mailchimp-extender' ), __( 'Error', 'yikes-inc-easy-mailchimp-extender' ) ); |
|
143 | 143 | |
144 | 144 | } else { |
145 | 145 | |
@@ -149,22 +149,22 @@ discard block |
||
149 | 149 | add_query_arg( |
150 | 150 | array( |
151 | 151 | 'action' => 'yikes-easy-mc-update-form', |
152 | - 'nonce' => wp_create_nonce( 'update-mailchimp-form'.-$form['id'] ) |
|
152 | + 'nonce' => wp_create_nonce( 'update-mailchimp-form' . -$form[ 'id' ] ) |
|
153 | 153 | ) |
154 | 154 | ) |
155 | 155 | ); |
156 | 156 | /* Display Our Form */ |
157 | 157 | ?> |
158 | 158 | <!-- Freddie Logo --> |
159 | - <img src="<?php echo YIKES_MC_URL . 'includes/images/MailChimp_Assets/Freddie_60px.png'; ?>" alt="<?php __( 'Freddie - MailChimp Mascot' , 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-mc-freddie-logo" /> |
|
159 | + <img src="<?php echo YIKES_MC_URL . 'includes/images/MailChimp_Assets/Freddie_60px.png'; ?>" alt="<?php __( 'Freddie - MailChimp Mascot', 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-mc-freddie-logo" /> |
|
160 | 160 | |
161 | - <h1>YIKES Easy Forms for MailChimp | <?php echo __( 'Edit' , 'yikes-inc-easy-mailchimp-extender' ) . ' ' . $form['form_name']; ?></h1> |
|
161 | + <h1>YIKES Easy Forms for MailChimp | <?php echo __( 'Edit', 'yikes-inc-easy-mailchimp-extender' ) . ' ' . $form[ 'form_name' ]; ?></h1> |
|
162 | 162 | |
163 | 163 | <!-- Settings Page Description --> |
164 | - <p class="yikes-easy-mc-about-text about-text"><?php _e( 'Update this MailChimp form\'s fields, styles and settings below.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
164 | + <p class="yikes-easy-mc-about-text about-text"><?php _e( 'Update this MailChimp form\'s fields, styles and settings below.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
165 | 165 | |
166 | 166 | <?php |
167 | - if( isset( $_REQUEST['updated-form'] ) && $_REQUEST['updated-form'] == 'true' ) { |
|
167 | + if ( isset( $_REQUEST[ 'updated-form' ] ) && $_REQUEST[ 'updated-form' ] == 'true' ) { |
|
168 | 168 | ?> |
169 | 169 | <div class="updated manage-form-admin-notice"> |
170 | 170 | <p><?php _e( 'Opt-in form successfully updated.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
@@ -188,15 +188,15 @@ discard block |
||
188 | 188 | <div class="inside"> |
189 | 189 | |
190 | 190 | <label for="form-name"> |
191 | - <h3 class="bg-transparent"><?php _e( 'Form Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
192 | - <input autocomplete="disabled" id="form-name" name="form-name" type="text" value="<?php echo stripslashes( esc_html( $form['form_name'] ) ); ?>" class="widefat" /> |
|
193 | - <p class="description"><?php _e( "The title of this signup form." , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
191 | + <h3 class="bg-transparent"><?php _e( 'Form Name', 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
192 | + <input autocomplete="disabled" id="form-name" name="form-name" type="text" value="<?php echo stripslashes( esc_html( $form[ 'form_name' ] ) ); ?>" class="widefat" /> |
|
193 | + <p class="description"><?php _e( "The title of this signup form.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
194 | 194 | </label> |
195 | 195 | |
196 | 196 | <label for="form-description"> |
197 | - <h3 class="bg-transparent"><?php _e( 'Form Description' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
198 | - <textarea name="form-description" id="form-description" class="large-text edit-form-form-description"><?php echo isset( $form['form_description'] ) ? stripslashes( esc_textarea( $form['form_description'] ) ) : ''; ?></textarea> |
|
199 | - <p class="description"><?php _e( "Descriptions are optional and you may choose to display it to visitors to your site." , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
197 | + <h3 class="bg-transparent"><?php _e( 'Form Description', 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
198 | + <textarea name="form-description" id="form-description" class="large-text edit-form-form-description"><?php echo isset( $form[ 'form_description' ] ) ? stripslashes( esc_textarea( $form[ 'form_description' ] ) ) : ''; ?></textarea> |
|
199 | + <p class="description"><?php _e( "Descriptions are optional and you may choose to display it to visitors to your site.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
200 | 200 | <p class="description"><?php printf( __( 'To display the number of subscribers for the list associated with this form, use %s in the form description field above.', 'yikes-inc-easy-mailchimp-extender' ), '<code>[yikes-mailchimp-subscriber-count]</code>' ); ?><p> |
201 | 201 | </label> |
202 | 202 | |
@@ -212,16 +212,16 @@ discard block |
||
212 | 212 | |
213 | 213 | <ul id="yikes_easy_mc_toolbar_links"> |
214 | 214 | <li class="hidden_setting_list"> |
215 | - <a class="hidden_setting form-builder selected_hidden_setting" data-attr-container="form-builder" onclick="return false;" title="<?php esc_attr_e( 'Customize Form Fields' , 'yikes-inc-easy-mailchimp-extender' ); ?>" href="#"> <?php _e( 'Form Builder' , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
215 | + <a class="hidden_setting form-builder selected_hidden_setting" data-attr-container="form-builder" onclick="return false;" title="<?php esc_attr_e( 'Customize Form Fields', 'yikes-inc-easy-mailchimp-extender' ); ?>" href="#"> <?php _e( 'Form Builder', 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
216 | 216 | <div class="selected_setting_triangle"></div> |
217 | 217 | </li> |
218 | 218 | <li class="hidden_setting_list"> |
219 | - <a class="hidden_setting form-settings" onclick="return false;" data-attr-container="form-settings" title="<?php esc_attr_e( 'Form Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?>" href="#"> <?php _e( 'Form Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
219 | + <a class="hidden_setting form-settings" onclick="return false;" data-attr-container="form-settings" title="<?php esc_attr_e( 'Form Settings', 'yikes-inc-easy-mailchimp-extender' ); ?>" href="#"> <?php _e( 'Form Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
220 | 220 | </li> |
221 | 221 | <li class="hidden_setting_list"> |
222 | - <a class="hidden_setting error-messages" onclick="return false;" data-attr-container="error-messages" title="<?php esc_attr_e( 'Customize Form Messages' , 'yikes-inc-easy-mailchimp-extender' ); ?>" href="#"> <?php _e( 'Custom Messages' , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
222 | + <a class="hidden_setting error-messages" onclick="return false;" data-attr-container="error-messages" title="<?php esc_attr_e( 'Customize Form Messages', 'yikes-inc-easy-mailchimp-extender' ); ?>" href="#"> <?php _e( 'Custom Messages', 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
223 | 223 | </li> |
224 | - <?php do_action( 'yikes-mailchimp-edit-form-section-links' , $form ); ?> |
|
224 | + <?php do_action( 'yikes-mailchimp-edit-form-section-links', $form ); ?> |
|
225 | 225 | </ul> |
226 | 226 | |
227 | 227 | </div> |
@@ -242,22 +242,22 @@ discard block |
||
242 | 242 | <div class="meta-box-sortables ui-sortable"> |
243 | 243 | <div class="postbox yikes-easy-mc-postbox"> |
244 | 244 | <!-- container title --> |
245 | - <h3 class="edit-form-title"><?php _e( 'Form Builder' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
246 | - <p id="edit-form-description" class="description"><?php _e( 'Select fields from the right to add to this form, you can click a field to reveal advanced options, or drag it to re-arrange its position in the form.' , 'yikes-inc-easy-mailchimp-extender' );?></p> |
|
245 | + <h3 class="edit-form-title"><?php _e( 'Form Builder', 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
246 | + <p id="edit-form-description" class="description"><?php _e( 'Select fields from the right to add to this form, you can click a field to reveal advanced options, or drag it to re-arrange its position in the form.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
247 | 247 | <div id="form-builder-container" class="inside"> |
248 | 248 | <!-- #poststuff --> |
249 | - <?php echo $this->generate_form_editor( json_decode( $form['fields'] , true ) , $form['list_id'] , $available_merge_variables , isset( $interest_groupings ) ? $interest_groupings : array() ); ?> |
|
249 | + <?php echo $this->generate_form_editor( json_decode( $form[ 'fields' ], true ), $form[ 'list_id' ], $available_merge_variables, isset( $interest_groupings ) ? $interest_groupings : array() ); ?> |
|
250 | 250 | </div> |
251 | 251 | |
252 | 252 | <!-- Bulk Delete Form Fields --> |
253 | - <a href="#" class="clear-form-fields" <?php if( isset( $form['fields'] ) && count( json_decode( $form['fields'] , true ) ) <= 0 ) { ?> style="display:none;" <?php } ?>><?php _e( 'Clear Form Fields', 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
253 | + <a href="#" class="clear-form-fields" <?php if ( isset( $form[ 'fields' ] ) && count( json_decode( $form[ 'fields' ], true ) ) <= 0 ) { ?> style="display:none;" <?php } ?>><?php _e( 'Clear Form Fields', 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
254 | 254 | |
255 | 255 | <?php |
256 | - $display_none = ( isset( $form['fields'] ) && count( json_decode( $form['fields'] , true ) ) <= 0 ) ? 'display:none;' : ''; |
|
256 | + $display_none = ( isset( $form[ 'fields' ] ) && count( json_decode( $form[ 'fields' ], true ) ) <= 0 ) ? 'display:none;' : ''; |
|
257 | 257 | ?> |
258 | 258 | |
259 | 259 | <!-- Save Fields Button --> |
260 | - <?php echo submit_button( __( 'Update Form' ) , 'primary' , '' , false , array( 'onclick' => '', 'style' => 'float:right;margin-right:12px;'.$display_none ) ); ?> |
|
260 | + <?php echo submit_button( __( 'Update Form' ), 'primary', '', false, array( 'onclick' => '', 'style' => 'float:right;margin-right:12px;' . $display_none ) ); ?> |
|
261 | 261 | |
262 | 262 | <!-- .inside --> |
263 | 263 | </div> |
@@ -270,15 +270,15 @@ discard block |
||
270 | 270 | <div id="postbox-container-1" class="postbox-container"> |
271 | 271 | <div class="meta-box-sortables"> |
272 | 272 | <div class="postbox yikes-easy-mc-postbox"> |
273 | - <h3 class="edit-form-title"><span><?php _e( "Form Fields & Interest Groups" , 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3> |
|
273 | + <h3 class="edit-form-title"><span><?php _e( "Form Fields & Interest Groups", 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3> |
|
274 | 274 | <div class="inside"> |
275 | 275 | |
276 | 276 | <h3 class="nav-tab-wrapper mv_ig_list"> |
277 | - <a href="#" class="nav-tab nav-tab-active" alt="merge-variables"><div class="arrow-down"></div><?php _e( 'Form Fields' , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
278 | - <?php if( !isset( $merge_variable_error ) ) { ?> |
|
279 | - <a href="#" class="nav-tab"><?php _e( 'Interest Groups' , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
277 | + <a href="#" class="nav-tab nav-tab-active" alt="merge-variables"><div class="arrow-down"></div><?php _e( 'Form Fields', 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
278 | + <?php if ( ! isset( $merge_variable_error ) ) { ?> |
|
279 | + <a href="#" class="nav-tab"><?php _e( 'Interest Groups', 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
280 | 280 | <?php } else { ?> |
281 | - <a href="#" class="nav-tab no-interest-groups-found-message" disabled="disabled" title="<?php _e( "No Interest Groups Exist" , 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'Interest Groups' , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
281 | + <a href="#" class="nav-tab no-interest-groups-found-message" disabled="disabled" title="<?php _e( "No Interest Groups Exist", 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'Interest Groups', 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
282 | 282 | <?php } ?> |
283 | 283 | </h3> |
284 | 284 | |
@@ -286,11 +286,11 @@ discard block |
||
286 | 286 | |
287 | 287 | <div id="merge-variables-container" class="list-container"> |
288 | 288 | <?php |
289 | - if( ! isset( $merge_variable_error ) ) { |
|
289 | + if ( ! isset( $merge_variable_error ) ) { |
|
290 | 290 | // build a list of available merge variables, |
291 | 291 | // but exclude the ones already assigned to the form |
292 | - echo '<p class="description">' . __( "Select a field below to add to the form builder." , 'yikes-inc-easy-mailchimp-extender' ) . '</p>'; |
|
293 | - $this->build_available_merge_vars( json_decode( $form['fields'] , true ) , $available_merge_variables ); |
|
292 | + echo '<p class="description">' . __( "Select a field below to add to the form builder.", 'yikes-inc-easy-mailchimp-extender' ) . '</p>'; |
|
293 | + $this->build_available_merge_vars( json_decode( $form[ 'fields' ], true ), $available_merge_variables ); |
|
294 | 294 | } else { |
295 | 295 | echo $merge_variable_error; |
296 | 296 | } |
@@ -299,14 +299,14 @@ discard block |
||
299 | 299 | |
300 | 300 | <div id="interest-groups-container" class="list-container"> |
301 | 301 | <?php |
302 | - if( isset( $interest_groupings ) && ! isset( $interest_groupings['error'] ) ) { |
|
302 | + if ( isset( $interest_groupings ) && ! isset( $interest_groupings[ 'error' ] ) ) { |
|
303 | 303 | // build a list of available merge variables, |
304 | 304 | // but exclude the ones already assigned to the form |
305 | - echo '<p class="description">' . __( "Select an interest group below to add to the form builder." , 'yikes-inc-easy-mailchimp-extender' ) . '</p>'; |
|
305 | + echo '<p class="description">' . __( "Select an interest group below to add to the form builder.", 'yikes-inc-easy-mailchimp-extender' ) . '</p>'; |
|
306 | 306 | // $this->build_available_merge_vars( json_decode( $form['fields'] , true ) , $available_merge_variables ); |
307 | - $this->build_available_interest_groups( json_decode( $form['fields'] , true ) , $interest_groupings , $form['list_id'] ); |
|
307 | + $this->build_available_interest_groups( json_decode( $form[ 'fields' ], true ), $interest_groupings, $form[ 'list_id' ] ); |
|
308 | 308 | } else { |
309 | - echo '<p class="description">' . $interest_groupings['error'] . '</p>'; |
|
309 | + echo '<p class="description">' . $interest_groupings[ 'error' ] . '</p>'; |
|
310 | 310 | } |
311 | 311 | ?> |
312 | 312 | </div> |
@@ -339,19 +339,19 @@ discard block |
||
339 | 339 | <div id="post-body-content"> |
340 | 340 | <div class="meta-box-sortables ui-sortable"> |
341 | 341 | <div class="postbox yikes-easy-mc-postbox"> |
342 | - <h3 class="edit-form-title"><span><?php _e( "Additional Form Settings" , 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3> |
|
342 | + <h3 class="edit-form-title"><span><?php _e( "Additional Form Settings", 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3> |
|
343 | 343 | |
344 | 344 | <div class="inside form-settings-container"> |
345 | 345 | |
346 | - <p class="edit-form-description"><?php _e( "Adjust some additional form settings below." , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
346 | + <p class="edit-form-description"><?php _e( "Adjust some additional form settings below.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
347 | 347 | |
348 | 348 | <!-- begin form classes section --> |
349 | 349 | <strong class="section-title first"><?php _e( 'Overall Form Classes', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
350 | 350 | <section class="section-interior"> |
351 | 351 | |
352 | 352 | <!-- form classes --> |
353 | - <label for="yikes-easy-mc-form-class-names"><strong><?php _e( 'Form Classes' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
354 | - <input type="text" class="widefat" name="yikes-easy-mc-form-class-names" id="yikes-easy-mc-form-class-names" value="<?php echo $form_settings['yikes-easy-mc-form-class-names']; ?>" placeholder="<?php _e( 'Add additional classes to this opt-in form.', 'yikes-inc-easy-mailchimp-extender' ); ?>" > |
|
353 | + <label for="yikes-easy-mc-form-class-names"><strong><?php _e( 'Form Classes', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
354 | + <input type="text" class="widefat" name="yikes-easy-mc-form-class-names" id="yikes-easy-mc-form-class-names" value="<?php echo $form_settings[ 'yikes-easy-mc-form-class-names' ]; ?>" placeholder="<?php _e( 'Add additional classes to this opt-in form.', 'yikes-inc-easy-mailchimp-extender' ); ?>" > |
|
355 | 355 | <p class="description"><?php printf( __( 'Add additional class names to the %s element.', 'yikes-inc-easy-mailchimp-extender' ), '<code>' . htmlentities( '<form>' ) . '</code>' ); ?></p> |
356 | 356 | </label> |
357 | 357 | |
@@ -364,12 +364,12 @@ discard block |
||
364 | 364 | |
365 | 365 | <!-- setup the checked state here --> |
366 | 366 | <!-- inline form --> |
367 | - <strong><?php _e( 'Inline Form' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
367 | + <strong><?php _e( 'Inline Form', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
368 | 368 | <label class="inline-form-label"> |
369 | - <input type="radio" name="yikes-easy-mc-inline-form[]" value="1" <?php checked( $form_settings['yikes-easy-mc-inline-form'], '1' ); ?>/><?php _e( 'Enable', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
369 | + <input type="radio" name="yikes-easy-mc-inline-form[]" value="1" <?php checked( $form_settings[ 'yikes-easy-mc-inline-form' ], '1' ); ?>/><?php _e( 'Enable', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
370 | 370 | </label> |
371 | 371 | <label class="inline-form-label"> |
372 | - <input type="radio" name="yikes-easy-mc-inline-form[]" value="0" <?php checked( $form_settings['yikes-easy-mc-inline-form'], '0' ); ?> /><?php _e( 'Disable', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
372 | + <input type="radio" name="yikes-easy-mc-inline-form[]" value="0" <?php checked( $form_settings[ 'yikes-easy-mc-inline-form' ], '0' ); ?> /><?php _e( 'Disable', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
373 | 373 | </label> |
374 | 374 | <p class="description"><?php _e( 'Programatically setup this form so that all fields are on the same line.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
375 | 375 | <p class="description"><?php printf( __( 'If you are having issues with your theme not displaying the inline form properly, please see the following %s.', 'yikes-inc-easy-mailchimp-extender' ), '<a href="https://yikesplugins.com/support/knowledge-base/my-form-fields-are-not-fully-inline-after-enabling-the-inline-form-option-how-come/" target="_blank">' . __( 'knowledge base article', 'yikes-inc-easy-mailchimp-extender' ) . '</a>' ); ?></p> |
@@ -382,30 +382,30 @@ discard block |
||
382 | 382 | <section class="section-interior"> |
383 | 383 | |
384 | 384 | <!-- Submit button type --> |
385 | - <strong><?php _e( 'Submit Button Type' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
385 | + <strong><?php _e( 'Submit Button Type', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
386 | 386 | <label class="inline-form-label"> |
387 | - <input type="radio" onclick="toggle_nested_section( jQuery(this) );" name="yikes-easy-mc-submit-button-type[]" value="text" <?php checked( $form_settings['yikes-easy-mc-submit-button-type'], 'text' ); ?> /><?php _e( 'Text', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
387 | + <input type="radio" onclick="toggle_nested_section( jQuery(this) );" name="yikes-easy-mc-submit-button-type[]" value="text" <?php checked( $form_settings[ 'yikes-easy-mc-submit-button-type' ], 'text' ); ?> /><?php _e( 'Text', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
388 | 388 | </label> |
389 | 389 | <label class="inline-form-label"> |
390 | - <input type="radio" onclick="toggle_nested_section( jQuery(this) );" name="yikes-easy-mc-submit-button-type[]" value="image" <?php checked( $form_settings['yikes-easy-mc-submit-button-type'], 'image' ); ?> /><?php _e( 'Image', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
390 | + <input type="radio" onclick="toggle_nested_section( jQuery(this) );" name="yikes-easy-mc-submit-button-type[]" value="image" <?php checked( $form_settings[ 'yikes-easy-mc-submit-button-type' ], 'image' ); ?> /><?php _e( 'Image', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
391 | 391 | </label> |
392 | 392 | <p class="description"><?php _e( 'Select the submit button type for this form.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
393 | 393 | <!-- end submit button type --> |
394 | 394 | |
395 | 395 | <!-- Text submit button type --> |
396 | - <section class="submit-button-type-text nested-child<?php if( $form_settings['yikes-easy-mc-submit-button-type'] == 'image' ) { echo ' hidden'; } ?>"> |
|
396 | + <section class="submit-button-type-text nested-child<?php if ( $form_settings[ 'yikes-easy-mc-submit-button-type' ] == 'image' ) { echo ' hidden'; } ?>"> |
|
397 | 397 | <!-- submit button text --> |
398 | - <label for="yikes-easy-mc-submit-button-text"><strong><?php _e( 'Submit Button Text' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
399 | - <input type="text" class="widefat" name="yikes-easy-mc-submit-button-text" id="yikes-easy-mc-submit-button-text" value="<?php echo $form_settings['yikes-easy-mc-submit-button-text']; ?>" placeholder="<?php _e( 'Submit', 'yikes-inc-easy-mailchimp-extender' ); ?>"> |
|
398 | + <label for="yikes-easy-mc-submit-button-text"><strong><?php _e( 'Submit Button Text', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
399 | + <input type="text" class="widefat" name="yikes-easy-mc-submit-button-text" id="yikes-easy-mc-submit-button-text" value="<?php echo $form_settings[ 'yikes-easy-mc-submit-button-text' ]; ?>" placeholder="<?php _e( 'Submit', 'yikes-inc-easy-mailchimp-extender' ); ?>"> |
|
400 | 400 | <p class="description"><?php printf( __( 'Set the submit button text. Leaving this blank will default to %s.', 'yikes-inc-easy-mailchimp-extender' ), '"' . __( 'Submit', 'yikes-inc-easy-mailchimp-extender' ) . '"' ); ?></p> |
401 | 401 | </label> |
402 | 402 | </section> |
403 | 403 | <!-- end text submit button type --> |
404 | 404 | |
405 | 405 | <!-- Image submit button type --> |
406 | - <section class="submit-button-type-image nested-child<?php if( $form_settings['yikes-easy-mc-submit-button-type'] == 'text' ) { echo ' hidden'; } ?>"> |
|
407 | - <label for="yikes-easy-mc-submit-button-image"><strong><?php _e( 'Submit Button URL' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
408 | - <input type="text" class="widefat" name="yikes-easy-mc-submit-button-image" id="yikes-easy-mc-submit-button-image" value="<?php echo $form_settings['yikes-easy-mc-submit-button-image']; ?>" placeholder="<?php _e( 'http://', 'yikes-inc-easy-mailchimp-extender' ); ?>"> |
|
406 | + <section class="submit-button-type-image nested-child<?php if ( $form_settings[ 'yikes-easy-mc-submit-button-type' ] == 'text' ) { echo ' hidden'; } ?>"> |
|
407 | + <label for="yikes-easy-mc-submit-button-image"><strong><?php _e( 'Submit Button URL', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
408 | + <input type="text" class="widefat" name="yikes-easy-mc-submit-button-image" id="yikes-easy-mc-submit-button-image" value="<?php echo $form_settings[ 'yikes-easy-mc-submit-button-image' ]; ?>" placeholder="<?php _e( 'http://', 'yikes-inc-easy-mailchimp-extender' ); ?>"> |
|
409 | 409 | <p class="description"><?php _e( 'Enter the URL of an image you would like to use as the submit button for this form.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
410 | 410 | </label> |
411 | 411 | </section> |
@@ -413,8 +413,8 @@ discard block |
||
413 | 413 | |
414 | 414 | |
415 | 415 | <!-- submit button classes --> |
416 | - <label for="yikes-easy-mc-form-submit-button-classes"><strong style="float:left;"><?php _e( 'Submit Button Classes' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
417 | - <input type="text" class="widefat" name="yikes-easy-mc-submit-button-classes" id="yikes-easy-mc-submit-button-classes" value="<?php echo $form_settings['yikes-easy-mc-submit-button-classes']; ?>" placeholder="<?php _e( 'Add additional classes to this submit button.', 'yikes-inc-easy-mailchimp-extender' ); ?>" > |
|
416 | + <label for="yikes-easy-mc-form-submit-button-classes"><strong style="float:left;"><?php _e( 'Submit Button Classes', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
417 | + <input type="text" class="widefat" name="yikes-easy-mc-submit-button-classes" id="yikes-easy-mc-submit-button-classes" value="<?php echo $form_settings[ 'yikes-easy-mc-submit-button-classes' ]; ?>" placeholder="<?php _e( 'Add additional classes to this submit button.', 'yikes-inc-easy-mailchimp-extender' ); ?>" > |
|
418 | 418 | <p class="description"><?php _e( 'Add custom classes to the submit button.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
419 | 419 | </label> |
420 | 420 | <!-- end submit button classes --> |
@@ -427,45 +427,45 @@ discard block |
||
427 | 427 | <section class="section-interior"> |
428 | 428 | <!-- Schedule form --> |
429 | 429 | <label class="inline-form-label"> |
430 | - <input type="checkbox" onclick="toggle_nested_section( jQuery(this) );" name="yikes-easy-mc-form-schedule" value="1" <?php checked( $form_settings['yikes-easy-mc-form-schedule'], '1' ); ?>/><?php _e( 'Schedule Form', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
430 | + <input type="checkbox" onclick="toggle_nested_section( jQuery(this) );" name="yikes-easy-mc-form-schedule" value="1" <?php checked( $form_settings[ 'yikes-easy-mc-form-schedule' ], '1' ); ?>/><?php _e( 'Schedule Form', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
431 | 431 | </label> |
432 | 432 | <p class="description" style="margin-bottom:0;"><?php _e( 'Set a time period that this form should be active on your site. (mm/dd/yyyy)', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
433 | 433 | <p class="description" style="margin: 0 0 .5em 0;"><?php _e( 'Once the end date & time have passed, users will no longer be able to signup for your mailing list.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
434 | 434 | <!-- Start Date Limitation Nested --> |
435 | - <section class="date-restirction-section nested-child<?php if( $form_settings['yikes-easy-mc-form-schedule'] == '0' ) { echo ' hidden'; } ?>"> |
|
435 | + <section class="date-restirction-section nested-child<?php if ( $form_settings[ 'yikes-easy-mc-form-schedule' ] == '0' ) { echo ' hidden'; } ?>"> |
|
436 | 436 | <!-- Start Date --> |
437 | - <label for="yikes-easy-mc-form-restriction-start-date"><strong><?php _e( 'Start Date' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
438 | - <input type="text" class="date-picker" name="yikes-easy-mc-form-restriction-start-date" id="yikes-easy-mc-form-restriction-start-date" value="<?php echo date( $this->yikes_jQuery_datepicker_date_format( get_option( 'date_format' ) ), $form_settings['yikes-easy-mc-form-restriction-start'] ); ?>" > |
|
437 | + <label for="yikes-easy-mc-form-restriction-start-date"><strong><?php _e( 'Start Date', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
438 | + <input type="text" class="date-picker" name="yikes-easy-mc-form-restriction-start-date" id="yikes-easy-mc-form-restriction-start-date" value="<?php echo date( $this->yikes_jQuery_datepicker_date_format( get_option( 'date_format' ) ), $form_settings[ 'yikes-easy-mc-form-restriction-start' ] ); ?>" > |
|
439 | 439 | <?php _e( 'at', 'yikes-inc-easy-mailchimp-extender' ); ?> |
440 | 440 | </label> |
441 | 441 | |
442 | 442 | <!-- Start Time --> |
443 | - <label for="yikes-easy-mc-form-restriction-start-time"><strong><?php _e( 'Start Time' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
444 | - <input type="text" class="time-picker" name="yikes-easy-mc-form-restriction-start-time" id="yikes-easy-mc-form-restriction-start-time" value="<?php echo date( 'g:iA', $form_settings['yikes-easy-mc-form-restriction-start'] ); ?>" > |
|
443 | + <label for="yikes-easy-mc-form-restriction-start-time"><strong><?php _e( 'Start Time', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
444 | + <input type="text" class="time-picker" name="yikes-easy-mc-form-restriction-start-time" id="yikes-easy-mc-form-restriction-start-time" value="<?php echo date( 'g:iA', $form_settings[ 'yikes-easy-mc-form-restriction-start' ] ); ?>" > |
|
445 | 445 | </label> |
446 | 446 | <p class="description"><?php _e( 'Set the dates that this form should display on your site.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
447 | 447 | </section> |
448 | 448 | <!-- end Start Date Limitation Nested --> |
449 | 449 | |
450 | 450 | <!-- End Date Limitation Nested --> |
451 | - <section class="date-restirction-section nested-child<?php if( $form_settings['yikes-easy-mc-form-schedule'] == '0' ) { echo ' hidden'; } ?> last"> |
|
451 | + <section class="date-restirction-section nested-child<?php if ( $form_settings[ 'yikes-easy-mc-form-schedule' ] == '0' ) { echo ' hidden'; } ?> last"> |
|
452 | 452 | <!-- End Date --> |
453 | - <label for="yikes-easy-mc-form-restriction-end-date"><strong><?php _e( 'End Date' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
454 | - <input type="text" class="date-picker" name="yikes-easy-mc-form-restriction-end-date" id="yikes-easy-mc-form-restriction-end-date" value="<?php echo date( $this->yikes_jQuery_datepicker_date_format( get_option( 'date_format' ) ), $form_settings['yikes-easy-mc-form-restriction-end'] ); ?>" > |
|
453 | + <label for="yikes-easy-mc-form-restriction-end-date"><strong><?php _e( 'End Date', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
454 | + <input type="text" class="date-picker" name="yikes-easy-mc-form-restriction-end-date" id="yikes-easy-mc-form-restriction-end-date" value="<?php echo date( $this->yikes_jQuery_datepicker_date_format( get_option( 'date_format' ) ), $form_settings[ 'yikes-easy-mc-form-restriction-end' ] ); ?>" > |
|
455 | 455 | <?php _e( 'at', 'yikes-inc-easy-mailchimp-extender' ); ?> |
456 | 456 | </label> |
457 | 457 | |
458 | 458 | <!-- End Time --> |
459 | - <label for="yikes-easy-mc-form-restriction-end-time"><strong><?php _e( 'End Time' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
460 | - <input type="text" class="time-picker" name="yikes-easy-mc-form-restriction-end-time" id="yikes-easy-mc-form-restriction-end-time" value="<?php echo date( 'g:iA', $form_settings['yikes-easy-mc-form-restriction-end'] ); ?>" > |
|
459 | + <label for="yikes-easy-mc-form-restriction-end-time"><strong><?php _e( 'End Time', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
460 | + <input type="text" class="time-picker" name="yikes-easy-mc-form-restriction-end-time" id="yikes-easy-mc-form-restriction-end-time" value="<?php echo date( 'g:iA', $form_settings[ 'yikes-easy-mc-form-restriction-end' ] ); ?>" > |
|
461 | 461 | </label> |
462 | 462 | <p class="description"><?php _e( 'Set the dates that this form should no longer display on your site.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
463 | 463 | |
464 | 464 | <!-- Form pending message --> |
465 | - <label for="yikes-easy-mc-form-restriction-pending-message"><strong><?php _e( 'Pending Message' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
465 | + <label for="yikes-easy-mc-form-restriction-pending-message"><strong><?php _e( 'Pending Message', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
466 | 466 | <?php |
467 | 467 | wp_editor( |
468 | - $form_settings['yikes-easy-mc-form-restriction-pending-message'], |
|
468 | + $form_settings[ 'yikes-easy-mc-form-restriction-pending-message' ], |
|
469 | 469 | 'yikes-easy-mc-form-restriction-pending-message', |
470 | 470 | array( |
471 | 471 | 'editor_class' => 'yikes-easy-mc-form-restriction-pending-message', |
@@ -477,10 +477,10 @@ discard block |
||
477 | 477 | <p class="description"><?php _e( 'Set the message that should display prior to the form being active.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
478 | 478 | |
479 | 479 | <!-- form expired message --> |
480 | - <label for="yikes-easy-mc-form-restriction-expired-message"><strong><?php _e( 'Expired Message' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
480 | + <label for="yikes-easy-mc-form-restriction-expired-message"><strong><?php _e( 'Expired Message', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
481 | 481 | <?php |
482 | 482 | wp_editor( |
483 | - $form_settings['yikes-easy-mc-form-restriction-expired-message'], |
|
483 | + $form_settings[ 'yikes-easy-mc-form-restriction-expired-message' ], |
|
484 | 484 | 'yikes-easy-mc-form-restriction-expired-message', |
485 | 485 | array( |
486 | 486 | 'editor_class' => 'yikes-easy-mc-form-restriction-expired-message', |
@@ -495,16 +495,16 @@ discard block |
||
495 | 495 | |
496 | 496 | <!-- Require Users to be Logged In --> |
497 | 497 | <label class="inline-form-label"> |
498 | - <input type="checkbox" onclick="toggle_nested_section( jQuery(this) );" name="yikes-easy-mc-form-login-required" value="1" <?php checked( $form_settings['yikes-easy-mc-form-login-required'], '1' ); ?> /><?php _e( 'Require Login', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
498 | + <input type="checkbox" onclick="toggle_nested_section( jQuery(this) );" name="yikes-easy-mc-form-login-required" value="1" <?php checked( $form_settings[ 'yikes-easy-mc-form-login-required' ], '1' ); ?> /><?php _e( 'Require Login', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
499 | 499 | </label> |
500 | 500 | <p class="description"><?php _e( 'Require users to be logged in before they can view and submit this opt-in form.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
501 | 501 | |
502 | 502 | <!-- Require Login Message --> |
503 | - <section class="login-restirction-section nested-child<?php if( $form_settings['yikes-easy-mc-form-login-required'] == '0' ) { echo ' hidden'; } ?>"> |
|
504 | - <label for="yikes-easy-mc-form-restriction-login-message"><strong><?php _e( 'Required Login Message' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
503 | + <section class="login-restirction-section nested-child<?php if ( $form_settings[ 'yikes-easy-mc-form-login-required' ] == '0' ) { echo ' hidden'; } ?>"> |
|
504 | + <label for="yikes-easy-mc-form-restriction-login-message"><strong><?php _e( 'Required Login Message', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
505 | 505 | <?php |
506 | 506 | wp_editor( |
507 | - $form_settings['yikes-easy-mc-form-restriction-login-message'], |
|
507 | + $form_settings[ 'yikes-easy-mc-form-restriction-login-message' ], |
|
508 | 508 | 'yikes-easy-mc-form-restriction-login-message', |
509 | 509 | array( |
510 | 510 | 'editor_class' => 'yikes-easy-mc-form-restriction-login-message', |
@@ -533,14 +533,14 @@ discard block |
||
533 | 533 | <div id="postbox-container-1" class="postbox-container"> |
534 | 534 | <div class="meta-box-sortables"> |
535 | 535 | <div class="postbox yikes-easy-mc-postbox"> |
536 | - <h3 class="edit-form-title"><span><?php _e( "Form Settings Explained" , 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3> |
|
536 | + <h3 class="edit-form-title"><span><?php _e( "Form Settings Explained", 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3> |
|
537 | 537 | <div class="inside"> |
538 | 538 | |
539 | 539 | <ul> |
540 | - <li><strong><?php _e( 'Classes' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> : <?php _e( 'Add additional classes to this form, allowing you to target it more easily for customization via CSS.' , 'yikes-inc-easy-mailchimp-extender' ); ?></li> |
|
541 | - <li><strong><?php _e( 'Form Layout' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> : <?php _e( 'Toggle the layout of this form between single column and an inline layout. The inline layout places all of your form fields and the submit button on a single line.' , 'yikes-inc-easy-mailchimp-extender' ); ?></li> |
|
542 | - <li><strong><?php _e( 'Submit Button' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> : <?php _e( 'Adjust setting specific to the submit button. Change the submit button text, or set it to a specified image. Use the "Submit Button Classes" to assign additional classes to your submit button - ensuring it fits better into your theme.' , 'yikes-inc-easy-mailchimp-extender' ); ?></li> |
|
543 | - <li><strong><?php _e( 'Form Restrictions' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> : <?php _e( 'Adjust the restrictions for this form. Limit form visibility to a given time period, require users to be logged in to sign up or combine the two!' , 'yikes-inc-easy-mailchimp-extender' ); ?></li> |
|
540 | + <li><strong><?php _e( 'Classes', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> : <?php _e( 'Add additional classes to this form, allowing you to target it more easily for customization via CSS.', 'yikes-inc-easy-mailchimp-extender' ); ?></li> |
|
541 | + <li><strong><?php _e( 'Form Layout', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> : <?php _e( 'Toggle the layout of this form between single column and an inline layout. The inline layout places all of your form fields and the submit button on a single line.', 'yikes-inc-easy-mailchimp-extender' ); ?></li> |
|
542 | + <li><strong><?php _e( 'Submit Button', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> : <?php _e( 'Adjust setting specific to the submit button. Change the submit button text, or set it to a specified image. Use the "Submit Button Classes" to assign additional classes to your submit button - ensuring it fits better into your theme.', 'yikes-inc-easy-mailchimp-extender' ); ?></li> |
|
543 | + <li><strong><?php _e( 'Form Restrictions', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> : <?php _e( 'Adjust the restrictions for this form. Limit form visibility to a given time period, require users to be logged in to sign up or combine the two!', 'yikes-inc-easy-mailchimp-extender' ); ?></li> |
|
544 | 544 | </ul> |
545 | 545 | |
546 | 546 | </div> |
@@ -568,36 +568,36 @@ discard block |
||
568 | 568 | <div id="post-body-content"> |
569 | 569 | <div class="meta-box-sortables ui-sortable"> |
570 | 570 | <div class="postbox yikes-easy-mc-postbox"> |
571 | - <h3 class="edit-form-title"><span><?php _e( "Custom Messages" , 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3> |
|
571 | + <h3 class="edit-form-title"><span><?php _e( "Custom Messages", 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3> |
|
572 | 572 | |
573 | 573 | <div class="inside error-message-container"> |
574 | 574 | <?php |
575 | 575 | // build our default options |
576 | 576 | $error_message_array = array( |
577 | - 'success' => __( 'Thank You for subscribing! Check your email for the confirmation message.' , 'yikes-inc-easy-mailchimp-extender' ), |
|
578 | - 'general-error' => __( "Whoops! It looks like something went wrong. Please try again." , 'yikes-inc-easy-mailchimp-extender' ), |
|
579 | - 'invalid-email' => __( "Please provide a valid email address." , 'yikes-inc-easy-mailchimp-extender' ), |
|
580 | - 'email-exists-error' => __( "The provided email is already subscribed to this list." , 'yikes-inc-easy-mailchimp-extender' ) |
|
577 | + 'success' => __( 'Thank You for subscribing! Check your email for the confirmation message.', 'yikes-inc-easy-mailchimp-extender' ), |
|
578 | + 'general-error' => __( "Whoops! It looks like something went wrong. Please try again.", 'yikes-inc-easy-mailchimp-extender' ), |
|
579 | + 'invalid-email' => __( "Please provide a valid email address.", 'yikes-inc-easy-mailchimp-extender' ), |
|
580 | + 'email-exists-error' => __( "The provided email is already subscribed to this list.", 'yikes-inc-easy-mailchimp-extender' ) |
|
581 | 581 | ); |
582 | - $global_error_messages = get_option( 'yikes-easy-mc-global-error-messages' , $error_message_array ); |
|
582 | + $global_error_messages = get_option( 'yikes-easy-mc-global-error-messages', $error_message_array ); |
|
583 | 583 | ?> |
584 | - <p class="edit-form-description"><?php _e( "Enter your custom messages for this form below. Leave the field blank to use the default global error message." , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
584 | + <p class="edit-form-description"><?php _e( "Enter your custom messages for this form below. Leave the field blank to use the default global error message.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
585 | 585 | |
586 | 586 | <!-- Success Message --> |
587 | - <label for="yikes-easy-mc-success-message"><strong><?php _e( 'Success Message' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
588 | - <input type="text" class="widefat" name="yikes-easy-mc-success-message" id="yikes-easy-mc-success-message" value="<?php echo isset( $error_messages['success'] ) ? stripslashes( esc_html( $error_messages['success'] ) ) : ''; ?>" placeholder="<?php echo $global_error_messages['success']; ?>" > |
|
587 | + <label for="yikes-easy-mc-success-message"><strong><?php _e( 'Success Message', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
588 | + <input type="text" class="widefat" name="yikes-easy-mc-success-message" id="yikes-easy-mc-success-message" value="<?php echo isset( $error_messages[ 'success' ] ) ? stripslashes( esc_html( $error_messages[ 'success' ] ) ) : ''; ?>" placeholder="<?php echo $global_error_messages[ 'success' ]; ?>" > |
|
589 | 589 | </label> |
590 | 590 | <!-- General Error Message --> |
591 | - <label for="yikes-easy-mc-general-error-message"><strong><?php _e( 'General Error Message' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
592 | - <input type="text" class="widefat" name="yikes-easy-mc-general-error-message" id="yikes-easy-mc-general-error-message" value="<?php echo isset( $error_messages['general-error'] ) ? stripslashes( esc_html( $error_messages['general-error'] ) ) : ''; ?>" placeholder="<?php echo $global_error_messages['general-error']; ?>" > |
|
591 | + <label for="yikes-easy-mc-general-error-message"><strong><?php _e( 'General Error Message', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
592 | + <input type="text" class="widefat" name="yikes-easy-mc-general-error-message" id="yikes-easy-mc-general-error-message" value="<?php echo isset( $error_messages[ 'general-error' ] ) ? stripslashes( esc_html( $error_messages[ 'general-error' ] ) ) : ''; ?>" placeholder="<?php echo $global_error_messages[ 'general-error' ]; ?>" > |
|
593 | 593 | </label> |
594 | 594 | <!-- Invalid Email Address Message --> |
595 | - <label for="yikes-easy-mc-invalid-email-message"><strong><?php _e( 'Invalid Email' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
596 | - <input type="text" class="widefat" name="yikes-easy-mc-invalid-email-message" id="yikes-easy-mc-invalid-email-message" value="<?php echo isset( $error_messages['invalid-email'] ) ? stripslashes( esc_html( $error_messages['invalid-email'] ) ) : ''; ?>" placeholder="<?php echo $global_error_messages['invalid-email']; ?>"> |
|
595 | + <label for="yikes-easy-mc-invalid-email-message"><strong><?php _e( 'Invalid Email', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
596 | + <input type="text" class="widefat" name="yikes-easy-mc-invalid-email-message" id="yikes-easy-mc-invalid-email-message" value="<?php echo isset( $error_messages[ 'invalid-email' ] ) ? stripslashes( esc_html( $error_messages[ 'invalid-email' ] ) ) : ''; ?>" placeholder="<?php echo $global_error_messages[ 'invalid-email' ]; ?>"> |
|
597 | 597 | </label> |
598 | 598 | <!-- Email Address is already subscribed --> |
599 | - <label for="yikes-easy-mc-user-subscribed-message"><strong><?php _e( 'Email Already Subscribed' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
600 | - <input type="text" class="widefat" name="yikes-easy-mc-user-subscribed-message" id="yikes-easy-mc-user-subscribed-message" value="<?php echo isset( $error_messages['already-subscribed'] ) ? stripslashes( esc_html( $error_messages['already-subscribed'] ) ) : ''; ?>" placeholder="<?php echo $global_error_messages['email-exists-error']; ?>"> |
|
599 | + <label for="yikes-easy-mc-user-subscribed-message"><strong><?php _e( 'Email Already Subscribed', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
600 | + <input type="text" class="widefat" name="yikes-easy-mc-user-subscribed-message" id="yikes-easy-mc-user-subscribed-message" value="<?php echo isset( $error_messages[ 'already-subscribed' ] ) ? stripslashes( esc_html( $error_messages[ 'already-subscribed' ] ) ) : ''; ?>" placeholder="<?php echo $global_error_messages[ 'email-exists-error' ]; ?>"> |
|
601 | 601 | </label> |
602 | 602 | |
603 | 603 | </div> |
@@ -613,14 +613,14 @@ discard block |
||
613 | 613 | <div id="postbox-container-1" class="postbox-container"> |
614 | 614 | <div class="meta-box-sortables"> |
615 | 615 | <div class="postbox yikes-easy-mc-postbox"> |
616 | - <h3 class="edit-form-title"><span><?php _e( "Error Message Explanation" , 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3> |
|
616 | + <h3 class="edit-form-title"><span><?php _e( "Error Message Explanation", 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3> |
|
617 | 617 | <div class="inside"> |
618 | 618 | |
619 | 619 | <ul> |
620 | - <li><strong><?php _e( 'Success Message' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> : <?php _e( 'The message displayed to the user after they have submitted the form and the data has been successfully sent to MailChimp.' , 'yikes-inc-easy-mailchimp-extender' ); ?></li> |
|
621 | - <li><strong><?php _e( 'General Error Message' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> : <?php _e( 'The message displayed to the user after a generic error has occurred.' , 'yikes-inc-easy-mailchimp-extender' ); ?></li> |
|
622 | - <li><strong><?php _e( 'Invalid Email' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> : <?php _e( 'The message displayed to the user after they have entered a non-valid email address.' , 'yikes-inc-easy-mailchimp-extender' ); ?></li> |
|
623 | - <li><strong><?php _e( 'Email Already Subscribed' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> : <?php _e( 'The message displayed to the user after they attempt to sign up for a mailing list using an email address that is already subscribed.' , 'yikes-inc-easy-mailchimp-extender' ); ?></li> |
|
620 | + <li><strong><?php _e( 'Success Message', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> : <?php _e( 'The message displayed to the user after they have submitted the form and the data has been successfully sent to MailChimp.', 'yikes-inc-easy-mailchimp-extender' ); ?></li> |
|
621 | + <li><strong><?php _e( 'General Error Message', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> : <?php _e( 'The message displayed to the user after a generic error has occurred.', 'yikes-inc-easy-mailchimp-extender' ); ?></li> |
|
622 | + <li><strong><?php _e( 'Invalid Email', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> : <?php _e( 'The message displayed to the user after they have entered a non-valid email address.', 'yikes-inc-easy-mailchimp-extender' ); ?></li> |
|
623 | + <li><strong><?php _e( 'Email Already Subscribed', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> : <?php _e( 'The message displayed to the user after they attempt to sign up for a mailing list using an email address that is already subscribed.', 'yikes-inc-easy-mailchimp-extender' ); ?></li> |
|
624 | 624 | </ul> |
625 | 625 | |
626 | 626 | </div> |
@@ -639,7 +639,7 @@ discard block |
||
639 | 639 | </label> |
640 | 640 | <!-- End Error Messages --> |
641 | 641 | |
642 | - <?php do_action( 'yikes-mailchimp-edit-form-sections' , $form ); ?> |
|
642 | + <?php do_action( 'yikes-mailchimp-edit-form-sections', $form ); ?> |
|
643 | 643 | |
644 | 644 | </div> |
645 | 645 | <!-- .inside --> |
@@ -654,175 +654,175 @@ discard block |
||
654 | 654 | <div id="postbox-container-1" class="postbox-container yikes-easy-forms-sidebar"> |
655 | 655 | <div class="meta-box-sortables"> |
656 | 656 | <div class="postbox yikes-easy-mc-postbox"> |
657 | - <h3><span><?php _e( 'Form Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3> |
|
657 | + <h3><span><?php _e( 'Form Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3> |
|
658 | 658 | |
659 | 659 | <div class="inside"> |
660 | 660 | <p class="inside-section-1"> |
661 | - <label for="shortcode"><?php _e( 'Edit Another Form' , 'yikes-inc-easy-mailchimp-extender' ); ?><br /> |
|
661 | + <label for="shortcode"><?php _e( 'Edit Another Form', 'yikes-inc-easy-mailchimp-extender' ); ?><br /> |
|
662 | 662 | <select class="widefat" name="form_switcher" id="form_switcher" onchange="YIKES_Easy_MC_SwitchForm(jQuery(this).val());"> |
663 | - <?php foreach( $all_forms as $single_form ) { ?> |
|
664 | - <option <?php selected( $form_id , $single_form['id'] ); ?>value="<?php echo $single_form['id']; ?>"><?php echo $single_form['form_name']; ?></option> |
|
663 | + <?php foreach ( $all_forms as $single_form ) { ?> |
|
664 | + <option <?php selected( $form_id, $single_form[ 'id' ] ); ?>value="<?php echo $single_form[ 'id' ]; ?>"><?php echo $single_form[ 'form_name' ]; ?></option> |
|
665 | 665 | <?php } ?> |
666 | 666 | </select> |
667 | 667 | </label> |
668 | 668 | </p> |
669 | 669 | |
670 | 670 | <p class="inside-section-2"> |
671 | - <label for="shortcode"><?php _e( 'Shortcode' , 'yikes-inc-easy-mailchimp-extender' ); ?><br /> |
|
672 | - <input type="text" onclick="this.setSelectionRange(0, this.value.length)" class="widefat shortcode-input-field" readonly value='[yikes-mailchimp form="<?php echo $form['id']; ?>"]' /> |
|
671 | + <label for="shortcode"><?php _e( 'Shortcode', 'yikes-inc-easy-mailchimp-extender' ); ?><br /> |
|
672 | + <input type="text" onclick="this.setSelectionRange(0, this.value.length)" class="widefat shortcode-input-field" readonly value='[yikes-mailchimp form="<?php echo $form[ 'id' ]; ?>"]' /> |
|
673 | 673 | </label> |
674 | 674 | </p> |
675 | 675 | |
676 | 676 | |
677 | 677 | <a href="#" class="expansion-section-title settings-sidebar"> |
678 | - <span class="dashicons dashicons-plus"></span><?php _e( 'Associated List Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
678 | + <span class="dashicons dashicons-plus"></span><?php _e( 'Associated List Settings', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
679 | 679 | </a> |
680 | 680 | <div class="yikes-mc-settings-expansion-section"> |
681 | 681 | <!-- Associated List --> |
682 | - <p class="form-field-container"><!-- necessary to prevent skipping on slideToggle(); --><label for="associated-list"><strong><?php _e( 'Associated List' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
683 | - <select name="associated-list" id="associated-list" <?php if( empty( $list_data['data'] ) ) { echo 'disabled="disabled"'; } ?> onchange="jQuery('.view-list-link').attr( 'href', '<?php echo esc_url( admin_url( 'admin.php?page=yikes-mailchimp-view-list&list-id=' ) ); ?>' + jQuery( this ).val() );"> |
|
682 | + <p class="form-field-container"><!-- necessary to prevent skipping on slideToggle(); --><label for="associated-list"><strong><?php _e( 'Associated List', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
683 | + <select name="associated-list" id="associated-list" <?php if ( empty( $list_data[ 'data' ] ) ) { echo 'disabled="disabled"'; } ?> onchange="jQuery('.view-list-link').attr( 'href', '<?php echo esc_url( admin_url( 'admin.php?page=yikes-mailchimp-view-list&list-id=' ) ); ?>' + jQuery( this ).val() );"> |
|
684 | 684 | <?php |
685 | - if( !empty( $list_data['data'] ) ) { |
|
686 | - foreach( $list_data['data'] as $mailing_list ) { |
|
685 | + if ( ! empty( $list_data[ 'data' ] ) ) { |
|
686 | + foreach ( $list_data[ 'data' ] as $mailing_list ) { |
|
687 | 687 | ?> |
688 | - <option <?php selected( $form['list_id'] , $mailing_list['id'] ); ?> value="<?php echo $mailing_list['id']; ?>"><?php echo stripslashes( $mailing_list['name'] ) . ' (' . $mailing_list['stats']['member_count'] . ') '; ?></option> |
|
688 | + <option <?php selected( $form[ 'list_id' ], $mailing_list[ 'id' ] ); ?> value="<?php echo $mailing_list[ 'id' ]; ?>"><?php echo stripslashes( $mailing_list[ 'name' ] ) . ' (' . $mailing_list[ 'stats' ][ 'member_count' ] . ') '; ?></option> |
|
689 | 689 | <?php |
690 | 690 | } |
691 | 691 | } else { |
692 | 692 | ?> |
693 | - <option value="no-forms"><?php _e( 'No Lists Found' , 'yikes-inc-easy-mailchimp-extender' ); ?></option> |
|
693 | + <option value="no-forms"><?php _e( 'No Lists Found', 'yikes-inc-easy-mailchimp-extender' ); ?></option> |
|
694 | 694 | <?php |
695 | 695 | } |
696 | 696 | ?> |
697 | 697 | </select> |
698 | - <?php if( !empty( $list_data['data'] ) ) { ?> |
|
698 | + <?php if ( ! empty( $list_data[ 'data' ] ) ) { ?> |
|
699 | 699 | <p class="description view-list"> |
700 | - <a href="<?php echo esc_url( admin_url( 'admin.php?page=yikes-mailchimp-view-list&list-id=' . $form['list_id'] ) ); ?>" class="view-list-link"><?php _e( 'View List', 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
700 | + <a href="<?php echo esc_url( admin_url( 'admin.php?page=yikes-mailchimp-view-list&list-id=' . $form[ 'list_id' ] ) ); ?>" class="view-list-link"><?php _e( 'View List', 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
701 | 701 | </p> |
702 | 702 | <p class="description"> |
703 | - <?php _e( "Users who sign up via this form will be added to the list selected above." , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
703 | + <?php _e( "Users who sign up via this form will be added to the list selected above.", 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
704 | 704 | </p> |
705 | 705 | <?php } else { ?> |
706 | 706 | <p class="description"> |
707 | - <?php _e( "It looks like you first need to create a list to assign this form to. Head over to" , 'yikes-inc-easy-mailchimp-extender' ); ?> <a href="http://www.MailChimp.com" title="<?php _e( 'Create a new list' , 'yikes-inc-easy-mailchimp-extender' ); ?>">MailChimp</a> <?php _e( 'to create your first list' , 'yikes-inc-easy-mailchimp-extender' ); ?>. |
|
707 | + <?php _e( "It looks like you first need to create a list to assign this form to. Head over to", 'yikes-inc-easy-mailchimp-extender' ); ?> <a href="http://www.MailChimp.com" title="<?php _e( 'Create a new list', 'yikes-inc-easy-mailchimp-extender' ); ?>">MailChimp</a> <?php _e( 'to create your first list', 'yikes-inc-easy-mailchimp-extender' ); ?>. |
|
708 | 708 | </p> |
709 | 709 | <?php } ?> |
710 | 710 | </label></p> |
711 | 711 | </div> |
712 | 712 | |
713 | 713 | <a href="#" class="expansion-section-title settings-sidebar"> |
714 | - <span class="dashicons dashicons-plus"></span><?php _e( 'Opt-in Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
714 | + <span class="dashicons dashicons-plus"></span><?php _e( 'Opt-in Settings', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
715 | 715 | </a> |
716 | 716 | <div class="yikes-mc-settings-expansion-section"> |
717 | 717 | |
718 | 718 | <!-- Single or Double Opt-in --> |
719 | 719 | <?php |
720 | - if( !isset( $optin_settings['optin'] ) ) { |
|
721 | - $optin_settings['optin'] = '1'; |
|
720 | + if ( ! isset( $optin_settings[ 'optin' ] ) ) { |
|
721 | + $optin_settings[ 'optin' ] = '1'; |
|
722 | 722 | } |
723 | 723 | ?> |
724 | - <p class="form-field-container"><!-- necessary to prevent skipping on slideToggle(); --><label for="single-double-optin"><strong><?php _e( 'Single or Double Opt-in' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
724 | + <p class="form-field-container"><!-- necessary to prevent skipping on slideToggle(); --><label for="single-double-optin"><strong><?php _e( 'Single or Double Opt-in', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
725 | 725 | <span class="edit-form-field-container-span"> |
726 | - <label for="single"><input id="single" type="radio" name="single-double-optin" value="0" <?php checked( $optin_settings['optin'] , '0' ); ?>><?php _e( 'Single' , 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
727 | - <label for="double"><input id="double" type="radio" name="single-double-optin" value="1" <?php checked( $optin_settings['optin'] , '1' ); ?>><?php _e( 'Double' , 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
726 | + <label for="single"><input id="single" type="radio" name="single-double-optin" value="0" <?php checked( $optin_settings[ 'optin' ], '0' ); ?>><?php _e( 'Single', 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
727 | + <label for="double"><input id="double" type="radio" name="single-double-optin" value="1" <?php checked( $optin_settings[ 'optin' ], '1' ); ?>><?php _e( 'Double', 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
728 | 728 | </span> |
729 | - <p class="description"><?php _e( "Double opt-in requires users to confirm their email address before being added to a list (recommended)" , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
729 | + <p class="description"><?php _e( "Double opt-in requires users to confirm their email address before being added to a list (recommended)", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
730 | 730 | </label></p> |
731 | 731 | |
732 | 732 | <!-- Welcome Email --> |
733 | 733 | <?php |
734 | - if( !isset( $optin_settings['send_welcome_email'] ) ) { |
|
735 | - $optin_settings['send_welcome_email'] = '1'; |
|
734 | + if ( ! isset( $optin_settings[ 'send_welcome_email' ] ) ) { |
|
735 | + $optin_settings[ 'send_welcome_email' ] = '1'; |
|
736 | 736 | } |
737 | 737 | ?> |
738 | - <p class="form-field-container"><!-- necessary to prevent skipping on slideToggle(); --><label for="send-welcome-email"><strong><?php _e( 'Send Welcome Email' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
738 | + <p class="form-field-container"><!-- necessary to prevent skipping on slideToggle(); --><label for="send-welcome-email"><strong><?php _e( 'Send Welcome Email', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
739 | 739 | <span class="edit-form-field-container-span"> |
740 | - <label for="send-welcome"><input id="send-welcome" type="radio" name="send-welcome-email" value="1" <?php checked( $optin_settings['send_welcome_email'] , '1' ); ?>><?php _e( 'Yes' , 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
741 | - <label for="do-not-send-welcome"><input id="do-not-send-welcome" type="radio" name="send-welcome-email" value="0" <?php checked( $optin_settings['send_welcome_email'] , '0' ); ?>><?php _e( 'No' , 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
740 | + <label for="send-welcome"><input id="send-welcome" type="radio" name="send-welcome-email" value="1" <?php checked( $optin_settings[ 'send_welcome_email' ], '1' ); ?>><?php _e( 'Yes', 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
741 | + <label for="do-not-send-welcome"><input id="do-not-send-welcome" type="radio" name="send-welcome-email" value="0" <?php checked( $optin_settings[ 'send_welcome_email' ], '0' ); ?>><?php _e( 'No', 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
742 | 742 | </span> |
743 | - <p class="description"><?php _e( "When a user signs up, should they receive the default welcome email?" , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
743 | + <p class="description"><?php _e( "When a user signs up, should they receive the default welcome email?", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
744 | 744 | </label></p> |
745 | 745 | |
746 | 746 | <!-- Update Existing Users --> |
747 | 747 | <?php |
748 | - if( !isset( $optin_settings['update_existing_user'] ) ) { |
|
749 | - $optin_settings['update_existing_user'] = '1'; |
|
748 | + if ( ! isset( $optin_settings[ 'update_existing_user' ] ) ) { |
|
749 | + $optin_settings[ 'update_existing_user' ] = '1'; |
|
750 | 750 | } |
751 | 751 | ?> |
752 | - <p class="form-field-container"><!-- necessary to prevent skipping on slideToggle(); --><label for="update-existing-user"><strong><?php _e( 'Update Existing Subscriber' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
752 | + <p class="form-field-container"><!-- necessary to prevent skipping on slideToggle(); --><label for="update-existing-user"><strong><?php _e( 'Update Existing Subscriber', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
753 | 753 | <span class="form-field-container-span"> |
754 | - <label for="update-user"><input type="radio" id="update-user" name="update-existing-user" value="1" <?php checked( $optin_settings['update_existing_user'] , '1' ); ?>><?php _e( 'Yes' , 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
755 | - <label for="do-not-update-user"><input type="radio" id="do-not-update-user" name="update-existing-user" value="0" <?php checked( $optin_settings['update_existing_user'] , '0' ); ?>><?php _e( 'No' , 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
754 | + <label for="update-user"><input type="radio" id="update-user" name="update-existing-user" value="1" <?php checked( $optin_settings[ 'update_existing_user' ], '1' ); ?>><?php _e( 'Yes', 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
755 | + <label for="do-not-update-user"><input type="radio" id="do-not-update-user" name="update-existing-user" value="0" <?php checked( $optin_settings[ 'update_existing_user' ], '0' ); ?>><?php _e( 'No', 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
756 | 756 | </span> |
757 | - <p class="description"><?php printf( __( "Display an update link when a user is already subscribed to the list, allowing them to generate an email where they can update their subscribtion info - instead of displaying a <em>%s</em> message." , "yikes-inc-easy-mailchimp-extender" ), __( '"user already subscribed"', 'yikes-inc-easy-mailchimp-extender' ) ); ?></p> |
|
757 | + <p class="description"><?php printf( __( "Display an update link when a user is already subscribed to the list, allowing them to generate an email where they can update their subscribtion info - instead of displaying a <em>%s</em> message.", "yikes-inc-easy-mailchimp-extender" ), __( '"user already subscribed"', 'yikes-inc-easy-mailchimp-extender' ) ); ?></p> |
|
758 | 758 | </label></p> |
759 | 759 | |
760 | 760 | </div> |
761 | 761 | |
762 | 762 | <a href="#" class="expansion-section-title settings-sidebar"> |
763 | - <span class="dashicons dashicons-plus"></span><?php _e( 'Submission Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
763 | + <span class="dashicons dashicons-plus"></span><?php _e( 'Submission Settings', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
764 | 764 | </a> |
765 | 765 | <div class="yikes-mc-settings-expansion-section"> |
766 | 766 | <!-- AJAX form Submission --> |
767 | 767 | <?php |
768 | - if( !isset( $submission_settings['ajax'] ) ) { |
|
769 | - $submission_settings['ajax'] = '1'; |
|
768 | + if ( ! isset( $submission_settings[ 'ajax' ] ) ) { |
|
769 | + $submission_settings[ 'ajax' ] = '1'; |
|
770 | 770 | } |
771 | 771 | ?> |
772 | - <p class="form-field-container"><!-- necessary to prevent skipping on slideToggle(); --><label for="form-ajax-submission"><strong><?php _e( 'Enable AJAX Submission' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
772 | + <p class="form-field-container"><!-- necessary to prevent skipping on slideToggle(); --><label for="form-ajax-submission"><strong><?php _e( 'Enable AJAX Submission', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
773 | 773 | <span class="form-field-container-span"> |
774 | - <label for="enable-ajax"><input type="radio" id="enable-ajax" name="form-ajax-submission" value="1" <?php checked( $submission_settings['ajax'] , '1' ); ?>><?php _e( 'Yes' , 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
775 | - <label for="disable-ajax"><input type="radio" id="disable-ajax" name="form-ajax-submission" value="0" <?php checked( $submission_settings['ajax'] , '0' ); ?>><?php _e( 'No' , 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
774 | + <label for="enable-ajax"><input type="radio" id="enable-ajax" name="form-ajax-submission" value="1" <?php checked( $submission_settings[ 'ajax' ], '1' ); ?>><?php _e( 'Yes', 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
775 | + <label for="disable-ajax"><input type="radio" id="disable-ajax" name="form-ajax-submission" value="0" <?php checked( $submission_settings[ 'ajax' ], '0' ); ?>><?php _e( 'No', 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
776 | 776 | </span> |
777 | - <p class="description"><?php _e( "AJAX form submissions transmit data without requiring the page to refresh." , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
777 | + <p class="description"><?php _e( "AJAX form submissions transmit data without requiring the page to refresh.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
778 | 778 | </label></p> |
779 | 779 | |
780 | 780 | <!-- Redirect User On Submission --> |
781 | 781 | <?php |
782 | - if( !isset( $submission_settings['redirect_on_submission'] ) ) { |
|
783 | - $submission_settings['redirect_on_submission'] = '0'; |
|
784 | - $submission_settings['redirect_page'] = ''; |
|
782 | + if ( ! isset( $submission_settings[ 'redirect_on_submission' ] ) ) { |
|
783 | + $submission_settings[ 'redirect_on_submission' ] = '0'; |
|
784 | + $submission_settings[ 'redirect_page' ] = ''; |
|
785 | 785 | } |
786 | 786 | ?> |
787 | - <p><label for="redirect-user-on-submission"><strong><?php _e( 'Redirect On Submission' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
787 | + <p><label for="redirect-user-on-submission"><strong><?php _e( 'Redirect On Submission', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
788 | 788 | <span class="form-field-container-span"> |
789 | - <label for="redirect-user"><input type="radio" id="redirect-user" onclick="togglePageRedirection( this );" name="redirect-user-on-submission" value="1" <?php checked( $submission_settings['redirect_on_submission'] , '1' ); ?>><?php _e( 'Yes' , 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
790 | - <label for="do-not-redirect-user"><input type="radio" id="do-not-redirect-user" onclick="togglePageRedirection( this );" name="redirect-user-on-submission" value="0" <?php checked( $submission_settings['redirect_on_submission'] , '0' ); ?>><?php _e( 'No' , 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
789 | + <label for="redirect-user"><input type="radio" id="redirect-user" onclick="togglePageRedirection( this );" name="redirect-user-on-submission" value="1" <?php checked( $submission_settings[ 'redirect_on_submission' ], '1' ); ?>><?php _e( 'Yes', 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
790 | + <label for="do-not-redirect-user"><input type="radio" id="do-not-redirect-user" onclick="togglePageRedirection( this );" name="redirect-user-on-submission" value="0" <?php checked( $submission_settings[ 'redirect_on_submission' ], '0' ); ?>><?php _e( 'No', 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
791 | 791 | </span> |
792 | - <?php $this->generate_page_redirect_dropdown( $submission_settings['redirect_on_submission'] , $submission_settings['redirect_page'], ( isset( $submission_settings['custom_redirect_url'] ) ) ? esc_url( $submission_settings['custom_redirect_url'] ) : '' ); ?> |
|
793 | - <p class="description"><?php _e( "When the user signs up would you like to redirect them to another page?" , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
792 | + <?php $this->generate_page_redirect_dropdown( $submission_settings[ 'redirect_on_submission' ], $submission_settings[ 'redirect_page' ], ( isset( $submission_settings[ 'custom_redirect_url' ] ) ) ? esc_url( $submission_settings[ 'custom_redirect_url' ] ) : '' ); ?> |
|
793 | + <p class="description"><?php _e( "When the user signs up would you like to redirect them to another page?", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
794 | 794 | </label></p> |
795 | 795 | |
796 | 796 | <!-- Hide Form On Submission --> |
797 | 797 | <?php |
798 | - if( !isset( $submission_settings['hide_form_post_signup'] ) ) { |
|
799 | - $submission_settings['hide_form_post_signup'] = '0'; |
|
798 | + if ( ! isset( $submission_settings[ 'hide_form_post_signup' ] ) ) { |
|
799 | + $submission_settings[ 'hide_form_post_signup' ] = '0'; |
|
800 | 800 | } |
801 | 801 | ?> |
802 | - <p><label for="hide-form-post-signup"><strong><?php _e( 'Hide Form After Sign Up' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
802 | + <p><label for="hide-form-post-signup"><strong><?php _e( 'Hide Form After Sign Up', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
803 | 803 | <span class="form-field-container-span"> |
804 | - <label for="hide-form"><input type="radio" id="hide-form" name="hide-form-post-signup" value="1" <?php checked( $submission_settings['hide_form_post_signup'] , '1' ); ?> checked><?php _e( 'Yes' , 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
805 | - <label for="do-not-hide-form"><input type="radio" id="do-not-hide-form" name="hide-form-post-signup" value="0" <?php checked( $submission_settings['hide_form_post_signup'] , '0' ); ?>><?php _e( 'No' , 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
804 | + <label for="hide-form"><input type="radio" id="hide-form" name="hide-form-post-signup" value="1" <?php checked( $submission_settings[ 'hide_form_post_signup' ], '1' ); ?> checked><?php _e( 'Yes', 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
805 | + <label for="do-not-hide-form"><input type="radio" id="do-not-hide-form" name="hide-form-post-signup" value="0" <?php checked( $submission_settings[ 'hide_form_post_signup' ], '0' ); ?>><?php _e( 'No', 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
806 | 806 | </span> |
807 | - <p class="description"><?php _e( "Should the form be hidden after the user successfully signs up?" , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
807 | + <p class="description"><?php _e( "Should the form be hidden after the user successfully signs up?", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
808 | 808 | </label></p> |
809 | 809 | |
810 | 810 | <!-- Append or Replace Interest Groups --> |
811 | 811 | <?php |
812 | - if( !isset( $submission_settings['replace_interests'] ) ) { |
|
813 | - $submission_settings['replace_interests'] = '1'; // defaults to true |
|
812 | + if ( ! isset( $submission_settings[ 'replace_interests' ] ) ) { |
|
813 | + $submission_settings[ 'replace_interests' ] = '1'; // defaults to true |
|
814 | 814 | } |
815 | 815 | ?> |
816 | - <p><label for="replace-interest-groups"><strong><?php _e( 'Existing Interest Groups' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
816 | + <p><label for="replace-interest-groups"><strong><?php _e( 'Existing Interest Groups', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
817 | 817 | <span class="form-field-container-span"> |
818 | - <label for="replace-interest-groups"><input type="radio" id="replace-interest-groups" name="replace-interest-groups" value="1" <?php checked( $submission_settings['replace_interests'] , '1' ); ?> checked><?php _e( 'Replace' , 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
819 | - <label for="update-interest-groups"><input type="radio" id="update-interest-groups" name="replace-interest-groups" value="0" <?php checked( $submission_settings['replace_interests'] , '0' ); ?>><?php _e( 'Update' , 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
818 | + <label for="replace-interest-groups"><input type="radio" id="replace-interest-groups" name="replace-interest-groups" value="1" <?php checked( $submission_settings[ 'replace_interests' ], '1' ); ?> checked><?php _e( 'Replace', 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
819 | + <label for="update-interest-groups"><input type="radio" id="update-interest-groups" name="replace-interest-groups" value="0" <?php checked( $submission_settings[ 'replace_interests' ], '0' ); ?>><?php _e( 'Update', 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
820 | 820 | </span> |
821 | 821 | |
822 | - <p class="description"><small><?php _e( "<strong>Replace</strong>: Replace all interest groups with the new ones submitted." , 'yikes-inc-easy-mailchimp-extender' ); ?></small></p> |
|
822 | + <p class="description"><small><?php _e( "<strong>Replace</strong>: Replace all interest groups with the new ones submitted.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p> |
|
823 | 823 | |
824 | 824 | |
825 | - <p class="description"><small><?php _e( "<strong>Update</strong>: Update <em>only</em> the ones submitted. Leave existing interest groups as is." , 'yikes-inc-easy-mailchimp-extender' ); ?></small></p> |
|
825 | + <p class="description"><small><?php _e( "<strong>Update</strong>: Update <em>only</em> the ones submitted. Leave existing interest groups as is.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p> |
|
826 | 826 | |
827 | 827 | </label></p> |
828 | 828 | |
@@ -835,9 +835,9 @@ discard block |
||
835 | 835 | |
836 | 836 | <span class="form-buttons-container" id="major-publishing-actions"> |
837 | 837 | <?php |
838 | - echo submit_button( __( 'Update Form' ) , 'primary' , '' , false , array( 'onclick' => 'jQuery(this).parent().prev().css({"display":"block","visibility":"inherit"});' ) ); |
|
839 | - $url = esc_url_raw( add_query_arg( array( 'action' => 'yikes-easy-mc-delete-form', 'mailchimp-form' => $form['id'] , 'nonce' => wp_create_nonce( 'delete-mailchimp-form-'.$form['id'] ) ) , admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ) ); |
|
840 | - echo '<a href="' . $url . '" class="yikes-delete-mailchimp-form" onclick="return confirm(\'' . __( "Are you sure you want to delete this form? This cannot be undone." , 'yikes-inc-easy-mailchimp-extender' ) . '\');">' . __( "Delete Form" , 'yikes-inc-easy-mailchimp-extender' ) . '</a>'; |
|
838 | + echo submit_button( __( 'Update Form' ), 'primary', '', false, array( 'onclick' => 'jQuery(this).parent().prev().css({"display":"block","visibility":"inherit"});' ) ); |
|
839 | + $url = esc_url_raw( add_query_arg( array( 'action' => 'yikes-easy-mc-delete-form', 'mailchimp-form' => $form[ 'id' ], 'nonce' => wp_create_nonce( 'delete-mailchimp-form-' . $form[ 'id' ] ) ), admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ) ); |
|
840 | + echo '<a href="' . $url . '" class="yikes-delete-mailchimp-form" onclick="return confirm(\'' . __( "Are you sure you want to delete this form? This cannot be undone.", 'yikes-inc-easy-mailchimp-extender' ) . '\');">' . __( "Delete Form", 'yikes-inc-easy-mailchimp-extender' ) . '</a>'; |
|
841 | 841 | ?> |
842 | 842 | </span> |
843 | 843 |
@@ -1,11 +1,11 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | // lets confirm the user has a valid API key stored |
3 | - if( $this->is_user_mc_api_valid_form( false ) == 'valid' ) { |
|
3 | + if ( $this->is_user_mc_api_valid_form( false ) == 'valid' ) { |
|
4 | 4 | /// Check for a transient, if not - set one up for one hour |
5 | 5 | if ( false === ( $list_data = get_transient( 'yikes-easy-mailchimp-list-data' ) ) ) { |
6 | - $api_key = trim( get_option( 'yikes-mc-api-key' , '' ) ); |
|
6 | + $api_key = trim( get_option( 'yikes-mc-api-key', '' ) ); |
|
7 | 7 | $dash_position = strpos( $api_key, '-' ); |
8 | - if( $dash_position !== false ) { |
|
8 | + if ( $dash_position !== false ) { |
|
9 | 9 | $api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/list.json'; |
10 | 10 | } |
11 | 11 | $list_data = wp_remote_post( $api_endpoint, array( |
@@ -17,11 +17,11 @@ discard block |
||
17 | 17 | 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true ) |
18 | 18 | ) ); |
19 | 19 | $list_data = json_decode( wp_remote_retrieve_body( $list_data ), true ); |
20 | - if( isset( $list_data['error'] ) ) { |
|
21 | - if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) { |
|
20 | + if ( isset( $list_data[ 'error' ] ) ) { |
|
21 | + if ( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) { |
|
22 | 22 | require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php'; |
23 | 23 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
24 | - $error_logging->yikes_easy_mailchimp_write_to_error_log( $list_data['error'], __( "Get Account Lists" , 'yikes-inc-easy-mailchimp-extender' ), "View Lists Page" ); |
|
24 | + $error_logging->yikes_easy_mailchimp_write_to_error_log( $list_data[ 'error' ], __( "Get Account Lists", 'yikes-inc-easy-mailchimp-extender' ), "View Lists Page" ); |
|
25 | 25 | } |
26 | 26 | } else { |
27 | 27 | // set our transient |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | } |
30 | 30 | } |
31 | 31 | } else { |
32 | - wp_die( __( 'It looks like you need to re-validate your MailChimp API key before you can continue.' , 'yikes-inc-easy-mailchimp-extender' ) , 500 ); |
|
32 | + wp_die( __( 'It looks like you need to re-validate your MailChimp API key before you can continue.', 'yikes-inc-easy-mailchimp-extender' ), 500 ); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | wp_register_script( 'yikes-easy-mc-manage-forms-script', YIKES_MC_URL . 'admin/js/yikes-inc-easy-mailchimp-manage-forms.js', array( 'jquery' ), $this->version, false ); |
@@ -43,12 +43,12 @@ discard block |
||
43 | 43 | ?> |
44 | 44 | <div class="wrap"> |
45 | 45 | <!-- Freddie Logo --> |
46 | - <img src="<?php echo YIKES_MC_URL . 'includes/images/MailChimp_Assets/Freddie_60px.png'; ?>" alt="<?php _e( 'Freddie - MailChimp Mascot' , 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-mc-freddie-logo" /> |
|
46 | + <img src="<?php echo YIKES_MC_URL . 'includes/images/MailChimp_Assets/Freddie_60px.png'; ?>" alt="<?php _e( 'Freddie - MailChimp Mascot', 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-mc-freddie-logo" /> |
|
47 | 47 | |
48 | - <h1>YIKES Easy Forms for MailChimp | <?php _e( 'Manage Lists' , 'yikes-inc-easy-mailchimp-extender' ) ?></h1> |
|
48 | + <h1>YIKES Easy Forms for MailChimp | <?php _e( 'Manage Lists', 'yikes-inc-easy-mailchimp-extender' ) ?></h1> |
|
49 | 49 | |
50 | 50 | <!-- Settings Page Description --> |
51 | - <p class="yikes-easy-mc-about-text about-text"><?php _e( 'Make edits to your MailChimp lists on the following page. Select a list to make edits to it.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
51 | + <p class="yikes-easy-mc-about-text about-text"><?php _e( 'Make edits to your MailChimp lists on the following page. Select a list to make edits to it.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
52 | 52 | |
53 | 53 | <!-- entire body content --> |
54 | 54 | <div id="poststuff"> |
@@ -68,8 +68,8 @@ discard block |
||
68 | 68 | <thead> |
69 | 69 | <tr> |
70 | 70 | <th id="cb" class="manage-column column-cb check-column" scope="col"><input type="checkbox" /></th> |
71 | - <th id="columnname" class="manage-column column-columnname" scope="col"><?php _e( 'List Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
72 | - <th id="columnname" class="manage-column column-columnname num" scope="col"><?php _e( 'Subscriber Count' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
71 | + <th id="columnname" class="manage-column column-columnname" scope="col"><?php _e( 'List Name', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
72 | + <th id="columnname" class="manage-column column-columnname num" scope="col"><?php _e( 'Subscriber Count', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
73 | 73 | </tr> |
74 | 74 | </thead> |
75 | 75 | <!-- end header --> |
@@ -78,36 +78,36 @@ discard block |
||
78 | 78 | <tfoot> |
79 | 79 | <tr> |
80 | 80 | <th class="manage-column column-cb check-column" scope="col"><input type="checkbox" /></th> |
81 | - <th class="manage-column column-columnname" scope="col"><?php _e( 'Form Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
82 | - <th class="manage-column column-columnname num" scope="col"><?php _e( 'Subscriber Count' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
81 | + <th class="manage-column column-columnname" scope="col"><?php _e( 'Form Name', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
82 | + <th class="manage-column column-columnname num" scope="col"><?php _e( 'Subscriber Count', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
83 | 83 | </tr> |
84 | 84 | </tfoot> |
85 | 85 | <!-- end footer --> |
86 | 86 | |
87 | 87 | <!-- TABLE BODY --> |
88 | 88 | <tbody> |
89 | - <?php if( count( $list_data['total'] ) > 0 ) { |
|
89 | + <?php if ( count( $list_data[ 'total' ] ) > 0 ) { |
|
90 | 90 | $i = 1; |
91 | - foreach( $list_data['data'] as $list ) { |
|
91 | + foreach ( $list_data[ 'data' ] as $list ) { |
|
92 | 92 | ?> |
93 | - <tr class="<?php if( $i % 2 == 0 ) { echo 'alternate'; } ?>"> |
|
93 | + <tr class="<?php if ( $i % 2 == 0 ) { echo 'alternate'; } ?>"> |
|
94 | 94 | <th class="check-column" scope="row"><input type="checkbox" /></th> |
95 | - <td class="column-columnname"><?php echo stripslashes( $list['name'] ); ?> |
|
95 | + <td class="column-columnname"><?php echo stripslashes( $list[ 'name' ] ); ?> |
|
96 | 96 | <div class="row-actions"> |
97 | - <span><a href="<?php echo esc_url_raw( add_query_arg( array( 'list-id' => (int) $list['id'] ) , admin_url( 'admin.php?page=yikes-mailchimp-view-list' ) ) ); ?>"><?php _e( "View" , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |</span> |
|
98 | - <span><a href="<?php echo esc_url_raw( add_query_arg( array( 'list-id' => (int) $list['id'] ) , admin_url( 'admin.php?page=yikes-mailchimp-edit-list' ) ) ); ?>"><?php _e( "Edit Fields" , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |</span> |
|
99 | - <span><a href="<?php echo esc_url_raw( add_query_arg( array( 'action' => '', 'mailchimp-list' => (int) $list['id'] , 'nonce' => wp_create_nonce( 'duplicate-mailchimp-form-'.$list['id'] ) ) , admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ) ); ?>"><?php _e( "Delete" , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |</span> |
|
100 | - <span><a href="#" class="view-yikes-mc-list-info"><?php _e( "List Info." , 'yikes-inc-easy-mailchimp-extender' ); ?></a></span> |
|
97 | + <span><a href="<?php echo esc_url_raw( add_query_arg( array( 'list-id' => (int) $list[ 'id' ] ), admin_url( 'admin.php?page=yikes-mailchimp-view-list' ) ) ); ?>"><?php _e( "View", 'yikes-inc-easy-mailchimp-extender' ); ?></a> |</span> |
|
98 | + <span><a href="<?php echo esc_url_raw( add_query_arg( array( 'list-id' => (int) $list[ 'id' ] ), admin_url( 'admin.php?page=yikes-mailchimp-edit-list' ) ) ); ?>"><?php _e( "Edit Fields", 'yikes-inc-easy-mailchimp-extender' ); ?></a> |</span> |
|
99 | + <span><a href="<?php echo esc_url_raw( add_query_arg( array( 'action' => '', 'mailchimp-list' => (int) $list[ 'id' ], 'nonce' => wp_create_nonce( 'duplicate-mailchimp-form-' . $list[ 'id' ] ) ), admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ) ); ?>"><?php _e( "Delete", 'yikes-inc-easy-mailchimp-extender' ); ?></a> |</span> |
|
100 | + <span><a href="#" class="view-yikes-mc-list-info"><?php _e( "List Info.", 'yikes-inc-easy-mailchimp-extender' ); ?></a></span> |
|
101 | 101 | </div> |
102 | 102 | </td> |
103 | - <td class="column-columnname num"><?php echo $list['stats']['member_count']; ?></td> |
|
103 | + <td class="column-columnname num"><?php echo $list[ 'stats' ][ 'member_count' ]; ?></td> |
|
104 | 104 | </tr> |
105 | 105 | <?php |
106 | 106 | $i++; |
107 | 107 | } |
108 | 108 | } else { ?> |
109 | 109 | <tr class="no-items"> |
110 | - <td class="colspanchange no-mailchimp-lists-found" colspan="3"><em><?php _e( 'No MailChimp lists found. Head over to' , 'yikes-inc-easy-mailchimp-extender' ); ?></em></td> |
|
110 | + <td class="colspanchange no-mailchimp-lists-found" colspan="3"><em><?php _e( 'No MailChimp lists found. Head over to', 'yikes-inc-easy-mailchimp-extender' ); ?></em></td> |
|
111 | 111 | </tr> |
112 | 112 | <?php } ?> |
113 | 113 | </tbody> |
@@ -3,18 +3,18 @@ |
||
3 | 3 | - Clear MailChimp transient data such as forms, form fields, list data, subscribers etc. |
4 | 4 | * transient cache is stored for 60 minutes. |
5 | 5 | --> |
6 | -<h3><span><?php _e( 'API Cache Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3> |
|
6 | +<h3><span><?php _e( 'API Cache Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3> |
|
7 | 7 | <div class="inside"> |
8 | 8 | |
9 | 9 | <!-- Settings Form --> |
10 | - <form action="<?php echo esc_url_raw( add_query_arg( array( 'action' => 'yikes-easy-mc-clear-transient-data' , 'nonce' => wp_create_nonce( 'clear-mc-transient-data' ) ) ) ); ?>" method="post"> |
|
10 | + <form action="<?php echo esc_url_raw( add_query_arg( array( 'action' => 'yikes-easy-mc-clear-transient-data', 'nonce' => wp_create_nonce( 'clear-mc-transient-data' ) ) ) ); ?>" method="post"> |
|
11 | 11 | |
12 | - <p><?php _e( "Delete all MailChimp data stored in your sites cache. Most data is stored in the cache for 1 hour." , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
12 | + <p><?php _e( "Delete all MailChimp data stored in your sites cache. Most data is stored in the cache for 1 hour.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
13 | 13 | <!-- check if any of our transients contain data --> |
14 | 14 | <?php if ( false === get_transient( 'yikes-easy-mailchimp-list-data' ) && false === get_transient( 'yikes-easy-mailchimp-profile-data' ) && false === get_transient( 'yikes-easy-mailchimp-account-data' ) ) { ?> |
15 | - <p><a href="#" class="button-secondary" disabled="disabled" title="<?php _e( 'No MailChimp data found in temporary cache storage.' , 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'Clear MailChimp API Cache' , 'yikes-inc-easy-mailchimp-extender' ); ?></a></p> |
|
15 | + <p><a href="#" class="button-secondary" disabled="disabled" title="<?php _e( 'No MailChimp data found in temporary cache storage.', 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'Clear MailChimp API Cache', 'yikes-inc-easy-mailchimp-extender' ); ?></a></p> |
|
16 | 16 | <?php } else { ?> |
17 | - <p><input type="submit" class="button-primary" value="<?php _e( 'Clear MailChimp API Cache' , 'yikes-inc-easy-mailchimp-extender' ); ?>" /></p> |
|
17 | + <p><input type="submit" class="button-primary" value="<?php _e( 'Clear MailChimp API Cache', 'yikes-inc-easy-mailchimp-extender' ); ?>" /></p> |
|
18 | 18 | <?php } ?> |
19 | 19 | |
20 | 20 | </form> |
@@ -5,65 +5,65 @@ |
||
5 | 5 | // return it as an array, so we can work with it to build our form below |
6 | 6 | $all_forms = $wpdb->get_results( 'SELECT id, form_name FROM ' . $wpdb->prefix . 'yikes_easy_mc_forms', ARRAY_A ); |
7 | 7 | ?> |
8 | -<h3><span><?php _e( 'Import/Export Forms & Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3> |
|
8 | +<h3><span><?php _e( 'Import/Export Forms & Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3> |
|
9 | 9 | |
10 | 10 | <div class="inside"> |
11 | 11 | |
12 | 12 | <!-- Export Form --> |
13 | - <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"> |
|
13 | + <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"> |
|
14 | 14 | |
15 | - <p><strong><?php _e( "Export Forms" , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></p> |
|
15 | + <p><strong><?php _e( "Export Forms", 'yikes-inc-easy-mailchimp-extender' ); ?></strong></p> |
|
16 | 16 | <p class="description"> |
17 | - <?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" ); ?> |
|
17 | + <?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" ); ?> |
|
18 | 18 | </p> |
19 | 19 | |
20 | - <?php if( !empty( $all_forms ) ) { ?> |
|
20 | + <?php if ( ! empty( $all_forms ) ) { ?> |
|
21 | 21 | <!-- custom list so users can export specific forms --> |
22 | - <a class="toggle-custom-lists button-secondary" onclick="jQuery(this).next().slideToggle();return false;"><?php _e( 'Select Forms' , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
22 | + <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 | 23 | <ul class="export-custom-forms-list"> |
24 | - <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> |
|
25 | - <?php foreach( $all_forms as $form ) { ?> |
|
26 | - <li><label><input type="checkbox" name="export_forms[]" value="<?php echo (int) $form['id']; ?>"><?php echo esc_html( $form['form_name'] ); ?></label></li> |
|
24 | + <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> |
|
25 | + <?php foreach ( $all_forms as $form ) { ?> |
|
26 | + <li><label><input type="checkbox" name="export_forms[]" value="<?php echo (int) $form[ 'id' ]; ?>"><?php echo esc_html( $form[ 'form_name' ] ); ?></label></li> |
|
27 | 27 | <?php } ?> |
28 | 28 | </ul> |
29 | 29 | <?php } else { ?> |
30 | - <p><em><?php _e( "It looks like you haven't created any forms yet." , "yikes-inc-easy-mailchimp-extender" ); ?></em></p> |
|
30 | + <p><em><?php _e( "It looks like you haven't created any forms yet.", "yikes-inc-easy-mailchimp-extender" ); ?></em></p> |
|
31 | 31 | <?php } ?> |
32 | 32 | <!-- check if any of our transients contain data --> |
33 | - <p><input type="submit" class="button-primary" value="<?php _e( 'Export Opt-in Forms' , 'yikes-inc-easy-mailchimp-extender' ); ?>" /></p> |
|
33 | + <p><input type="submit" class="button-primary" value="<?php _e( 'Export Opt-in Forms', 'yikes-inc-easy-mailchimp-extender' ); ?>" /></p> |
|
34 | 34 | |
35 | 35 | </form> |
36 | 36 | |
37 | 37 | <hr /> |
38 | 38 | |
39 | 39 | <!-- Export Form --> |
40 | - <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"> |
|
40 | + <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"> |
|
41 | 41 | |
42 | - <p><strong><?php _e( "Export Settings" , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></p> |
|
42 | + <p><strong><?php _e( "Export Settings", 'yikes-inc-easy-mailchimp-extender' ); ?></strong></p> |
|
43 | 43 | <p class="description"> |
44 | - <?php _e( "Export YIKES Easy Forms for MailChimp plugin settings." , "yikes-inc-easy-mailchimp-extender" ); ?> |
|
44 | + <?php _e( "Export YIKES Easy Forms for MailChimp plugin settings.", "yikes-inc-easy-mailchimp-extender" ); ?> |
|
45 | 45 | </p> |
46 | 46 | |
47 | 47 | <!-- check if any of our transients contain data --> |
48 | - <p><input type="submit" class="button-primary" value="<?php _e( 'Export Plugin Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?>" /></p> |
|
48 | + <p><input type="submit" class="button-primary" value="<?php _e( 'Export Plugin Settings', 'yikes-inc-easy-mailchimp-extender' ); ?>" /></p> |
|
49 | 49 | |
50 | 50 | </form> |
51 | 51 | |
52 | 52 | <hr /> |
53 | 53 | |
54 | 54 | <!-- Import Form --> |
55 | - <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"> |
|
55 | + <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"> |
|
56 | 56 | |
57 | - <p><strong><?php _e( "Import" , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></p> |
|
57 | + <p><strong><?php _e( "Import", 'yikes-inc-easy-mailchimp-extender' ); ?></strong></p> |
|
58 | 58 | <p class="description"> |
59 | - <?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" ); ?> |
|
59 | + <?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" ); ?> |
|
60 | 60 | </p> |
61 | 61 | |
62 | 62 | <label> |
63 | 63 | <input type="file" name="csv" id="forms_to_import"> |
64 | 64 | </label> |
65 | 65 | <!-- check if any of our transients contain data --> |
66 | - <p><input type="submit" class="button-primary" value="<?php _e( 'Import' , 'yikes-inc-easy-mailchimp-extender' ); ?>" /></p> |
|
66 | + <p><input type="submit" class="button-primary" value="<?php _e( 'Import', 'yikes-inc-easy-mailchimp-extender' ); ?>" /></p> |
|
67 | 67 | |
68 | 68 | </form> |
69 | 69 |
@@ -11,8 +11,8 @@ discard block |
||
11 | 11 | */ |
12 | 12 | |
13 | 13 | // enqueue jquery qtip for our tooltip |
14 | - wp_enqueue_script( 'jquery-qtip-tooltip', YIKES_MC_URL . 'admin/js/min/jquery.qtip.min.js' , array( 'jquery' ) ); |
|
15 | - wp_enqueue_style( 'jquery-qtip-style', YIKES_MC_URL . 'admin/css/jquery.qtip.min.css' ); |
|
14 | + wp_enqueue_script( 'jquery-qtip-tooltip', YIKES_MC_URL . 'admin/js/min/jquery.qtip.min.js', array( 'jquery' ) ); |
|
15 | + wp_enqueue_style( 'jquery-qtip-style', YIKES_MC_URL . 'admin/css/jquery.qtip.min.css' ); |
|
16 | 16 | |
17 | 17 | ?> |
18 | 18 | <script> |
@@ -43,50 +43,50 @@ discard block |
||
43 | 43 | ); |
44 | 44 | |
45 | 45 | $class_descriptions = array( |
46 | - 'comment_form' => '<img class="tooltip-integration-banner" src="' . YIKES_MC_URL . 'includes/images/Checkbox_Integration_Logos/wordpress-banner-logo.png" title="' . __( 'WordPress' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Enabling the WordPress core comment form opt-in checkbox will display a checkbox to your current users when leaving a comment (if they are not currently subscribed).' , 'yikes-inc-easy-mailchimp-extender' ), |
|
47 | - 'registration_form' => '<img class="tooltip-integration-banner" src="' . YIKES_MC_URL . 'includes/images/Checkbox_Integration_Logos/wordpress-banner-logo.png" title="' . __( 'WordPress' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Enabling the WordPress core registration form opt-in checkbox will display a checkbox to new users when registering for your site.' , 'yikes-inc-easy-mailchimp-extender' ), |
|
48 | - 'woocommerce_checkout_form' => '<img class="tooltip-integration-banner" src="' . YIKES_MC_URL . 'includes/images/Checkbox_Integration_Logos/woocommerce-banner.png" title="' . __( 'WooCommerce Store' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Enabling the WooCommerce checkout opt-in form allows you to capture email addresses from users who make purchases in your store. This option will add an opt-in checkbox to the checkout page.' , 'yikes-inc-easy-mailchimp-extender' ), |
|
49 | - 'easy_digital_downloads_checkout_form' => '<img class="tooltip-integration-banner" src="' . YIKES_MC_URL . 'includes/images/Checkbox_Integration_Logos/edd-banner.png" title="' . __( 'Easy Digital Downloads' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Enabling the Easy Digital Downloads checkout opt-in allows users who make a purchase to opt-in to your mailing list during checkout.' , 'yikes-inc-easy-mailchimp-extender' ), |
|
50 | - 'buddypress_form' => '<img class="tooltip-integration-banner" src="' . YIKES_MC_URL . 'includes/images/Checkbox_Integration_Logos/buddypress-banner.png" title="' . __( 'BuddyPress' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Enabling the BuddyPress opt-in allows users who register for your site to be automatically added to the mailing list of your choice.' , 'yikes-inc-easy-mailchimp-extender' ), |
|
51 | - 'bbpress_forms' => '<img class="tooltip-integration-banner" src="' . YIKES_MC_URL . 'includes/images/Checkbox_Integration_Logos/bbpress-banner.png" title="' . __( 'bbPress' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Enabling the bbPress opt-in enables users who register to use the forums on your site to be automatically added to the mailing list of your choice.' , 'yikes-inc-easy-mailchimp-extender' ), |
|
52 | - 'contact_form_7' => '<img class="tooltip-integration-banner" src="' . YIKES_MC_URL . 'includes/images/Checkbox_Integration_Logos/cf7-banner.png" title="' . __( 'Contact Form 7' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Once the Contact Form 7 integration is active you can use our custom shortcode [yikes_mailchimp_checkbox] in your contact forms to subscribe users to a pre-selected list.' , 'yikes-inc-easy-mailchimp-extender' ), |
|
46 | + 'comment_form' => '<img class="tooltip-integration-banner" src="' . YIKES_MC_URL . 'includes/images/Checkbox_Integration_Logos/wordpress-banner-logo.png" title="' . __( 'WordPress', 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Enabling the WordPress core comment form opt-in checkbox will display a checkbox to your current users when leaving a comment (if they are not currently subscribed).', 'yikes-inc-easy-mailchimp-extender' ), |
|
47 | + 'registration_form' => '<img class="tooltip-integration-banner" src="' . YIKES_MC_URL . 'includes/images/Checkbox_Integration_Logos/wordpress-banner-logo.png" title="' . __( 'WordPress', 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Enabling the WordPress core registration form opt-in checkbox will display a checkbox to new users when registering for your site.', 'yikes-inc-easy-mailchimp-extender' ), |
|
48 | + 'woocommerce_checkout_form' => '<img class="tooltip-integration-banner" src="' . YIKES_MC_URL . 'includes/images/Checkbox_Integration_Logos/woocommerce-banner.png" title="' . __( 'WooCommerce Store', 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Enabling the WooCommerce checkout opt-in form allows you to capture email addresses from users who make purchases in your store. This option will add an opt-in checkbox to the checkout page.', 'yikes-inc-easy-mailchimp-extender' ), |
|
49 | + 'easy_digital_downloads_checkout_form' => '<img class="tooltip-integration-banner" src="' . YIKES_MC_URL . 'includes/images/Checkbox_Integration_Logos/edd-banner.png" title="' . __( 'Easy Digital Downloads', 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Enabling the Easy Digital Downloads checkout opt-in allows users who make a purchase to opt-in to your mailing list during checkout.', 'yikes-inc-easy-mailchimp-extender' ), |
|
50 | + 'buddypress_form' => '<img class="tooltip-integration-banner" src="' . YIKES_MC_URL . 'includes/images/Checkbox_Integration_Logos/buddypress-banner.png" title="' . __( 'BuddyPress', 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Enabling the BuddyPress opt-in allows users who register for your site to be automatically added to the mailing list of your choice.', 'yikes-inc-easy-mailchimp-extender' ), |
|
51 | + 'bbpress_forms' => '<img class="tooltip-integration-banner" src="' . YIKES_MC_URL . 'includes/images/Checkbox_Integration_Logos/bbpress-banner.png" title="' . __( 'bbPress', 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Enabling the bbPress opt-in enables users who register to use the forums on your site to be automatically added to the mailing list of your choice.', 'yikes-inc-easy-mailchimp-extender' ), |
|
52 | + 'contact_form_7' => '<img class="tooltip-integration-banner" src="' . YIKES_MC_URL . 'includes/images/Checkbox_Integration_Logos/cf7-banner.png" title="' . __( 'Contact Form 7', 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Once the Contact Form 7 integration is active you can use our custom shortcode [yikes_mailchimp_checkbox] in your contact forms to subscribe users to a pre-selected list.', 'yikes-inc-easy-mailchimp-extender' ), |
|
53 | 53 | ); |
54 | 54 | |
55 | 55 | // Easy Digital Downloads |
56 | - if( class_exists( 'Easy_Digital_Downloads' ) ) { |
|
57 | - $active_plugins['easy_digital_downloads_checkout_form'] = __( 'Easy Digital Downloads Checkout', 'yikes-inc-easy-mailchimp-extender' ); |
|
56 | + if ( class_exists( 'Easy_Digital_Downloads' ) ) { |
|
57 | + $active_plugins[ 'easy_digital_downloads_checkout_form' ] = __( 'Easy Digital Downloads Checkout', 'yikes-inc-easy-mailchimp-extender' ); |
|
58 | 58 | } |
59 | 59 | // WooCommerce |
60 | - if( class_exists( 'WooCommerce' ) ) { |
|
61 | - $active_plugins['woocommerce_checkout_form'] = __( 'WooCommerce Checkout', 'yikes-inc-easy-mailchimp-extender' ); |
|
60 | + if ( class_exists( 'WooCommerce' ) ) { |
|
61 | + $active_plugins[ 'woocommerce_checkout_form' ] = __( 'WooCommerce Checkout', 'yikes-inc-easy-mailchimp-extender' ); |
|
62 | 62 | } |
63 | 63 | // BuddyPress |
64 | - if( class_exists( 'BuddyPress' ) ) { |
|
65 | - $active_plugins['buddypress_form'] = __( 'BuddyPress Registration', 'yikes-inc-easy-mailchimp-extender' ); |
|
64 | + if ( class_exists( 'BuddyPress' ) ) { |
|
65 | + $active_plugins[ 'buddypress_form' ] = __( 'BuddyPress Registration', 'yikes-inc-easy-mailchimp-extender' ); |
|
66 | 66 | } |
67 | 67 | // bbPress |
68 | - if( class_exists( 'bbPress' ) ) { |
|
69 | - $active_plugins['bbpress_forms'] = __( 'bbPress', 'yikes-inc-easy-mailchimp-extender' ); |
|
68 | + if ( class_exists( 'bbPress' ) ) { |
|
69 | + $active_plugins[ 'bbpress_forms' ] = __( 'bbPress', 'yikes-inc-easy-mailchimp-extender' ); |
|
70 | 70 | } |
71 | 71 | // Contact Form 7 |
72 | - if( is_plugin_active( 'contact-form-7/wp-contact-form-7.php' ) ) { |
|
73 | - $active_plugins['contact_form_7'] = __( 'Contact Form 7', 'yikes-inc-easy-mailchimp-extender' ); |
|
72 | + if ( is_plugin_active( 'contact-form-7/wp-contact-form-7.php' ) ) { |
|
73 | + $active_plugins[ 'contact_form_7' ] = __( 'Contact Form 7', 'yikes-inc-easy-mailchimp-extender' ); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | // store our checkbox options |
77 | - $options = get_option( 'optin-checkbox-init' , '' ); |
|
77 | + $options = get_option( 'optin-checkbox-init', '' ); |
|
78 | 78 | ?> |
79 | -<h3><span><?php _e( 'Integration Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3> |
|
79 | +<h3><span><?php _e( 'Integration Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3> |
|
80 | 80 | |
81 | 81 | |
82 | 82 | <?php |
83 | 83 | // lets confirm the user has a valid API key stored |
84 | - if( $this->is_user_mc_api_valid_form( false ) == 'valid' ) { |
|
84 | + if ( $this->is_user_mc_api_valid_form( false ) == 'valid' ) { |
|
85 | 85 | /// Check for a transient, if not - set one up for one hour |
86 | 86 | if ( false === ( $list_data = get_transient( 'yikes-easy-mailchimp-list-data' ) ) ) { |
87 | - $api_key = trim( get_option( 'yikes-mc-api-key' , '' ) ); |
|
87 | + $api_key = trim( get_option( 'yikes-mc-api-key', '' ) ); |
|
88 | 88 | $dash_position = strpos( $api_key, '-' ); |
89 | - if( $dash_position !== false ) { |
|
89 | + if ( $dash_position !== false ) { |
|
90 | 90 | $api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/list.json'; |
91 | 91 | } |
92 | 92 | $list_data = wp_remote_post( $api_endpoint, array( |
@@ -98,11 +98,11 @@ discard block |
||
98 | 98 | 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true ) |
99 | 99 | ) ); |
100 | 100 | $list_data = json_decode( wp_remote_retrieve_body( $list_data ), true ); |
101 | - if( isset( $list_data['error'] ) ) { |
|
102 | - if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) { |
|
101 | + if ( isset( $list_data[ 'error' ] ) ) { |
|
102 | + if ( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) { |
|
103 | 103 | require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php'; |
104 | 104 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
105 | - $error_logging->yikes_easy_mailchimp_write_to_error_log( $list_data['error'], __( "Get Account Lists" , 'yikes-inc-easy-mailchimp-extender' ), "Integration Settings Page" ); |
|
105 | + $error_logging->yikes_easy_mailchimp_write_to_error_log( $list_data[ 'error' ], __( "Get Account Lists", 'yikes-inc-easy-mailchimp-extender' ), "Integration Settings Page" ); |
|
106 | 106 | } |
107 | 107 | } else { |
108 | 108 | // set our transient |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | ?> |
114 | 114 | <div class="inside"> |
115 | 115 | <?php |
116 | - echo sprintf( __( 'Please %s to setup your integrations.', 'yikes-inc-easy-mailchimp-extender' ), '<a href="' . esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings§ion=general-settings' ) ) . '" title="' . __( 'General Settings' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'enter a valid MailChimp API key' , 'yikes-inc-easy-mailchimp-extender' ) . '</a>' ); |
|
116 | + echo sprintf( __( 'Please %s to setup your integrations.', 'yikes-inc-easy-mailchimp-extender' ), '<a href="' . esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings§ion=general-settings' ) ) . '" title="' . __( 'General Settings', 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'enter a valid MailChimp API key', 'yikes-inc-easy-mailchimp-extender' ) . '</a>' ); |
|
117 | 117 | ?> |
118 | 118 | </div> |
119 | 119 | <?php |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | <div class="inside"> |
125 | 125 | |
126 | 126 | <p> |
127 | - <?php _e( 'Select which plugins or features Easy Forms for MailChimp by Yikes Inc. should integrate with. Depending on which plugins or features you choose to integrate with, an opt-in checkbox will be generated. For example, the comment form checkbox will generate a checkbox below the standard WordPress comment form to add any new commenters to a pre-determined MailChimp mailing list.' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
127 | + <?php _e( 'Select which plugins or features Easy Forms for MailChimp by Yikes Inc. should integrate with. Depending on which plugins or features you choose to integrate with, an opt-in checkbox will be generated. For example, the comment form checkbox will generate a checkbox below the standard WordPress comment form to add any new commenters to a pre-determined MailChimp mailing list.', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
128 | 128 | </p> |
129 | 129 | |
130 | 130 | <!-- Settings Form --> |
@@ -134,54 +134,54 @@ discard block |
||
134 | 134 | |
135 | 135 | <ul> |
136 | 136 | <?php |
137 | - if( !empty( $active_plugins ) ) { |
|
137 | + if ( ! empty( $active_plugins ) ) { |
|
138 | 138 | |
139 | - foreach( $active_plugins as $class => $value ) { |
|
139 | + foreach ( $active_plugins as $class => $value ) { |
|
140 | 140 | // echo $class; |
141 | - $checked = isset( $options[$class]['value'] ) ? 'checked="checked"' : ''; |
|
142 | - $hidden = !isset( $options[$class]['value'] ) ? 'yikes-easy-mc-hidden' : ''; |
|
143 | - $checkbox_label = isset( $options[$class]['label'] ) ? esc_attr__( $options[$class]['label'] ) : ''; |
|
144 | - $precheck_checkbox = isset( $options[$class]['precheck'] ) ? $options[$class]['precheck'] : ''; |
|
145 | - $selected_list = isset( $options[$class]['associated-list'] ) ? $options[$class]['associated-list'] : '-'; |
|
146 | - $list_interest_groups = isset( $options[$class]['interest-groups'] ) ? $options[$class]['interest-groups'] : false; |
|
141 | + $checked = isset( $options[ $class ][ 'value' ] ) ? 'checked="checked"' : ''; |
|
142 | + $hidden = ! isset( $options[ $class ][ 'value' ] ) ? 'yikes-easy-mc-hidden' : ''; |
|
143 | + $checkbox_label = isset( $options[ $class ][ 'label' ] ) ? esc_attr__( $options[ $class ][ 'label' ] ) : ''; |
|
144 | + $precheck_checkbox = isset( $options[ $class ][ 'precheck' ] ) ? $options[ $class ][ 'precheck' ] : ''; |
|
145 | + $selected_list = isset( $options[ $class ][ 'associated-list' ] ) ? $options[ $class ][ 'associated-list' ] : '-'; |
|
146 | + $list_interest_groups = isset( $options[ $class ][ 'interest-groups' ] ) ? $options[ $class ][ 'interest-groups' ] : false; |
|
147 | 147 | ?> |
148 | 148 | <li> |
149 | 149 | <label> |
150 | - <input type="checkbox" name="optin-checkbox-init[<?php echo $class; ?>][value]" value="on" <?php echo $checked; ?> onclick="jQuery(this).parents('li').next().stop().slideToggle();"><?php echo ucwords( $value ); ?><span class="dashicons dashicons-editor-help"></span><div class="tooltiptext qtip-bootstrap" style="display:none;"><?php echo $class_descriptions[$class]; ?></div> |
|
150 | + <input type="checkbox" name="optin-checkbox-init[<?php echo $class; ?>][value]" value="on" <?php echo $checked; ?> onclick="jQuery(this).parents('li').next().stop().slideToggle();"><?php echo ucwords( $value ); ?><span class="dashicons dashicons-editor-help"></span><div class="tooltiptext qtip-bootstrap" style="display:none;"><?php echo $class_descriptions[ $class ]; ?></div> |
|
151 | 151 | </label> |
152 | 152 | </li> |
153 | 153 | <!-- checkbox settings, text - associated list etc. --> |
154 | 154 | <li class="optin-checkbox-init[<?php echo $class; ?>]-settings <?php echo $hidden; ?>"> |
155 | - <?php if( $class == 'contact_form_7' ) { ?> |
|
155 | + <?php if ( $class == 'contact_form_7' ) { ?> |
|
156 | 156 | <p style="margin-top:0;"><small class="contact-form-7-notice"><?php printf( __( 'Use %s in Contact Form 7 to display the checkbox.', 'yikes-inc-easy-mailchimp-extender' ), '<code>[yikes_mailchimp_checkbox]</code>' ); ?></small></p> |
157 | 157 | <?php } ?> |
158 | 158 | <p style="margin-top:0;padding-top:0;margin-bottom:0;padding-bottom:0;"> |
159 | 159 | <!-- checkbox associated list --> |
160 | - <label><?php _e( 'Associated List' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
160 | + <label><?php _e( 'Associated List', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
161 | 161 | <?php |
162 | - if( $list_data['total'] > 0 ) { |
|
162 | + if ( $list_data[ 'total' ] > 0 ) { |
|
163 | 163 | ?> |
164 | 164 | <select class="optin-checkbox-init[<?php echo $class; ?>][associated-list] checkbox-settings-list-dropdown" data-attr-integration="<?php echo $class; ?>" name="optin-checkbox-init[<?php echo $class; ?>][associated-list]" onchange="checkForInterestGroups( jQuery( this ), jQuery( this ).find( 'option:selected' ).val(), jQuery( this ).attr( 'data-attr-integration' ) );return false;"> |
165 | - <option value="-" <?php selected( $selected_list , '-' ); ?>><?php _e( 'Select a List' , 'yikes-inc-easy-mailchimp-extender' ); ?></option> |
|
166 | - <?php foreach( $list_data['data'] as $list ) { ?> |
|
167 | - <option value="<?php echo $list['id']; ?>" <?php selected( $selected_list , $list['id'] ); ?>><?php echo $list['name']; ?></option> |
|
165 | + <option value="-" <?php selected( $selected_list, '-' ); ?>><?php _e( 'Select a List', 'yikes-inc-easy-mailchimp-extender' ); ?></option> |
|
166 | + <?php foreach ( $list_data[ 'data' ] as $list ) { ?> |
|
167 | + <option value="<?php echo $list[ 'id' ]; ?>" <?php selected( $selected_list, $list[ 'id' ] ); ?>><?php echo $list[ 'name' ]; ?></option> |
|
168 | 168 | <?php } ?> |
169 | 169 | </select> |
170 | 170 | <?php |
171 | 171 | } else { |
172 | - echo '<p class="description no-lists-setup-notice"><strong>' . __( 'You have not setup any lists. You should head over to MailChimp and setup your first list.' , 'yikes-inc-easy-mailchimp-extender' ) . '</strong></p>'; |
|
172 | + echo '<p class="description no-lists-setup-notice"><strong>' . __( 'You have not setup any lists. You should head over to MailChimp and setup your first list.', 'yikes-inc-easy-mailchimp-extender' ) . '</strong></p>'; |
|
173 | 173 | } |
174 | 174 | ?> |
175 | 175 | </label> |
176 | 176 | <!-- checkbox text label --> |
177 | - <label><?php _e( 'Checkbox Label' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
177 | + <label><?php _e( 'Checkbox Label', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
178 | 178 | <input type="text" class="optin-checkbox-init[<?php echo $class; ?>][label] optin-checkbox-label-input" name="optin-checkbox-init[<?php echo $class; ?>][label]" value="<?php echo $checkbox_label; ?>"> |
179 | 179 | </label> |
180 | 180 | <!-- prechecked? --> |
181 | - <label><?php _e( 'Precheck Checkbox' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
181 | + <label><?php _e( 'Precheck Checkbox', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
182 | 182 | <select id="optin-checkbox-init[<?php echo $class; ?>][precheck]" name="optin-checkbox-init[<?php echo $class; ?>][precheck]" class="optin-checkbox-init[<?php echo $class; ?>][precheck] checkbox-settings-list-dropdown"> |
183 | - <option value="true" <?php selected( $precheck_checkbox , 'true' ); ?>><?php _e( 'Yes' , 'yikes-inc-easy-mailchimp-extender' ); ?></option> |
|
184 | - <option value="false" <?php selected( $precheck_checkbox , 'false' ); ?>><?php _e( 'No' , 'yikes-inc-easy-mailchimp-extender' ); ?></option> |
|
183 | + <option value="true" <?php selected( $precheck_checkbox, 'true' ); ?>><?php _e( 'Yes', 'yikes-inc-easy-mailchimp-extender' ); ?></option> |
|
184 | + <option value="false" <?php selected( $precheck_checkbox, 'false' ); ?>><?php _e( 'No', 'yikes-inc-easy-mailchimp-extender' ); ?></option> |
|
185 | 185 | </select> |
186 | 186 | </label> |
187 | 187 | |
@@ -192,8 +192,8 @@ discard block |
||
192 | 192 | $interest_groupings = get_transient( $selected_list . '_interest_group' ); |
193 | 193 | $integration_type = $class; |
194 | 194 | require( YIKES_MC_PATH . 'admin/partials/menu/options-sections/templates/integration-interest-groups.php' ); |
195 | - } else if( $selected_list != '-' && $list_interest_groups ) { |
|
196 | - $list_id = $options[$class]['associated-list']; |
|
195 | + } else if ( $selected_list != '-' && $list_interest_groups ) { |
|
196 | + $list_id = $options[ $class ][ 'associated-list' ]; |
|
197 | 197 | $integration_type = $class; |
198 | 198 | YIKES_Inc_Easy_MailChimp_Process_Ajax::check_list_for_interest_groups( $list_id, $integration_type, true ); |
199 | 199 | } |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | } else { |
209 | 209 | ?> |
210 | 210 | <li> |
211 | - <?php _e( 'Nothing is active.' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
211 | + <?php _e( 'Nothing is active.', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
212 | 212 | </li> |
213 | 213 | <?php |
214 | 214 | } |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | General Settings Options Template |
3 | 3 | -- yea |
4 | 4 | --> |
5 | -<h3><span><?php _e( 'General Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?></span><?php echo $api_connection; ?></h3> |
|
5 | +<h3><span><?php _e( 'General Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></span><?php echo $api_connection; ?></h3> |
|
6 | 6 | <div class="inside"> |
7 | 7 | |
8 | 8 | <!-- Settings Form --> |
@@ -15,15 +15,15 @@ discard block |
||
15 | 15 | <!-- MailChimp API Input Field --> |
16 | 16 | <label for="yks-mailchimp-api-key"> |
17 | 17 | |
18 | - <p><?php _e( 'Enter your API key in the field below to connect your site to your MailChimp account.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
18 | + <p><?php _e( 'Enter your API key in the field below to connect your site to your MailChimp account.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
19 | 19 | |
20 | - <p><strong><?php _e( 'MailChimp API Key' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></p> |
|
20 | + <p><strong><?php _e( 'MailChimp API Key', 'yikes-inc-easy-mailchimp-extender' ); ?></strong></p> |
|
21 | 21 | |
22 | - <input autocomplete="off" <?php if( strlen( trim( get_option( 'yikes-mc-api-key' , '' ) ) ) > 0 ) { ?> type="password" <?php } else { ?> type="text" <?php } ?> value="<?php echo trim( get_option( 'yikes-mc-api-key' , '' ) ); ?>" placeholder="<?php _e( 'MailChimp API Key' , 'yikes-inc-easy-mailchimp-extender' ); ?>" name="yikes-mc-api-key" id="yikes-mc-api-key" class="settings-page-input" /> |
|
22 | + <input autocomplete="off" <?php if ( strlen( trim( get_option( 'yikes-mc-api-key', '' ) ) ) > 0 ) { ?> type="password" <?php } else { ?> type="text" <?php } ?> value="<?php echo trim( get_option( 'yikes-mc-api-key', '' ) ); ?>" placeholder="<?php _e( 'MailChimp API Key', 'yikes-inc-easy-mailchimp-extender' ); ?>" name="yikes-mc-api-key" id="yikes-mc-api-key" class="settings-page-input" /> |
|
23 | 23 | |
24 | 24 | <?php echo $api_error_response; ?> |
25 | 25 | |
26 | - <p class="description"><small><a href="https://admin.mailchimp.com/account/api" target="_blank" title="<?php _e( 'Get your API key here' , 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'Get your API key here' , 'yikes-inc-easy-mailchimp-extender' ); ?></a></small></p> |
|
26 | + <p class="description"><small><a href="https://admin.mailchimp.com/account/api" target="_blank" title="<?php _e( 'Get your API key here', 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'Get your API key here', 'yikes-inc-easy-mailchimp-extender' ); ?></a></small></p> |
|
27 | 27 | |
28 | 28 | </label> |
29 | 29 |
@@ -4,7 +4,7 @@ discard block |
||
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 |
||
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 |
||
35 | 35 | ) |
36 | 36 | ); |
37 | 37 | ?> |
38 | - <h2><?php _e( "Debug Log" , 'yikes-inc-easy-mailchimp-extender' ); ?> <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' ); ?> <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 --> |
@@ -12,16 +12,16 @@ discard block |
||
12 | 12 | |
13 | 13 | ?> |
14 | 14 | |
15 | -<h3><span><?php _e( 'reCAPTCHA Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3> |
|
15 | +<h3><span><?php _e( 'reCAPTCHA Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3> |
|
16 | 16 | |
17 | 17 | <div class="inside"> |
18 | 18 | |
19 | 19 | <p> |
20 | - <?php _e( 'reCAPTCHA is a free CAPTCHA service, from Google, that helps protect your site against spam, malicious registrations and other forms of attacks where computers try to disguise themselves as a human. reCAPTCHA will help prevent spammers and bots from submitting data through your MailChimp forms.' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
20 | + <?php _e( 'reCAPTCHA is a free CAPTCHA service, from Google, that helps protect your site against spam, malicious registrations and other forms of attacks where computers try to disguise themselves as a human. reCAPTCHA will help prevent spammers and bots from submitting data through your MailChimp forms.', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
21 | 21 | </p> |
22 | 22 | |
23 | 23 | <p> |
24 | - <?php echo '<a href="https://www.google.com/recaptcha/admin" target="_blank" title="' . __( 'Get your reCAPTCHA API Key' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Get Your reCAPTCHA API Key' , 'yikes-inc-easy-mailchimp-extender' ) . '</a>'; ?> |
|
24 | + <?php echo '<a href="https://www.google.com/recaptcha/admin" target="_blank" title="' . __( 'Get your reCAPTCHA API Key', 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Get Your reCAPTCHA API Key', 'yikes-inc-easy-mailchimp-extender' ) . '</a>'; ?> |
|
25 | 25 | </p> |
26 | 26 | |
27 | 27 | <!-- Settings Form --> |
@@ -29,21 +29,21 @@ discard block |
||
29 | 29 | |
30 | 30 | <?php settings_fields( 'yikes_inc_easy_mc_recaptcha_settings_page' ); ?> |
31 | 31 | |
32 | - <label for="yikes-mc-recaptcha-setting"><strong><?php _e( 'Enable reCAPTCHA Protection' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
33 | - <input type="checkbox" name="yikes-mc-recaptcha-status" class="recaptcha-setting-checkbox" value="1" <?php checked( get_option( 'yikes-mc-recaptcha-status' , '' ) , '1' ); ?>> |
|
32 | + <label for="yikes-mc-recaptcha-setting"><strong><?php _e( 'Enable reCAPTCHA Protection', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
33 | + <input type="checkbox" name="yikes-mc-recaptcha-status" class="recaptcha-setting-checkbox" value="1" <?php checked( get_option( 'yikes-mc-recaptcha-status', '' ), '1' ); ?>> |
|
34 | 34 | </label> |
35 | 35 | |
36 | - <label for="yikes-mc-recaptcha-api-key"><strong><?php _e( 'reCAPTCHA Site Key' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
37 | - <input type="text" class="widefat recaptcha-setting-checkbox" name="yikes-mc-recaptcha-site-key" value="<?php echo esc_attr( get_option( 'yikes-mc-recaptcha-site-key' , '' ) ); ?>"> |
|
36 | + <label for="yikes-mc-recaptcha-api-key"><strong><?php _e( 'reCAPTCHA Site Key', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
37 | + <input type="text" class="widefat recaptcha-setting-checkbox" name="yikes-mc-recaptcha-site-key" value="<?php echo esc_attr( get_option( 'yikes-mc-recaptcha-site-key', '' ) ); ?>"> |
|
38 | 38 | </label> |
39 | 39 | |
40 | - <label for="yikes-mc-recaptcha-private-api-key"><strong><?php _e( 'reCAPTCHA Secret Key' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
41 | - <input type="text" class="widefat recaptcha-setting-checkbox" name="yikes-mc-recaptcha-secret-key" id="" value="<?php echo esc_attr( get_option( 'yikes-mc-recaptcha-secret-key' , '' ) ); ?>"> |
|
40 | + <label for="yikes-mc-recaptcha-private-api-key"><strong><?php _e( 'reCAPTCHA Secret Key', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
41 | + <input type="text" class="widefat recaptcha-setting-checkbox" name="yikes-mc-recaptcha-secret-key" id="" value="<?php echo esc_attr( get_option( 'yikes-mc-recaptcha-secret-key', '' ) ); ?>"> |
|
42 | 42 | </label> |
43 | 43 | |
44 | - <a href="#" onclick="jQuery(this).next().slideToggle();return false;" class="recaptcha-preview-link"><?php _e( 'View reCAPTCHA Preview' , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
44 | + <a href="#" onclick="jQuery(this).next().slideToggle();return false;" class="recaptcha-preview-link"><?php _e( 'View reCAPTCHA Preview', 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
45 | 45 | <span class="recaptcha-preview-container"> |
46 | - <img src="<?php echo YIKES_MC_URL . 'includes/images/recaptcha/recaptcha-demo.gif'; ?>" alt="<?php _e( 'reCAPTCHA Preview' , 'yikes-inc-easy-mailchimp-extender' ); ?>" class="recaptcha-demo-gif"> |
|
46 | + <img src="<?php echo YIKES_MC_URL . 'includes/images/recaptcha/recaptcha-demo.gif'; ?>" alt="<?php _e( 'reCAPTCHA Preview', 'yikes-inc-easy-mailchimp-extender' ); ?>" class="recaptcha-demo-gif"> |
|
47 | 47 | </span> |
48 | 48 | |
49 | 49 |