*/ protected function input_properties(): array { return array(); } /** * @since 0.0.45 * @return array */ protected function required_input(): array { return array(); } /** * @since 0.0.45 * @return array */ protected function output_properties(): array { return array( 'host_plugin' => array( 'type' => 'object' ), 'supported_types' => array( 'type' => 'array' ), 'covers_core' => array( 'type' => 'boolean' ), 'version_source' => array( 'type' => 'string' ), 'limits' => array( 'type' => 'array' ), ); } /** * @since 0.0.45 * @return array{readonly:bool,destructive:bool,idempotent:bool} */ protected function annotations(): array { return array( 'readonly' => true, 'destructive' => false, 'idempotent' => true, ); } /** * @since 0.0.45 * @param array $input Unused. * @return array */ protected function run( array $input ) { $active = Wp_Rollback_Guard::is_active(); return array( 'host_plugin' => (object) array( 'name' => 'WP Rollback', 'slug' => Wp_Rollback_Guard::PLUGIN_SLUG, 'file' => Wp_Rollback_Guard::PLUGIN_FILE, 'active' => $active, 'directory' => 'https://wordpress.org/plugins/' . Wp_Rollback_Guard::PLUGIN_SLUG . '/', ), 'supported_types' => array( 'plugin', 'theme' ), // Stated rather than implied: WP Rollback's own route enum is ['plugin','theme'] and it // ships no CoreRollback subsystem. A caller asking to downgrade core needs a different // answer, and finding that out here costs nothing. 'covers_core' => false, 'version_source' => 'wordpress.org', 'limits' => array( __( 'Plugins and themes only. WordPress core is not supported by WP Rollback — use the core pinning abilities or core/rollback-wp-core.', 'acrossai-abilities-manager' ), __( 'Release history comes from WordPress.org. A premium or privately-hosted asset has none there, and can only be rolled back to a version this site already holds a local archive of — which requires WP Rollback, the only thing here that does.', 'acrossai-abilities-manager' ), __( 'Only assets already installed can be re-versioned; this does not install something new.', 'acrossai-abilities-manager' ), ), 'message' => $active ? __( 'Plugins and themes can be moved onto any version WordPress.org publishes, via versions/rollback-plugin and versions/rollback-theme. WP Rollback is also active, so versions it has archived locally can be restored too — including for assets the directory does not host.', 'acrossai-abilities-manager' ) : __( 'Plugins and themes can be moved onto any version WordPress.org publishes, via versions/rollback-plugin and versions/rollback-theme. These drive WordPress core\'s own upgrader and need no host plugin. WP Rollback is not active; installing wordpress.org/plugins/wp-rollback/ adds local archives of previously installed versions, which are the only source for an asset the directory does not host.', 'acrossai-abilities-manager' ), ); } }