Completed
Pull Request — master (#116)
by
unknown
02:26
created
admin/includes/EDD_SL_Plugin_Updater.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -270,11 +270,13 @@
 block discarded – undo
270 270
 
271 271
 		$data = array_merge( $this->api_data, $_data );
272 272
 
273
-		if ( $data['slug'] != $this->slug )
274
-			return;
273
+		if ( $data['slug'] != $this->slug ) {
274
+					return;
275
+		}
275 276
 
276
-		if ( empty( $data['license'] ) )
277
-			return;
277
+		if ( empty( $data['license'] ) ) {
278
+					return;
279
+		}
278 280
 
279 281
 		if ( $this->api_url == home_url() ) {
280 282
 			return false; // Don't allow a plugin to ping itself
Please login to merge, or discard this patch.
admin/includes/load_admin.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -127,11 +127,11 @@  discard block
 block discarded – undo
127 127
 	}
128 128
 
129 129
 	/**
130
-	*	Adds an admin notice reminding the user if their license key has not been saved
131
-	*
132
-	*	@since 0.9.7
133
-	*	@todo make dismissible
134
-	*/
130
+	 *	Adds an admin notice reminding the user if their license key has not been saved
131
+	 *
132
+	 *	@since 0.9.7
133
+	 *	@todo make dismissible
134
+	 */
135 135
 	public function license_nag(){
136 136
 
137 137
 		$screen 	= get_current_screen();
@@ -152,26 +152,26 @@  discard block
 block discarded – undo
152 152
 
153 153
 			if ( empty( $license ) ) {
154 154
 
155
-        		printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_empty, $license_link, $dismiss_link );
155
+				printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_empty, $license_link, $dismiss_link );
156 156
 
157
-        	} else if ( 'invalid' == $status ){ // license key entered wrong or something
157
+			} else if ( 'invalid' == $status ){ // license key entered wrong or something
158 158
 
159 159
 				printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_invalid, $license_link , $dismiss_link );
160 160
 
161
-        	} else if ( empty( $status ) ){ // license key saved but not activated
161
+			} else if ( empty( $status ) ){ // license key saved but not activated
162 162
 
163 163
 				printf('<div class="lasso-notice error" style="position:relative;"><p>%s %s</p>%s</div>', $message_inactive, $license_link, $dismiss_link );
164 164
 
165
-        	}
165
+			}
166 166
 		}
167 167
 
168 168
 	}
169 169
 
170 170
 	/**
171
-	*  Process hiding the dimiss
172
-	*
173
-	* @since 0.9.7
174
-	*/
171
+	 *  Process hiding the dimiss
172
+	 *
173
+	 * @since 0.9.7
174
+	 */
175 175
 	public function dismiss_nag() {
176 176
 
177 177
 		if ( isset( $_GET['lasso-notice'] ) && 'dismiss' == $_GET['lasso-notice'] && current_user_can('manage_options') ) {
Please login to merge, or discard this patch.
admin/includes/menus/license.php 1 patch
Braces   +20 added lines, -12 removed lines patch added patch discarded remove patch
@@ -106,8 +106,10 @@  discard block
 block discarded – undo
106 106
 		if ( isset( $_POST['edd_license_activate'] ) ) {
107 107
 
108 108
 			// run a quick security check
109
-			if ( ! check_admin_referer( 'lasso_license_nonce', 'lasso_license_nonce' ) )
110
-				return; // get out if we didn't click the Activate button
109
+			if ( ! check_admin_referer( 'lasso_license_nonce', 'lasso_license_nonce' ) ) {
110
+							return;
111
+			}
112
+			// get out if we didn't click the Activate button
111 113
 
112 114
 			// retrieve the license from the database
113 115
 			$license = trim( get_option( 'lasso_license_key' ) );
@@ -124,8 +126,9 @@  discard block
 block discarded – undo
124 126
 			$response = wp_remote_post( LASSO_STORE_URL, array( 'body' => $api_params, 'timeout' => 15, 'sslverify' => false ) );
125 127
 
126 128
 			// make sure the response came back okay
127
-			if ( is_wp_error( $response ) )
128
-				return false;
129
+			if ( is_wp_error( $response ) ) {
130
+							return false;
131
+			}
129 132
 
130 133
 			// decode the license data
131 134
 			$license_data = json_decode( wp_remote_retrieve_body( $response ) );
@@ -143,8 +146,10 @@  discard block
 block discarded – undo
143 146
 		if ( isset( $_POST['edd_license_deactivate'] ) ) {
144 147
 
145 148
 			// run a quick security check
146
-			if ( ! check_admin_referer( 'lasso_license_nonce', 'lasso_license_nonce' ) )
147
-				return; // get out if we didn't click the Activate button
149
+			if ( ! check_admin_referer( 'lasso_license_nonce', 'lasso_license_nonce' ) ) {
150
+							return;
151
+			}
152
+			// get out if we didn't click the Activate button
148 153
 
149 154
 			// retrieve the license from the database
150 155
 			$license = trim( get_option( 'lasso_license_key' ) );
@@ -162,15 +167,17 @@  discard block
 block discarded – undo
162 167
 			$response = wp_remote_post( LASSO_STORE_URL, array( 'body' => $api_params, 'timeout' => 15, 'sslverify' => false ) );
163 168
 
164 169
 			// make sure the response came back okay
165
-			if ( is_wp_error( $response ) )
166
-				return false;
170
+			if ( is_wp_error( $response ) ) {
171
+							return false;
172
+			}
167 173
 
168 174
 			// decode the license data
169 175
 			$license_data = json_decode( wp_remote_retrieve_body( $response ) );
170 176
 
171 177
 			// $license_data->license will be either "deactivated" or "failed"
172
-			if ( $license_data->license == 'deactivated' )
173
-				delete_option( 'lasso_license_status' );
178
+			if ( $license_data->license == 'deactivated' ) {
179
+							delete_option( 'lasso_license_status' );
180
+			}
174 181
 
175 182
 		}
176 183
 	}
@@ -192,8 +199,9 @@  discard block
 block discarded – undo
192 199
 		// Call the custom API.
193 200
 		$response = wp_remote_post( LASSO_STORE_URL, array( 'body' => $api_params, 'timeout' => 15, 'sslverify' => false ) );
194 201
 
195
-		if ( is_wp_error( $response ) )
196
-			return false;
202
+		if ( is_wp_error( $response ) ) {
203
+					return false;
204
+		}
197 205
 
198 206
 		$license_data = json_decode( wp_remote_retrieve_body( $response ) );
199 207
 
Please login to merge, or discard this patch.
admin/includes/menus/settings.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -51,8 +51,9 @@  discard block
 block discarded – undo
51 51
 	function process_settings() {
52 52
 
53 53
 		// bail out if current user isn't and administrator and they are not logged in
54
-		if ( !current_user_can( 'manage_options' ) || !is_user_logged_in() )
55
-			return;
54
+		if ( !current_user_can( 'manage_options' ) || !is_user_logged_in() ) {
55
+					return;
56
+		}
56 57
 
57 58
 		if ( isset( $_POST['action'] ) && 'lasso-editor-settings' == $_POST['action'] && check_admin_referer( 'nonce', 'lasso_editor_settings' ) ) {
58 59
 
@@ -88,8 +89,9 @@  discard block
 block discarded – undo
88 89
 	 */
89 90
 	function lasso_editor_settings_form() {
90 91
 
91
-		if ( !is_user_logged_in() )
92
-			return;
92
+		if ( !is_user_logged_in() ) {
93
+					return;
94
+		}
93 95
 
94 96
 		$article_object   = lasso_editor_get_option( 'article_class', 'lasso_editor' );
95 97
 		$featImgClass    = lasso_editor_get_option( 'featimg_class', 'lasso_editor' );
Please login to merge, or discard this patch.
admin/includes/menus/welcome.php 2 patches
Indentation   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -197,53 +197,53 @@
 block discarded – undo
197 197
 	 */
198 198
 	function required_plugins() {
199 199
 
200
-	    $plugins = array(
201
-
202
-	        array(
203
-	            'name'      => __('WP REST API','lasso'),
204
-	            'slug'      => 'json-rest-api',
205
-	            'required'  => true,
206
-	        ),
207
-
208
-	        array(
209
-	            'name'      => __('Aesop Story Engine','lasso'),
210
-	            'slug'      => 'aesop-story-engine',
211
-	            'required'  => false,
212
-	        ),
213
-
214
-	    );
215
-
216
-	    $config = array(
217
-	        'default_path' => '',                      // Default absolute path to pre-packaged plugins.
218
-	        'menu'         => 'lasso-install-plugins', // Menu slug.
219
-	        'has_notices'  => true,                    // Show admin notices or not.
220
-	        'dismissable'  => true,                    // If false, a user cannot dismiss the nag message.
221
-	        'dismiss_msg'  => '',                      // If 'dismissable' is false, this message will be output at top of nag.
222
-	        'is_automatic' => false,                   // Automatically activate plugins after installation or not.
223
-	        'message'      => '',                      // Message to output right before the plugins table.
224
-	        'strings'      => array(
225
-	            'page_title'                      => __( 'Install Required Plugins', 'lasso' ),
226
-	            'menu_title'                      => __( 'Install Plugins', 'lasso' ),
227
-	            'installing'                      => __( 'Installing Plugin: %s', 'lasso' ), // %s = plugin name.
228
-	            'oops'                            => __( 'Something went wrong with the plugin API.', 'lasso' ),
229
-	            'notice_can_install_required'     => _n_noop( 'This plugin requires the following plugin: %1$s.', 'This plugin requires the following plugins: %1$s.' ), // %1$s = plugin name(s).
230
-	            'notice_can_install_recommended'  => _n_noop( 'This plugin recommends the following plugin: %1$s.', 'This plugin recommends the following plugins: %1$s.' ), // %1$s = plugin name(s).
231
-	            'notice_cannot_install'           => _n_noop( 'Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.' ), // %1$s = plugin name(s).
232
-	            'notice_can_activate_required'    => _n_noop( 'The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.' ), // %1$s = plugin name(s).
233
-	            'notice_can_activate_recommended' => _n_noop( 'The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.' ), // %1$s = plugin name(s).
234
-	            'notice_cannot_activate'          => _n_noop( 'Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.' ), // %1$s = plugin name(s).
235
-	            'notice_ask_to_update'            => _n_noop( 'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this plugin: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this plugin: %1$s.' ), // %1$s = plugin name(s).
236
-	            'notice_cannot_update'            => _n_noop( 'Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.', 'Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.' ), // %1$s = plugin name(s).
237
-	            'install_link'                    => _n_noop( 'Begin installing plugin', 'Begin installing plugins' ),
238
-	            'activate_link'                   => _n_noop( 'Begin activating plugin', 'Begin activating plugins' ),
239
-	            'return'                          => __( 'Return to Required Plugins Installer', 'lasso' ),
240
-	            'plugin_activated'                => __( 'Plugin activated successfully.', 'lasso' ),
241
-	            'complete'                        => __( 'All plugins installed and activated successfully. %s', 'lasso' ), // %s = dashboard link.
242
-	            'nag_type'                        => 'updated' // Determines admin notice type - can only be 'updated', 'update-nag' or 'error'.
243
-	        )
244
-	    );
245
-
246
-	    tgmpa( $plugins, $config );
200
+		$plugins = array(
201
+
202
+			array(
203
+				'name'      => __('WP REST API','lasso'),
204
+				'slug'      => 'json-rest-api',
205
+				'required'  => true,
206
+			),
207
+
208
+			array(
209
+				'name'      => __('Aesop Story Engine','lasso'),
210
+				'slug'      => 'aesop-story-engine',
211
+				'required'  => false,
212
+			),
213
+
214
+		);
215
+
216
+		$config = array(
217
+			'default_path' => '',                      // Default absolute path to pre-packaged plugins.
218
+			'menu'         => 'lasso-install-plugins', // Menu slug.
219
+			'has_notices'  => true,                    // Show admin notices or not.
220
+			'dismissable'  => true,                    // If false, a user cannot dismiss the nag message.
221
+			'dismiss_msg'  => '',                      // If 'dismissable' is false, this message will be output at top of nag.
222
+			'is_automatic' => false,                   // Automatically activate plugins after installation or not.
223
+			'message'      => '',                      // Message to output right before the plugins table.
224
+			'strings'      => array(
225
+				'page_title'                      => __( 'Install Required Plugins', 'lasso' ),
226
+				'menu_title'                      => __( 'Install Plugins', 'lasso' ),
227
+				'installing'                      => __( 'Installing Plugin: %s', 'lasso' ), // %s = plugin name.
228
+				'oops'                            => __( 'Something went wrong with the plugin API.', 'lasso' ),
229
+				'notice_can_install_required'     => _n_noop( 'This plugin requires the following plugin: %1$s.', 'This plugin requires the following plugins: %1$s.' ), // %1$s = plugin name(s).
230
+				'notice_can_install_recommended'  => _n_noop( 'This plugin recommends the following plugin: %1$s.', 'This plugin recommends the following plugins: %1$s.' ), // %1$s = plugin name(s).
231
+				'notice_cannot_install'           => _n_noop( 'Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.' ), // %1$s = plugin name(s).
232
+				'notice_can_activate_required'    => _n_noop( 'The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.' ), // %1$s = plugin name(s).
233
+				'notice_can_activate_recommended' => _n_noop( 'The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.' ), // %1$s = plugin name(s).
234
+				'notice_cannot_activate'          => _n_noop( 'Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.' ), // %1$s = plugin name(s).
235
+				'notice_ask_to_update'            => _n_noop( 'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this plugin: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this plugin: %1$s.' ), // %1$s = plugin name(s).
236
+				'notice_cannot_update'            => _n_noop( 'Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.', 'Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.' ), // %1$s = plugin name(s).
237
+				'install_link'                    => _n_noop( 'Begin installing plugin', 'Begin installing plugins' ),
238
+				'activate_link'                   => _n_noop( 'Begin activating plugin', 'Begin activating plugins' ),
239
+				'return'                          => __( 'Return to Required Plugins Installer', 'lasso' ),
240
+				'plugin_activated'                => __( 'Plugin activated successfully.', 'lasso' ),
241
+				'complete'                        => __( 'All plugins installed and activated successfully. %s', 'lasso' ), // %s = dashboard link.
242
+				'nag_type'                        => 'updated' // Determines admin notice type - can only be 'updated', 'update-nag' or 'error'.
243
+			)
244
+		);
245
+
246
+		tgmpa( $plugins, $config );
247 247
 
248 248
 	}
249 249
 }
Please login to merge, or discard this patch.
Braces   +8 added lines, -5 removed lines patch added patch discarded remove patch
@@ -71,23 +71,26 @@
 block discarded – undo
71 71
 			  				<p><?php _e( 'We will check the current theme on every site in your network and give you a quick status feedback here. You can see the status by visiting the Editus menu on each site.', 'lasso' );?></p>
72 72
 			  			</li>
73 73
 
74
-			  		<?php else :
74
+			  		<?php else {
75
+	:
75 76
 
76 77
 					$checks = self::lasso_preflight_check();
78
+}
77 79
 
78 80
 					if ( $checks && !defined( 'LASSO_AGENCY_MODE' ) ):
79 81
 
80 82
 						foreach ( (array) $checks as $key => $check ) {
81 83
 
82 84
 							echo $check;
83
-						}
84
-
85
-						else:
85
+						} else {
86
+							:
86 87
 
87 88
 							// pre-flight is go for flight
88 89
 						?>
89 90
 						<li class="success">
90
-							<h3><?php _e( 'You\'re Ready to Rock!', 'lasso' );?></h3>
91
+							<h3><?php _e( 'You\'re Ready to Rock!', 'lasso' );
92
+						}
93
+						?></h3>
91 94
 							<?php if ( lasso_get_supported_theme_class() ) { ?>
92 95
 							<p><?php _e( 'Your theme is automatically supported. No additional setup is needed.', 'lasso' );?></p>
93 96
 							<?php } ?>
Please login to merge, or discard this patch.
includes/lasso_autoloader.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -115,8 +115,8 @@
 block discarded – undo
115 115
 			// replace namespace separators with directory separators
116 116
 			// in the relative class name, append with .php
117 117
 			$file = $base_dir
118
-			        . str_replace('\\', '/', $relative_class)
119
-			        . '.php';
118
+					. str_replace('\\', '/', $relative_class)
119
+					. '.php';
120 120
 
121 121
 			// if the mapped file exists, require it
122 122
 			if ($this->requireFile($file)) {
Please login to merge, or discard this patch.
includes/process/delete.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,8 +30,9 @@
 block discarded – undo
30 30
 		$postid = isset( $data['postid'] ) ? $data['postid'] : false;
31 31
 
32 32
 		// bail out if teh current user can't publish posts
33
-		if ( !lasso_user_can( 'delete_post', $postid ) )
34
-			return;
33
+		if ( !lasso_user_can( 'delete_post', $postid ) ) {
34
+					return;
35
+		}
35 36
 
36 37
 		$args = array(
37 38
 			'ID'   			=> (int) $postid,
Please login to merge, or discard this patch.
includes/process/gallery.php 1 patch
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -119,9 +119,9 @@  discard block
 block discarded – undo
119 119
 		$gallery_ids  = isset( $data['gallery_ids'] ) ? $data['gallery_ids'] : false;
120 120
 		if ( ! empty( $data ) && $data[ 'gallery_type' ] ) {
121 121
 			$type = $data[ 'gallery_type' ];
122
-		}elseif ( ! empty( $options ) && $options[ 'galleryType' ] ) {
122
+		} elseif ( ! empty( $options ) && $options[ 'galleryType' ] ) {
123 123
 			$type = $options[ 'galleryType' ];
124
-		}else{
124
+		} else{
125 125
 			$type = false;
126 126
 		}
127 127
 
@@ -173,8 +173,9 @@  discard block
 block discarded – undo
173 173
 	 */
174 174
 	private function get_the_images( $image_ids = '' ) {
175 175
 
176
-		if ( empty( $image_ids ) )
177
-			return;
176
+		if ( empty( $image_ids ) ) {
177
+					return;
178
+		}
178 179
 
179 180
 		$image_ids  = array_map( 'intval', explode( ',', $image_ids ) );
180 181
 
Please login to merge, or discard this patch.
includes/process/revision.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
 		$args = array();
32 32
 		if ( isset( $data[ 'limit' ] ) ) {
33 33
 			$args[ 'posts_per_page' ] = $data[ 'limit' ];
34
-		}else{
34
+		} else{
35 35
 			$args[ 'posts_per_page' ] = 6; // we start at revision 0
36 36
 		}
37 37
 
Please login to merge, or discard this patch.