@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | 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 ) ); |
| 290 | 290 | } |
| 291 | 291 | // include the export class |
| 292 | - if( ! class_exists( 'Yikes_Inc_Easy_MailChimp_Export_Class' ) ) { |
|
| 292 | + if( ! class_exists( 'Yikes_Inc_Easy_MailChimp_Export_Class' ) ) { |
|
| 293 | 293 | include_once( YIKES_MC_PATH . 'includes/import-export/yikes-easy-mailchimp-export.class.php' ); |
| 294 | 294 | } |
| 295 | 295 | // run the export function |
@@ -314,7 +314,7 @@ discard block |
||
| 314 | 314 | 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 ) ); |
| 315 | 315 | } |
| 316 | 316 | // include the export class |
| 317 | - if( ! class_exists( 'Yikes_Inc_Easy_MailChimp_Export_Class' ) ) { |
|
| 317 | + if( ! class_exists( 'Yikes_Inc_Easy_MailChimp_Export_Class' ) ) { |
|
| 318 | 318 | include_once( YIKES_MC_PATH . 'includes/import-export/yikes-easy-mailchimp-export.class.php' ); |
| 319 | 319 | } |
| 320 | 320 | // run the export function |
@@ -337,7 +337,7 @@ discard block |
||
| 337 | 337 | 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 ) ); |
| 338 | 338 | } |
| 339 | 339 | // include the export class |
| 340 | - if( ! class_exists( 'Yikes_Inc_Easy_MailChimp_Import_Class' ) ) { |
|
| 340 | + if( ! class_exists( 'Yikes_Inc_Easy_MailChimp_Import_Class' ) ) { |
|
| 341 | 341 | include_once( YIKES_MC_PATH . 'includes/import-export/yikes-easy-mailchimp-import.class.php' ); |
| 342 | 342 | } |
| 343 | 343 | // run the import function |
@@ -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 | |
@@ -456,7 +457,7 @@ discard block |
||
| 456 | 457 | - if it's past 2 weeks we ask the user for a review :) |
| 457 | 458 | @since v6.0.0 |
| 458 | 459 | */ |
| 459 | - public function yikes_easy_mailchimp_check_installation_date() { |
|
| 460 | + public function yikes_easy_mailchimp_check_installation_date() { |
|
| 460 | 461 | |
| 461 | 462 | // add a new option to store the plugin activation date/time |
| 462 | 463 | // @since v6.0.0 |
@@ -482,7 +483,7 @@ discard block |
||
| 482 | 483 | asking for a review, and for user feedback |
| 483 | 484 | @since v6.0.0 |
| 484 | 485 | */ |
| 485 | - public function yikes_easy_mailchimp_display_review_us_notice() { |
|
| 486 | + public function yikes_easy_mailchimp_display_review_us_notice() { |
|
| 486 | 487 | /* Lets only display our admin notice on YT4WP pages to not annoy the hell out of people :) */ |
| 487 | 488 | if ( in_array( get_current_screen()->base , array( 'dashboard' , 'post' , 'edit' ) ) || strpos( get_current_screen()->base ,'yikes-inc-easy-mailchimp') !== false ) { |
| 488 | 489 | // Review URL - Change to the URL of your plugin on WordPress.org |
@@ -534,7 +535,7 @@ discard block |
||
| 534 | 535 | |
| 535 | 536 | /* TinyMCE Functions */ |
| 536 | 537 | // load our button and pass in the JS form data variable |
| 537 | - public function add_tinyMCE_buttons() { |
|
| 538 | + public function add_tinyMCE_buttons() { |
|
| 538 | 539 | global $typenow; |
| 539 | 540 | // only on Post Type: post and page |
| 540 | 541 | if( ! in_array( $typenow, array( 'post', 'page' ) ) ) { |
@@ -545,7 +546,7 @@ discard block |
||
| 545 | 546 | } |
| 546 | 547 | |
| 547 | 548 | // Add the button key for address via JS |
| 548 | - public function yks_mc_add_tinymce_button( $buttons ) { |
|
| 549 | + public function yks_mc_add_tinymce_button( $buttons ) { |
|
| 549 | 550 | array_push( $buttons, 'yks_mc_tinymce_button_key' ); |
| 550 | 551 | // Print all buttons |
| 551 | 552 | return $buttons; |
@@ -573,7 +574,7 @@ discard block |
||
| 573 | 574 | $list_data = $wpdb->get_results( 'SELECT * FROM ' . $wpdb->prefix . 'yikes_easy_mc_forms', ARRAY_A ); |
| 574 | 575 | $lists = array(); |
| 575 | 576 | $i = 0; |
| 576 | - if( !empty( $list_data ) ) { |
|
| 577 | + if( !empty( $list_data ) ) { |
|
| 577 | 578 | // build an array to pass to our javascript |
| 578 | 579 | foreach( $list_data as $form ) { |
| 579 | 580 | $lists[$i] = array( |
@@ -621,7 +622,7 @@ discard block |
||
| 621 | 622 | /* If the user had this plugin activated prior to today, redirect to 'Whats New' */ |
| 622 | 623 | if( get_option( 'yikes_easy_mailchimp_activation_date', strtotime( 'now' ) ) == strtotime( 'now' ) ) { |
| 623 | 624 | wp_redirect( esc_url( admin_url( 'admin.php?page=yikes-mailchimp-welcome' ) ) ); |
| 624 | - } else { |
|
| 625 | + } else { |
|
| 625 | 626 | /* Else redirect the user over to the 'Getting Started' tab */ |
| 626 | 627 | wp_redirect( esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-welcome§ion=whats-new' ) ) ); |
| 627 | 628 | } |
@@ -795,7 +796,7 @@ discard block |
||
| 795 | 796 | * Register our admin pages |
| 796 | 797 | * used to display data back to the user |
| 797 | 798 | **/ |
| 798 | - public function register_admin_pages() { |
|
| 799 | + public function register_admin_pages() { |
|
| 799 | 800 | |
| 800 | 801 | /* Top Level Menu 'Easy MailChimp' */ |
| 801 | 802 | add_menu_page( |
@@ -841,7 +842,7 @@ discard block |
||
| 841 | 842 | |
| 842 | 843 | |
| 843 | 844 | /* YIKES Inc. Easy MailChimp Account Overview */ |
| 844 | - if ( get_option('yikes-mc-api-validation') == 'valid_api_key' ) { |
|
| 845 | + if ( get_option('yikes-mc-api-validation') == 'valid_api_key' ) { |
|
| 845 | 846 | /* YIKES Inc. Easy MailChimp Settings */ |
| 846 | 847 | add_submenu_page( |
| 847 | 848 | 'yikes-inc-easy-mailchimp', |
@@ -1024,7 +1025,7 @@ discard block |
||
| 1024 | 1025 | * |
| 1025 | 1026 | * @since v.5.4 |
| 1026 | 1027 | **/ |
| 1027 | - function yikes_easy_mc_settings_init() { |
|
| 1028 | + function yikes_easy_mc_settings_init() { |
|
| 1028 | 1029 | |
| 1029 | 1030 | /* Register General Settings Section */ |
| 1030 | 1031 | |
@@ -1168,7 +1169,7 @@ discard block |
||
| 1168 | 1169 | if( isset( $body['msg'] ) && $body['msg'] == "Everything's Chimpy!" ) { |
| 1169 | 1170 | update_option( 'yikes-mc-api-validation' , 'valid_api_key' ); |
| 1170 | 1171 | } |
| 1171 | - } else { |
|
| 1172 | + } else { |
|
| 1172 | 1173 | require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php'; |
| 1173 | 1174 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
| 1174 | 1175 | $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' ) ); |
@@ -1331,7 +1332,7 @@ discard block |
||
| 1331 | 1332 | $done = $_POST['done_import']; |
| 1332 | 1333 | // Create some starter forms for the user |
| 1333 | 1334 | // based on previously imported lists (to our old version) |
| 1334 | - if( $option_name == 'yikes-mc-lists' ) { |
|
| 1335 | + if( $option_name == 'yikes-mc-lists' ) { |
|
| 1335 | 1336 | global $wpdb; |
| 1336 | 1337 | $option_value = $_POST['option_value']; |
| 1337 | 1338 | $new_options = json_decode( stripslashes_deep( $option_value ) , true ); |
@@ -1726,7 +1727,7 @@ discard block |
||
| 1726 | 1727 | <input type="hidden" name="field[<?php echo $field['merge']; ?>][merge]" value="<?php echo $field['merge']; ?>" /> |
| 1727 | 1728 | <input type="hidden" class="field-<?php echo $field['merge']; ?>-position position-input" name="field[<?php echo $field['merge']; ?>][position]" value="<?php echo $i++; ?>" /> |
| 1728 | 1729 | |
| 1729 | - <?php if ( $field['type'] == 'radio' || $field['type'] == 'dropdown' || $field['type'] == 'select' ) { |
|
| 1730 | + <?php if ( $field['type'] == 'radio' || $field['type'] == 'dropdown' || $field['type'] == 'select' ) { |
|
| 1730 | 1731 | $choices = json_decode( $field['choices'], true ); |
| 1731 | 1732 | ?> |
| 1732 | 1733 | <input type="hidden" name="field[<?php echo $field['merge']; ?>][choices]" value='<?php echo esc_attr( json_encode( $choices ) ); ?>' /> |
@@ -1750,7 +1751,7 @@ discard block |
||
| 1750 | 1751 | </tr> |
| 1751 | 1752 | |
| 1752 | 1753 | <!-- Placeholder Value --> |
| 1753 | - <?php switch( $field['type'] ) { |
|
| 1754 | + <?php switch( $field['type'] ) { |
|
| 1754 | 1755 | |
| 1755 | 1756 | case 'text': |
| 1756 | 1757 | case 'email': |
@@ -1779,7 +1780,7 @@ discard block |
||
| 1779 | 1780 | ?> |
| 1780 | 1781 | |
| 1781 | 1782 | <!-- Default Value --> |
| 1782 | - <?php switch( $field['type'] ) { |
|
| 1783 | + <?php switch( $field['type'] ) { |
|
| 1783 | 1784 | default: |
| 1784 | 1785 | case 'text': |
| 1785 | 1786 | case 'number': |
@@ -1795,7 +1796,7 @@ discard block |
||
| 1795 | 1796 | <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 } ?> /> |
| 1796 | 1797 | <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> |
| 1797 | 1798 | <?php |
| 1798 | - switch( $field['type'] ) { |
|
| 1799 | + switch( $field['type'] ) { |
|
| 1799 | 1800 | case 'text': |
| 1800 | 1801 | ?> |
| 1801 | 1802 | <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> |
@@ -1926,7 +1927,7 @@ discard block |
||
| 1926 | 1927 | <!-- Display Phone/Date Formats back to the user --> |
| 1927 | 1928 | <!-- Phone Format Initial Load --> |
| 1928 | 1929 | <?php |
| 1929 | - switch( $field['type'] ) { |
|
| 1930 | + switch( $field['type'] ) { |
|
| 1930 | 1931 | /* Store the phone format, for properly regex pattern */ |
| 1931 | 1932 | case 'phone': |
| 1932 | 1933 | case 'birthday': |
@@ -1997,7 +1998,8 @@ discard block |
||
| 1997 | 1998 | |
| 1998 | 1999 | |
| 1999 | 2000 | |
| 2000 | - } else { // THIS IS AN INTEREST GROUP! |
|
| 2001 | + } else { |
|
| 2002 | +// THIS IS AN INTEREST GROUP! |
|
| 2001 | 2003 | |
| 2002 | 2004 | ?> |
| 2003 | 2005 | <section class="draggable" id="<?php echo $field['group_id']; ?>"> |
@@ -2028,7 +2030,7 @@ discard block |
||
| 2028 | 2030 | |
| 2029 | 2031 | <table class="form-table form-field-container"> |
| 2030 | 2032 | <!-- Default Value --> |
| 2031 | - <?php switch( $field['type'] ) { |
|
| 2033 | + <?php switch( $field['type'] ) { |
|
| 2032 | 2034 | |
| 2033 | 2035 | default: |
| 2034 | 2036 | case 'radio': |
@@ -2269,7 +2271,7 @@ discard block |
||
| 2269 | 2271 | } |
| 2270 | 2272 | } |
| 2271 | 2273 | } |
| 2272 | - if( !empty( $available_merge_variables['data'][0] ) ) { |
|
| 2274 | + if( !empty( $available_merge_variables['data'][0] ) ) { |
|
| 2273 | 2275 | ?><ul id="available-fields"><?php |
| 2274 | 2276 | foreach( $available_merge_variables['data'][0]['merge_vars'] as $merge_var ) { |
| 2275 | 2277 | if( in_array( $merge_var['tag'] , $fields_assigned_to_form ) ) { |
@@ -2304,7 +2306,7 @@ discard block |
||
| 2304 | 2306 | } |
| 2305 | 2307 | } |
| 2306 | 2308 | } |
| 2307 | - if( !empty( $available_interest_groups) ) { |
|
| 2309 | + if( !empty( $available_interest_groups) ) { |
|
| 2308 | 2310 | ?><ul id="available-interest-groups"><?php |
| 2309 | 2311 | foreach( $available_interest_groups as $interest_group ) { |
| 2310 | 2312 | if( in_array( $interest_group['id'] , $fields_assigned_to_form ) ) { |
@@ -2473,7 +2475,7 @@ discard block |
||
| 2473 | 2475 | // build a data array to duplicate |
| 2474 | 2476 | foreach( $form_data as $id => $value ) { |
| 2475 | 2477 | // skip the ID field this is unique |
| 2476 | - if( $id != 'id' ) { |
|
| 2478 | + if( $id != 'id' ) { |
|
| 2477 | 2479 | // append -Copy- to our new form |
| 2478 | 2480 | if( $id == 'form_name' ) { |
| 2479 | 2481 | $value = $value . ' - Copy -'; |
@@ -2632,9 +2634,9 @@ discard block |
||
| 2632 | 2634 | if( isset( $_POST['custom-field'] ) ) { |
| 2633 | 2635 | $custom_field_array = array(); |
| 2634 | 2636 | foreach( $_POST['custom-field'] as $custom_field => $custom_value ) { |
| 2635 | - if( is_array( $custom_value ) ) { |
|
| 2637 | + if( is_array( $custom_value ) ) { |
|
| 2636 | 2638 | $custom_field_array[$custom_field] = array_filter( stripslashes_deep( $custom_value ) ); // array_filters to remove empty items (don't save them!) |
| 2637 | - } else { |
|
| 2639 | + } else { |
|
| 2638 | 2640 | $custom_field_array[$custom_field] = stripslashes( $custom_value ); |
| 2639 | 2641 | } |
| 2640 | 2642 | } |
@@ -2750,7 +2752,7 @@ discard block |
||
| 2750 | 2752 | } |
| 2751 | 2753 | // setup the path to the error log |
| 2752 | 2754 | $error_log = fopen( plugin_dir_path( __FILE__ ) . '../includes/error_log/yikes-easy-mailchimp-error-log.php' , 'w' ); |
| 2753 | - try { |
|
| 2755 | + try { |
|
| 2754 | 2756 | // create the file |
| 2755 | 2757 | fwrite( $error_log , '' ); |
| 2756 | 2758 | // close out |
@@ -2847,7 +2849,7 @@ discard block |
||
| 2847 | 2849 | */ |
| 2848 | 2850 | public function yikes_mailchimp_load_helper_class() { |
| 2849 | 2851 | // check to see if it's already loaded up |
| 2850 | - if( !class_exists( 'Yikes_Inc_Easy_Mailchimp_Forms_Helper' ) ) { |
|
| 2852 | + if( !class_exists( 'Yikes_Inc_Easy_Mailchimp_Forms_Helper' ) ) { |
|
| 2851 | 2853 | // Include our main helper class file |
| 2852 | 2854 | include_once( YIKES_MC_PATH . 'admin/partials/helpers/init.php' ); |
| 2853 | 2855 | } |
@@ -2954,7 +2956,8 @@ discard block |
||
| 2954 | 2956 | include_once( ABSPATH . WPINC . '/feed.php' ); |
| 2955 | 2957 | $rss = fetch_feed( esc_url( 'http://yikesplugins.com/feed/?post_type=product_ads&genre=easy-forms-for-mailchimp' ) ); |
| 2956 | 2958 | $maxitems = 0; |
| 2957 | - if ( ! is_wp_error( $rss ) ) { // Checks that the object is created correctly |
|
| 2959 | + if ( ! is_wp_error( $rss ) ) { |
|
| 2960 | +// Checks that the object is created correctly |
|
| 2958 | 2961 | // Figure out how many total items there are, but limit it to 1. |
| 2959 | 2962 | $maxitems = $rss->get_item_quantity( 1 ); |
| 2960 | 2963 | // Build an array of all the items, starting with element 0 (first element). |
@@ -2,11 +2,10 @@ discard block |
||
| 2 | 2 | /* |
| 3 | 3 | * Our ajax is processed inside of class.ajax.php |
| 4 | 4 | */ |
| 5 | - class YIKES_Inc_Easy_MailChimp_Dashboard_Widgets |
|
| 6 | - { |
|
| 5 | + class YIKES_Inc_Easy_MailChimp_Dashboard_Widgets { |
|
| 7 | 6 | |
| 8 | 7 | // Construction |
| 9 | - public function __construct() { |
|
| 8 | + public function __construct() { |
|
| 10 | 9 | if( get_option( 'yikes-mc-api-key' , '' ) != '' && get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) == 'valid_api_key' ) { |
| 11 | 10 | // hook in and display our list stats dashboard widget |
| 12 | 11 | add_action( 'wp_dashboard_setup', array( $this , 'yks_mc_add_chimp_chatter_dashboard_widget' ) , 10 ); |
@@ -18,7 +17,8 @@ discard block |
||
| 18 | 17 | |
| 19 | 18 | // enqueue our JS file on the main dashboard page |
| 20 | 19 | function enqueue_dashboard_widget_script( $hook ) { |
| 21 | - if( 'index.php' == $hook ) { // default 'dashboard' page |
|
| 20 | + if( 'index.php' == $hook ) { |
|
| 21 | +// default 'dashboard' page |
|
| 22 | 22 | wp_register_script( 'yikes-easy-mc-dashboard-widget-script' , YIKES_MC_URL . 'admin/js/min/yikes-inc-easy-mailchimp-dashboard-widget.min.js' , array( 'jquery' ) , 'all' , false ); |
| 23 | 23 | $data_array = array( |
| 24 | 24 | 'ajax_url' => esc_url_raw( admin_url( 'admin-ajax.php' ) ), |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true ) |
| 75 | 75 | ) ); |
| 76 | 76 | $list_data = json_decode( wp_remote_retrieve_body( $list_data ), true ); |
| 77 | - if( isset( $list_data['error'] ) ) { |
|
| 77 | + if( isset( $list_data['error'] ) ) { |
|
| 78 | 78 | if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) { |
| 79 | 79 | require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php'; |
| 80 | 80 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | function account_activity_dashboard_widget() { |
| 121 | 121 | // Get our list data! |
| 122 | 122 | // Check for a transient, if not - set one up for one hour |
| 123 | - if ( false === ( $account_activity = get_transient( 'yikes-easy-mailchimp-account-activity' ) ) ) { |
|
| 123 | + if ( false === ( $account_activity = get_transient( 'yikes-easy-mailchimp-account-activity' ) ) ) { |
|
| 124 | 124 | $api_key = trim( get_option( 'yikes-mc-api-key' , '' ) ); |
| 125 | 125 | $dash_position = strpos( $api_key, '-' ); |
| 126 | 126 | if( $dash_position !== false ) { |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true ) |
| 135 | 135 | ) ); |
| 136 | 136 | $account_activity = json_decode( wp_remote_retrieve_body( $account_activity ), true ); |
| 137 | - if( isset( $account_activity['error'] ) ) { |
|
| 137 | + if( isset( $account_activity['error'] ) ) { |
|
| 138 | 138 | if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) { |
| 139 | 139 | require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php'; |
| 140 | 140 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
@@ -7,10 +7,9 @@ discard block |
||
| 7 | 7 | * @since 6.0.0 |
| 8 | 8 | * Author: Yikes Inc. | https://www.yikesinc.com |
| 9 | 9 | */ |
| 10 | - class YIKES_Inc_Easy_MailChimp_Process_Ajax |
|
| 11 | - { |
|
| 10 | + class YIKES_Inc_Easy_MailChimp_Process_Ajax { |
|
| 12 | 11 | |
| 13 | - public function __construct() { |
|
| 12 | + public function __construct() { |
|
| 14 | 13 | // ajax send merge variable to form builder |
| 15 | 14 | add_action( 'wp_ajax_add_field_to_form', array( $this , 'send_field_to_form' ), 10 ); |
| 16 | 15 | // ajax send interest group to form builder |
@@ -74,10 +73,10 @@ discard block |
||
| 74 | 73 | // to allow users to pre-check anything they want to assign users appropriately |
| 75 | 74 | /* note: this function is called statically from the integration settings page */ |
| 76 | 75 | public static function check_list_for_interest_groups( $list_id='', $integration_type='', $load=false ) { |
| 77 | - if( ! $list_id ) { |
|
| 76 | + if( ! $list_id ) { |
|
| 78 | 77 | $list_id = $_POST['list_id']; |
| 79 | 78 | } |
| 80 | - if( ! $integration_type ) { |
|
| 79 | + if( ! $integration_type ) { |
|
| 81 | 80 | $integration_type = $_POST['integration']; |
| 82 | 81 | } |
| 83 | 82 | $api_key = trim( get_option( 'yikes-mc-api-key' , '' ) ); |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | ?> |
| 133 | 133 | |
| 134 | 134 | <!-- Default Value --> |
| 135 | - <?php switch( $form_data_array['field_type'] ) { |
|
| 135 | + <?php switch( $form_data_array['field_type'] ) { |
|
| 136 | 136 | |
| 137 | 137 | default: |
| 138 | 138 | case 'text': |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | <input type="text" class="widefat" name="field[<?php echo $merge_field_data['tag']; ?>][default]" <?php if( $form_data_array['field_type'] != 'url' ) { ?> value="<?php echo isset( $merge_field_data['default'] ) ? stripslashes( wp_strip_all_tags( $merge_field_data['default'] ) ) : ''; ?>" <?php } else { ?> value="<?php echo isset( $merge_field_data['default'] ) ? stripslashes( wp_strip_all_tags( esc_url_raw( $merge_field_data['default'] ) ) ) : ''; } ?>" /> |
| 148 | 148 | <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> |
| 149 | 149 | <?php |
| 150 | - switch( $form_data_array['field_type'] ) { |
|
| 150 | + switch( $form_data_array['field_type'] ) { |
|
| 151 | 151 | case 'text': |
| 152 | 152 | ?> |
| 153 | 153 | <p><small class="pre-defined-tag-link"><a href="#TB_inline?width=600&height=550&inlineId=pre-defined-tag-container" class="thickbox" onclick="storeGlobalClicked( jQuery( this ) );"><?php _e( 'View Pre-Defined Tags' , 'yikes-inc-easy-mailchimp-extender' ); ?></a></small></p> |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | <td> |
| 171 | 171 | <?php |
| 172 | 172 | $x = 0; |
| 173 | - foreach( $merge_field_data['choices'] as $choice => $value ) { |
|
| 173 | + foreach( $merge_field_data['choices'] as $choice => $value ) { |
|
| 174 | 174 | $pre_selected = !empty( $merge_field_data['default_choice'] ) ? $merge_field_data['default_choice'] : '0'; |
| 175 | 175 | ?> |
| 176 | 176 | <label> |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | </td> |
| 195 | 195 | <td> |
| 196 | 196 | <select type="default" name="field[<?php echo $merge_field_data['tag']; ?>][default_choice]"> |
| 197 | - <?php foreach( $merge_field_data['choices'] as $choice => $value ) { |
|
| 197 | + <?php foreach( $merge_field_data['choices'] as $choice => $value ) { |
|
| 198 | 198 | $pre_selected = ! empty( $merge_field_data['default_choice'] ) ? $merge_field_data['default_choice'] : '0'; |
| 199 | 199 | ?> |
| 200 | 200 | <option value="<?php echo $choice; ?>" <?php selected( $pre_selected , $choice ); ?>><?php echo stripslashes( $value ); ?></option> |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true ) |
| 23 | 23 | ) ); |
| 24 | 24 | $body = json_decode( wp_remote_retrieve_body( $available_merge_variables ), true ); |
| 25 | - if( isset( $body['error'] ) ) { |
|
| 25 | + if( isset( $body['error'] ) ) { |
|
| 26 | 26 | if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) { |
| 27 | 27 | require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php'; |
| 28 | 28 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | </td> |
| 70 | 70 | </tr> |
| 71 | 71 | <!-- Default Value --> |
| 72 | - <?php switch( $form_data_array['field_type'] ) { |
|
| 72 | + <?php switch( $form_data_array['field_type'] ) { |
|
| 73 | 73 | |
| 74 | 74 | default: |
| 75 | 75 | case 'text': |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | </label> |
| 98 | 98 | </td> |
| 99 | 99 | <td> |
| 100 | - <?php foreach( $merge_field_data['choices'] as $choice => $value ) { |
|
| 100 | + <?php foreach( $merge_field_data['choices'] as $choice => $value ) { |
|
| 101 | 101 | $pre_selected = !empty( $merge_field_data['default_choice'] ) ? $merge_field_data['default_choice'] : '0'; |
| 102 | 102 | ?> |
| 103 | 103 | <input type="radio" name="field[<?php echo $merge_field_data['tag']; ?>][default_choice]" value="<?php echo $choice; ?>" <?php checked( $pre_selected , $choice ); ?>><?php echo stripslashes( $value ); ?> |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | </td> |
| 120 | 120 | <td> |
| 121 | 121 | <select type="default" name="field[<?php echo $merge_field_data['tag']; ?>][default_choice]"> |
| 122 | - <?php foreach( $merge_field_data['choices'] as $choice => $value ) { |
|
| 122 | + <?php foreach( $merge_field_data['choices'] as $choice => $value ) { |
|
| 123 | 123 | $pre_selected = !empty( $merge_field_data['default_choice'] ) ? $merge_field_data['default_choice'] : '0'; |
| 124 | 124 | ?> |
| 125 | 125 | <option value="<?php echo $choice; ?>" <?php selected( $pre_selected , $choice ); ?>><?php echo stripslashes( $value ); ?></option> |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | <table class="form-table form-field-container"> |
| 60 | 60 | |
| 61 | 61 | <!-- Default Value --> |
| 62 | - <?php switch( $form_data_array['field_type'] ) { |
|
| 62 | + <?php switch( $form_data_array['field_type'] ) { |
|
| 63 | 63 | |
| 64 | 64 | default: |
| 65 | 65 | case 'radio': |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | </label> |
| 72 | 72 | </td> |
| 73 | 73 | <td> |
| 74 | - <?php $i = 0; foreach( $merge_field_data['groups'] as $interest_group ) { |
|
| 74 | + <?php $i = 0; foreach( $merge_field_data['groups'] as $interest_group ) { |
|
| 75 | 75 | $pre_selected = !empty( $merge_field_data['default_choice'] ) ? $merge_field_data['default_choice'] : '0'; |
| 76 | 76 | ?> |
| 77 | 77 | <input type="radio" name="field[<?php echo $form_data_array['group_id']; ?>][default_choice][]" value="<?php echo $i; ?>" <?php checked( $pre_selected , $i ); ?>><?php echo stripslashes( $interest_group['name'] ); ?> |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | </label> |
| 96 | 96 | </td> |
| 97 | 97 | <td> |
| 98 | - <?php $i = 0; foreach( $merge_field_data['groups'] as $interest_group ) { |
|
| 98 | + <?php $i = 0; foreach( $merge_field_data['groups'] as $interest_group ) { |
|
| 99 | 99 | $pre_selected = !empty( $merge_field_data['default_choice'] ) ? $merge_field_data['default_choice'] : '0'; |
| 100 | 100 | ?> |
| 101 | 101 | <input type="checkbox" name="field[<?php echo $form_data_array['group_id']; ?>][default_choice][]" value="<?php echo $i; ?>" <?php checked( $pre_selected , $i ); ?>><?php echo stripslashes( $interest_group['name'] ); ?> |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | </td> |
| 121 | 121 | <td> |
| 122 | 122 | <select type="default" name="field[<?php echo $form_data_array['group_id']; ?>][default_choice]"> |
| 123 | - <?php $i = 0; foreach( $merge_field_data['groups'] as $interest_group ) { |
|
| 123 | + <?php $i = 0; foreach( $merge_field_data['groups'] as $interest_group ) { |
|
| 124 | 124 | $pre_selected = !empty( $merge_field_data['default_choice'] ) ? $merge_field_data['default_choice'] : '0'; |
| 125 | 125 | ?> |
| 126 | 126 | <option value="<?php echo $i; ?>" <?php selected( $pre_selected , $i ); ?>><?php echo $interest_group['name']; ?></option> |
@@ -76,13 +76,13 @@ discard block |
||
| 76 | 76 | 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true ) |
| 77 | 77 | ) ); |
| 78 | 78 | $list_data = json_decode( wp_remote_retrieve_body( $list_data ), true ); |
| 79 | - if( isset( $list_data['error'] ) ) { |
|
| 79 | + if( isset( $list_data['error'] ) ) { |
|
| 80 | 80 | if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) { |
| 81 | 81 | require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php'; |
| 82 | 82 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
| 83 | 83 | $error_logging->yikes_easy_mailchimp_write_to_error_log( $list_data['error'], __( "Get Account Lists" , 'yikes-inc-easy-mailchimp-extender' ), "Edit Form Page" ); |
| 84 | 84 | } |
| 85 | - } else { |
|
| 85 | + } else { |
|
| 86 | 86 | // set our transient |
| 87 | 87 | set_transient( 'yikes-easy-mailchimp-list-data', $list_data, 1 * HOUR_IN_SECONDS ); |
| 88 | 88 | } |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true ) |
| 102 | 102 | ) ); |
| 103 | 103 | $available_merge_variables = json_decode( wp_remote_retrieve_body( $available_merge_variables ), true ); |
| 104 | - if( isset( $available_merge_variables['error'] ) ) { |
|
| 104 | + if( isset( $available_merge_variables['error'] ) ) { |
|
| 105 | 105 | if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) { |
| 106 | 106 | require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php'; |
| 107 | 107 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | ) ); |
| 124 | 124 | $interest_groupings = json_decode( wp_remote_retrieve_body( $interest_groupings ), true ); |
| 125 | 125 | $no_interest_groupings = '<p class="description error-descripion">' . __( 'No Interest Groups Found' , 'yikes-inc-easy-mailchimp-extender' ) . '.</p>'; |
| 126 | - if( isset( $interest_groupings['error'] ) ) { |
|
| 126 | + if( isset( $interest_groupings['error'] ) ) { |
|
| 127 | 127 | if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) { |
| 128 | 128 | require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php'; |
| 129 | 129 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | /* Confirm we've retreived our form data */ |
| 140 | - if( empty( $form ) ) { |
|
| 140 | + if( empty( $form ) ) { |
|
| 141 | 141 | |
| 142 | 142 | wp_die( __( "We've encountered an error. Please try again. If the error persists, please contact support." , 'yikes-inc-easy-mailchimp-extender' ) , __( 'Error' , 'yikes-inc-easy-mailchimp-extender' ) ); |
| 143 | 143 | |
@@ -17,13 +17,13 @@ discard block |
||
| 17 | 17 | 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true ) |
| 18 | 18 | ) ); |
| 19 | 19 | $list_data = json_decode( wp_remote_retrieve_body( $list_data ), true ); |
| 20 | - if( isset( $list_data['error'] ) ) { |
|
| 20 | + if( isset( $list_data['error'] ) ) { |
|
| 21 | 21 | if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) { |
| 22 | 22 | require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php'; |
| 23 | 23 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
| 24 | 24 | $error_logging->yikes_easy_mailchimp_write_to_error_log( $list_data['error'], __( "Get Account Lists" , 'yikes-inc-easy-mailchimp-extender' ), "View Lists Page" ); |
| 25 | 25 | } |
| 26 | - } else { |
|
| 26 | + } else { |
|
| 27 | 27 | // set our transient |
| 28 | 28 | set_transient( 'yikes-easy-mailchimp-list-data', $list_data, 1 * HOUR_IN_SECONDS ); |
| 29 | 29 | } |
@@ -86,9 +86,9 @@ discard block |
||
| 86 | 86 | |
| 87 | 87 | <!-- TABLE BODY --> |
| 88 | 88 | <tbody> |
| 89 | - <?php if( count( $list_data['total'] ) > 0 ) { |
|
| 89 | + <?php if( count( $list_data['total'] ) > 0 ) { |
|
| 90 | 90 | $i = 1; |
| 91 | - foreach( $list_data['data'] as $list ) { |
|
| 91 | + foreach( $list_data['data'] as $list ) { |
|
| 92 | 92 | ?> |
| 93 | 93 | <tr class="<?php if( $i % 2 == 0 ) { echo 'alternate'; } ?>"> |
| 94 | 94 | <th class="check-column" scope="row"><input type="checkbox" /></th> |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true ) |
| 99 | 99 | ) ); |
| 100 | 100 | $list_data = json_decode( wp_remote_retrieve_body( $list_data ), true ); |
| 101 | - if( isset( $list_data['error'] ) ) { |
|
| 101 | + if( isset( $list_data['error'] ) ) { |
|
| 102 | 102 | if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) { |
| 103 | 103 | require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php'; |
| 104 | 104 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | |
| 135 | 135 | <ul> |
| 136 | 136 | <?php |
| 137 | - if( !empty( $active_plugins ) ) { |
|
| 137 | + if( !empty( $active_plugins ) ) { |
|
| 138 | 138 | |
| 139 | 139 | foreach( $active_plugins as $class => $value ) { |
| 140 | 140 | // echo $class; |