PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3-a.1
Jetpack – WP Security, Backup, Speed, & Growth v16.3-a.1
16.3-a.3 16.3-a.1 16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 13.8.3 13.9.2 14.0.1 All 504 releases
← All changes | modules/widgets/blog-stats.php +7 -3 13.3.316.3-a.1 View file →
@@ -9,12 +9,13 @@
9 9
10 10 // phpcs:disable Universal.Files.SeparateFunctionsFromOO.Mixed -- TODO: Move classes to appropriately-named class files.
11 11
12 12 use Automattic\Jetpack\Stats\WPCOM_Stats;
13 +use Automattic\Jetpack\Status\Host;
13 14
14 15 // Disable direct access/execution to/of the widget code.
15 16 if ( ! defined( 'ABSPATH' ) ) {
16 - exit;
17 + exit( 0 );
17 18 }
18 19
19 20 /**
20 21 * Blog Stats Widget.
@@ -51,9 +52,12 @@
51 52 * @param array $widget_types List of widgets that are currently removed from the Legacy Widget block.
52 53 * @return array $widget_types New list of widgets that will be removed.
53 54 */
54 55 public function hide_widget_in_block_editor( $widget_types ) {
55 - $widget_types[] = 'blog-stats';
56 + // @TODO: Hide for Simple sites when the block API starts working.
57 + if ( ! ( new Host() )->is_wpcom_simple() ) {
58 + $widget_types[] = 'blog-stats';
59 + }
56 60 return $widget_types;
57 61 }
58 62
59 63 /**
@@ -98,9 +102,9 @@
98 102 * @see WP_Widget::form()
99 103 *
100 104 * @param array $instance Previously saved values from database.
101 105 *
102 - * @return void
106 + * @return string|void
103 107 */
104 108 public function form( $instance ) {
105 109 $instance = wp_parse_args( $instance, $this->defaults() );
106 110 ?>