PluginProbe
Stream – Activity Log & Audit Trail / 4.2.2
Stream – Activity Log & Audit Trail v4.2.2
4.4.0 4.3.0 4.2.2 4.2.1 trunk 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.1 3.1.1 3.10.0 3.2.0 3.2.1 3.2.2 3.2.3 All 50 releases
← All changes | classes/class-cli.php +3 -8 trunk4.2.2 View file →
@@ -210,9 +210,9 @@
210 210 private function csv_format( $records ) {
211 211 $output = fopen( 'php://output', 'w' ); // @codingStandardsIgnoreLine Clever output for WP CLI using php://output
212 212
213 213 foreach ( $records as $line ) {
214 - fputcsv( $output, $line, ',', '"', '\\' );
214 + fputcsv( $output, $line );
215 215 }
216 216
217 217 fclose( $output ); // @codingStandardsIgnoreLine
218 218 }
@@ -222,11 +222,9 @@
222 222 *
223 223 * @return void
224 224 */
225 225 private function connection() {
226 - global $wpdb;
227 -
228 - wp_stream_get_instance()->db->query(
226 + $query = wp_stream_get_instance()->db->query(
229 227 array(
230 228 'records_per_page' => 1,
231 229 'fields' => 'created',
232 230 )
@@ -231,12 +229,9 @@
231 229 'fields' => 'created',
232 230 )
233 231 );
234 232
235 - // An empty result set is valid (e.g. a fresh site with no logged
236 - // activity yet); only a genuine database error means the site is
237 - // disconnected.
238 - if ( ! empty( $wpdb->last_error ) ) {
233 + if ( ! $query ) {
239 234 \WP_CLI::error( esc_html__( 'SITE IS DISCONNECTED', 'stream' ) );
240 235 }
241 236 }
242 237 }