Completed
Push — master ( d1a272...91e5db )
by
unknown
04:07
created
includes/admin/pages/calendars.php 1 patch
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 use SimpleCalendar\Abstracts\Calendar;
10 10
 use SimpleCalendar\Abstracts\Admin_Page;
11 11
 
12
-if ( ! defined( 'ABSPATH' ) ) {
12
+if ( ! defined('ABSPATH')) {
13 13
 	exit;
14 14
 }
15 15
 
@@ -39,20 +39,20 @@  discard block
 block discarded – undo
39 39
 
40 40
 		$this->id               = 'calendars';
41 41
 		$this->option_group     = 'settings';
42
-		$this->label            = __( 'Calendars', 'google-calendar-events' );
42
+		$this->label            = __('Calendars', 'google-calendar-events');
43 43
 		//$this->description      = __( 'Manage calendar preferences and calendar types settings and options.', 'google-calendar-events' );
44 44
 
45 45
 		$calendars = simcal_get_calendar_types();
46 46
 		$calendar_settings = array();
47
-		if ( ! empty( $calendars ) && is_array( $calendars ) ) {
48
-			foreach ( $calendars as $calendar => $views ) {
47
+		if ( ! empty($calendars) && is_array($calendars)) {
48
+			foreach ($calendars as $calendar => $views) {
49 49
 
50
-				$calendar_type = simcal_get_calendar( $calendar );
50
+				$calendar_type = simcal_get_calendar($calendar);
51 51
 
52
-				if ( $calendar_type instanceof Calendar ) {
52
+				if ($calendar_type instanceof Calendar) {
53 53
 					$settings = $calendar_type->settings_fields();
54
-					if ( ! empty( $settings ) ) {
55
-						$calendar_settings[ $calendar ] = $settings;
54
+					if ( ! empty($settings)) {
55
+						$calendar_settings[$calendar] = $settings;
56 56
 					}
57 57
 				}
58 58
 			}
@@ -74,17 +74,17 @@  discard block
 block discarded – undo
74 74
 
75 75
 		$sections = array(
76 76
 			'general' => array(
77
-				'title'       => __( 'General', 'google-calendar-events' ),
77
+				'title'       => __('General', 'google-calendar-events'),
78 78
 				'description' => '',
79 79
 			),
80 80
 		);
81 81
 
82 82
 		$calendar_types = $this->calendar_types;
83 83
 
84
-		if ( ! empty( $calendar_types ) && is_array( $calendar_types ) ) {
85
-			foreach ( $calendar_types as $calendar_type => $type ) {
84
+		if ( ! empty($calendar_types) && is_array($calendar_types)) {
85
+			foreach ($calendar_types as $calendar_type => $type) {
86 86
 
87
-				$sections[ $calendar_type ] = array(
87
+				$sections[$calendar_type] = array(
88 88
 					'title' => $type['name'],
89 89
 					'description' => $type['description'],
90 90
 				);
@@ -92,14 +92,14 @@  discard block
 block discarded – undo
92 92
 			}
93 93
 		}
94 94
 
95
-		arsort( $calendar_types );
95
+		arsort($calendar_types);
96 96
 
97 97
 		$sections['poweredby'] = array(
98
-			'title' => __( 'Show Some Love', 'google-calendar-events' ),
98
+			'title' => __('Show Some Love', 'google-calendar-events'),
99 99
 			'description' => '',
100 100
 		);
101 101
 
102
-		return apply_filters( 'simcal_add_' . $this->option_group . '_' . $this->id .'_sections', $sections );
102
+		return apply_filters('simcal_add_'.$this->option_group.'_'.$this->id.'_sections', $sections);
103 103
 	}
104 104
 
105 105
 	/**
@@ -113,11 +113,11 @@  discard block
 block discarded – undo
113 113
 
114 114
 		$fields       = array();
115 115
 		$feed_types   = $this->calendar_types;
116
-		$this->values = get_option( 'simple-calendar_' . $this->option_group . '_' . $this->id );
116
+		$this->values = get_option('simple-calendar_'.$this->option_group.'_'.$this->id);
117 117
 
118
-		foreach ( $this->sections as $section => $contents ) :
118
+		foreach ($this->sections as $section => $contents) :
119 119
 
120
-			if ( 'general' == $section ) {
120
+			if ('general' == $section) {
121 121
 
122 122
 				$options    = array();
123 123
 				$post_types = get_post_types(
@@ -129,54 +129,54 @@  discard block
 block discarded – undo
129 129
 					'objects',
130 130
 					'not'
131 131
 				);
132
-				unset( $post_types['attachment'] );
133
-				unset( $post_types['calendar'] );
134
-				unset( $post_types['gce_feed'] );
135
-				foreach ( $post_types as $slug => $post_type ) {
136
-					$options[ $slug ] = $post_type->label;
132
+				unset($post_types['attachment']);
133
+				unset($post_types['calendar']);
134
+				unset($post_types['gce_feed']);
135
+				foreach ($post_types as $slug => $post_type) {
136
+					$options[$slug] = $post_type->label;
137 137
 				}
138
-				asort( $options );
138
+				asort($options);
139 139
 
140
-				$fields[ $section ][] = array(
140
+				$fields[$section][] = array(
141 141
 					'type'        => 'select',
142 142
 					'multiselect' => 'multiselect',
143 143
 					'enhanced'    => 'enhanced',
144
-					'title'       => __( 'Attach Calendars', 'google-calendar-events' ),
145
-					'tooltip'     => __( 'You can choose on which content types to add the ability to attach calendars.', 'google-calendar-events' ),
146
-					'name'        => 'simple-calendar_' . $this->option_group . '_' . $this->id . '[' . $section . '][attach_calendars_posts]',
147
-					'id'          => 'simple-calendar-' . $this->option_group . '-' . $this->id . '-attach-calendars-posts',
148
-					'value'       => $this->get_option_value( $section, 'attach_calendars_posts' ),
144
+					'title'       => __('Attach Calendars', 'google-calendar-events'),
145
+					'tooltip'     => __('You can choose on which content types to add the ability to attach calendars.', 'google-calendar-events'),
146
+					'name'        => 'simple-calendar_'.$this->option_group.'_'.$this->id.'['.$section.'][attach_calendars_posts]',
147
+					'id'          => 'simple-calendar-'.$this->option_group.'-'.$this->id.'-attach-calendars-posts',
148
+					'value'       => $this->get_option_value($section, 'attach_calendars_posts'),
149 149
 					'default'     => 'post,page',
150 150
 					'options'     => $options,
151 151
 				);
152 152
 
153
-			} elseif ( isset( $feed_types[ $section ]['fields'] ) ) {
153
+			} elseif (isset($feed_types[$section]['fields'])) {
154 154
 
155
-				foreach ( $feed_types[ $section ]['fields'] as $key => $args ) {
155
+				foreach ($feed_types[$section]['fields'] as $key => $args) {
156 156
 
157
-					$fields[ $section ][] = array_merge( $args, array(
158
-						'name'  => 'simple-calendar_' . $this->option_group . '_' . $this->id . '[' . $section . '][' . $key . ']',
159
-						'id'    => 'simple-calendar-' . $this->option_group . '-' . $this->id . '-' . $key,
160
-						'value' => $this->get_option_value( $section, $key )
161
-					) );
157
+					$fields[$section][] = array_merge($args, array(
158
+						'name'  => 'simple-calendar_'.$this->option_group.'_'.$this->id.'['.$section.']['.$key.']',
159
+						'id'    => 'simple-calendar-'.$this->option_group.'-'.$this->id.'-'.$key,
160
+						'value' => $this->get_option_value($section, $key)
161
+					));
162 162
 
163 163
 				}
164 164
 
165
-			} elseif ( 'poweredby' == $section ) {
165
+			} elseif ('poweredby' == $section) {
166 166
 
167
-				$fields[ $section ][] = array(
167
+				$fields[$section][] = array(
168 168
 					'type'      => 'checkbox',
169
-					'title'     => __( 'Powered by Simple Calendar', 'google-calendar-events' ),
170
-					'tooltip'   => __( 'Help our plugin get noticed and display a small link to our plugin below your calendars. Thanks!', 'google-calendar-events' ),
171
-					'name'      => 'simple-calendar_' . $this->option_group . '_' . $this->id . '[' . $section . '][opt_in]',
172
-					'id'        => 'simple-calendar-' . $this->option_group . '-' . $this->id . '-poweredby-optin',
173
-					'value'     => $this->get_option_value( $section, 'opt_in' ),
169
+					'title'     => __('Powered by Simple Calendar', 'google-calendar-events'),
170
+					'tooltip'   => __('Help our plugin get noticed and display a small link to our plugin below your calendars. Thanks!', 'google-calendar-events'),
171
+					'name'      => 'simple-calendar_'.$this->option_group.'_'.$this->id.'['.$section.'][opt_in]',
172
+					'id'        => 'simple-calendar-'.$this->option_group.'-'.$this->id.'-poweredby-optin',
173
+					'value'     => $this->get_option_value($section, 'opt_in'),
174 174
 				);
175 175
 			}
176 176
 
177 177
 		endforeach;
178 178
 
179
-		return apply_filters( 'simcal_add_' . $this->option_group . '_' . $this->id . '_fields', $fields );
179
+		return apply_filters('simcal_add_'.$this->option_group.'_'.$this->id.'_fields', $fields);
180 180
 	}
181 181
 
182 182
 }
Please login to merge, or discard this patch.
includes/admin/pages/feeds.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 use SimpleCalendar\Abstracts\Feed;
10 10
 use SimpleCalendar\Abstracts\Admin_Page;
11 11
 
12
-if ( ! defined( 'ABSPATH' ) ) {
12
+if ( ! defined('ABSPATH')) {
13 13
 	exit;
14 14
 }
15 15
 
@@ -39,20 +39,20 @@  discard block
 block discarded – undo
39 39
 
40 40
 		$this->id           = 'feeds';
41 41
 		$this->option_group = 'settings';
42
-		$this->label        = __( 'Event Sources', 'google-calendar-events' );
42
+		$this->label        = __('Event Sources', 'google-calendar-events');
43 43
 		//$this->description  = __( 'Manage calendar event sources settings.', 'google-calendar-events' );
44 44
 
45 45
 		$feeds_settings = array();
46 46
 		$feeds = simcal_get_feed_types();
47
-		if ( ! empty( $feeds ) && is_array( $feeds ) ) {
48
-			foreach ( $feeds as $feed ) {
47
+		if ( ! empty($feeds) && is_array($feeds)) {
48
+			foreach ($feeds as $feed) {
49 49
 
50
-				$feed_type = simcal_get_feed( $feed );
50
+				$feed_type = simcal_get_feed($feed);
51 51
 
52
-				if ( $feed_type instanceof Feed ) {
52
+				if ($feed_type instanceof Feed) {
53 53
 					$settings = $feed_type->settings_fields();
54
-					if ( ! empty( $settings ) ) {
55
-						$feeds_settings[ $feed ] = $settings;
54
+					if ( ! empty($settings)) {
55
+						$feeds_settings[$feed] = $settings;
56 56
 					}
57 57
 				}
58 58
 			}
@@ -74,18 +74,18 @@  discard block
 block discarded – undo
74 74
 
75 75
 		$sections = array();
76 76
 
77
-		foreach ( $this->feed_types as $feed_type => $type ) {
77
+		foreach ($this->feed_types as $feed_type => $type) {
78 78
 
79
-			$sections[ $feed_type ] = array(
79
+			$sections[$feed_type] = array(
80 80
 				'title'       => $type['name'],
81 81
 				'description' => $type['description'],
82 82
 			);
83 83
 
84 84
 		}
85 85
 
86
-		arsort( $sections );
86
+		arsort($sections);
87 87
 
88
-		return apply_filters( 'simcal_add_' . $this->option_group . '_' . $this->id .'_sections', $sections );
88
+		return apply_filters('simcal_add_'.$this->option_group.'_'.$this->id.'_sections', $sections);
89 89
 	}
90 90
 
91 91
 	/**
@@ -99,25 +99,25 @@  discard block
 block discarded – undo
99 99
 
100 100
 		$fields       = array();
101 101
 		$feed_types   = $this->feed_types;
102
-		$this->values = get_option( 'simple-calendar_' . $this->option_group . '_' . $this->id );
102
+		$this->values = get_option('simple-calendar_'.$this->option_group.'_'.$this->id);
103 103
 
104
-		foreach ( $this->sections as $type => $contents ) :
104
+		foreach ($this->sections as $type => $contents) :
105 105
 
106
-			if ( isset( $feed_types[ $type ]['fields'] ) ) {
107
-				foreach ( $feed_types[ $type ]['fields'] as $key => $args ) {
106
+			if (isset($feed_types[$type]['fields'])) {
107
+				foreach ($feed_types[$type]['fields'] as $key => $args) {
108 108
 
109
-					$fields[ $type ][] = array_merge( $args, array(
110
-						'name'  => 'simple-calendar_' . $this->option_group . '_' . $this->id . '[' . $type . '][' . $key . ']',
111
-						'id'    => 'simple-calendar-' . $this->option_group . '-' . $this->id . '-' . $type . '-' . $key,
112
-						'value' => $this->get_option_value( $type, $key )
113
-					) );
109
+					$fields[$type][] = array_merge($args, array(
110
+						'name'  => 'simple-calendar_'.$this->option_group.'_'.$this->id.'['.$type.']['.$key.']',
111
+						'id'    => 'simple-calendar-'.$this->option_group.'-'.$this->id.'-'.$type.'-'.$key,
112
+						'value' => $this->get_option_value($type, $key)
113
+					));
114 114
 
115 115
 				}
116 116
 			}
117 117
 
118 118
 		endforeach;
119 119
 
120
-		return apply_filters( 'simcal_add_' . $this->option_group . '_' . $this->id . '_fields', $fields );
120
+		return apply_filters('simcal_add_'.$this->option_group.'_'.$this->id.'_fields', $fields);
121 121
 	}
122 122
 
123 123
 }
Please login to merge, or discard this patch.
includes/admin/pages/licenses.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -75,8 +75,8 @@
 block discarded – undo
75 75
 			'keys' => array(
76 76
 				'title' => __( 'Premium Add-on License Keys', 'google-calendar-events' ),
77 77
 				'description' => __( 'Enter your add-on license keys below, making sure to activate each one to ensure they are valid.', 'google-calendar-events' ) .
78
-				                 '<br/><br/>' .
79
-				                 '<em>' . __( 'Your license keys are used for access to automatic upgrades and premium support.', 'google-calendar-events' ) . '</em>',
78
+								 '<br/><br/>' .
79
+								 '<em>' . __( 'Your license keys are used for access to automatic upgrades and premium support.', 'google-calendar-events' ) . '</em>',
80 80
 			),
81 81
 		);
82 82
 		return apply_filters( 'simcal_add_' . $this->option_group . '_' . $this->id .'_sections', $sections );
Please login to merge, or discard this patch.
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 
9 9
 use SimpleCalendar\Abstracts\Admin_Page;
10 10
 
11
-if ( ! defined( 'ABSPATH' ) ) {
11
+if ( ! defined('ABSPATH')) {
12 12
 	exit;
13 13
 }
14 14
 
@@ -30,16 +30,16 @@  discard block
 block discarded – undo
30 30
 
31 31
 		$this->id           = $tab = 'licenses';
32 32
 		$this->option_group = $page = 'settings';
33
-		$this->label        = __( 'Add-on Licenses', 'google-calendar-events' );
33
+		$this->label        = __('Add-on Licenses', 'google-calendar-events');
34 34
 		//$this->description  = __( 'Manage your premium add-on license keys.', 'google-calendar-events' );
35 35
 		$this->sections     = $this->add_sections();
36 36
 		$this->fields       = $this->add_fields();
37 37
 
38 38
 		// Disabled the 'save changes' button for this page.
39
-		add_filter( 'simcal_admin_page_' . $page . '_' . $tab . '_submit', function() { return false; } );
39
+		add_filter('simcal_admin_page_'.$page.'_'.$tab.'_submit', function() { return false; } );
40 40
 
41 41
 		// Add html to page.
42
-		add_action( 'simcal_admin_page_' . $page . '_' . $tab . '_end', array( __CLASS__, 'html' ) );
42
+		add_action('simcal_admin_page_'.$page.'_'.$tab.'_end', array(__CLASS__, 'html'));
43 43
 	}
44 44
 
45 45
 	/**
@@ -49,14 +49,14 @@  discard block
 block discarded – undo
49 49
 	 *
50 50
 	 * @return void
51 51
 	 */
52
-	public static function html()  {
52
+	public static function html() {
53 53
 		// Add a nonce field used in ajax.
54
-		wp_nonce_field( 'simcal_license_manager', 'simcal_license_manager' );
54
+		wp_nonce_field('simcal_license_manager', 'simcal_license_manager');
55 55
 		// Add a license 'reset' button.
56 56
 		?>
57 57
 		<br><br>
58
-		<a href="#" id="simcal-reset-licenses" data-dialog="<?php _e( 'WARNING: Are you sure you want to start over and delete all license keys from the settings?', 'google-calendar-events' ) ?>">
59
-			<?php _e( 'Delete your license keys', 'google-calendar-events' ) ?>
58
+		<a href="#" id="simcal-reset-licenses" data-dialog="<?php _e('WARNING: Are you sure you want to start over and delete all license keys from the settings?', 'google-calendar-events') ?>">
59
+			<?php _e('Delete your license keys', 'google-calendar-events') ?>
60 60
 			<i class="simcal-icon-spinner simcal-icon-spin" style="display: none;"></i>
61 61
 		</a>
62 62
 		<?php
@@ -73,13 +73,13 @@  discard block
 block discarded – undo
73 73
 	public function add_sections() {
74 74
 		$sections = array(
75 75
 			'keys' => array(
76
-				'title' => __( 'Premium Add-on License Keys', 'google-calendar-events' ),
77
-				'description' => __( 'Enter your add-on license keys below, making sure to activate each one to ensure they are valid.', 'google-calendar-events' ) .
78
-				                 '<br/><br/>' .
79
-				                 '<em>' . __( 'Your license keys are used for access to automatic upgrades and premium support.', 'google-calendar-events' ) . '</em>',
76
+				'title' => __('Premium Add-on License Keys', 'google-calendar-events'),
77
+				'description' => __('Enter your add-on license keys below, making sure to activate each one to ensure they are valid.', 'google-calendar-events').
78
+				                 '<br/><br/>'.
79
+				                 '<em>'.__('Your license keys are used for access to automatic upgrades and premium support.', 'google-calendar-events').'</em>',
80 80
 			),
81 81
 		);
82
-		return apply_filters( 'simcal_add_' . $this->option_group . '_' . $this->id .'_sections', $sections );
82
+		return apply_filters('simcal_add_'.$this->option_group.'_'.$this->id.'_sections', $sections);
83 83
 	}
84 84
 
85 85
 	/**
@@ -92,25 +92,25 @@  discard block
 block discarded – undo
92 92
 	public function add_fields() {
93 93
 
94 94
 		$fields = array();
95
-		$this->values = get_option( 'simple-calendar_' . $this->option_group . '_' . $this->id );
95
+		$this->values = get_option('simple-calendar_'.$this->option_group.'_'.$this->id);
96 96
 
97
-		foreach ( $this->sections as $section => $contents ) {
97
+		foreach ($this->sections as $section => $contents) {
98 98
 
99
-			if ( 'keys' == $section ) {
99
+			if ('keys' == $section) {
100 100
 
101
-				$addons = apply_filters( 'simcal_installed_addons', array() );
101
+				$addons = apply_filters('simcal_installed_addons', array());
102 102
 
103
-				if ( ! empty( $addons ) && is_array( $addons ) ) {
103
+				if ( ! empty($addons) && is_array($addons)) {
104 104
 
105
-					foreach ( $addons as $addon_id => $addon_name ) {
105
+					foreach ($addons as $addon_id => $addon_name) {
106 106
 
107
-						$fields[ $section ][ $addon_id ] = array(
107
+						$fields[$section][$addon_id] = array(
108 108
 							'type'      => 'license',
109 109
 							'addon'     => $addon_id,
110
-							'title'     => esc_attr( $addon_name ),
111
-							'name'      => 'simple-calendar_' . $this->option_group . '_' . $this->id . '[' . $section . '][' . $addon_id . ']',
112
-							'id'        => 'simple-calendar-' . $this->option_group . '-' . $this->id . '-' . $section . '-' . sanitize_key( $addon_id ),
113
-							'value'     => $this->get_option_value( $section, $addon_id ),
110
+							'title'     => esc_attr($addon_name),
111
+							'name'      => 'simple-calendar_'.$this->option_group.'_'.$this->id.'['.$section.']['.$addon_id.']',
112
+							'id'        => 'simple-calendar-'.$this->option_group.'-'.$this->id.'-'.$section.'-'.sanitize_key($addon_id),
113
+							'value'     => $this->get_option_value($section, $addon_id),
114 114
 							'class'     => array(
115 115
 								'regular-text',
116 116
 								'ltr',
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 
126 126
 		}
127 127
 
128
-		return apply_filters( 'simcal_add_' . $this->option_group . '_' . $this->id . '_fields', $fields );
128
+		return apply_filters('simcal_add_'.$this->option_group.'_'.$this->id.'_fields', $fields);
129 129
 	}
130 130
 
131 131
 }
Please login to merge, or discard this patch.
includes/admin/pages/system-status.php 1 patch
Spacing   +167 added lines, -167 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 
9 9
 use SimpleCalendar\Abstracts\Admin_Page;
10 10
 
11
-if ( ! defined( 'ABSPATH' ) ) {
11
+if ( ! defined('ABSPATH')) {
12 12
 	exit;
13 13
 }
14 14
 
@@ -30,16 +30,16 @@  discard block
 block discarded – undo
30 30
 
31 31
 		$this->id           = $tab = 'system-status';
32 32
 		$this->option_group = $page = 'tools';
33
-		$this->label        = __( 'System Report', 'google-calendar-events' );
33
+		$this->label        = __('System Report', 'google-calendar-events');
34 34
 		$this->description  = '';
35 35
 		$this->sections     = $this->add_sections();
36 36
 		$this->fields       = $this->add_fields();
37 37
 
38 38
 		// Disable the submit button for this page.
39
-		add_filter( 'simcal_admin_page_' . $page . '_' . $tab . '_submit', function() { return false; } );
39
+		add_filter('simcal_admin_page_'.$page.'_'.$tab.'_submit', function() { return false; } );
40 40
 
41 41
 		// Add html.
42
-		add_action( 'simcal_admin_page_' . $page . '_' . $tab . '_end', array( $this, 'html' ) );
42
+		add_action('simcal_admin_page_'.$page.'_'.$tab.'_end', array($this, 'html'));
43 43
 	}
44 44
 
45 45
 	/**
@@ -51,37 +51,37 @@  discard block
 block discarded – undo
51 51
 
52 52
 		?>
53 53
 		<div id="simcal-system-status-report">
54
-			<p><?php _e( 'Please copy and paste this information when contacting support:', 'google-calendar-events' ); ?> </p>
54
+			<p><?php _e('Please copy and paste this information when contacting support:', 'google-calendar-events'); ?> </p>
55 55
 			<textarea readonly="readonly" onclick="this.select();"></textarea>
56
-			<p><?php _e( 'You can also download your information as a text file to attach, or simply view it below.', 'google-calendar-events' ); ?></p>
57
-			<p><a href="#" id="simcal-system-status-report-download" class="button button-primary"><?php _e( 'Download System Report', 'google-calendar-events' ); ?></a></p>
56
+			<p><?php _e('You can also download your information as a text file to attach, or simply view it below.', 'google-calendar-events'); ?></p>
57
+			<p><a href="#" id="simcal-system-status-report-download" class="button button-primary"><?php _e('Download System Report', 'google-calendar-events'); ?></a></p>
58 58
 		</div>
59 59
 		<hr>
60 60
 		<?php
61 61
 
62 62
 		global $wpdb;
63
-		$wp_version = get_bloginfo( 'version' );
63
+		$wp_version = get_bloginfo('version');
64 64
 
65 65
 		$sections = array();
66 66
 		$panels   = array(
67 67
 			'wordpress' => array(
68
-				'label'  => __( 'WordPress Installation', 'google-calendar-events' ),
68
+				'label'  => __('WordPress Installation', 'google-calendar-events'),
69 69
 				'export' => 'WordPress Installation',
70 70
 			),
71 71
 			'theme'     => array(
72
-				'label'  => __( 'Active Theme', 'google-calendar-events' ),
72
+				'label'  => __('Active Theme', 'google-calendar-events'),
73 73
 				'export' => 'Active Theme',
74 74
 			),
75 75
 			'plugins'   => array(
76
-				'label'  => __( 'Active Plugins', 'google-calendar-events' ),
76
+				'label'  => __('Active Plugins', 'google-calendar-events'),
77 77
 				'export' => 'Active Plugins',
78 78
 			),
79 79
 			'server'    => array(
80
-				'label'  => __( 'Server Environment', 'google-calendar-events' ),
80
+				'label'  => __('Server Environment', 'google-calendar-events'),
81 81
 				'export' => 'Server Environment',
82 82
 			),
83 83
 			'client'    => array(
84
-				'label'  => __( 'Client Information', 'google-calendar-events' ),
84
+				'label'  => __('Client Information', 'google-calendar-events'),
85 85
 				'export' => 'Client Information',
86 86
 			)
87 87
 		);
@@ -98,68 +98,68 @@  discard block
 block discarded – undo
98 98
 		 * ======================
99 99
 		 */
100 100
 
101
-		$debug_mode = $script_debug = __( 'No', 'google-calendar-events' );
102
-		if ( defined( 'WP_DEBUG' ) ) {
103
-			$debug_mode = true === WP_DEBUG ? __( 'Yes', 'google-calendar-events' ) : $debug_mode;
101
+		$debug_mode = $script_debug = __('No', 'google-calendar-events');
102
+		if (defined('WP_DEBUG')) {
103
+			$debug_mode = true === WP_DEBUG ? __('Yes', 'google-calendar-events') : $debug_mode;
104 104
 		}
105
-		if ( defined( 'SCRIPT_DEBUG' ) ) {
106
-			$script_debug = true === SCRIPT_DEBUG ? __( 'Yes', 'google-calendar-events' ) : $script_debug;
105
+		if (defined('SCRIPT_DEBUG')) {
106
+			$script_debug = true === SCRIPT_DEBUG ? __('Yes', 'google-calendar-events') : $script_debug;
107 107
 		}
108 108
 
109
-		$memory = $this->let_to_num( WP_MEMORY_LIMIT );
110
-		$memory_export = size_format( $memory );
111
-		if ( $memory < 67108864 ) {
112
-			$memory = '<mark class="error">' . sprintf( __( '%1$s - It is recomendend to set memory to at least 64MB. See: <a href="%2$s" target="_blank">Increasing memory allocated to PHP</a>', 'google-calendar-events' ), $memory_export, 'http://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP' ) . '</mark>';
109
+		$memory = $this->let_to_num(WP_MEMORY_LIMIT);
110
+		$memory_export = size_format($memory);
111
+		if ($memory < 67108864) {
112
+			$memory = '<mark class="error">'.sprintf(__('%1$s - It is recomendend to set memory to at least 64MB. See: <a href="%2$s" target="_blank">Increasing memory allocated to PHP</a>', 'google-calendar-events'), $memory_export, 'http://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP').'</mark>';
113 113
 		} else {
114
-			$memory = '<mark class="ok">' . $memory_export . '</mark>';
114
+			$memory = '<mark class="ok">'.$memory_export.'</mark>';
115 115
 		}
116 116
 
117
-		$permalinks = get_option( 'permalink_structure' );
118
-		$permalinks = empty( $permalinks ) ? '/?' : $permalinks;
117
+		$permalinks = get_option('permalink_structure');
118
+		$permalinks = empty($permalinks) ? '/?' : $permalinks;
119 119
 
120 120
 		$is_multisite = is_multisite();
121 121
 
122 122
 		$sections['wordpress'] = array(
123 123
 			'name'          => array(
124
-				'label'  => __( 'Site Name', 'google-calendar-events' ),
124
+				'label'  => __('Site Name', 'google-calendar-events'),
125 125
 				'label_export' => 'Site Name',
126
-				'result' => get_bloginfo( 'name' ),
126
+				'result' => get_bloginfo('name'),
127 127
 			),
128 128
 			'home_url'      => array(
129
-				'label'  => __( 'Home URL', 'google-calendar-events' ),
129
+				'label'  => __('Home URL', 'google-calendar-events'),
130 130
 				'label_export' => 'Home URL',
131 131
 				'result' => home_url(),
132 132
 			),
133 133
 			'site_url'      => array(
134
-				'label'  => __( 'Site URL', 'google-calendar-events' ),
134
+				'label'  => __('Site URL', 'google-calendar-events'),
135 135
 				'label_export' => 'Site URL',
136 136
 				'result' => site_url(),
137 137
 			),
138 138
 			'version'       => array(
139
-				'label'  => __( 'Version', 'google-calendar-events' ),
139
+				'label'  => __('Version', 'google-calendar-events'),
140 140
 				'label_export' => 'Version',
141 141
 				'result' => $wp_version,
142 142
 			),
143 143
 			'locale'        => array(
144
-				'label'  => __( 'Locale', 'google-calendar-events' ),
144
+				'label'  => __('Locale', 'google-calendar-events'),
145 145
 				'label_export' => 'Locale',
146 146
 				'result' => get_locale(),
147 147
 			),
148 148
 			'wp_timezone'   => array(
149
-				'label'  => __( 'Timezone', 'google-calendar-events' ),
149
+				'label'  => __('Timezone', 'google-calendar-events'),
150 150
 				'label_export' => 'Timezone',
151 151
 				'result' => simcal_get_wp_timezone(),
152 152
 			),
153 153
 			'multisite'     => array(
154
-				'label'  => __( 'Multisite', 'google-calendar-events' ),
154
+				'label'  => __('Multisite', 'google-calendar-events'),
155 155
 				'label_export' => 'Multisite',
156
-				'result' => $is_multisite ? __( 'Yes', 'google-calendar-events' ) : __( 'No', 'google-calendar-events' ),
156
+				'result' => $is_multisite ? __('Yes', 'google-calendar-events') : __('No', 'google-calendar-events'),
157 157
 				'result_export' => $is_multisite ? 'Yes' : 'No'
158 158
 			),
159 159
 			'permalink'     => array(
160
-				'label'  => __( 'Permalinks', 'google-calendar-events' ),
160
+				'label'  => __('Permalinks', 'google-calendar-events'),
161 161
 				'label_export' => 'Permalinks',
162
-				'result' => '<code>' . $permalinks . '</code>',
162
+				'result' => '<code>'.$permalinks.'</code>',
163 163
 				'result_export' => $permalinks,
164 164
 			),
165 165
 			'memory_limit'  => array(
@@ -182,86 +182,86 @@  discard block
 block discarded – undo
182 182
 		 * ============
183 183
 		 */
184 184
 
185
-		include_once ABSPATH . 'wp-admin/includes/theme-install.php';
185
+		include_once ABSPATH.'wp-admin/includes/theme-install.php';
186 186
 
187
-		if ( version_compare( $wp_version, '3.4', '<' ) ) {
188
-			$active_theme  = get_theme_data( get_stylesheet_directory() . '/style.css' );
189
-			$theme_name    = '<a href="' . $active_theme['URI'] . '" target="_blank">' . $active_theme['Name'] . '</a>';
187
+		if (version_compare($wp_version, '3.4', '<')) {
188
+			$active_theme  = get_theme_data(get_stylesheet_directory().'/style.css');
189
+			$theme_name    = '<a href="'.$active_theme['URI'].'" target="_blank">'.$active_theme['Name'].'</a>';
190 190
 			$theme_version = $active_theme['Version'];
191
-			$theme_author  = '<a href="' . $active_theme['AuthorURI'] . '" target="_blank">' . $active_theme['Author'] . '</a>';
192
-			$theme_export  = $active_theme['Name'] . ' - ' . $theme_version;
191
+			$theme_author  = '<a href="'.$active_theme['AuthorURI'].'" target="_blank">'.$active_theme['Author'].'</a>';
192
+			$theme_export  = $active_theme['Name'].' - '.$theme_version;
193 193
 		} else {
194 194
 			$active_theme  = wp_get_theme();
195
-			$theme_name    = '<a href="' . $active_theme->ThemeURI . '" target="_blank">' . $active_theme->Name . '</a>';
195
+			$theme_name    = '<a href="'.$active_theme->ThemeURI.'" target="_blank">'.$active_theme->Name.'</a>';
196 196
 			$theme_version = $active_theme->Version;
197 197
 			$theme_author  = $active_theme->Author;
198
-			$theme_export  = $active_theme->Name . ' - ' . $theme_version;
198
+			$theme_export  = $active_theme->Name.' - '.$theme_version;
199 199
 		}
200 200
 
201 201
 		$theme_update_version = $theme_version;
202 202
 
203
-		$api = themes_api( 'theme_information', array(
203
+		$api = themes_api('theme_information', array(
204 204
 			'slug'   => get_template(),
205
-			'fields' => array( 'sections' => false, 'tags' => false ),
206
-		) );
207
-		if ( $api && ! is_wp_error( $api ) ) {
205
+			'fields' => array('sections' => false, 'tags' => false),
206
+		));
207
+		if ($api && ! is_wp_error($api)) {
208 208
 			$theme_update_version = $api->version;
209 209
 		}
210 210
 
211
-		if ( version_compare( $theme_version, $theme_update_version, '<' ) ) {
212
-			$theme_version = '<mark class="error">' . $theme_version . ' (' . sprintf( __( '%s is available', 'google-calendar-events' ), esc_html( $theme_update_version ) ) . ')</mark>';
211
+		if (version_compare($theme_version, $theme_update_version, '<')) {
212
+			$theme_version = '<mark class="error">'.$theme_version.' ('.sprintf(__('%s is available', 'google-calendar-events'), esc_html($theme_update_version)).')</mark>';
213 213
 		} else {
214
-			$theme_version = '<mark class="ok">' . $theme_version . '</mark>';
214
+			$theme_version = '<mark class="ok">'.$theme_version.'</mark>';
215 215
 		}
216 216
 
217 217
 		$theme  = '<dl>';
218
-		$theme .= '<dt>' . __( 'Name', 'google-calendar-events' ) . '</dt>';
219
-		$theme .= '<dd>' . $theme_name . '</dd>';
220
-		$theme .= '<dt>' . __( 'Author', 'google-calendar-events' ) . '</dt>';
221
-		$theme .= '<dd>' . $theme_author . '</dd>';
222
-		$theme .= '<dt>' . __( 'Version', 'google-calendar-events' ) . '</dt>';
223
-		$theme .= '<dd>' . $theme_version . '</dd>';
218
+		$theme .= '<dt>'.__('Name', 'google-calendar-events').'</dt>';
219
+		$theme .= '<dd>'.$theme_name.'</dd>';
220
+		$theme .= '<dt>'.__('Author', 'google-calendar-events').'</dt>';
221
+		$theme .= '<dd>'.$theme_author.'</dd>';
222
+		$theme .= '<dt>'.__('Version', 'google-calendar-events').'</dt>';
223
+		$theme .= '<dd>'.$theme_version.'</dd>';
224 224
 		$theme .= '</dl>';
225 225
 
226 226
 		$is_child_theme = is_child_theme();
227 227
 		$parent_theme = $parent_theme_export = '-';
228 228
 
229
-		if ( $is_child_theme ) {
230
-			if ( version_compare( $wp_version, '3.4', '<' ) ) {
229
+		if ($is_child_theme) {
230
+			if (version_compare($wp_version, '3.4', '<')) {
231 231
 
232 232
 				$parent_theme = $parent_theme_export = $active_theme['Template'];
233 233
 
234 234
 			} else {
235 235
 
236
-				$parent = wp_get_theme( $active_theme->Template );
236
+				$parent = wp_get_theme($active_theme->Template);
237 237
 				$parent_theme  = '<dl>';
238
-				$parent_theme .= '<dt>' . __( 'Name', 'google-calendar-events' ) .    '</dt>';
239
-				$parent_theme .= '<dd>' . $parent->Name .          '</dd>';
240
-				$parent_theme .= '<dt>' . __( 'Author', 'google-calendar-events' ) .  '</dt>';
241
-				$parent_theme .= '<dd>' . $parent->Author .        '</dd>';
242
-				$parent_theme .= '<dt>' . __( 'Version', 'google-calendar-events' ) . '</dt>';
243
-				$parent_theme .= '<dd>' . $parent->Version .       '</dd>';
238
+				$parent_theme .= '<dt>'.__('Name', 'google-calendar-events').'</dt>';
239
+				$parent_theme .= '<dd>'.$parent->Name.'</dd>';
240
+				$parent_theme .= '<dt>'.__('Author', 'google-calendar-events').'</dt>';
241
+				$parent_theme .= '<dd>'.$parent->Author.'</dd>';
242
+				$parent_theme .= '<dt>'.__('Version', 'google-calendar-events').'</dt>';
243
+				$parent_theme .= '<dd>'.$parent->Version.'</dd>';
244 244
 				$parent_theme .= '</dl>';
245 245
 
246
-				$parent_theme_export = strip_tags( $parent->Name ) . ' - ' .  $parent->Version;
246
+				$parent_theme_export = strip_tags($parent->Name).' - '.$parent->Version;
247 247
 			}
248 248
 		}
249 249
 
250 250
 		$sections['theme'] = array(
251 251
 			'theme'    => array(
252
-				'label'  => __( 'Theme Information', 'google-calendar-events' ),
252
+				'label'  => __('Theme Information', 'google-calendar-events'),
253 253
 				'label_export' => 'Theme',
254 254
 				'result' => $theme,
255 255
 				'result_export' => $theme_export,
256 256
 			),
257 257
 			'theme_child'   => array(
258
-				'label'  => __( 'Child Theme', 'google-calendar-events' ),
258
+				'label'  => __('Child Theme', 'google-calendar-events'),
259 259
 				'label_export' => 'Child Theme',
260
-				'result' => $is_child_theme ? __( 'Yes', 'google-calendar-events' ) : __( 'No', 'google-calendar-events' ),
260
+				'result' => $is_child_theme ? __('Yes', 'google-calendar-events') : __('No', 'google-calendar-events'),
261 261
 				'result_export' => $is_child_theme ? 'Yes' : 'No',
262 262
 			),
263 263
 			'theme_parent'   => array(
264
-				'label'  => __( 'Parent Theme', 'google-calendar-events' ),
264
+				'label'  => __('Parent Theme', 'google-calendar-events'),
265 265
 				'label_export' => 'Parent Theme',
266 266
 				'result' => $parent_theme,
267 267
 				'result_export' => $parent_theme_export,
@@ -273,61 +273,61 @@  discard block
 block discarded – undo
273 273
 		 * ==============
274 274
 		 */
275 275
 
276
-		include_once ABSPATH . 'wp-admin/includes/plugin-install.php';
276
+		include_once ABSPATH.'wp-admin/includes/plugin-install.php';
277 277
 
278
-		$active_plugins = (array) get_option( 'active_plugins', array() );
279
-		if ( is_multisite() ) {
280
-			$active_plugins = array_merge( $active_plugins, get_site_option( 'active_sitewide_plugins', array() ) );
278
+		$active_plugins = (array) get_option('active_plugins', array());
279
+		if (is_multisite()) {
280
+			$active_plugins = array_merge($active_plugins, get_site_option('active_sitewide_plugins', array()));
281 281
 		}
282 282
 
283
-		foreach ( $active_plugins as $plugin ) {
283
+		foreach ($active_plugins as $plugin) {
284 284
 
285
-			$plugin_data = @get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin );
285
+			$plugin_data = @get_plugin_data(WP_PLUGIN_DIR.'/'.$plugin);
286 286
 
287
-			if ( ! empty( $plugin_data['Name'] ) ) {
287
+			if ( ! empty($plugin_data['Name'])) {
288 288
 
289 289
 				$plugin_name    = $plugin_data['Title'];
290 290
 				$plugin_author  = $plugin_data['Author'];
291 291
 				$plugin_version = $plugin_update_version = $plugin_data['Version'];
292 292
 
293 293
 				// Afraid that querying many plugins may risk a timeout.
294
-				if ( count( $active_plugins ) <= 10 ) {
295
-					$api = plugins_api( 'plugin_information', array(
294
+				if (count($active_plugins) <= 10) {
295
+					$api = plugins_api('plugin_information', array(
296 296
 						'slug'   => $plugin_data['Name'],
297 297
 						'fields' => array(
298 298
 							'version' => true,
299 299
 						),
300
-					) );
301
-					if ( $api && ! is_wp_error( $api ) ) {
302
-						if ( ! empty( $api->version ) ) {
300
+					));
301
+					if ($api && ! is_wp_error($api)) {
302
+						if ( ! empty($api->version)) {
303 303
 							$plugin_update_version = $api->version;
304
-							if ( version_compare( $plugin_version, $plugin_update_version, '<' ) ) {
305
-								$plugin_version = '<mark class="error">' . $plugin_version . ' (' . sprintf( __( '%s is available', 'google-calendar-events' ), esc_html( $plugin_update_version ) ) . ')</mark>';
304
+							if (version_compare($plugin_version, $plugin_update_version, '<')) {
305
+								$plugin_version = '<mark class="error">'.$plugin_version.' ('.sprintf(__('%s is available', 'google-calendar-events'), esc_html($plugin_update_version)).')</mark>';
306 306
 							} else {
307
-								$plugin_version = '<mark class="ok">' . $plugin_version . '</mark>';
307
+								$plugin_version = '<mark class="ok">'.$plugin_version.'</mark>';
308 308
 							}
309 309
 						}
310 310
 					}
311 311
 				}
312 312
 
313 313
 				$plugin  = '<dl>';
314
-				$plugin .= '<dt>' . __( 'Author', 'google-calendar-events' ) .  '</dt>';
315
-				$plugin .= '<dd>' . $plugin_author .         '</dd>';
316
-				$plugin .= '<dt>' . __( 'Version', 'google-calendar-events' ) . '</dt>';
317
-				$plugin .= '<dd>' . $plugin_version .        '</dd>';
314
+				$plugin .= '<dt>'.__('Author', 'google-calendar-events').'</dt>';
315
+				$plugin .= '<dd>'.$plugin_author.'</dd>';
316
+				$plugin .= '<dt>'.__('Version', 'google-calendar-events').'</dt>';
317
+				$plugin .= '<dd>'.$plugin_version.'</dd>';
318 318
 				$plugin .= '</dl>';
319 319
 
320
-				$sections['plugins'][ sanitize_key( strip_tags( $plugin_name ) ) ] = array(
320
+				$sections['plugins'][sanitize_key(strip_tags($plugin_name))] = array(
321 321
 					'label'  => $plugin_name,
322
-					'label_export' => strip_tags( $plugin_data['Title'] ),
322
+					'label_export' => strip_tags($plugin_data['Title']),
323 323
 					'result' => $plugin,
324 324
 					'result_export' => $plugin_data['Version'],
325 325
 				);
326 326
 			}
327 327
 		}
328 328
 
329
-		if ( isset( $sections['plugins'] ) ) {
330
-			rsort( $sections['plugins'] );
329
+		if (isset($sections['plugins'])) {
330
+			rsort($sections['plugins']);
331 331
 		}
332 332
 
333 333
 		/**
@@ -335,51 +335,51 @@  discard block
 block discarded – undo
335 335
 		 * ==================
336 336
 		 */
337 337
 
338
-		if ( version_compare( PHP_VERSION, '5.4', '<' ) ) {
339
-			$php = '<mark class="error">' . sprintf( __( '%1$s - It is recomendend to upgrade at least to PHP version 5.4 for security reasons. <a href="%2$s" target="_blank">Read more.</a>', 'google-calendar-events' ), PHP_VERSION, 'http://www.wpupdatephp.com/update/' ) . '</mark>';
338
+		if (version_compare(PHP_VERSION, '5.4', '<')) {
339
+			$php = '<mark class="error">'.sprintf(__('%1$s - It is recomendend to upgrade at least to PHP version 5.4 for security reasons. <a href="%2$s" target="_blank">Read more.</a>', 'google-calendar-events'), PHP_VERSION, 'http://www.wpupdatephp.com/update/').'</mark>';
340 340
 		} else {
341
-			$php = '<mark class="ok">' . PHP_VERSION . '</mark>';
341
+			$php = '<mark class="ok">'.PHP_VERSION.'</mark>';
342 342
 		}
343 343
 
344
-		if ( $wpdb->use_mysqli ) {
345
-			$mysql = @mysqli_get_server_info( $wpdb->dbh );
344
+		if ($wpdb->use_mysqli) {
345
+			$mysql = @mysqli_get_server_info($wpdb->dbh);
346 346
 		} else {
347 347
 			$mysql = @mysql_get_server_info();
348 348
 		}
349 349
 
350 350
 		$host = $_SERVER['SERVER_SOFTWARE'];
351
-		if ( defined( 'WPE_APIKEY' ) ) {
351
+		if (defined('WPE_APIKEY')) {
352 352
 			$host .= ' (WP Engine)';
353
-		} elseif ( defined( 'PAGELYBIN' ) ) {
353
+		} elseif (defined('PAGELYBIN')) {
354 354
 			$host .= ' (Pagely)';
355 355
 		}
356 356
 
357 357
 		$default_timezone = $server_timezone_export = date_default_timezone_get();
358
-		if ( 'UTC' !== $default_timezone ) {
359
-			$server_timezone = '<mark class="error">' . sprintf( __( 'Server default timezone is %s - it should be UTC', 'google-calendar-events' ), $default_timezone ) . '</mark>';
358
+		if ('UTC' !== $default_timezone) {
359
+			$server_timezone = '<mark class="error">'.sprintf(__('Server default timezone is %s - it should be UTC', 'google-calendar-events'), $default_timezone).'</mark>';
360 360
 		} else {
361 361
 			$server_timezone = '<mark class="ok">UTC</mark>';
362 362
 		}
363 363
 
364 364
 		// WP Remote POST test.
365
-		$response = wp_safe_remote_post( 'https://www.paypal.com/cgi-bin/webscr', array(
365
+		$response = wp_safe_remote_post('https://www.paypal.com/cgi-bin/webscr', array(
366 366
 			'timeout'    => 60,
367 367
 			'body'       => array(
368 368
 				'cmd'    => '_notify-validate',
369 369
 			),
370
-		) );
371
-		if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) {
370
+		));
371
+		if ( ! is_wp_error($response) && $response['response']['code'] >= 200 && $response['response']['code'] < 300) {
372 372
 			$wp_post_export = 'Yes';
373
-			$wp_post = '<mark class="ok">' . __( 'Yes', 'google-calendar-events' ) . '</mark>';
373
+			$wp_post = '<mark class="ok">'.__('Yes', 'google-calendar-events').'</mark>';
374 374
 		} else {
375 375
 			$wp_post_export = 'No';
376
-			$wp_post = '<mark class="error">' . __( 'No', 'google-calendar-events' );
377
-			if ( is_wp_error( $response ) ) {
378
-				$error = ' (' . $response->get_error_message() . ')';
376
+			$wp_post = '<mark class="error">'.__('No', 'google-calendar-events');
377
+			if (is_wp_error($response)) {
378
+				$error = ' ('.$response->get_error_message().')';
379 379
 				$wp_post .= $error;
380 380
 				$wp_post_export .= $error;
381 381
 			} else {
382
-				$error = ' (' . $response['response']['code'] . ')';
382
+				$error = ' ('.$response['response']['code'].')';
383 383
 				$wp_post .= $error;
384 384
 				$wp_post_export .= $error;
385 385
 			}
@@ -387,64 +387,64 @@  discard block
 block discarded – undo
387 387
 		}
388 388
 
389 389
 		// WP Remote GET test.
390
-		$response = wp_safe_remote_get( get_home_url( '/?p=1' ) );
391
-		if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) {
390
+		$response = wp_safe_remote_get(get_home_url('/?p=1'));
391
+		if ( ! is_wp_error($response) && $response['response']['code'] >= 200 && $response['response']['code'] < 300) {
392 392
 			$wp_get_export = 'Yes';
393
-			$wp_get = '<mark class="ok">' . __( 'Yes', 'google-calendar-events' ) . '</mark>';
393
+			$wp_get = '<mark class="ok">'.__('Yes', 'google-calendar-events').'</mark>';
394 394
 		} else {
395 395
 			$wp_get_export = 'No';
396
-			$wp_get = '<mark class="error">' . __( 'No', 'google-calendar-events' );
397
-			if ( is_wp_error( $response ) ) {
398
-				$error = ' (' . $response->get_error_message() . ')';
396
+			$wp_get = '<mark class="error">'.__('No', 'google-calendar-events');
397
+			if (is_wp_error($response)) {
398
+				$error = ' ('.$response->get_error_message().')';
399 399
 				$wp_get .= $error;
400 400
 				$wp_get_export .= $error;
401 401
 			} else {
402
-				$error = ' (' . $response['response']['code'] . ')';
402
+				$error = ' ('.$response['response']['code'].')';
403 403
 				$wp_get .= $error;
404 404
 				$wp_get_export .= $error;
405 405
 			}
406 406
 			$wp_get .= '</mark>';
407 407
 		}
408 408
 
409
-		$php_memory_limit        = ini_get( 'memory_limit' );
410
-		$php_max_upload_filesize = ini_get( 'upload_max_filesize' );
411
-		$php_post_max_size       = ini_get( 'post_max_size' );
412
-		$php_max_execution_time  = ini_get( 'max_execution_time' );
413
-		$php_max_input_vars      = ini_get( 'max_input_vars' );
409
+		$php_memory_limit        = ini_get('memory_limit');
410
+		$php_max_upload_filesize = ini_get('upload_max_filesize');
411
+		$php_post_max_size       = ini_get('post_max_size');
412
+		$php_max_execution_time  = ini_get('max_execution_time');
413
+		$php_max_input_vars      = ini_get('max_input_vars');
414 414
 
415 415
 		$sections['server'] = array(
416 416
 			'host'                => array(
417
-				'label'  => __( 'Web Server', 'google-calendar-events' ),
417
+				'label'  => __('Web Server', 'google-calendar-events'),
418 418
 				'label_export' => 'Web Server',
419 419
 				'result' => $host,
420 420
 			),
421 421
 			'php_version'         => array(
422
-				'label'  => __( 'PHP Version', 'google-calendar-events' ),
422
+				'label'  => __('PHP Version', 'google-calendar-events'),
423 423
 				'label_export' => 'PHP Version',
424 424
 				'result' => $php,
425 425
 				'result_export' => PHP_VERSION,
426 426
 			),
427 427
 			'mysql_version'       => array(
428
-				'label'  => __( 'MySQL Version', 'google-calendar-events' ),
428
+				'label'  => __('MySQL Version', 'google-calendar-events'),
429 429
 				'label_export' => 'MySQL Version',
430
-				'result' => version_compare( $mysql, '5.5', '>' ) ? '<mark class="ok">' . $mysql . '</mark>' : $mysql,
430
+				'result' => version_compare($mysql, '5.5', '>') ? '<mark class="ok">'.$mysql.'</mark>' : $mysql,
431 431
 				'result_export' => $mysql,
432 432
 			),
433 433
 			'server_timezone'     => array(
434
-				'label'  => __( 'Server Timezone', 'google-calendar-events' ),
434
+				'label'  => __('Server Timezone', 'google-calendar-events'),
435 435
 				'label_export' => 'Server Timezone',
436 436
 				'result' => $server_timezone,
437 437
 				'result_export' => $server_timezone_export,
438 438
 			),
439 439
 			'display_errors'      => array(
440 440
 				'label'  => 'Display Errors',
441
-				'result' => ( ini_get( 'display_errors' ) ) ? __( 'Yes', 'google-calendar-events' ) . ' (' . ini_get( 'display_errors' ) . ')' : '-',
442
-				'result_export' => ( ini_get( 'display_errors' ) ) ? 'Yes' : 'No',
441
+				'result' => (ini_get('display_errors')) ? __('Yes', 'google-calendar-events').' ('.ini_get('display_errors').')' : '-',
442
+				'result_export' => (ini_get('display_errors')) ? 'Yes' : 'No',
443 443
 			),
444 444
 			'php_safe_mode'       => array(
445 445
 				'label'  => 'Safe Mode',
446
-				'result' => ( ini_get( 'safe_mode' ) ) ? __( 'Yes', 'google-calendar-events' ) : __( 'No', 'google-calendar-events' ),
447
-				'result_export' => ( ini_get( 'safe_mode' ) ) ? 'Yes' : 'No',
446
+				'result' => (ini_get('safe_mode')) ? __('Yes', 'google-calendar-events') : __('No', 'google-calendar-events'),
447
+				'result_export' => (ini_get('safe_mode')) ? 'Yes' : 'No',
448 448
 			),
449 449
 			'php_memory_limit'    => array(
450 450
 				'label'  => 'Memory Limit',
@@ -468,23 +468,23 @@  discard block
 block discarded – undo
468 468
 			),
469 469
 			'fsockopen'           => array(
470 470
 				'label'  => 'fsockopen',
471
-				'result' => function_exists( 'fsockopen' ) ? __( 'Yes', 'google-calendar-events' ) : __( 'No', 'google-calendar-events' ),
472
-				'result_export' => function_exists( 'fsockopen' ) ? 'Yes' : 'No',
471
+				'result' => function_exists('fsockopen') ? __('Yes', 'google-calendar-events') : __('No', 'google-calendar-events'),
472
+				'result_export' => function_exists('fsockopen') ? 'Yes' : 'No',
473 473
 			),
474 474
 			'curl_init'           => array(
475 475
 				'label'  => 'cURL',
476
-				'result' => function_exists( 'curl_init' ) ? __( 'Yes', 'google-calendar-events' ) : __( 'No', 'google-calendar-events' ),
477
-				'result_export' => function_exists( 'curl_init' ) ? 'Yes' : 'No',
476
+				'result' => function_exists('curl_init') ? __('Yes', 'google-calendar-events') : __('No', 'google-calendar-events'),
477
+				'result_export' => function_exists('curl_init') ? 'Yes' : 'No',
478 478
 			),
479 479
 			'soap'                => array(
480 480
 				'label'  => 'SOAP',
481
-				'result' => class_exists( 'SoapClient' ) ? __( 'Yes', 'google-calendar-events' ) : __( 'No', 'google-calendar-events' ),
482
-				'result_export' => class_exists( 'SoapClient' ) ? 'Yes' : 'No',
481
+				'result' => class_exists('SoapClient') ? __('Yes', 'google-calendar-events') : __('No', 'google-calendar-events'),
482
+				'result_export' => class_exists('SoapClient') ? 'Yes' : 'No',
483 483
 			),
484 484
 			'suhosin'             => array(
485 485
 				'label'  => 'SUHOSIN',
486
-				'result' => extension_loaded( 'suhosin' ) ? __( 'Yes', 'google-calendar-events' ) : __( 'No', 'google-calendar-events' ),
487
-				'result_export' => extension_loaded( 'suhosin' ) ? 'Yes' : 'No',
486
+				'result' => extension_loaded('suhosin') ? __('Yes', 'google-calendar-events') : __('No', 'google-calendar-events'),
487
+				'result_export' => extension_loaded('suhosin') ? 'Yes' : 'No',
488 488
 			),
489 489
 			'wp_remote_post'      => array(
490 490
 				'label'  => 'WP Remote POST',
@@ -506,26 +506,26 @@  discard block
 block discarded – undo
506 506
 		$user_client = new \Browser();
507 507
 
508 508
 		$browser  = '<dl>';
509
-		$browser .= '<dt>' . __( 'Name:', 'google-calendar-events' ) .         '</dt>';
510
-		$browser .= '<dd>' . $user_client->getBrowser() .   '</dd>';
511
-		$browser .= '<dt>' . __( 'Version:', 'google-calendar-events' ) .      '</dt>';
512
-		$browser .= '<dd>' . $user_client->getVersion() .   '</dd>';
513
-		$browser .= '<dt>' . __( 'User Agent:', 'google-calendar-events' ) .   '</dt>';
514
-		$browser .= '<dd>' . $user_client->getUserAgent() . '</dd>';
515
-		$browser .= '<dt>' . __( 'Platform:', 'google-calendar-events' ) .     '</dt>';
516
-		$browser .= '<dd>' . $user_client->getPlatform() .  '</dd>';
509
+		$browser .= '<dt>'.__('Name:', 'google-calendar-events').'</dt>';
510
+		$browser .= '<dd>'.$user_client->getBrowser().'</dd>';
511
+		$browser .= '<dt>'.__('Version:', 'google-calendar-events').'</dt>';
512
+		$browser .= '<dd>'.$user_client->getVersion().'</dd>';
513
+		$browser .= '<dt>'.__('User Agent:', 'google-calendar-events').'</dt>';
514
+		$browser .= '<dd>'.$user_client->getUserAgent().'</dd>';
515
+		$browser .= '<dt>'.__('Platform:', 'google-calendar-events').'</dt>';
516
+		$browser .= '<dd>'.$user_client->getPlatform().'</dd>';
517 517
 		$browser .= '</dl>';
518 518
 
519
-		$browser_export = $user_client->getBrowser() . ' ' . $user_client->getVersion() . ' (' . $user_client->getPlatform() . ')';
519
+		$browser_export = $user_client->getBrowser().' '.$user_client->getVersion().' ('.$user_client->getPlatform().')';
520 520
 
521 521
 		$sections['client'] = array(
522 522
 			'user_ip' => array(
523
-				'label'  => __( 'IP Address', 'google-calendar-events' ),
523
+				'label'  => __('IP Address', 'google-calendar-events'),
524 524
 				'label_export' => 'IP Address',
525 525
 				'result' => $_SERVER['SERVER_ADDR'],
526 526
 			),
527 527
 			'browser' => array(
528
-				'label'  => __( 'Browser', 'google-calendar-events' ),
528
+				'label'  => __('Browser', 'google-calendar-events'),
529 529
 				'result' => $browser,
530 530
 				'result_export' => $browser_export,
531 531
 			)
@@ -536,12 +536,12 @@  discard block
 block discarded – undo
536 536
 		 * ============
537 537
 		 */
538 538
 
539
-		$panels   = apply_filters( 'simcal_system_status_report_panels', $panels );
540
-		$sections = apply_filters( 'simcal_system_status_report_sections', $sections );
539
+		$panels   = apply_filters('simcal_system_status_report_panels', $panels);
540
+		$sections = apply_filters('simcal_system_status_report_sections', $sections);
541 541
 
542
-		foreach ( $panels as $panel => $v ) :
542
+		foreach ($panels as $panel => $v) :
543 543
 
544
-			if ( isset( $sections[ $panel ] ) ) :
544
+			if (isset($sections[$panel])) :
545 545
 
546 546
 				?>
547 547
 				<table class="widefat simcal-system-status-report-panel">
@@ -551,15 +551,15 @@  discard block
 block discarded – undo
551 551
 						</tr>
552 552
 					</thead>
553 553
 					<tbody>
554
-						<?php foreach ( $sections[ $panel ] as $row => $cell ) : ?>
554
+						<?php foreach ($sections[$panel] as $row => $cell) : ?>
555 555
 							<tr>
556 556
 								<?php
557
-								$label_export  = isset( $cell['label_export']  ) ? $cell['label_export']  : $cell['label'];
558
-								$result_export = isset( $cell['result_export'] ) ? $cell['result_export'] : $cell['result'];
557
+								$label_export  = isset($cell['label_export']) ? $cell['label_export'] : $cell['label'];
558
+								$result_export = isset($cell['result_export']) ? $cell['result_export'] : $cell['result'];
559 559
 								?>
560
-								<td class="tooltip"><?php echo isset( $cell['tooltip'] ) ? ' <i class="simcal-icon-help simcal-help-tip" data-tip="' . $cell['tooltip'] . '"></i> ' : ''; ?></td>
561
-								<td class="label" data-export="<?php echo trim( $label_export ); ?>"><?php echo $cell['label']; ?></td>
562
-								<td class="result" data-export="<?php echo trim( $result_export ); ?>"><?php echo $cell['result']; ?></td>
560
+								<td class="tooltip"><?php echo isset($cell['tooltip']) ? ' <i class="simcal-icon-help simcal-help-tip" data-tip="'.$cell['tooltip'].'"></i> ' : ''; ?></td>
561
+								<td class="label" data-export="<?php echo trim($label_export); ?>"><?php echo $cell['label']; ?></td>
562
+								<td class="result" data-export="<?php echo trim($result_export); ?>"><?php echo $cell['result']; ?></td>
563 563
 							</tr>
564 564
 						<?php endforeach; ?>
565 565
 					</tbody>
@@ -637,7 +637,7 @@  discard block
 block discarded – undo
637 637
 			jQuery( '#simcal-system-status-report-download' ).on( 'click', function() {
638 638
 				var file = new Blob( [ report ], { type: 'text/plain' } );
639 639
 				jQuery( this ).attr( 'href', URL.createObjectURL( file ) );
640
-				jQuery( this ).attr( 'download', '<?php echo sanitize_title( str_replace( array( 'http://', 'https://' ), '', get_bloginfo( 'url' ) ) . '-system-report-' . date( 'Y-m-d', time() ) ); ?>' );
640
+				jQuery( this ).attr( 'download', '<?php echo sanitize_title(str_replace(array('http://', 'https://'), '', get_bloginfo('url')).'-system-report-'.date('Y-m-d', time())); ?>' );
641 641
 			} );
642 642
 
643 643
 		</script>
@@ -657,13 +657,13 @@  discard block
 block discarded – undo
657 657
 	 *
658 658
 	 * @return int|double|string
659 659
 	 */
660
-	private function let_to_num( $size ) {
660
+	private function let_to_num($size) {
661 661
 
662
-		$l   = substr( $size, -1 );
663
-		$ret = substr( $size, 0, -1 );
662
+		$l   = substr($size, -1);
663
+		$ret = substr($size, 0, -1);
664 664
 
665 665
 		// Note: do not insert break or default in this switch loop.
666
-		switch ( strtoupper( $l ) ) {
666
+		switch (strtoupper($l)) {
667 667
 			case 'P':
668 668
 				$ret *= 1024;
669 669
 				// no break
@@ -677,7 +677,7 @@  discard block
 block discarded – undo
677 677
 				$ret *= 1024;
678 678
 				// no break
679 679
 			case 'K':
680
-				$ret *= 1024;;
680
+				$ret *= 1024; ;
681 681
 				// no break
682 682
 		}
683 683
 
Please login to merge, or discard this patch.
includes/admin/post-types.php 3 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -272,9 +272,9 @@
 block discarded – undo
272 272
 
273 273
 		if ( $post_type == 'calendar' && isset( $post->ID ) ) {
274 274
 			echo '<a id="simcal-clear-cache" class="button" data-id="' . $post->ID . ' ">' .
275
-			     '<i class="simcal-icon-spinner simcal-icon-spin" style="display: none;"></i> ' .
276
-			     __( 'Clear cache', 'google-calendar-events' ) .
277
-			     '</a>';
275
+				 '<i class="simcal-icon-spinner simcal-icon-spin" style="display: none;"></i> ' .
276
+				 __( 'Clear cache', 'google-calendar-events' ) .
277
+				 '</a>';
278 278
 		}
279 279
 	}
280 280
 
Please login to merge, or discard this patch.
Spacing   +82 added lines, -82 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 
9 9
 use SimpleCalendar\Abstracts\Calendar;
10 10
 
11
-if ( ! defined( 'ABSPATH' ) ) {
11
+if ( ! defined('ABSPATH')) {
12 12
 	exit;
13 13
 }
14 14
 
@@ -32,26 +32,26 @@  discard block
 block discarded – undo
32 32
 		new Meta_Boxes();
33 33
 
34 34
 		// Add column headers in calendar feeds admin archives.
35
-		add_filter( 'manage_calendar_posts_columns', array( $this, 'add_calendar_feed_column_headers' ) );
35
+		add_filter('manage_calendar_posts_columns', array($this, 'add_calendar_feed_column_headers'));
36 36
 		// Process column contents for calendar feeds.
37
-		add_action( 'manage_calendar_posts_custom_column', array( $this, 'calendar_feed_column_content' ), 10, 2 );
37
+		add_action('manage_calendar_posts_custom_column', array($this, 'calendar_feed_column_content'), 10, 2);
38 38
 
39 39
 		// Add actions in calendar feed rows.
40
-		add_filter( 'post_row_actions', array( $this, 'row_actions' ), 10, 2 );
40
+		add_filter('post_row_actions', array($this, 'row_actions'), 10, 2);
41 41
 		// Add bulk actions.
42
-		add_action( 'admin_init', array( $this, 'bulk_actions' ) );
42
+		add_action('admin_init', array($this, 'bulk_actions'));
43 43
 		// Add content to edit calendars page.
44
-		add_action( 'load-edit.php', array( $this, 'edit_table_hooks' ) );
44
+		add_action('load-edit.php', array($this, 'edit_table_hooks'));
45 45
 
46 46
 		// Default calendar post type content (default event template).
47
-		add_filter( 'default_content', array( $this, 'default_event_template' ), 10, 2 );
47
+		add_filter('default_content', array($this, 'default_event_template'), 10, 2);
48 48
 
49 49
 		// Add a clear cache link in submit post box.
50
-		add_action( 'post_submitbox_misc_actions', array( $this, 'clear_cache_button' ) );
50
+		add_action('post_submitbox_misc_actions', array($this, 'clear_cache_button'));
51 51
 
52 52
 		// Add media button to post editor for adding a shortcode.
53
-		add_action( 'media_buttons', array( $this, 'add_shortcode_button' ), 100 );
54
-		add_action( 'edit_form_after_editor', array( $this, 'add_shortcode_panel' ), 100 );
53
+		add_action('media_buttons', array($this, 'add_shortcode_button'), 100);
54
+		add_action('edit_form_after_editor', array($this, 'add_shortcode_panel'), 100);
55 55
 	}
56 56
 
57 57
 	/**
@@ -63,15 +63,15 @@  discard block
 block discarded – undo
63 63
 	 *
64 64
 	 * @return array Filtered output.
65 65
 	 */
66
-	public function add_calendar_feed_column_headers( $columns ) {
66
+	public function add_calendar_feed_column_headers($columns) {
67 67
 
68 68
 		// New columns.
69
-		$feed_info = array( 'feed' => __( 'Events Source', 'google-calendar-events' ) );
70
-		$calendar_info = array( 'calendar' => __( 'Calendar Type', 'google-calendar-events' ) );
71
-		$shortcode = array( 'shortcode' => __( 'Shortcode', 'google-calendar-events' ) );
69
+		$feed_info = array('feed' => __('Events Source', 'google-calendar-events'));
70
+		$calendar_info = array('calendar' => __('Calendar Type', 'google-calendar-events'));
71
+		$shortcode = array('shortcode' => __('Shortcode', 'google-calendar-events'));
72 72
 
73 73
 		// Merge with existing columns and rearrange.
74
-		$columns = array_slice( $columns, 0, 2, true ) + $feed_info + $calendar_info + $shortcode + array_slice( $columns, 2, null, true );
74
+		$columns = array_slice($columns, 0, 2, true) + $feed_info + $calendar_info + $shortcode + array_slice($columns, 2, null, true);
75 75
 
76 76
 		return $columns;
77 77
 	}
@@ -86,32 +86,32 @@  discard block
 block discarded – undo
86 86
 	 *
87 87
 	 * @return void
88 88
 	 */
89
-	public function calendar_feed_column_content( $column_name, $post_id ) {
89
+	public function calendar_feed_column_content($column_name, $post_id) {
90 90
 
91
-		switch ( $column_name ) {
91
+		switch ($column_name) {
92 92
 
93 93
 			case 'feed':
94 94
 
95
-				$feed = simcal_get_feed( $post_id );
96
-				echo isset( $feed->name ) ? $feed->name : '&mdash;';
95
+				$feed = simcal_get_feed($post_id);
96
+				echo isset($feed->name) ? $feed->name : '&mdash;';
97 97
 				break;
98 98
 
99 99
 			case 'calendar':
100 100
 
101 101
 				$info = '&mdash;';
102 102
 
103
-				if ( $terms = wp_get_object_terms( $post_id, 'calendar_type' ) ) {
103
+				if ($terms = wp_get_object_terms($post_id, 'calendar_type')) {
104 104
 
105
-					$calendar_type  = sanitize_title( current( $terms )->name );
106
-					$calendar       = simcal_get_calendar( $calendar_type );
105
+					$calendar_type  = sanitize_title(current($terms)->name);
106
+					$calendar       = simcal_get_calendar($calendar_type);
107 107
 
108
-					if ( $calendar instanceof Calendar ) {
108
+					if ($calendar instanceof Calendar) {
109 109
 						$info = $calendar->name;
110
-						$views = get_post_meta( $post_id, '_calendar_view', true );;
111
-						$view = isset( $views[ $calendar->type ] ) ? $views[ $calendar->type ] : '';
110
+						$views = get_post_meta($post_id, '_calendar_view', true); ;
111
+						$view = isset($views[$calendar->type]) ? $views[$calendar->type] : '';
112 112
 
113
-						if ( isset( $calendar->views[ $view ] ) ) {
114
-							$info .= ' &rarr; ' . $calendar->views[ $view ];
113
+						if (isset($calendar->views[$view])) {
114
+							$info .= ' &rarr; '.$calendar->views[$view];
115 115
 						}
116 116
 					}
117 117
 				}
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 
122 122
 			case 'shortcode' :
123 123
 
124
-				simcal_print_shortcode_tip( $post_id );
124
+				simcal_print_shortcode_tip($post_id);
125 125
 				break;
126 126
 		}
127 127
 	}
@@ -136,12 +136,12 @@  discard block
 block discarded – undo
136 136
 	 *
137 137
 	 * @return array Filtered output.
138 138
 	 */
139
-	public function row_actions( $actions, $post ) {
139
+	public function row_actions($actions, $post) {
140 140
 
141 141
 		// Add a clear feed cache action link.
142
-		if ( $post->post_type == 'calendar' ) {
143
-			$actions['duplicate_feed'] = '<a href="' . esc_url( add_query_arg( array( 'duplicate_feed' => $post->ID ) ) ) . '">' . __( 'Clone', 'google-calendar-events' )       . '</a>';
144
-			$actions['clear_cache']    = '<a href="' . esc_url( add_query_arg( array( 'clear_cache' => $post->ID ) ) ) . '">'    . __( 'Clear Cache', 'google-calendar-events' ) . '</a>';
142
+		if ($post->post_type == 'calendar') {
143
+			$actions['duplicate_feed'] = '<a href="'.esc_url(add_query_arg(array('duplicate_feed' => $post->ID))).'">'.__('Clone', 'google-calendar-events').'</a>';
144
+			$actions['clear_cache']    = '<a href="'.esc_url(add_query_arg(array('clear_cache' => $post->ID))).'">'.__('Clear Cache', 'google-calendar-events').'</a>';
145 145
 		}
146 146
 
147 147
 		return $actions;
@@ -156,38 +156,38 @@  discard block
 block discarded – undo
156 156
 
157 157
 		// Clear an individual feed cache.
158 158
 		// @todo Convert the clear cache request to ajax.
159
-		if ( isset( $_REQUEST['clear_cache'] ) ) {
159
+		if (isset($_REQUEST['clear_cache'])) {
160 160
 
161
-			$id = intval( $_REQUEST['clear_cache'] );
161
+			$id = intval($_REQUEST['clear_cache']);
162 162
 
163
-			if ( $id > 0 ) {
164
-				simcal_delete_feed_transients( $id );
163
+			if ($id > 0) {
164
+				simcal_delete_feed_transients($id);
165 165
 			}
166 166
 
167
-			wp_redirect( remove_query_arg( 'clear_cache' ) );
167
+			wp_redirect(remove_query_arg('clear_cache'));
168 168
 		}
169 169
 
170 170
 		// Duplicate a feed post type.
171
-		if ( isset( $_REQUEST['duplicate_feed'] ) ) {
171
+		if (isset($_REQUEST['duplicate_feed'])) {
172 172
 
173
-			$id = intval( $_REQUEST['duplicate_feed'] );
173
+			$id = intval($_REQUEST['duplicate_feed']);
174 174
 
175
-			if ( $id > 0 ) {
176
-				$this->duplicate_feed( $id );
175
+			if ($id > 0) {
176
+				$this->duplicate_feed($id);
177 177
 			}
178 178
 
179
-			wp_redirect( remove_query_arg( 'duplicate_feed' ) );
179
+			wp_redirect(remove_query_arg('duplicate_feed'));
180 180
 		}
181 181
 
182
-		$bulk_actions = new Bulk_Actions( 'calendar' );
182
+		$bulk_actions = new Bulk_Actions('calendar');
183 183
 
184
-		$bulk_actions->register_bulk_action( array(
185
-			'menu_text'     => __( 'Clear cache', 'google-calendar-events' ),
184
+		$bulk_actions->register_bulk_action(array(
185
+			'menu_text'     => __('Clear cache', 'google-calendar-events'),
186 186
 			'action_name'   => 'clear_calendars_cache',
187
-			'callback'      => function( $post_ids ) {
188
-				simcal_delete_feed_transients( $post_ids );
187
+			'callback'      => function($post_ids) {
188
+				simcal_delete_feed_transients($post_ids);
189 189
 			},
190
-			'admin_notice'  => __( 'Cache cleared.', 'google-calendar-events' ),
190
+			'admin_notice'  => __('Cache cleared.', 'google-calendar-events'),
191 191
 			)
192 192
 		);
193 193
 
@@ -204,8 +204,8 @@  discard block
 block discarded – undo
204 204
 
205 205
 		$screen = simcal_is_admin_screen();
206 206
 
207
-		if ( 'edit-calendar' == $screen ) {
208
-			add_action( 'in_admin_footer', function() {
207
+		if ('edit-calendar' == $screen) {
208
+			add_action('in_admin_footer', function() {
209 209
 
210 210
 			} );
211 211
 		}
@@ -218,29 +218,29 @@  discard block
 block discarded – undo
218 218
 	 *
219 219
 	 * @param int $post_id
220 220
 	 */
221
-	private function duplicate_feed( $post_id ) {
221
+	private function duplicate_feed($post_id) {
222 222
 
223
-		if ( $duplicate = get_post( intval( $post_id ), 'ARRAY_A' ) ) {
223
+		if ($duplicate = get_post(intval($post_id), 'ARRAY_A')) {
224 224
 
225
-			if ( 'calendar' == $duplicate['post_type'] ) {
225
+			if ('calendar' == $duplicate['post_type']) {
226 226
 
227
-				$duplicate['post_title'] = $duplicate['post_title'] . ' (' . __( 'Copy', 'google-calendar-events' ) . ')';
227
+				$duplicate['post_title'] = $duplicate['post_title'].' ('.__('Copy', 'google-calendar-events').')';
228 228
 
229
-				unset( $duplicate['ID'] );
230
-				unset( $duplicate['guid'] );
231
-				unset( $duplicate['comment_count'] );
229
+				unset($duplicate['ID']);
230
+				unset($duplicate['guid']);
231
+				unset($duplicate['comment_count']);
232 232
 
233
-				$duplicate_id = wp_insert_post( $duplicate );
233
+				$duplicate_id = wp_insert_post($duplicate);
234 234
 
235
-				$taxonomies = get_object_taxonomies( $duplicate['post_type'] );
236
-				foreach ( $taxonomies as $taxonomy ) {
237
-					$terms = wp_get_post_terms( $post_id, $taxonomy, array( 'fields' => 'names' ) );
238
-					wp_set_object_terms( $duplicate_id, $terms, $taxonomy );
235
+				$taxonomies = get_object_taxonomies($duplicate['post_type']);
236
+				foreach ($taxonomies as $taxonomy) {
237
+					$terms = wp_get_post_terms($post_id, $taxonomy, array('fields' => 'names'));
238
+					wp_set_object_terms($duplicate_id, $terms, $taxonomy);
239 239
 				}
240 240
 
241
-				$custom_fields = get_post_custom( $post_id );
242
-				foreach ( $custom_fields as $key => $value ) {
243
-					add_post_meta( $duplicate_id, $key, maybe_unserialize( $value[0] ) );
241
+				$custom_fields = get_post_custom($post_id);
242
+				foreach ($custom_fields as $key => $value) {
243
+					add_post_meta($duplicate_id, $key, maybe_unserialize($value[0]));
244 244
 				}
245 245
 			}
246 246
 
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 	 *
258 258
 	 * @return string
259 259
 	 */
260
-	public function default_event_template( $content, $post ) {
260
+	public function default_event_template($content, $post) {
261 261
 		return 'calendar' == $post->post_type ? simcal_default_event_template() : $content;
262 262
 	}
263 263
 
@@ -270,10 +270,10 @@  discard block
 block discarded – undo
270 270
 
271 271
 		global $post, $post_type;
272 272
 
273
-		if ( $post_type == 'calendar' && isset( $post->ID ) ) {
274
-			echo '<a id="simcal-clear-cache" class="button" data-id="' . $post->ID . ' ">' .
275
-			     '<i class="simcal-icon-spinner simcal-icon-spin" style="display: none;"></i> ' .
276
-			     __( 'Clear cache', 'google-calendar-events' ) .
273
+		if ($post_type == 'calendar' && isset($post->ID)) {
274
+			echo '<a id="simcal-clear-cache" class="button" data-id="'.$post->ID.' ">'.
275
+			     '<i class="simcal-icon-spinner simcal-icon-spin" style="display: none;"></i> '.
276
+			     __('Clear cache', 'google-calendar-events').
277 277
 			     '</a>';
278 278
 		}
279 279
 	}
@@ -290,20 +290,20 @@  discard block
 block discarded – undo
290 290
 
291 291
 		$post_types = array();
292 292
 
293
-		$settings = get_option( 'simple-calendar_settings_calendars' );
294
-		if ( isset( $settings['general']['attach_calendars_posts'] ) ) {
293
+		$settings = get_option('simple-calendar_settings_calendars');
294
+		if (isset($settings['general']['attach_calendars_posts'])) {
295 295
 			$post_types = $settings['general']['attach_calendars_posts'];
296 296
 		}
297 297
 
298 298
 		global $post_type;
299 299
 
300
-		if ( in_array( $post_type, $post_types ) ) {
300
+		if (in_array($post_type, $post_types)) {
301 301
 
302 302
 			// Thickbox will ignore height and width, will adjust these in js.
303 303
 			// @see https://core.trac.wordpress.org/ticket/17249
304 304
 			?>
305 305
 			<a href="#TB_inline?height=250&width=500&inlineId=simcal-insert-shortcode-panel" id="simcal-insert-shortcode-button" class="thickbox button insert-calendar add_calendar">
306
-				<span class="wp-media-buttons-icon dashicons-before dashicons-calendar-alt"></span> <?php _e( 'Add Calendar', 'google-calendar-events' ); ?>
306
+				<span class="wp-media-buttons-icon dashicons-before dashicons-calendar-alt"></span> <?php _e('Add Calendar', 'google-calendar-events'); ?>
307 307
 			</a>
308 308
 			<?php
309 309
 
@@ -325,25 +325,25 @@  discard block
 block discarded – undo
325 325
 		?>
326 326
 		<div id="simcal-insert-shortcode-panel" style="display:none;">
327 327
 			<div class="simcal-insert-shortcode-panel">
328
-				<h1><?php _e( 'Add Calendar', 'google-calendar-events' ); ?></h1>
329
-				<?php _e( 'Add a calendar to your post.', 'google-calendar-events' ); ?>
330
-				<?php if ( ! empty( $calendars ) && is_array( $calendars ) ) : ?>
328
+				<h1><?php _e('Add Calendar', 'google-calendar-events'); ?></h1>
329
+				<?php _e('Add a calendar to your post.', 'google-calendar-events'); ?>
330
+				<?php if ( ! empty($calendars) && is_array($calendars)) : ?>
331 331
 					<p>
332 332
 						<label for="simcal-choose-calendar">
333
-							<?php $multiselect = count( $calendars ) > 15 ? ' simcal-field-select-enhanced' : ''; ?>
333
+							<?php $multiselect = count($calendars) > 15 ? ' simcal-field-select-enhanced' : ''; ?>
334 334
 							<select id="simcal-choose-calendar"
335 335
 							        class="simcal-field simcal-field-select<?php echo $multiselect; ?>"
336 336
 							        name="">
337
-								<?php foreach ( $calendars as $id => $title ) : ?>
337
+								<?php foreach ($calendars as $id => $title) : ?>
338 338
 									<option value="<?php echo $id ?>"><?php echo $title ?></option>
339 339
 								<?php endforeach; ?>
340 340
 							</select>
341 341
 						</label>
342 342
 					</p>
343
-					<p><input type="button" value="<?php _e( 'Insert Calendar', 'google-calendar-events' ); ?>" id="simcal-insert-shortcode" class="button button-primary button-large" name="" /></p>
343
+					<p><input type="button" value="<?php _e('Insert Calendar', 'google-calendar-events'); ?>" id="simcal-insert-shortcode" class="button button-primary button-large" name="" /></p>
344 344
 				<?php else : ?>
345
-					<p><em><?php _e( 'Could not find any calendars to add to this post.', 'google-calendar-events' ); ?></em></p>
346
-					<strong><a href="post-new.php?post_type=calendar"><?php _e( 'Please add and configure new calendar first.', 'google-calendar-events' ); ?></a></strong>
345
+					<p><em><?php _e('Could not find any calendars to add to this post.', 'google-calendar-events'); ?></em></p>
346
+					<strong><a href="post-new.php?post_type=calendar"><?php _e('Please add and configure new calendar first.', 'google-calendar-events'); ?></a></strong>
347 347
 				<?php endif; ?>
348 348
 			</div>
349 349
 		</div>
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -341,8 +341,11 @@
 block discarded – undo
341 341
 						</label>
342 342
 					</p>
343 343
 					<p><input type="button" value="<?php _e( 'Insert Calendar', 'google-calendar-events' ); ?>" id="simcal-insert-shortcode" class="button button-primary button-large" name="" /></p>
344
-				<?php else : ?>
345
-					<p><em><?php _e( 'Could not find any calendars to add to this post.', 'google-calendar-events' ); ?></em></p>
344
+				<?php else {
345
+	: ?>
346
+					<p><em><?php _e( 'Could not find any calendars to add to this post.', 'google-calendar-events' );
347
+}
348
+?></em></p>
346 349
 					<strong><a href="post-new.php?post_type=calendar"><?php _e( 'Please add and configure new calendar first.', 'google-calendar-events' ); ?></a></strong>
347 350
 				<?php endif; ?>
348 351
 			</div>
Please login to merge, or discard this patch.
includes/admin/updater.php 1 patch
Spacing   +78 added lines, -78 removed lines patch added patch discarded remove patch
@@ -62,17 +62,17 @@  discard block
 block discarded – undo
62 62
 	 * @param string $_plugin_file Path to the plugin file.
63 63
 	 * @param array  $_api_data    Optional data to send with API calls.
64 64
 	 */
65
-	public function __construct( $_api_url, $_plugin_file, $_api_data = null ) {
65
+	public function __construct($_api_url, $_plugin_file, $_api_data = null) {
66 66
 
67
-		$this->api_url  = trailingslashit( $_api_url );
67
+		$this->api_url  = trailingslashit($_api_url);
68 68
 		$this->api_data = $_api_data;
69
-		$this->name     = plugin_basename( $_plugin_file );
70
-		$this->slug     = basename( $_plugin_file, '.php' );
69
+		$this->name     = plugin_basename($_plugin_file);
70
+		$this->slug     = basename($_plugin_file, '.php');
71 71
 		$this->version  = $_api_data['version'];
72 72
 
73 73
 		// Set up hooks.
74 74
 		$this->init();
75
-		add_action( 'admin_init', array( $this, 'show_changelog' ) );
75
+		add_action('admin_init', array($this, 'show_changelog'));
76 76
 	}
77 77
 
78 78
 	/**
@@ -83,10 +83,10 @@  discard block
 block discarded – undo
83 83
 	 * @return void
84 84
 	 */
85 85
 	public function init() {
86
-		add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ) );
87
-		add_filter( 'plugins_api', array( $this, 'plugins_api_filter' ), 10, 3 );
88
-		remove_action( 'after_plugin_row_' . $this->name, 'wp_plugin_update_row', 10 );
89
-		add_action( 'after_plugin_row_' . $this->name, array( $this, 'show_update_notification' ), 10, 2 );
86
+		add_filter('pre_set_site_transient_update_plugins', array($this, 'check_update'));
87
+		add_filter('plugins_api', array($this, 'plugins_api_filter'), 10, 3);
88
+		remove_action('after_plugin_row_'.$this->name, 'wp_plugin_update_row', 10);
89
+		add_action('after_plugin_row_'.$this->name, array($this, 'show_update_notification'), 10, 2);
90 90
 	}
91 91
 
92 92
 	/**
@@ -103,30 +103,30 @@  discard block
 block discarded – undo
103 103
 	 *
104 104
 	 * @return array|\stdClass Modified update array with custom plugin data.
105 105
 	 */
106
-	public function check_update( $_transient_data ) {
106
+	public function check_update($_transient_data) {
107 107
 
108 108
 		global $pagenow;
109 109
 
110
-		if ( ! is_object( $_transient_data ) ) {
110
+		if ( ! is_object($_transient_data)) {
111 111
 			$_transient_data = new \stdClass();
112 112
 		}
113 113
 
114
-		if ( 'plugins.php' == $pagenow && is_multisite() ) {
114
+		if ('plugins.php' == $pagenow && is_multisite()) {
115 115
 			return $_transient_data;
116 116
 		}
117 117
 
118
-		if ( empty( $_transient_data->response ) || empty( $_transient_data->response[ $this->name ] ) ) {
118
+		if (empty($_transient_data->response) || empty($_transient_data->response[$this->name])) {
119 119
 
120
-			$version_info = $this->api_request( 'plugin_latest_version', array( 'slug' => $this->slug ) );
120
+			$version_info = $this->api_request('plugin_latest_version', array('slug' => $this->slug));
121 121
 
122
-			if ( false !== $version_info && is_object( $version_info ) && isset( $version_info->new_version ) ) {
122
+			if (false !== $version_info && is_object($version_info) && isset($version_info->new_version)) {
123 123
 
124
-				if ( version_compare( $this->version, $version_info->new_version, '<' ) ) {
125
-					$_transient_data->response[ $this->name ] = $version_info;
124
+				if (version_compare($this->version, $version_info->new_version, '<')) {
125
+					$_transient_data->response[$this->name] = $version_info;
126 126
 				}
127 127
 
128 128
 				$_transient_data->last_checked = time();
129
-				$_transient_data->checked[ $this->name ] = $this->version;
129
+				$_transient_data->checked[$this->name] = $this->version;
130 130
 			}
131 131
 
132 132
 		}
@@ -144,81 +144,81 @@  discard block
 block discarded – undo
144 144
 	 * @param string $file
145 145
 	 * @param array  $plugin
146 146
 	 */
147
-	public function show_update_notification( $file, $plugin ) {
147
+	public function show_update_notification($file, $plugin) {
148 148
 
149
-		if ( ! current_user_can( 'update_plugins' ) ) {
149
+		if ( ! current_user_can('update_plugins')) {
150 150
 			return;
151 151
 		}
152 152
 
153
-		if ( ! is_multisite() ) {
153
+		if ( ! is_multisite()) {
154 154
 			return;
155 155
 		}
156 156
 
157
-		if ( $this->name != $file ) {
157
+		if ($this->name != $file) {
158 158
 			return;
159 159
 		}
160 160
 
161 161
 		// Remove our filter on the site transient
162
-		remove_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ), 10 );
162
+		remove_filter('pre_set_site_transient_update_plugins', array($this, 'check_update'), 10);
163 163
 
164
-		$update_cache = get_site_transient( 'update_plugins' );
164
+		$update_cache = get_site_transient('update_plugins');
165 165
 
166
-		if ( ! is_object( $update_cache ) || empty( $update_cache->response ) || empty( $update_cache->response[ $this->name ] ) ) {
166
+		if ( ! is_object($update_cache) || empty($update_cache->response) || empty($update_cache->response[$this->name])) {
167 167
 
168
-			$cache_key    = md5( 'edd_plugin_' .sanitize_key( $this->name ) . '_version_info' );
169
-			$version_info = get_transient( $cache_key );
168
+			$cache_key    = md5('edd_plugin_'.sanitize_key($this->name).'_version_info');
169
+			$version_info = get_transient($cache_key);
170 170
 
171
-			if ( false === $version_info ) {
171
+			if (false === $version_info) {
172 172
 
173
-				$version_info = $this->api_request( 'plugin_latest_version', array( 'slug' => $this->slug ) );
173
+				$version_info = $this->api_request('plugin_latest_version', array('slug' => $this->slug));
174 174
 
175
-				set_transient( $cache_key, $version_info, 3600 );
175
+				set_transient($cache_key, $version_info, 3600);
176 176
 			}
177 177
 
178
-			if ( ! is_object( $version_info ) ) {
178
+			if ( ! is_object($version_info)) {
179 179
 				return;
180 180
 			}
181 181
 
182
-			if ( version_compare( $this->version, $version_info->new_version, '<' ) ) {
183
-				$update_cache->response[ $this->name ] = $version_info;
182
+			if (version_compare($this->version, $version_info->new_version, '<')) {
183
+				$update_cache->response[$this->name] = $version_info;
184 184
 			}
185 185
 
186 186
 			$update_cache->last_checked = time();
187
-			$update_cache->checked[ $this->name ] = $this->version;
187
+			$update_cache->checked[$this->name] = $this->version;
188 188
 
189
-			set_site_transient( 'update_plugins', $update_cache );
189
+			set_site_transient('update_plugins', $update_cache);
190 190
 
191 191
 		} else {
192 192
 
193
-			$version_info = $update_cache->response[ $this->name ];
193
+			$version_info = $update_cache->response[$this->name];
194 194
 
195 195
 		}
196 196
 
197 197
 		// Restore our filter
198
-		add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ) );
198
+		add_filter('pre_set_site_transient_update_plugins', array($this, 'check_update'));
199 199
 
200
-		if ( ! empty( $update_cache->response[ $this->name ] ) && version_compare( $this->version, $version_info->new_version, '<' ) ) {
200
+		if ( ! empty($update_cache->response[$this->name]) && version_compare($this->version, $version_info->new_version, '<')) {
201 201
 
202 202
 			// build a plugin list row, with update notification
203
-			$wp_list_table = _get_list_table( 'WP_Plugins_List_Table' );
204
-			echo '<tr class="plugin-update-tr"><td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange"><div class="update-message">';
203
+			$wp_list_table = _get_list_table('WP_Plugins_List_Table');
204
+			echo '<tr class="plugin-update-tr"><td colspan="'.$wp_list_table->get_column_count().'" class="plugin-update colspanchange"><div class="update-message">';
205 205
 
206
-			$changelog_link = self_admin_url( 'index.php?edd_sl_action=view_plugin_changelog&plugin=' . $this->name . '&slug=' . $this->slug . '&TB_iframe=true&width=772&height=911' );
206
+			$changelog_link = self_admin_url('index.php?edd_sl_action=view_plugin_changelog&plugin='.$this->name.'&slug='.$this->slug.'&TB_iframe=true&width=772&height=911');
207 207
 
208
-			if ( empty( $version_info->download_link ) ) {
208
+			if (empty($version_info->download_link)) {
209 209
 				printf(
210
-					__( 'There is a new version of %1$s available. <a target="_blank" class="thickbox" href="%2$s">View version %3$s details</a>.', 'google-calendar-events' ),
211
-					esc_html( $version_info->name ),
212
-					esc_url( $changelog_link ),
213
-					esc_html( $version_info->new_version )
210
+					__('There is a new version of %1$s available. <a target="_blank" class="thickbox" href="%2$s">View version %3$s details</a>.', 'google-calendar-events'),
211
+					esc_html($version_info->name),
212
+					esc_url($changelog_link),
213
+					esc_html($version_info->new_version)
214 214
 				);
215 215
 			} else {
216 216
 				printf(
217
-					__( 'There is a new version of %1$s available. <a target="_blank" class="thickbox" href="%2$s">View version %3$s details</a> or <a href="%4$s">update now</a>.', 'google-calendar-events' ),
218
-					esc_html( $version_info->name ),
219
-					esc_url( $changelog_link ),
220
-					esc_html( $version_info->new_version ),
221
-					esc_url( wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $this->name, 'upgrade-plugin_' . $this->name ) )
217
+					__('There is a new version of %1$s available. <a target="_blank" class="thickbox" href="%2$s">View version %3$s details</a> or <a href="%4$s">update now</a>.', 'google-calendar-events'),
218
+					esc_html($version_info->name),
219
+					esc_url($changelog_link),
220
+					esc_html($version_info->new_version),
221
+					esc_url(wp_nonce_url(self_admin_url('update.php?action=upgrade-plugin&plugin=').$this->name, 'upgrade-plugin_'.$this->name))
222 222
 				);
223 223
 			}
224 224
 
@@ -238,13 +238,13 @@  discard block
 block discarded – undo
238 238
 	 *
239 239
 	 * @return object
240 240
 	 */
241
-	public function plugins_api_filter( $_data, $_action = '', $_args = null ) {
241
+	public function plugins_api_filter($_data, $_action = '', $_args = null) {
242 242
 
243
-		if ( 'plugin_information' != $_action ) {
243
+		if ('plugin_information' != $_action) {
244 244
 			return $_data;
245 245
 		}
246 246
 
247
-		if ( ! isset( $_args->slug ) || ( $_args->slug != $this->slug ) ) {
247
+		if ( ! isset($_args->slug) || ($_args->slug != $this->slug)) {
248 248
 			return $_data;
249 249
 		}
250 250
 
@@ -257,9 +257,9 @@  discard block
 block discarded – undo
257 257
 			),
258 258
 		);
259 259
 
260
-		$api_response = $this->api_request( 'plugin_information', $to_send );
260
+		$api_response = $this->api_request('plugin_information', $to_send);
261 261
 
262
-		if ( false !== $api_response ) {
262
+		if (false !== $api_response) {
263 263
 			$_data = $api_response;
264 264
 		}
265 265
 
@@ -276,9 +276,9 @@  discard block
 block discarded – undo
276 276
 	 * @param  string $url
277 277
 	 * @return object|array $array
278 278
 	 */
279
-	public function http_request_args( $args, $url ) {
279
+	public function http_request_args($args, $url) {
280 280
 		// If it is an https request and we are performing a package download, disable ssl verification
281
-		if ( strpos( $url, 'https://' ) !== false && strpos( $url, 'edd_action=package_download' ) ) {
281
+		if (strpos($url, 'https://') !== false && strpos($url, 'edd_action=package_download')) {
282 282
 			$args['sslverify'] = false;
283 283
 		}
284 284
 		return $args;
@@ -293,42 +293,42 @@  discard block
 block discarded – undo
293 293
 	 * @param  array  $_data   Parameters for the API action.
294 294
 	 * @return false|object
295 295
 	 */
296
-	private function api_request( $_action, $_data ) {
296
+	private function api_request($_action, $_data) {
297 297
 
298 298
 		global $wp_version;
299 299
 
300
-		$data = array_merge( $this->api_data, $_data );
300
+		$data = array_merge($this->api_data, $_data);
301 301
 
302
-		if ( $data['slug'] != $this->slug ) {
302
+		if ($data['slug'] != $this->slug) {
303 303
 			return;
304 304
 		}
305 305
 
306
-		if ( empty( $data['license'] ) ) {
306
+		if (empty($data['license'])) {
307 307
 			return;
308 308
 		}
309 309
 
310
-		if ( $this->api_url == home_url() ) {
310
+		if ($this->api_url == home_url()) {
311 311
 			return false; // Don't allow a plugin to ping itself
312 312
 		}
313 313
 
314 314
 		$api_params = array(
315 315
 			'edd_action' => 'get_version',
316 316
 			'license'    => $data['license'],
317
-			'item_name'  => isset( $data['item_name'] ) ? $data['item_name'] : false,
318
-			'item_id'    => isset( $data['item_id'] ) ? $data['item_id'] : false,
317
+			'item_name'  => isset($data['item_name']) ? $data['item_name'] : false,
318
+			'item_id'    => isset($data['item_id']) ? $data['item_id'] : false,
319 319
 			'slug'       => $data['slug'],
320 320
 			'author'     => $data['author'],
321 321
 			'url'        => home_url()
322 322
 		);
323 323
 
324
-		$request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => false, 'body' => $api_params ) );
324
+		$request = wp_remote_post($this->api_url, array('timeout' => 15, 'sslverify' => false, 'body' => $api_params));
325 325
 
326
-		if ( ! is_wp_error( $request ) ) {
327
-			$request = json_decode( wp_remote_retrieve_body( $request ) );
326
+		if ( ! is_wp_error($request)) {
327
+			$request = json_decode(wp_remote_retrieve_body($request));
328 328
 		}
329 329
 
330
-		if ( $request && isset( $request->sections ) ) {
331
-			$request->sections = maybe_unserialize( $request->sections );
330
+		if ($request && isset($request->sections)) {
331
+			$request->sections = maybe_unserialize($request->sections);
332 332
 		} else {
333 333
 			$request = false;
334 334
 		}
@@ -343,26 +343,26 @@  discard block
 block discarded – undo
343 343
 	 */
344 344
 	public function show_changelog() {
345 345
 
346
-		if ( empty( $_REQUEST['edd_sl_action'] ) || 'view_plugin_changelog' != $_REQUEST['edd_sl_action'] ) {
346
+		if (empty($_REQUEST['edd_sl_action']) || 'view_plugin_changelog' != $_REQUEST['edd_sl_action']) {
347 347
 			return;
348 348
 		}
349 349
 
350
-		if ( empty( $_REQUEST['plugin'] ) ) {
350
+		if (empty($_REQUEST['plugin'])) {
351 351
 			return;
352 352
 		}
353 353
 
354
-		if ( empty( $_REQUEST['slug'] ) ) {
354
+		if (empty($_REQUEST['slug'])) {
355 355
 			return;
356 356
 		}
357 357
 
358
-		if ( ! current_user_can( 'update_plugins' ) ) {
359
-			wp_die( __( 'You do not have permission to install plugin updates', 'google-calendar-events' ), __( 'Error', 'google-calendar-events' ), array( 'response' => 403 ) );
358
+		if ( ! current_user_can('update_plugins')) {
359
+			wp_die(__('You do not have permission to install plugin updates', 'google-calendar-events'), __('Error', 'google-calendar-events'), array('response' => 403));
360 360
 		}
361 361
 
362
-		$response = $this->api_request( 'plugin_latest_version', array( 'slug' => $_REQUEST['slug'] ) );
362
+		$response = $this->api_request('plugin_latest_version', array('slug' => $_REQUEST['slug']));
363 363
 
364
-		if ( $response && isset( $response->sections['changelog'] ) ) {
365
-			echo '<div style="background:#fff;padding:10px;">' . $response->sections['changelog'] . '</div>';
364
+		if ($response && isset($response->sections['changelog'])) {
365
+			echo '<div style="background:#fff;padding:10px;">'.$response->sections['changelog'].'</div>';
366 366
 		}
367 367
 
368 368
 		exit;
Please login to merge, or discard this patch.
includes/ajax.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 
9 9
 use SimpleCalendar\Abstracts\Calendar_View;
10 10
 
11
-if ( ! defined( 'ABSPATH' ) ) {
11
+if ( ! defined('ABSPATH')) {
12 12
 	exit;
13 13
 }
14 14
 
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 	 * @since 3.0.0
26 26
 	 */
27 27
 	public function __construct() {
28
-		add_action( 'init', array( $this, 'add_callbacks' ), 100 );
28
+		add_action('init', array($this, 'add_callbacks'), 100);
29 29
 	}
30 30
 
31 31
 	/**
@@ -37,19 +37,19 @@  discard block
 block discarded – undo
37 37
 
38 38
 		$calendars = simcal_get_calendar_types();
39 39
 
40
-		foreach ( $calendars as $calendar => $views ) {
40
+		foreach ($calendars as $calendar => $views) {
41 41
 
42
-			foreach ( $views as $view ) {
42
+			foreach ($views as $view) {
43 43
 
44
-				$the_view = simcal_get_calendar_view( 0, $calendar . '-' . $view );
44
+				$the_view = simcal_get_calendar_view(0, $calendar.'-'.$view);
45 45
 
46
-				if ( $the_view instanceof Calendar_View ) {
46
+				if ($the_view instanceof Calendar_View) {
47 47
 					$the_view->add_ajax_actions();
48 48
 				}
49 49
 			}
50 50
 		}
51 51
 
52
-		do_action( 'simcal_add_ajax_callbacks' );
52
+		do_action('simcal_add_ajax_callbacks');
53 53
 	}
54 54
 
55 55
 }
Please login to merge, or discard this patch.
includes/assets.php 1 patch
Spacing   +106 added lines, -106 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 
9 9
 use SimpleCalendar\Abstracts\Calendar_View;
10 10
 
11
-if ( ! defined( 'ABSPATH' ) ) {
11
+if ( ! defined('ABSPATH')) {
12 12
 	exit;
13 13
 }
14 14
 
@@ -76,24 +76,24 @@  discard block
 block discarded – undo
76 76
 	 */
77 77
 	public function __construct() {
78 78
 
79
-		$this->min = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG == true ) ? '' : '.min';
79
+		$this->min = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG == true) ? '' : '.min';
80 80
 
81
-		$settings = get_option( 'simple-calendar_settings_advanced' );
82
-		if ( isset( $settings['assets']['disable_js'] ) ) {
81
+		$settings = get_option('simple-calendar_settings_advanced');
82
+		if (isset($settings['assets']['disable_js'])) {
83 83
 			$this->disable_scripts = 'yes' == $settings['assets']['disable_js'] ? true : false;
84 84
 		}
85 85
 
86
-		if ( isset( $settings['assets']['disable_css'] ) ) {
86
+		if (isset($settings['assets']['disable_css'])) {
87 87
 			$this->disable_styles = 'yes' == $settings['assets']['disable_css'] ? true : false;
88 88
 		}
89 89
 
90
-		if ( isset( $settings['assets']['always_enqueue'] ) ) {
90
+		if (isset($settings['assets']['always_enqueue'])) {
91 91
 			$this->always_enqueue = 'yes' == $settings['assets']['always_enqueue'] ? true : false;
92 92
 		}
93 93
 
94
-		add_action( 'init', array( $this, 'register' ), 20 );
95
-		add_action( 'init', array( $this, 'enqueue' ), 40 );
96
-		add_action( 'wp_print_styles', array( $this, 'disable' ), 100 );
94
+		add_action('init', array($this, 'register'), 20);
95
+		add_action('init', array($this, 'enqueue'), 40);
96
+		add_action('wp_print_styles', array($this, 'disable'), 100);
97 97
 	}
98 98
 
99 99
 	/**
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 	 * @since 3.0.0
103 103
 	 */
104 104
 	public function register() {
105
-		do_action( 'simcal_register_assets', $this->min );
105
+		do_action('simcal_register_assets', $this->min);
106 106
 	}
107 107
 
108 108
 	/**
@@ -112,25 +112,25 @@  discard block
 block discarded – undo
112 112
 	 */
113 113
 	public function enqueue() {
114 114
 
115
-		add_action( 'wp_enqueue_scripts', array( $this, 'load' ), 10 );
115
+		add_action('wp_enqueue_scripts', array($this, 'load'), 10);
116 116
 
117
-		do_action( 'simcal_enqueue_assets', $this->min );
117
+		do_action('simcal_enqueue_assets', $this->min);
118 118
 
119
-		if ( false === $this->disable_scripts ) {
119
+		if (false === $this->disable_scripts) {
120 120
 			$min = $this->min;
121 121
 			// Improves compatibility with themes and plugins using Isotope and Masonry.
122
-			add_action( 'wp_enqueue_scripts',
123
-				function () use ( $min ) {
124
-					if ( wp_script_is( 'simcal-qtip', 'enqueued' ) ) {
122
+			add_action('wp_enqueue_scripts',
123
+				function() use ($min) {
124
+					if (wp_script_is('simcal-qtip', 'enqueued')) {
125 125
 						wp_enqueue_script(
126 126
 							'simplecalendar-imagesloaded',
127
-							SIMPLE_CALENDAR_ASSETS . 'js/vendor/imagesloaded' . $min . '.js',
128
-							array( 'simcal-qtip' ),
127
+							SIMPLE_CALENDAR_ASSETS.'js/vendor/imagesloaded'.$min.'.js',
128
+							array('simcal-qtip'),
129 129
 							'3.1.8',
130 130
 							true
131 131
 						);
132 132
 					}
133
-				}, 1000 );
133
+				}, 1000);
134 134
 		}
135 135
 	}
136 136
 
@@ -141,15 +141,15 @@  discard block
 block discarded – undo
141 141
 	 */
142 142
 	public function load() {
143 143
 
144
-		if ( $this->always_enqueue ) {
144
+		if ($this->always_enqueue) {
145 145
 			$scripts = $this->get_default_scripts();
146 146
 			$styles  = $this->get_default_styles();
147 147
 
148
-			$this->scripts = apply_filters( 'simcal_front_end_scripts', $scripts, $this->min );
149
-			$this->styles  = apply_filters( 'simcal_front_end_styles', $styles, $this->min );
148
+			$this->scripts = apply_filters('simcal_front_end_scripts', $scripts, $this->min);
149
+			$this->styles  = apply_filters('simcal_front_end_styles', $styles, $this->min);
150 150
 
151
-			$this->load_scripts( $this->scripts );
152
-			$this->load_styles( $this->styles );
151
+			$this->load_scripts($this->scripts);
152
+			$this->load_styles($this->styles);
153 153
 
154 154
 			return;
155 155
 		}
@@ -158,33 +158,33 @@  discard block
 block discarded – undo
158 158
 		$cal_id = array();
159 159
 		$scripts = $styles = array();
160 160
 
161
-		if ( is_singular() ) {
161
+		if (is_singular()) {
162 162
 
163 163
 			global $post, $post_type;
164 164
 
165
-			if ( 'calendar' == $post_type ) {
165
+			if ('calendar' == $post_type) {
166 166
 
167 167
 				$id = get_queried_object_id();
168 168
 
169
-				$view = simcal_get_calendar_view( $id );
170
-				if ( $view instanceof Calendar_View ) {
171
-					$scripts[] = $view->scripts( $this->min );
172
-					$styles[]  = $view->styles( $this->min );
169
+				$view = simcal_get_calendar_view($id);
170
+				if ($view instanceof Calendar_View) {
171
+					$scripts[] = $view->scripts($this->min);
172
+					$styles[]  = $view->styles($this->min);
173 173
 				}
174 174
 
175 175
 			} else {
176 176
 
177
-				$id = absint( get_post_meta( $post->ID, '_simcal_attach_calendar_id', true ) );
177
+				$id = absint(get_post_meta($post->ID, '_simcal_attach_calendar_id', true));
178 178
 
179
-				if ( $id === 0 ) {
179
+				if ($id === 0) {
180 180
 
181
-					preg_match_all( '/' . get_shortcode_regex() . '/s', $post->post_content, $matches, PREG_SET_ORDER );
181
+					preg_match_all('/'.get_shortcode_regex().'/s', $post->post_content, $matches, PREG_SET_ORDER);
182 182
 
183
-					if ( ! empty( $matches ) && is_array( $matches ) ) {
184
-						foreach ( $matches as $shortcode ) {
185
-							if ( 'calendar' === $shortcode[2] || 'gcal' === $shortcode[2] ) {
186
-								$atts = shortcode_parse_atts( $shortcode[3] );
187
-								$cal_id[]   = isset( $atts['id'] ) ? intval( $atts['id'] ) : 0;
183
+					if ( ! empty($matches) && is_array($matches)) {
184
+						foreach ($matches as $shortcode) {
185
+							if ('calendar' === $shortcode[2] || 'gcal' === $shortcode[2]) {
186
+								$atts = shortcode_parse_atts($shortcode[3]);
187
+								$cal_id[] = isset($atts['id']) ? intval($atts['id']) : 0;
188 188
 							}
189 189
 						}
190 190
 					}
@@ -192,41 +192,41 @@  discard block
 block discarded – undo
192 192
 			}
193 193
 		}
194 194
 
195
-		foreach( $cal_id as $i ) {
195
+		foreach ($cal_id as $i) {
196 196
 
197
-			if ( $i > 0 ) {
197
+			if ($i > 0) {
198 198
 
199
-				$view = simcal_get_calendar_view( $i );
199
+				$view = simcal_get_calendar_view($i);
200 200
 
201
-				if ( $view instanceof Calendar_View ) {
202
-					$scripts[] = $view->scripts( $this->min );
203
-					$styles[] = $view->styles( $this->min );
201
+				if ($view instanceof Calendar_View) {
202
+					$scripts[] = $view->scripts($this->min);
203
+					$styles[] = $view->styles($this->min);
204 204
 				}
205 205
 			}
206 206
 		}
207 207
 
208 208
 		$this->get_widgets_assets();
209 209
 
210
-		$this->scripts = apply_filters( 'simcal_front_end_scripts', $scripts, $this->min );
210
+		$this->scripts = apply_filters('simcal_front_end_scripts', $scripts, $this->min);
211 211
 
212 212
 		// First check if there is a multi-dimensional array of scripts
213
-		if ( isset( $this->scripts[0] ) ) {
214
-			foreach ( $this->scripts as $script ) {
215
-				$this->load_scripts ( $script );
213
+		if (isset($this->scripts[0])) {
214
+			foreach ($this->scripts as $script) {
215
+				$this->load_scripts($script);
216 216
 			}
217 217
 		} else {
218
-			$this->load_scripts( $this->scripts );
218
+			$this->load_scripts($this->scripts);
219 219
 		}
220 220
 
221
-		$this->styles = apply_filters( 'simcal_front_end_styles', $styles, $this->min );
221
+		$this->styles = apply_filters('simcal_front_end_styles', $styles, $this->min);
222 222
 
223 223
 		// First check if there is a multi-dimensional array of styles
224
-		if ( isset( $this->styles[0] ) ) {
225
-			foreach( $this->styles as $style ) {
226
-				$this->load_styles( $style );
224
+		if (isset($this->styles[0])) {
225
+			foreach ($this->styles as $style) {
226
+				$this->load_styles($style);
227 227
 			}
228 228
 		} else {
229
-			$this->load_styles( $this->styles );
229
+			$this->load_styles($this->styles);
230 230
 		}
231 231
 	}
232 232
 
@@ -237,25 +237,25 @@  discard block
 block discarded – undo
237 237
 	 */
238 238
 	public function get_widgets_assets() {
239 239
 
240
-		$widgets = get_option( 'widget_gce_widget' );
240
+		$widgets = get_option('widget_gce_widget');
241 241
 
242
-		if ( ! empty( $widgets ) && is_array( $widgets ) ) {
242
+		if ( ! empty($widgets) && is_array($widgets)) {
243 243
 
244
-			foreach ( $widgets as $settings ) {
244
+			foreach ($widgets as $settings) {
245 245
 
246
-				if ( ! empty( $settings ) && is_array( $settings ) ) {
246
+				if ( ! empty($settings) && is_array($settings)) {
247 247
 
248
-					if ( isset( $settings['calendar_id'] ) ) {
248
+					if (isset($settings['calendar_id'])) {
249 249
 
250
-						$view = simcal_get_calendar_view( absint( $settings['calendar_id'] ) );
250
+						$view = simcal_get_calendar_view(absint($settings['calendar_id']));
251 251
 
252
-						if ( $view instanceof Calendar_View ) {
253
-							add_filter( 'simcal_front_end_scripts', function ( $scripts, $min ) use ( $view ) {
254
-								return array_merge( $scripts, $view->scripts( $min ) );
255
-							}, 100, 2 );
256
-							add_filter( 'simcal_front_end_styles', function ( $styles, $min ) use ( $view ) {
257
-								return array_merge( $styles, $view->styles( $min ) );
258
-							}, 100, 2 );
252
+						if ($view instanceof Calendar_View) {
253
+							add_filter('simcal_front_end_scripts', function($scripts, $min) use ($view) {
254
+								return array_merge($scripts, $view->scripts($min));
255
+							}, 100, 2);
256
+							add_filter('simcal_front_end_styles', function($styles, $min) use ($view) {
257
+								return array_merge($styles, $view->styles($min));
258
+							}, 100, 2);
259 259
 						}
260 260
 
261 261
 					}
@@ -272,16 +272,16 @@  discard block
 block discarded – undo
272 272
 	 * @since 3.0.0
273 273
 	 */
274 274
 	public function disable() {
275
-		if ( true === $this->disable_scripts ) {
276
-			$scripts = apply_filters( 'simcal_front_end_scripts', $this->scripts, $this->min );
277
-			foreach ( $scripts as $script => $v ) {
278
-				wp_dequeue_script( $script );
275
+		if (true === $this->disable_scripts) {
276
+			$scripts = apply_filters('simcal_front_end_scripts', $this->scripts, $this->min);
277
+			foreach ($scripts as $script => $v) {
278
+				wp_dequeue_script($script);
279 279
 			}
280 280
 		}
281
-		if ( true === $this->disable_styles ) {
282
-			$styles = apply_filters( 'simcal_front_end_styles', $this->styles, $this->min );
283
-			foreach ( $styles as $style => $v ) {
284
-				wp_dequeue_style( $style );
281
+		if (true === $this->disable_styles) {
282
+			$styles = apply_filters('simcal_front_end_styles', $this->styles, $this->min);
283
+			foreach ($styles as $style => $v) {
284
+				wp_dequeue_style($style);
285 285
 			}
286 286
 		}
287 287
 	}
@@ -293,30 +293,30 @@  discard block
 block discarded – undo
293 293
 	 *
294 294
 	 * @param array $scripts
295 295
 	 */
296
-	public function load_scripts( $scripts ) {
296
+	public function load_scripts($scripts) {
297 297
 
298
-		if ( ! empty( $scripts ) && is_array( $scripts ) ) {
298
+		if ( ! empty($scripts) && is_array($scripts)) {
299 299
 
300
-			foreach ( $scripts as $script => $v ) {
300
+			foreach ($scripts as $script => $v) {
301 301
 
302
-				if ( ! empty( $v['src'] ) ) {
302
+				if ( ! empty($v['src'])) {
303 303
 
304
-					$src        = esc_url( $v['src'] );
305
-					$deps       = isset( $v['deps'] )        ? $v['deps']       : array();
306
-					$ver        = isset( $v['ver'] )         ? $v['ver']        : SIMPLE_CALENDAR_VERSION;
307
-					$in_footer  = isset( $v['in_footer'] )   ? $v['in_footer']  : false;
304
+					$src        = esc_url($v['src']);
305
+					$deps       = isset($v['deps']) ? $v['deps'] : array();
306
+					$ver        = isset($v['ver']) ? $v['ver'] : SIMPLE_CALENDAR_VERSION;
307
+					$in_footer  = isset($v['in_footer']) ? $v['in_footer'] : false;
308 308
 
309
-					wp_enqueue_script( $script, $src, $deps, $ver, $in_footer );
309
+					wp_enqueue_script($script, $src, $deps, $ver, $in_footer);
310 310
 
311
-					if ( ! empty( $v['localize'] ) && is_array( $v['localize'] ) ) {
312
-						foreach ( $v['localize'] as $object => $l10n ) {
313
-							wp_localize_script( $script, $object, $l10n );
311
+					if ( ! empty($v['localize']) && is_array($v['localize'])) {
312
+						foreach ($v['localize'] as $object => $l10n) {
313
+							wp_localize_script($script, $object, $l10n);
314 314
 						}
315 315
 					}
316 316
 
317
-				} elseif ( is_string( $v ) && ! empty( $v ) ) {
317
+				} elseif (is_string($v) && ! empty($v)) {
318 318
 
319
-					wp_enqueue_script( $v );
319
+					wp_enqueue_script($v);
320 320
 				}
321 321
 			}
322 322
 
@@ -330,24 +330,24 @@  discard block
 block discarded – undo
330 330
 	 *
331 331
 	 * @param array $styles
332 332
 	 */
333
-	public function load_styles( $styles ) {
333
+	public function load_styles($styles) {
334 334
 
335
-		if ( ! empty( $styles ) && is_array( $styles ) ) {
335
+		if ( ! empty($styles) && is_array($styles)) {
336 336
 
337
-			foreach ( $styles as $style => $v ) {
337
+			foreach ($styles as $style => $v) {
338 338
 
339
-				if ( ! empty( $v['src'] ) ) {
339
+				if ( ! empty($v['src'])) {
340 340
 
341
-					$src    = esc_url( $v['src'] );
342
-					$deps   = isset( $v['deps'] )   ? $v['deps']    : array();
343
-					$ver    = isset( $v['ver'] )    ? $v['ver']     : SIMPLE_CALENDAR_VERSION;
344
-					$media  = isset( $v['media'] )  ? $v['media']   : 'all';
341
+					$src    = esc_url($v['src']);
342
+					$deps   = isset($v['deps']) ? $v['deps'] : array();
343
+					$ver    = isset($v['ver']) ? $v['ver'] : SIMPLE_CALENDAR_VERSION;
344
+					$media  = isset($v['media']) ? $v['media'] : 'all';
345 345
 
346
-					wp_enqueue_style( $style, $src, $deps, $ver, $media );
346
+					wp_enqueue_style($style, $src, $deps, $ver, $media);
347 347
 
348
-				} elseif ( is_string( $v ) && ! empty( $v ) ) {
348
+				} elseif (is_string($v) && ! empty($v)) {
349 349
 
350
-					wp_enqueue_style( $v );
350
+					wp_enqueue_style($v);
351 351
 				}
352 352
 
353 353
 			}
@@ -363,13 +363,13 @@  discard block
 block discarded – undo
363 363
 	public function get_default_scripts() {
364 364
 		return array(
365 365
 			'simcal-qtip' => array(
366
-				'src'       => SIMPLE_CALENDAR_ASSETS . 'js/vendor/qtip' . $this->min . '.js',
367
-				'deps'      => array( 'jquery' ),
366
+				'src'       => SIMPLE_CALENDAR_ASSETS.'js/vendor/qtip'.$this->min.'.js',
367
+				'deps'      => array('jquery'),
368 368
 				'ver'       => '2.2.1',
369 369
 				'in_footer' => true,
370 370
 			),
371 371
 			'simcal-default-calendar' => array(
372
-				'src'       => SIMPLE_CALENDAR_ASSETS . 'js/default-calendar' . $this->min . '.js',
372
+				'src'       => SIMPLE_CALENDAR_ASSETS.'js/default-calendar'.$this->min.'.js',
373 373
 				'deps'      => array(
374 374
 					'jquery',
375 375
 					'simcal-qtip',
@@ -391,12 +391,12 @@  discard block
 block discarded – undo
391 391
 	public function get_default_styles() {
392 392
 		return array(
393 393
 			'simcal-qtip' => array(
394
-				'src'   => SIMPLE_CALENDAR_ASSETS . 'css/vendor/qtip' . $this->min . '.css',
394
+				'src'   => SIMPLE_CALENDAR_ASSETS.'css/vendor/qtip'.$this->min.'.css',
395 395
 				'ver'   => '2.2.1',
396 396
 				'media' => 'all',
397 397
 			),
398 398
 			'simcal-default-calendar-grid' => array(
399
-				'src'   => SIMPLE_CALENDAR_ASSETS . 'css/default-calendar-grid' . $this->min . '.css',
399
+				'src'   => SIMPLE_CALENDAR_ASSETS.'css/default-calendar-grid'.$this->min.'.css',
400 400
 				'deps'  => array(
401 401
 					'simcal-qtip',
402 402
 				),
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
 				'media' => 'all',
405 405
 			),
406 406
 			'simcal-default-calendar-list' => array(
407
-				'src'   => SIMPLE_CALENDAR_ASSETS . 'css/default-calendar-list' . $this->min . '.css',
407
+				'src'   => SIMPLE_CALENDAR_ASSETS.'css/default-calendar-list'.$this->min.'.css',
408 408
 				'deps'  => array(
409 409
 					'simcal-qtip',
410 410
 				),
Please login to merge, or discard this patch.
includes/autoload.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -5,11 +5,11 @@  discard block
 block discarded – undo
5 5
  * @package SimpleCalendar
6 6
  */
7 7
 
8
-if ( ! defined( 'ABSPATH' ) ) {
8
+if ( ! defined('ABSPATH')) {
9 9
 	exit;
10 10
 }
11 11
 
12
-if ( ! function_exists( 'SimpleCalendar_Autoload' ) ) {
12
+if ( ! function_exists('SimpleCalendar_Autoload')) {
13 13
 
14 14
 	/**
15 15
 	 * Plugin autoloader.
@@ -22,31 +22,31 @@  discard block
 block discarded – undo
22 22
 	 *
23 23
 	 * @param $class
24 24
 	 */
25
-	function SimpleCalendar_Autoload( $class ) {
25
+	function SimpleCalendar_Autoload($class) {
26 26
 
27 27
 		// Do not load unless in plugin domain.
28 28
 		$namespace = 'SimpleCalendar';
29
-		if ( strpos( $class, $namespace ) !== 0 ) {
29
+		if (strpos($class, $namespace) !== 0) {
30 30
 			return;
31 31
 		}
32 32
 
33 33
 		// Converts Class_Name (class convention) to class-name (file convention).
34
-		$class_name = implode( '-', array_map( 'lcfirst', explode( '_', strtolower( $class ) ) ) );
34
+		$class_name = implode('-', array_map('lcfirst', explode('_', strtolower($class))));
35 35
 
36 36
 		// Remove the root namespace.
37
-		$unprefixed = substr( $class_name, strlen( $namespace ) );
37
+		$unprefixed = substr($class_name, strlen($namespace));
38 38
 
39 39
 		// Build the file path.
40
-		$file_path = str_replace( '\\', DIRECTORY_SEPARATOR, $unprefixed );
41
-		$file      = dirname( __FILE__ ) . '/' . $file_path . '.php';
40
+		$file_path = str_replace('\\', DIRECTORY_SEPARATOR, $unprefixed);
41
+		$file      = dirname(__FILE__).'/'.$file_path.'.php';
42 42
 
43
-		if ( file_exists( $file ) ) {
43
+		if (file_exists($file)) {
44 44
 			require $file;
45 45
 		}
46 46
 
47 47
 	}
48 48
 
49 49
 	// Register the autoloader.
50
-	spl_autoload_register( 'SimpleCalendar_Autoload' );
50
+	spl_autoload_register('SimpleCalendar_Autoload');
51 51
 
52 52
 }
Please login to merge, or discard this patch.