@@ -270,11 +270,13 @@ |
||
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 |
@@ -106,8 +106,10 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -51,8 +51,9 @@ discard block |
||
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 |
||
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' ); |
@@ -73,14 +73,15 @@ |
||
73 | 73 | foreach ( (array) $checks as $key => $check ) { |
74 | 74 | |
75 | 75 | echo $check; |
76 | - } |
|
77 | - |
|
78 | - else: |
|
76 | + } else { |
|
77 | + : |
|
79 | 78 | |
80 | 79 | // pre-flight is go for flight |
81 | 80 | ?> |
82 | 81 | <li class="success"> |
83 | - <h3><?php _e( 'You\'re Ready to Rock!', 'lasso' );?></h3> |
|
82 | + <h3><?php _e( 'You\'re Ready to Rock!', 'lasso' ); |
|
83 | + } |
|
84 | + ?></h3> |
|
84 | 85 | <?php if ( lasso_get_supported_theme_class() ) { ?> |
85 | 86 | <p><?php _e( 'Your theme is automatically supported. No additional setup is needed.', 'lasso' );?></p> |
86 | 87 | <?php } ?> |
@@ -30,8 +30,9 @@ |
||
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, |
@@ -119,9 +119,9 @@ discard block |
||
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 |
||
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 |
@@ -31,7 +31,7 @@ |
||
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 |
@@ -132,8 +132,7 @@ discard block |
||
132 | 132 | |
133 | 133 | |
134 | 134 | $result = wp_set_object_terms( $postid, $value, $taxonomy ); |
135 | - } |
|
136 | - else { |
|
135 | + } else { |
|
137 | 136 | //remove all terms from post |
138 | 137 | $result = wp_set_object_terms( $postid, null, $taxonomy ); |
139 | 138 | |
@@ -141,7 +140,7 @@ discard block |
||
141 | 140 | |
142 | 141 | if ( ! is_wp_error( $result ) ) { |
143 | 142 | return true; |
144 | - }else{ |
|
143 | + } else{ |
|
145 | 144 | return false; |
146 | 145 | } |
147 | 146 |
@@ -47,8 +47,7 @@ discard block |
||
47 | 47 | $defaults[ 'type' ] = $params; |
48 | 48 | |
49 | 49 | $params = $defaults; |
50 | - } |
|
51 | - else { |
|
50 | + } else { |
|
52 | 51 | $params = array_merge( $defaults, (array) $params ); |
53 | 52 | } |
54 | 53 | |
@@ -63,24 +62,21 @@ discard block |
||
63 | 62 | } |
64 | 63 | |
65 | 64 | $output = (object) $output; |
66 | - } |
|
67 | - elseif ( is_array( $input ) ) { |
|
65 | + } elseif ( is_array( $input ) ) { |
|
68 | 66 | $n_params = $params; |
69 | 67 | $n_params[ 'nested' ] = true; |
70 | 68 | |
71 | 69 | foreach ( $input as $key => $val ) { |
72 | 70 | $output[ self::do_sanitize( $key ) ] = self::do_sanitize( $val, $n_params ); |
73 | 71 | } |
74 | - } |
|
75 | - elseif ( !empty( $params[ 'type' ] ) && false !== strpos( $params[ 'type' ], '%' ) ) { |
|
72 | + } elseif ( !empty( $params[ 'type' ] ) && false !== strpos( $params[ 'type' ], '%' ) ) { |
|
76 | 73 | /** |
77 | 74 | * @var $wpdb wpdb |
78 | 75 | */ |
79 | 76 | global $wpdb; |
80 | 77 | |
81 | 78 | $output = $wpdb->prepare( $params[ 'type' ], $output ); |
82 | - } |
|
83 | - else { |
|
79 | + } else { |
|
84 | 80 | $output = wp_slash( $input ); |
85 | 81 | } |
86 | 82 | |
@@ -115,20 +111,17 @@ discard block |
||
115 | 111 | } |
116 | 112 | |
117 | 113 | $output = (object) $output; |
118 | - } |
|
119 | - elseif ( is_array( $input ) ) { |
|
114 | + } elseif ( is_array( $input ) ) { |
|
120 | 115 | foreach ( $input as $key => $val ) { |
121 | 116 | $output[ $key ] = self::sanitize_like( $val ); |
122 | 117 | } |
123 | - } |
|
124 | - else { |
|
118 | + } else { |
|
125 | 119 | global $wpdb; |
126 | 120 | |
127 | 121 | //backwords-compat check for pre WP4.0 |
128 | 122 | if ( method_exists( 'wpdb', 'esc_like' ) ) { |
129 | 123 | $output = $wpdb->esc_like( self::do_sanitize( $input ) ); |
130 | - } |
|
131 | - else { |
|
124 | + } else { |
|
132 | 125 | // like_escape is deprecated in WordPress 4.0 |
133 | 126 | $output = like_escape( self::do_sanitize( $input ) ); |
134 | 127 | } |
@@ -160,8 +153,7 @@ discard block |
||
160 | 153 | |
161 | 154 | if ( empty( $input ) ) { |
162 | 155 | $output = $input; |
163 | - } |
|
164 | - elseif ( is_object( $input ) ) { |
|
156 | + } elseif ( is_object( $input ) ) { |
|
165 | 157 | $input = get_object_vars( $input ); |
166 | 158 | |
167 | 159 | foreach ( $input as $key => $val ) { |
@@ -169,13 +161,11 @@ discard block |
||
169 | 161 | } |
170 | 162 | |
171 | 163 | $output = (object) $output; |
172 | - } |
|
173 | - elseif ( is_array( $input ) ) { |
|
164 | + } elseif ( is_array( $input ) ) { |
|
174 | 165 | foreach ( $input as $key => $val ) { |
175 | 166 | $output[ $key ] = self::unslash( $val ); |
176 | 167 | } |
177 | - } |
|
178 | - else { |
|
168 | + } else { |
|
179 | 169 | $output = wp_unslash( $input ); |
180 | 170 | |
181 | 171 | } |