@@ -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 | } |
@@ -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 | |
@@ -5,18 +5,18 @@ discard block |
||
| 5 | 5 | * @since 6.0.3 |
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | -class YIKES_MailChimp_Visual_Composer_Extension {
|
|
| 8 | +class YIKES_MailChimp_Visual_Composer_Extension { |
|
| 9 | 9 | |
| 10 | 10 | /** |
| 11 | 11 | * Constructor |
| 12 | 12 | * |
| 13 | 13 | * @since 6.0.3 |
| 14 | 14 | */ |
| 15 | - function __construct() {
|
|
| 15 | + function __construct() { |
|
| 16 | 16 | |
| 17 | 17 | add_action( 'admin_init', array( $this, 'extend_visual_composer' ) ); |
| 18 | 18 | |
| 19 | - if ( function_exists( 'vc_add_shortcode_param' ) ) {
|
|
| 19 | + if ( function_exists( 'vc_add_shortcode_param' ) ) { |
|
| 20 | 20 | vc_add_shortcode_param( 'yikes_mailchimp_logo', array( $this, 'yikes_mailchimp_logo_vc_section' ) ); |
| 21 | 21 | } |
| 22 | 22 | } |
@@ -26,9 +26,9 @@ discard block |
||
| 26 | 26 | * |
| 27 | 27 | * @since 6.0.3 |
| 28 | 28 | */ |
| 29 | - public function extend_visual_composer() {
|
|
| 29 | + public function extend_visual_composer() { |
|
| 30 | 30 | |
| 31 | - if ( ! function_exists( 'vc_map' ) ) {
|
|
| 31 | + if ( ! function_exists( 'vc_map' ) ) { |
|
| 32 | 32 | return; |
| 33 | 33 | } |
| 34 | 34 | |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | * |
| 99 | 99 | * @since 6.0.3 |
| 100 | 100 | */ |
| 101 | - public function yikes_mailchimp_logo_vc_section() {
|
|
| 101 | + public function yikes_mailchimp_logo_vc_section() { |
|
| 102 | 102 | return '<img style="width:250px;display:block;margin:0 auto;" src="' . YIKES_MC_URL . 'includes/images/Welcome_Page/mailchimp-logo.png" title="' . __( 'Easy Forms for MailChimp', 'yikes-inc-easy-mailchimp-extender' ) . '" />'; |
| 103 | 103 | } |
| 104 | 104 | |
@@ -107,17 +107,17 @@ discard block |
||
| 107 | 107 | * |
| 108 | 108 | * @since 6.0.3 |
| 109 | 109 | */ |
| 110 | - public function yikes_mailchimp_retreive_user_created_forms() {
|
|
| 110 | + public function yikes_mailchimp_retreive_user_created_forms() { |
|
| 111 | 111 | $interface = yikes_easy_mailchimp_extender_get_form_interface(); |
| 112 | 112 | $all_forms = $interface->get_all_forms(); |
| 113 | 113 | |
| 114 | 114 | $lists = array(); |
| 115 | - if ( ! empty( $all_forms ) ) {
|
|
| 115 | + if ( ! empty( $all_forms ) ) { |
|
| 116 | 116 | // build an array to pass to our javascript |
| 117 | - foreach ( $all_forms as $id => $form ) {
|
|
| 117 | + foreach ( $all_forms as $id => $form ) { |
|
| 118 | 118 | $lists[ $form['form_name'] ] = $id; |
| 119 | 119 | } |
| 120 | - } else {
|
|
| 120 | + } else { |
|
| 121 | 121 | $lists[ __( 'Please Import Some MailChimp Lists', 'yikes-inc-easy-mailchimp-extender' ) ] = '-'; |
| 122 | 122 | } |
| 123 | 123 | |