| @@ -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'](); | 
| @@ -112,9 +112,11 @@ | ||
| 112 | 112 | |
| 113 | 113 | // update 'date_format' on 'birthday' and 'date' fields | 
| 114 | 114 |  												if( isset( $mailchimp_form['fields'][$new_parent_key]['type'] ) && in_array( $mailchimp_form['fields'][$new_parent_key]['type'], array( 'date', 'birthday' ) ) ) { | 
| 115 | -													if( $mailchimp_form['fields'][$new_parent_key]['type'] == 'date' ) { // date | |
| 115 | +													if( $mailchimp_form['fields'][$new_parent_key]['type'] == 'date' ) { | |
| 116 | +// date | |
| 116 | 117 | $mailchimp_form['fields'][$new_parent_key]['date_format'] = 'MM/DD'; // mailchimp default (can be altered) | 
| 117 | -													} else { // birthday  | |
| 118 | +													} else { | |
| 119 | +// birthday | |
| 118 | 120 | $mailchimp_form['fields'][$new_parent_key]['date_format'] = 'MM/DD/YYYY'; // mailchimp default (can be altered) | 
| 119 | 121 | } | 
| 120 | 122 | } | 
| @@ -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; | 
| @@ -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 | } | 
| @@ -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_Extender {
 | |
| 28 | +class Yikes_Inc_Easy_Mailchimp_Extender { | |
| 29 | 29 | /** | 
| 30 | 30 | * The loader that's responsible for maintaining and registering all hooks that power | 
| 31 | 31 | * the plugin. | 
| @@ -70,7 +70,7 @@ discard block | ||
| 70 | 70 | * | 
| 71 | 71 | * @param Yikes_Inc_Easy_MailChimp_Extender_Form_Interface $form_interface | 
| 72 | 72 | */ | 
| 73 | -	public function __construct( Yikes_Inc_Easy_MailChimp_Extender_Form_Interface $form_interface ) {
 | |
| 73 | +	public function __construct( Yikes_Inc_Easy_MailChimp_Extender_Form_Interface $form_interface ) { | |
| 74 | 74 | $this->version = YIKES_MC_VERSION; | 
| 75 | 75 | $this->form_interface = $form_interface; | 
| 76 | 76 | $this->load_dependencies(); | 
| @@ -93,7 +93,7 @@ discard block | ||
| 93 | 93 | * @since 1.0.0 | 
| 94 | 94 | * @access private | 
| 95 | 95 | */ | 
| 96 | -	private function load_dependencies() {
 | |
| 96 | +	private function load_dependencies() { | |
| 97 | 97 | /** | 
| 98 | 98 | * The class responsible for orchestrating the actions and filters of the | 
| 99 | 99 | * core plugin. | 
| @@ -117,7 +117,7 @@ discard block | ||
| 117 | 117 | * @since 1.0.0 | 
| 118 | 118 | * @access private | 
| 119 | 119 | */ | 
| 120 | -	private function define_admin_hooks() {
 | |
| 120 | +	private function define_admin_hooks() { | |
| 121 | 121 | $plugin_admin = new Yikes_Inc_Easy_Mailchimp_Forms_Admin( $this->get_yikes_inc_easy_mailchimp_extender(), $this->get_version(), $this->form_interface ); | 
| 122 | 122 | $plugin_admin->hooks(); | 
| 123 | 123 | $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' ); | 
| @@ -130,7 +130,7 @@ discard block | ||
| 130 | 130 | * @since 1.0.0 | 
| 131 | 131 | * @access private | 
| 132 | 132 | */ | 
| 133 | -	private function define_public_hooks() {
 | |
| 133 | +	private function define_public_hooks() { | |
| 134 | 134 | $plugin_public = new Yikes_Inc_Easy_Mailchimp_Extender_Public( $this->get_yikes_inc_easy_mailchimp_extender(), $this->get_version() ); | 
| 135 | 135 | } | 
| 136 | 136 | /** | 
| @@ -138,7 +138,7 @@ discard block | ||
| 138 | 138 | * | 
| 139 | 139 | * @since 1.0.0 | 
| 140 | 140 | */ | 
| 141 | -	public function run() {
 | |
| 141 | +	public function run() { | |
| 142 | 142 | $this->loader->run(); | 
| 143 | 143 | } | 
| 144 | 144 | /** | 
| @@ -148,7 +148,7 @@ discard block | ||
| 148 | 148 | * @since 1.0.0 | 
| 149 | 149 | * @return string The name of the plugin. | 
| 150 | 150 | */ | 
| 151 | -	public function get_yikes_inc_easy_mailchimp_extender() {
 | |
| 151 | +	public function get_yikes_inc_easy_mailchimp_extender() { | |
| 152 | 152 | return $this->yikes_inc_easy_mailchimp_extender; | 
| 153 | 153 | } | 
| 154 | 154 | /** | 
| @@ -157,7 +157,7 @@ discard block | ||
| 157 | 157 | * @since 1.0.0 | 
| 158 | 158 | * @return Yikes_Inc_Easy_Mailchimp_Extender_Loader Orchestrates the hooks of the plugin. | 
| 159 | 159 | */ | 
| 160 | -	public function get_loader() {
 | |
| 160 | +	public function get_loader() { | |
| 161 | 161 | return $this->loader; | 
| 162 | 162 | } | 
| 163 | 163 | /** | 
| @@ -166,7 +166,7 @@ discard block | ||
| 166 | 166 | * @since 1.0.0 | 
| 167 | 167 | * @return string The version number of the plugin. | 
| 168 | 168 | */ | 
| 169 | -	public function get_version() {
 | |
| 169 | +	public function get_version() { | |
| 170 | 170 | return $this->version; | 
| 171 | 171 | } | 
| 172 | 172 | } | 
| @@ -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' ); | 
| @@ -7,8 +7,7 @@ | ||
| 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 | 12 |  		public function __construct() { | 
| 14 | 13 | |