@@ -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 | |
@@ -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' ) ); |
@@ -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']; ?>"> |
@@ -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). |
@@ -9,6 +9,11 @@ discard block |
||
| 9 | 9 | * @form_ids array of form ID's to export ie: array( 1,4,5,6 ) (user can select specific forms) |
| 10 | 10 | * @file_name the name of the exported file |
| 11 | 11 | */ |
| 12 | + |
|
| 13 | + /** |
|
| 14 | + * @param string $table_name |
|
| 15 | + * @param string $file_name |
|
| 16 | + */ |
|
| 12 | 17 | public static function yikes_mailchimp_form_export( $table_name, $form_ids , $file_name ) { |
| 13 | 18 | global $wpdb; |
| 14 | 19 | $wpdb->show_errors(); |
@@ -64,6 +69,10 @@ discard block |
||
| 64 | 69 | * @parameters |
| 65 | 70 | * @file_name the name of the exported file |
| 66 | 71 | */ |
| 72 | + |
|
| 73 | + /** |
|
| 74 | + * @param string $file_name |
|
| 75 | + */ |
|
| 67 | 76 | public static function yikes_mailchimp_settings_export( $file_name ) { |
| 68 | 77 | |
| 69 | 78 | // get an array of all of our plugin settings (on the settings pages), to loop over |
@@ -39,9 +39,9 @@ |
||
| 39 | 39 | foreach ($results as $row) { |
| 40 | 40 | |
| 41 | 41 | // Add table headers |
| 42 | - if($first){ |
|
| 42 | + if($first) { |
|
| 43 | 43 | $titles = array(); |
| 44 | - foreach($row as $key=>$val){ |
|
| 44 | + foreach($row as $key=>$val) { |
|
| 45 | 45 | $titles[] = $key; |
| 46 | 46 | } |
| 47 | 47 | fputcsv($output_handle, $titles); |
@@ -23,6 +23,10 @@ discard block |
||
| 23 | 23 | * @since 6.0.0 |
| 24 | 24 | * @$integration_type - pass in the type of checkbox integration |
| 25 | 25 | */ |
| 26 | + |
|
| 27 | + /** |
|
| 28 | + * @param string $integration_type |
|
| 29 | + */ |
|
| 26 | 30 | public function is_user_already_subscribed( $integration_type ) { |
| 27 | 31 | // first check if the user is logged in |
| 28 | 32 | if( is_user_logged_in() ) { |
@@ -69,6 +73,10 @@ discard block |
||
| 69 | 73 | * @$email - users email address entered into the form |
| 70 | 74 | * @$integration_type - pass in the type of checkbox integration |
| 71 | 75 | */ |
| 76 | + |
|
| 77 | + /** |
|
| 78 | + * @param string $integration_type |
|
| 79 | + */ |
|
| 72 | 80 | public function is_new_registration_already_subscribed( $email , $integration_type ) { |
| 73 | 81 | // first check if the user is logged in |
| 74 | 82 | $checkbox_options = get_option( 'optin-checkbox-init' , '' ); |
@@ -233,6 +241,10 @@ discard block |
||
| 233 | 241 | * before continuing |
| 234 | 242 | * @since 6.0.0 |
| 235 | 243 | */ |
| 244 | + |
|
| 245 | + /** |
|
| 246 | + * @param string $type |
|
| 247 | + */ |
|
| 236 | 248 | public function was_checkbox_checked( $type ) { |
| 237 | 249 | // was sign-up checkbox checked - return the value |
| 238 | 250 | return ( isset( $_POST[ 'yikes_mailchimp_checkbox_'.$type ] ) && $_POST[ 'yikes_mailchimp_checkbox_'.$type ] == 1 ); |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | protected $type = 'integration'; |
| 14 | 14 | private $text_domain = 'yikes-inc-easy-mailchimp-extender'; |
| 15 | 15 | |
| 16 | - public function __construct() { |
|
| 16 | + public function __construct() { |
|
| 17 | 17 | |
| 18 | 18 | } |
| 19 | 19 | |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true ) |
| 46 | 46 | ) ); |
| 47 | 47 | $already_subscribed = json_decode( wp_remote_retrieve_body( $already_subscribed ), true ); |
| 48 | - if( isset( $already_subscribed['error'] ) ) { |
|
| 48 | + if( isset( $already_subscribed['error'] ) ) { |
|
| 49 | 49 | if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) { |
| 50 | 50 | require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php'; |
| 51 | 51 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true ) |
| 89 | 89 | ) ); |
| 90 | 90 | $already_subscribed = json_decode( wp_remote_retrieve_body( $already_subscribed ), true ); |
| 91 | - if( isset( $already_subscribed['error'] ) ) { |
|
| 91 | + if( isset( $already_subscribed['error'] ) ) { |
|
| 92 | 92 | if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) { |
| 93 | 93 | require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php'; |
| 94 | 94 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | * |
| 137 | 137 | * @since 6.0.0 |
| 138 | 138 | **/ |
| 139 | - public function subscribe_user_integration( $email, $type, $merge_vars ) { |
|
| 139 | + public function subscribe_user_integration( $email, $type, $merge_vars ) { |
|
| 140 | 140 | // get checkbox data |
| 141 | 141 | $checkbox_options = get_option( 'optin-checkbox-init' , '' ); |
| 142 | 142 | if( $type != 'registration_form' ) { |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | ) ); |
| 187 | 187 | if( ! Is_wp_error( $subscribe_response ) ) { |
| 188 | 188 | $response_body = json_decode( wp_remote_retrieve_body( $subscribe_response ), true ); |
| 189 | - if( WP_DEBUG || isset( $response_body['error'] ) ) { |
|
| 189 | + if( WP_DEBUG || isset( $response_body['error'] ) ) { |
|
| 190 | 190 | if( get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) { |
| 191 | 191 | require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php'; |
| 192 | 192 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | public function yikes_reg_complete_msg( $errors, $redirect_to ) { |
| 248 | 248 | if( isset( $errors->errors['registered'] ) ) { |
| 249 | 249 | $email_error = get_option( 'yikes_register_subscription_error' , '' ); |
| 250 | - if( isset( $email_error ) && $email_error != '' ) { |
|
| 250 | + if( isset( $email_error ) && $email_error != '' ) { |
|
| 251 | 251 | // Use the magic __get method to retrieve the errors array: |
| 252 | 252 | $tmp = $errors->errors; |
| 253 | 253 | $old = 'Registration complete. Please check your e-mail.'; |
@@ -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 ); |
@@ -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 ) { |
@@ -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 ); |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | * |
| 36 | 36 | * @param int $user_id |
| 37 | 37 | * |
| 38 | - * @return bool|string |
|
| 38 | + * @return false|null |
|
| 39 | 39 | */ |
| 40 | 40 | public function subscribe_from_registration( $user_id ) { |
| 41 | 41 | // was sign-up checkbox checked? |
@@ -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> |