diff --git a/connectors/installer.php b/connectors/installer.php index a8f9037f0..37354745c 100644 --- a/connectors/installer.php +++ b/connectors/installer.php @@ -137,7 +137,7 @@ public static function callback_upgrader_process_complete( $upgrader, $extra ) { 'Plugin/theme installation. 1: Type (plugin/theme), 2: Plugin/theme name, 3: Plugin/theme version', 'stream' ); - $logs[] = compact( 'slug', 'name', 'version', 'message', 'action', 'message' ); + $logs[] = compact( 'slug', 'name', 'version', 'message', 'action' ); } elseif ( 'update' === $action ) { $action = 'updated'; $message = _x( @@ -158,7 +158,7 @@ public static function callback_upgrader_process_complete( $upgrader, $extra ) { $version = $plugin_data['Version']; $old_version = $plugins[ $slug ]['Version']; - $logs[] = compact( 'slug', 'name', 'old_version', 'version', 'message', 'action', 'message' ); + $logs[] = compact( 'slug', 'name', 'old_version', 'version', 'message', 'action' ); } } else { // theme if ( isset( $extra['bulk'] ) && true == $extra['bulk'] ) { @@ -174,7 +174,7 @@ public static function callback_upgrader_process_complete( $upgrader, $extra ) { $old_version = $theme['Version']; $version = $theme_data['Version']; - $logs[] = compact( 'slug', 'name', 'old_version', 'version', 'message', 'action', 'message' ); + $logs[] = compact( 'slug', 'name', 'old_version', 'version', 'message', 'action' ); } } } else { @@ -184,11 +184,15 @@ public static function callback_upgrader_process_complete( $upgrader, $extra ) { $context = $type . 's'; foreach ( $logs as $log ) { - extract( $log ); - unset( $log['action'] ); + $name = isset( $log['name'] ) ? $log['name'] : null; + $version = isset( $log['version'] ) ? $log['version'] : null; + $slug = isset( $log['slug'] ) ? $log['slug'] : null; + $old_version = isset( $log['old_version'] ) ? $log['old_version'] : null; + $message = isset( $log['message'] ) ? $log['message'] : null; + $action = isset( $log['action'] ) ? $log['action'] : null; self::log( $message, - compact( 'type', 'name', 'version', 'slug', 'success', 'error', 'from' , 'old_version' ), + compact( 'type', 'name', 'version', 'slug', 'success', 'error', 'old_version' ), null, array( $context => $action ) ); diff --git a/includes/dashboard.php b/includes/dashboard.php index efd968aa2..ff233a543 100644 --- a/includes/dashboard.php +++ b/includes/dashboard.php @@ -72,8 +72,8 @@ public static function stream_activity_contents( $paged = 1 ) { $total_items = count( $all_records ); $args = array( - 'total_pages' => absint( ceil( $total_items / $records_per_page ) ), // Cast as an integer, not a float 'current' => $paged, + 'total_pages' => absint( ceil( $total_items / $records_per_page ) ), // Cast as an integer, not a float ); self::pagination( $args ); @@ -91,7 +91,9 @@ public static function pagination( $args = array() ) { 'total_pages' => 1, ) ); - extract( $args ); + + $current = $args['current']; + $total_pages = $args['total_pages']; $records_link = add_query_arg( array( 'page' => WP_Stream_Admin::RECORDS_PAGE_SLUG ), diff --git a/includes/live-update.php b/includes/live-update.php index 3aa3ddbb3..40c2db675 100644 --- a/includes/live-update.php +++ b/includes/live-update.php @@ -106,7 +106,9 @@ public static function heartbeat_received( $response, $data ) { self::$list_table = new WP_Stream_List_Table( array( 'screen' => 'toplevel_page_' . WP_Stream_Admin::RECORDS_PAGE_SLUG ) ); self::$list_table->prepare_items(); - extract( self::$list_table->_pagination_args, EXTR_SKIP ); + $total_items = isset( self::$list_table->_pagination_args['total_items'] ) ? self::$list_table->_pagination_args['total_items'] : null; + $total_pages = isset( self::$list_table->_pagination_args['total_pages'] ) ? self::$list_table->_pagination_args['total_pages'] : null; + $per_page = isset( self::$list_table->_pagination_args['per_page'] ) ? self::$list_table->_pagination_args['per_page'] : null; if ( isset( $data['wp-stream-heartbeat'] ) && isset( $total_items ) ) { $response['total_items'] = $total_items;