Skip to content

Commit a6be580

Browse files
Fixed fatals
1 parent f83072f commit a6be580

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

projects/packages/stats-admin/src/class-admin-post-list-column.php

+10-6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77

88
namespace Automattic\Jetpack\Stats_Admin;
99

10+
use Automattic\Jetpack\Connection\Manager as Connection_Manager;
11+
use Automattic\Jetpack\Redirect;
12+
use Automattic\Jetpack\Stats\Options as Stats_Options;
13+
use Automattic\Jetpack\Stats\WPCOM_Stats;
14+
use Automattic\Jetpack\Status\Host;
15+
1016
/**
1117
* Add a Stats column in the post and page lists.
1218
*/
@@ -58,7 +64,7 @@ public function add_stats_post_table_cell( $column, $post_id ) {
5864
);
5965
} else {
6066
// Link to the wp-admin stats page.
61-
$stats_post_url = admin_url( sprintf( 'admin.php?page=stats#!/stats/post/%d/%d', $post_id, Jetpack_Options::get_option( 'id', 0 ) ) );
67+
$stats_post_url = admin_url( sprintf( 'admin.php?page=stats#!/stats/post/%d/%d', $post_id, \Jetpack_Options::get_option( 'id', 0 ) ) );
6268
// Unless the user is on a Default style WOA site, in which case link to Calypso.
6369
if ( ( new Host() )->is_woa_site() && Stats_Options::get_option( 'enable_odyssey_stats' ) && 'wp-admin' !== get_option( 'wpcom_admin_interface' ) ) {
6470
$stats_post_url = Redirect::get_url(
@@ -93,11 +99,11 @@ public function add_stats_post_table_cell( $column, $post_id ) {
9399
$compact_decimal_short = 14;
94100

95101
try {
96-
$formatter = new NumberFormatter( $current_locale, $compact_decimal_short );
97-
$formatter->setAttribute( NumberFormatter::MAX_FRACTION_DIGITS, 1 );
102+
$formatter = new \NumberFormatter( $current_locale, $compact_decimal_short );
103+
$formatter->setAttribute( \NumberFormatter::MAX_FRACTION_DIGITS, 1 );
98104
} catch ( \Exception $e ) {
99105
// Fallback to decimal if for some reason it fails to work.
100-
$formatter = new NumberFormatter( $current_locale, NumberFormatter::DECIMAL );
106+
$formatter = new \NumberFormatter( $current_locale, \NumberFormatter::DECIMAL );
101107
}
102108

103109
?>
@@ -116,8 +122,6 @@ class="dashicons dashicons-visibility"></span>&nbsp;<span><?php echo $views ? es
116122
*
117123
* @param array $columns An array of column names.
118124
*
119-
* @since 4.7.0
120-
*
121125
* @return mixed
122126
*/
123127
public function add_stats_post_table( $columns ) {

0 commit comments

Comments
 (0)