| @@ -23,7 +23,7 @@ discard block | ||
| 23 | 23 | <?php | 
| 24 | 24 | } | 
| 25 | 25 | $main_field_data = $section_data['main_fields']; | 
| 26 | -										foreach( $main_field_data as $field ) {  | |
| 26 | +										foreach( $main_field_data as $field ) { | |
| 27 | 27 |  											if( $field['type'] == 'custom' ) { | 
| 28 | 28 | // execute the custom callback | 
| 29 | 29 | $field['callback'](); | 
| @@ -53,7 +53,7 @@ discard block | ||
| 53 | 53 | <?php | 
| 54 | 54 | } | 
| 55 | 55 | $sidebar_field_data = $section_data['sidebar_fields']; | 
| 56 | -											foreach( $sidebar_field_data as $field ) {  | |
| 56 | +											foreach( $sidebar_field_data as $field ) { | |
| 57 | 57 |  												if( $field['type'] == 'custom' ) { | 
| 58 | 58 | // execute the custom callback | 
| 59 | 59 | $field['callback'](); | 
| @@ -54,7 +54,8 @@ | ||
| 54 | 54 |  				foreach( $new_settings as $option_name => $option_value ) { | 
| 55 | 55 | update_option( $option_name, $option_value ); | 
| 56 | 56 | } | 
| 57 | -			} else { // if it's not, then it's an opt-in forms import | |
| 57 | +			} else { | |
| 58 | +// if it's not, then it's an opt-in forms import | |
| 58 | 59 | // If this is the first row, then it should be title data. | 
| 59 | 60 |  				if ( 1 === $row ) { | 
| 60 | 61 | $titles = $line; | 
| @@ -19,7 +19,7 @@ discard block | ||
| 19 | 19 | * @subpackage Yikes_Inc_Easy_Mailchimp_Extender/includes | 
| 20 | 20 | * @author YIKES Inc. <[email protected]> | 
| 21 | 21 | */ | 
| 22 | -class Yikes_Inc_Easy_Mailchimp_Extender_Loader {
 | |
| 22 | +class Yikes_Inc_Easy_Mailchimp_Extender_Loader { | |
| 23 | 23 | /** | 
| 24 | 24 | * The array of actions registered with WordPress. | 
| 25 | 25 | * | 
| @@ -41,7 +41,7 @@ discard block | ||
| 41 | 41 | * | 
| 42 | 42 | * @since 6.0.0 | 
| 43 | 43 | */ | 
| 44 | -	public function __construct() {
 | |
| 44 | +	public function __construct() { | |
| 45 | 45 | $this->actions = array(); | 
| 46 | 46 | $this->filters = array(); | 
| 47 | 47 | } | 
| @@ -55,7 +55,7 @@ discard block | ||
| 55 | 55 | * @param int Optional $priority The priority at which the function should be fired. | 
| 56 | 56 | * @param int Optional $accepted_args The number of arguments that should be passed to the $callback. | 
| 57 | 57 | */ | 
| 58 | -	public function add_action( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
 | |
| 58 | +	public function add_action( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) { | |
| 59 | 59 | $this->actions = $this->add( $this->actions, $hook, $component, $callback, $priority, $accepted_args ); | 
| 60 | 60 | } | 
| 61 | 61 | /** | 
| @@ -68,7 +68,7 @@ discard block | ||
| 68 | 68 | * @param int Optional $priority The priority at which the function should be fired. | 
| 69 | 69 | * @param int Optional $accepted_args The number of arguments that should be passed to the $callback. | 
| 70 | 70 | */ | 
| 71 | -	public function add_filter( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
 | |
| 71 | +	public function add_filter( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) { | |
| 72 | 72 | $this->filters = $this->add( $this->filters, $hook, $component, $callback, $priority, $accepted_args ); | 
| 73 | 73 | } | 
| 74 | 74 | /** | 
| @@ -85,7 +85,7 @@ discard block | ||
| 85 | 85 | * @param int Optional $accepted_args The number of arguments that should be passed to the $callback. | 
| 86 | 86 | * @return type The collection of actions and filters registered with WordPress. | 
| 87 | 87 | */ | 
| 88 | -	private function add( $hooks, $hook, $component, $callback, $priority, $accepted_args ) {
 | |
| 88 | +	private function add( $hooks, $hook, $component, $callback, $priority, $accepted_args ) { | |
| 89 | 89 | $hooks[] = array( | 
| 90 | 90 | 'hook' => $hook, | 
| 91 | 91 | 'component' => $component, | 
| @@ -100,11 +100,11 @@ discard block | ||
| 100 | 100 | * | 
| 101 | 101 | * @since 6.0.0 | 
| 102 | 102 | */ | 
| 103 | -	public function run() {
 | |
| 104 | -		foreach ( $this->filters as $hook ) {
 | |
| 103 | +	public function run() { | |
| 104 | +		foreach ( $this->filters as $hook ) { | |
| 105 | 105 | add_filter( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] ); | 
| 106 | 106 | } | 
| 107 | -		foreach ( $this->actions as $hook ) {
 | |
| 107 | +		foreach ( $this->actions as $hook ) { | |
| 108 | 108 | add_action( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] ); | 
| 109 | 109 | } | 
| 110 | 110 | } | 
| @@ -1051,6 +1051,7 @@ discard block | ||
| 1051 | 1051 | * @param string | $slug | The type of message we're looking for | 
| 1052 | 1052 | * @param string | $response_text| The default response message | 
| 1053 | 1053 | * @param array | $data | An array of data that may be needed to construct the user's error message | 
| 1054 | + * @param string $slug | |
| 1054 | 1055 | * @return string| $response_text| The $response_text (after it's potentially been changed) | 
| 1055 | 1056 | */ | 
| 1056 | 1057 |  	protected function check_for_user_defined_response_message( $slug, $response_text, $data = false ) { | 
| @@ -1198,6 +1199,7 @@ discard block | ||
| 1198 | 1199 | * | 
| 1199 | 1200 | * @param string | $message | The response message | 
| 1200 | 1201 | * @param bool | $is_success | Boolean signifying if we're returning a success message or an error message | 
| 1202 | + * @param boolean $is_success | |
| 1201 | 1203 | * @return string| The $message wrapping in HTML | 
| 1202 | 1204 | */ | 
| 1203 | 1205 |  	public function wrap_form_submission_response( $message, $is_success ) { | 
| @@ -1242,6 +1244,7 @@ discard block | ||
| 1242 | 1244 | * @param string | $response | The response message to display to the user | 
| 1243 | 1245 | * @param array | $additional_fields | An array of additional fields to return | 
| 1244 | 1246 | * @param bool | $return_response_non_ajax | Boolean deciding if we need to return a message | 
| 1247 | + * @param integer $hide | |
| 1245 | 1248 | * | 
| 1246 | 1249 | * @return If AJAX, return $this->yikes_send_json_error(). If not AJAX, return an array || false. | 
| 1247 | 1250 | */ | 
| @@ -133,7 +133,8 @@ | ||
| 133 | 133 |  		if( $form_id ) { | 
| 134 | 134 | $form_settings = self::yikes_retrieve_form_settings( $form_id ); | 
| 135 | 135 |  			if( isset( $_POST ) && !empty( $_POST ) && isset( $form_id ) && $form_settings['submission_settings']['ajax'] == 0 ) { | 
| 136 | -				if( $_POST['yikes-mailchimp-submitted-form'] == $form_id ) { // ensure we only process the form that was submitted | |
| 136 | +				if( $_POST['yikes-mailchimp-submitted-form'] == $form_id ) { | |
| 137 | +// ensure we only process the form that was submitted | |
| 137 | 138 | |
| 138 | 139 | // Lets include our form processing file | 
| 139 | 140 | include_once( YIKES_MC_PATH . 'public/partials/shortcodes/process/process_form_submission.php' ); | 
| @@ -474,7 +474,9 @@ discard block | ||
| 474 | 474 | $field_array['required'] = isset( $field['require'] ) ? 'required="required"' : ''; | 
| 475 | 475 | $label_array['visible'] = isset( $field['hide'] ) ? 'style="display:none;"' : ''; | 
| 476 | 476 | $label_class_array[] = ( $tag === 'merge' ) ? $field['merge'] . '-label' : $field['group_id'] . '-label'; | 
| 477 | - if ( isset( $field['require'] ) ) $label_class_array[] = 'yikes-mailchimp-field-required'; | |
| 477 | +						if ( isset( $field['require'] ) ) { | |
| 478 | + $label_class_array[] = 'yikes-mailchimp-field-required'; | |
| 479 | + } | |
| 478 | 480 | } | 
| 479 | 481 | |
| 480 | 482 | // if both hide label and hide field are checked, we gotta hide the field! | 
| @@ -761,7 +763,7 @@ discard block | ||
| 761 | 763 |  														} else { | 
| 762 | 764 | $zip_value = $_POST[$field['merge']]; | 
| 763 | 765 | } | 
| 764 | -													} else {  | |
| 766 | +													} else { | |
| 765 | 767 | |
| 766 | 768 | /** | 
| 767 | 769 | * A filter to set the default zip code value. | 
| @@ -1125,7 +1127,7 @@ discard block | ||
| 1125 | 1127 | echo $no_default === true ? '<option value="">' . $no_default_name . '</option>' : ''; | 
| 1126 | 1128 | |
| 1127 | 1129 | $i = 0; | 
| 1128 | -												foreach( $groups as $group_id => $name ) {  | |
| 1130 | +												foreach( $groups as $group_id => $name ) { | |
| 1129 | 1131 | |
| 1130 | 1132 | // If the form was submitted and failed, set the submitted/chosen values as the default | 
| 1131 | 1133 |  													if( isset( $_POST[ 'group-' . $field['group_id'] ] ) && $form_submitted === 0 ) { | 
| @@ -1174,7 +1176,7 @@ discard block | ||
| 1174 | 1176 | // Turn $default_choice into an array if it isn't already | 
| 1175 | 1177 | $default_choice = ( isset( $default_choice ) && is_array( $default_choice ) ) ? $default_choice : array( $default_choice ); | 
| 1176 | 1178 | |
| 1177 | -										foreach( $groups as $group_id => $name ) {  | |
| 1179 | +										foreach( $groups as $group_id => $name ) { | |
| 1178 | 1180 | ?> | 
| 1179 | 1181 |  											<label for="<?php echo esc_attr( $field['group_id'] ) . '-' . $i; ?>" class="yikes-easy-mc-checkbox-label <?php echo implode( ' ' , $custom_classes ); if ( $x === $count ) { echo ' last-selection'; } ?>" style="display:none;"> | 
| 1180 | 1182 | <input | 
| @@ -25,7 +25,7 @@ discard block | ||
| 25 | 25 | * @subpackage Yikes_Inc_Easy_Mailchimp_Extender/includes | 
| 26 | 26 | * @author YIKES Inc. <[email protected]> | 
| 27 | 27 | */ | 
| 28 | -class Yikes_Inc_Easy_Mailchimp_Error_Logging {
 | |
| 28 | +class Yikes_Inc_Easy_Mailchimp_Error_Logging { | |
| 29 | 29 | |
| 30 | 30 | /** | 
| 31 | 31 | * Whether we're doing debugging. | 
| @@ -57,7 +57,7 @@ discard block | ||
| 57 | 57 | * | 
| 58 | 58 | * @since 1.0.0 | 
| 59 | 59 | */ | 
| 60 | -	public function __construct() {
 | |
| 60 | +	public function __construct() { | |
| 61 | 61 | $this->is_debugging = WP_DEBUG || (string) get_option( 'yikes-mailchimp-debug-status', '' ) === '1'; | 
| 62 | 62 | $this->error_log_file_path = $this->get_error_log_file_path(); | 
| 63 | 63 | $this->error_log_folder_path = $this->get_error_log_folder(); | 
| @@ -78,35 +78,35 @@ discard block | ||
| 78 | 78 | * @param string $error_type The error type. | 
| 79 | 79 | * @param string $page The page information. | 
| 80 | 80 | */ | 
| 81 | -	public function maybe_write_to_log( $returned_error, $error_type, $page = '' ) {
 | |
| 82 | -		if ( ! $this->is_debugging ) {
 | |
| 81 | +	public function maybe_write_to_log( $returned_error, $error_type, $page = '' ) { | |
| 82 | +		if ( ! $this->is_debugging ) { | |
| 83 | 83 | return; | 
| 84 | 84 | } | 
| 85 | 85 | |
| 86 | 86 | $this->yikes_easy_mailchimp_write_to_error_log( $returned_error, $error_type, $page ); | 
| 87 | 87 | } | 
| 88 | 88 | |
| 89 | -	public function create_error_log_folder() {
 | |
| 89 | +	public function create_error_log_folder() { | |
| 90 | 90 | |
| 91 | 91 | // If our directory doesn't exist, make it. | 
| 92 | -		if ( ! file_exists( $this->get_error_log_folder() ) ) {
 | |
| 92 | +		if ( ! file_exists( $this->get_error_log_folder() ) ) { | |
| 93 | 93 | mkdir( $this->get_error_log_folder() ); | 
| 94 | 94 | } | 
| 95 | 95 | } | 
| 96 | 96 | |
| 97 | -	public function create_error_log_file() {
 | |
| 97 | +	public function create_error_log_file() { | |
| 98 | 98 | |
| 99 | 99 | // If our error log doesn't exist, make it. | 
| 100 | -		if ( ! file_exists( $this->error_log_file_path ) ) {
 | |
| 100 | +		if ( ! file_exists( $this->error_log_file_path ) ) { | |
| 101 | 101 | file_put_contents( $this->error_log_file_path, '' ); | 
| 102 | 102 | } | 
| 103 | 103 | } | 
| 104 | 104 | |
| 105 | -	private function get_error_log_folder() {
 | |
| 105 | +	private function get_error_log_folder() { | |
| 106 | 106 | return WP_CONTENT_DIR . '/uploads/yikes-log/'; | 
| 107 | 107 | } | 
| 108 | 108 | |
| 109 | -	private function get_error_log_file_path() {
 | |
| 109 | +	private function get_error_log_file_path() { | |
| 110 | 110 | return WP_CONTENT_DIR . '/uploads/yikes-log/yikes-easy-mailchimp-error-log.txt'; | 
| 111 | 111 | } | 
| 112 | 112 | |
| @@ -122,17 +122,17 @@ discard block | ||
| 122 | 122 | * @returned_error | 
| 123 | 123 | * @error_type - what was running when the error occured ie (new user subscription, remove user etc) | 
| 124 | 124 | */ | 
| 125 | -	public function yikes_easy_mailchimp_write_to_error_log( $returned_error , $error_type , $page='' ) {
 | |
| 125 | +	public function yikes_easy_mailchimp_write_to_error_log( $returned_error , $error_type , $page='' ) { | |
| 126 | 126 | |
| 127 | 127 | // confirm error logging is toggled on, else lets exit | 
| 128 | -		if( get_option( 'yikes-mailchimp-debug-status' , '' )  != '1' ) {
 | |
| 128 | +		if( get_option( 'yikes-mailchimp-debug-status' , '' )  != '1' ) { | |
| 129 | 129 | return; | 
| 130 | 130 | } | 
| 131 | 131 | |
| 132 | 132 | $contents = file_get_contents( $this->error_log_file_path, true ); | 
| 133 | 133 | |
| 134 | 134 | // if we pass in a custom page, don't set things up | 
| 135 | -		if ( empty( $page ) ) {
 | |
| 135 | +		if ( empty( $page ) ) { | |
| 136 | 136 | |
| 137 | 137 | // get the current page, admin or front end? | 
| 138 | 138 | $page = is_admin() ? __( 'Admin', 'yikes-inc-easy-mailchimp-extender' ) : __( 'Front End', 'yikes-inc-easy-mailchimp-extender' ); | 
| @@ -168,20 +168,20 @@ discard block | ||
| 168 | 168 | * | 
| 169 | 169 | * @since 5.6 | 
| 170 | 170 | */ | 
| 171 | -	public function yikes_easy_mailchimp_generate_error_log_table() {		
 | |
| 171 | +	public function yikes_easy_mailchimp_generate_error_log_table() { | |
| 172 | 172 | |
| 173 | 173 | // ensure file_get_contents exists | 
| 174 | -		if( function_exists( 'file_get_contents' ) ) {	
 | |
| 174 | +		if( function_exists( 'file_get_contents' ) ) { | |
| 175 | 175 | // confirm that our file exists | 
| 176 | -			if( file_exists( $this->error_log_file_path ) ) {
 | |
| 176 | +			if( file_exists( $this->error_log_file_path ) ) { | |
| 177 | 177 | $error_log_contents = file_get_contents( $this->error_log_file_path, true ); | 
| 178 | -				if( $error_log_contents === FALSE ) {
 | |
| 178 | +				if( $error_log_contents === FALSE ) { | |
| 179 | 179 | return _e( 'File get contents not available' , 'yikes-inc-easy-mailchimp-extender' ); | 
| 180 | 180 | } | 
| 181 | -				if ( $error_log_contents != '' ) {
 | |
| 181 | +				if ( $error_log_contents != '' ) { | |
| 182 | 182 | // return $error_log_contents; | 
| 183 | 183 | print_r( $error_log_contents ); | 
| 184 | -				} else {
 | |
| 184 | +				} else { | |
| 185 | 185 | ?> | 
| 186 | 186 | <!-- table body --> | 
| 187 | 187 | <tr class="error-log-tr"> | 
| @@ -195,7 +195,7 @@ discard block | ||
| 195 | 195 | </tr> | 
| 196 | 196 | <?php | 
| 197 | 197 | } | 
| 198 | -			} else {
 | |
| 198 | +			} else { | |
| 199 | 199 | ?> | 
| 200 | 200 | <!-- table body --> | 
| 201 | 201 | <tr class="error-log-tr"> | 
| @@ -223,7 +223,8 @@ discard block | ||
| 223 | 223 | </tr> | 
| 224 | 224 | <?php | 
| 225 | 225 | } | 
| 226 | -		} else { // if file_get_contents is disabled server side
 | |
| 226 | +		} else { | |
| 227 | +// if file_get_contents is disabled server side | |
| 227 | 228 | ?> | 
| 228 | 229 | <!-- table body --> | 
| 229 | 230 | <tr> | 
| @@ -53,23 +53,23 @@ discard block | ||
| 53 | 53 | ); | 
| 54 | 54 | |
| 55 | 55 | // Easy Digital Downloads. | 
| 56 | -	if ( class_exists( 'Easy_Digital_Downloads' ) ) {
 | |
| 56 | +	if ( class_exists( 'Easy_Digital_Downloads' ) ) { | |
| 57 | 57 | $active_plugins['easy_digital_downloads_checkout_form'] = __( 'Easy Digital Downloads Checkout', 'yikes-inc-easy-mailchimp-extender' ); | 
| 58 | 58 | } | 
| 59 | 59 | // WooCommerce. | 
| 60 | -	if ( class_exists( 'WooCommerce' ) ) {
 | |
| 60 | +	if ( class_exists( 'WooCommerce' ) ) { | |
| 61 | 61 | $active_plugins['woocommerce_checkout_form'] = __( 'WooCommerce Checkout', 'yikes-inc-easy-mailchimp-extender' ); | 
| 62 | 62 | } | 
| 63 | 63 | // BuddyPress. | 
| 64 | -	if ( class_exists( 'BuddyPress' ) ) {
 | |
| 64 | +	if ( class_exists( 'BuddyPress' ) ) { | |
| 65 | 65 | $active_plugins['buddypress_form'] = __( 'BuddyPress Registration', 'yikes-inc-easy-mailchimp-extender' ); | 
| 66 | 66 | } | 
| 67 | 67 | // bbPress. | 
| 68 | -	if ( class_exists( 'bbPress' ) ) {
 | |
| 68 | +	if ( class_exists( 'bbPress' ) ) { | |
| 69 | 69 | $active_plugins['bbpress_forms'] = __( 'bbPress', 'yikes-inc-easy-mailchimp-extender' ); | 
| 70 | 70 | } | 
| 71 | 71 | // Contact Form 7. | 
| 72 | -	if ( is_plugin_active( 'contact-form-7/wp-contact-form-7.php' ) ) {
 | |
| 72 | +	if ( is_plugin_active( 'contact-form-7/wp-contact-form-7.php' ) ) { | |
| 73 | 73 | $active_plugins['contact_form_7'] = __( 'Contact Form 7', 'yikes-inc-easy-mailchimp-extender' ); | 
| 74 | 74 | } | 
| 75 | 75 | |
| @@ -81,9 +81,9 @@ discard block | ||
| 81 | 81 | |
| 82 | 82 | <?php | 
| 83 | 83 | // lets confirm the user has a valid API key stored. | 
| 84 | -	if ( $this->is_user_mc_api_valid_form( false ) == 'valid' ) {
 | |
| 84 | +	if ( $this->is_user_mc_api_valid_form( false ) == 'valid' ) { | |
| 85 | 85 | $list_data = yikes_get_mc_api_manager()->get_list_handler()->get_lists(); | 
| 86 | -		if ( is_wp_error( $list_data ) ) {
 | |
| 86 | +		if ( is_wp_error( $list_data ) ) { | |
| 87 | 87 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); | 
| 88 | 88 | $error_logging->maybe_write_to_log( | 
| 89 | 89 | $list_data->get_error_code(), | 
| @@ -91,7 +91,7 @@ discard block | ||
| 91 | 91 | "Integration Settings Page" | 
| 92 | 92 | ); | 
| 93 | 93 | } | 
| 94 | -	} else {
 | |
| 94 | +	} else { | |
| 95 | 95 | ?> | 
| 96 | 96 | <div class="inside"> | 
| 97 | 97 | <?php | 
| @@ -116,9 +116,9 @@ discard block | ||
| 116 | 116 | |
| 117 | 117 | <ul> | 
| 118 | 118 | <?php | 
| 119 | -			if ( ! empty( $active_plugins ) ) {
 | |
| 119 | +			if ( ! empty( $active_plugins ) ) { | |
| 120 | 120 | |
| 121 | -				foreach( $active_plugins as $class => $value ) {
 | |
| 121 | +				foreach( $active_plugins as $class => $value ) { | |
| 122 | 122 | |
| 123 | 123 | $checked = isset( $options[$class]['value'] ) ? 'checked="checked"' : ''; | 
| 124 | 124 | $hidden = ! isset( $options[$class]['value'] ) ? 'yikes-easy-mc-hidden' : ''; | 
| @@ -145,7 +145,7 @@ discard block | ||
| 145 | 145 | <!-- Associated Lists --> | 
| 146 | 146 | <div class="checkbox-lists"><strong><?php _e( 'Choose Lists: ', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> | 
| 147 | 147 | <?php | 
| 148 | -									if ( count( $list_data ) > 0 ) {
 | |
| 148 | +									if ( count( $list_data ) > 0 ) { | |
| 149 | 149 | ?> | 
| 150 | 150 |  										<?php foreach( $list_data as $list ) { ?>
 | 
| 151 | 151 | |
| @@ -163,14 +163,14 @@ discard block | ||
| 163 | 163 | |
| 164 | 164 | <!-- If interest groups have been selected already, load them here --> | 
| 165 | 165 | <?php | 
| 166 | -											if ( in_array( $list['id'], $selected_list ) && $list_interest_groups ) {
 | |
| 166 | +											if ( in_array( $list['id'], $selected_list ) && $list_interest_groups ) { | |
| 167 | 167 | YIKES_Inc_Easy_Mailchimp_Process_Ajax::check_list_for_interest_groups( $list['id'], $class, true ); | 
| 168 | 168 | } | 
| 169 | 169 | ?> | 
| 170 | 170 | |
| 171 | 171 | <?php } ?> | 
| 172 | 172 | <?php | 
| 173 | -								} else {
 | |
| 173 | +								} else { | |
| 174 | 174 | echo '<p class="description no-lists-setup-notice"><strong>' . __( 'You have not setup any lists. Head over to Mailchimp and setup your first list.', 'yikes-inc-easy-mailchimp-extender' ) . '</strong></p>'; | 
| 175 | 175 | } | 
| 176 | 176 | ?> | 
| @@ -193,7 +193,7 @@ discard block | ||
| 193 | 193 | </li> | 
| 194 | 194 | <?php | 
| 195 | 195 | } | 
| 196 | -		} else {
 | |
| 196 | +		} else { | |
| 197 | 197 | ?> | 
| 198 | 198 | <li> | 
| 199 | 199 | <?php _e( 'Nothing is active.', 'yikes-inc-easy-mailchimp-extender' ); ?> | 
| @@ -18,7 +18,7 @@ discard block | ||
| 18 | 18 | * @subpackage Yikes_Inc_Easy_Mailchimp_Extender/includes | 
| 19 | 19 | * @author YIKES Inc. <[email protected]> | 
| 20 | 20 | */ | 
| 21 | -class Yikes_Inc_Easy_Mailchimp_Extender_Activator {
 | |
| 21 | +class Yikes_Inc_Easy_Mailchimp_Extender_Activator { | |
| 22 | 22 | /** | 
| 23 | 23 | * Short Description. Activation hook. | 
| 24 | 24 | * | 
| @@ -26,16 +26,16 @@ discard block | ||
| 26 | 26 | * | 
| 27 | 27 | * @since 6.0.0 | 
| 28 | 28 | */ | 
| 29 | -	public static function activate( $network_wide ) {
 | |
| 29 | +	public static function activate( $network_wide ) { | |
| 30 | 30 | global $wpdb; | 
| 31 | 31 | |
| 32 | -		if ( function_exists( 'is_multisite' ) && is_multisite() ) {
 | |
| 32 | +		if ( function_exists( 'is_multisite' ) && is_multisite() ) { | |
| 33 | 33 | // check if it is a network activation - if so, run the activation function for each blog id | 
| 34 | -			if ( $network_wide ) {
 | |
| 34 | +			if ( $network_wide ) { | |
| 35 | 35 | $old_blog = $wpdb->blogid; | 
| 36 | 36 | // Get all blog ids | 
| 37 | 37 |  				$blogids = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs");
 | 
| 38 | -				foreach ( $blogids as $blog_id ) {
 | |
| 38 | +				foreach ( $blogids as $blog_id ) { | |
| 39 | 39 | switch_to_blog( $blog_id ); | 
| 40 | 40 | self::_activate_yikes_easy_mailchimp( $wpdb ); | 
| 41 | 41 | restore_current_blog(); | 
| @@ -44,7 +44,8 @@ discard block | ||
| 44 | 44 | return; | 
| 45 | 45 | } | 
| 46 | 46 | self::_activate_yikes_easy_mailchimp( $wpdb ); | 
| 47 | -		} else { /* end network activate */
 | |
| 47 | +		} else { | |
| 48 | +/* end network activate */ | |
| 48 | 49 | self::_activate_yikes_easy_mailchimp( $wpdb ); | 
| 49 | 50 | } | 
| 50 | 51 | } | 
| @@ -56,7 +57,7 @@ discard block | ||
| 56 | 57 | * | 
| 57 | 58 | * @since 6.0.0 | 
| 58 | 59 | */ | 
| 59 | -	static function _activate_yikes_easy_mailchimp( $wpdb ) {
 | |
| 60 | +	static function _activate_yikes_easy_mailchimp( $wpdb ) { | |
| 60 | 61 | |
| 61 | 62 | // single site | 
| 62 | 63 | $custom_table_name = $wpdb->prefix . 'yikes_easy_mc_forms'; | 
| @@ -95,12 +96,12 @@ discard block | ||
| 95 | 96 | |
| 96 | 97 | // create an option for the date that the user initially activated the plugin | 
| 97 | 98 | // used to display a two week notice, asking for a review or to upgrade | 
| 98 | -		if ( ! get_option( 'yikes_easy_mailchimp_activation_date' ) || get_option( 'yikes_easy_mailchimp_activation_date' ) == '' ) {
 | |
| 99 | +		if ( ! get_option( 'yikes_easy_mailchimp_activation_date' ) || get_option( 'yikes_easy_mailchimp_activation_date' ) == '' ) { | |
| 99 | 100 | update_option( 'yikes_easy_mailchimp_activation_date', strtotime( 'now' ) ); | 
| 100 | 101 | } | 
| 101 | 102 | |
| 102 | 103 | // Create an option for the forms. | 
| 103 | -		if ( class_exists( 'Yikes_Inc_Easy_Mailchimp_Extender_Option_Forms' ) ) {
 | |
| 104 | +		if ( class_exists( 'Yikes_Inc_Easy_Mailchimp_Extender_Option_Forms' ) ) { | |
| 104 | 105 | $option_class = new Yikes_Inc_Easy_Mailchimp_Extender_Option_Forms(); | 
| 105 | 106 | $option_class->create_option(); | 
| 106 | 107 | } |