*/ protected function input_properties(): array { return array(); } /** * @since 0.0.34 * @return array */ protected function required_input(): array { return array(); } /** * @since 0.0.34 * @return array */ protected function output_properties(): array { return array( 'pageviews' => array( 'type' => 'object', 'additionalProperties' => true ), ); } /** * @since 0.0.34 * @return array */ protected function annotations(): array { return array( 'readonly' => true, 'destructive' => false, 'idempotent' => true, ); } /** * @since 0.0.34 * @return bool */ protected function requires_account(): bool { return true; } /** * @since 0.0.34 * @return string */ protected function account_subject(): string { return __( 'Banner pageview figures', 'acrossai-abilities-manager' ); } /** * @since 0.0.34 * @param array $input Input. * @return array|WP_Error */ protected function run( array $input ) { $class = '\\CookieYes\\Lite\\Admin\\Modules\\Pageviews\\Includes\\Controller'; if ( ! class_exists( $class ) || ! method_exists( $class, 'get_pageviews' ) ) { return new WP_Error( 'consent_feature_unavailable', __( 'This edition of the consent plugin does not expose pageview figures.', 'acrossai-abilities-manager' ) ); } return array( 'pageviews' => (array) $class::get_instance()->get_pageviews() ); } }