array( 'type' => 'array' ), 'generated' => array( 'type' => 'boolean' ), ); } protected function annotations(): array { return array( 'readonly' => true, 'destructive' => false, 'idempotent' => true, ); } /** * @param array $input Input. * @return array */ protected function run( array $input ) { $rows = Settings_Repository::describe_area( 'optimize-css' ); $rows = array_merge( $rows, Settings_Repository::describe_area( 'optimize-js' ) ); $rows = array_merge( $rows, Settings_Repository::describe_area( 'optimize-html' ) ); $dir = WP_CONTENT_DIR . '/litespeed/css'; $generated = is_dir( $dir ) && array() !== array_diff( (array) scandir( $dir ), array( '.', '..' ) ); return array( 'status' => $rows, 'generated' => $generated, 'message' => $generated ? __( 'Optimisation is configured and generated assets exist.', 'acrossai-abilities-manager' ) : __( 'No generated assets on disk yet — they are built on the first visit to each page.', 'acrossai-abilities-manager' ), ); } }