| @@ -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 | ?> |