@@ -1214,8 +1214,6 @@ discard block |
||
1214 | 1214 | * the correct WordPress options API (old plugin stored options wierdly) |
1215 | 1215 | * |
1216 | 1216 | * @since 1.0.0 |
1217 | - * @param string $yikes_inc_easy_mailchimp_extender The name of this plugin. |
|
1218 | - * @param string $version The version of this plugin. |
|
1219 | 1217 | */ |
1220 | 1218 | public function check_for_old_yks_mc_options() { |
1221 | 1219 | $old_plugin_options = get_option( 'ykseme_storage' ); |
@@ -1250,8 +1248,6 @@ discard block |
||
1250 | 1248 | * the correct WordPress options API (old plugin stored options wierdly) |
1251 | 1249 | * |
1252 | 1250 | * @since 1.0.0 |
1253 | - * @param string $yikes_inc_easy_mailchimp_extender The name of this plugin. |
|
1254 | - * @param string $version The version of this plugin. |
|
1255 | 1251 | */ |
1256 | 1252 | public function display_options_migrate_notice() { |
1257 | 1253 |
@@ -413,8 +413,9 @@ discard block |
||
413 | 413 | $create_ticket_response = wp_remote_retrieve_body( $response ); |
414 | 414 | |
415 | 415 | // display it |
416 | - if( $create_ticket_response ) |
|
417 | - echo $create_ticket_response; |
|
416 | + if( $create_ticket_response ) { |
|
417 | + echo $create_ticket_response; |
|
418 | + } |
|
418 | 419 | |
419 | 420 | } |
420 | 421 | |
@@ -1160,7 +1161,7 @@ discard block |
||
1160 | 1161 | if( isset( $body['msg'] ) && $body['msg'] == "Everything's Chimpy!" ) { |
1161 | 1162 | update_option( 'yikes-mc-api-validation' , 'valid_api_key' ); |
1162 | 1163 | } |
1163 | - } else { |
|
1164 | + } else { |
|
1164 | 1165 | require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php'; |
1165 | 1166 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
1166 | 1167 | $error_logging->yikes_easy_mailchimp_write_to_error_log( $api_key_response->get_error_message() , __( "Connecting to MailChimp" , 'yikes-inc-easy-mailchimp-extender' ) , __( "Settings Page/General Settings" , 'yikes-inc-easy-mailchimp-extender' ) ); |
@@ -2009,7 +2010,8 @@ discard block |
||
2009 | 2010 | |
2010 | 2011 | |
2011 | 2012 | |
2012 | - } else { // THIS IS AN INTEREST GROUP! |
|
2013 | + } else { |
|
2014 | +// THIS IS AN INTEREST GROUP! |
|
2013 | 2015 | |
2014 | 2016 | ?> |
2015 | 2017 | <section class="draggable" id="<?php echo $field['group_id']; ?>"> |
@@ -492,10 +492,10 @@ discard block |
||
492 | 492 | } |
493 | 493 | |
494 | 494 | /** |
495 | - * Dismiss the migrate options notice (incase the user wants to do things manually) |
|
496 | - * |
|
497 | - * @since 6.0.0 |
|
498 | - **/ |
|
495 | + * Dismiss the migrate options notice (incase the user wants to do things manually) |
|
496 | + * |
|
497 | + * @since 6.0.0 |
|
498 | + **/ |
|
499 | 499 | public function yikes_easy_mailchimp_dismiss_option_migrate() { |
500 | 500 | // delete the options and allow the user to manually updadte things |
501 | 501 | |
@@ -626,10 +626,10 @@ discard block |
||
626 | 626 | } |
627 | 627 | |
628 | 628 | /** |
629 | - * Localize Script |
|
630 | - * Pass our imported list data, to the JS file |
|
631 | - * to build the drop down list in the modal |
|
632 | - */ |
|
629 | + * Localize Script |
|
630 | + * Pass our imported list data, to the JS file |
|
631 | + * to build the drop down list in the modal |
|
632 | + */ |
|
633 | 633 | public function tinymce_yikes_easy_mc() { |
634 | 634 | // check capabilities |
635 | 635 | if( ! current_user_can( apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ) ) ) { |
@@ -857,9 +857,9 @@ discard block |
||
857 | 857 | } |
858 | 858 | |
859 | 859 | /** |
860 | - * Register our admin pages |
|
861 | - * used to display data back to the user |
|
862 | - **/ |
|
860 | + * Register our admin pages |
|
861 | + * used to display data back to the user |
|
862 | + **/ |
|
863 | 863 | public function register_admin_pages() { |
864 | 864 | |
865 | 865 | /* Top Level Menu 'Easy MailChimp' */ |
@@ -1013,82 +1013,82 @@ discard block |
||
1013 | 1013 | } |
1014 | 1014 | |
1015 | 1015 | /** |
1016 | - * Generate YIKES Inc. Easy MailChimp Manage Forms Page |
|
1017 | - * |
|
1018 | - * @since 1.0.0 |
|
1019 | - */ |
|
1016 | + * Generate YIKES Inc. Easy MailChimp Manage Forms Page |
|
1017 | + * |
|
1018 | + * @since 1.0.0 |
|
1019 | + */ |
|
1020 | 1020 | function generateManageFormsPage() { |
1021 | 1021 | require_once YIKES_MC_PATH . 'admin/partials/menu/manage-forms.php'; // include our manage forms page |
1022 | 1022 | } |
1023 | 1023 | |
1024 | 1024 | /** |
1025 | - * Generate YIKES Inc. Easy MailChimp Manage Lists Page |
|
1026 | - * |
|
1027 | - * @since 1.0.0 |
|
1028 | - */ |
|
1025 | + * Generate YIKES Inc. Easy MailChimp Manage Lists Page |
|
1026 | + * |
|
1027 | + * @since 1.0.0 |
|
1028 | + */ |
|
1029 | 1029 | function generateManageListsPage() { |
1030 | 1030 | require_once YIKES_MC_PATH . 'admin/partials/menu/manage-lists.php'; // include our lists page |
1031 | 1031 | } |
1032 | 1032 | |
1033 | 1033 | /** |
1034 | - * Generate YIKES Inc. Easy MailChimp Account Details Page |
|
1035 | - * |
|
1036 | - * @since 1.0.0 |
|
1037 | - */ |
|
1034 | + * Generate YIKES Inc. Easy MailChimp Account Details Page |
|
1035 | + * |
|
1036 | + * @since 1.0.0 |
|
1037 | + */ |
|
1038 | 1038 | function generateAccountDetailsPage() { |
1039 | 1039 | require_once YIKES_MC_PATH . 'admin/partials/menu/account-details.php'; // include our account details page |
1040 | 1040 | } |
1041 | 1041 | |
1042 | 1042 | /** |
1043 | - * Generate YIKES Inc. Easy MailChimp Support Page |
|
1044 | - * |
|
1045 | - * @since 1.0.0 |
|
1046 | - */ |
|
1043 | + * Generate YIKES Inc. Easy MailChimp Support Page |
|
1044 | + * |
|
1045 | + * @since 1.0.0 |
|
1046 | + */ |
|
1047 | 1047 | function generateSupportPage() { |
1048 | 1048 | require_once YIKES_MC_PATH . 'admin/partials/menu/support.php'; // include our options page |
1049 | 1049 | } |
1050 | 1050 | |
1051 | 1051 | /** |
1052 | - * Generate YIKES Inc. Easy MailChimp Edit Form Page |
|
1053 | - * |
|
1054 | - * @since 1.0.0 |
|
1055 | - */ |
|
1052 | + * Generate YIKES Inc. Easy MailChimp Edit Form Page |
|
1053 | + * |
|
1054 | + * @since 1.0.0 |
|
1055 | + */ |
|
1056 | 1056 | function generateEditFormPage() { |
1057 | 1057 | require_once YIKES_MC_PATH . 'admin/partials/edit-form.php'; // include our options page |
1058 | 1058 | } |
1059 | 1059 | |
1060 | 1060 | /** |
1061 | - * Generate YIKES Inc. Easy MailChimp Welcome Page |
|
1062 | - * |
|
1063 | - * @since 1.0.0 |
|
1064 | - */ |
|
1061 | + * Generate YIKES Inc. Easy MailChimp Welcome Page |
|
1062 | + * |
|
1063 | + * @since 1.0.0 |
|
1064 | + */ |
|
1065 | 1065 | function generateWelcomePage() { |
1066 | 1066 | require_once YIKES_MC_PATH . 'admin/partials/welcome-page/welcome.php'; // include our options page |
1067 | 1067 | } |
1068 | 1068 | |
1069 | 1069 | /** |
1070 | - * Generate YIKES Inc. Easy MailChimp View List Page |
|
1071 | - * |
|
1072 | - * @since 1.0.0 |
|
1073 | - */ |
|
1070 | + * Generate YIKES Inc. Easy MailChimp View List Page |
|
1071 | + * |
|
1072 | + * @since 1.0.0 |
|
1073 | + */ |
|
1074 | 1074 | function generateViewListPage() { |
1075 | 1075 | require_once YIKES_MC_PATH . 'admin/partials/view-list.php'; // include our options page |
1076 | 1076 | } |
1077 | 1077 | |
1078 | 1078 | /** |
1079 | - * Generate YIKES Inc. Easy MailChimp View User Page |
|
1080 | - * |
|
1081 | - * @since 1.0.0 |
|
1082 | - */ |
|
1079 | + * Generate YIKES Inc. Easy MailChimp View User Page |
|
1080 | + * |
|
1081 | + * @since 1.0.0 |
|
1082 | + */ |
|
1083 | 1083 | function generateViewUserPage() { |
1084 | 1084 | require_once YIKES_MC_PATH . 'admin/partials/view-user.php'; // include our options page |
1085 | 1085 | } |
1086 | 1086 | |
1087 | 1087 | /** |
1088 | - * Register our plugin settings, and display them on our settings page |
|
1089 | - * |
|
1090 | - * @since v.5.4 |
|
1091 | - **/ |
|
1088 | + * Register our plugin settings, and display them on our settings page |
|
1089 | + * |
|
1090 | + * @since v.5.4 |
|
1091 | + **/ |
|
1092 | 1092 | function yikes_easy_mc_settings_init() { |
1093 | 1093 | |
1094 | 1094 | /* Register General Settings Section */ |
@@ -1204,9 +1204,9 @@ discard block |
||
1204 | 1204 | } |
1205 | 1205 | |
1206 | 1206 | /** |
1207 | - * Options Sanitization & Validation |
|
1208 | - * @since complete re-write |
|
1209 | - **/ |
|
1207 | + * Options Sanitization & Validation |
|
1208 | + * @since complete re-write |
|
1209 | + **/ |
|
1210 | 1210 | function yikes_mc_validate_api_key( $input ) { |
1211 | 1211 | if( $input === '' ) { |
1212 | 1212 | update_option( 'yikes-mc-api-validation' , 'invalid_api_key' ); |
@@ -1248,20 +1248,20 @@ discard block |
||
1248 | 1248 | } |
1249 | 1249 | |
1250 | 1250 | /** |
1251 | - * Generate YIKES Inc. Easy Forms for MailChimp Options Page |
|
1252 | - * |
|
1253 | - * @since 1.0.0 |
|
1254 | - */ |
|
1251 | + * Generate YIKES Inc. Easy Forms for MailChimp Options Page |
|
1252 | + * |
|
1253 | + * @since 1.0.0 |
|
1254 | + */ |
|
1255 | 1255 | function generatePageOptions() { |
1256 | 1256 | require_once YIKES_MC_PATH . 'admin/partials/menu/options.php'; // include our options page |
1257 | 1257 | } |
1258 | 1258 | |
1259 | 1259 | /** |
1260 | - * Check if users API key is valid, if not |
|
1261 | - * this function will apply a disabled attribute |
|
1262 | - * to form fields. (input, dropdowns, buttons etc.) |
|
1263 | - * @since v5.5 re-write |
|
1264 | - **/ |
|
1260 | + * Check if users API key is valid, if not |
|
1261 | + * this function will apply a disabled attribute |
|
1262 | + * to form fields. (input, dropdowns, buttons etc.) |
|
1263 | + * @since v5.5 re-write |
|
1264 | + **/ |
|
1265 | 1265 | public function is_user_mc_api_valid_form( $echo=true ) { |
1266 | 1266 | if( $echo == true ) { |
1267 | 1267 | if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) == 'invalid_api_key' ) { |
@@ -1301,7 +1301,7 @@ discard block |
||
1301 | 1301 | * Migrate our old options , to the new options API |
1302 | 1302 | * moving from 5.5 and beyond.. |
1303 | 1303 | * @since |
1304 | - */ |
|
1304 | + */ |
|
1305 | 1305 | public function migrate_old_yks_mc_options() { |
1306 | 1306 | // include our migrate options helper file |
1307 | 1307 | include_once YIKES_MC_PATH . 'admin/partials/upgrade-helpers/upgrade-migrate-options.php'; |
@@ -1310,7 +1310,7 @@ discard block |
||
1310 | 1310 | /** |
1311 | 1311 | Admin Notices |
1312 | 1312 | - Notifications displayed at the top of admin pages, back to the user |
1313 | - **/ |
|
1313 | + **/ |
|
1314 | 1314 | |
1315 | 1315 | /** |
1316 | 1316 | * Check for existing plugin options |
@@ -1369,12 +1369,12 @@ discard block |
||
1369 | 1369 | * - http://stackoverflow.com/questions/6661530/php-multi-dimensional-array-search |
1370 | 1370 | */ |
1371 | 1371 | function findMCListID($id, $array) { |
1372 | - foreach ($array as $key => $val) { |
|
1373 | - if ($val['id'] === $id) { |
|
1374 | - return $key; |
|
1375 | - } |
|
1376 | - } |
|
1377 | - return null; |
|
1372 | + foreach ($array as $key => $val) { |
|
1373 | + if ($val['id'] === $id) { |
|
1374 | + return $key; |
|
1375 | + } |
|
1376 | + } |
|
1377 | + return null; |
|
1378 | 1378 | } // end |
1379 | 1379 | |
1380 | 1380 | /* Ajax Migrate Options */ |
@@ -1727,9 +1727,9 @@ discard block |
||
1727 | 1727 | } |
1728 | 1728 | |
1729 | 1729 | /** |
1730 | - * Custom action hook for our extensions to hook into |
|
1731 | - * @parameter get_current_screen() current screen information |
|
1732 | - */ |
|
1730 | + * Custom action hook for our extensions to hook into |
|
1731 | + * @parameter get_current_screen() current screen information |
|
1732 | + */ |
|
1733 | 1733 | do_action( 'yikes-mailchimp-admin-sidebar', get_current_screen() ); |
1734 | 1734 | |
1735 | 1735 | } |
@@ -2773,12 +2773,12 @@ discard block |
||
2773 | 2773 | } |
2774 | 2774 | |
2775 | 2775 | /** |
2776 | - * Return an array of MailChimp lists associated with this account |
|
2777 | - * |
|
2778 | - * Used when deleting the sites MailChimp cache stored |
|
2779 | - * @since 6.0.2 |
|
2780 | - * @return $list_id_array - array of list id's to loop over |
|
2781 | - */ |
|
2776 | + * Return an array of MailChimp lists associated with this account |
|
2777 | + * |
|
2778 | + * Used when deleting the sites MailChimp cache stored |
|
2779 | + * @since 6.0.2 |
|
2780 | + * @return $list_id_array - array of list id's to loop over |
|
2781 | + */ |
|
2782 | 2782 | public function get_mailchimp_list_ids_on_account() { |
2783 | 2783 | $api_key = yikes_get_mc_api_key(); |
2784 | 2784 | if( ! $api_key ) { |
@@ -2888,19 +2888,19 @@ discard block |
||
2888 | 2888 | } |
2889 | 2889 | |
2890 | 2890 | /** |
2891 | - * Hook in and display our support page/knowledge base articles |
|
2892 | - * on the support page |
|
2893 | - * @since 6.0.3.8 |
|
2894 | - */ |
|
2891 | + * Hook in and display our support page/knowledge base articles |
|
2892 | + * on the support page |
|
2893 | + * @since 6.0.3.8 |
|
2894 | + */ |
|
2895 | 2895 | public function hook_and_display_kb_article_RSS() { |
2896 | 2896 | // include_once( YIKES_MC_PATH . 'admin/partials/helpers/knowledge-base-articles-RSS.php' ); |
2897 | 2897 | include_once( YIKES_MC_PATH . 'admin/partials/helpers/knowledge-base-article-links.php' ); |
2898 | 2898 | } |
2899 | 2899 | |
2900 | 2900 | /** |
2901 | - * Check the users version number, and display a notice to upgrade the databse if needed |
|
2902 | - * @since 6.0.4 |
|
2903 | - */ |
|
2901 | + * Check the users version number, and display a notice to upgrade the databse if needed |
|
2902 | + * @since 6.0.4 |
|
2903 | + */ |
|
2904 | 2904 | public function check_yikes_mc_table_version() { |
2905 | 2905 | if( get_option( 'yikes_mc_database_version', '0.00' ) < '1.0' ) { |
2906 | 2906 | require_once YIKES_MC_PATH . 'includes/class-yikes-inc-easy-mailchimp-extender-activator.php'; |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | /***********************/ |
105 | 105 | /** Create A Form **/ |
106 | 106 | /**********************/ |
107 | - if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-create-form' ) { |
|
107 | + if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-create-form' ) { |
|
108 | 108 | |
109 | 109 | add_action( 'init', array( $this, 'yikes_easy_mailchimp_create_form' ) ); |
110 | 110 | |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | /***********************/ |
114 | 114 | /** Delete A Form **/ |
115 | 115 | /**********************/ |
116 | - if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-delete-form' ) { |
|
116 | + if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-delete-form' ) { |
|
117 | 117 | |
118 | 118 | add_action( 'init', array( $this, 'yikes_easy_mailchimp_delete_form' ) ); |
119 | 119 | |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | /**********************************/ |
123 | 123 | /** Duplicate/Clone A Form **/ |
124 | 124 | /********************************/ |
125 | - if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-duplicate-form' ) { |
|
125 | + if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-duplicate-form' ) { |
|
126 | 126 | |
127 | 127 | add_action( 'init', array( $this, 'yikes_easy_mailchimp_duplicate_form' ) ); |
128 | 128 | |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | /*************************************/ |
132 | 132 | /** Reset Form Impression Stats **/ |
133 | 133 | /***********************************/ |
134 | - if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-reset-stats' ) { |
|
134 | + if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-reset-stats' ) { |
|
135 | 135 | |
136 | 136 | add_action( 'init', array( $this, 'yikes_easy_mailchimp_reset_impression_stats' ) ); |
137 | 137 | |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | /**********************************/ |
141 | 141 | /** Update A Form **/ |
142 | 142 | /********************************/ |
143 | - if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-update-form' ) { |
|
143 | + if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-update-form' ) { |
|
144 | 144 | |
145 | 145 | add_action( 'init', array( $this, 'yikes_easy_mailchimp_update_form' ) ); |
146 | 146 | |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | /**************************************************/ |
150 | 150 | /** Clear Store MailChimp Transient Data **/ |
151 | 151 | /*************************************************/ |
152 | - if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-clear-transient-data' ) { |
|
152 | + if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-clear-transient-data' ) { |
|
153 | 153 | |
154 | 154 | add_action( 'init', array( $this, 'yikes_easy_mailchimp_clear_transient_data' ) ); |
155 | 155 | |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | /*******************************************/ |
159 | 159 | /** Remove a user from a mailing list **/ |
160 | 160 | /*****************************************/ |
161 | - if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-unsubscribe-user' ) { |
|
161 | + if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-unsubscribe-user' ) { |
|
162 | 162 | |
163 | 163 | add_action( 'init', array( $this, 'yikes_easy_mailchimp_unsubscribe_user' ) ); |
164 | 164 | |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | /*******************************************/ |
168 | 168 | /** Create misisng error log file **/ |
169 | 169 | /*****************************************/ |
170 | - if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-create-error-log' ) { |
|
170 | + if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-create-error-log' ) { |
|
171 | 171 | |
172 | 172 | add_action( 'init', array( $this, 'yikes_easy_mailchimp_create_missing_error_log' ) ); |
173 | 173 | |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | /**************************************************/ |
200 | 200 | /** Clear MailChimp Error Log Data **/ |
201 | 201 | /*************************************************/ |
202 | - if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-clear-error-log' ) { |
|
202 | + if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-clear-error-log' ) { |
|
203 | 203 | |
204 | 204 | add_action( 'init', array( $this, 'yikes_easy_mailchimp_clear_error_log' ) ); |
205 | 205 | |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | /*********************************************/ |
209 | 209 | /** Export MailChimp Opt-in Forms **/ |
210 | 210 | /*******************************************/ |
211 | - if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-export-forms' ) { |
|
211 | + if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-export-forms' ) { |
|
212 | 212 | |
213 | 213 | add_action( 'init', array( $this, 'yikes_easy_mailchimp_export_forms' ) ); |
214 | 214 | |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | /*********************************************/ |
218 | 218 | /** Export Plugin Settings **/ |
219 | 219 | /*******************************************/ |
220 | - if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-export-settings' ) { |
|
220 | + if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-export-settings' ) { |
|
221 | 221 | |
222 | 222 | add_action( 'init', array( $this, 'yikes_easy_mailchimp_export_plugin_settings' ) ); |
223 | 223 | |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | /*******************************************/ |
227 | 227 | /** Import Class Inclusion **/ |
228 | 228 | /*****************************************/ |
229 | - if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yikes-easy-mc-import-forms' ) { |
|
229 | + if ( isset( $_REQUEST[ 'action' ] ) && $_REQUEST[ 'action' ] == 'yikes-easy-mc-import-forms' ) { |
|
230 | 230 | |
231 | 231 | add_action( 'init', array( $this, 'yikes_easy_mailchimp_import_forms' ) ); |
232 | 232 | |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | /*******************************************/ |
236 | 236 | /** Premium Support Request **/ |
237 | 237 | /*****************************************/ |
238 | - if ( isset( $_POST['submit-premium-support-request'] ) ) { |
|
238 | + if ( isset( $_POST[ 'submit-premium-support-request' ] ) ) { |
|
239 | 239 | |
240 | 240 | add_action( 'init', array( $this, 'yikes_easy_mailchimp_premium_support_request' ) ); |
241 | 241 | |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | /****************************************/ |
245 | 245 | /** Dismiss Options Migrations **/ |
246 | 246 | /****************************************/ |
247 | - if ( isset( $_REQUEST['dismiss_migration_nonce'] ) ) { |
|
247 | + if ( isset( $_REQUEST[ 'dismiss_migration_nonce' ] ) ) { |
|
248 | 248 | |
249 | 249 | add_action( 'init', array( $this, 'yikes_easy_mailchimp_dismiss_option_migrate' ) ); |
250 | 250 | |
@@ -280,8 +280,8 @@ discard block |
||
280 | 280 | * @ return array $links New array of plugin actions |
281 | 281 | */ |
282 | 282 | public function easy_forms_plugin_action_links( $links ) { |
283 | - $links[] = '<a href="'. esc_url( get_admin_url(null, 'admin.php?page=yikes-inc-easy-mailchimp-settings') ) .'">' . __( 'Settings', 'yikes-inc-easy-mailchimp-extender' ) . '</a>'; |
|
284 | - $links[] = '<a href="' . esc_url( 'http://www.yikesplugins.com?utm_source=plugins-page&utm_medium=plugin-row&utm_campaign=admin' ) . '" target="_blank">' . __( 'More plugins by YIKES' , 'yikes-inc-easy-mailchimp-extender' ) . '</a>'; |
|
283 | + $links[ ] = '<a href="' . esc_url( get_admin_url( null, 'admin.php?page=yikes-inc-easy-mailchimp-settings' ) ) . '">' . __( 'Settings', 'yikes-inc-easy-mailchimp-extender' ) . '</a>'; |
|
284 | + $links[ ] = '<a href="' . esc_url( 'http://www.yikesplugins.com?utm_source=plugins-page&utm_medium=plugin-row&utm_campaign=admin' ) . '" target="_blank">' . __( 'More plugins by YIKES', 'yikes-inc-easy-mailchimp-extender' ) . '</a>'; |
|
285 | 285 | return $links; |
286 | 286 | } |
287 | 287 | |
@@ -314,29 +314,29 @@ discard block |
||
314 | 314 | * @return parsed tag content |
315 | 315 | */ |
316 | 316 | public function parse_mailchimp_default_tag( $default_tag ) { |
317 | - if( ! $default_tag || $default_tag == '' ) { |
|
317 | + if ( ! $default_tag || $default_tag == '' ) { |
|
318 | 318 | return $default_tag; |
319 | 319 | } |
320 | 320 | global $post; |
321 | 321 | // page title |
322 | - if( $default_tag == '{page_title}' ) { |
|
322 | + if ( $default_tag == '{page_title}' ) { |
|
323 | 323 | $default_tag = get_the_title( $post->ID ); |
324 | 324 | } |
325 | 325 | // page id |
326 | - if( $default_tag == '{page_title}' ) { |
|
326 | + if ( $default_tag == '{page_title}' ) { |
|
327 | 327 | $default_tag = $post->ID; |
328 | 328 | } |
329 | 329 | // page url |
330 | - if( $default_tag == '{page_url}' ) { |
|
330 | + if ( $default_tag == '{page_url}' ) { |
|
331 | 331 | $default_tag = get_permalink( $post->ID ); |
332 | 332 | } |
333 | 333 | // blog name |
334 | - if( $default_tag == '{blog_name}' ) { |
|
334 | + if ( $default_tag == '{blog_name}' ) { |
|
335 | 335 | $default_tag = get_bloginfo( 'name' ); |
336 | 336 | } |
337 | 337 | // is user logged in |
338 | - if( $default_tag == '{user_logged_in}' ) { |
|
339 | - if( is_user_logged_in() ) { |
|
338 | + if ( $default_tag == '{user_logged_in}' ) { |
|
339 | + if ( is_user_logged_in() ) { |
|
340 | 340 | $default_tag = 'Registered User'; |
341 | 341 | } else { |
342 | 342 | $default_tag = 'Guest User'; |
@@ -354,12 +354,12 @@ discard block |
||
354 | 354 | */ |
355 | 355 | public function yikes_easy_mailchimp_clear_error_log() { |
356 | 356 | // file put contents $returned error + other data |
357 | - if( file_exists( YIKES_MC_PATH . 'includes/error_log/yikes-easy-mailchimp-error-log.php' ) ) { |
|
357 | + if ( file_exists( YIKES_MC_PATH . 'includes/error_log/yikes-easy-mailchimp-error-log.php' ) ) { |
|
358 | 358 | $clear_log = file_put_contents( |
359 | 359 | YIKES_MC_PATH . 'includes/error_log/yikes-easy-mailchimp-error-log.php', |
360 | 360 | '' |
361 | 361 | ); |
362 | - if( $clear_log === false ) { |
|
362 | + if ( $clear_log === false ) { |
|
363 | 363 | // redirect the user to the manage forms page, display error message |
364 | 364 | wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings§ion=debug-settings&error-log-cleared=false' ) ) ); |
365 | 365 | } else { |
@@ -377,17 +377,17 @@ discard block |
||
377 | 377 | */ |
378 | 378 | public function yikes_easy_mailchimp_export_forms() { |
379 | 379 | // grab our nonce |
380 | - $nonce = $_REQUEST['nonce']; |
|
380 | + $nonce = $_REQUEST[ 'nonce' ]; |
|
381 | 381 | // grab the forms |
382 | - $forms = isset( $_REQUEST['export_forms'] ) ? $_REQUEST['export_forms'] : array(); |
|
382 | + $forms = isset( $_REQUEST[ 'export_forms' ] ) ? $_REQUEST[ 'export_forms' ] : array(); |
|
383 | 383 | // validate nonce |
384 | - if( ! wp_verify_nonce( $nonce, 'export-forms' ) ) { |
|
385 | - wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) , __( "Failed nonce validation" , 'yikes-inc-easy-mailchimp-extender' ) , array( 'response' => 500 , 'back_link' => true ) ); |
|
384 | + if ( ! wp_verify_nonce( $nonce, 'export-forms' ) ) { |
|
385 | + wp_die( __( "We've run into an error. The security check didn't pass. Please try again.", 'yikes-inc-easy-mailchimp-extender' ), __( "Failed nonce validation", 'yikes-inc-easy-mailchimp-extender' ), array( 'response' => 500, 'back_link' => true ) ); |
|
386 | 386 | } |
387 | 387 | |
388 | 388 | // run the export function |
389 | 389 | // parameters: ( $table_name, $form_ids, $file_name ) |
390 | - Yikes_Inc_Easy_MailChimp_Export_Class::yikes_mailchimp_form_export('Yikes-Inc-Easy-MailChimp-Forms-Export', $forms ); |
|
390 | + Yikes_Inc_Easy_MailChimp_Export_Class::yikes_mailchimp_form_export( 'Yikes-Inc-Easy-MailChimp-Forms-Export', $forms ); |
|
391 | 391 | // re-direct the user back to the page |
392 | 392 | wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings§ion=import-export-forms' ) ) ); |
393 | 393 | die(); |
@@ -401,10 +401,10 @@ discard block |
||
401 | 401 | */ |
402 | 402 | public function yikes_easy_mailchimp_export_plugin_settings() { |
403 | 403 | // grab our nonce |
404 | - $nonce = $_REQUEST['nonce']; |
|
404 | + $nonce = $_REQUEST[ 'nonce' ]; |
|
405 | 405 | // validate nonce |
406 | - if( ! wp_verify_nonce( $nonce, 'export-settings' ) ) { |
|
407 | - wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) , __( "Failed nonce validation" , 'yikes-inc-easy-mailchimp-extender' ) , array( 'response' => 500 , 'back_link' => true ) ); |
|
406 | + if ( ! wp_verify_nonce( $nonce, 'export-settings' ) ) { |
|
407 | + wp_die( __( "We've run into an error. The security check didn't pass. Please try again.", 'yikes-inc-easy-mailchimp-extender' ), __( "Failed nonce validation", 'yikes-inc-easy-mailchimp-extender' ), array( 'response' => 500, 'back_link' => true ) ); |
|
408 | 408 | } |
409 | 409 | |
410 | 410 | // run the export function |
@@ -421,13 +421,13 @@ discard block |
||
421 | 421 | */ |
422 | 422 | public function yikes_easy_mailchimp_import_forms() { |
423 | 423 | // grab our nonce |
424 | - $nonce = $_REQUEST['nonce']; |
|
424 | + $nonce = $_REQUEST[ 'nonce' ]; |
|
425 | 425 | // validate nonce |
426 | - if( ! wp_verify_nonce( $nonce, 'import-forms' ) ) { |
|
427 | - wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) , __( "Failed nonce validation" , 'yikes-inc-easy-mailchimp-extender' ) , array( 'response' => 500 , 'back_link' => true ) ); |
|
426 | + if ( ! wp_verify_nonce( $nonce, 'import-forms' ) ) { |
|
427 | + wp_die( __( "We've run into an error. The security check didn't pass. Please try again.", 'yikes-inc-easy-mailchimp-extender' ), __( "Failed nonce validation", 'yikes-inc-easy-mailchimp-extender' ), array( 'response' => 500, 'back_link' => true ) ); |
|
428 | 428 | } |
429 | 429 | // include the export class |
430 | - if( ! class_exists( 'Yikes_Inc_Easy_MailChimp_Import_Class' ) ) { |
|
430 | + if ( ! class_exists( 'Yikes_Inc_Easy_MailChimp_Import_Class' ) ) { |
|
431 | 431 | include_once( YIKES_MC_PATH . 'includes/import-export/yikes-easy-mailchimp-import.class.php' ); |
432 | 432 | } |
433 | 433 | // run the import function |
@@ -445,15 +445,15 @@ discard block |
||
445 | 445 | */ |
446 | 446 | public function yikes_easy_mailchimp_premium_support_request() { |
447 | 447 | |
448 | - if( isset( $_POST['action'] ) && $_POST['action'] != 'yikes-support-request' ) { |
|
449 | - return __( 'We encountered an error. Please contact the YIKES Inc. support team.' , 'yikes-inc-easy-mailchimp-extender' ); |
|
448 | + if ( isset( $_POST[ 'action' ] ) && $_POST[ 'action' ] != 'yikes-support-request' ) { |
|
449 | + return __( 'We encountered an error. Please contact the YIKES Inc. support team.', 'yikes-inc-easy-mailchimp-extender' ); |
|
450 | 450 | } |
451 | 451 | |
452 | - $license = $_POST['license_key']; |
|
453 | - $user_email = $_POST['user-email']; |
|
454 | - $support_topic = $_POST['support-topic']; |
|
455 | - $support_priority = $_POST['support-priority']; |
|
456 | - $support_content = $_POST['support-content']; |
|
452 | + $license = $_POST[ 'license_key' ]; |
|
453 | + $user_email = $_POST[ 'user-email' ]; |
|
454 | + $support_topic = $_POST[ 'support-topic' ]; |
|
455 | + $support_priority = $_POST[ 'support-priority' ]; |
|
456 | + $support_content = $_POST[ 'support-content' ]; |
|
457 | 457 | |
458 | 458 | // wp_die( print_r( $support_content) ); |
459 | 459 | |
@@ -477,7 +477,7 @@ discard block |
||
477 | 477 | ) ); |
478 | 478 | |
479 | 479 | // catch the error |
480 | - if( is_wp_error( $response ) ) { |
|
480 | + if ( is_wp_error( $response ) ) { |
|
481 | 481 | wp_die( $response->getMessage() ); |
482 | 482 | return; |
483 | 483 | } |
@@ -486,7 +486,7 @@ discard block |
||
486 | 486 | $create_ticket_response = wp_remote_retrieve_body( $response ); |
487 | 487 | |
488 | 488 | // display it |
489 | - if( $create_ticket_response ) |
|
489 | + if ( $create_ticket_response ) |
|
490 | 490 | echo $create_ticket_response; |
491 | 491 | |
492 | 492 | } |
@@ -500,7 +500,7 @@ discard block |
||
500 | 500 | // delete the options and allow the user to manually updadte things |
501 | 501 | |
502 | 502 | // Verify the NONCE is valid |
503 | - check_admin_referer( 'yikes-mc-dismiss-migration' , 'dismiss_migration_nonce' ); |
|
503 | + check_admin_referer( 'yikes-mc-dismiss-migration', 'dismiss_migration_nonce' ); |
|
504 | 504 | |
505 | 505 | // re-direct the user back to the page |
506 | 506 | wp_redirect( esc_url_raw( admin_url( 'index.php?yikes-mc-options-migration-dismissed="true"' ) ) ); |
@@ -515,7 +515,7 @@ discard block |
||
515 | 515 | * @since 6.0.0 |
516 | 516 | */ |
517 | 517 | public function load_error_logging_class() { |
518 | - if( get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) { |
|
518 | + if ( get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) { |
|
519 | 519 | // if error logging is enabled we should include our error logging class |
520 | 520 | /* Generate oure error logging table */ |
521 | 521 | require_once YIKES_MC_PATH . '/includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php'; |
@@ -534,17 +534,17 @@ discard block |
||
534 | 534 | // add a new option to store the plugin activation date/time |
535 | 535 | // @since v6.0.0 |
536 | 536 | // this is used to notify the user that they should review after 2 weeks |
537 | - if ( !get_option( 'yikes_easy_mailchimp_activation_date' ) ) { |
|
537 | + if ( ! get_option( 'yikes_easy_mailchimp_activation_date' ) ) { |
|
538 | 538 | add_option( 'yikes_easy_mailchimp_activation_date', strtotime( "now" ) ); |
539 | 539 | } |
540 | 540 | |
541 | 541 | $stop_bugging_me = get_option( 'yikes_easy_mailchimp_review_stop_bugging_me' ); |
542 | 542 | |
543 | - if( !$stop_bugging_me ) { |
|
543 | + if ( ! $stop_bugging_me ) { |
|
544 | 544 | $install_date = get_option( 'yikes_easy_mailchimp_activation_date' ); |
545 | 545 | $past_date = strtotime( '-14 days' ); |
546 | 546 | if ( $past_date >= $install_date && current_user_can( 'install_plugins' ) ) { |
547 | - add_action( 'admin_notices', array( $this , 'yikes_easy_mailchimp_display_review_us_notice' ) ); |
|
547 | + add_action( 'admin_notices', array( $this, 'yikes_easy_mailchimp_display_review_us_notice' ) ); |
|
548 | 548 | } |
549 | 549 | } |
550 | 550 | |
@@ -557,13 +557,13 @@ discard block |
||
557 | 557 | */ |
558 | 558 | public function yikes_easy_mailchimp_display_review_us_notice() { |
559 | 559 | /* Lets only display our admin notice on YT4WP pages to not annoy the hell out of people :) */ |
560 | - if ( in_array( get_current_screen()->base , array( 'dashboard' , 'post' , 'edit' ) ) || strpos( get_current_screen()->base ,'yikes-inc-easy-mailchimp') !== false ) { |
|
560 | + if ( in_array( get_current_screen()->base, array( 'dashboard', 'post', 'edit' ) ) || strpos( get_current_screen()->base, 'yikes-inc-easy-mailchimp' ) !== false ) { |
|
561 | 561 | // Review URL - Change to the URL of your plugin on WordPress.org |
562 | 562 | $reviewurl = 'https://wordpress.org/support/view/plugin-reviews/yikes-inc-easy-mailchimp-extender'; |
563 | 563 | $addons_url = esc_url( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-addons' ) ); |
564 | 564 | $nobugurl = esc_url_raw( add_query_arg( 'yikes_easy_mc_icons_nobug', '1', admin_url() ) ); |
565 | 565 | $review_message = '<div id="yikes-mailchimp-logo"></div>'; |
566 | - $review_message .= sprintf( __( "It looks like you've been using %s for 2 weeks now. We hope you're enjoying the features included with the free version. If so, please consider leaving us a review. Reviews only help to catch other users attention as well as provide us with feedback to grow and improve upon. If you're really enjoying the plugin, consider buying an add-on or developer license for some really awesome features and premium support." , 'yikes-inc-easy-mailchimp-extender' ) . "<span class='button-container'> <a href='%s' target='_blank' class='button-secondary'><span class='dashicons dashicons-star-filled'></span>" . __( "Leave A Review" , 'yikes-inc-easy-mailchimp-extender' ) . "</a> <a href='%s' class='button-secondary'><span class='dashicons dashicons-upload'></span>" . __( "View Addons" , 'yikes-inc-easy-mailchimp-extender' ) . "</a> <a href='%s' class='button-secondary'><span class='dashicons dashicons-no-alt'></span>" . __( "Dismiss" , 'yikes-inc-easy-mailchimp-extender' ) . "</a> </span>", '<strong>Easy Forms for MailChimp by YIKES Inc.</strong>', $reviewurl, $addons_url, $nobugurl ) . ''; |
|
566 | + $review_message .= sprintf( __( "It looks like you've been using %s for 2 weeks now. We hope you're enjoying the features included with the free version. If so, please consider leaving us a review. Reviews only help to catch other users attention as well as provide us with feedback to grow and improve upon. If you're really enjoying the plugin, consider buying an add-on or developer license for some really awesome features and premium support.", 'yikes-inc-easy-mailchimp-extender' ) . "<span class='button-container'> <a href='%s' target='_blank' class='button-secondary'><span class='dashicons dashicons-star-filled'></span>" . __( "Leave A Review", 'yikes-inc-easy-mailchimp-extender' ) . "</a> <a href='%s' class='button-secondary'><span class='dashicons dashicons-upload'></span>" . __( "View Addons", 'yikes-inc-easy-mailchimp-extender' ) . "</a> <a href='%s' class='button-secondary'><span class='dashicons dashicons-no-alt'></span>" . __( "Dismiss", 'yikes-inc-easy-mailchimp-extender' ) . "</a> </span>", '<strong>Easy Forms for MailChimp by YIKES Inc.</strong>', $reviewurl, $addons_url, $nobugurl ) . ''; |
|
567 | 567 | ?> |
568 | 568 | <div id="review-yikes-easy-mailchimp-notice"> |
569 | 569 | <?php echo $review_message; ?> |
@@ -579,8 +579,8 @@ discard block |
||
579 | 579 | */ |
580 | 580 | public function yikes_easy_mailchimp_stop_bugging_me() { |
581 | 581 | $nobug = ""; |
582 | - if ( isset( $_GET['yikes_easy_mc_icons_nobug'] ) ) { |
|
583 | - $nobug = (int) esc_attr( $_GET['yikes_easy_mc_icons_nobug'] ); |
|
582 | + if ( isset( $_GET[ 'yikes_easy_mc_icons_nobug' ] ) ) { |
|
583 | + $nobug = (int) esc_attr( $_GET[ 'yikes_easy_mc_icons_nobug' ] ); |
|
584 | 584 | } |
585 | 585 | if ( 1 == $nobug ) { |
586 | 586 | add_option( 'yikes_easy_mailchimp_review_stop_bugging_me', TRUE ); |
@@ -591,7 +591,7 @@ discard block |
||
591 | 591 | |
592 | 592 | /* Display a warning users who are using PHP < 5.3 */ |
593 | 593 | public function display_php_warning() { |
594 | - $message = __( 'YIKES Inc. Easy Forms for MailChimp requires a minimum of PHP 5.3. The plugin will not function properly until you update. Reach out to your host provider for assistance.' , 'yikes-inc-easy-mailchimp-extender' ); |
|
594 | + $message = __( 'YIKES Inc. Easy Forms for MailChimp requires a minimum of PHP 5.3. The plugin will not function properly until you update. Reach out to your host provider for assistance.', 'yikes-inc-easy-mailchimp-extender' ); |
|
595 | 595 | echo "<div class='error'> <p><span class='dashicons dashicons-no-alt' style='color:rgb(231, 98, 98)'></span> $message</p></div>"; |
596 | 596 | } |
597 | 597 | |
@@ -602,7 +602,7 @@ discard block |
||
602 | 602 | public function add_tinyMCE_buttons() { |
603 | 603 | global $typenow; |
604 | 604 | // only on Post Type: post and page |
605 | - if( ! in_array( $typenow, array( 'post', 'page' ) ) ) { |
|
605 | + if ( ! in_array( $typenow, array( 'post', 'page' ) ) ) { |
|
606 | 606 | return; |
607 | 607 | } |
608 | 608 | add_filter( 'mce_buttons', array( $this, 'yks_mc_add_tinymce_button' ) ); |
@@ -619,7 +619,7 @@ discard block |
||
619 | 619 | // inlcude the js for tinymce |
620 | 620 | public function yks_mc_add_tinymce_plugin( $plugin_array ) { |
621 | 621 | |
622 | - $plugin_array['yks_mc_tinymce_button'] = plugins_url( '/js/min/yikes-inc-easy-mailchimp-tinymce-button.min.js', __FILE__ ); |
|
622 | + $plugin_array[ 'yks_mc_tinymce_button' ] = plugins_url( '/js/min/yikes-inc-easy-mailchimp-tinymce-button.min.js', __FILE__ ); |
|
623 | 623 | |
624 | 624 | return $plugin_array; |
625 | 625 | |
@@ -632,23 +632,23 @@ discard block |
||
632 | 632 | */ |
633 | 633 | public function tinymce_yikes_easy_mc() { |
634 | 634 | // check capabilities |
635 | - if( ! current_user_can( apply_filters( 'yikes-mailchimp-user-role-access' , 'manage_options' ) ) ) { |
|
635 | + if ( ! current_user_can( apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ) ) ) { |
|
636 | 636 | return; |
637 | 637 | } |
638 | 638 | |
639 | 639 | $list_data = $this->form_interface->get_all_forms(); |
640 | 640 | $lists = array(); |
641 | - if( !empty( $list_data ) ) { |
|
641 | + if ( ! empty( $list_data ) ) { |
|
642 | 642 | // build an array to pass to our javascript |
643 | - foreach( $list_data as $id => $form ) { |
|
644 | - $lists[] = array( |
|
645 | - 'text' => urlencode( $form['form_name'] ), |
|
643 | + foreach ( $list_data as $id => $form ) { |
|
644 | + $lists[ ] = array( |
|
645 | + 'text' => urlencode( $form[ 'form_name' ] ), |
|
646 | 646 | 'value' => $id, |
647 | 647 | ); |
648 | 648 | } |
649 | 649 | } else { |
650 | - $lists[0] = array( |
|
651 | - 'text' => __( 'Please Import Some MailChimp Lists' , 'yikes-inc-easy-mailchimp-extender' ), |
|
650 | + $lists[ 0 ] = array( |
|
651 | + 'text' => __( 'Please Import Some MailChimp Lists', 'yikes-inc-easy-mailchimp-extender' ), |
|
652 | 652 | 'value' => '-' |
653 | 653 | ); |
654 | 654 | } |
@@ -658,10 +658,10 @@ discard block |
||
658 | 658 | 'forms' => json_encode( $lists ), |
659 | 659 | 'button_title' => __( 'Easy Forms for MailChimp by YIKES', 'yikes-inc-easy-mailchimp-extender' ), |
660 | 660 | 'popup_title' => __( 'Easy Forms for MailChimp by YIKES', 'yikes-inc-easy-mailchimp-extender' ), |
661 | - 'list_id_label' => __( 'MailChimp Opt-In Form' , 'yikes-inc-easy-mailchimp-extender' ), |
|
662 | - 'show_title_label' => __( 'Display Form Title' , 'yikes-inc-easy-mailchimp-extender' ), |
|
663 | - 'show_description_label' => __( 'Display Form Description' , 'yikes-inc-easy-mailchimp-extender' ), |
|
664 | - 'submit_button_text_label' => __( 'Custom Submit Button Text' , 'yikes-inc-easy-mailchimp-extender' ), |
|
661 | + 'list_id_label' => __( 'MailChimp Opt-In Form', 'yikes-inc-easy-mailchimp-extender' ), |
|
662 | + 'show_title_label' => __( 'Display Form Title', 'yikes-inc-easy-mailchimp-extender' ), |
|
663 | + 'show_description_label' => __( 'Display Form Description', 'yikes-inc-easy-mailchimp-extender' ), |
|
664 | + 'submit_button_text_label' => __( 'Custom Submit Button Text', 'yikes-inc-easy-mailchimp-extender' ), |
|
665 | 665 | 'submit_button_message' => '<em>' . __( 'If left empty, the button will use the default submit button text .', 'yikes-inc-easy-mailchimp-extender' ) . '</em>', |
666 | 666 | 'alert_translated' => sprintf( __( 'You need to <a href=%s title="%s">create a form</a> before you can add one to a page or post.', 'yikes-inc-easy-mailchimp-extender' ), esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ), __( 'Create a form', 'yikes-inc-easy-mailchimp-extender' ) ), |
667 | 667 | ) ); |
@@ -677,7 +677,7 @@ discard block |
||
677 | 677 | if ( get_option( 'yikes_mailchimp_activation_redirect', 'true' ) == 'true' ) { |
678 | 678 | update_option( 'yikes_mailchimp_activation_redirect', 'false' ); |
679 | 679 | /* If the user had this plugin activated prior to today, redirect to 'Whats New' */ |
680 | - if( get_option( 'yikes_easy_mailchimp_activation_date', strtotime( 'now' ) ) == strtotime( 'now' ) ) { |
|
680 | + if ( get_option( 'yikes_easy_mailchimp_activation_date', strtotime( 'now' ) ) == strtotime( 'now' ) ) { |
|
681 | 681 | wp_redirect( esc_url( admin_url( 'admin.php?page=yikes-mailchimp-welcome' ) ) ); |
682 | 682 | } else { |
683 | 683 | /* Else redirect the user over to the 'Getting Started' tab */ |
@@ -729,7 +729,7 @@ discard block |
||
729 | 729 | * @since 6.0.0 |
730 | 730 | */ |
731 | 731 | public function enqueue_scripts() { |
732 | - wp_enqueue_script( 'yikes-inc-easy-mailchimp-extender-admin-js', plugin_dir_url( __FILE__ ) . 'js/min/yikes-inc-easy-mailchimp-extender-admin.min.js', array( 'jquery' , 'jquery-ui-sortable' ), $this->version, false ); |
|
732 | + wp_enqueue_script( 'yikes-inc-easy-mailchimp-extender-admin-js', plugin_dir_url( __FILE__ ) . 'js/min/yikes-inc-easy-mailchimp-extender-admin.min.js', array( 'jquery', 'jquery-ui-sortable' ), $this->version, false ); |
|
733 | 733 | |
734 | 734 | $localized_data = array( |
735 | 735 | 'admin_url' => esc_url_raw( admin_url() ), |
@@ -739,7 +739,7 @@ discard block |
||
739 | 739 | 'preloader_url' => esc_url_raw( admin_url( '/images/wpspin_light.gif' ) ), |
740 | 740 | ); |
741 | 741 | |
742 | - wp_localize_script( 'yikes-inc-easy-mailchimp-extender-admin-js' , 'object_data' , $localized_data ); |
|
742 | + wp_localize_script( 'yikes-inc-easy-mailchimp-extender-admin-js', 'object_data', $localized_data ); |
|
743 | 743 | |
744 | 744 | // Enqueue required scripts for the form editor |
745 | 745 | $screen = get_current_screen(); |
@@ -752,8 +752,8 @@ discard block |
||
752 | 752 | |
753 | 753 | wp_enqueue_style( 'wp-color-picker' ); |
754 | 754 | wp_enqueue_script( 'wp-color-picker' ); |
755 | - wp_enqueue_script( 'jquery.timepicker.js',YIKES_MC_URL . 'admin/js/jquery.timepicker.min.js' , array( 'jquery' ) , $this->version, false ); |
|
756 | - wp_enqueue_script( 'edit-form-js' , YIKES_MC_URL . 'admin/js/min/yikes-inc-easy-mailchimp-extender-edit-form.min.js' , array( 'jquery.timepicker.js', 'jquery-ui-datepicker' ) , $this->version, false ); |
|
755 | + wp_enqueue_script( 'jquery.timepicker.js', YIKES_MC_URL . 'admin/js/jquery.timepicker.min.js', array( 'jquery' ), $this->version, false ); |
|
756 | + wp_enqueue_script( 'edit-form-js', YIKES_MC_URL . 'admin/js/min/yikes-inc-easy-mailchimp-extender-edit-form.min.js', array( 'jquery.timepicker.js', 'jquery-ui-datepicker' ), $this->version, false ); |
|
757 | 757 | |
758 | 758 | $localized_data = array( |
759 | 759 | 'ajax_url' => esc_url_raw( admin_url( 'admin-ajax.php' ) ), |
@@ -778,7 +778,7 @@ discard block |
||
778 | 778 | 'isRTL' => $wp_locale->is_rtl(), |
779 | 779 | 'start_date_exceeds_end_date_error' => __( 'Error: The start date and time cannot occur after the end date and time. Chosen date reverted to previous selection.', 'yikes-inc-easy-mailchimp-extender' ), |
780 | 780 | ); |
781 | - wp_localize_script( 'edit-form-js' , 'yikes_mailchimp_edit_form' , $localized_data ); |
|
781 | + wp_localize_script( 'edit-form-js', 'yikes_mailchimp_edit_form', $localized_data ); |
|
782 | 782 | } |
783 | 783 | |
784 | 784 | /** |
@@ -840,7 +840,7 @@ discard block |
||
840 | 840 | * Convert the php date format string to a js date format |
841 | 841 | */ |
842 | 842 | public function yikes_jQuery_datepicker_date_format( $site_option ) { |
843 | - switch( $site_option ) { |
|
843 | + switch ( $site_option ) { |
|
844 | 844 | //Predefined WP date formats |
845 | 845 | default: |
846 | 846 | case 'F j, Y': |
@@ -1093,7 +1093,7 @@ discard block |
||
1093 | 1093 | |
1094 | 1094 | /* Register General Settings Section */ |
1095 | 1095 | |
1096 | - register_setting( 'yikes_inc_easy_mc_general_settings_page', 'yikes-mc-api-key', array( $this , 'yikes_mc_validate_api_key' ) ); |
|
1096 | + register_setting( 'yikes_inc_easy_mc_general_settings_page', 'yikes-mc-api-key', array( $this, 'yikes_mc_validate_api_key' ) ); |
|
1097 | 1097 | |
1098 | 1098 | add_settings_section( |
1099 | 1099 | 'yikes_easy_mc_settings_general_section_callback', |
@@ -1136,16 +1136,16 @@ discard block |
||
1136 | 1136 | add_settings_field( |
1137 | 1137 | 'optin-checkbox-init', |
1138 | 1138 | __( 'Select Checkboxes to Generate', 'yikes-inc-easy-mailchimp-extender' ), |
1139 | - '', // callback + validation inside of admin/partials/menu/options.php |
|
1139 | + '', // callback + validation inside of admin/partials/menu/options.php |
|
1140 | 1140 | 'yikes_inc_easy_mc_checkbox_settings' |
1141 | 1141 | ); |
1142 | 1142 | /* End Checkbox Settings */ |
1143 | 1143 | |
1144 | 1144 | /* reCAPTCHA Settings */ |
1145 | 1145 | |
1146 | - register_setting( 'yikes_inc_easy_mc_recaptcha_settings_page' , 'yikes-mc-recaptcha-status' ); |
|
1147 | - register_setting( 'yikes_inc_easy_mc_recaptcha_settings_page' , 'yikes-mc-recaptcha-site-key' ); |
|
1148 | - register_setting( 'yikes_inc_easy_mc_recaptcha_settings_page' , 'yikes-mc-recaptcha-secret-key' ); |
|
1146 | + register_setting( 'yikes_inc_easy_mc_recaptcha_settings_page', 'yikes-mc-recaptcha-status' ); |
|
1147 | + register_setting( 'yikes_inc_easy_mc_recaptcha_settings_page', 'yikes-mc-recaptcha-site-key' ); |
|
1148 | + register_setting( 'yikes_inc_easy_mc_recaptcha_settings_page', 'yikes-mc-recaptcha-secret-key' ); |
|
1149 | 1149 | |
1150 | 1150 | /* Register reCAPTCHA Settings Section */ |
1151 | 1151 | add_settings_section( |
@@ -1158,28 +1158,28 @@ discard block |
||
1158 | 1158 | add_settings_field( |
1159 | 1159 | 'yikes-mc-recaptcha-site-key', |
1160 | 1160 | __( 'Enter reCAPTCHA Site Key', 'yikes-inc-easy-mailchimp-extender' ), |
1161 | - '', // callback + validation inside of admin/partials/menu/options.php |
|
1161 | + '', // callback + validation inside of admin/partials/menu/options.php |
|
1162 | 1162 | 'yikes_easy_mc_settings_recpatcha_section' |
1163 | 1163 | ); |
1164 | 1164 | |
1165 | 1165 | add_settings_field( |
1166 | 1166 | 'yikes-mc-recaptcha-secret-key', |
1167 | 1167 | __( 'Enter reCAPTCHA Secret Key', 'yikes-inc-easy-mailchimp-extender' ), |
1168 | - '', // callback + validation inside of admin/partials/menu/options.php |
|
1168 | + '', // callback + validation inside of admin/partials/menu/options.php |
|
1169 | 1169 | 'yikes_easy_mc_settings_recpatcha_section' |
1170 | 1170 | ); |
1171 | 1171 | |
1172 | 1172 | add_settings_field( |
1173 | 1173 | 'yikes-mc-recaptcha-status', |
1174 | 1174 | __( 'Enable ReCaptcha', 'yikes-inc-easy-mailchimp-extender' ), |
1175 | - '', // callback + validation inside of admin/partials/menu/options.php |
|
1175 | + '', // callback + validation inside of admin/partials/menu/options.php |
|
1176 | 1176 | 'yikes_easy_mc_settings_recpatcha_section' |
1177 | 1177 | ); |
1178 | 1178 | |
1179 | 1179 | /* End reCAPTCHA Settings */ |
1180 | 1180 | |
1181 | 1181 | /* Debug Settings */ |
1182 | - register_setting( 'yikes_inc_easy_mc_debug_settings_page' , 'yikes-mailchimp-debug-status' ); |
|
1182 | + register_setting( 'yikes_inc_easy_mc_debug_settings_page', 'yikes-mailchimp-debug-status' ); |
|
1183 | 1183 | |
1184 | 1184 | /* Register Debug Settings Section */ |
1185 | 1185 | add_settings_section( |
@@ -1192,7 +1192,7 @@ discard block |
||
1192 | 1192 | add_settings_field( |
1193 | 1193 | 'yikes-mailchimp-debug-status', |
1194 | 1194 | __( 'Enable Debugging', 'yikes-inc-easy-mailchimp-extender' ), |
1195 | - '', // callback + validation inside of admin/partials/menu/options.php |
|
1195 | + '', // callback + validation inside of admin/partials/menu/options.php |
|
1196 | 1196 | 'yikes_easy_mc_settings_debug_section' |
1197 | 1197 | ); |
1198 | 1198 | |
@@ -1208,30 +1208,30 @@ discard block |
||
1208 | 1208 | * @since complete re-write |
1209 | 1209 | **/ |
1210 | 1210 | function yikes_mc_validate_api_key( $input ) { |
1211 | - if( $input === '' ) { |
|
1212 | - update_option( 'yikes-mc-api-validation' , 'invalid_api_key' ); |
|
1211 | + if ( $input === '' ) { |
|
1212 | + update_option( 'yikes-mc-api-validation', 'invalid_api_key' ); |
|
1213 | 1213 | return ''; |
1214 | 1214 | } |
1215 | - $api_key = strip_tags ( trim( $input ) ); |
|
1215 | + $api_key = strip_tags( trim( $input ) ); |
|
1216 | 1216 | $dash_position = strpos( trim( $input ), '-' ); |
1217 | - if( $dash_position !== false ) { |
|
1217 | + if ( $dash_position !== false ) { |
|
1218 | 1218 | $manager = new Yikes_Inc_Easy_MailChimp_API_Manager( $api_key ); |
1219 | 1219 | } else { |
1220 | 1220 | update_option( 'yikes-mc-api-invalid-key-response', __( 'Your API key appears to be invalid.', 'yikes-inc-easy-mailchimp-extender' ) ); |
1221 | - update_option( 'yikes-mc-api-validation' , 'invalid_api_key' ); |
|
1221 | + update_option( 'yikes-mc-api-validation', 'invalid_api_key' ); |
|
1222 | 1222 | return $api_key; |
1223 | 1223 | } |
1224 | 1224 | |
1225 | 1225 | $response = $manager->get_account_handler()->get_account( false ); |
1226 | - if( ! is_wp_error( $response ) ) { |
|
1227 | - update_option( 'yikes-mc-api-validation' , 'valid_api_key' ); |
|
1226 | + if ( ! is_wp_error( $response ) ) { |
|
1227 | + update_option( 'yikes-mc-api-validation', 'valid_api_key' ); |
|
1228 | 1228 | // Clear the API key transient data |
1229 | 1229 | $this->delete_yikes_mailchimp_transients(); |
1230 | - } else { |
|
1230 | + } else { |
|
1231 | 1231 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
1232 | - $error_logging->yikes_easy_mailchimp_write_to_error_log( $response->get_error_message() , __( "Connecting to MailChimp" , 'yikes-inc-easy-mailchimp-extender' ) , __( "Settings Page/General Settings" , 'yikes-inc-easy-mailchimp-extender' ) ); |
|
1233 | - update_option( 'yikes-mc-api-invalid-key-response' , $response->get_error_message() ); |
|
1234 | - update_option( 'yikes-mc-api-validation' , 'invalid_api_key' ); |
|
1232 | + $error_logging->yikes_easy_mailchimp_write_to_error_log( $response->get_error_message(), __( "Connecting to MailChimp", 'yikes-inc-easy-mailchimp-extender' ), __( "Settings Page/General Settings", 'yikes-inc-easy-mailchimp-extender' ) ); |
|
1233 | + update_option( 'yikes-mc-api-invalid-key-response', $response->get_error_message() ); |
|
1234 | + update_option( 'yikes-mc-api-validation', 'invalid_api_key' ); |
|
1235 | 1235 | } |
1236 | 1236 | // returned the api key |
1237 | 1237 | return $api_key; |
@@ -1252,13 +1252,13 @@ discard block |
||
1252 | 1252 | * to form fields. (input, dropdowns, buttons etc.) |
1253 | 1253 | * @since v5.5 re-write |
1254 | 1254 | **/ |
1255 | - public function is_user_mc_api_valid_form( $echo=true ) { |
|
1256 | - if( $echo == true ) { |
|
1257 | - if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) == 'invalid_api_key' ) { |
|
1255 | + public function is_user_mc_api_valid_form( $echo = true ) { |
|
1256 | + if ( $echo == true ) { |
|
1257 | + if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) == 'invalid_api_key' ) { |
|
1258 | 1258 | echo 'disabled="disabled"'; |
1259 | 1259 | } |
1260 | 1260 | } else { |
1261 | - if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) == 'invalid_api_key' ) { |
|
1261 | + if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) == 'invalid_api_key' ) { |
|
1262 | 1262 | return false; |
1263 | 1263 | } else { |
1264 | 1264 | return true; |
@@ -1278,11 +1278,11 @@ discard block |
||
1278 | 1278 | public function check_for_old_yks_mc_options() { |
1279 | 1279 | $old_plugin_options = get_option( 'ykseme_storage' ); |
1280 | 1280 | // only perform options migrations if the site is not a multi-site setup |
1281 | - if ( !is_multisite() ) { |
|
1282 | - if( apply_filters( 'yikes_mc_old_options_filter' , $old_plugin_options ) ) { |
|
1281 | + if ( ! is_multisite() ) { |
|
1282 | + if ( apply_filters( 'yikes_mc_old_options_filter', $old_plugin_options ) ) { |
|
1283 | 1283 | // display a notice to the user that they should 'migrate' |
1284 | 1284 | // from the old plugin settings to the new ones |
1285 | - add_action( 'admin_notices', array( $this , 'display_options_migrate_notice' ) , 11 ); |
|
1285 | + add_action( 'admin_notices', array( $this, 'display_options_migrate_notice' ), 11 ); |
|
1286 | 1286 | } |
1287 | 1287 | } |
1288 | 1288 | } |
@@ -1315,11 +1315,11 @@ discard block |
||
1315 | 1315 | |
1316 | 1316 | // Confirm that the necessary forms table in the database exists, else bail |
1317 | 1317 | global $wpdb; |
1318 | - if( $wpdb->get_var("show tables like '" . $wpdb->prefix . "yikes_easy_mc_forms'") != $wpdb->prefix . "yikes_easy_mc_forms" ) { |
|
1318 | + if ( $wpdb->get_var( "show tables like '" . $wpdb->prefix . "yikes_easy_mc_forms'" ) != $wpdb->prefix . "yikes_easy_mc_forms" ) { |
|
1319 | 1319 | return; |
1320 | 1320 | } |
1321 | 1321 | |
1322 | - if( isset( $_GET['yikes-mc-options-migration-dismissed'] ) && $_GET['yikes-mc-options-migration-dismissed'] == 'true' ) { |
|
1322 | + if ( isset( $_GET[ 'yikes-mc-options-migration-dismissed' ] ) && $_GET[ 'yikes-mc-options-migration-dismissed' ] == 'true' ) { |
|
1323 | 1323 | // Delete the options, start a-new! (this will disable the migration notice altogether) |
1324 | 1324 | delete_option( 'widget_yikes_mc_widget' ); |
1325 | 1325 | delete_option( 'api_validation' ); |
@@ -1333,18 +1333,18 @@ discard block |
||
1333 | 1333 | } else { |
1334 | 1334 | ?> |
1335 | 1335 | <div class="yikes-easy-mc-updated migrate-options-notice"> |
1336 | - <p><?php printf( __( "It looks like you're upgrading from a previous version of %s.", 'yikes-inc-easy-mailchimp-extender' ), '<strong>YIKES Inc. Easy Forms for MailChimp</strong>' ); ?> <?php printf( __( "In the newest version of %s, the options data structure has changed. We've also moved the mailing lists into its own database table to allow for some higher level customization. Now you can easily create multiple forms and assign them to the same mailing list." , 'yikes-inc-easy-mailchimp-extender' ), '<strong>YIKES Inc. Easy Forms for MailChimp</strong>' ); ?></p> |
|
1336 | + <p><?php printf( __( "It looks like you're upgrading from a previous version of %s.", 'yikes-inc-easy-mailchimp-extender' ), '<strong>YIKES Inc. Easy Forms for MailChimp</strong>' ); ?> <?php printf( __( "In the newest version of %s, the options data structure has changed. We've also moved the mailing lists into its own database table to allow for some higher level customization. Now you can easily create multiple forms and assign them to the same mailing list.", 'yikes-inc-easy-mailchimp-extender' ), '<strong>YIKES Inc. Easy Forms for MailChimp</strong>' ); ?></p> |
|
1337 | 1337 | <p><?php _e( "Before you continue, it's strongly recommended you the perform the migration to ensure the plugin continues to function properly.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
1338 | 1338 | <p><em><?php _e( "It's also strongly recommended that you take a backup of your database.", 'yikes-inc-easy-mailchimp-extender' ); ?></em></p> |
1339 | 1339 | <section id="migration-buttons"> |
1340 | 1340 | <!-- migrate button --> |
1341 | 1341 | <form> |
1342 | 1342 | <input type="hidden" name="yikes-mc-update-option-structure" value="yikes-mc-update-option-structure" /> |
1343 | - <a href="<?php echo wp_nonce_url( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-update' ) ), 'yikes-mc-migrate-options' , 'migrate_options_nonce' ); ?>" class="button-secondary"><?php _e( 'Perform Migration' , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
1343 | + <a href="<?php echo wp_nonce_url( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-update' ) ), 'yikes-mc-migrate-options', 'migrate_options_nonce' ); ?>" class="button-secondary"><?php _e( 'Perform Migration', 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
1344 | 1344 | </form> |
1345 | 1345 | <!-- dismiss button --> |
1346 | 1346 | <form> |
1347 | - <a href="<?php echo wp_nonce_url( esc_url_raw( admin_url() ), 'yikes-mc-dismiss-migration' , 'dismiss_migration_nonce' ); ?>" class="button-secondary"><?php _e( 'Dismiss Notice' , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
1347 | + <a href="<?php echo wp_nonce_url( esc_url_raw( admin_url() ), 'yikes-mc-dismiss-migration', 'dismiss_migration_nonce' ); ?>" class="button-secondary"><?php _e( 'Dismiss Notice', 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
1348 | 1348 | </form> |
1349 | 1349 | </section> |
1350 | 1350 | |
@@ -1358,9 +1358,9 @@ discard block |
||
1358 | 1358 | * and return the index ( used to find the list name assigned to a form ) |
1359 | 1359 | * - http://stackoverflow.com/questions/6661530/php-multi-dimensional-array-search |
1360 | 1360 | */ |
1361 | - function findMCListID($id, $array) { |
|
1362 | - foreach ($array as $key => $val) { |
|
1363 | - if ($val['id'] === $id) { |
|
1361 | + function findMCListID( $id, $array ) { |
|
1362 | + foreach ( $array as $key => $val ) { |
|
1363 | + if ( $val[ 'id' ] === $id ) { |
|
1364 | 1364 | return $key; |
1365 | 1365 | } |
1366 | 1366 | } |
@@ -1370,9 +1370,9 @@ discard block |
||
1370 | 1370 | /* Ajax Migrate Options */ |
1371 | 1371 | function migrate_archived_options() { |
1372 | 1372 | // all options prefixed with 'yikes-mc-' |
1373 | - $option_name = 'yikes-mc-'.$_POST['option_name']; |
|
1374 | - $option_value = $_POST['option_value']; |
|
1375 | - if( json_decode( $option_value ) ) { |
|
1373 | + $option_name = 'yikes-mc-' . $_POST[ 'option_name' ]; |
|
1374 | + $option_value = $_POST[ 'option_value' ]; |
|
1375 | + if ( json_decode( $option_value ) ) { |
|
1376 | 1376 | // decode our lists() array, and store it |
1377 | 1377 | $opt_value = json_decode( $option_value, true ); |
1378 | 1378 | } else { |
@@ -1385,23 +1385,23 @@ discard block |
||
1385 | 1385 | |
1386 | 1386 | /* Ajax Migrate Forms */ |
1387 | 1387 | function migrate_previously_setup_forms() { |
1388 | - $option_name = $_POST['option_name']; |
|
1389 | - $done = $_POST['done_import']; |
|
1388 | + $option_name = $_POST[ 'option_name' ]; |
|
1389 | + $done = $_POST[ 'done_import' ]; |
|
1390 | 1390 | // Create some starter forms for the user |
1391 | 1391 | // based on previously imported lists (to our old version) |
1392 | - if( $option_name == 'yikes-mc-lists' ) { |
|
1393 | - $option_value = $_POST['option_value']; |
|
1394 | - $new_options = json_decode( stripslashes_deep( $option_value ) , true ); |
|
1392 | + if ( $option_name == 'yikes-mc-lists' ) { |
|
1393 | + $option_value = $_POST[ 'option_value' ]; |
|
1394 | + $new_options = json_decode( stripslashes_deep( $option_value ), true ); |
|
1395 | 1395 | |
1396 | - $list_id = $new_options['id']; |
|
1397 | - $form_name = $new_options['name']; |
|
1398 | - $fields = $new_options['fields']; // our fields array |
|
1396 | + $list_id = $new_options[ 'id' ]; |
|
1397 | + $form_name = $new_options[ 'name' ]; |
|
1398 | + $fields = $new_options[ 'fields' ]; // our fields array |
|
1399 | 1399 | |
1400 | - $custom_styles = isset( $new_options['custom_styles'] ) ? $new_options['custom_styles']: '0'; // store as an array with all of our styles |
|
1401 | - $custom_template = isset( $new_options['custom_template'] ) ? $new_options['custom_template'] : '0'; // store template data as an array ( active , template used ) |
|
1402 | - $send_welcome_email = isset( $new_options['yks_mailchimp_send_welcome_'.$list_id] ) ? '0' : '1'; |
|
1403 | - $redirect_user_on_submit = isset( $new_options['yks_mailchimp_redirect_'.$list_id] ) ? '1' : '0'; |
|
1404 | - $redirect_page = isset( $new_options['page_id_'.$list_id] ) ? $new_options['page_id_'.$list_id] : ''; |
|
1400 | + $custom_styles = isset( $new_options[ 'custom_styles' ] ) ? $new_options[ 'custom_styles' ] : '0'; // store as an array with all of our styles |
|
1401 | + $custom_template = isset( $new_options[ 'custom_template' ] ) ? $new_options[ 'custom_template' ] : '0'; // store template data as an array ( active , template used ) |
|
1402 | + $send_welcome_email = isset( $new_options[ 'yks_mailchimp_send_welcome_' . $list_id ] ) ? '0' : '1'; |
|
1403 | + $redirect_user_on_submit = isset( $new_options[ 'yks_mailchimp_redirect_' . $list_id ] ) ? '1' : '0'; |
|
1404 | + $redirect_page = isset( $new_options[ 'page_id_' . $list_id ] ) ? $new_options[ 'page_id_' . $list_id ] : ''; |
|
1405 | 1405 | |
1406 | 1406 | /* Insert Forms Function */ |
1407 | 1407 | $this->form_interface->create_form( array( |
@@ -1423,7 +1423,7 @@ discard block |
||
1423 | 1423 | 'custom_fields' => '', |
1424 | 1424 | ) ); |
1425 | 1425 | } |
1426 | - if( $done == 'done' ) { |
|
1426 | + if ( $done == 'done' ) { |
|
1427 | 1427 | wp_send_json( array( 'form_name' => $form_name, 'completed_import' => true ) ); |
1428 | 1428 | } else { |
1429 | 1429 | wp_send_json( array( 'form_name' => $form_name, 'completed_import' => false ) ); |
@@ -1438,35 +1438,35 @@ discard block |
||
1438 | 1438 | * @since v5.6 - complete re-write |
1439 | 1439 | */ |
1440 | 1440 | public function generate_options_pages_sidebar_menu() { |
1441 | - if( isset( $_REQUEST['section'] ) ) { |
|
1442 | - $selected = $_REQUEST['section']; |
|
1441 | + if ( isset( $_REQUEST[ 'section' ] ) ) { |
|
1442 | + $selected = $_REQUEST[ 'section' ]; |
|
1443 | 1443 | } |
1444 | - $installed_addons = get_option( 'yikes-easy-mc-active-addons' , array() ); |
|
1444 | + $installed_addons = get_option( 'yikes-easy-mc-active-addons', array() ); |
|
1445 | 1445 | // sort our addons array alphabetically so they appear in similar orders across all sites |
1446 | 1446 | asort( $installed_addons ); |
1447 | 1447 | ?> |
1448 | - <h3><span><?php _e( 'Additional Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3> |
|
1448 | + <h3><span><?php _e( 'Additional Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3> |
|
1449 | 1449 | <div class="inside"> |
1450 | 1450 | <ul id="settings-nav"> |
1451 | - <li><?php if( isset( $_REQUEST['section'] ) && $_REQUEST['section'] == 'general-settings' || !isset( $_REQUEST['section'] ) ) { ?><div class="option-menu-selected-arrow"></div><?php } ?><a href="<?php echo esc_url_raw( add_query_arg( array( 'section' => 'general-settings' ) , admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings§ion=general-settings' ) ) ); ?>"><?php _e( 'General Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?></a></li> |
|
1452 | - <li><?php if( isset( $_REQUEST['section'] ) && $_REQUEST['section'] == 'integration-settings' ) { ?><div class="option-menu-selected-arrow"></div><?php } ?><a href="<?php echo esc_url_raw( add_query_arg( array( 'section' => 'integration-settings' ) , admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings§ion=integration-settings' ) ) ); ?>"><?php _e( 'Integration Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?></a></li> |
|
1453 | - <li><?php if( isset( $_REQUEST['section'] ) && $_REQUEST['section'] == 'recaptcha-settings' ) { ?><div class="option-menu-selected-arrow"></div><?php } ?><a href="<?php echo esc_url_raw( add_query_arg( array( 'section' => 'recaptcha-settings' ) , admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings§ion=recaptcha-settings' ) ) ); ?>"><?php _e( 'ReCaptcha Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?></a></li> |
|
1454 | - <li><?php if( isset( $_REQUEST['section'] ) && $_REQUEST['section'] == 'api-cache-settings' ) { ?><div class="option-menu-selected-arrow"></div><?php } ?><a href="<?php echo esc_url_raw( add_query_arg( array( 'section' => 'api-cache-settings' ) , admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings§ion=api-cache-settings' ) ) ); ?>"><?php _e( 'API Cache Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?></a></li> |
|
1455 | - <li><?php if( isset( $_REQUEST['section'] ) && $_REQUEST['section'] == 'debug-settings' ) { ?><div class="option-menu-selected-arrow"></div><?php } ?><a href="<?php echo esc_url_raw( add_query_arg( array( 'section' => 'debug-settings' ) , admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings§ion=debug-settings' ) ) ); ?>"><?php _e( 'Debug Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?></a></li> |
|
1456 | - <li><?php if( isset( $_REQUEST['section'] ) && $_REQUEST['section'] == 'import-export-forms' ) { ?><div class="option-menu-selected-arrow"></div><?php } ?><a href="<?php echo esc_url_raw( add_query_arg( array( 'section' => 'import-export-forms' ) , admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings§ion=import-export-forms' ) ) ); ?>"><?php _e( 'Import/Export' , 'yikes-inc-easy-mailchimp-extender' ); ?></a></li> |
|
1451 | + <li><?php if ( isset( $_REQUEST[ 'section' ] ) && $_REQUEST[ 'section' ] == 'general-settings' || ! isset( $_REQUEST[ 'section' ] ) ) { ?><div class="option-menu-selected-arrow"></div><?php } ?><a href="<?php echo esc_url_raw( add_query_arg( array( 'section' => 'general-settings' ), admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings§ion=general-settings' ) ) ); ?>"><?php _e( 'General Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></a></li> |
|
1452 | + <li><?php if ( isset( $_REQUEST[ 'section' ] ) && $_REQUEST[ 'section' ] == 'integration-settings' ) { ?><div class="option-menu-selected-arrow"></div><?php } ?><a href="<?php echo esc_url_raw( add_query_arg( array( 'section' => 'integration-settings' ), admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings§ion=integration-settings' ) ) ); ?>"><?php _e( 'Integration Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></a></li> |
|
1453 | + <li><?php if ( isset( $_REQUEST[ 'section' ] ) && $_REQUEST[ 'section' ] == 'recaptcha-settings' ) { ?><div class="option-menu-selected-arrow"></div><?php } ?><a href="<?php echo esc_url_raw( add_query_arg( array( 'section' => 'recaptcha-settings' ), admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings§ion=recaptcha-settings' ) ) ); ?>"><?php _e( 'ReCaptcha Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></a></li> |
|
1454 | + <li><?php if ( isset( $_REQUEST[ 'section' ] ) && $_REQUEST[ 'section' ] == 'api-cache-settings' ) { ?><div class="option-menu-selected-arrow"></div><?php } ?><a href="<?php echo esc_url_raw( add_query_arg( array( 'section' => 'api-cache-settings' ), admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings§ion=api-cache-settings' ) ) ); ?>"><?php _e( 'API Cache Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></a></li> |
|
1455 | + <li><?php if ( isset( $_REQUEST[ 'section' ] ) && $_REQUEST[ 'section' ] == 'debug-settings' ) { ?><div class="option-menu-selected-arrow"></div><?php } ?><a href="<?php echo esc_url_raw( add_query_arg( array( 'section' => 'debug-settings' ), admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings§ion=debug-settings' ) ) ); ?>"><?php _e( 'Debug Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></a></li> |
|
1456 | + <li><?php if ( isset( $_REQUEST[ 'section' ] ) && $_REQUEST[ 'section' ] == 'import-export-forms' ) { ?><div class="option-menu-selected-arrow"></div><?php } ?><a href="<?php echo esc_url_raw( add_query_arg( array( 'section' => 'import-export-forms' ), admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings§ion=import-export-forms' ) ) ); ?>"><?php _e( 'Import/Export', 'yikes-inc-easy-mailchimp-extender' ); ?></a></li> |
|
1457 | 1457 | </ul> |
1458 | 1458 | <?php |
1459 | 1459 | // create our add-on settings pages |
1460 | - if( !empty( $installed_addons ) ) { |
|
1460 | + if ( ! empty( $installed_addons ) ) { |
|
1461 | 1461 | ?> |
1462 | 1462 | <hr class="add-on-settings-divider" /> |
1463 | - <strong><?php _e( 'Addon Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
1463 | + <strong><?php _e( 'Addon Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
1464 | 1464 | <ul id="addon-settings-nav"> |
1465 | 1465 | <?php |
1466 | - foreach( $installed_addons as $addon_name ) { |
|
1466 | + foreach ( $installed_addons as $addon_name ) { |
|
1467 | 1467 | ?> |
1468 | 1468 | <li> |
1469 | - <?php if( isset( $_REQUEST['section'] ) && $_REQUEST['section'] == $addon_name ) { ?><div class="option-menu-selected-arrow"></div><?php } ?><a href="<?php echo esc_url_raw( add_query_arg( array( 'section' => $addon_name, 'addon' => 'true' ) , admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings§ion='.$addon_name ) ) ); ?>"><?php echo ucwords( str_replace( '-' , ' ' , $addon_name ) ); ?></a></li> |
|
1469 | + <?php if ( isset( $_REQUEST[ 'section' ] ) && $_REQUEST[ 'section' ] == $addon_name ) { ?><div class="option-menu-selected-arrow"></div><?php } ?><a href="<?php echo esc_url_raw( add_query_arg( array( 'section' => $addon_name, 'addon' => 'true' ), admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings§ion=' . $addon_name ) ) ); ?>"><?php echo ucwords( str_replace( '-', ' ', $addon_name ) ); ?></a></li> |
|
1470 | 1470 | <?php |
1471 | 1471 | } |
1472 | 1472 | ?> |
@@ -1494,7 +1494,7 @@ discard block |
||
1494 | 1494 | ) |
1495 | 1495 | ); |
1496 | 1496 | ?> |
1497 | - <h3><?php _e( 'Create a New Signup Form' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
1497 | + <h3><?php _e( 'Create a New Signup Form', 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
1498 | 1498 | |
1499 | 1499 | <div class="inside"> |
1500 | 1500 | |
@@ -1503,31 +1503,31 @@ discard block |
||
1503 | 1503 | <form id="import-list-to-site" method="POST" action="<?php echo $url; ?>"> |
1504 | 1504 | <input type="hidden" name="import-list-to-site" value="1" /> |
1505 | 1505 | <!-- Name your new form --> |
1506 | - <label for="form-name"><strong><?php _e( 'Form Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
1507 | - <input type="text" class="widefat input-field" placeholder="<?php _e( 'Form Name' , 'yikes-inc-easy-mailchimp-extender' ); ?>" name="form-name" id="form-name" <?php $this->is_user_mc_api_valid_form( true ); ?> required> |
|
1506 | + <label for="form-name"><strong><?php _e( 'Form Name', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
1507 | + <input type="text" class="widefat input-field" placeholder="<?php _e( 'Form Name', 'yikes-inc-easy-mailchimp-extender' ); ?>" name="form-name" id="form-name" <?php $this->is_user_mc_api_valid_form( true ); ?> required> |
|
1508 | 1508 | </label> |
1509 | 1509 | <!-- Name your new form --> |
1510 | - <label for="form-description"><strong><?php _e( 'Form Description' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
1511 | - <textarea class="widefat input-field form-description" placeholder="<?php _e( 'Form Description' , 'yikes-inc-easy-mailchimp-extender' ); ?>" name="form-description" id="form-description" <?php $this->is_user_mc_api_valid_form( true ); ?>></textarea> |
|
1510 | + <label for="form-description"><strong><?php _e( 'Form Description', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
1511 | + <textarea class="widefat input-field form-description" placeholder="<?php _e( 'Form Description', 'yikes-inc-easy-mailchimp-extender' ); ?>" name="form-description" id="form-description" <?php $this->is_user_mc_api_valid_form( true ); ?>></textarea> |
|
1512 | 1512 | </label> |
1513 | 1513 | <!-- Associate this form with a list! --> |
1514 | - <label for="associated-list"><strong><?php _e( 'Associated List' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
1514 | + <label for="associated-list"><strong><?php _e( 'Associated List', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
1515 | 1515 | <select name="associated-list" id="associated-list" class=" input-field" <?php $this->is_user_mc_api_valid_form( true ); disabled( true, empty( $lists ) ); ?>> |
1516 | 1516 | <?php |
1517 | 1517 | if ( ! empty( $lists ) ) { |
1518 | - foreach( $lists as $mailing_list ) { |
|
1518 | + foreach ( $lists as $mailing_list ) { |
|
1519 | 1519 | ?> |
1520 | - <option value="<?php echo $mailing_list['id']; ?>"><?php echo stripslashes( $mailing_list['name'] ) . ' (' . $mailing_list['stats']['member_count'] . ') '; ?></option> |
|
1520 | + <option value="<?php echo $mailing_list[ 'id' ]; ?>"><?php echo stripslashes( $mailing_list[ 'name' ] ) . ' (' . $mailing_list[ 'stats' ][ 'member_count' ] . ') '; ?></option> |
|
1521 | 1521 | <?php |
1522 | 1522 | } |
1523 | 1523 | } else { |
1524 | - if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) == 'invalid_api_key' ) { |
|
1524 | + if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) == 'invalid_api_key' ) { |
|
1525 | 1525 | ?> |
1526 | - <option><?php echo __( "Please enter a valid API key." , 'yikes-inc-easy-mailchimp-extender' ); ?></option> |
|
1526 | + <option><?php echo __( "Please enter a valid API key.", 'yikes-inc-easy-mailchimp-extender' ); ?></option> |
|
1527 | 1527 | <?php |
1528 | 1528 | } else { |
1529 | 1529 | ?> |
1530 | - <option><?php echo __( "No lists were found on the account." , 'yikes-inc-easy-mailchimp-extender' ); ?></option> |
|
1530 | + <option><?php echo __( "No lists were found on the account.", 'yikes-inc-easy-mailchimp-extender' ); ?></option> |
|
1531 | 1531 | <?php |
1532 | 1532 | |
1533 | 1533 | } |
@@ -1536,8 +1536,8 @@ discard block |
||
1536 | 1536 | </select> |
1537 | 1537 | |
1538 | 1538 | <?php |
1539 | - if ( isset( $_GET['transient-cleared'] ) ) { |
|
1540 | - if ( 'true' === $_GET['transient-cleared'] ) { |
|
1539 | + if ( isset( $_GET[ 'transient-cleared' ] ) ) { |
|
1540 | + if ( 'true' === $_GET[ 'transient-cleared' ] ) { |
|
1541 | 1541 | ?> |
1542 | 1542 | <div class="yikes-list-refreshed-notice"> |
1543 | 1543 | <p><?php esc_attr_e( 'MailChimp list data has been succesfully refreshed.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
@@ -1546,11 +1546,11 @@ discard block |
||
1546 | 1546 | } |
1547 | 1547 | } |
1548 | 1548 | |
1549 | - if( isset( $lists ) && empty( $lists ) ) { |
|
1550 | - if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) != 'invalid_api_key' ) { |
|
1549 | + if ( isset( $lists ) && empty( $lists ) ) { |
|
1550 | + if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) != 'invalid_api_key' ) { |
|
1551 | 1551 | ?> |
1552 | 1552 | <p class="description"> |
1553 | - <?php printf( __( 'Head over to <a href="http://www.MailChimp.com" title="%s">MailChimp</a> to create a new list.', 'yikes-inc-easy-mailchimp-extender' ) , __( 'Create a list' , 'yikes-inc-easy-mailchimp-extender' ) ); ?> |
|
1553 | + <?php printf( __( 'Head over to <a href="http://www.MailChimp.com" title="%s">MailChimp</a> to create a new list.', 'yikes-inc-easy-mailchimp-extender' ), __( 'Create a list', 'yikes-inc-easy-mailchimp-extender' ) ); ?> |
|
1554 | 1554 | </p> |
1555 | 1555 | <?php |
1556 | 1556 | } |
@@ -1558,12 +1558,12 @@ discard block |
||
1558 | 1558 | ?> |
1559 | 1559 | </label> |
1560 | 1560 | <?php |
1561 | - if( $this->is_user_mc_api_valid_form( false ) ) { |
|
1562 | - echo submit_button( __( 'Create', 'yikes-inc-easy-mailchimp-extender' ) , 'primary' , '' , false , array( 'style' => 'margin:.75em 0 .5em 0;' ) ); |
|
1561 | + if ( $this->is_user_mc_api_valid_form( false ) ) { |
|
1562 | + echo submit_button( __( 'Create', 'yikes-inc-easy-mailchimp-extender' ), 'primary', '', false, array( 'style' => 'margin:.75em 0 .5em 0;' ) ); |
|
1563 | 1563 | } else { |
1564 | - echo '<p class="description">' . __( "Please enter a valid MailChimp API key to get started." , 'yikes-inc-easy-mailchimp-extender' ) . '</p>'; |
|
1564 | + echo '<p class="description">' . __( "Please enter a valid MailChimp API key to get started.", 'yikes-inc-easy-mailchimp-extender' ) . '</p>'; |
|
1565 | 1565 | ?> |
1566 | - <a href="<?php echo esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&settings-updated=true' ) ); ?>"><?php _e( 'general settings' , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
1566 | + <a href="<?php echo esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&settings-updated=true' ) ); ?>"><?php _e( 'general settings', 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
1567 | 1567 | <?php |
1568 | 1568 | } |
1569 | 1569 | ?> |
@@ -1571,10 +1571,10 @@ discard block |
||
1571 | 1571 | |
1572 | 1572 | <!-- Clear API CACHE --> |
1573 | 1573 | <?php |
1574 | - if( isset( $lists ) && ! empty( $lists ) ) { |
|
1574 | + if ( isset( $lists ) && ! empty( $lists ) ) { |
|
1575 | 1575 | if ( false !== get_transient( 'yikes-easy-mailchimp-list-data' ) ) { ?> |
1576 | - <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"> |
|
1577 | - <input type="submit" class="button-secondary clear-mailchimp-api-cache" value="<?php _e( 'Refresh Lists' , 'yikes-inc-easy-mailchimp-extender' ); ?>" /> |
|
1576 | + <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"> |
|
1577 | + <input type="submit" class="button-secondary clear-mailchimp-api-cache" value="<?php _e( 'Refresh Lists', 'yikes-inc-easy-mailchimp-extender' ); ?>" /> |
|
1578 | 1578 | </form> |
1579 | 1579 | <?php } |
1580 | 1580 | } |
@@ -1590,14 +1590,14 @@ discard block |
||
1590 | 1590 | public function generate_page_redirect_dropdown( $redirect, $redirect_page, $custom_redirect_url ) { |
1591 | 1591 | $post_types = get_post_types(); |
1592 | 1592 | ?> |
1593 | - <label id="redirect-user-to-selection-label" for="redirect-user-to-selection" class="<?php if( $redirect == '0' ) { echo 'yikes-easy-mc-hidden'; } ?>"> |
|
1594 | - <?php _e( "Select A Page or Post" , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
1593 | + <label id="redirect-user-to-selection-label" for="redirect-user-to-selection" class="<?php if ( $redirect == '0' ) { echo 'yikes-easy-mc-hidden'; } ?>"> |
|
1594 | + <?php _e( "Select A Page or Post", 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
1595 | 1595 | <select id="redirect-user-to-selection" name="redirect-user-to-selection" onchange="shouldWeDisplayCustomURL( this );return;"> |
1596 | 1596 | <?php |
1597 | 1597 | // loop over registered post types, and query! |
1598 | - foreach( $post_types as $registered_post_type ) { |
|
1598 | + foreach ( $post_types as $registered_post_type ) { |
|
1599 | 1599 | // exclude a few built in custom post types |
1600 | - if( ! in_array( $registered_post_type , array( 'attachment' , 'revision' , 'nav_menu_item' ) ) ) { |
|
1600 | + if ( ! in_array( $registered_post_type, array( 'attachment', 'revision', 'nav_menu_item' ) ) ) { |
|
1601 | 1601 | // run our query, to retreive the posts |
1602 | 1602 | $pages = get_posts( array( |
1603 | 1603 | 'order' => 'ASC', |
@@ -1607,12 +1607,12 @@ discard block |
||
1607 | 1607 | 'numberposts' => -1 |
1608 | 1608 | ) ); |
1609 | 1609 | // only show cpt's that have posts assigned |
1610 | - if( !empty( $pages ) ) { |
|
1610 | + if ( ! empty( $pages ) ) { |
|
1611 | 1611 | ?> |
1612 | - <optgroup label="<?php echo ucwords( str_replace( '_' , ' ' , $registered_post_type ) ); ?>"> |
|
1612 | + <optgroup label="<?php echo ucwords( str_replace( '_', ' ', $registered_post_type ) ); ?>"> |
|
1613 | 1613 | <?php |
1614 | - foreach( $pages as $page ) { |
|
1615 | - ?><option <?php selected( $redirect_page , $page->ID ); ?> value="<?php echo $page->ID; ?>"><?php echo $page->post_title; ?></option><?php |
|
1614 | + foreach ( $pages as $page ) { |
|
1615 | + ?><option <?php selected( $redirect_page, $page->ID ); ?> value="<?php echo $page->ID; ?>"><?php echo $page->post_title; ?></option><?php |
|
1616 | 1616 | } |
1617 | 1617 | ?> |
1618 | 1618 | <option <?php selected( $redirect_page, 'custom_url' ); ?> value="custom_url"><?php echo __( 'Custom URL', 'yikes-inc-easy-mailchimp-extender' ); ?></option> |
@@ -1624,8 +1624,8 @@ discard block |
||
1624 | 1624 | ?> |
1625 | 1625 | </select> |
1626 | 1626 | |
1627 | - <label name="custom-redirect-url" class="custom_redirect_url_label" <?php if( ! isset( $redirect_page ) || $redirect_page != 'custom_url' ) { echo 'style="display:none;"'; } ?>> |
|
1628 | - <?php _e( "Enter Custom URL" , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
1627 | + <label name="custom-redirect-url" class="custom_redirect_url_label" <?php if ( ! isset( $redirect_page ) || $redirect_page != 'custom_url' ) { echo 'style="display:none;"'; } ?>> |
|
1628 | + <?php _e( "Enter Custom URL", 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
1629 | 1629 | <input type="text" class="widefat custom-redirect-url" name="custom-redirect-url" value="<?php echo $custom_redirect_url; ?>" /> |
1630 | 1630 | </label> |
1631 | 1631 | |
@@ -1642,11 +1642,11 @@ discard block |
||
1642 | 1642 | public function generate_show_some_love_container() { |
1643 | 1643 | // if no active add-ons are installed, |
1644 | 1644 | // lets display our branding and add-on sidebar |
1645 | - if( get_option( 'yikes-easy-mc-active-addons' , array() ) == array() ) { |
|
1645 | + if ( get_option( 'yikes-easy-mc-active-addons', array() ) == array() ) { |
|
1646 | 1646 | |
1647 | 1647 | /* On Edit Forms Page Display Upsell to Customizer */ |
1648 | 1648 | $screen = get_current_screen(); |
1649 | - if( isset( $screen ) && $screen->base == 'admin_page_yikes-mailchimp-edit-form' ) { |
|
1649 | + if ( isset( $screen ) && $screen->base == 'admin_page_yikes-mailchimp-edit-form' ) { |
|
1650 | 1650 | ?> |
1651 | 1651 | |
1652 | 1652 | <div class="postbox yikes-easy-mc-postbox show-some-love-container"> |
@@ -1660,11 +1660,11 @@ discard block |
||
1660 | 1660 | <div class="postbox yikes-easy-mc-postbox show-some-love-container"> |
1661 | 1661 | |
1662 | 1662 | <!-- review us container --> |
1663 | - <h3 data-alt-text="<?php _e( 'About YIKES Inc.', 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'Show YIKES Inc. Some Love' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
1663 | + <h3 data-alt-text="<?php _e( 'About YIKES Inc.', 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'Show YIKES Inc. Some Love', 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
1664 | 1664 | <div id="review-yikes-easy-mc" class="inside"> |
1665 | 1665 | |
1666 | 1666 | <p> |
1667 | - <?php _e( 'Leave a review' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
1667 | + <?php _e( 'Leave a review', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
1668 | 1668 | <p class="star-container"> |
1669 | 1669 | <a href="https://wordpress.org/support/view/plugin-reviews/yikes-inc-easy-mailchimp-extender" target="_blank"> |
1670 | 1670 | <b class="dashicons dashicons-star-filled"></b> |
@@ -1676,21 +1676,21 @@ discard block |
||
1676 | 1676 | </p> |
1677 | 1677 | </p> |
1678 | 1678 | |
1679 | - <?php _e( 'Tweet about it' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
1679 | + <?php _e( 'Tweet about it', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
1680 | 1680 | <p class="sidebar-container"> |
1681 | 1681 | <a href="https://twitter.com/share" class="twitter-share-button" data-url="https://wordpress.org/plugins/yikes-inc-easy-mailchimp-extender/" data-text="I'm using the Easy Forms for MailChimp plugin by @YikesInc to grow my mailing list - it's awesome! -" data-hashtags="MailChimp">Tweet</a> |
1682 | 1682 | <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script> |
1683 | 1683 | </p> |
1684 | 1684 | |
1685 | - <?php _e( 'Vote that the plugin works' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
1685 | + <?php _e( 'Vote that the plugin works', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
1686 | 1686 | <p class="sidebar-container"> |
1687 | 1687 | <a href="https://wordpress.org/plugins/yikes-inc-easy-mailchimp-extender/" target="_blank"> |
1688 | - <?php _e( 'Vote for Compatibility' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
1688 | + <?php _e( 'Vote for Compatibility', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
1689 | 1689 | </a> |
1690 | 1690 | </p> |
1691 | 1691 | </div> |
1692 | 1692 | |
1693 | - <p class="description sidebar-footer-text"><?php printf( __( "This plugin made with %s by %s" , 'yikes-inc-easy-mailchimp-extender' ), '<span class="dashicons dashicons-heart yikes-love"></span>', '<a href="http://www.yikesinc.com" target="_blank" title="YIKES Inc.">YIKES Inc.</a>' ); ?> </p> |
|
1693 | + <p class="description sidebar-footer-text"><?php printf( __( "This plugin made with %s by %s", 'yikes-inc-easy-mailchimp-extender' ), '<span class="dashicons dashicons-heart yikes-love"></span>', '<a href="http://www.yikesinc.com" target="_blank" title="YIKES Inc.">YIKES Inc.</a>' ); ?> </p> |
|
1694 | 1694 | |
1695 | 1695 | <section id="about-yikes-inc" class="inside"> |
1696 | 1696 | <a href="https://www.yikesinc.com" target="_blank" title="YIKES Inc."> |
@@ -1706,10 +1706,10 @@ discard block |
||
1706 | 1706 | <div class="postbox yikes-easy-mc-postbox"> |
1707 | 1707 | |
1708 | 1708 | <!-- review us container --> |
1709 | - <h3><?php _e( 'Easy Forms for MailChimp Add-Ons' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
1709 | + <h3><?php _e( 'Easy Forms for MailChimp Add-Ons', 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
1710 | 1710 | <div id="review-yikes-easy-mc" class="inside"> |
1711 | - <p><?php _e( "Check out available add-ons for some seriously enhanced features." , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
1712 | - <p><a class="button-secondary" href="<?php echo esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-addons' ) ); ?>" title="<?php _e( 'View Add-Ons' , 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'View Add-Ons' , 'yikes-inc-easy-mailchimp-extender' ); ?></a></p> |
|
1711 | + <p><?php _e( "Check out available add-ons for some seriously enhanced features.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
1712 | + <p><a class="button-secondary" href="<?php echo esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-addons' ) ); ?>" title="<?php _e( 'View Add-Ons', 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'View Add-Ons', 'yikes-inc-easy-mailchimp-extender' ); ?></a></p> |
|
1713 | 1713 | </div> |
1714 | 1714 | |
1715 | 1715 | </div> |
@@ -1734,15 +1734,15 @@ discard block |
||
1734 | 1734 | public function generate_form_editor( $form_fields, $list_id, $merge_variables, $interest_groups ) { |
1735 | 1735 | |
1736 | 1736 | // if no list id, die! |
1737 | - if( ! $list_id ) { |
|
1738 | - wp_die( __( "We've encountered an error. No list ID was sent." , 'yikes-inc-easy-mailchimp-extender' ) ); |
|
1737 | + if ( ! $list_id ) { |
|
1738 | + wp_die( __( "We've encountered an error. No list ID was sent.", 'yikes-inc-easy-mailchimp-extender' ) ); |
|
1739 | 1739 | } |
1740 | 1740 | |
1741 | - if( ! $merge_variables ) { |
|
1742 | - wp_die( __( "We've encountered an error. Reload the page and try again. If the error persists, please reach out to support." , 'yikes-inc-easy-mailchimp-extender' ) ); |
|
1741 | + if ( ! $merge_variables ) { |
|
1742 | + wp_die( __( "We've encountered an error. Reload the page and try again. If the error persists, please reach out to support.", 'yikes-inc-easy-mailchimp-extender' ) ); |
|
1743 | 1743 | } |
1744 | 1744 | |
1745 | - if( ! empty( $form_fields ) ) { |
|
1745 | + if ( ! empty( $form_fields ) ) { |
|
1746 | 1746 | |
1747 | 1747 | // find any fields that are assigned to this form, that don't exist in MailChimp |
1748 | 1748 | // or else were going to run into issues when we submit the form |
@@ -1750,8 +1750,8 @@ discard block |
||
1750 | 1750 | $available_interest_groups = array(); |
1751 | 1751 | |
1752 | 1752 | // loop over merge variables |
1753 | - if ( ! empty( $merge_variables['merge_fields'] ) ) { |
|
1754 | - $available_merge_variables = wp_list_pluck( $merge_variables['merge_fields'], 'tag' ); |
|
1753 | + if ( ! empty( $merge_variables[ 'merge_fields' ] ) ) { |
|
1754 | + $available_merge_variables = wp_list_pluck( $merge_variables[ 'merge_fields' ], 'tag' ); |
|
1755 | 1755 | } |
1756 | 1756 | |
1757 | 1757 | // loop over interest groups |
@@ -1765,38 +1765,38 @@ discard block |
||
1765 | 1765 | $excluded_fields = array_diff( $assigned_fields, $merged_fields ); |
1766 | 1766 | |
1767 | 1767 | $i = 1; |
1768 | - foreach( $form_fields as $field ) { |
|
1768 | + foreach ( $form_fields as $field ) { |
|
1769 | 1769 | |
1770 | - if ( isset( $field['merge'] ) ) { |
|
1770 | + if ( isset( $field[ 'merge' ] ) ) { |
|
1771 | 1771 | // @todo: don't use in_array() |
1772 | - $excluded_field = in_array( $field['merge'], $excluded_fields, true ); |
|
1772 | + $excluded_field = in_array( $field[ 'merge' ], $excluded_fields, true ); |
|
1773 | 1773 | ?> |
1774 | - <section class="draggable" id="<?php echo $field['merge']; ?>"> |
|
1774 | + <section class="draggable" id="<?php echo $field[ 'merge' ]; ?>"> |
|
1775 | 1775 | <!-- top --> |
1776 | 1776 | <a href="#" class="expansion-section-title settings-sidebar"> |
1777 | - <span class="dashicons dashicons-plus"></span><?php echo stripslashes( $field['label'] ); ?> |
|
1777 | + <span class="dashicons dashicons-plus"></span><?php echo stripslashes( $field[ 'label' ] ); ?> |
|
1778 | 1778 | <?php if ( $excluded_field ) { ?> |
1779 | - <img src="<?php echo YIKES_MC_URL . 'includes/images/warning.svg'; ?>" class="field-doesnt-exist-notice" title="<?php _e( 'Field no longer exists.' , 'yikes-inc-easy-mailchimp-extender' ); ?>" alt="<?php _e( 'Field no longer exists.' , 'yikes-inc-easy-mailchimp-extender' ); ?>"> |
|
1779 | + <img src="<?php echo YIKES_MC_URL . 'includes/images/warning.svg'; ?>" class="field-doesnt-exist-notice" title="<?php _e( 'Field no longer exists.', 'yikes-inc-easy-mailchimp-extender' ); ?>" alt="<?php _e( 'Field no longer exists.', 'yikes-inc-easy-mailchimp-extender' ); ?>"> |
|
1780 | 1780 | <?php } ?> |
1781 | - <span class="field-type-text"><small><?php echo __( 'type' , 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $field['type']; ?></small></span> |
|
1781 | + <span class="field-type-text"><small><?php echo __( 'type', 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $field[ 'type' ]; ?></small></span> |
|
1782 | 1782 | </a> |
1783 | 1783 | <!-- expansion section --> |
1784 | 1784 | <div class="yikes-mc-settings-expansion-section"> |
1785 | 1785 | |
1786 | 1786 | <?php if ( $excluded_field ) { ?> |
1787 | - <p class="yikes-mc-warning-message"><?php _e( "This field no longer exists in this list. Delete this field from the form to prevent issues on your website." , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
1787 | + <p class="yikes-mc-warning-message"><?php _e( "This field no longer exists in this list. Delete this field from the form to prevent issues on your website.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
1788 | 1788 | <?php } ?> |
1789 | 1789 | |
1790 | 1790 | <!-- store the label --> |
1791 | - <input type="hidden" name="field[<?php echo $field['merge']; ?>][label]" value="<?php echo $field['label']; ?>" /> |
|
1792 | - <input type="hidden" name="field[<?php echo $field['merge']; ?>][type]" value="<?php echo $field['type']; ?>" /> |
|
1793 | - <input type="hidden" name="field[<?php echo $field['merge']; ?>][merge]" value="<?php echo $field['merge']; ?>" /> |
|
1794 | - <input type="hidden" class="field-<?php echo $field['merge']; ?>-position position-input" name="field[<?php echo $field['merge']; ?>][position]" value="<?php echo $i++; ?>" /> |
|
1791 | + <input type="hidden" name="field[<?php echo $field[ 'merge' ]; ?>][label]" value="<?php echo $field[ 'label' ]; ?>" /> |
|
1792 | + <input type="hidden" name="field[<?php echo $field[ 'merge' ]; ?>][type]" value="<?php echo $field[ 'type' ]; ?>" /> |
|
1793 | + <input type="hidden" name="field[<?php echo $field[ 'merge' ]; ?>][merge]" value="<?php echo $field[ 'merge' ]; ?>" /> |
|
1794 | + <input type="hidden" class="field-<?php echo $field[ 'merge' ]; ?>-position position-input" name="field[<?php echo $field[ 'merge' ]; ?>][position]" value="<?php echo $i++; ?>" /> |
|
1795 | 1795 | |
1796 | - <?php if ( $field['type'] == 'radio' || $field['type'] == 'dropdown' || $field['type'] == 'select' ) { |
|
1797 | - $choices = json_decode( $field['choices'], true ); |
|
1796 | + <?php if ( $field[ 'type' ] == 'radio' || $field[ 'type' ] == 'dropdown' || $field[ 'type' ] == 'select' ) { |
|
1797 | + $choices = json_decode( $field[ 'choices' ], true ); |
|
1798 | 1798 | ?> |
1799 | - <input type="hidden" name="field[<?php echo $field['merge']; ?>][choices]" value='<?php echo esc_attr( json_encode( $choices ) ); ?>' /> |
|
1799 | + <input type="hidden" name="field[<?php echo $field[ 'merge' ]; ?>][choices]" value='<?php echo esc_attr( json_encode( $choices ) ); ?>' /> |
|
1800 | 1800 | <?php } ?> |
1801 | 1801 | |
1802 | 1802 | <!-- Single or Double Opt-in --> |
@@ -1808,16 +1808,16 @@ discard block |
||
1808 | 1808 | <tr valign="top"> |
1809 | 1809 | <td scope="row"> |
1810 | 1810 | <label for="merge-tag"> |
1811 | - <?php _e( 'Merge Tag' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
1811 | + <?php _e( 'Merge Tag', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
1812 | 1812 | </label> |
1813 | 1813 | </td> |
1814 | 1814 | <td> |
1815 | - <input class="widefat merge-tag-text" type="text" readonly value="<?php echo $field['merge']; ?>"> |
|
1815 | + <input class="widefat merge-tag-text" type="text" readonly value="<?php echo $field[ 'merge' ]; ?>"> |
|
1816 | 1816 | </td> |
1817 | 1817 | </tr> |
1818 | 1818 | |
1819 | 1819 | <!-- Placeholder Value --> |
1820 | - <?php switch( $field['type'] ) { |
|
1820 | + <?php switch ( $field[ 'type' ] ) { |
|
1821 | 1821 | |
1822 | 1822 | case 'text': |
1823 | 1823 | case 'email': |
@@ -1832,12 +1832,12 @@ discard block |
||
1832 | 1832 | <tr valign="top"> |
1833 | 1833 | <td scope="row"> |
1834 | 1834 | <label for="placeholder"> |
1835 | - <?php _e( 'Placeholder' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
1835 | + <?php _e( 'Placeholder', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
1836 | 1836 | </label> |
1837 | 1837 | </td> |
1838 | 1838 | <td> |
1839 | - <input type="text" class="widefat" name="field[<?php echo $field['merge']; ?>][placeholder]" value="<?php echo isset( $field['placeholder'] ) ? $field['placeholder'] : '' ; ?>" /> |
|
1840 | - <p class="description"><small><?php _e( "Assign a placeholder value to this field.", 'yikes-inc-easy-mailchimp-extender' );?></small></p> |
|
1839 | + <input type="text" class="widefat" name="field[<?php echo $field[ 'merge' ]; ?>][placeholder]" value="<?php echo isset( $field[ 'placeholder' ] ) ? $field[ 'placeholder' ] : ''; ?>" /> |
|
1840 | + <p class="description"><small><?php _e( "Assign a placeholder value to this field.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p> |
|
1841 | 1841 | </td> |
1842 | 1842 | </tr> |
1843 | 1843 | <?php |
@@ -1846,7 +1846,7 @@ discard block |
||
1846 | 1846 | ?> |
1847 | 1847 | |
1848 | 1848 | <!-- Default Value --> |
1849 | - <?php switch( $field['type'] ) { |
|
1849 | + <?php switch ( $field[ 'type' ] ) { |
|
1850 | 1850 | default: |
1851 | 1851 | case 'text': |
1852 | 1852 | case 'number': |
@@ -1855,17 +1855,17 @@ discard block |
||
1855 | 1855 | <tr valign="top"> |
1856 | 1856 | <td scope="row"> |
1857 | 1857 | <label for="placeholder"> |
1858 | - <?php _e( 'Default Value' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
1858 | + <?php _e( 'Default Value', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
1859 | 1859 | </label> |
1860 | 1860 | </td> |
1861 | 1861 | <td> |
1862 | - <input <?php if( $field['type'] != 'number' ) { ?> type="text" <?php } else { ?> type="number" <?php } ?> class="widefat" name="field[<?php echo $field['merge']; ?>][default]" <?php if( $field['type'] != 'url' ) { ?> value="<?php echo isset( $field['default'] ) ? stripslashes( wp_strip_all_tags( $field['default'] ) ) : ''; ?>" <?php } else { ?> value="<?php echo isset( $field['default'] ) ? stripslashes( wp_strip_all_tags( esc_url_raw( $field['default'] ) ) ) : ''; ?>" <?php } ?> /> |
|
1863 | - <p class="description"><small><?php _e( "Assign a default value to populate this field with on initial page load.", 'yikes-inc-easy-mailchimp-extender' );?></small></p> |
|
1862 | + <input <?php if ( $field[ 'type' ] != 'number' ) { ?> type="text" <?php } else { ?> type="number" <?php } ?> class="widefat" name="field[<?php echo $field[ 'merge' ]; ?>][default]" <?php if ( $field[ 'type' ] != 'url' ) { ?> value="<?php echo isset( $field[ 'default' ] ) ? stripslashes( wp_strip_all_tags( $field[ 'default' ] ) ) : ''; ?>" <?php } else { ?> value="<?php echo isset( $field[ 'default' ] ) ? stripslashes( wp_strip_all_tags( esc_url_raw( $field[ 'default' ] ) ) ) : ''; ?>" <?php } ?> /> |
|
1863 | + <p class="description"><small><?php _e( "Assign a default value to populate this field with on initial page load.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p> |
|
1864 | 1864 | <?php |
1865 | - switch( $field['type'] ) { |
|
1865 | + switch ( $field[ 'type' ] ) { |
|
1866 | 1866 | case 'text': |
1867 | 1867 | ?> |
1868 | - <p><small class="pre-defined-tag-link"><a href="#TB_inline?width=600&height=550&inlineId=pre-defined-tag-container" onclick="storeGlobalClicked( jQuery( this ) );" class="thickbox"><?php _e( 'View Pre-Defined Tags' , 'yikes-inc-easy-mailchimp-extender' ); ?></a></small></p> |
|
1868 | + <p><small class="pre-defined-tag-link"><a href="#TB_inline?width=600&height=550&inlineId=pre-defined-tag-container" onclick="storeGlobalClicked( jQuery( this ) );" class="thickbox"><?php _e( 'View Pre-Defined Tags', 'yikes-inc-easy-mailchimp-extender' ); ?></a></small></p> |
|
1869 | 1869 | <?php |
1870 | 1870 | break; |
1871 | 1871 | } ?> |
@@ -1879,25 +1879,25 @@ discard block |
||
1879 | 1879 | <tr valign="top"> |
1880 | 1880 | <td scope="row"> |
1881 | 1881 | <label for="placeholder"> |
1882 | - <?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
1882 | + <?php _e( 'Default Selection', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
1883 | 1883 | </label> |
1884 | 1884 | </td> |
1885 | 1885 | <td> |
1886 | 1886 | <?php |
1887 | - if ( ! isset( $field['default_choice'] ) ) { |
|
1888 | - $field['default_choice'] = 0; |
|
1887 | + if ( ! isset( $field[ 'default_choice' ] ) ) { |
|
1888 | + $field[ 'default_choice' ] = 0; |
|
1889 | 1889 | } |
1890 | 1890 | $x = 0; |
1891 | 1891 | foreach ( $choices as $choice => $value ) { ?> |
1892 | - <label for="<?php echo $field['merge'].'-'.$x; ?>"> |
|
1893 | - <input id="<?php echo $field['merge'].'-'.$x; ?>" |
|
1892 | + <label for="<?php echo $field[ 'merge' ] . '-' . $x; ?>"> |
|
1893 | + <input id="<?php echo $field[ 'merge' ] . '-' . $x; ?>" |
|
1894 | 1894 | type="radio" |
1895 | - name="field[<?php echo $field['merge']; ?>][default_choice]" |
|
1896 | - value="<?php echo $x; ?>" <?php checked( $field['default_choice'], $x ); ?>> |
|
1895 | + name="field[<?php echo $field[ 'merge' ]; ?>][default_choice]" |
|
1896 | + value="<?php echo $x; ?>" <?php checked( $field[ 'default_choice' ], $x ); ?>> |
|
1897 | 1897 | <?php echo $value; ?> |
1898 | 1898 | </label> |
1899 | 1899 | <?php $x++; } ?> |
1900 | - <p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' );?></small></p> |
|
1900 | + <p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p> |
|
1901 | 1901 | </td> |
1902 | 1902 | </tr> |
1903 | 1903 | |
@@ -1909,16 +1909,16 @@ discard block |
||
1909 | 1909 | <tr valign="top"> |
1910 | 1910 | <td scope="row"> |
1911 | 1911 | <label for="placeholder"> |
1912 | - <?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
1912 | + <?php _e( 'Default Selection', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
1913 | 1913 | </label> |
1914 | 1914 | </td> |
1915 | 1915 | <td> |
1916 | - <select type="default" name="field[<?php echo $field['merge']; ?>][default_choice]"> |
|
1917 | - <?php foreach( json_decode( $field['choices'], true ) as $choice => $value ) { ?> |
|
1918 | - <option value="<?php echo $choice; ?>" <?php selected( $field['default_choice'] , $choice ); ?>><?php echo $value; ?></option> |
|
1916 | + <select type="default" name="field[<?php echo $field[ 'merge' ]; ?>][default_choice]"> |
|
1917 | + <?php foreach ( json_decode( $field[ 'choices' ], true ) as $choice => $value ) { ?> |
|
1918 | + <option value="<?php echo $choice; ?>" <?php selected( $field[ 'default_choice' ], $choice ); ?>><?php echo $value; ?></option> |
|
1919 | 1919 | <?php } ?> |
1920 | 1920 | </select> |
1921 | - <p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' );?></small></p> |
|
1921 | + <p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p> |
|
1922 | 1922 | </td> |
1923 | 1923 | </tr> |
1924 | 1924 | |
@@ -1938,69 +1938,69 @@ discard block |
||
1938 | 1938 | <tr valign="top"> |
1939 | 1939 | <td scope="row"> |
1940 | 1940 | <label for="placeholder"> |
1941 | - <?php _e( 'Description' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
1941 | + <?php _e( 'Description', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
1942 | 1942 | </label> |
1943 | 1943 | </td> |
1944 | 1944 | <td> |
1945 | - <textarea class="widefat field-description-input" name="field[<?php echo $field['merge']; ?>][description]"><?php echo isset( $field['description'] ) ? stripslashes( esc_html( $field['description'] ) ) : '' ; ?></textarea> |
|
1946 | - <p class="description"><small><?php _e( "Enter the description for the form field. This will be displayed to the user and will provide some direction on how the field should be filled out or selected.", 'yikes-inc-easy-mailchimp-extender' );?></small></p> |
|
1945 | + <textarea class="widefat field-description-input" name="field[<?php echo $field[ 'merge' ]; ?>][description]"><?php echo isset( $field[ 'description' ] ) ? stripslashes( esc_html( $field[ 'description' ] ) ) : ''; ?></textarea> |
|
1946 | + <p class="description"><small><?php _e( "Enter the description for the form field. This will be displayed to the user and will provide some direction on how the field should be filled out or selected.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p> |
|
1947 | 1947 | </td> |
1948 | 1948 | </tr> |
1949 | 1949 | <!-- Additional Classes --> |
1950 | 1950 | <tr valign="top"> |
1951 | 1951 | <td scope="row"> |
1952 | 1952 | <label for="placeholder"> |
1953 | - <?php _e( 'Additional Classes' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
1953 | + <?php _e( 'Additional Classes', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
1954 | 1954 | </label> |
1955 | 1955 | </td> |
1956 | 1956 | <td> |
1957 | - <input type="text" class="widefat" name="field[<?php echo $field['merge']; ?>][additional-classes]" value="<?php echo isset( $field['additional-classes'] ) ? stripslashes( wp_strip_all_tags( $field['additional-classes'] ) ) : '' ; ?>" /> |
|
1958 | - <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> |
|
1957 | + <input type="text" class="widefat" name="field[<?php echo $field[ 'merge' ]; ?>][additional-classes]" value="<?php echo isset( $field[ 'additional-classes' ] ) ? stripslashes( wp_strip_all_tags( $field[ 'additional-classes' ] ) ) : ''; ?>" /> |
|
1958 | + <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> |
|
1959 | 1959 | </td> |
1960 | 1960 | </tr> |
1961 | 1961 | <!-- Required Toggle --> |
1962 | 1962 | <tr valign="top"> |
1963 | 1963 | <td scope="row"> |
1964 | 1964 | <label for="field-required"> |
1965 | - <?php _e( 'Field Required?' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
1965 | + <?php _e( 'Field Required?', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
1966 | 1966 | </label> |
1967 | 1967 | </td> |
1968 | 1968 | <td> |
1969 | - <?php $checked = isset( $field['require'] ) ? $field['require'] : '0'; ?> |
|
1970 | - <input type="checkbox" class="widefat" value="1" name="field[<?php echo $field['merge']; ?>][require]" <?php checked( $checked , 1 ); ?> <?php if( $field['merge'] == 'EMAIL' ) { ?> disabled="disabled" checked="checked" title="<?php echo __( 'Email is a required field.' , 'yikes-inc-easy-mailchimp-extender' ); } ?>"> |
|
1971 | - <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> |
|
1969 | + <?php $checked = isset( $field[ 'require' ] ) ? $field[ 'require' ] : '0'; ?> |
|
1970 | + <input type="checkbox" class="widefat" value="1" name="field[<?php echo $field[ 'merge' ]; ?>][require]" <?php checked( $checked, 1 ); ?> <?php if ( $field[ 'merge' ] == 'EMAIL' ) { ?> disabled="disabled" checked="checked" title="<?php echo __( 'Email is a required field.', 'yikes-inc-easy-mailchimp-extender' ); } ?>"> |
|
1971 | + <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> |
|
1972 | 1972 | </td> |
1973 | 1973 | </tr> |
1974 | 1974 | <!-- Visible Toggle --> |
1975 | 1975 | <tr valign="top"> |
1976 | 1976 | <td scope="row"> |
1977 | 1977 | <label for="hide-field"> |
1978 | - <?php _e( 'Hide Field' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
1978 | + <?php _e( 'Hide Field', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
1979 | 1979 | </label> |
1980 | 1980 | </td> |
1981 | 1981 | <td> |
1982 | - <?php $hide = isset( $field['hide'] ) ? $field['hide'] : '0'; ?> |
|
1983 | - <input type="checkbox" class="widefat" value="1" name="field[<?php echo $field['merge']; ?>][hide]" <?php checked( $hide , 1 ); ?> <?php if( $field['merge'] == 'EMAIL' ) { ?> disabled="disabled" title="<?php echo __( 'Cannot toggle email field visibility.' , 'yikes-inc-easy-mailchimp-extender' ); } ?>"> |
|
1984 | - <p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' );?></small></p> |
|
1982 | + <?php $hide = isset( $field[ 'hide' ] ) ? $field[ 'hide' ] : '0'; ?> |
|
1983 | + <input type="checkbox" class="widefat" value="1" name="field[<?php echo $field[ 'merge' ]; ?>][hide]" <?php checked( $hide, 1 ); ?> <?php if ( $field[ 'merge' ] == 'EMAIL' ) { ?> disabled="disabled" title="<?php echo __( 'Cannot toggle email field visibility.', 'yikes-inc-easy-mailchimp-extender' ); } ?>"> |
|
1984 | + <p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p> |
|
1985 | 1985 | </td> |
1986 | 1986 | </tr> |
1987 | 1987 | <!-- Toggle Field Label Visibility --> |
1988 | 1988 | <tr valign="top"> |
1989 | 1989 | <td scope="row"> |
1990 | 1990 | <label for="placeholder"> |
1991 | - <?php _e( 'Hide Label' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
1991 | + <?php _e( 'Hide Label', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
1992 | 1992 | </label> |
1993 | 1993 | </td> |
1994 | 1994 | <td> |
1995 | - <?php $hide_label = isset( $field['hide-label'] ) ? $field['hide-label'] : '0'; ?> |
|
1996 | - <input type="checkbox" name="field[<?php echo $field['merge']; ?>][hide-label]" value="1" <?php checked( $hide_label , 1 ); ?>/> |
|
1997 | - <p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' );?></small></p> |
|
1995 | + <?php $hide_label = isset( $field[ 'hide-label' ] ) ? $field[ 'hide-label' ] : '0'; ?> |
|
1996 | + <input type="checkbox" name="field[<?php echo $field[ 'merge' ]; ?>][hide-label]" value="1" <?php checked( $hide_label, 1 ); ?>/> |
|
1997 | + <p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p> |
|
1998 | 1998 | </td> |
1999 | 1999 | </tr> |
2000 | 2000 | <!-- Display Phone/Date Formats back to the user --> |
2001 | 2001 | <!-- Phone Format Initial Load --> |
2002 | 2002 | <?php |
2003 | - switch( $field['type'] ) { |
|
2003 | + switch ( $field[ 'type' ] ) { |
|
2004 | 2004 | /* Store the phone format, for properly regex pattern */ |
2005 | 2005 | case 'phone': |
2006 | 2006 | case 'birthday': |
@@ -2010,23 +2010,23 @@ discard block |
||
2010 | 2010 | <td scope="row"> |
2011 | 2011 | <label for="placeholder"> |
2012 | 2012 | <?php |
2013 | - switch( $field['type'] ) { |
|
2013 | + switch ( $field[ 'type' ] ) { |
|
2014 | 2014 | default: |
2015 | 2015 | case 'birthday': |
2016 | - $type = __( 'Date Format' , 'yikes-inc-easy-mailchimp-extender' ); |
|
2017 | - $format = ( isset( $field['date_format'] ) ) ? $field['date_format'] : 'MM/DD'; |
|
2016 | + $type = __( 'Date Format', 'yikes-inc-easy-mailchimp-extender' ); |
|
2017 | + $format = ( isset( $field[ 'date_format' ] ) ) ? $field[ 'date_format' ] : 'MM/DD'; |
|
2018 | 2018 | $format_name = 'date_format'; |
2019 | 2019 | break; |
2020 | 2020 | |
2021 | 2021 | case 'date': |
2022 | - $type = __( 'Date Format' , 'yikes-inc-easy-mailchimp-extender' ); |
|
2023 | - $format = ( isset( $field['date_format'] ) ) ? $field['date_format'] : 'MM/DD/YYYY'; |
|
2022 | + $type = __( 'Date Format', 'yikes-inc-easy-mailchimp-extender' ); |
|
2023 | + $format = ( isset( $field[ 'date_format' ] ) ) ? $field[ 'date_format' ] : 'MM/DD/YYYY'; |
|
2024 | 2024 | $format_name = 'date_format'; |
2025 | 2025 | break; |
2026 | 2026 | |
2027 | 2027 | case 'phone': |
2028 | - $type = __( 'Phone Format' , 'yikes-inc-easy-mailchimp-extender' ); |
|
2029 | - $format = isset( $field['phone_format'] ) && ! empty( $field['phone_format'] ) ? $field['phone_format'] : __( 'International', 'yikes-inc-easy-mailchimp-extender' ); |
|
2028 | + $type = __( 'Phone Format', 'yikes-inc-easy-mailchimp-extender' ); |
|
2029 | + $format = isset( $field[ 'phone_format' ] ) && ! empty( $field[ 'phone_format' ] ) ? $field[ 'phone_format' ] : __( 'International', 'yikes-inc-easy-mailchimp-extender' ); |
|
2030 | 2030 | $format_name = 'phone_format'; |
2031 | 2031 | break; |
2032 | 2032 | } |
@@ -2036,7 +2036,7 @@ discard block |
||
2036 | 2036 | </td> |
2037 | 2037 | <td> |
2038 | 2038 | <strong><?php echo $format; ?></strong> |
2039 | - <input type="hidden" name="field[<?php echo $field['merge']; ?>][<?php echo $format_name; ?>]" value="<?php echo $format; ?>" /> |
|
2039 | + <input type="hidden" name="field[<?php echo $field[ 'merge' ]; ?>][<?php echo $format_name; ?>]" value="<?php echo $format; ?>" /> |
|
2040 | 2040 | <p class="description"><small> |
2041 | 2041 | <?php printf( __( 'To change the %s please head over to <a href="%s" title="MailChimp" target="_blank">MailChimp</a>. If you alter the format, you should re-import this field.', 'yikes-inc-easy-mailchimp-extender' ), strtolower( $type ), esc_url( 'http://www.mailchimp.com' ) ); ?> |
2042 | 2042 | </small></p> |
@@ -2057,8 +2057,8 @@ discard block |
||
2057 | 2057 | </td> |
2058 | 2058 | <td> |
2059 | 2059 | <span class="toggle-container"> |
2060 | - <a href="#" class="close-form-expansion"><?php _e( "Close" , 'yikes-inc-easy-mailchimp-extender' ); ?></a> | |
|
2061 | - <a href="#" class="remove-field" alt="<?php echo $field['merge']; ?>"><?php _e( "Remove Field" , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
2060 | + <a href="#" class="close-form-expansion"><?php _e( "Close", 'yikes-inc-easy-mailchimp-extender' ); ?></a> | |
|
2061 | + <a href="#" class="remove-field" alt="<?php echo $field[ 'merge' ]; ?>"><?php _e( "Remove Field", 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
2062 | 2062 | </span> |
2063 | 2063 | </td> |
2064 | 2064 | </tr> |
@@ -2074,35 +2074,35 @@ discard block |
||
2074 | 2074 | } else { // THIS IS AN INTEREST GROUP! |
2075 | 2075 | |
2076 | 2076 | ?> |
2077 | - <section class="draggable" id="<?php echo $field['group_id']; ?>"> |
|
2077 | + <section class="draggable" id="<?php echo $field[ 'group_id' ]; ?>"> |
|
2078 | 2078 | <!-- top --> |
2079 | 2079 | <a href="#" class="expansion-section-title settings-sidebar"> |
2080 | - <span class="dashicons dashicons-plus"></span><?php echo stripslashes( $field['label'] ); ?> |
|
2081 | - <?php if( in_array( $field['group_id'] , $excluded_fields ) ) { ?> |
|
2082 | - <img src="<?php echo YIKES_MC_URL . 'includes/images/warning.svg'; ?>" class="field-no-longer-exists-warning" title="<?php _e( 'Field no longer exists.' , 'yikes-inc-easy-mailchimp-extender' ); ?>" alt="<?php _e( 'Field no longer exists.' , 'yikes-inc-easy-mailchimp-extender' ); ?>"> |
|
2080 | + <span class="dashicons dashicons-plus"></span><?php echo stripslashes( $field[ 'label' ] ); ?> |
|
2081 | + <?php if ( in_array( $field[ 'group_id' ], $excluded_fields ) ) { ?> |
|
2082 | + <img src="<?php echo YIKES_MC_URL . 'includes/images/warning.svg'; ?>" class="field-no-longer-exists-warning" title="<?php _e( 'Field no longer exists.', 'yikes-inc-easy-mailchimp-extender' ); ?>" alt="<?php _e( 'Field no longer exists.', 'yikes-inc-easy-mailchimp-extender' ); ?>"> |
|
2083 | 2083 | <?php } ?> |
2084 | - <span class="field-type-text"><small><?php echo __( 'type' , 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $field['type']; ?></small></span> |
|
2084 | + <span class="field-type-text"><small><?php echo __( 'type', 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $field[ 'type' ]; ?></small></span> |
|
2085 | 2085 | </a> |
2086 | 2086 | <!-- expansion section --> |
2087 | 2087 | <div class="yikes-mc-settings-expansion-section"> |
2088 | 2088 | |
2089 | 2089 | <!-- check if this field exists in the available interest group array --> |
2090 | - <?php if( in_array( $field['group_id'] , $excluded_fields ) ) { ?> |
|
2091 | - <p class="yikes-mc-warning-message"><?php _e( "This field no longer exists in this list. Delete this field from the form to prevent issues on the front end." , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
2090 | + <?php if ( in_array( $field[ 'group_id' ], $excluded_fields ) ) { ?> |
|
2091 | + <p class="yikes-mc-warning-message"><?php _e( "This field no longer exists in this list. Delete this field from the form to prevent issues on the front end.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
2092 | 2092 | <?php } ?> |
2093 | 2093 | |
2094 | 2094 | <!-- store the label --> |
2095 | - <input type="hidden" name="field[<?php echo $field['group_id']; ?>][label]" value="<?php echo $field['label']; ?>" /> |
|
2096 | - <input type="hidden" name="field[<?php echo $field['group_id']; ?>][type]" value="<?php echo $field['type']; ?>" /> |
|
2097 | - <input type="hidden" name="field[<?php echo $field['group_id']; ?>][group_id]" value="<?php echo $field['group_id']; ?>" /> |
|
2098 | - <input type="hidden" name="field[<?php echo $field['group_id']; ?>][groups]" value='<?php echo esc_attr( json_encode( json_decode( $field['groups'], true ) ) ); ?>' /> |
|
2095 | + <input type="hidden" name="field[<?php echo $field[ 'group_id' ]; ?>][label]" value="<?php echo $field[ 'label' ]; ?>" /> |
|
2096 | + <input type="hidden" name="field[<?php echo $field[ 'group_id' ]; ?>][type]" value="<?php echo $field[ 'type' ]; ?>" /> |
|
2097 | + <input type="hidden" name="field[<?php echo $field[ 'group_id' ]; ?>][group_id]" value="<?php echo $field[ 'group_id' ]; ?>" /> |
|
2098 | + <input type="hidden" name="field[<?php echo $field[ 'group_id' ]; ?>][groups]" value='<?php echo esc_attr( json_encode( json_decode( $field[ 'groups' ], true ) ) ); ?>' /> |
|
2099 | 2099 | |
2100 | 2100 | <!-- Single or Double Opt-in --> |
2101 | 2101 | <p class="type-container"><!-- necessary to prevent skipping on slideToggle(); --> |
2102 | 2102 | |
2103 | 2103 | <table class="form-table form-field-container"> |
2104 | 2104 | <!-- Default Value --> |
2105 | - <?php switch( $field['type'] ) { |
|
2105 | + <?php switch ( $field[ 'type' ] ) { |
|
2106 | 2106 | |
2107 | 2107 | default: |
2108 | 2108 | case 'radio': |
@@ -2111,22 +2111,22 @@ discard block |
||
2111 | 2111 | <tr valign="top"> |
2112 | 2112 | <td scope="row"> |
2113 | 2113 | <label for="placeholder"> |
2114 | - <?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
2114 | + <?php _e( 'Default Selection', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
2115 | 2115 | </label> |
2116 | 2116 | </td> |
2117 | 2117 | <td> |
2118 | 2118 | <?php |
2119 | - if( $field['type'] != 'checkboxes' ) { |
|
2120 | - if( ! isset( $field['default_choice'] ) ) { $field['default_choice'] = json_decode( stripslashes( $field['groups'] ) , true ); } |
|
2119 | + if ( $field[ 'type' ] != 'checkboxes' ) { |
|
2120 | + if ( ! isset( $field[ 'default_choice' ] ) ) { $field[ 'default_choice' ] = json_decode( stripslashes( $field[ 'groups' ] ), true ); } |
|
2121 | 2121 | } else { |
2122 | - if ( ! isset( $field['default_choice'] ) ) { $field['default_choice'] = array(); } |
|
2122 | + if ( ! isset( $field[ 'default_choice' ] ) ) { $field[ 'default_choice' ] = array(); } |
|
2123 | 2123 | } |
2124 | 2124 | |
2125 | - foreach( json_decode( $field['groups'], true ) as $id => $group ) { |
|
2126 | - $field_id = "{$field['group_id']}-{$id}"; |
|
2127 | - $field_type = 'hidden' == $field['type'] ? 'radio' : $field['type']; |
|
2125 | + foreach ( json_decode( $field[ 'groups' ], true ) as $id => $group ) { |
|
2126 | + $field_id = "{$field[ 'group_id' ]}-{$id}"; |
|
2127 | + $field_type = 'hidden' == $field[ 'type' ] ? 'radio' : $field[ 'type' ]; |
|
2128 | 2128 | $field_type = 'checkboxes' == $field_type ? 'checkbox' : $field_type; |
2129 | - $field_name = "field[{$field['group_id']}][default_choice]"; |
|
2129 | + $field_name = "field[{$field[ 'group_id' ]}][default_choice]"; |
|
2130 | 2130 | $field_name = 'checkbox' == $field_type ? $field_name . '[]' : $field_name; |
2131 | 2131 | |
2132 | 2132 | // Determine if the current group is checked. |
@@ -2135,11 +2135,11 @@ discard block |
||
2135 | 2135 | case 'radio': |
2136 | 2136 | case 'hidden': |
2137 | 2137 | default: |
2138 | - $checked = checked( $field['default_choice'], $id, false ); |
|
2138 | + $checked = checked( $field[ 'default_choice' ], $id, false ); |
|
2139 | 2139 | break; |
2140 | 2140 | |
2141 | 2141 | case 'checkbox': |
2142 | - if ( in_array( $id, (array) $field['default_choice'] ) ) { |
|
2142 | + if ( in_array( $id, (array) $field[ 'default_choice' ] ) ) { |
|
2143 | 2143 | $checked = checked( true, true, false ); |
2144 | 2144 | } |
2145 | 2145 | } |
@@ -2150,11 +2150,11 @@ discard block |
||
2150 | 2150 | type="<?php echo $field_type; ?>" |
2151 | 2151 | name="<?php echo $field_name; ?>" |
2152 | 2152 | value="<?php echo $id; ?>" <?php echo $checked; ?>> |
2153 | - <?php echo stripslashes( str_replace( '\'' , '' , $group ) ); ?> |
|
2153 | + <?php echo stripslashes( str_replace( '\'', '', $group ) ); ?> |
|
2154 | 2154 | </label> |
2155 | 2155 | <?php |
2156 | 2156 | } ?> |
2157 | - <p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' );?></small></p> |
|
2157 | + <p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p> |
|
2158 | 2158 | </td> |
2159 | 2159 | </tr> |
2160 | 2160 | |
@@ -2166,16 +2166,16 @@ discard block |
||
2166 | 2166 | <tr valign="top"> |
2167 | 2167 | <td scope="row"> |
2168 | 2168 | <label for="placeholder"> |
2169 | - <?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
2169 | + <?php _e( 'Default Selection', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
2170 | 2170 | </label> |
2171 | 2171 | </td> |
2172 | 2172 | <td> |
2173 | - <select type="default" name="field[<?php echo $field['group_id']; ?>][default_choice]"> |
|
2174 | - <?php foreach( json_decode( stripslashes_deep( $field['groups'] ) , true ) as $id => $group ) { ?> |
|
2175 | - <option value="<?php echo $id; ?>" <?php selected( $field['default_choice'] , $id ); ?>><?php echo stripslashes( $group ); ?></option> |
|
2173 | + <select type="default" name="field[<?php echo $field[ 'group_id' ]; ?>][default_choice]"> |
|
2174 | + <?php foreach ( json_decode( stripslashes_deep( $field[ 'groups' ] ), true ) as $id => $group ) { ?> |
|
2175 | + <option value="<?php echo $id; ?>" <?php selected( $field[ 'default_choice' ], $id ); ?>><?php echo stripslashes( $group ); ?></option> |
|
2176 | 2176 | <?php } ?> |
2177 | 2177 | </select> |
2178 | - <p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' );?></small></p> |
|
2178 | + <p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p> |
|
2179 | 2179 | </td> |
2180 | 2180 | </tr> |
2181 | 2181 | |
@@ -2189,12 +2189,12 @@ discard block |
||
2189 | 2189 | <tr valign="top"> |
2190 | 2190 | <td scope="row"> |
2191 | 2191 | <label for="placeholder"> |
2192 | - <?php _e( 'Description' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
2192 | + <?php _e( 'Description', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
2193 | 2193 | </label> |
2194 | 2194 | </td> |
2195 | 2195 | <td> |
2196 | - <textarea class="widefat field-description-input" name="field[<?php echo $field['group_id']; ?>][description]"><?php echo isset( $field['description'] ) ? stripslashes( esc_html( $field['description'] ) ) : '' ; ?></textarea> |
|
2197 | - <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> |
|
2196 | + <textarea class="widefat field-description-input" name="field[<?php echo $field[ 'group_id' ]; ?>][description]"><?php echo isset( $field[ 'description' ] ) ? stripslashes( esc_html( $field[ 'description' ] ) ) : ''; ?></textarea> |
|
2197 | + <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> |
|
2198 | 2198 | </td> |
2199 | 2199 | </tr> |
2200 | 2200 | |
@@ -2202,51 +2202,51 @@ discard block |
||
2202 | 2202 | <tr valign="top"> |
2203 | 2203 | <td scope="row"> |
2204 | 2204 | <label for="placeholder"> |
2205 | - <?php _e( 'Additional Classes' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
2205 | + <?php _e( 'Additional Classes', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
2206 | 2206 | </label> |
2207 | 2207 | </td> |
2208 | 2208 | <td> |
2209 | - <input type="text" class="widefat" name="field[<?php echo $field['group_id']; ?>][additional-classes]" value="<?php echo isset( $field['additional-classes'] ) ? stripslashes( wp_strip_all_tags( $field['additional-classes'] ) ) : '' ; ?>" /> |
|
2210 | - <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> |
|
2209 | + <input type="text" class="widefat" name="field[<?php echo $field[ 'group_id' ]; ?>][additional-classes]" value="<?php echo isset( $field[ 'additional-classes' ] ) ? stripslashes( wp_strip_all_tags( $field[ 'additional-classes' ] ) ) : ''; ?>" /> |
|
2210 | + <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> |
|
2211 | 2211 | </td> |
2212 | 2212 | </tr> |
2213 | 2213 | <!-- Required Toggle --> |
2214 | 2214 | <tr valign="top"> |
2215 | 2215 | <td scope="row"> |
2216 | 2216 | <label for="field-required"> |
2217 | - <?php _e( 'Field Required?' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
2217 | + <?php _e( 'Field Required?', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
2218 | 2218 | </label> |
2219 | 2219 | </td> |
2220 | 2220 | <td> |
2221 | - <?php $checked = isset( $field['require'] ) ? $field['require'] : '0'; ?> |
|
2222 | - <input type="checkbox" class="widefat" value="1" name="field[<?php echo $field['group_id']; ?>][require]" <?php checked( $checked , 1 ); ?>> |
|
2223 | - <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> |
|
2221 | + <?php $checked = isset( $field[ 'require' ] ) ? $field[ 'require' ] : '0'; ?> |
|
2222 | + <input type="checkbox" class="widefat" value="1" name="field[<?php echo $field[ 'group_id' ]; ?>][require]" <?php checked( $checked, 1 ); ?>> |
|
2223 | + <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> |
|
2224 | 2224 | </td> |
2225 | 2225 | </tr> |
2226 | 2226 | <!-- Visible Toggle --> |
2227 | 2227 | <tr valign="top"> |
2228 | 2228 | <td scope="row"> |
2229 | 2229 | <label for="hide-field"> |
2230 | - <?php _e( 'Hide Field' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
2230 | + <?php _e( 'Hide Field', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
2231 | 2231 | </label> |
2232 | 2232 | </td> |
2233 | 2233 | <td> |
2234 | - <?php $hide = isset( $field['hide'] ) ? $field['hide'] : '0'; ?> |
|
2235 | - <input type="checkbox" class="widefat" value="1" name="field[<?php echo $field['group_id']; ?>][hide]" <?php checked( $hide , 1 ); ?>> |
|
2236 | - <p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' );?></small></p> |
|
2234 | + <?php $hide = isset( $field[ 'hide' ] ) ? $field[ 'hide' ] : '0'; ?> |
|
2235 | + <input type="checkbox" class="widefat" value="1" name="field[<?php echo $field[ 'group_id' ]; ?>][hide]" <?php checked( $hide, 1 ); ?>> |
|
2236 | + <p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p> |
|
2237 | 2237 | </td> |
2238 | 2238 | </tr> |
2239 | 2239 | <!-- Toggle Field Label Visibility --> |
2240 | 2240 | <tr valign="top"> |
2241 | 2241 | <td scope="row"> |
2242 | 2242 | <label for="placeholder"> |
2243 | - <?php _e( 'Hide Label' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
2243 | + <?php _e( 'Hide Label', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
2244 | 2244 | </label> |
2245 | 2245 | </td> |
2246 | 2246 | <td> |
2247 | - <?php $hide = isset( $field['hide-label'] ) ? $field['hide-label'] : '0'; ?> |
|
2248 | - <input type="checkbox" name="field[<?php echo $field['group_id']; ?>][hide-label]" value="1" <?php checked( $hide , 1 ); ?>/> |
|
2249 | - <p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' );?></small></p> |
|
2247 | + <?php $hide = isset( $field[ 'hide-label' ] ) ? $field[ 'hide-label' ] : '0'; ?> |
|
2248 | + <input type="checkbox" name="field[<?php echo $field[ 'group_id' ]; ?>][hide-label]" value="1" <?php checked( $hide, 1 ); ?>/> |
|
2249 | + <p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p> |
|
2250 | 2250 | </td> |
2251 | 2251 | </tr> |
2252 | 2252 | <!-- Toggle Buttons --> |
@@ -2256,8 +2256,8 @@ discard block |
||
2256 | 2256 | </td> |
2257 | 2257 | <td> |
2258 | 2258 | <span class="toggle-container"> |
2259 | - <a href="#" class="close-form-expansion"><?php _e( "Close" , 'yikes-inc-easy-mailchimp-extender' ); ?></a> | |
|
2260 | - <a href="#" class="remove-field" alt="<?php echo $field['group_id']; ?>"><?php _e( "Remove Field" , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
2259 | + <a href="#" class="close-form-expansion"><?php _e( "Close", 'yikes-inc-easy-mailchimp-extender' ); ?></a> | |
|
2260 | + <a href="#" class="remove-field" alt="<?php echo $field[ 'group_id' ]; ?>"><?php _e( "Remove Field", 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
2261 | 2261 | </span> |
2262 | 2262 | </td> |
2263 | 2263 | </tr> |
@@ -2271,38 +2271,38 @@ discard block |
||
2271 | 2271 | } |
2272 | 2272 | } else { |
2273 | 2273 | ?> |
2274 | - <h4 class="no-fields-assigned-notice non-draggable-yikes"><em><?php _e( 'No fields are assigned to this form. Select fields from the right hand column to add to this form.' , 'yikes-inc-easy-mailchimp-extender' ); ?></em></h4> |
|
2274 | + <h4 class="no-fields-assigned-notice non-draggable-yikes"><em><?php _e( 'No fields are assigned to this form. Select fields from the right hand column to add to this form.', 'yikes-inc-easy-mailchimp-extender' ); ?></em></h4> |
|
2275 | 2275 | <?php |
2276 | 2276 | } |
2277 | 2277 | /* Pre Defined Merge Tag Container - Always rendered so the modal appears and links are clickable on initial page load */ |
2278 | 2278 | add_thickbox(); |
2279 | 2279 | // enqueue jquery qtip for our tooltip |
2280 | - wp_enqueue_script( 'jquery-qtip-tooltip' , YIKES_MC_URL . 'admin/js/min/jquery.qtip.min.js' , array( 'jquery' ) ); |
|
2281 | - wp_enqueue_style( 'jquery-qtip-style' , YIKES_MC_URL . 'admin/css/jquery.qtip.min.css' ); |
|
2280 | + wp_enqueue_script( 'jquery-qtip-tooltip', YIKES_MC_URL . 'admin/js/min/jquery.qtip.min.js', array( 'jquery' ) ); |
|
2281 | + wp_enqueue_style( 'jquery-qtip-style', YIKES_MC_URL . 'admin/css/jquery.qtip.min.css' ); |
|
2282 | 2282 | $available_tags = array( |
2283 | 2283 | array( |
2284 | 2284 | 'tag' => '{page_title}', |
2285 | - 'description' => '<h4 class="tooltip-title">' . __( 'Page Title', 'yikes-inc-easy-mailchimp-extender' ) . ' | <small>{page_title}</small></h4><hr />' . __( 'Pre-populate the field with the current page or post title that the user is on when opting in to your mailing list.' , 'yikes-inc-easy-mailchimp-extender' ), |
|
2285 | + 'description' => '<h4 class="tooltip-title">' . __( 'Page Title', 'yikes-inc-easy-mailchimp-extender' ) . ' | <small>{page_title}</small></h4><hr />' . __( 'Pre-populate the field with the current page or post title that the user is on when opting in to your mailing list.', 'yikes-inc-easy-mailchimp-extender' ), |
|
2286 | 2286 | 'title' => __( 'Page Title', 'yikes-inc-easy-mailchimp-extender' ) |
2287 | 2287 | ), |
2288 | 2288 | array( |
2289 | 2289 | 'tag' => '{page_id}', |
2290 | - 'description' => '<h4 class="tooltip-title">' . __( 'Page ID', 'yikes-inc-easy-mailchimp-extender' ) . ' | <small>{page_id}</small></h4><hr />' . __( 'Pre-populate the field with the current page or post ID that the user is on when opting in to your mailing list.' , 'yikes-inc-easy-mailchimp-extender' ), |
|
2290 | + 'description' => '<h4 class="tooltip-title">' . __( 'Page ID', 'yikes-inc-easy-mailchimp-extender' ) . ' | <small>{page_id}</small></h4><hr />' . __( 'Pre-populate the field with the current page or post ID that the user is on when opting in to your mailing list.', 'yikes-inc-easy-mailchimp-extender' ), |
|
2291 | 2291 | 'title' => __( 'Page ID', 'yikes-inc-easy-mailchimp-extender' ) |
2292 | 2292 | ), |
2293 | 2293 | array( |
2294 | 2294 | 'tag' => '{page_url}', |
2295 | - 'description' => '<h4 class="tooltip-title">' . __( 'Page URL', 'yikes-inc-easy-mailchimp-extender' ) . ' | <small>{page_url}</small></h4><hr />' . __( 'Pre-populate the field with the current page URL that the user is on when opting in to your mailing list.' , 'yikes-inc-easy-mailchimp-extender' ), |
|
2295 | + 'description' => '<h4 class="tooltip-title">' . __( 'Page URL', 'yikes-inc-easy-mailchimp-extender' ) . ' | <small>{page_url}</small></h4><hr />' . __( 'Pre-populate the field with the current page URL that the user is on when opting in to your mailing list.', 'yikes-inc-easy-mailchimp-extender' ), |
|
2296 | 2296 | 'title' => __( 'Page URL', 'yikes-inc-easy-mailchimp-extender' ) |
2297 | 2297 | ), |
2298 | 2298 | array( |
2299 | 2299 | 'tag' => '{blog_name}', |
2300 | - 'description' => '<h4 class="tooltip-title">' . __( 'Blog Name', 'yikes-inc-easy-mailchimp-extender' ) . ' | <small>{blog_name}</small></h4><hr />' . __( 'Pre-populate the field with the current blog name that the user is on when opting in to your mailing list. This is especially helpful for multi-site networks.' , 'yikes-inc-easy-mailchimp-extender' ), |
|
2300 | + 'description' => '<h4 class="tooltip-title">' . __( 'Blog Name', 'yikes-inc-easy-mailchimp-extender' ) . ' | <small>{blog_name}</small></h4><hr />' . __( 'Pre-populate the field with the current blog name that the user is on when opting in to your mailing list. This is especially helpful for multi-site networks.', 'yikes-inc-easy-mailchimp-extender' ), |
|
2301 | 2301 | 'title' => __( 'Blog Name', 'yikes-inc-easy-mailchimp-extender' ) |
2302 | 2302 | ), |
2303 | 2303 | array( |
2304 | 2304 | 'tag' => '{user_logged_in}', |
2305 | - 'description' => '<h4 class="tooltip-title">' . __( 'User Logged In', 'yikes-inc-easy-mailchimp-extender' ) . ' | <small>{user_logged_in}</small></h4><hr />' . __( 'Detects if a user is logged in and pre-populates the field with an appropriate value.' , 'yikes-inc-easy-mailchimp-extender' ), |
|
2305 | + 'description' => '<h4 class="tooltip-title">' . __( 'User Logged In', 'yikes-inc-easy-mailchimp-extender' ) . ' | <small>{user_logged_in}</small></h4><hr />' . __( 'Detects if a user is logged in and pre-populates the field with an appropriate value.', 'yikes-inc-easy-mailchimp-extender' ), |
|
2306 | 2306 | 'title' => __( 'User Logged In', 'yikes-inc-easy-mailchimp-extender' ) |
2307 | 2307 | ), |
2308 | 2308 | ); |
@@ -2330,17 +2330,17 @@ discard block |
||
2330 | 2330 | <div id="pre-defined-tag-container"> |
2331 | 2331 | <input type="hidden" value="" class="clicked-input"> |
2332 | 2332 | <div id="pre-defined-tag-interior-container"> |
2333 | - <h3><?php _e( 'Pre Defined Tags' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
2334 | - <p class="description"><?php _e( 'You can use any of the following tags to populate a MailChimp text field with dynamic content. This can be used to determine which page the user signed up on, if the user was logged in and more.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
2333 | + <h3><?php _e( 'Pre Defined Tags', 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
2334 | + <p class="description"><?php _e( 'You can use any of the following tags to populate a MailChimp text field with dynamic content. This can be used to determine which page the user signed up on, if the user was logged in and more.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
2335 | 2335 | <ul> |
2336 | - <?php foreach( apply_filters( 'yikes-mailchimp-custom-default-value-tags' , $available_tags ) as $tag ) { ?> |
|
2336 | + <?php foreach ( apply_filters( 'yikes-mailchimp-custom-default-value-tags', $available_tags ) as $tag ) { ?> |
|
2337 | 2337 | <li class="tooltop-tag"> |
2338 | 2338 | <!-- link/tag --> |
2339 | - <a href="#" onclick="populateDefaultValue( '<?php echo $tag['tag']; ?>' );return false;" data-attr-tag="<?php echo $tag['tag']; ?>" title="<?php echo $tag['title']; ?>"><?php echo $tag['title']; ?></a> |
|
2339 | + <a href="#" onclick="populateDefaultValue( '<?php echo $tag[ 'tag' ]; ?>' );return false;" data-attr-tag="<?php echo $tag[ 'tag' ]; ?>" title="<?php echo $tag[ 'title' ]; ?>"><?php echo $tag[ 'title' ]; ?></a> |
|
2340 | 2340 | <!-- help icon --> |
2341 | 2341 | <span class="dashicons dashicons-editor-help"></span> |
2342 | 2342 | <!-- tooltip --> |
2343 | - <div class="tooltiptext qtip-bootstrap yikes-easy-mc-hidden"><?php echo $tag['description']; ?></div> |
|
2343 | + <div class="tooltiptext qtip-bootstrap yikes-easy-mc-hidden"><?php echo $tag[ 'description' ]; ?></div> |
|
2344 | 2344 | </li> |
2345 | 2345 | <?php } ?> |
2346 | 2346 | </ul> |
@@ -2356,46 +2356,46 @@ discard block |
||
2356 | 2356 | * - |
2357 | 2357 | * @parameters - $list_id - pass in the list ID to retreive merge variables from |
2358 | 2358 | */ |
2359 | - public function build_available_merge_vars( $form_fields , $available_merge_variables ) { |
|
2359 | + public function build_available_merge_vars( $form_fields, $available_merge_variables ) { |
|
2360 | 2360 | $fields_assigned_to_form = array(); |
2361 | 2361 | foreach ( $form_fields as $field ) { |
2362 | - if ( isset( $field['merge'] ) ) { |
|
2363 | - $fields_assigned_to_form[ $field['merge'] ] = true; |
|
2362 | + if ( isset( $field[ 'merge' ] ) ) { |
|
2363 | + $fields_assigned_to_form[ $field[ 'merge' ] ] = true; |
|
2364 | 2364 | } |
2365 | 2365 | } |
2366 | 2366 | |
2367 | - if ( ! empty( $available_merge_variables['merge_fields'] ) ) { |
|
2367 | + if ( ! empty( $available_merge_variables[ 'merge_fields' ] ) ) { |
|
2368 | 2368 | ?> |
2369 | 2369 | <ul id="available-fields"><?php |
2370 | - foreach ( $available_merge_variables['merge_fields'] as $merge_var ) { |
|
2371 | - if ( isset( $fields_assigned_to_form[ $merge_var['tag'] ] ) ) { |
|
2370 | + foreach ( $available_merge_variables[ 'merge_fields' ] as $merge_var ) { |
|
2371 | + if ( isset( $fields_assigned_to_form[ $merge_var[ 'tag' ] ] ) ) { |
|
2372 | 2372 | ?> |
2373 | 2373 | <li class="available-form-field not-available" |
2374 | - alt="<?php echo $merge_var['tag']; ?>" |
|
2375 | - data-attr-field-type="<?php echo esc_attr( $merge_var['type'] ); ?>" |
|
2376 | - data-attr-field-name="<?php echo esc_attr( $merge_var['name'] ); ?>" |
|
2377 | - data-attr-form-id="<?php echo esc_attr( $available_merge_variables['list_id'] ); ?>" |
|
2374 | + alt="<?php echo $merge_var[ 'tag' ]; ?>" |
|
2375 | + data-attr-field-type="<?php echo esc_attr( $merge_var[ 'type' ] ); ?>" |
|
2376 | + data-attr-field-name="<?php echo esc_attr( $merge_var[ 'name' ] ); ?>" |
|
2377 | + data-attr-form-id="<?php echo esc_attr( $available_merge_variables[ 'list_id' ] ); ?>" |
|
2378 | 2378 | title="<?php esc_attr_e( 'Already assigned to your form', 'yikes-inc-easy-mailchimp-extender' ); ?>" |
2379 | 2379 | disabled="disabled"> |
2380 | - <?php echo stripslashes( $merge_var['name'] ); |
|
2381 | - if ( $merge_var['required'] ) { |
|
2380 | + <?php echo stripslashes( $merge_var[ 'name' ] ); |
|
2381 | + if ( $merge_var[ 'required' ] ) { |
|
2382 | 2382 | echo ' <span class="field-required" title="' . __( 'required field', 'yikes-inc-easy-mailchimp-extender' ) . '">*</span>'; |
2383 | 2383 | } ?> |
2384 | - <small class="field-type-text"><?php echo $merge_var['type']; ?></small> |
|
2384 | + <small class="field-type-text"><?php echo $merge_var[ 'type' ]; ?></small> |
|
2385 | 2385 | </li> |
2386 | 2386 | <?php |
2387 | 2387 | } else { |
2388 | 2388 | ?> |
2389 | 2389 | <li class="available-form-field" |
2390 | - alt="<?php echo $merge_var['tag']; ?>" |
|
2391 | - data-attr-field-type="<?php echo esc_attr( $merge_var['type'] ); ?>" |
|
2392 | - data-attr-field-name="<?php echo esc_attr( $merge_var['name'] ); ?>" |
|
2393 | - data-attr-form-id="<?php echo esc_attr( $available_merge_variables['list_id'] ); ?>"> |
|
2394 | - <?php echo stripslashes( $merge_var['name'] ); |
|
2395 | - if ( $merge_var['required'] ) { |
|
2390 | + alt="<?php echo $merge_var[ 'tag' ]; ?>" |
|
2391 | + data-attr-field-type="<?php echo esc_attr( $merge_var[ 'type' ] ); ?>" |
|
2392 | + data-attr-field-name="<?php echo esc_attr( $merge_var[ 'name' ] ); ?>" |
|
2393 | + data-attr-form-id="<?php echo esc_attr( $available_merge_variables[ 'list_id' ] ); ?>"> |
|
2394 | + <?php echo stripslashes( $merge_var[ 'name' ] ); |
|
2395 | + if ( $merge_var[ 'required' ] ) { |
|
2396 | 2396 | echo ' <span class="field-required" title="' . __( 'required field', 'yikes-inc-easy-mailchimp-extender' ) . '">*</span>'; |
2397 | 2397 | } ?> |
2398 | - <small class="field-type-text"><?php echo $merge_var['type']; ?></small> |
|
2398 | + <small class="field-type-text"><?php echo $merge_var[ 'type' ]; ?></small> |
|
2399 | 2399 | </li> |
2400 | 2400 | <?php |
2401 | 2401 | } |
@@ -2417,12 +2417,12 @@ discard block |
||
2417 | 2417 | * - |
2418 | 2418 | * @parameters - $list_id - pass in the list ID to retreive merge variables from |
2419 | 2419 | */ |
2420 | - public function build_available_interest_groups( $form_fields , $available_interest_groups , $list_id ) { |
|
2420 | + public function build_available_interest_groups( $form_fields, $available_interest_groups, $list_id ) { |
|
2421 | 2421 | $fields_assigned_to_form = array(); |
2422 | 2422 | if ( ! empty( $form_fields ) ) { |
2423 | 2423 | foreach ( $form_fields as $field ) { |
2424 | - if ( isset( $field['group_id'] ) ) { |
|
2425 | - $fields_assigned_to_form[ $field['group_id'] ] = true; |
|
2424 | + if ( isset( $field[ 'group_id' ] ) ) { |
|
2425 | + $fields_assigned_to_form[ $field[ 'group_id' ] ] = true; |
|
2426 | 2426 | } |
2427 | 2427 | } |
2428 | 2428 | } |
@@ -2431,16 +2431,16 @@ discard block |
||
2431 | 2431 | ?> |
2432 | 2432 | <ul id="available-interest-groups"><?php |
2433 | 2433 | foreach ( $available_interest_groups as $interest_group ) { |
2434 | - if ( isset( $fields_assigned_to_form[ $interest_group['id'] ] ) ) { |
|
2434 | + if ( isset( $fields_assigned_to_form[ $interest_group[ 'id' ] ] ) ) { |
|
2435 | 2435 | ?> |
2436 | - <li class="available-interest-group not-available" alt="<?php echo $interest_group['id']; ?>" data-attr-field-name="<?php echo stripslashes( $interest_group['title'] ); ?>" data-attr-field-type="<?php echo $interest_group['type']; ?>" data-attr-form-id="<?php echo $list_id; ?>" title="<?php _e( 'Already assigned to your form', 'yikes-inc-easy-mailchimp-extender' ); ?>" disabled="disabled"><?php echo stripslashes( $interest_group['title'] ); ?> |
|
2437 | - <small class="field-type-text"><?php echo $interest_group['type']; ?></small> |
|
2436 | + <li class="available-interest-group not-available" alt="<?php echo $interest_group[ 'id' ]; ?>" data-attr-field-name="<?php echo stripslashes( $interest_group[ 'title' ] ); ?>" data-attr-field-type="<?php echo $interest_group[ 'type' ]; ?>" data-attr-form-id="<?php echo $list_id; ?>" title="<?php _e( 'Already assigned to your form', 'yikes-inc-easy-mailchimp-extender' ); ?>" disabled="disabled"><?php echo stripslashes( $interest_group[ 'title' ] ); ?> |
|
2437 | + <small class="field-type-text"><?php echo $interest_group[ 'type' ]; ?></small> |
|
2438 | 2438 | </li> |
2439 | 2439 | <?php |
2440 | 2440 | } else { |
2441 | 2441 | ?> |
2442 | - <li class="available-interest-group" alt="<?php echo $interest_group['id']; ?>" data-attr-field-name="<?php echo stripslashes( $interest_group['title'] ); ?>" data-attr-field-type="<?php echo $interest_group['type']; ?>" data-attr-form-id="<?php echo $list_id; ?>"><?php echo stripslashes( $interest_group['title'] ); ?> |
|
2443 | - <small class="field-type-text"><?php echo $interest_group['type']; ?></small> |
|
2442 | + <li class="available-interest-group" alt="<?php echo $interest_group[ 'id' ]; ?>" data-attr-field-name="<?php echo stripslashes( $interest_group[ 'title' ] ); ?>" data-attr-field-type="<?php echo $interest_group[ 'type' ]; ?>" data-attr-form-id="<?php echo $list_id; ?>"><?php echo stripslashes( $interest_group[ 'title' ] ); ?> |
|
2443 | + <small class="field-type-text"><?php echo $interest_group[ 'type' ]; ?></small> |
|
2444 | 2444 | </li> |
2445 | 2445 | <?php |
2446 | 2446 | } |
@@ -2462,15 +2462,15 @@ discard block |
||
2462 | 2462 | * - must clean up db tables , ensure what data is going in and what is needed... |
2463 | 2463 | */ |
2464 | 2464 | public function yikes_easy_mailchimp_create_form() { |
2465 | - $nonce = $_REQUEST['nonce']; |
|
2466 | - if( ! wp_verify_nonce( $nonce, 'create_mailchimp_form' ) ) { |
|
2467 | - wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) ); |
|
2465 | + $nonce = $_REQUEST[ 'nonce' ]; |
|
2466 | + if ( ! wp_verify_nonce( $nonce, 'create_mailchimp_form' ) ) { |
|
2467 | + wp_die( __( "We've run into an error. The security check didn't pass. Please try again.", 'yikes-inc-easy-mailchimp-extender' ) ); |
|
2468 | 2468 | } |
2469 | 2469 | |
2470 | 2470 | $result = $this->form_interface->create_form( array( |
2471 | - 'list_id' => sanitize_key( $_POST['associated-list'] ), |
|
2472 | - 'form_name' => stripslashes( $_POST['form-name'] ), |
|
2473 | - 'form_description' => stripslashes( $_POST['form-description'] ), |
|
2471 | + 'list_id' => sanitize_key( $_POST[ 'associated-list' ] ), |
|
2472 | + 'form_name' => stripslashes( $_POST[ 'form-name' ] ), |
|
2473 | + 'form_description' => stripslashes( $_POST[ 'form-description' ] ), |
|
2474 | 2474 | ) ); |
2475 | 2475 | |
2476 | 2476 | // if an error occurs during the form creation process |
@@ -2478,11 +2478,11 @@ discard block |
||
2478 | 2478 | // write it to the error log |
2479 | 2479 | // if the form was not created successfully |
2480 | 2480 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
2481 | - $error_logging->maybe_write_to_log( __( 'Error creating a new form', 'yikes-inc-easy-mailchimp-extender') , __( "Creating a new form" , 'yikes-inc-easy-mailchimp-extender' ) , __( "Forms" , 'yikes-inc-easy-mailchimp-extender' ) ); |
|
2481 | + $error_logging->maybe_write_to_log( __( 'Error creating a new form', 'yikes-inc-easy-mailchimp-extender' ), __( "Creating a new form", 'yikes-inc-easy-mailchimp-extender' ), __( "Forms", 'yikes-inc-easy-mailchimp-extender' ) ); |
|
2482 | 2482 | wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-edit-form&sql_error=' . urlencode( __( 'Error creating a new form', 'yikes-inc-easy-mailchimp-extender' ) ) ) ) ); |
2483 | 2483 | } else { |
2484 | 2484 | // redirect the user to the new form edit page |
2485 | - wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-edit-form&id=' . $result) ) ); |
|
2485 | + wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-edit-form&id=' . $result ) ) ); |
|
2486 | 2486 | } |
2487 | 2487 | exit(); |
2488 | 2488 | } |
@@ -2495,11 +2495,11 @@ discard block |
||
2495 | 2495 | */ |
2496 | 2496 | public function yikes_easy_mailchimp_delete_form() { |
2497 | 2497 | // grab & store our variables ( associated list & form name ) |
2498 | - $nonce = $_REQUEST['nonce']; |
|
2499 | - $post_id_to_delete = $_REQUEST['mailchimp-form']; |
|
2498 | + $nonce = $_REQUEST[ 'nonce' ]; |
|
2499 | + $post_id_to_delete = $_REQUEST[ 'mailchimp-form' ]; |
|
2500 | 2500 | // verify our nonce |
2501 | - if( ! wp_verify_nonce( $nonce, 'delete-mailchimp-form-'.$post_id_to_delete ) ) { |
|
2502 | - wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) , __( "Failed nonce validation" , 'yikes-inc-easy-mailchimp-extender' ) , array( 'response' => 500 , 'back_link' => true ) ); |
|
2501 | + if ( ! wp_verify_nonce( $nonce, 'delete-mailchimp-form-' . $post_id_to_delete ) ) { |
|
2502 | + wp_die( __( "We've run into an error. The security check didn't pass. Please try again.", 'yikes-inc-easy-mailchimp-extender' ), __( "Failed nonce validation", 'yikes-inc-easy-mailchimp-extender' ), array( 'response' => 500, 'back_link' => true ) ); |
|
2503 | 2503 | } |
2504 | 2504 | |
2505 | 2505 | $this->form_interface->delete_form( $post_id_to_delete ); |
@@ -2515,19 +2515,19 @@ discard block |
||
2515 | 2515 | */ |
2516 | 2516 | public function yikes_easy_mailchimp_duplicate_form() { |
2517 | 2517 | // grab & store our variables ( associated list & form name ) |
2518 | - $nonce = $_REQUEST['nonce']; |
|
2519 | - $post_id_to_clone = $_REQUEST['mailchimp-form']; |
|
2518 | + $nonce = $_REQUEST[ 'nonce' ]; |
|
2519 | + $post_id_to_clone = $_REQUEST[ 'mailchimp-form' ]; |
|
2520 | 2520 | // verify our nonce |
2521 | - if( ! wp_verify_nonce( $nonce, 'duplicate-mailchimp-form-'.$post_id_to_clone ) ) { |
|
2522 | - wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) , __( "Failed nonce validation" , 'yikes-inc-easy-mailchimp-extender' ) , array( 'response' => 500 , 'back_link' => true ) ); |
|
2521 | + if ( ! wp_verify_nonce( $nonce, 'duplicate-mailchimp-form-' . $post_id_to_clone ) ) { |
|
2522 | + wp_die( __( "We've run into an error. The security check didn't pass. Please try again.", 'yikes-inc-easy-mailchimp-extender' ), __( "Failed nonce validation", 'yikes-inc-easy-mailchimp-extender' ), array( 'response' => 500, 'back_link' => true ) ); |
|
2523 | 2523 | } |
2524 | 2524 | |
2525 | 2525 | // Get the current form data. |
2526 | 2526 | $form_data = $this->form_interface->get_form( $post_id_to_clone ); |
2527 | 2527 | |
2528 | 2528 | // Update some of the data before duplication |
2529 | - $form_data['form_name'] .= ' - Copy - '; |
|
2530 | - $form_data['impressions'] = $form_data['submissions'] = 0; |
|
2529 | + $form_data[ 'form_name' ] .= ' - Copy - '; |
|
2530 | + $form_data[ 'impressions' ] = $form_data[ 'submissions' ] = 0; |
|
2531 | 2531 | |
2532 | 2532 | // Create the new form, and handle the result. |
2533 | 2533 | $result = $this->form_interface->create_form( $form_data ); |
@@ -2548,11 +2548,11 @@ discard block |
||
2548 | 2548 | */ |
2549 | 2549 | public function yikes_easy_mailchimp_reset_impression_stats() { |
2550 | 2550 | // grab & store our variables ( associated list & form name ) |
2551 | - $nonce = $_REQUEST['nonce']; |
|
2552 | - $form_id_to_reset = $_REQUEST['mailchimp-form']; |
|
2551 | + $nonce = $_REQUEST[ 'nonce' ]; |
|
2552 | + $form_id_to_reset = $_REQUEST[ 'mailchimp-form' ]; |
|
2553 | 2553 | // verify our nonce |
2554 | - if( ! wp_verify_nonce( $nonce, 'reset-stats-mailchimp-form-'.$form_id_to_reset ) ) { |
|
2555 | - wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) , __( "Failed nonce validation" , 'yikes-inc-easy-mailchimp-extender' ) , array( 'response' => 500 , 'back_link' => true ) ); |
|
2554 | + if ( ! wp_verify_nonce( $nonce, 'reset-stats-mailchimp-form-' . $form_id_to_reset ) ) { |
|
2555 | + wp_die( __( "We've run into an error. The security check didn't pass. Please try again.", 'yikes-inc-easy-mailchimp-extender' ), __( "Failed nonce validation", 'yikes-inc-easy-mailchimp-extender' ), array( 'response' => 500, 'back_link' => true ) ); |
|
2556 | 2556 | } |
2557 | 2557 | |
2558 | 2558 | $result = $this->form_interface->update_form( |
@@ -2580,8 +2580,8 @@ discard block |
||
2580 | 2580 | */ |
2581 | 2581 | public function yikes_easy_mailchimp_update_form() { |
2582 | 2582 | // grab & store our variables ( associated list & form name ) |
2583 | - $nonce = $_REQUEST['nonce']; |
|
2584 | - $form_id = $_REQUEST['id']; |
|
2583 | + $nonce = $_REQUEST[ 'nonce' ]; |
|
2584 | + $form_id = $_REQUEST[ 'id' ]; |
|
2585 | 2585 | |
2586 | 2586 | // verify our nonce |
2587 | 2587 | if ( ! wp_verify_nonce( $nonce, 'update-mailchimp-form-' . $form_id ) ) { |
@@ -2595,66 +2595,66 @@ discard block |
||
2595 | 2595 | } |
2596 | 2596 | |
2597 | 2597 | // store our values! |
2598 | - $list_id = $_POST['associated-list']; |
|
2599 | - $form_name = stripslashes( $_POST['form-name'] ); |
|
2600 | - $form_description = sanitize_text_field( stripslashes( $_POST['form-description'] ) ); |
|
2601 | - $send_welcome_email = $_POST['send-welcome-email']; |
|
2602 | - $redirect_user_on_submit = $_POST['redirect-user-on-submission']; |
|
2603 | - $redirect_page = $_POST['redirect-user-to-selection']; |
|
2598 | + $list_id = $_POST[ 'associated-list' ]; |
|
2599 | + $form_name = stripslashes( $_POST[ 'form-name' ] ); |
|
2600 | + $form_description = sanitize_text_field( stripslashes( $_POST[ 'form-description' ] ) ); |
|
2601 | + $send_welcome_email = $_POST[ 'send-welcome-email' ]; |
|
2602 | + $redirect_user_on_submit = $_POST[ 'redirect-user-on-submission' ]; |
|
2603 | + $redirect_page = $_POST[ 'redirect-user-to-selection' ]; |
|
2604 | 2604 | |
2605 | 2605 | // stripslashes_deep on save, to prevent foreign languages from added excessive backslashes |
2606 | - $assigned_fields = isset( $_POST['field'] ) ? stripslashes_deep( $_POST['field'] ): array(); |
|
2606 | + $assigned_fields = isset( $_POST[ 'field' ] ) ? stripslashes_deep( $_POST[ 'field' ] ) : array(); |
|
2607 | 2607 | |
2608 | 2608 | // setup our submission settings serialized array |
2609 | 2609 | $submission_settings = array( |
2610 | - 'ajax' => $_POST['form-ajax-submission'], |
|
2611 | - 'redirect_on_submission' => $_POST['redirect-user-on-submission'], |
|
2612 | - 'redirect_page' => $_POST['redirect-user-to-selection'], |
|
2613 | - 'custom_redirect_url' => esc_url( $_POST['custom-redirect-url'] ), |
|
2614 | - 'hide_form_post_signup' => $_POST['hide-form-post-signup'], |
|
2615 | - 'replace_interests' => $_POST['replace-interest-groups'], |
|
2610 | + 'ajax' => $_POST[ 'form-ajax-submission' ], |
|
2611 | + 'redirect_on_submission' => $_POST[ 'redirect-user-on-submission' ], |
|
2612 | + 'redirect_page' => $_POST[ 'redirect-user-to-selection' ], |
|
2613 | + 'custom_redirect_url' => esc_url( $_POST[ 'custom-redirect-url' ] ), |
|
2614 | + 'hide_form_post_signup' => $_POST[ 'hide-form-post-signup' ], |
|
2615 | + 'replace_interests' => $_POST[ 'replace-interest-groups' ], |
|
2616 | 2616 | ); |
2617 | 2617 | |
2618 | 2618 | // setup our opt-in settings serialized array |
2619 | 2619 | $optin_settings = array( |
2620 | - 'optin' => $_POST['single-double-optin'], |
|
2621 | - 'update_existing_user' => $_POST['update-existing-user'], |
|
2622 | - 'send_update_email' => $_POST['update-existing-email'], |
|
2623 | - 'send_welcome_email' => $_POST['send-welcome-email'], |
|
2620 | + 'optin' => $_POST[ 'single-double-optin' ], |
|
2621 | + 'update_existing_user' => $_POST[ 'update-existing-user' ], |
|
2622 | + 'send_update_email' => $_POST[ 'update-existing-email' ], |
|
2623 | + 'send_welcome_email' => $_POST[ 'send-welcome-email' ], |
|
2624 | 2624 | ); |
2625 | 2625 | |
2626 | 2626 | // setup our error settings serialized array |
2627 | 2627 | $error_settings = array( |
2628 | - 'success' => trim( $_POST['yikes-easy-mc-success-message'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-success-message'] ) ) : '', |
|
2629 | - 'general-error' => trim( $_POST['yikes-easy-mc-general-error-message'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-general-error-message'] ) ) : '', |
|
2630 | - 'invalid-email' => trim( $_POST['yikes-easy-mc-invalid-email-message'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-invalid-email-message'] ) ) : '', |
|
2631 | - 'already-subscribed' => trim( $_POST['yikes-easy-mc-user-subscribed-message'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-user-subscribed-message'] ) ) : '', |
|
2632 | - 'update-link' => trim( $_POST['yikes-easy-mc-user-update-link'] ) ? trim( stripslashes( $_POST['yikes-easy-mc-user-update-link'] ) ) : '', |
|
2628 | + 'success' => trim( $_POST[ 'yikes-easy-mc-success-message' ] ) ? trim( stripslashes( $_POST[ 'yikes-easy-mc-success-message' ] ) ) : '', |
|
2629 | + 'general-error' => trim( $_POST[ 'yikes-easy-mc-general-error-message' ] ) ? trim( stripslashes( $_POST[ 'yikes-easy-mc-general-error-message' ] ) ) : '', |
|
2630 | + 'invalid-email' => trim( $_POST[ 'yikes-easy-mc-invalid-email-message' ] ) ? trim( stripslashes( $_POST[ 'yikes-easy-mc-invalid-email-message' ] ) ) : '', |
|
2631 | + 'already-subscribed' => trim( $_POST[ 'yikes-easy-mc-user-subscribed-message' ] ) ? trim( stripslashes( $_POST[ 'yikes-easy-mc-user-subscribed-message' ] ) ) : '', |
|
2632 | + 'update-link' => trim( $_POST[ 'yikes-easy-mc-user-update-link' ] ) ? trim( stripslashes( $_POST[ 'yikes-easy-mc-user-update-link' ] ) ) : '', |
|
2633 | 2633 | ); |
2634 | 2634 | |
2635 | 2635 | // Setup the new form settings array |
2636 | 2636 | // @since 6.0.3.8 |
2637 | 2637 | // To Do: Combine date & time so it's a single unix timestamp |
2638 | 2638 | $form_settings = array( |
2639 | - 'yikes-easy-mc-form-class-names' => trim( $_POST['yikes-easy-mc-form-class-names'] ), |
|
2640 | - 'yikes-easy-mc-inline-form' => $_POST['yikes-easy-mc-inline-form'][0], |
|
2641 | - 'yikes-easy-mc-submit-button-type' => $_POST['yikes-easy-mc-submit-button-type'][0], |
|
2642 | - 'yikes-easy-mc-submit-button-text' => trim( $_POST['yikes-easy-mc-submit-button-text'] ), |
|
2643 | - 'yikes-easy-mc-submit-button-image' => esc_url( trim( $_POST['yikes-easy-mc-submit-button-image'] ) ), |
|
2644 | - 'yikes-easy-mc-submit-button-classes' => trim( $_POST['yikes-easy-mc-submit-button-classes'] ), |
|
2645 | - 'yikes-easy-mc-form-schedule' => ( isset( $_POST['yikes-easy-mc-form-schedule'] ) ) ? '1' : '0', |
|
2646 | - 'yikes-easy-mc-form-restriction-start' => strtotime( $_POST['yikes-easy-mc-form-restriction-start-date'] . ' ' . $_POST['yikes-easy-mc-form-restriction-start-time'] ), |
|
2647 | - 'yikes-easy-mc-form-restriction-end' => strtotime( $_POST['yikes-easy-mc-form-restriction-end-date'] . ' ' . $_POST['yikes-easy-mc-form-restriction-end-time'] ), |
|
2648 | - 'yikes-easy-mc-form-restriction-pending-message' => trim( $_POST['yikes-easy-mc-form-restriction-pending-message'] ), |
|
2649 | - 'yikes-easy-mc-form-restriction-expired-message' => trim( $_POST['yikes-easy-mc-form-restriction-expired-message'] ), |
|
2650 | - 'yikes-easy-mc-form-login-required' => ( isset( $_POST['yikes-easy-mc-form-login-required'] ) ) ? '1' : '0', |
|
2651 | - 'yikes-easy-mc-form-restriction-login-message' => trim( $_POST['yikes-easy-mc-form-restriction-login-message'] ), |
|
2639 | + 'yikes-easy-mc-form-class-names' => trim( $_POST[ 'yikes-easy-mc-form-class-names' ] ), |
|
2640 | + 'yikes-easy-mc-inline-form' => $_POST[ 'yikes-easy-mc-inline-form' ][ 0 ], |
|
2641 | + 'yikes-easy-mc-submit-button-type' => $_POST[ 'yikes-easy-mc-submit-button-type' ][ 0 ], |
|
2642 | + 'yikes-easy-mc-submit-button-text' => trim( $_POST[ 'yikes-easy-mc-submit-button-text' ] ), |
|
2643 | + 'yikes-easy-mc-submit-button-image' => esc_url( trim( $_POST[ 'yikes-easy-mc-submit-button-image' ] ) ), |
|
2644 | + 'yikes-easy-mc-submit-button-classes' => trim( $_POST[ 'yikes-easy-mc-submit-button-classes' ] ), |
|
2645 | + 'yikes-easy-mc-form-schedule' => ( isset( $_POST[ 'yikes-easy-mc-form-schedule' ] ) ) ? '1' : '0', |
|
2646 | + 'yikes-easy-mc-form-restriction-start' => strtotime( $_POST[ 'yikes-easy-mc-form-restriction-start-date' ] . ' ' . $_POST[ 'yikes-easy-mc-form-restriction-start-time' ] ), |
|
2647 | + 'yikes-easy-mc-form-restriction-end' => strtotime( $_POST[ 'yikes-easy-mc-form-restriction-end-date' ] . ' ' . $_POST[ 'yikes-easy-mc-form-restriction-end-time' ] ), |
|
2648 | + 'yikes-easy-mc-form-restriction-pending-message' => trim( $_POST[ 'yikes-easy-mc-form-restriction-pending-message' ] ), |
|
2649 | + 'yikes-easy-mc-form-restriction-expired-message' => trim( $_POST[ 'yikes-easy-mc-form-restriction-expired-message' ] ), |
|
2650 | + 'yikes-easy-mc-form-login-required' => ( isset( $_POST[ 'yikes-easy-mc-form-login-required' ] ) ) ? '1' : '0', |
|
2651 | + 'yikes-easy-mc-form-restriction-login-message' => trim( $_POST[ 'yikes-easy-mc-form-restriction-login-message' ] ), |
|
2652 | 2652 | ); |
2653 | 2653 | |
2654 | 2654 | // additional custom fields (extensions / user defined fields) |
2655 | 2655 | $custom_fields = array(); |
2656 | - if ( isset( $_POST['custom-field'] ) ) { |
|
2657 | - foreach ( $_POST['custom-field'] as $custom_field => $custom_value ) { |
|
2656 | + if ( isset( $_POST[ 'custom-field' ] ) ) { |
|
2657 | + foreach ( $_POST[ 'custom-field' ] as $custom_field => $custom_value ) { |
|
2658 | 2658 | if ( is_array( $custom_value ) ) { |
2659 | 2659 | $custom_fields[ $custom_field ] = array_filter( stripslashes_deep( $custom_value ) ); // array_filters to remove empty items (don't save them!) |
2660 | 2660 | } else { |
@@ -2685,7 +2685,7 @@ discard block |
||
2685 | 2685 | $this->form_interface->update_form( $form_id, $form_updates ); |
2686 | 2686 | |
2687 | 2687 | /* Custom action hook which allows users to update specific options when a form is updated - used in add ons */ |
2688 | - do_action( 'yikes-mailchimp-save-form', $form_id, $custom_fields ); |
|
2688 | + do_action( 'yikes-mailchimp-save-form', $form_id, $custom_fields ); |
|
2689 | 2689 | |
2690 | 2690 | // redirect the user to the manage forms page, display confirmation |
2691 | 2691 | wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-edit-form&id=' . $form_id . '&updated-form=true' ) ) ); |
@@ -2694,13 +2694,13 @@ discard block |
||
2694 | 2694 | |
2695 | 2695 | /* Unsubscribe a given user from our list */ |
2696 | 2696 | public function yikes_easy_mailchimp_unsubscribe_user() { |
2697 | - $nonce = $_REQUEST['nonce']; |
|
2698 | - $list_id = $_REQUEST['mailchimp-list']; |
|
2699 | - $email_id = $_REQUEST['email_id']; |
|
2697 | + $nonce = $_REQUEST[ 'nonce' ]; |
|
2698 | + $list_id = $_REQUEST[ 'mailchimp-list' ]; |
|
2699 | + $email_id = $_REQUEST[ 'email_id' ]; |
|
2700 | 2700 | |
2701 | 2701 | // verify our nonce |
2702 | - if( ! wp_verify_nonce( $nonce, 'unsubscribe-user-' . $email_id ) ) { |
|
2703 | - wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) , __( "Failed nonce validation" , 'yikes-inc-easy-mailchimp-extender' ) , array( 'response' => 500 , 'back_link' => true ) ); |
|
2702 | + if ( ! wp_verify_nonce( $nonce, 'unsubscribe-user-' . $email_id ) ) { |
|
2703 | + wp_die( __( "We've run into an error. The security check didn't pass. Please try again.", 'yikes-inc-easy-mailchimp-extender' ), __( "Failed nonce validation", 'yikes-inc-easy-mailchimp-extender' ), array( 'response' => 500, 'back_link' => true ) ); |
|
2704 | 2704 | } |
2705 | 2705 | |
2706 | 2706 | $response = yikes_get_mc_api_manager()->get_list_handler()->member_unsubscribe( $list_id, $email_id ); |
@@ -2719,21 +2719,21 @@ discard block |
||
2719 | 2719 | |
2720 | 2720 | public function yikes_easy_mailchimp_create_missing_error_log() { |
2721 | 2721 | // grab our nonnce |
2722 | - $nonce = $_REQUEST['nonce']; |
|
2722 | + $nonce = $_REQUEST[ 'nonce' ]; |
|
2723 | 2723 | // validate nonce |
2724 | - if( !wp_verify_nonce( $nonce, 'create_error_log' ) ) { |
|
2725 | - wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) , __( "Failed nonce validation" , 'yikes-inc-easy-mailchimp-extender' ) , array( 'response' => 500 , 'back_link' => true ) ); |
|
2724 | + if ( ! wp_verify_nonce( $nonce, 'create_error_log' ) ) { |
|
2725 | + wp_die( __( "We've run into an error. The security check didn't pass. Please try again.", 'yikes-inc-easy-mailchimp-extender' ), __( "Failed nonce validation", 'yikes-inc-easy-mailchimp-extender' ), array( 'response' => 500, 'back_link' => true ) ); |
|
2726 | 2726 | } |
2727 | 2727 | // setup the path to the error log |
2728 | - $error_log = fopen( plugin_dir_path( __FILE__ ) . '../includes/error_log/yikes-easy-mailchimp-error-log.php' , 'w' ); |
|
2728 | + $error_log = fopen( plugin_dir_path( __FILE__ ) . '../includes/error_log/yikes-easy-mailchimp-error-log.php', 'w' ); |
|
2729 | 2729 | try { |
2730 | 2730 | // create the file |
2731 | - fwrite( $error_log , '' ); |
|
2731 | + fwrite( $error_log, '' ); |
|
2732 | 2732 | // close out |
2733 | 2733 | fclose( $error_log ); |
2734 | 2734 | wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings§ion=debug-settings&error_log_created=true' ) ) ); |
2735 | 2735 | } catch ( Exception $e ) { |
2736 | - wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings§ion=debug-settings&error_log_created=false&error_message='.urlencode( $e->getMessage() ) ) ) ); |
|
2736 | + wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings§ion=debug-settings&error_log_created=false&error_message=' . urlencode( $e->getMessage() ) ) ) ); |
|
2737 | 2737 | } |
2738 | 2738 | } |
2739 | 2739 | |
@@ -2744,9 +2744,9 @@ discard block |
||
2744 | 2744 | public function yikes_easy_mailchimp_clear_transient_data() { |
2745 | 2745 | |
2746 | 2746 | // verify our nonce |
2747 | - $nonce = $_REQUEST['nonce']; |
|
2748 | - if( ! wp_verify_nonce( $nonce, 'clear-mc-transient-data' ) ) { |
|
2749 | - wp_die( __( "We've run into an error. The security check didn't pass. Please try again." , 'yikes-inc-easy-mailchimp-extender' ) , __( "Failed nonce validation" , 'yikes-inc-easy-mailchimp-extender' ) , array( 'response' => 500 , 'back_link' => true ) ); |
|
2747 | + $nonce = $_REQUEST[ 'nonce' ]; |
|
2748 | + if ( ! wp_verify_nonce( $nonce, 'clear-mc-transient-data' ) ) { |
|
2749 | + wp_die( __( "We've run into an error. The security check didn't pass. Please try again.", 'yikes-inc-easy-mailchimp-extender' ), __( "Failed nonce validation", 'yikes-inc-easy-mailchimp-extender' ), array( 'response' => 500, 'back_link' => true ) ); |
|
2750 | 2750 | } |
2751 | 2751 | |
2752 | 2752 | // delete all of the list_id transients |
@@ -2809,7 +2809,7 @@ discard block |
||
2809 | 2809 | */ |
2810 | 2810 | public function yikes_mailchimp_load_helper_class() { |
2811 | 2811 | // check to see if it's already loaded up |
2812 | - if( !class_exists( 'Yikes_Inc_Easy_Mailchimp_Forms_Helper' ) ) { |
|
2812 | + if ( ! class_exists( 'Yikes_Inc_Easy_Mailchimp_Forms_Helper' ) ) { |
|
2813 | 2813 | // Include our main helper class file |
2814 | 2814 | include_once( YIKES_MC_PATH . 'admin/partials/helpers/init.php' ); |
2815 | 2815 | } |
@@ -2886,7 +2886,7 @@ discard block |
||
2886 | 2886 | * @since 6.0.4 |
2887 | 2887 | */ |
2888 | 2888 | public function check_yikes_mc_table_version() { |
2889 | - if( get_option( 'yikes_mc_database_version', '0.00' ) < '1.0' ) { |
|
2889 | + if ( get_option( 'yikes_mc_database_version', '0.00' ) < '1.0' ) { |
|
2890 | 2890 | require_once YIKES_MC_PATH . 'includes/class-yikes-inc-easy-mailchimp-extender-activator.php'; |
2891 | 2891 | global $wpdb; |
2892 | 2892 | Yikes_Inc_Easy_Mailchimp_Extender_Activator::_activate_yikes_easy_mailchimp( $wpdb ); |
@@ -41,7 +41,7 @@ |
||
41 | 41 | * @param array $anonymous_data |
42 | 42 | * @param int $user_id |
43 | 43 | * @param string $trigger |
44 | - * @return boolean |
|
44 | + * @return boolean|null |
|
45 | 45 | */ |
46 | 46 | public function subscribe_from_bbpress( $anonymous_data, $user_id, $trigger ) { |
47 | 47 | $user_data = get_userdata( $user_id ); |
@@ -27,8 +27,8 @@ |
||
27 | 27 | |
28 | 28 | |
29 | 29 | /** |
30 | - * Outputs a checkbox |
|
31 | - */ |
|
30 | + * Outputs a checkbox |
|
31 | + */ |
|
32 | 32 | public function output_checkbox() { |
33 | 33 | if( $this->is_user_already_subscribed( $this->type ) == '1' ) { |
34 | 34 | return; |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | */ |
7 | 7 | |
8 | 8 | // Prevent direct access to the file |
9 | - defined('ABSPATH') or die( __( "Whoops, you shouldn't be accessing this file directly. Abort!" , 'yikes-inc-easy-mailchimp-extender' ) ); |
|
9 | + defined( 'ABSPATH' ) or die( __( "Whoops, you shouldn't be accessing this file directly. Abort!", 'yikes-inc-easy-mailchimp-extender' ) ); |
|
10 | 10 | |
11 | 11 | class Yikes_Easy_MC_bbPress_Checkbox_Class extends Yikes_Easy_MC_Checkbox_Integration_Class { |
12 | 12 | |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | */ |
46 | 46 | public function subscribe_from_bbpress( $anonymous_data, $user_id, $trigger ) { |
47 | 47 | $user_data = get_userdata( $user_id ); |
48 | - return $this->subscribe_user_integration( $user_data->user_email, $this->type , array( |
|
48 | + return $this->subscribe_user_integration( $user_data->user_email, $this->type, array( |
|
49 | 49 | 'FNAME' => $user_data->first_name, |
50 | 50 | 'LNAME' => $user_data->last_name, |
51 | 51 | 'NAE' => $user_data->first_name, |
@@ -40,7 +40,6 @@ |
||
40 | 40 | * @param string $user_login |
41 | 41 | * @param string $user_password |
42 | 42 | * @param string $user_email |
43 | - * @param array $usermeta |
|
44 | 43 | */ |
45 | 44 | public function subscribe_from_buddypress_form( $user_id, $user_login, $user_password, $user_email ) { |
46 | 45 | if ( $this->was_checkbox_checked( $this->type ) === false ) { |
@@ -18,8 +18,8 @@ |
||
18 | 18 | } |
19 | 19 | |
20 | 20 | /** |
21 | - * Outputs a checkbox, if user is not already subscribed |
|
22 | - */ |
|
21 | + * Outputs a checkbox, if user is not already subscribed |
|
22 | + */ |
|
23 | 23 | public function output_checkbox() { |
24 | 24 | if( $this->is_user_already_subscribed( $this->type ) == '1' ) { |
25 | 25 | return; |
@@ -6,7 +6,7 @@ |
||
6 | 6 | */ |
7 | 7 | |
8 | 8 | // Prevent direct access to the file |
9 | - defined('ABSPATH') or die( __( "Whoops, you shouldn't be accessing this file directly. Abort!" , 'yikes-inc-easy-mailchimp-extender' ) ); |
|
9 | + defined( 'ABSPATH' ) or die( __( "Whoops, you shouldn't be accessing this file directly. Abort!", 'yikes-inc-easy-mailchimp-extender' ) ); |
|
10 | 10 | |
11 | 11 | class Yikes_Easy_MC_BuddyPress_Checkbox_Class extends Yikes_Easy_MC_Checkbox_Integration_Class { |
12 | 12 |
@@ -41,7 +41,6 @@ discard block |
||
41 | 41 | |
42 | 42 | |
43 | 43 | /** |
44 | - * @param array $meta |
|
45 | 44 | * |
46 | 45 | * @return array |
47 | 46 | */ |
@@ -57,7 +56,7 @@ discard block |
||
57 | 56 | /** |
58 | 57 | * @param int $payment_id The ID of the payment |
59 | 58 | * |
60 | - * @return bool|string |
|
59 | + * @return false|null |
|
61 | 60 | */ |
62 | 61 | public function subscribe_from_edd_purchase( $payment_id ) { |
63 | 62 | $meta = get_post_meta( $payment_id , '_yikes_easy_mc_optin' , true ); |
@@ -27,8 +27,8 @@ |
||
27 | 27 | |
28 | 28 | |
29 | 29 | /** |
30 | - * Outputs a checkbox |
|
31 | - */ |
|
30 | + * Outputs a checkbox |
|
31 | + */ |
|
32 | 32 | public function output_checkbox() { |
33 | 33 | if( $this->is_user_already_subscribed( $this->type ) == '1' ) { |
34 | 34 | return; |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | */ |
8 | 8 | |
9 | 9 | // Prevent direct access to the file |
10 | - defined('ABSPATH') or die( __( "Whoops, you shouldn't be accessing this file directly. Abort!" , 'yikes-inc-easy-mailchimp-extender' ) ); |
|
10 | + defined( 'ABSPATH' ) or die( __( "Whoops, you shouldn't be accessing this file directly. Abort!", 'yikes-inc-easy-mailchimp-extender' ) ); |
|
11 | 11 | |
12 | 12 | class Yikes_Easy_MC_EDD_Checkbox_Class extends Yikes_Easy_MC_Checkbox_Integration_Class { |
13 | 13 | |
@@ -21,8 +21,8 @@ discard block |
||
21 | 21 | */ |
22 | 22 | public function __construct() { |
23 | 23 | add_action( 'edd_purchase_form_user_info_fields', array( $this, 'output_checkbox' ) ); |
24 | - add_action( 'edd_insert_payment', array( $this, 'update_payment_post_meta' ) , 99999 ); |
|
25 | - add_action( 'edd_complete_purchase', array( $this, 'subscribe_from_edd_purchase'), 50 ); |
|
24 | + add_action( 'edd_insert_payment', array( $this, 'update_payment_post_meta' ), 99999 ); |
|
25 | + add_action( 'edd_complete_purchase', array( $this, 'subscribe_from_edd_purchase' ), 50 ); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | */ |
49 | 49 | public function update_payment_post_meta( $payment_id = 0, $payment_data = array() ) { |
50 | 50 | // don't save anything if the checkbox was not checked |
51 | - if( ! $this->was_checkbox_checked( $this->type ) ) { |
|
51 | + if ( ! $this->was_checkbox_checked( $this->type ) ) { |
|
52 | 52 | update_post_meta( $payment_id, '_yikes_easy_mc_optin', '0' ); |
53 | 53 | return; |
54 | 54 | } |
@@ -61,25 +61,25 @@ discard block |
||
61 | 61 | * @return bool|string |
62 | 62 | */ |
63 | 63 | public function subscribe_from_edd_purchase( $payment_id ) { |
64 | - $meta = get_post_meta( $payment_id , '_yikes_easy_mc_optin' , true ); |
|
65 | - if( $meta == '0' ) { |
|
64 | + $meta = get_post_meta( $payment_id, '_yikes_easy_mc_optin', true ); |
|
65 | + if ( $meta == '0' ) { |
|
66 | 66 | return false; |
67 | 67 | } |
68 | 68 | $email = (string) edd_get_payment_user_email( $payment_id ); |
69 | 69 | $merge_vars = array(); |
70 | 70 | // add first and last name to merge vars, if given |
71 | 71 | $user_info = (array) edd_get_payment_meta_user_info( $payment_id ); |
72 | - if( isset( $user_info['first_name'] ) && isset( $user_info['last_name'] ) ) { |
|
73 | - $merge_vars['NAME'] = $user_info['first_name'] . ' ' . $user_info['last_name']; |
|
72 | + if ( isset( $user_info[ 'first_name' ] ) && isset( $user_info[ 'last_name' ] ) ) { |
|
73 | + $merge_vars[ 'NAME' ] = $user_info[ 'first_name' ] . ' ' . $user_info[ 'last_name' ]; |
|
74 | 74 | } |
75 | - if( isset( $user_info['first_name'] ) ) { |
|
76 | - $merge_vars['FNAME'] = $user_info['first_name']; |
|
75 | + if ( isset( $user_info[ 'first_name' ] ) ) { |
|
76 | + $merge_vars[ 'FNAME' ] = $user_info[ 'first_name' ]; |
|
77 | 77 | } |
78 | - if( isset( $user_info['last_name'] ) ) { |
|
79 | - $merge_vars['LNAME'] = $user_info['last_name']; |
|
78 | + if ( isset( $user_info[ 'last_name' ] ) ) { |
|
79 | + $merge_vars[ 'LNAME' ] = $user_info[ 'last_name' ]; |
|
80 | 80 | } |
81 | 81 | // subscribe the user |
82 | - $this->subscribe_user_integration( sanitize_email( $email ) , $this->type , $merge_vars ); |
|
82 | + $this->subscribe_user_integration( sanitize_email( $email ), $this->type, $merge_vars ); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | } |
@@ -8,23 +8,23 @@ |
||
8 | 8 | </tr> |
9 | 9 | <?php |
10 | 10 | $i = 1; |
11 | - foreach( $account_activity as $activity ) { |
|
12 | - if( $i <= 8 ) { |
|
13 | - $message = $activity['message']; |
|
14 | - $split_message = explode( ' - ' , $activity['message'] ); |
|
15 | - $split_list = explode( '"' , $split_message[0] ); |
|
16 | - if( isset( $split_list[1] ) ) { |
|
17 | - if( isset( $activity['list_id'] ) ) { |
|
18 | - $message = $split_list[0] . ' <a href="' . esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-view-list&list-id=' . $activity['list_id'] ) ) . '"><strong>' . $split_list[1] . '</strong></a>'; |
|
11 | + foreach ( $account_activity as $activity ) { |
|
12 | + if ( $i <= 8 ) { |
|
13 | + $message = $activity[ 'message' ]; |
|
14 | + $split_message = explode( ' - ', $activity[ 'message' ] ); |
|
15 | + $split_list = explode( '"', $split_message[ 0 ] ); |
|
16 | + if ( isset( $split_list[ 1 ] ) ) { |
|
17 | + if ( isset( $activity[ 'list_id' ] ) ) { |
|
18 | + $message = $split_list[ 0 ] . ' <a href="' . esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-view-list&list-id=' . $activity[ 'list_id' ] ) ) . '"><strong>' . $split_list[ 1 ] . '</strong></a>'; |
|
19 | 19 | } else { |
20 | - $message = $split_list[0] . ' <strong>' . $split_list[1] . '</strong>'; |
|
20 | + $message = $split_list[ 0 ] . ' <strong>' . $split_list[ 1 ] . '</strong>'; |
|
21 | 21 | } |
22 | 22 | } else { |
23 | - $message = $split_list[0]; |
|
23 | + $message = $split_list[ 0 ]; |
|
24 | 24 | } |
25 | 25 | ?> |
26 | 26 | <tr valign="top"> |
27 | - <td><label for="tablecell"><?php echo ucwords( str_replace( '-' , ' ' , str_replace( 'lists:' , '' , $activity['type'] ) ) ); ?></label></td> |
|
27 | + <td><label for="tablecell"><?php echo ucwords( str_replace( '-', ' ', str_replace( 'lists:', '', $activity[ 'type' ] ) ) ); ?></label></td> |
|
28 | 28 | <td><?php echo $message; ?></td> |
29 | 29 | </tr> |
30 | 30 | <?php |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | |
3 | 3 | <div class="feature-section"> |
4 | 4 | |
5 | - <h2><?php _e( 'All New Form Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?></h2> |
|
5 | + <h2><?php _e( 'All New Form Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></h2> |
|
6 | 6 | |
7 | 7 | <img src="<?php echo YIKES_MC_URL . 'includes/images/Welcome_Page/form-layout-option.jpg'; ?>" alt="<?php _e( 'New Form Settings', 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-easy-mc-feature-image yikes-easy-mc-whats-new-section-image"> |
8 | 8 | |
@@ -26,9 +26,9 @@ discard block |
||
26 | 26 | |
27 | 27 | <div class="feature-section"> |
28 | 28 | |
29 | - <h2><?php _e( 'Translated & Localized' , 'yikes-inc-easy-mailchimp-extender' ); ?></h2> |
|
29 | + <h2><?php _e( 'Translated & Localized', 'yikes-inc-easy-mailchimp-extender' ); ?></h2> |
|
30 | 30 | |
31 | - <p style="float:left;width:55%;max-width:55%;"><?php _e( "YIKES Easy Forms for MailChimp was developed with our international users in mind. Not only will you find the plugin to be i18n ready, but you'll also find our datepickers to be localized for mm/dd/yyyy or dd/mm/yyyy formats. Everything is automatic and gets localized based on the language of your site. It's like magic!", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
31 | + <p style="float:left;width:55%;max-width:55%;"><?php _e( "YIKES Easy Forms for MailChimp was developed with our international users in mind. Not only will you find the plugin to be i18n ready, but you'll also find our datepickers to be localized for mm/dd/yyyy or dd/mm/yyyy formats. Everything is automatic and gets localized based on the language of your site. It's like magic!", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
32 | 32 | |
33 | 33 | <img style="width:40%;max-width:400px;display:block;" src="<?php echo YIKES_MC_URL . 'includes/images/Welcome_Page/arabic-calendar.png'; ?>" alt="<?php _e( 'Localized Arabic Calendar', 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-easy-mc-feature-image yikes-easy-mc-whats-new-section-image"> |
34 | 34 | |
@@ -38,19 +38,19 @@ discard block |
||
38 | 38 | |
39 | 39 | <div class="feature-section"> |
40 | 40 | |
41 | - <h2><?php _e( 'Knowledge Base & GlotPress Support' , 'yikes-inc-easy-mailchimp-extender' ); ?></h2> |
|
41 | + <h2><?php _e( 'Knowledge Base & GlotPress Support', 'yikes-inc-easy-mailchimp-extender' ); ?></h2> |
|
42 | 42 | |
43 | 43 | <img style="float:left;max-width:300px;margin-right:20px;margin-left:0 !important;" src="<?php echo YIKES_MC_URL . 'includes/images/Welcome_Page/glotpress-translation-percentage.png'; ?>" alt="<?php _e( 'GlotPress Localized Precentage', 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-easy-mc-feature-image yikes-easy-mc-whats-new-section-image"> |
44 | 44 | |
45 | - <p><?php _e( "Since the initial release of this Easy Forms for MailChimp by YIKES we've been tirelessly working on putting together a collection of help articles ranging from troubleshooting tips to customization options. We've also included a collection of code snippets from some of our most widely asked questions. Now you can access some of our most popular articles right from within the plugin.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
45 | + <p><?php _e( "Since the initial release of this Easy Forms for MailChimp by YIKES we've been tirelessly working on putting together a collection of help articles ranging from troubleshooting tips to customization options. We've also included a collection of code snippets from some of our most widely asked questions. Now you can access some of our most popular articles right from within the plugin.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
46 | 46 | |
47 | - <p><h4><a href="<?php echo esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-support#knowledge-base-articles' ) ); ?>" title="<?php _e( 'Support | Knowledge Base' , 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'Support → Knowledge Base Articles', 'yikes-inc-easy-mailchimp-extender' ); ?></a></h4></p> |
|
47 | + <p><h4><a href="<?php echo esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-support#knowledge-base-articles' ) ); ?>" title="<?php _e( 'Support | Knowledge Base', 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'Support → Knowledge Base Articles', 'yikes-inc-easy-mailchimp-extender' ); ?></a></h4></p> |
|
48 | 48 | |
49 | 49 | <p> </p> |
50 | 50 | |
51 | 51 | <p><?php _e( "With a ton of help from the WordPress community, we've been able to support 7 international languages. We're always looking for additional translators, so if you are multi-lingual and can help translate things - hop into glotpress and help contribute to future development of this plugin.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
52 | 52 | |
53 | - <p><h4><a href="<?php echo esc_url_raw( 'https://translate.wordpress.org/projects/wp-plugins/yikes-inc-easy-mailchimp-extender' ); ?>" target="_blank"title="<?php _e( 'Easy Forms for MailChimp | GlotPress' , 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'GlotPress', 'yikes-inc-easy-mailchimp-extender' ); ?></a></h4></p> |
|
53 | + <p><h4><a href="<?php echo esc_url_raw( 'https://translate.wordpress.org/projects/wp-plugins/yikes-inc-easy-mailchimp-extender' ); ?>" target="_blank"title="<?php _e( 'Easy Forms for MailChimp | GlotPress', 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'GlotPress', 'yikes-inc-easy-mailchimp-extender' ); ?></a></h4></p> |
|
54 | 54 | |
55 | 55 | |
56 | 56 | </div> |
@@ -59,11 +59,11 @@ discard block |
||
59 | 59 | |
60 | 60 | <div class="feature-section"> |
61 | 61 | |
62 | - <h2><?php _e( 'Intuitive Settings Page' , 'yikes-inc-easy-mailchimp-extender' ); ?></h2> |
|
62 | + <h2><?php _e( 'Intuitive Settings Page', 'yikes-inc-easy-mailchimp-extender' ); ?></h2> |
|
63 | 63 | |
64 | 64 | <img src="<?php echo YIKES_MC_URL . 'includes/images/Welcome_Page/settings-page.png'; ?>" alt="<?php _e( 'Settings Page', 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-easy-mc-feature-image yikes-easy-mc-whats-new-section-image"> |
65 | 65 | |
66 | - <p style="float:left; padding-left:15px;margin-top:5px;"><?php _e( "We've re-laid out the settings page to allow for a more intuitive workflow. All of your settings are neatly tucked away in their respective setting tab.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
66 | + <p style="float:left; padding-left:15px;margin-top:5px;"><?php _e( "We've re-laid out the settings page to allow for a more intuitive workflow. All of your settings are neatly tucked away in their respective setting tab.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
67 | 67 | |
68 | 68 | </div> |
69 | 69 |
@@ -3,8 +3,8 @@ discard block |
||
3 | 3 | if ( false === ( $contributors = get_transient( 'yikes-mailchimp-contributor-transient' ) ) ) { |
4 | 4 | // It wasn't there, so regenerate the data and save the transient |
5 | 5 | $contributors = wp_remote_get( 'https://api.github.com/repos/yikesinc/yikes-inc-easy-mailchimp-extender/contributors?per_page=100', array( 'timeout' => 120 ) ); |
6 | - $contributors = json_decode( $contributors['body'] , true ); |
|
7 | - set_transient( 'yikes-mailchimp-contributor-transient', $contributors, 60*60*12 ); |
|
6 | + $contributors = json_decode( $contributors[ 'body' ], true ); |
|
7 | + set_transient( 'yikes-mailchimp-contributor-transient', $contributors, 60 * 60 * 12 ); |
|
8 | 8 | } |
9 | 9 | // get the YIKES Inc. MailChimp translators via the Github API |
10 | 10 | if ( false === ( $translators = get_transient( 'yikes-mailchimp-translators-transient' ) ) ) { |
@@ -19,20 +19,20 @@ discard block |
||
19 | 19 | ); |
20 | 20 | // create an empty array to store with translator data to loop over |
21 | 21 | $translators = array(); |
22 | - foreach( $translator_usernames as $username => $language ) { |
|
22 | + foreach ( $translator_usernames as $username => $language ) { |
|
23 | 23 | $translator_data = wp_remote_get( 'https://api.github.com/users/' . $username, array( 'timeout' => 120 ) ); |
24 | 24 | // if( $translator_data['status'] == 200 ) { |
25 | - $translators_data_decoded = json_decode( $translator_data['body'] , true ); |
|
26 | - $translators[] = array( |
|
27 | - 'login' => $translators_data_decoded['login'], |
|
28 | - 'avatar_url' => $translators_data_decoded['avatar_url'], |
|
29 | - 'html_url' => $translators_data_decoded['html_url'], |
|
30 | - 'name' => $translators_data_decoded['name'], |
|
25 | + $translators_data_decoded = json_decode( $translator_data[ 'body' ], true ); |
|
26 | + $translators[ ] = array( |
|
27 | + 'login' => $translators_data_decoded[ 'login' ], |
|
28 | + 'avatar_url' => $translators_data_decoded[ 'avatar_url' ], |
|
29 | + 'html_url' => $translators_data_decoded[ 'html_url' ], |
|
30 | + 'name' => $translators_data_decoded[ 'name' ], |
|
31 | 31 | 'translation_language' => $language, |
32 | 32 | ); |
33 | 33 | // } |
34 | 34 | } |
35 | - set_transient( 'yikes-mailchimp-translators-transient', $translators, 60*60*12 ); |
|
35 | + set_transient( 'yikes-mailchimp-translators-transient', $translators, 60 * 60 * 12 ); |
|
36 | 36 | } |
37 | 37 | ?> |
38 | 38 | <div class="wrap about-wrap"> |
@@ -46,17 +46,17 @@ discard block |
||
46 | 46 | <div id="credit-container"> |
47 | 47 | <h2><?php _e( 'Developers', 'yikes-inc-easy-mailchimp-extender' ); ?></h2> |
48 | 48 | <?php |
49 | - if( ! empty( $contributors ) ) { |
|
50 | - $old_contributors = array( 'seriouslysean' , 'Apfelbiss', 'hiwhatsup', 'mialevesque' ); |
|
51 | - foreach( $contributors as $contributor ) { |
|
49 | + if ( ! empty( $contributors ) ) { |
|
50 | + $old_contributors = array( 'seriouslysean', 'Apfelbiss', 'hiwhatsup', 'mialevesque' ); |
|
51 | + foreach ( $contributors as $contributor ) { |
|
52 | 52 | // skip contributors from our old plugin (this is a new re-write) |
53 | - if( ! in_array( $contributor['login'] , $old_contributors ) ) { |
|
53 | + if ( ! in_array( $contributor[ 'login' ], $old_contributors ) ) { |
|
54 | 54 | ?> |
55 | - <a href="<?php echo esc_url_raw( $contributor['html_url'] ); ?>" title="<?php echo $contributor['login']; ?>" target="_blank" class="github-avatar-url"> |
|
55 | + <a href="<?php echo esc_url_raw( $contributor[ 'html_url' ] ); ?>" title="<?php echo $contributor[ 'login' ]; ?>" target="_blank" class="github-avatar-url"> |
|
56 | 56 | <div class="team-member"> |
57 | - <img src="<?php echo esc_url_raw( $contributor['avatar_url'] ); ?>" class="github-avatar-image"> |
|
57 | + <img src="<?php echo esc_url_raw( $contributor[ 'avatar_url' ] ); ?>" class="github-avatar-image"> |
|
58 | 58 | <p class="member-blurb"> |
59 | - <p><strong><?php echo $contributor['login']; ?></strong></p> |
|
59 | + <p><strong><?php echo $contributor[ 'login' ]; ?></strong></p> |
|
60 | 60 | </p> |
61 | 61 | </div> |
62 | 62 | </a> |
@@ -65,24 +65,24 @@ discard block |
||
65 | 65 | } |
66 | 66 | } else { |
67 | 67 | ?> |
68 | - <h4><?php _e( 'There was an error retrieving the contributors list. Please try again later.' , 'yikes-inc-easy-mailchimp-extender' ); ?></h4> |
|
68 | + <h4><?php _e( 'There was an error retrieving the contributors list. Please try again later.', 'yikes-inc-easy-mailchimp-extender' ); ?></h4> |
|
69 | 69 | <?php |
70 | 70 | } |
71 | 71 | ?> |
72 | 72 | </div> |
73 | 73 | |
74 | - <?php if( ! empty( $translators ) ) { ?> |
|
74 | + <?php if ( ! empty( $translators ) ) { ?> |
|
75 | 75 | <div id="translators-container"> |
76 | 76 | <h2><?php _e( 'Translators', 'yikes-inc-easy-mailchimp-extender' ); ?></h2> |
77 | 77 | <?php |
78 | - foreach( $translators as $translator ) { |
|
78 | + foreach ( $translators as $translator ) { |
|
79 | 79 | ?> |
80 | - <a href="<?php echo esc_url_raw( $translator['html_url'] ); ?>" title="<?php echo $translator['name']; ?>" target="_blank" class="github-avatar-url"> |
|
80 | + <a href="<?php echo esc_url_raw( $translator[ 'html_url' ] ); ?>" title="<?php echo $translator[ 'name' ]; ?>" target="_blank" class="github-avatar-url"> |
|
81 | 81 | <div class="translator"> |
82 | - <img src="<?php echo esc_url_raw( $translator['avatar_url'] ); ?>" class="github-avatar-image"> |
|
82 | + <img src="<?php echo esc_url_raw( $translator[ 'avatar_url' ] ); ?>" class="github-avatar-image"> |
|
83 | 83 | <p class="member-blurb"> |
84 | - <p><strong><?php echo $translator['login']; ?></strong></p> |
|
85 | - <em class="translation-language"><?php echo $translator['translation_language']; ?></em> |
|
84 | + <p><strong><?php echo $translator[ 'login' ]; ?></strong></p> |
|
85 | + <em class="translation-language"><?php echo $translator[ 'translation_language' ]; ?></em> |
|
86 | 86 | </p> |
87 | 87 | </div> |
88 | 88 | </a> |
@@ -1,24 +1,24 @@ discard block |
||
1 | -<?php if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) == 'invalid_api_key' ) { ?> |
|
1 | +<?php if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) == 'invalid_api_key' ) { ?> |
|
2 | 2 | <div class="about-description"> |
3 | - <?php printf( __( "Before you can create any opt-in forms, you'll first need to enter your MailChimp API key into the <a href='%s' title='Yikes Easy MailChimp Settings'>settings page</a>" , 'yikes-inc-easy-mailchimp-extender' ), esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings§ion=general-settings' ) ) ); ?> |
|
3 | + <?php printf( __( "Before you can create any opt-in forms, you'll first need to enter your MailChimp API key into the <a href='%s' title='Yikes Easy MailChimp Settings'>settings page</a>", 'yikes-inc-easy-mailchimp-extender' ), esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings§ion=general-settings' ) ) ); ?> |
|
4 | 4 | </div> |
5 | 5 | <?php } ?> |
6 | 6 | |
7 | 7 | <div class="changelog"> |
8 | 8 | |
9 | - <h3><?php _e( 'Creating Your First Opt-In Form' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
9 | + <h3><?php _e( 'Creating Your First Opt-In Form', 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
10 | 10 | |
11 | 11 | <div class="feature-section"> |
12 | 12 | |
13 | 13 | <img src="<?php echo YIKES_MC_URL . 'includes/images/Welcome_Page/create-first-optin-form.jpg'; ?>" alt="<?php _e( 'Create first optin form screenshot', 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-easy-mc-feature-image"> |
14 | 14 | |
15 | - <h4><a href="<?php echo esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ); ?>" title="<?php _e( 'Manage Forms' , 'yikes-inc-easy-mailchimp-extender' ); ?>">Easy MailChimp → <?php _e( 'Forms', 'yikes-inc-easy-mailchimp-extender' ); ?></a></h4> |
|
16 | - <p><?php _e( "Before you can start collecting users email addresses and building your mailing list, you'll need to create your first form. You can create as many forms as you'd like and assign each form to the same or different mailing lists.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
15 | + <h4><a href="<?php echo esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ); ?>" title="<?php _e( 'Manage Forms', 'yikes-inc-easy-mailchimp-extender' ); ?>">Easy MailChimp → <?php _e( 'Forms', 'yikes-inc-easy-mailchimp-extender' ); ?></a></h4> |
|
16 | + <p><?php _e( "Before you can start collecting users email addresses and building your mailing list, you'll need to create your first form. You can create as many forms as you'd like and assign each form to the same or different mailing lists.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
17 | 17 | |
18 | 18 | <p> </p> |
19 | 19 | |
20 | - <h4><?php _e( 'Additional Options' , 'yikes-inc-easy-mailchimp-extender' ); ?></h4> |
|
21 | - <p><?php _e( "Once you create a form, you can choose which fields you want to add to it and customize the success and error messages returned by MailChimp.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
20 | + <h4><?php _e( 'Additional Options', 'yikes-inc-easy-mailchimp-extender' ); ?></h4> |
|
21 | + <p><?php _e( "Once you create a form, you can choose which fields you want to add to it and customize the success and error messages returned by MailChimp.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
22 | 22 | |
23 | 23 | </div> |
24 | 24 | |
@@ -26,41 +26,41 @@ discard block |
||
26 | 26 | |
27 | 27 | <img src="<?php echo YIKES_MC_URL . 'includes/images/Welcome_Page/optin-settings.png'; ?>" alt="<?php _e( 'Optin settings screenshot', 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-easy-mc-feature-image yikes-easy-mc-feature-image-left"> |
28 | 28 | |
29 | - <h4><?php _e( 'Customize the Form' , 'yikes-inc-easy-mailchimp-extender' ); ?></h4> |
|
30 | - <p><?php _e( "Once created, you can customize the form. This includes editing the success and error messages displayed to the user, choosing which fields or interest groups are displayed, adding CSS classes to fields, assigning default values amp; placeholders and tons more!", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
29 | + <h4><?php _e( 'Customize the Form', 'yikes-inc-easy-mailchimp-extender' ); ?></h4> |
|
30 | + <p><?php _e( "Once created, you can customize the form. This includes editing the success and error messages displayed to the user, choosing which fields or interest groups are displayed, adding CSS classes to fields, assigning default values amp; placeholders and tons more!", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
31 | 31 | |
32 | 32 | <p> </p> |
33 | 33 | |
34 | - <p><?php _e( "Quickly and easily switch which list the form is associated with, toggle single or double optin, whether the welcome email should be sent, toggle AJAX form submissions and more. Get customizing!", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
34 | + <p><?php _e( "Quickly and easily switch which list the form is associated with, toggle single or double optin, whether the welcome email should be sent, toggle AJAX form submissions and more. Get customizing!", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
35 | 35 | </div> |
36 | 36 | <div class="feature-section"> |
37 | 37 | |
38 | 38 | <img src="<?php echo YIKES_MC_URL . 'includes/images/Welcome_Page/add-field-to-page.png'; ?>" alt="<?php _e( 'Add field to form screenshot', 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-easy-mc-feature-image"> |
39 | 39 | |
40 | - <h4><?php _e( 'Add Form to Page/Post' , 'yikes-inc-easy-mailchimp-extender' ); ?></h4> |
|
41 | - <p><?php _e( "When you're ready to add your MailChimp opt-in form to a page or post, you can click on the small MailChimp button in the content editor toolbar.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
40 | + <h4><?php _e( 'Add Form to Page/Post', 'yikes-inc-easy-mailchimp-extender' ); ?></h4> |
|
41 | + <p><?php _e( "When you're ready to add your MailChimp opt-in form to a page or post, you can click on the small MailChimp button in the content editor toolbar.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
42 | 42 | |
43 | 43 | <p> </p> |
44 | 44 | |
45 | - <h4><?php _e( 'Add Form to Widget' , 'yikes-inc-easy-mailchimp-extender' ); ?></h4> |
|
46 | - <p><?php _e( "We've created a MailChimp widget to easily add forms to any sidebar or widgetized area on your site. The widget allows you to select from any created forms.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
45 | + <h4><?php _e( 'Add Form to Widget', 'yikes-inc-easy-mailchimp-extender' ); ?></h4> |
|
46 | + <p><?php _e( "We've created a MailChimp widget to easily add forms to any sidebar or widgetized area on your site. The widget allows you to select from any created forms.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
47 | 47 | </div> |
48 | 48 | |
49 | 49 | <div class="feature-section"> |
50 | - <h3><span class="dashicons dashicons-format-status need-support-icon"></span> <?php _e( "Need Support?" , 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
50 | + <h3><span class="dashicons dashicons-format-status need-support-icon"></span> <?php _e( "Need Support?", 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
51 | 51 | |
52 | - <h4><?php _e( 'Free Support' , 'yikes-inc-easy-mailchimp-extender' ); ?></h4> |
|
53 | - <p><?php _e( "If you need help using the free version of the plugin, you can post support inquiries to one of two locations.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
52 | + <h4><?php _e( 'Free Support', 'yikes-inc-easy-mailchimp-extender' ); ?></h4> |
|
53 | + <p><?php _e( "If you need help using the free version of the plugin, you can post support inquiries to one of two locations.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
54 | 54 | <ul class="support-option-list"> |
55 | - <li class="support-option support-option-first"><a href="https://wordpress.org/plugins/yikes-inc-easy-mailchimp-extender/" title="<?php esc_attr_e( 'WordPress Plugin Directory' , 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'WordPress Plugin Directory' , 'yikes-inc-easy-mailchimp-extender' ); ?></a></li> |
|
56 | - <li class="support-option support-option-second"><a href="https://github.com/yikesinc/yikes-inc-easy-mailchimp-extender/issues" target="_blank" title="<?php esc_attr_e( 'GitHub Issue Tracker' , 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'GitHub Issue Tracker' , 'yikes-inc-easy-mailchimp-extender' ); ?></a></li> |
|
55 | + <li class="support-option support-option-first"><a href="https://wordpress.org/plugins/yikes-inc-easy-mailchimp-extender/" title="<?php esc_attr_e( 'WordPress Plugin Directory', 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'WordPress Plugin Directory', 'yikes-inc-easy-mailchimp-extender' ); ?></a></li> |
|
56 | + <li class="support-option support-option-second"><a href="https://github.com/yikesinc/yikes-inc-easy-mailchimp-extender/issues" target="_blank" title="<?php esc_attr_e( 'GitHub Issue Tracker', 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'GitHub Issue Tracker', 'yikes-inc-easy-mailchimp-extender' ); ?></a></li> |
|
57 | 57 | </ul> |
58 | 58 | |
59 | - <h4><?php _e( 'Priority Support' , 'yikes-inc-easy-mailchimp-extender' ); ?></h4> |
|
60 | - <p><?php _e( "If you want immediate support, please consider purchasing an add-on or developer License. Not only will you get 1 full year of automatic updates and priority support, you will enjoy the tons of features packed into our add-ons that are not available in the free version." , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
59 | + <h4><?php _e( 'Priority Support', 'yikes-inc-easy-mailchimp-extender' ); ?></h4> |
|
60 | + <p><?php _e( "If you want immediate support, please consider purchasing an add-on or developer License. Not only will you get 1 full year of automatic updates and priority support, you will enjoy the tons of features packed into our add-ons that are not available in the free version.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
61 | 61 | |
62 | - <h4><?php _e( 'Knowledge Base' , 'yikes-inc-easy-mailchimp-extender' ); ?></h4> |
|
63 | - <p><?php printf( __( 'For plugin documentation, visit our <a href="%s" title="Knowledge Base" target="_blank">knowledge base</a>.' , 'yikes-inc-easy-mailchimp-extender' ), esc_url_raw( 'https://yikesplugins.com/support/knowledge-base/product/easy-forms-for-mailchimp/' ) ); ?> |
|
62 | + <h4><?php _e( 'Knowledge Base', 'yikes-inc-easy-mailchimp-extender' ); ?></h4> |
|
63 | + <p><?php printf( __( 'For plugin documentation, visit our <a href="%s" title="Knowledge Base" target="_blank">knowledge base</a>.', 'yikes-inc-easy-mailchimp-extender' ), esc_url_raw( 'https://yikesplugins.com/support/knowledge-base/product/easy-forms-for-mailchimp/' ) ); ?> |
|
64 | 64 | |
65 | 65 | </div> |
66 | 66 |
@@ -7,22 +7,22 @@ discard block |
||
7 | 7 | * @return void |
8 | 8 | */ |
9 | 9 | function yikes_easy_mc_welcome_tabs() { |
10 | - $section = isset( $_GET['section'] ) ? $_GET['section'] : 'getting-started'; |
|
10 | + $section = isset( $_GET[ 'section' ] ) ? $_GET[ 'section' ] : 'getting-started'; |
|
11 | 11 | ?> |
12 | 12 | <h2 class="nav-tab-wrapper welcome-page-tabs"> |
13 | - <a class="nav-tab <?php echo $section == 'getting-started' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url_raw( admin_url( add_query_arg( array( 'page' => 'yikes-mailchimp-welcome' , 'section' => 'getting-started' ), 'admin.php' ) ) ); ?>"> |
|
13 | + <a class="nav-tab <?php echo $section == 'getting-started' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url_raw( admin_url( add_query_arg( array( 'page' => 'yikes-mailchimp-welcome', 'section' => 'getting-started' ), 'admin.php' ) ) ); ?>"> |
|
14 | 14 | <span class="dashicons dashicons-admin-home"></span> <?php _e( 'Getting Started', 'yikes-inc-easy-mailchimp-extender' ); ?> |
15 | 15 | </a> |
16 | - <a class="nav-tab <?php echo $section == 'whats-new' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url_raw( admin_url( add_query_arg( array( 'page' => 'yikes-mailchimp-welcome' , 'section' => 'whats-new' ), 'admin.php' ) ) ); ?>"> |
|
16 | + <a class="nav-tab <?php echo $section == 'whats-new' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url_raw( admin_url( add_query_arg( array( 'page' => 'yikes-mailchimp-welcome', 'section' => 'whats-new' ), 'admin.php' ) ) ); ?>"> |
|
17 | 17 | <span class="dashicons dashicons-warning"></span> <?php _e( "What's New", 'yikes-inc-easy-mailchimp-extender' ); ?> |
18 | 18 | </a> |
19 | - <a class="nav-tab <?php echo $section == 'add-ons' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url_raw( admin_url( add_query_arg( array( 'page' => 'yikes-mailchimp-welcome' , 'section' => 'add-ons' ), 'admin.php' ) ) ); ?>"> |
|
19 | + <a class="nav-tab <?php echo $section == 'add-ons' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url_raw( admin_url( add_query_arg( array( 'page' => 'yikes-mailchimp-welcome', 'section' => 'add-ons' ), 'admin.php' ) ) ); ?>"> |
|
20 | 20 | <span class="dashicons dashicons-admin-plugins"></span> <?php _e( "Add-Ons", 'yikes-inc-easy-mailchimp-extender' ); ?> |
21 | 21 | </a> |
22 | - <a class="nav-tab <?php echo $section == 'knowledge-base' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url_raw( admin_url( add_query_arg( array( 'page' => 'yikes-mailchimp-welcome' , 'section' => 'knowledge-base' ), 'admin.php' ) ) ); ?>"> |
|
22 | + <a class="nav-tab <?php echo $section == 'knowledge-base' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url_raw( admin_url( add_query_arg( array( 'page' => 'yikes-mailchimp-welcome', 'section' => 'knowledge-base' ), 'admin.php' ) ) ); ?>"> |
|
23 | 23 | <span class="dashicons dashicons-welcome-learn-more"></span> <?php _e( 'Knowledge Base', 'yikes-inc-easy-mailchimp-extender' ); ?> |
24 | 24 | </a> |
25 | - <a class="nav-tab <?php echo $section == 'credits' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url_raw( admin_url( add_query_arg( array( 'page' => 'yikes-mailchimp-welcome' , 'section' => 'credits' ), 'admin.php' ) ) ); ?>"> |
|
25 | + <a class="nav-tab <?php echo $section == 'credits' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url_raw( admin_url( add_query_arg( array( 'page' => 'yikes-mailchimp-welcome', 'section' => 'credits' ), 'admin.php' ) ) ); ?>"> |
|
26 | 26 | <span class="dashicons dashicons-arrow-left-alt2"></span><?php _e( 'Credits', 'yikes-inc-easy-mailchimp-extender' ); ?><span class="dashicons dashicons-arrow-right-alt2"></span> |
27 | 27 | </a> |
28 | 28 | </h2> |
@@ -30,8 +30,8 @@ discard block |
||
30 | 30 | } |
31 | 31 | |
32 | 32 | function yikes_easy_mc_welcome_body() { |
33 | - $section = isset( $_GET['section'] ) ? $_GET['section'] : 'getting-started'; |
|
34 | - if( isset( $section ) ) { |
|
33 | + $section = isset( $_GET[ 'section' ] ) ? $_GET[ 'section' ] : 'getting-started'; |
|
34 | + if ( isset( $section ) ) { |
|
35 | 35 | include_once( plugin_dir_path( dirname( __FILE__ ) ) . '/welcome-page/welcome-sections/' . $section . '-section.php' ); |
36 | 36 | } |
37 | 37 | } |
@@ -44,17 +44,17 @@ discard block |
||
44 | 44 | <div id="yikes-mailchimp-logo"></div> |
45 | 45 | |
46 | 46 | <h2 class="welcome-title"> |
47 | - Easy Forms for MailChimp by YIKES | <?php echo __( 'MailChimp Done Right' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
47 | + Easy Forms for MailChimp by YIKES | <?php echo __( 'MailChimp Done Right', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
48 | 48 | </h2> |
49 | 49 | |
50 | 50 | <p class="about-text"> |
51 | 51 | <?php |
52 | 52 | // check if this is a fresh install |
53 | - if( get_option( 'yikes_easy_mailchimp_activation_date', strtotime( 'now' ) ) == strtotime( 'now' ) ) { |
|
54 | - echo sprintf( __( 'Welcome to the most powerful MailChimp integration for WordPress. Easy Forms for MailChimp by YIKES v%s is ready to help take your mailing lists to the next level!' , 'yikes-inc-easy-mailchimp-extender' ) , $this->version ); |
|
53 | + if ( get_option( 'yikes_easy_mailchimp_activation_date', strtotime( 'now' ) ) == strtotime( 'now' ) ) { |
|
54 | + echo sprintf( __( 'Welcome to the most powerful MailChimp integration for WordPress. Easy Forms for MailChimp by YIKES v%s is ready to help take your mailing lists to the next level!', 'yikes-inc-easy-mailchimp-extender' ), $this->version ); |
|
55 | 55 | } else { |
56 | 56 | // else thank you for updating :) |
57 | - echo sprintf( __( 'Thank you for updating to the latest version! Easy Forms for MailChimp by YIKES v%s is ready to help take your mailing lists to the next level!' , 'yikes-inc-easy-mailchimp-extender' ) , $this->version ); |
|
57 | + echo sprintf( __( 'Thank you for updating to the latest version! Easy Forms for MailChimp by YIKES v%s is ready to help take your mailing lists to the next level!', 'yikes-inc-easy-mailchimp-extender' ), $this->version ); |
|
58 | 58 | } |
59 | 59 | ?> |
60 | 60 | </p> |