@@ -6,13 +6,13 @@ discard block |
||
6 | 6 | $all_forms = $form_interface->get_all_forms(); |
7 | 7 | |
8 | 8 | /* Store Data if User is Authorized */ |
9 | -if( $this->is_user_mc_api_valid_form( false ) == 'valid' ) { |
|
9 | +if ( $this->is_user_mc_api_valid_form( false ) == 'valid' ) { |
|
10 | 10 | $list_data = yikes_get_mc_api_manager()->get_list_handler()->get_lists(); |
11 | 11 | if ( is_wp_error( $list_data ) ) { |
12 | 12 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
13 | 13 | $error_logging->maybe_write_to_log( |
14 | 14 | $list_data->get_error_code(), |
15 | - __( "Get Account Lists" , 'yikes-inc-easy-mailchimp-extender' ), |
|
15 | + __( "Get Account Lists", 'yikes-inc-easy-mailchimp-extender' ), |
|
16 | 16 | "Manage Forms Page" |
17 | 17 | ); |
18 | 18 | $list_data = array(); |
@@ -23,24 +23,24 @@ discard block |
||
23 | 23 | ?> |
24 | 24 | <div class="wrap yikes-easy-mc-wrap"> |
25 | 25 | <!-- Freddie Logo --> |
26 | - <img src="<?php echo YIKES_MC_URL . 'includes/images/Mailchimp_Assets/Freddie_60px.png'; ?>" alt="<?php _e( 'Freddie - Mailchimp Mascot' , 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-mc-freddie-logo" /> |
|
26 | + <img src="<?php echo YIKES_MC_URL . 'includes/images/Mailchimp_Assets/Freddie_60px.png'; ?>" alt="<?php _e( 'Freddie - Mailchimp Mascot', 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-mc-freddie-logo" /> |
|
27 | 27 | |
28 | - <h1>Easy Forms for Mailchimp | <?php _e( 'Manage Forms' , 'yikes-inc-easy-mailchimp-extender' ) ?></h1> |
|
28 | + <h1>Easy Forms for Mailchimp | <?php _e( 'Manage Forms', 'yikes-inc-easy-mailchimp-extender' ) ?></h1> |
|
29 | 29 | |
30 | 30 | <!-- Settings Page Description --> |
31 | - <p class="yikes-easy-mc-about-text about-text"><?php _e( 'Create and manage your Mailchimp forms.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
31 | + <p class="yikes-easy-mc-about-text about-text"><?php _e( 'Create and manage your Mailchimp forms.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
32 | 32 | |
33 | 33 | <!-- Action Notices --> |
34 | 34 | <?php |
35 | 35 | |
36 | 36 | /* If the user hasn't authenticated yet, lets kill off */ |
37 | - if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) != 'valid_api_key' ) { |
|
38 | - wp_die( '<div class="error"><p>' . sprintf( __( 'You need to connect to Mailchimp before you can start creating forms. Head over to the <a href="%s" title="Settings Page">Settings Page</a> and enter your API key.' , 'yikes-inc-easy-mailchimp-extender' ), esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings' ) ) ) . '</p></div>' , 500 ); |
|
37 | + if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) != 'valid_api_key' ) { |
|
38 | + wp_die( '<div class="error"><p>' . sprintf( __( 'You need to connect to Mailchimp before you can start creating forms. Head over to the <a href="%s" title="Settings Page">Settings Page</a> and enter your API key.', 'yikes-inc-easy-mailchimp-extender' ), esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings' ) ) ) . '</p></div>', 500 ); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | /* Display our admin notices here */ |
42 | 42 | // delete form success |
43 | - if( isset( $_REQUEST['deleted-form'] ) && $_REQUEST['deleted-form'] == 'true' ) { |
|
43 | + if ( isset( $_REQUEST[ 'deleted-form' ] ) && $_REQUEST[ 'deleted-form' ] == 'true' ) { |
|
44 | 44 | ?> |
45 | 45 | <div class="updated manage-form-admin-notice"> |
46 | 46 | <p><?php _e( 'Opt-in form successfully deleted.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | <?php |
49 | 49 | } |
50 | 50 | // duplicate form success |
51 | - if( isset( $_REQUEST['duplicated-form'] ) && $_REQUEST['duplicated-form'] == 'true' ) { |
|
51 | + if ( isset( $_REQUEST[ 'duplicated-form' ] ) && $_REQUEST[ 'duplicated-form' ] == 'true' ) { |
|
52 | 52 | ?> |
53 | 53 | <div class="updated manage-form-admin-notice"> |
54 | 54 | <p><?php _e( 'Mailchimp Form successfully cloned.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | <?php |
57 | 57 | } |
58 | 58 | // duplicate form error |
59 | - if( isset( $_REQUEST['duplicated-form'] ) && $_REQUEST['duplicated-form'] == 'false' ) { |
|
59 | + if ( isset( $_REQUEST[ 'duplicated-form' ] ) && $_REQUEST[ 'duplicated-form' ] == 'false' ) { |
|
60 | 60 | ?> |
61 | 61 | <div class="error manage-form-admin-notice"> |
62 | 62 | <p><?php _e( 'There was an error trying to clone your form. Please try again. If this error persists, please contact the YIKES Inc. support team.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | <?php |
65 | 65 | } |
66 | 66 | // reset form submission stats success |
67 | - if( isset( $_REQUEST['reset-stats'] ) && $_REQUEST['reset-stats'] == 'true' ) { |
|
67 | + if ( isset( $_REQUEST[ 'reset-stats' ] ) && $_REQUEST[ 'reset-stats' ] == 'true' ) { |
|
68 | 68 | ?> |
69 | 69 | <div class="updated manage-form-admin-notice"> |
70 | 70 | <p><?php _e( 'Form submission stats/rates successfully reset.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | <?php |
73 | 73 | } |
74 | 74 | // reset form submission stats error |
75 | - if( isset( $_REQUEST['reset-stats'] ) && $_REQUEST['reset-stats'] == 'false' ) { |
|
75 | + if ( isset( $_REQUEST[ 'reset-stats' ] ) && $_REQUEST[ 'reset-stats' ] == 'false' ) { |
|
76 | 76 | ?> |
77 | 77 | <div class="error manage-form-admin-notice"> |
78 | 78 | <p><?php _e( 'There was an error trying to reset the form submission stats/rates. Please try again. If this error persists, please contact the YIKES Inc. support team.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
@@ -99,13 +99,13 @@ discard block |
||
99 | 99 | <thead> |
100 | 100 | <tr> |
101 | 101 | <th id="cb" class="manage-column column-cb check-column num" scope="col"><input type="checkbox" /></th> |
102 | - <th id="columnname" class="manage-column column-columnname num yikes-form-id-number" scope="col"><?php _e( 'ID' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
103 | - <th id="columnname" class="manage-column column-columnname" scope="col"><?php _e( 'Form Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
104 | - <th id="columnname" class="manage-column column-columnname" scope="col"><?php _e( 'Form Description' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
105 | - <th id="columnname" class="manage-column column-columnname" scope="col"><?php _e( 'List' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
106 | - <th id="columnname" class="manage-column column-columnname num" scope="col"><?php _e( 'Impressions' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
107 | - <th id="columnname" class="manage-column column-columnname num" scope="col" ><?php _e( 'Submissions' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
108 | - <th id="columnname" class="manage-column column-columnname num" scope="col"><?php _e( 'Conversion Rate' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
102 | + <th id="columnname" class="manage-column column-columnname num yikes-form-id-number" scope="col"><?php _e( 'ID', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
103 | + <th id="columnname" class="manage-column column-columnname" scope="col"><?php _e( 'Form Name', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
104 | + <th id="columnname" class="manage-column column-columnname" scope="col"><?php _e( 'Form Description', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
105 | + <th id="columnname" class="manage-column column-columnname" scope="col"><?php _e( 'List', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
106 | + <th id="columnname" class="manage-column column-columnname num" scope="col"><?php _e( 'Impressions', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
107 | + <th id="columnname" class="manage-column column-columnname num" scope="col" ><?php _e( 'Submissions', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
108 | + <th id="columnname" class="manage-column column-columnname num" scope="col"><?php _e( 'Conversion Rate', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
109 | 109 | </tr> |
110 | 110 | </thead> |
111 | 111 | <!-- end header --> |
@@ -114,13 +114,13 @@ discard block |
||
114 | 114 | <tfoot> |
115 | 115 | <tr> |
116 | 116 | <th class="manage-column column-cb check-column num" scope="col"><input type="checkbox" /></th> |
117 | - <th id="columnname" class="manage-column column-columnname num yikes-form-id-number" scope="col"><?php _e( 'ID' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
118 | - <th id="columnname" class="manage-column column-columnname" scope="col"><?php _e( 'Form Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
119 | - <th id="columnname" class="manage-column column-columnname" scope="col"><?php _e( 'Form Description' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
120 | - <th class="manage-column column-columnname" scope="col"><?php _e( 'List' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
121 | - <th id="columnname" class="manage-column column-columnname num" scope="col"><?php _e( 'Impressions' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
122 | - <th id="columnname" class="manage-column column-columnname num" scope="col"><?php _e( 'Submissions' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
123 | - <th id="columnname" class="manage-column column-columnname num" scope="col"><?php _e( 'Conversion Rate' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
117 | + <th id="columnname" class="manage-column column-columnname num yikes-form-id-number" scope="col"><?php _e( 'ID', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
118 | + <th id="columnname" class="manage-column column-columnname" scope="col"><?php _e( 'Form Name', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
119 | + <th id="columnname" class="manage-column column-columnname" scope="col"><?php _e( 'Form Description', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
120 | + <th class="manage-column column-columnname" scope="col"><?php _e( 'List', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
121 | + <th id="columnname" class="manage-column column-columnname num" scope="col"><?php _e( 'Impressions', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
122 | + <th id="columnname" class="manage-column column-columnname num" scope="col"><?php _e( 'Submissions', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
123 | + <th id="columnname" class="manage-column column-columnname num" scope="col"><?php _e( 'Conversion Rate', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
124 | 124 | </tr> |
125 | 125 | </tfoot> |
126 | 126 | <!-- end footer --> |
@@ -130,40 +130,40 @@ discard block |
||
130 | 130 | <?php |
131 | 131 | if ( count( $all_forms ) > 0 ) { |
132 | 132 | $i = 1; |
133 | - foreach( $all_forms as $id => $form ) { |
|
133 | + foreach ( $all_forms as $id => $form ) { |
|
134 | 134 | ?> |
135 | - <tr class="<?php if( $i % 2 == 0 ) { echo 'alternate'; } ?>"> |
|
135 | + <tr class="<?php if ( $i % 2 == 0 ) { echo 'alternate'; } ?>"> |
|
136 | 136 | <th class="check-column num" scope="row"><input type="checkbox" /></th> |
137 | 137 | <td class="column-columnname num"><span class="form-id-container"><?php echo intval( $id ); ?></span></td> |
138 | 138 | <td class="column-columnname"> |
139 | 139 | <!-- row title/link --> |
140 | - <a href="<?php echo esc_url_raw( add_query_arg( array( 'id' => $id ) , admin_url( 'admin.php?page=yikes-mailchimp-edit-form' ) ) ); ?>" class="row-title"> |
|
141 | - <?php echo stripslashes( $form['form_name'] ); ?> |
|
140 | + <a href="<?php echo esc_url_raw( add_query_arg( array( 'id' => $id ), admin_url( 'admin.php?page=yikes-mailchimp-edit-form' ) ) ); ?>" class="row-title"> |
|
141 | + <?php echo stripslashes( $form[ 'form_name' ] ); ?> |
|
142 | 142 | </a> |
143 | 143 | <div class="row-actions"> |
144 | - <span><a href="<?php echo esc_url_raw( add_query_arg( array( 'id' => $id ) , admin_url( 'admin.php?page=yikes-mailchimp-edit-form' ) ) ); ?>"><?php _e( "Edit" , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |</span> |
|
145 | - <span><a href="<?php echo esc_url_raw( add_query_arg( array( 'action' => 'yikes-easy-mc-duplicate-form', 'mailchimp-form' => $id , 'nonce' => wp_create_nonce( 'duplicate-mailchimp-form-'.$id ) ) , admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ) ); ?>"><?php _e( "Duplicate" , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |</span> |
|
146 | - <span><a href="<?php echo esc_url_raw( add_query_arg( array( 'action' => 'yikes-easy-mc-reset-stats', 'mailchimp-form' => $id , 'nonce' => wp_create_nonce( 'reset-stats-mailchimp-form-'.$id ) ) , admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ) ); ?>"><?php _e( "Reset Stats" , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |</span> |
|
147 | - <span><a href="#" class="view-yikes-mc-form-shortcode" data-alt-text="<?php _e( 'Stats' , 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( "Shortcode" , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |</span> |
|
144 | + <span><a href="<?php echo esc_url_raw( add_query_arg( array( 'id' => $id ), admin_url( 'admin.php?page=yikes-mailchimp-edit-form' ) ) ); ?>"><?php _e( "Edit", 'yikes-inc-easy-mailchimp-extender' ); ?></a> |</span> |
|
145 | + <span><a href="<?php echo esc_url_raw( add_query_arg( array( 'action' => 'yikes-easy-mc-duplicate-form', 'mailchimp-form' => $id, 'nonce' => wp_create_nonce( 'duplicate-mailchimp-form-' . $id ) ), admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ) ); ?>"><?php _e( "Duplicate", 'yikes-inc-easy-mailchimp-extender' ); ?></a> |</span> |
|
146 | + <span><a href="<?php echo esc_url_raw( add_query_arg( array( 'action' => 'yikes-easy-mc-reset-stats', 'mailchimp-form' => $id, 'nonce' => wp_create_nonce( 'reset-stats-mailchimp-form-' . $id ) ), admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ) ); ?>"><?php _e( "Reset Stats", 'yikes-inc-easy-mailchimp-extender' ); ?></a> |</span> |
|
147 | + <span><a href="#" class="view-yikes-mc-form-shortcode" data-alt-text="<?php _e( 'Stats', 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( "Shortcode", 'yikes-inc-easy-mailchimp-extender' ); ?></a> |</span> |
|
148 | 148 | <?php |
149 | 149 | /* |
150 | 150 | * Custom action to allow users to add additional action links |
151 | 151 | * to each form. We use this in our add-ons. |
152 | 152 | * - Delete should remain last |
153 | 153 | */ |
154 | - do_action( 'yikes-mailchimp-custom-form-actions' , $id ); |
|
154 | + do_action( 'yikes-mailchimp-custom-form-actions', $id ); |
|
155 | 155 | ?> |
156 | - <span><a href="<?php echo esc_url_raw( add_query_arg( array( 'action' => 'yikes-easy-mc-delete-form', 'mailchimp-form' => $id , 'nonce' => wp_create_nonce( 'delete-mailchimp-form-'.$id ) ) , admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ) ); ?>" class="yikes-delete-mailchimp-form" onclick="return confirm('<?php printf( __( 'Are you sure you want to delete the %s form? This cannot be undone.' , 'yikes-inc-easy-mailchimp-extender' ), stripslashes( $form['form_name'] ) ); ?>');"><?php _e( "Delete" , 'yikes-inc-easy-mailchimp-extender' ); ?></a></span> |
|
156 | + <span><a href="<?php echo esc_url_raw( add_query_arg( array( 'action' => 'yikes-easy-mc-delete-form', 'mailchimp-form' => $id, 'nonce' => wp_create_nonce( 'delete-mailchimp-form-' . $id ) ), admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ) ); ?>" class="yikes-delete-mailchimp-form" onclick="return confirm('<?php printf( __( 'Are you sure you want to delete the %s form? This cannot be undone.', 'yikes-inc-easy-mailchimp-extender' ), stripslashes( $form[ 'form_name' ] ) ); ?>');"><?php _e( "Delete", 'yikes-inc-easy-mailchimp-extender' ); ?></a></span> |
|
157 | 157 | </div> |
158 | 158 | </td> |
159 | 159 | |
160 | - <td class="column-columnname"><?php echo isset( $form['form_description'] ) ? str_replace( '[yikes-mailchimp-subscriber-count]', do_shortcode( '[yikes-mailchimp-subscriber-count form="' . $id . '"]' ), $form['form_description'] ) : ''; ?></td> |
|
160 | + <td class="column-columnname"><?php echo isset( $form[ 'form_description' ] ) ? str_replace( '[yikes-mailchimp-subscriber-count]', do_shortcode( '[yikes-mailchimp-subscriber-count form="' . $id . '"]' ), $form[ 'form_description' ] ) : ''; ?></td> |
|
161 | 161 | <td class="column-columnname"> |
162 | 162 | <?php |
163 | 163 | if ( $list_data && count( $list_data ) > 0 ) { |
164 | 164 | $parsed = wp_list_pluck( $list_data, 'name', 'id' ); |
165 | - if ( isset( $parsed[ $form['list_id'] ] ) ) { |
|
166 | - echo esc_textarea( $parsed[ $form['list_id'] ] ); |
|
165 | + if ( isset( $parsed[ $form[ 'list_id' ] ] ) ) { |
|
166 | + echo esc_textarea( $parsed[ $form[ 'list_id' ] ] ); |
|
167 | 167 | } else { |
168 | 168 | echo '<strong>' . __( 'List Not Found', 'yikes-inc-easy-mailchimp-extender' ) . '</strong>'; |
169 | 169 | } |
@@ -172,25 +172,25 @@ discard block |
||
172 | 172 | |
173 | 173 | <td class="column-columnname num stat-container"> |
174 | 174 | <?php |
175 | - $impressions = number_format( $form['impressions'] ); |
|
176 | - echo '<span title="' . __( 'Impressions' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . $impressions . '</span>'; |
|
175 | + $impressions = number_format( $form[ 'impressions' ] ); |
|
176 | + echo '<span title="' . __( 'Impressions', 'yikes-inc-easy-mailchimp-extender' ) . '">' . $impressions . '</span>'; |
|
177 | 177 | ?> |
178 | 178 | </td> |
179 | 179 | <td class="column-columnname num stat-container"> |
180 | 180 | <?php |
181 | - $submissions = number_format( $form['submissions'] ); |
|
182 | - echo '<span title="' . __( 'Submissions' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . $submissions . '</span>'; |
|
181 | + $submissions = number_format( $form[ 'submissions' ] ); |
|
182 | + echo '<span title="' . __( 'Submissions', 'yikes-inc-easy-mailchimp-extender' ) . '">' . $submissions . '</span>'; |
|
183 | 183 | ?> |
184 | 184 | </td> |
185 | 185 | <td class="column-columnname num stat-container"> |
186 | 186 | <?php |
187 | - if( $impressions != 0 ) { |
|
188 | - $conversion_rate = ( round( 100 * $form['submissions'] / $form['impressions'] , 3 ) ); |
|
189 | - if( $conversion_rate >= '15' ) { |
|
187 | + if ( $impressions != 0 ) { |
|
188 | + $conversion_rate = ( round( 100 * $form[ 'submissions' ] / $form[ 'impressions' ], 3 ) ); |
|
189 | + if ( $conversion_rate >= '15' ) { |
|
190 | 190 | $conversion_color = '#00cc00'; // green (unicorn!) |
191 | - } else if( $conversion_rate < '15' && $conversion_rate >= '10' ) { |
|
191 | + } else if ( $conversion_rate < '15' && $conversion_rate >= '10' ) { |
|
192 | 192 | $conversion_color = '#0080FF'; // light blue (good) |
193 | - } else if( $conversion_rate < '10' && $conversion_rate >= '5' ) { |
|
193 | + } else if ( $conversion_rate < '10' && $conversion_rate >= '5' ) { |
|
194 | 194 | $conversion_color = '#FFFF32'; // yellow (ok) |
195 | 195 | } else { |
196 | 196 | $conversion_color = '#FF0000'; // red (no bueno) |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | $conversion_rate = '0'; |
200 | 200 | $conversion_color = '#333333'; |
201 | 201 | } |
202 | - echo '<span style="color:' . esc_attr( $conversion_color ) . ';" title="' . esc_attr__( 'Conversion Rate' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . $conversion_rate . '%</span>'; |
|
202 | + echo '<span style="color:' . esc_attr( $conversion_color ) . ';" title="' . esc_attr__( 'Conversion Rate', 'yikes-inc-easy-mailchimp-extender' ) . '">' . $conversion_rate . '%</span>'; |
|
203 | 203 | ?> |
204 | 204 | </td> |
205 | 205 | <!-- shortcode --> |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | } |
213 | 213 | } else { ?> |
214 | 214 | <tr class="no-items"> |
215 | - <td class="colspanchange no-mailchimp-forms-found" colspan="8"><em><?php _e( 'No Mailchimp forms found. Use the form to the right to create a new one.' , 'yikes-inc-easy-mailchimp-extender' ); ?></em></td> |
|
215 | + <td class="colspanchange no-mailchimp-forms-found" colspan="8"><em><?php _e( 'No Mailchimp forms found. Use the form to the right to create a new one.', 'yikes-inc-easy-mailchimp-extender' ); ?></em></td> |
|
216 | 216 | </tr> |
217 | 217 | <?php } ?> |
218 | 218 | </tbody> |
@@ -9,21 +9,21 @@ |
||
9 | 9 | <div class="wrap yikes-easy-mc-support-wrap yikes-easy-mc-wrap"> |
10 | 10 | |
11 | 11 | <!-- Freddie Logo --> |
12 | - <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" /> |
|
12 | + <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" /> |
|
13 | 13 | |
14 | - <h1>Easy Forms for Mailchimp | <?php _e( 'Support' , 'yikes-inc-easy-mailchimp-extender' ); ?></h1> |
|
14 | + <h1>Easy Forms for Mailchimp | <?php _e( 'Support', 'yikes-inc-easy-mailchimp-extender' ); ?></h1> |
|
15 | 15 | <!-- Support Page Description --> |
16 | - <p class="yikes-easy-mc-about-text about-text"><?php _e( 'If you have questions, we have answers!' , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
16 | + <p class="yikes-easy-mc-about-text about-text"><?php _e( 'If you have questions, we have answers!', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
17 | 17 | |
18 | - <?php if( get_option( 'yikes-easy-mc-active-addons' , array() ) == array() ) { ?> |
|
19 | - <p><?php _e( 'Users of the free version of Easy Forms for Mailchimp can post questions to our support forum on the WordPress Plugin Directory. We aim to respond to support requests for the free version of the plugin within a week.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
20 | - <p><?php printf( __( 'Purchasers of our paid add-ons qualify for premium support. <a href="%s" target="_blank" title="' . __( 'Check out our paid add-ons', 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Check out our paid add-ons', 'yikes-inc-easy-mailchimp-extender' ) . '</a>!' , 'yikes-inc-easy-mailchimp-extender' ), esc_url( 'https://yikesplugins.com/' ) ); ?></p> |
|
18 | + <?php if ( get_option( 'yikes-easy-mc-active-addons', array() ) == array() ) { ?> |
|
19 | + <p><?php _e( 'Users of the free version of Easy Forms for Mailchimp can post questions to our support forum on the WordPress Plugin Directory. We aim to respond to support requests for the free version of the plugin within a week.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
20 | + <p><?php printf( __( 'Purchasers of our paid add-ons qualify for premium support. <a href="%s" target="_blank" title="' . __( 'Check out our paid add-ons', 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Check out our paid add-ons', 'yikes-inc-easy-mailchimp-extender' ) . '</a>!', 'yikes-inc-easy-mailchimp-extender' ), esc_url( 'https://yikesplugins.com/' ) ); ?></p> |
|
21 | 21 | <?php } else { ?> |
22 | - <p><?php _e( "It looks like you are one of our premium users! Fill out the form below to submit a priority support request." , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
23 | - <p><?php _e( "If you have any problems with the form, send an email to <a href='mailto:[email protected]'>[email protected]</a> and a ticket will be created." , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
22 | + <p><?php _e( "It looks like you are one of our premium users! Fill out the form below to submit a priority support request.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
23 | + <p><?php _e( "If you have any problems with the form, send an email to <a href='mailto:[email protected]'>[email protected]</a> and a ticket will be created.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
24 | 24 | <?php } ?> |
25 | 25 | |
26 | - <p><?php printf( __( 'Before submitting a support request, please visit our %s.' , 'yikes-inc-easy-mailchimp-extender' ), '<a target="_blank" href="' . esc_url( 'https://yikesplugins.com/support/knowledge-base/product/easy-forms-for-mailchimp/' ) . '" title="' . __( 'Knowledge Base', 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'knowledge base', 'yikes-inc-easy-mailchimp-extender' ) . '</a> where we have step-by-step guides and troubleshooting help' ); ?></p> |
|
26 | + <p><?php printf( __( 'Before submitting a support request, please visit our %s.', 'yikes-inc-easy-mailchimp-extender' ), '<a target="_blank" href="' . esc_url( 'https://yikesplugins.com/support/knowledge-base/product/easy-forms-for-mailchimp/' ) . '" title="' . __( 'Knowledge Base', 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'knowledge base', 'yikes-inc-easy-mailchimp-extender' ) . '</a> where we have step-by-step guides and troubleshooting help' ); ?></p> |
|
27 | 27 | |
28 | 28 | <hr /> |
29 | 29 |
@@ -7,12 +7,12 @@ |
||
7 | 7 | <div class="wrap yikes-easy-mc-wrap"> |
8 | 8 | |
9 | 9 | <!-- Freddie Logo --> |
10 | - <img src="<?php echo esc_url( YIKES_MC_URL . 'includes/images/Mailchimp_Assets/Freddie_60px.png' ); ?>" alt="<?php esc_attr_e( 'Freddie - Mailchimp Mascot' , 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-mc-freddie-logo" /> |
|
10 | + <img src="<?php echo esc_url( YIKES_MC_URL . 'includes/images/Mailchimp_Assets/Freddie_60px.png' ); ?>" alt="<?php esc_attr_e( 'Freddie - Mailchimp Mascot', 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-mc-freddie-logo" /> |
|
11 | 11 | |
12 | - <h1>Easy Forms for Mailchimp | <?php echo esc_attr__( 'Add-Ons' , 'yikes-inc-easy-mailchimp-extender' ); ?> <a href="https://yikesplugins.com/plugins/?plugins=Mailchimp" target="_blank" class="button-primary coming-soon-button" title="<?php esc_attr_e( 'View All Add-Ons' , 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php esc_attr_e( 'View All Add-Ons' , 'yikes-inc-easy-mailchimp-extender' ); ?> <span class="dashicons dashicons-external"></span></a></h1> |
|
12 | + <h1>Easy Forms for Mailchimp | <?php echo esc_attr__( 'Add-Ons', 'yikes-inc-easy-mailchimp-extender' ); ?> <a href="https://yikesplugins.com/plugins/?plugins=Mailchimp" target="_blank" class="button-primary coming-soon-button" title="<?php esc_attr_e( 'View All Add-Ons', 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php esc_attr_e( 'View All Add-Ons', 'yikes-inc-easy-mailchimp-extender' ); ?> <span class="dashicons dashicons-external"></span></a></h1> |
|
13 | 13 | |
14 | 14 | <!-- Addons Page Description --> |
15 | - <p class="yikes-easy-mc-about-text about-text"><?php esc_attr_e( "Below you'll find all free and paid add-ons available for Easy Forms for Mailchimp. Each add-on extends the functionality of the free plugin." , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
15 | + <p class="yikes-easy-mc-about-text about-text"><?php esc_attr_e( "Below you'll find all free and paid add-ons available for Easy Forms for Mailchimp. Each add-on extends the functionality of the free plugin.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
16 | 16 | |
17 | 17 | <!-- Add-On Container --> |
18 | 18 | <section id="add-ons"> |
@@ -36,16 +36,16 @@ discard block |
||
36 | 36 | ?> |
37 | 37 | <div class="wrap yikes-easy-mc-wrap"> |
38 | 38 | <!-- Freddie Logo --> |
39 | - <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" /> |
|
39 | + <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" /> |
|
40 | 40 | |
41 | - <h1>Easy Forms for Mailchimp | <?php _e( 'Manage Mailing Lists' , 'yikes-inc-easy-mailchimp-extender' ); ?></h1> |
|
41 | + <h1>Easy Forms for Mailchimp | <?php _e( 'Manage Mailing Lists', 'yikes-inc-easy-mailchimp-extender' ); ?></h1> |
|
42 | 42 | |
43 | 43 | <!-- Settings Page Description --> |
44 | - <p class="yikes-easy-mc-about-text about-text"><?php _e( 'Make edits to your Mailchimp lists.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
44 | + <p class="yikes-easy-mc-about-text about-text"><?php _e( 'Make edits to your Mailchimp lists.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
45 | 45 | |
46 | 46 | <?php |
47 | 47 | /* If the user hasn't authenticated yet, lets kill off */ |
48 | - if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) != 'valid_api_key' ) { |
|
48 | + if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) != 'valid_api_key' ) { |
|
49 | 49 | |
50 | 50 | $error_string = sprintf( |
51 | 51 | esc_html__( 'You need to connect to Mailchimp before you can start creating forms. Head over to the %s and enter your API key.', 'yikes-inc-easy-mailchimp-extender' ), |
@@ -81,8 +81,8 @@ discard block |
||
81 | 81 | <!-- TABLE HEAD --> |
82 | 82 | <thead> |
83 | 83 | <tr> |
84 | - <th id="columnname" class="manage-column column-columnname" scope="col"><?php _e( 'List Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
85 | - <th id="columnname" class="manage-column column-columnname num" scope="col"><?php _e( 'Subscriber Count' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
84 | + <th id="columnname" class="manage-column column-columnname" scope="col"><?php _e( 'List Name', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
85 | + <th id="columnname" class="manage-column column-columnname num" scope="col"><?php _e( 'Subscriber Count', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
86 | 86 | </tr> |
87 | 87 | </thead> |
88 | 88 | <!-- end header --> |
@@ -90,25 +90,25 @@ discard block |
||
90 | 90 | <!-- FOOTER --> |
91 | 91 | <tfoot> |
92 | 92 | <tr> |
93 | - <th class="manage-column column-columnname" scope="col"><?php _e( 'List Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
94 | - <th class="manage-column column-columnname num" scope="col"><?php _e( 'Subscriber Count' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
93 | + <th class="manage-column column-columnname" scope="col"><?php _e( 'List Name', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
94 | + <th class="manage-column column-columnname num" scope="col"><?php _e( 'Subscriber Count', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
95 | 95 | </tr> |
96 | 96 | </tfoot> |
97 | 97 | <!-- end footer --> |
98 | 98 | |
99 | 99 | <!-- TABLE BODY --> |
100 | 100 | <tbody> |
101 | - <?php if( count( $list_data ) > 0 ) { |
|
101 | + <?php if ( count( $list_data ) > 0 ) { |
|
102 | 102 | $i = 1; |
103 | - foreach( $list_data as $list ) { |
|
103 | + foreach ( $list_data as $list ) { |
|
104 | 104 | ?> |
105 | - <tr class="<?php if( $i % 2 == 0 ) { echo 'alternate'; } ?>"> |
|
105 | + <tr class="<?php if ( $i % 2 == 0 ) { echo 'alternate'; } ?>"> |
|
106 | 106 | <td class="column-columnname"> |
107 | - <a href="<?php echo esc_url_raw( add_query_arg( array( 'list-id' => $list['id'] ) , admin_url( 'admin.php?page=yikes-mailchimp-view-list' ) ) ); ?>" class="row-title"> |
|
108 | - <?php echo stripslashes( $list['name'] ); ?> |
|
107 | + <a href="<?php echo esc_url_raw( add_query_arg( array( 'list-id' => $list[ 'id' ] ), admin_url( 'admin.php?page=yikes-mailchimp-view-list' ) ) ); ?>" class="row-title"> |
|
108 | + <?php echo stripslashes( $list[ 'name' ] ); ?> |
|
109 | 109 | </a> |
110 | 110 | <div class="row-actions"> |
111 | - <span><a href="<?php echo esc_url_raw( add_query_arg( array( 'list-id' => $list['id'] ) , admin_url( 'admin.php?page=yikes-mailchimp-view-list' ) ) ); ?>"><?php _e( "View" , 'yikes-inc-easy-mailchimp-extender' ); ?></a></span> |
|
111 | + <span><a href="<?php echo esc_url_raw( add_query_arg( array( 'list-id' => $list[ 'id' ] ), admin_url( 'admin.php?page=yikes-mailchimp-view-list' ) ) ); ?>"><?php _e( "View", 'yikes-inc-easy-mailchimp-extender' ); ?></a></span> |
|
112 | 112 | <?php |
113 | 113 | /* |
114 | 114 | * Custom action to allow users to add additional action links |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | ?> |
119 | 119 | </div> |
120 | 120 | </td> |
121 | - <td class="column-columnname num"><?php echo $list['stats']['member_count']; ?></td> |
|
121 | + <td class="column-columnname num"><?php echo $list[ 'stats' ][ 'member_count' ]; ?></td> |
|
122 | 122 | </tr> |
123 | 123 | <?php |
124 | 124 | $i++; |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | } else { |
127 | 127 | ?> |
128 | 128 | <tr class="no-items"> |
129 | - <td class="colspanchange no-mailchimp-lists-found" colspan="3"><em><?php printf( __( 'No Mailchimp lists found. Head over to <a href="%s" title="Mailchimp.com">Mailchimp.com</a> to setup your first mailing list. Once thats done you can head back here to customize it!' , 'yikes-inc-easy-mailchimp-extender' ), esc_url( 'http://mailchimp.com/' ) ); ?></em></td> |
|
129 | + <td class="colspanchange no-mailchimp-lists-found" colspan="3"><em><?php printf( __( 'No Mailchimp lists found. Head over to <a href="%s" title="Mailchimp.com">Mailchimp.com</a> to setup your first mailing list. Once thats done you can head back here to customize it!', 'yikes-inc-easy-mailchimp-extender' ), esc_url( 'http://mailchimp.com/' ) ); ?></em></td> |
|
130 | 130 | </tr> |
131 | 131 | <?php } ?> |
132 | 132 | </tbody> |
@@ -146,8 +146,8 @@ discard block |
||
146 | 146 | <div class="postbox yikes-easy-mc-postbox"> |
147 | 147 | <div class="inside"> |
148 | 148 | |
149 | - <a href="https://us3.admin.mailchimp.com/" title="<?php _e( 'Mailchimp Site' , 'yikes-inc-easy-mailchimp-extender' ); ?>" target="_blank"> |
|
150 | - <img src="<?php echo YIKES_MC_URL . 'includes/images/Mailchimp_Assets/mailchimp-logo.png'; ?>" title="<?php _e( 'Mailchimp Site' , 'yikes-inc-easy-mailchimp-extender' ); ?>" class="list-page-mailchimp-logo"> |
|
149 | + <a href="https://us3.admin.mailchimp.com/" title="<?php _e( 'Mailchimp Site', 'yikes-inc-easy-mailchimp-extender' ); ?>" target="_blank"> |
|
150 | + <img src="<?php echo YIKES_MC_URL . 'includes/images/Mailchimp_Assets/mailchimp-logo.png'; ?>" title="<?php _e( 'Mailchimp Site', 'yikes-inc-easy-mailchimp-extender' ); ?>" class="list-page-mailchimp-logo"> |
|
151 | 151 | </a> |
152 | 152 | |
153 | 153 | </div> |
@@ -157,42 +157,42 @@ discard block |
||
157 | 157 | <div class="postbox yikes-easy-mc-postbox list-page-sidebar"> |
158 | 158 | <div class="inside"> |
159 | 159 | |
160 | - <h2 class="account-status"><?php echo $account_details['username']; ?> <small>(<?php echo $account_details['role']; ?>)</small></h2> |
|
160 | + <h2 class="account-status"><?php echo $account_details[ 'username' ]; ?> <small>(<?php echo $account_details[ 'role' ]; ?>)</small></h2> |
|
161 | 161 | |
162 | - <img class="mailchimp-avatar" src="<?php echo esc_url_raw( $account_details['avatar_url'] ); ?>" title="<?php echo $account_details['username'] . ' ' . __( "Mailchimp avatar" , 'yikes-inc-easy-mailchimp-extender' ); ?>"> |
|
162 | + <img class="mailchimp-avatar" src="<?php echo esc_url_raw( $account_details[ 'avatar_url' ] ); ?>" title="<?php echo $account_details[ 'username' ] . ' ' . __( "Mailchimp avatar", 'yikes-inc-easy-mailchimp-extender' ); ?>"> |
|
163 | 163 | |
164 | 164 | <table class="form-table" id="account-details-table"> |
165 | 165 | <tr valign="top"> |
166 | 166 | <td scope="row"> |
167 | 167 | <label for="tablecell"> |
168 | - <strong><?php _e( 'Company' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
168 | + <strong><?php _e( 'Company', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
169 | 169 | </label> |
170 | 170 | </td> |
171 | - <td><?php echo $account_details['contact']['company']; ?><br /><?php echo $account_details['contact']['city'] . ', ' . $account_details['contact']['state']; ?></td> |
|
171 | + <td><?php echo $account_details[ 'contact' ][ 'company' ]; ?><br /><?php echo $account_details[ 'contact' ][ 'city' ] . ', ' . $account_details[ 'contact' ][ 'state' ]; ?></td> |
|
172 | 172 | </tr> |
173 | 173 | <tr valign="top"> |
174 | 174 | <td scope="row"> |
175 | 175 | <label for="tablecell"> |
176 | - <strong><?php _e( 'Industry' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
176 | + <strong><?php _e( 'Industry', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
177 | 177 | </label> |
178 | 178 | </td> |
179 | - <td><?php echo $account_details['account_industry']; ?></td> |
|
179 | + <td><?php echo $account_details[ 'account_industry' ]; ?></td> |
|
180 | 180 | </tr> |
181 | 181 | <tr valign="top"> |
182 | 182 | <td scope="row"> |
183 | 183 | <label for="tablecell"> |
184 | - <strong><?php _e( 'Member Since' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
184 | + <strong><?php _e( 'Member Since', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
185 | 185 | </label> |
186 | 186 | </td> |
187 | - <td><?php echo date( get_option('date_format') , strtotime( $account_details['member_since'] ) ); ?></td> |
|
187 | + <td><?php echo date( get_option( 'date_format' ), strtotime( $account_details[ 'member_since' ] ) ); ?></td> |
|
188 | 188 | </tr> |
189 | 189 | <tr valign="top"> |
190 | 190 | <td scope="row"> |
191 | 191 | <label for="tablecell"> |
192 | - <strong><?php _e( 'Plan Type' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
192 | + <strong><?php _e( 'Plan Type', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
193 | 193 | </label> |
194 | 194 | </td> |
195 | - <td><?php echo ucwords( $account_details['pricing_plan_type'] ); ?></td> |
|
195 | + <td><?php echo ucwords( $account_details[ 'pricing_plan_type' ] ); ?></td> |
|
196 | 196 | </tr> |
197 | 197 | </table> |
198 | 198 |
@@ -5,13 +5,13 @@ discard block |
||
5 | 5 | */ |
6 | 6 | |
7 | 7 | /* Get and Store Option Values */ |
8 | - if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) === 'valid_api_key' ) { |
|
9 | - $api_connection = '<span id="connection-container" class="api-connected" title="' . __( "Your site is currently connected to the Mailchimp API" , "yikes-inc-easy-mailchimp-extender" ) . '"><span class="dashicons dashicons-yes yikes-mc-api-connected"></span> ' . __( "Connected" , 'yikes-inc-easy-mailchimp-extender' ) . '</span>'; |
|
8 | + if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) === 'valid_api_key' ) { |
|
9 | + $api_connection = '<span id="connection-container" class="api-connected" title="' . __( "Your site is currently connected to the Mailchimp API", "yikes-inc-easy-mailchimp-extender" ) . '"><span class="dashicons dashicons-yes yikes-mc-api-connected"></span> ' . __( "Connected", 'yikes-inc-easy-mailchimp-extender' ) . '</span>'; |
|
10 | 10 | $api_error_response = ''; |
11 | 11 | } else { |
12 | - $api_connection = '<span id="connection-container" class="api-not-connected"><span class="dashicons dashicons-no-alt yikes-mc-api-not-connected"></span> ' . __( "Not Connected" , 'yikes-inc-easy-mailchimp-extender' ) . '</span>'; |
|
13 | - if( get_option( 'yikes-mc-api-invalid-key-response' , '' ) != '' ) { |
|
14 | - $api_error_response = '<p><small><i class="dashicons dashicons-no-alt"></i> ' . get_option( 'yikes-mc-api-invalid-key-response' , '' ) . '</small></p>'; |
|
12 | + $api_connection = '<span id="connection-container" class="api-not-connected"><span class="dashicons dashicons-no-alt yikes-mc-api-not-connected"></span> ' . __( "Not Connected", 'yikes-inc-easy-mailchimp-extender' ) . '</span>'; |
|
13 | + if ( get_option( 'yikes-mc-api-invalid-key-response', '' ) != '' ) { |
|
14 | + $api_error_response = '<p><small><i class="dashicons dashicons-no-alt"></i> ' . get_option( 'yikes-mc-api-invalid-key-response', '' ) . '</small></p>'; |
|
15 | 15 | } else { |
16 | 16 | $api_error_response = ''; |
17 | 17 | } |
@@ -23,23 +23,23 @@ discard block |
||
23 | 23 | * @since 6.2.2 |
24 | 24 | * |
25 | 25 | */ |
26 | - if ( isset( $_REQUEST['section'] ) ) { |
|
27 | - $_REQUEST['section'] = preg_replace('/[^\w-]/', '', strip_tags ( $_REQUEST['section'] ) ); |
|
26 | + if ( isset( $_REQUEST[ 'section' ] ) ) { |
|
27 | + $_REQUEST[ 'section' ] = preg_replace( '/[^\w-]/', '', strip_tags( $_REQUEST[ 'section' ] ) ); |
|
28 | 28 | } |
29 | 29 | ?> |
30 | 30 | <!-- Actual Settings Form --> |
31 | 31 | <div class="wrap yikes-easy-mc-wrap"> |
32 | 32 | |
33 | 33 | <!-- Freddie Logo --> |
34 | - <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" /> |
|
34 | + <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" /> |
|
35 | 35 | |
36 | - <h1>Easy Forms for Mailchimp | <?php if ( isset( $_REQUEST['section'] ) ) { echo ucwords( str_replace( '-', ' ', $_REQUEST['section'] ) ); } else { echo __( 'General Settings' , 'yikes-inc-easy-mailchimp-extender' ); } ?></h1> |
|
36 | + <h1>Easy Forms for Mailchimp | <?php if ( isset( $_REQUEST[ 'section' ] ) ) { echo ucwords( str_replace( '-', ' ', $_REQUEST[ 'section' ] ) ); } else { echo __( 'General Settings', 'yikes-inc-easy-mailchimp-extender' ); } ?></h1> |
|
37 | 37 | |
38 | 38 | <!-- Settings Page Description --> |
39 | - <p class="yikes-easy-mc-about-text about-text"><?php _e( 'Manage the overall settings for Easy forms for Mailchimp.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
39 | + <p class="yikes-easy-mc-about-text about-text"><?php _e( 'Manage the overall settings for Easy forms for Mailchimp.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
40 | 40 | <?php |
41 | 41 | /* Success Messages on Options Updated */ |
42 | - if( isset( $_REQUEST['settings-updated'] ) && $_REQUEST['settings-updated'] == 'true' ) { |
|
42 | + if ( isset( $_REQUEST[ 'settings-updated' ] ) && $_REQUEST[ 'settings-updated' ] == 'true' ) { |
|
43 | 43 | ?> |
44 | 44 | <div class="updated manage-form-admin-notice"> |
45 | 45 | <p><?php _e( 'Settings successfully updated.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | <?php |
48 | 48 | } |
49 | 49 | /* Mailchimp API Cleared Successfully message */ |
50 | - if( isset( $_REQUEST['transient-cleared'] ) && $_REQUEST['transient-cleared'] == 'true' ) { |
|
50 | + if ( isset( $_REQUEST[ 'transient-cleared' ] ) && $_REQUEST[ 'transient-cleared' ] == 'true' ) { |
|
51 | 51 | ?> |
52 | 52 | <div class="updated manage-form-admin-notice"> |
53 | 53 | <p><?php _e( 'Mailchimp API Cache successfully cleared.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | } |
57 | 57 | /* Error Log Clear Messages */ |
58 | 58 | /* Success Messages on Options Updated */ |
59 | - if( isset( $_REQUEST['error-log-cleared'] ) && $_REQUEST['error-log-cleared'] == 'true' ) { |
|
59 | + if ( isset( $_REQUEST[ 'error-log-cleared' ] ) && $_REQUEST[ 'error-log-cleared' ] == 'true' ) { |
|
60 | 60 | ?> |
61 | 61 | <div class="updated manage-form-admin-notice"> |
62 | 62 | <p><?php _e( 'Error log successfully cleared.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | <?php |
65 | 65 | } |
66 | 66 | /* Mailchimp API Cleared Successfully message */ |
67 | - if( isset( $_REQUEST['error-log-cleared'] ) && $_REQUEST['error-log-cleared'] == 'false' ) { |
|
67 | + if ( isset( $_REQUEST[ 'error-log-cleared' ] ) && $_REQUEST[ 'error-log-cleared' ] == 'false' ) { |
|
68 | 68 | ?> |
69 | 69 | <div class="error manage-form-admin-notice"> |
70 | 70 | <p><?php _e( "Whoops! We've encountered an error while trying to clear the error log. Please refresh the page and try again. If the error persists please get in touch with the YIKES Inc. support team.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
@@ -73,28 +73,28 @@ discard block |
||
73 | 73 | } |
74 | 74 | |
75 | 75 | /* Display a success message if our error log was sucessfully created, or display an error if not */ |
76 | - if( isset( $_GET['error_log_created'] ) && $_GET['error_log_created'] == 'true' ) { |
|
76 | + if ( isset( $_GET[ 'error_log_created' ] ) && $_GET[ 'error_log_created' ] == 'true' ) { |
|
77 | 77 | ?> |
78 | 78 | <div class="updated"> |
79 | 79 | <p><?php _e( 'Error log successfully created. You may now start logging errors.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
80 | 80 | </div> |
81 | 81 | <?php |
82 | - } else if( isset( $_GET['error_log_created'] ) && $_GET['error_log_created'] == 'false' ) { |
|
82 | + } else if ( isset( $_GET[ 'error_log_created' ] ) && $_GET[ 'error_log_created' ] == 'false' ) { |
|
83 | 83 | ?> |
84 | 84 | <div class="error"> |
85 | - <p><?php echo esc_attr( urldecode( $_GET['error_message'] ) , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
85 | + <p><?php echo esc_attr( urldecode( $_GET[ 'error_message' ] ), 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
86 | 86 | </div> |
87 | 87 | <?php |
88 | 88 | } |
89 | 89 | |
90 | 90 | /* Display a success message if the user successfully imported some forms */ |
91 | - if( isset( $_GET['section'] ) && $_GET['section'] == 'import-export-forms' && isset( $_GET['import-forms'] ) && $_GET['import-forms'] == 'true' ) { |
|
91 | + if ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] == 'import-export-forms' && isset( $_GET[ 'import-forms' ] ) && $_GET[ 'import-forms' ] == 'true' ) { |
|
92 | 92 | ?> |
93 | 93 | <div class="updated"> |
94 | 94 | <p><?php printf( __( 'Opt-in forms successfully imported. <a href="%s" title="View Forms">View Forms</a>', 'yikes-inc-easy-mailchimp-extender' ), esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ) ); ?></p> |
95 | 95 | </div> |
96 | 96 | <?php |
97 | - } elseif( isset( $_GET['section'] ) && $_GET['section'] == 'import-export-forms' && isset( $_GET['import-settings'] ) && $_GET['import-settings'] == 'true' ) { |
|
97 | + } elseif ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] == 'import-export-forms' && isset( $_GET[ 'import-settings' ] ) && $_GET[ 'import-settings' ] == 'true' ) { |
|
98 | 98 | ?> |
99 | 99 | <div class="updated"> |
100 | 100 | <p><?php printf( __( 'YIKES Easy Forms for Mailchimp settings successfully imported.', 'yikes-inc-easy-mailchimp-extender' ), esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ) ); ?></p> |
@@ -115,11 +115,11 @@ discard block |
||
115 | 115 | |
116 | 116 | <div class="postbox yikes-easy-mc-postbox"> |
117 | 117 | |
118 | - <?php if( !isset( $_REQUEST['section'] ) || $_REQUEST['section'] == '' ) { |
|
118 | + <?php if ( ! isset( $_REQUEST[ 'section' ] ) || $_REQUEST[ 'section' ] == '' ) { |
|
119 | 119 | include YIKES_MC_PATH . 'admin/partials/menu/options-sections/general-settings.php'; |
120 | 120 | } else { |
121 | - if( isset( $_REQUEST['addon'] ) && $_REQUEST['addon'] == 'true' ) { |
|
122 | - include apply_filters( 'yikes-mailchimp-'.$_REQUEST['section'].'-options-path' , '' ); |
|
121 | + if ( isset( $_REQUEST[ 'addon' ] ) && $_REQUEST[ 'addon' ] == 'true' ) { |
|
122 | + include apply_filters( 'yikes-mailchimp-' . $_REQUEST[ 'section' ] . '-options-path', '' ); |
|
123 | 123 | } else { |
124 | 124 | // White list a set of files that are allowed to be included here |
125 | 125 | $file_base = 'admin/partials/menu/options-sections/'; |
@@ -132,8 +132,8 @@ discard block |
||
132 | 132 | $file_base . 'recaptcha-settings.php', |
133 | 133 | ); |
134 | 134 | // Ensure the included file is allowed and whitelisted above, before including it |
135 | - if ( 0 === validate_file( 'admin/partials/menu/options-sections/' . $_REQUEST['section'] . '.php', $acceptable_files ) ) { |
|
136 | - include YIKES_MC_PATH . 'admin/partials/menu/options-sections/' . $_REQUEST['section'] . '.php'; |
|
135 | + if ( 0 === validate_file( 'admin/partials/menu/options-sections/' . $_REQUEST[ 'section' ] . '.php', $acceptable_files ) ) { |
|
136 | + include YIKES_MC_PATH . 'admin/partials/menu/options-sections/' . $_REQUEST[ 'section' ] . '.php'; |
|
137 | 137 | } else { |
138 | 138 | wp_die( esc_attr__( 'Invalid file. If this error persists, please contact support.', 'yikes-inc-easy-mailchimp' ) ); |
139 | 139 | } |
@@ -1,9 +1,9 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! isset( $_REQUEST['list-id'] ) ) { |
|
2 | +if ( ! isset( $_REQUEST[ 'list-id' ] ) ) { |
|
3 | 3 | wp_die( __( 'Oops, we can\'t determine what List to view. Please go back and try again.' ) ); |
4 | 4 | } |
5 | 5 | |
6 | -$list_id = sanitize_key( $_REQUEST['list-id'] ); |
|
6 | +$list_id = sanitize_key( $_REQUEST[ 'list-id' ] ); |
|
7 | 7 | $list_helper = yikes_get_mc_api_manager()->get_list_handler(); |
8 | 8 | $api_key = yikes_get_mc_api_key(); |
9 | 9 | $dash_position = strpos( $api_key, '-' ); |
@@ -60,10 +60,10 @@ discard block |
||
60 | 60 | } |
61 | 61 | |
62 | 62 | // setup pagination variables |
63 | -$paged = isset( $_REQUEST['paged'] ) ? filter_var( $_REQUEST['paged'], FILTER_SANITIZE_NUMBER_INT ) : 0; |
|
63 | +$paged = isset( $_REQUEST[ 'paged' ] ) ? filter_var( $_REQUEST[ 'paged' ], FILTER_SANITIZE_NUMBER_INT ) : 0; |
|
64 | 64 | $limit = apply_filters( 'yikes_admin_list_subscriber_limit', 20 ); |
65 | -$page_offset = (int) $paged * (int) $limit; |
|
66 | -$sort_dir = isset( $_REQUEST['sort'] ) ? $_REQUEST['sort'] : 'DESC'; |
|
65 | +$page_offset = (int) $paged * (int) $limit; |
|
66 | +$sort_dir = isset( $_REQUEST[ 'sort' ] ) ? $_REQUEST[ 'sort' ] : 'DESC'; |
|
67 | 67 | |
68 | 68 | if ( $sort_dir === 'DESC' ) { |
69 | 69 | $opposite_sort_dir = 'ASC'; |
@@ -90,25 +90,25 @@ discard block |
||
90 | 90 | ?> |
91 | 91 | <div class="wrap yikes-easy-mc-wrap"> |
92 | 92 | <!-- Freddie Logo --> |
93 | - <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" /> |
|
93 | + <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" /> |
|
94 | 94 | |
95 | - <h1>YIKES Easy Forms for Mailchimp | <?php echo $list_data['name']; ?></h1> |
|
95 | + <h1>YIKES Easy Forms for Mailchimp | <?php echo $list_data[ 'name' ]; ?></h1> |
|
96 | 96 | |
97 | 97 | <!-- Settings Page Description --> |
98 | - <p class="yikes-easy-mc-about-text about-text"><?php _e( 'View all subscribers below. View additional subscriber info, or add additional fields to this list.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
99 | - <!-- <p class="add-new-subscriber-button"><a href="#" onclick="jQuery(this).parent().next().slideToggle();" class="add-new-h2"><?php _e( 'New Subscriber' , 'yikes-inc-easy-mailchimp-extender' ); ?></a></p> --> |
|
98 | + <p class="yikes-easy-mc-about-text about-text"><?php _e( 'View all subscribers below. View additional subscriber info, or add additional fields to this list.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
99 | + <!-- <p class="add-new-subscriber-button"><a href="#" onclick="jQuery(this).parent().next().slideToggle();" class="add-new-h2"><?php _e( 'New Subscriber', 'yikes-inc-easy-mailchimp-extender' ); ?></a></p> --> |
|
100 | 100 | |
101 | 101 | <?php |
102 | 102 | /* Display our admin notices here */ |
103 | 103 | // Unsubscribe user confirmation message |
104 | - if( isset( $_REQUEST['user-unsubscribed'] ) && $_REQUEST['user-unsubscribed'] == 'true' ) { |
|
104 | + if ( isset( $_REQUEST[ 'user-unsubscribed' ] ) && $_REQUEST[ 'user-unsubscribed' ] == 'true' ) { |
|
105 | 105 | ?> |
106 | 106 | <div class="updated manage-form-admin-notice"> |
107 | 107 | <p><?php _e( 'User successfully unsubscribed.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
108 | 108 | </div> |
109 | 109 | <?php |
110 | 110 | } |
111 | - if( isset( $_REQUEST['user-unsubscribed'] ) && $_REQUEST['user-unsubscribed'] == 'false' ) { |
|
111 | + if ( isset( $_REQUEST[ 'user-unsubscribed' ] ) && $_REQUEST[ 'user-unsubscribed' ] == 'false' ) { |
|
112 | 112 | ?> |
113 | 113 | <div class="error manage-form-admin-notice"> |
114 | 114 | <p><?php _e( "We've encountered an error trying to remove the subscriber. Please try again. If the error persists please get in contact with the YIKES Inc. support staff.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
@@ -118,9 +118,9 @@ discard block |
||
118 | 118 | ?> |
119 | 119 | |
120 | 120 | <section class="add-new-subscriber-form-container"> |
121 | - <h4><?php _e( 'Add New Subscriber' , 'yikes-inc-easy-mailchimp-extender' ); ?></h4> |
|
121 | + <h4><?php _e( 'Add New Subscriber', 'yikes-inc-easy-mailchimp-extender' ); ?></h4> |
|
122 | 122 | <form id="add-new-subcscriber"> |
123 | - <input type="text" class="regular-text" placeholder="<?php _e( 'User Email Address' , 'yikes-inc-easy-mailchimp-extender' ); ?>" /></p> |
|
123 | + <input type="text" class="regular-text" placeholder="<?php _e( 'User Email Address', 'yikes-inc-easy-mailchimp-extender' ); ?>" /></p> |
|
124 | 124 | <p><?php submit_button( 'Add Subscriber' ); ?></p> |
125 | 125 | </form> |
126 | 126 | </section> |
@@ -142,8 +142,8 @@ discard block |
||
142 | 142 | <!-- TABLE HEAD --> |
143 | 143 | <thead> |
144 | 144 | <tr> |
145 | - <th id="user-email columnname" class="manage-column column-columnname" scope="col"><a id="user-email-sort" href="<?php echo esc_url_raw( add_query_arg( array( 'column' => 'email' , 'sort' => $opposite_sort_dir ) ) ); ?>"><?php _e( 'User Email' , 'yikes-inc-easy-mailchimp-extender' ); echo $icon;?></a></th> |
|
146 | - <th id="columnname" class="manage-column column-columnname num" scope="col"><?php _e( 'Email Client' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
145 | + <th id="user-email columnname" class="manage-column column-columnname" scope="col"><a id="user-email-sort" href="<?php echo esc_url_raw( add_query_arg( array( 'column' => 'email', 'sort' => $opposite_sort_dir ) ) ); ?>"><?php _e( 'User Email', 'yikes-inc-easy-mailchimp-extender' ); echo $icon; ?></a></th> |
|
146 | + <th id="columnname" class="manage-column column-columnname num" scope="col"><?php _e( 'Email Client', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
147 | 147 | </tr> |
148 | 148 | </thead> |
149 | 149 | <!-- end header --> |
@@ -151,8 +151,8 @@ discard block |
||
151 | 151 | <!-- FOOTER --> |
152 | 152 | <tfoot> |
153 | 153 | <tr> |
154 | - <th class="manage-column column-columnname" scope="col"><?php _e( 'User Email' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
155 | - <th class="manage-column column-columnname num" scope="col"><?php _e( 'Email Client' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
154 | + <th class="manage-column column-columnname" scope="col"><?php _e( 'User Email', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
155 | + <th class="manage-column column-columnname num" scope="col"><?php _e( 'Email Client', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
156 | 156 | </tr> |
157 | 157 | </tfoot> |
158 | 158 | <!-- end footer --> |
@@ -162,15 +162,15 @@ discard block |
||
162 | 162 | <?php if ( count( $subscribers_list ) > 0 ) { |
163 | 163 | $i = 1; |
164 | 164 | foreach ( $subscribers_list as $subscriber ) { |
165 | - $user_id = $subscriber['id']; |
|
165 | + $user_id = $subscriber[ 'id' ]; |
|
166 | 166 | $path = YIKES_MC_URL . "includes/images/na.png"; |
167 | 167 | $email_client_icon = "<img width='35' src='" . $path . "' alt='" . __( 'not set', 'yikes-inc-easy-mailchimp-extender' ) . "' title='" . __( 'not set', 'yikes-inc-easy-mailchimp-extender' ) . "'>"; |
168 | 168 | |
169 | 169 | ?> |
170 | 170 | <tr class="<?php if ( $i % 2 == 0 ) { echo 'alternate'; } ?>"> |
171 | 171 | <td class="column-columnname"> |
172 | - <a class="user-email row-title" href="mailto:<?php echo sanitize_email( $subscriber['email_address'] ); ?>"> |
|
173 | - <?php echo sanitize_email( $subscriber['email_address'] ); ?> |
|
172 | + <a class="user-email row-title" href="mailto:<?php echo sanitize_email( $subscriber[ 'email_address' ] ); ?>"> |
|
173 | + <?php echo sanitize_email( $subscriber[ 'email_address' ] ); ?> |
|
174 | 174 | </a> |
175 | 175 | <div class="row-actions"> |
176 | 176 | <?php $view_user_info_url = esc_url_raw( add_query_arg( array( |
@@ -184,17 +184,17 @@ discard block |
||
184 | 184 | 'nonce' => wp_create_nonce( 'unsubscribe-user-' . $user_id ), |
185 | 185 | 'email_id' => $user_id, |
186 | 186 | ) ) ); ?> |
187 | - <span><a href="<?php echo $url; ?>" onclick="return confirm('<?php printf( __( "Are you sure you want to unsubscribe %s from this mailing list?", 'yikes-inc-easy-mailchimp-extender' ), sanitize_email( $subscriber['email_address'] ) ); ?>');" class="yikes-delete-subscriber"><?php _e( "Unsubscribe", 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
187 | + <span><a href="<?php echo $url; ?>" onclick="return confirm('<?php printf( __( "Are you sure you want to unsubscribe %s from this mailing list?", 'yikes-inc-easy-mailchimp-extender' ), sanitize_email( $subscriber[ 'email_address' ] ) ); ?>');" class="yikes-delete-subscriber"><?php _e( "Unsubscribe", 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
188 | 188 | </div> |
189 | 189 | </td> |
190 | 190 | <td class="column-columnname num"><?php echo $email_client_icon; ?></td> |
191 | 191 | </tr> |
192 | 192 | <?php |
193 | - $i ++; |
|
193 | + $i++; |
|
194 | 194 | } |
195 | 195 | } else { ?> |
196 | 196 | <tr class="no-items"> |
197 | - <td class="colspanchange no-current-subscriber-notice" colspan="2"><em><?php _e( 'No one is currently subscribed to this list.' , 'yikes-inc-easy-mailchimp-extender' ); ?></em></td> |
|
197 | + <td class="colspanchange no-current-subscriber-notice" colspan="2"><em><?php _e( 'No one is currently subscribed to this list.', 'yikes-inc-easy-mailchimp-extender' ); ?></em></td> |
|
198 | 198 | </tr> |
199 | 199 | <?php } ?> |
200 | 200 | </tbody> |
@@ -206,11 +206,11 @@ discard block |
||
206 | 206 | <!-- pagination --> |
207 | 207 | <div class="tablenav"> |
208 | 208 | <div class="tablenav-pages"> |
209 | - <a class='first-page <?php if( $paged == 0 ) { echo 'disabled'; } ?>' title='<?php _e( "Go to the first page" , 'yikes-inc-easy-mailchimp-extender' ); ?>' href='<?php echo esc_url_raw( add_query_arg( array( "paged" => 0 ) ) ); ?>'>«</a> |
|
210 | - <a class='prev-page <?php if( $paged == 0 ) { echo 'disabled'; } ?>' title='<?php _e( "Go to the previous page" , 'yikes-inc-easy-mailchimp-extender' ); ?>' href='<?php echo esc_url_raw( add_query_arg( array( "paged" => intval( $paged - 1 ) ) ) ); ?>'>‹</a> |
|
211 | - <span class="paging-input"><input class='current-page' title='<?php _e( "Current page" , 'yikes-inc-easy-mailchimp-extender' ); ?>' type='text' name='paged' value='<?php if( $paged == 0 ) { echo '1'; } else { echo intval( $paged + 1 ); } ?>' size='1' /> <?php _e( 'of', 'yikes-inc-easy-mailchimp-extender' ); ?> <span class='total-pages'><?php echo $total_pages; ?></span></span> |
|
212 | - <a class='next-page <?php if( $paged == intval( $total_pages - 1 ) ) { echo 'disabled'; } ?>' title='<?php _e( "Go to the next page" , 'yikes-inc-easy-mailchimp-extender' ); ?>' href='<?php echo esc_url_raw( add_query_arg( array( "paged" => intval( $paged + 1 ) ) ) ); ?>'>›</a> |
|
213 | - <a class='last-page <?php if( $paged == intval( $total_pages - 1 ) ) { echo 'disabled'; } ?>' title='<?php _e( "Go to the last page" , 'yikes-inc-easy-mailchimp-extender' ); ?>' href='<?php echo esc_url_raw( add_query_arg( array( "paged" => intval( $total_pages - 1 ) ) ) ); ?>'>»</a> |
|
209 | + <a class='first-page <?php if ( $paged == 0 ) { echo 'disabled'; } ?>' title='<?php _e( "Go to the first page", 'yikes-inc-easy-mailchimp-extender' ); ?>' href='<?php echo esc_url_raw( add_query_arg( array( "paged" => 0 ) ) ); ?>'>«</a> |
|
210 | + <a class='prev-page <?php if ( $paged == 0 ) { echo 'disabled'; } ?>' title='<?php _e( "Go to the previous page", 'yikes-inc-easy-mailchimp-extender' ); ?>' href='<?php echo esc_url_raw( add_query_arg( array( "paged" => intval( $paged - 1 ) ) ) ); ?>'>‹</a> |
|
211 | + <span class="paging-input"><input class='current-page' title='<?php _e( "Current page", 'yikes-inc-easy-mailchimp-extender' ); ?>' type='text' name='paged' value='<?php if ( $paged == 0 ) { echo '1'; } else { echo intval( $paged + 1 ); } ?>' size='1' /> <?php _e( 'of', 'yikes-inc-easy-mailchimp-extender' ); ?> <span class='total-pages'><?php echo $total_pages; ?></span></span> |
|
212 | + <a class='next-page <?php if ( $paged == intval( $total_pages - 1 ) ) { echo 'disabled'; } ?>' title='<?php _e( "Go to the next page", 'yikes-inc-easy-mailchimp-extender' ); ?>' href='<?php echo esc_url_raw( add_query_arg( array( "paged" => intval( $paged + 1 ) ) ) ); ?>'>›</a> |
|
213 | + <a class='last-page <?php if ( $paged == intval( $total_pages - 1 ) ) { echo 'disabled'; } ?>' title='<?php _e( "Go to the last page", 'yikes-inc-easy-mailchimp-extender' ); ?>' href='<?php echo esc_url_raw( add_query_arg( array( "paged" => intval( $total_pages - 1 ) ) ) ); ?>'>»</a> |
|
214 | 214 | </div> |
215 | 215 | </div> |
216 | 216 | |
@@ -225,21 +225,21 @@ discard block |
||
225 | 225 | |
226 | 226 | <div class="postbox yikes-easy-mc-postbox"> |
227 | 227 | |
228 | - <h3><?php _e( 'List Overview' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
228 | + <h3><?php _e( 'List Overview', 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
229 | 229 | |
230 | 230 | <?php |
231 | 231 | // store list rating |
232 | - $list_rating = $list_data['list_rating']; |
|
233 | - if( $list_rating > 0 ) { |
|
234 | - $list_rating_explosion = explode( '.' , $list_rating ); |
|
232 | + $list_rating = $list_data[ 'list_rating' ]; |
|
233 | + if ( $list_rating > 0 ) { |
|
234 | + $list_rating_explosion = explode( '.', $list_rating ); |
|
235 | 235 | $star_array = array(); |
236 | 236 | $x = 1; |
237 | - while( $list_rating_explosion[0] >= $x ) { |
|
238 | - $star_array[] = '<span class="dashicons dashicons-star-filled list-rating-star"></span>'; |
|
237 | + while ( $list_rating_explosion[ 0 ] >= $x ) { |
|
238 | + $star_array[ ] = '<span class="dashicons dashicons-star-filled list-rating-star"></span>'; |
|
239 | 239 | $x++; |
240 | 240 | } |
241 | - if( $list_rating_explosion[1] == '5' ) { |
|
242 | - $star_array[] = '<span class="dashicons dashicons-star-half list-rating-star"></span>'; |
|
241 | + if ( $list_rating_explosion[ 1 ] == '5' ) { |
|
242 | + $star_array[ ] = '<span class="dashicons dashicons-star-half list-rating-star"></span>'; |
|
243 | 243 | } |
244 | 244 | } else { |
245 | 245 | $star_array = array( 'n/a' ); |
@@ -247,40 +247,40 @@ discard block |
||
247 | 247 | ?> |
248 | 248 | <table class="form-table"> |
249 | 249 | <tr valign="top"> |
250 | - <td scope="row"><label for="tablecell"><strong><?php _e( 'List Rating' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
251 | - <td><?php echo implode( ' ' , $star_array ); ?></td> |
|
250 | + <td scope="row"><label for="tablecell"><strong><?php _e( 'List Rating', 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
251 | + <td><?php echo implode( ' ', $star_array ); ?></td> |
|
252 | 252 | </tr> |
253 | 253 | <tr valign="top"> |
254 | - <td scope="row"><label for="tablecell"><strong><?php _e( 'Average Subscribers' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
255 | - <td><?php echo $list_data['stats']['avg_sub_rate']; ?><small> / <?php _e( 'month' , 'yikes-inc-easy-mailchimp-extender' ); ?></small></td> |
|
254 | + <td scope="row"><label for="tablecell"><strong><?php _e( 'Average Subscribers', 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
255 | + <td><?php echo $list_data[ 'stats' ][ 'avg_sub_rate' ]; ?><small> / <?php _e( 'month', 'yikes-inc-easy-mailchimp-extender' ); ?></small></td> |
|
256 | 256 | </tr> |
257 | 257 | <tr valign="top"> |
258 | - <td scope="row"><label for="tablecell"><strong><?php _e( 'Subscriber Count' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
259 | - <td><?php echo intval( $list_data['stats']['member_count'] ); ?></td> |
|
258 | + <td scope="row"><label for="tablecell"><strong><?php _e( 'Subscriber Count', 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
259 | + <td><?php echo intval( $list_data[ 'stats' ][ 'member_count' ] ); ?></td> |
|
260 | 260 | </tr> |
261 | 261 | <tr valign="top"> |
262 | - <td scope="row"><label for="tablecell"><strong><?php _e( 'New Since Last Campaign' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
263 | - <td><?php echo intval( $list_data['stats']['member_count_since_send'] ); ?></td> |
|
262 | + <td scope="row"><label for="tablecell"><strong><?php _e( 'New Since Last Campaign', 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
263 | + <td><?php echo intval( $list_data[ 'stats' ][ 'member_count_since_send' ] ); ?></td> |
|
264 | 264 | </tr> |
265 | 265 | <tr valign="top"> |
266 | - <td scope="row"><label for="tablecell"><strong><?php _e( 'Created' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
267 | - <td><?php echo date( get_option('date_format') , strtotime( $list_data['date_created'] ) ); ?></td> |
|
266 | + <td scope="row"><label for="tablecell"><strong><?php _e( 'Created', 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
267 | + <td><?php echo date( get_option( 'date_format' ), strtotime( $list_data[ 'date_created' ] ) ); ?></td> |
|
268 | 268 | </tr> |
269 | 269 | <tr valign="top"> |
270 | - <td scope="row"><label for="tablecell"><strong><?php _e( 'List Fields' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
271 | - <td><?php echo intval( $list_data['stats']['merge_field_count'] + 1 ); // add 1 for our email field.. ?></td> |
|
270 | + <td scope="row"><label for="tablecell"><strong><?php _e( 'List Fields', 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
271 | + <td><?php echo intval( $list_data[ 'stats' ][ 'merge_field_count' ] + 1 ); // add 1 for our email field.. ?></td> |
|
272 | 272 | </tr> |
273 | 273 | <tr valign="top"> |
274 | - <td scope="row"><label for="tablecell"><strong><?php _e( 'Short Signup URL' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
275 | - <td><input type="text" class="widefat view-list-sidebar-input" value="<?php echo esc_url_raw( $list_data['subscribe_url_short'] ); ?>" readonly onclick="jQuery(this).select();"></td> |
|
274 | + <td scope="row"><label for="tablecell"><strong><?php _e( 'Short Signup URL', 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
275 | + <td><input type="text" class="widefat view-list-sidebar-input" value="<?php echo esc_url_raw( $list_data[ 'subscribe_url_short' ] ); ?>" readonly onclick="jQuery(this).select();"></td> |
|
276 | 276 | </tr> |
277 | 277 | <tr valign="top"> |
278 | - <td scope="row"><label for="tablecell"><strong><?php _e( 'Default From Email' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
279 | - <td><input type="text" class="widefat view-list-sidebar-input" value="<?php echo sanitize_email( $list_data['campaign_defaults']['from_email'] ); ?>" readonly onclick="jQuery(this).select();"></td> |
|
278 | + <td scope="row"><label for="tablecell"><strong><?php _e( 'Default From Email', 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
279 | + <td><input type="text" class="widefat view-list-sidebar-input" value="<?php echo sanitize_email( $list_data[ 'campaign_defaults' ][ 'from_email' ] ); ?>" readonly onclick="jQuery(this).select();"></td> |
|
280 | 280 | </tr> |
281 | 281 | <tr valign="top"> |
282 | - <td scope="row"><label for="tablecell"><strong><?php _e( 'Default From Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
283 | - <td><?php echo $list_data['campaign_defaults']['from_name']; ?></td> |
|
282 | + <td scope="row"><label for="tablecell"><strong><?php _e( 'Default From Name', 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
283 | + <td><?php echo $list_data[ 'campaign_defaults' ][ 'from_name' ]; ?></td> |
|
284 | 284 | </tr> |
285 | 285 | </table> |
286 | 286 | |
@@ -290,14 +290,14 @@ discard block |
||
290 | 290 | <!-- Merge Field Info --> |
291 | 291 | <div class="postbox yikes-easy-mc-postbox"> |
292 | 292 | |
293 | - <h3><?php _e( 'Form Fields' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
293 | + <h3><?php _e( 'Form Fields', 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
294 | 294 | <?php |
295 | - if( count( $merge_fields['merge_fields'] ) >= 1 ) { |
|
295 | + if ( count( $merge_fields[ 'merge_fields' ] ) >= 1 ) { |
|
296 | 296 | ?><ul class="merge-variable-ul"><?php |
297 | - echo '<li class="interest-group-count">' . sprintf( _n( '%d Field', '%d Fields', intval( count( $merge_fields['merge_fields'] ) ), 'yikes-inc-easy-mailchimp-extender' ), intval( count( $merge_fields['merge_fields'] ) ) ) . '</li>'; |
|
298 | - foreach( $merge_fields['merge_fields'] as $merge_field ) { |
|
297 | + echo '<li class="interest-group-count">' . sprintf( _n( '%d Field', '%d Fields', intval( count( $merge_fields[ 'merge_fields' ] ) ), 'yikes-inc-easy-mailchimp-extender' ), intval( count( $merge_fields[ 'merge_fields' ] ) ) ) . '</li>'; |
|
298 | + foreach ( $merge_fields[ 'merge_fields' ] as $merge_field ) { |
|
299 | 299 | // new action hook @since 6.0.3.8 |
300 | - echo '<li class="' . $merge_field['tag'] . '"><span class="dashicons dashicons-marker"></span>' . $merge_field['name'] . ' ' . do_action( 'yikes-mailchimp-list-field', $merge_field ) . '</li>'; |
|
300 | + echo '<li class="' . $merge_field[ 'tag' ] . '"><span class="dashicons dashicons-marker"></span>' . $merge_field[ 'name' ] . ' ' . do_action( 'yikes-mailchimp-list-field', $merge_field ) . '</li>'; |
|
301 | 301 | } |
302 | 302 | ?></ul><?php |
303 | 303 | } |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | <div class="postbox yikes-easy-mc-postbox"> |
315 | 315 | |
316 | 316 | |
317 | - <h3><?php _e( 'Interest Groups Overview' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
317 | + <h3><?php _e( 'Interest Groups Overview', 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
318 | 318 | <?php |
319 | 319 | if ( ! empty( $interest_groupings ) ) { |
320 | 320 | ?> |
@@ -322,8 +322,8 @@ discard block |
||
322 | 322 | echo '<li class="interest-group-count">' . sprintf( _n( '%d Interest Group', '%d Interest Groups', intval( count( $interest_groupings ) ), 'yikes-inc-easy-mailchimp-extender' ), intval( count( $interest_groupings ) ) ) . '</li>'; |
323 | 323 | foreach ( $interest_groupings as $interest_group ) { |
324 | 324 | // Build up the total subscribers |
325 | - $count = array_sum( wp_list_pluck( $interest_group['items'], 'subscriber_count' ) ); |
|
326 | - echo '<li><span class="dashicons dashicons-marker"></span>' . $interest_group['title'] . '<span class="interest-group-title"></span><small title="' . $count . ' ' . __( "subscribers assigned to this group", 'yikes-inc-easy-mailchimp-extender' ) . '">(' . $count . ')</small></li>'; |
|
325 | + $count = array_sum( wp_list_pluck( $interest_group[ 'items' ], 'subscriber_count' ) ); |
|
326 | + echo '<li><span class="dashicons dashicons-marker"></span>' . $interest_group[ 'title' ] . '<span class="interest-group-title"></span><small title="' . $count . ' ' . __( "subscribers assigned to this group", 'yikes-inc-easy-mailchimp-extender' ) . '">(' . $count . ')</small></li>'; |
|
327 | 327 | } |
328 | 328 | ?></ul><?php |
329 | 329 | } else { |
@@ -347,17 +347,17 @@ discard block |
||
347 | 347 | <div class="postbox yikes-easy-mc-postbox"> |
348 | 348 | |
349 | 349 | |
350 | - <h3><?php _e( 'Segments Overview' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
350 | + <h3><?php _e( 'Segments Overview', 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
351 | 351 | <?php |
352 | - if( isset( $segments['saved'] ) && count( $segments['saved'] ) >= 1 ) { |
|
352 | + if ( isset( $segments[ 'saved' ] ) && count( $segments[ 'saved' ] ) >= 1 ) { |
|
353 | 353 | $i = 1; |
354 | 354 | ?><ul class="segment-ul"><?php |
355 | - echo '<li class="segment-group-count">' . sprintf( _n( '%d Segment', '%d Segments', intval( count( $segments['saved'] ) ), 'yikes-inc-easy-mailchimp-extender' ), intval( count( $segments['saved'] ) ) ) . '</li>'; |
|
356 | - foreach( $segments['saved'] as $segment ) { |
|
357 | - echo '<li><span class="dashicons dashicons-arrow-right"></span>' . $segment['name'] . ' <small><a href="#" onclick="jQuery(this).parent().parent().next().slideToggle();jQuery(this).toggleText();return false;" data-alt-text="' . __( 'hide conditions' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( "view conditions" , 'yikes-inc-easy-mailchimp-extender' ) . '</a></small></li>'; |
|
355 | + echo '<li class="segment-group-count">' . sprintf( _n( '%d Segment', '%d Segments', intval( count( $segments[ 'saved' ] ) ), 'yikes-inc-easy-mailchimp-extender' ), intval( count( $segments[ 'saved' ] ) ) ) . '</li>'; |
|
356 | + foreach ( $segments[ 'saved' ] as $segment ) { |
|
357 | + echo '<li><span class="dashicons dashicons-arrow-right"></span>' . $segment[ 'name' ] . ' <small><a href="#" onclick="jQuery(this).parent().parent().next().slideToggle();jQuery(this).toggleText();return false;" data-alt-text="' . __( 'hide conditions', 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( "view conditions", 'yikes-inc-easy-mailchimp-extender' ) . '</a></small></li>'; |
|
358 | 358 | ?><div class="conditionals yikes-easy-mc-hidden"><?php |
359 | - foreach( $segment['segment_opts']['conditions'] as $condition ) { |
|
360 | - echo '<li><small>' . sprintf( __( 'condition #%s : If %s %s %s', 'yikes-inc-easy-mailchimp-extender' ), intval( $i ), $condition['field'], $condition['op'], $condition['value'] ) . '</small></li>'; |
|
359 | + foreach ( $segment[ 'segment_opts' ][ 'conditions' ] as $condition ) { |
|
360 | + echo '<li><small>' . sprintf( __( 'condition #%s : If %s %s %s', 'yikes-inc-easy-mailchimp-extender' ), intval( $i ), $condition[ 'field' ], $condition[ 'op' ], $condition[ 'value' ] ) . '</small></li>'; |
|
361 | 361 | $i++; |
362 | 362 | } |
363 | 363 | ?></div><?php |
@@ -372,9 +372,9 @@ discard block |
||
372 | 372 | } |
373 | 373 | ?> |
374 | 374 | <!-- |
375 | - <a class="edit-segments-button" href="#" onclick="return false;" class="button-primary"><?php _e( 'Edit Segments' , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
375 | + <a class="edit-segments-button" href="#" onclick="return false;" class="button-primary"><?php _e( 'Edit Segments', 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
376 | 376 | --> |
377 | - <p class="description edit-segment-description"><?php _e( 'To edit this lists segments, head over to' , 'yikes-inc-easy-mailchimp-extender' ); ?> <a href="http://www.Mailchimp.com" target="_blank">Mailchimp</a></p> |
|
377 | + <p class="description edit-segment-description"><?php _e( 'To edit this lists segments, head over to', 'yikes-inc-easy-mailchimp-extender' ); ?> <a href="http://www.Mailchimp.com" target="_blank">Mailchimp</a></p> |
|
378 | 378 | |
379 | 379 | </div> |
380 | 380 |