Title: Switcheroo
Author: John Thompson
Published: <strong>4 de Febreiro, 2025</strong>
Last modified: 12 de Marzo, 2025

---

Buscar plugins

![](https://ps.w.org/switcheroo/assets/banner-772x250.png?rev=3234776)

Este plugin **non se actualizou en máis de 2 anos**. É posible que xa non sexa compatible
ou mantido por ninguén, ou podes ter problemas de compatibilidade cando se usa con
novas versións de WordPress.

![](https://ps.w.org/switcheroo/assets/icon-256x256.png?rev=3234738)

# Switcheroo

 Por [John Thompson](https://profiles.wordpress.org/ufmedia/)

[Descargar](https://downloads.wordpress.org/plugin/switcheroo.1.0.2.zip)

 * [Detalles](https://gl.wordpress.org/plugins/switcheroo/#description)
 * [Valoracións](https://gl.wordpress.org/plugins/switcheroo/#reviews)
 *  [Instalación](https://gl.wordpress.org/plugins/switcheroo/#installation)
 * [Desenvolvemento](https://gl.wordpress.org/plugins/switcheroo/#developers)

 [Soporte](https://wordpress.org/support/plugin/switcheroo/)

## Descrición

Feature flags are a powerful tool for controlling the availability of features on
your site. By enabling or disabling flags, you can control what is active on your
site without needing to deploy new code.

Features are defined in the `switcheroo.json` file located in the root of your project.

Each feature has:

 * **Unique ID**: An identifier for the feature.
 * **Title**: A human-readable name.
 * **Description**: Explains the feature’s purpose.
 * **Status**: Indicates whether the feature is active, experimental, deprecated,
   etc.
 * **Link**: An optional link to further information.

You can toggle each feature within the Switcheroo Settings in the WP Admin (Settings-
> Switcheroo).

### Usage

### Managing Feature Flags in Code

You can wrap your feature-specific code in a conditional statement to check if a
flag is enabled.

For example, use the `switcheroo_flag_status('my_feature')` function to determine
whether a feature is active and include its logic conditionally.

### Suggested Feature Flag Statuses

Each feature flag can be assigned a status, allowing for better organisation and
understanding of the feature’s state:

 * **Draft**: The feature is still in development and not ready for use.
 * **Experimental**: The feature is available for testing but may have known issues.
 * **Active**: The feature is live and functional on the site.
 * **Deprecated**: The feature is being phased out and may be removed in the future.
 * **Breaking**: The feature introduces significant changes; enabling or disabling
   it may cause issues.
 * **Archived**: The feature has been permanently removed or is no longer supported.
 * **High-Risk**: The feature introduces significant changes or is under scrutiny
   for potential issues.

### Command Line Management

You can also manage your feature flags via the command line using WP-CLI. The `wp
switcheroo` command allows you to view and modify feature flags.

Examples:
 – `wp switcheroo`: List all flags and their statuses. – `wp switcheroo
my_feature`: Check the status of the `my_feature` flag. – `wp switcheroo my_feature
on`: Enable the `my_feature` flag. – `wp switcheroo my_feature off`: Disable the`
my_feature` flag.

## Instalación

### Plugin Directory

 1. Search for “Switcheroo” within the Add New section of your WordPress plugins page.
 2. Configure feature flags in the `switcheroo.json` file located in your project root,
    wp-content folder or active theme folder. You can find an example of this file 
    in the root folder of this plugin.
 3. Use the settings screen under `Settings -> Switcheroo` to toggle features.

### Manual Installation

 1. Download the latest version of the Switcheroo plugin from Github: https://github.
    com/ufmedia/switcheroo/releases/latest
 2. Unzip and upload the `switcheroo` folder to the `/wp-content/plugins/` directory.
 3. Activate the plugin through the ‘Plugins’ menu in WordPress.
 4. Configure feature flags in the `switcheroo.json` file located in your project root,
    wp-content folder or active theme folder. You can find an example of this file 
    in the root folder of this plugin.
 5. Use the settings screen under `Settings -> Switcheroo` to toggle features.

## Preguntas frecuentes

### What is a feature flag?

A feature flag is a toggle that allows you to enable or disable specific functionality
on your site without deploying new code.

### Where do I define my feature flags?

Feature flags are defined in the `switcheroo.json` file, located in the root of 
your project.

### Can I manage feature flags from the command line?

Yes, using WP-CLI commands such as `wp switcheroo` to list, enable, or disable flags.

## Comentarios

Non hai recensións para este plugin.

## Colaboradores e desenvolvedores

“Switcheroo” é un software de código aberto. As seguintes persoas colaboraron con
este plugin.

Colaboradores

 *   [ John Thompson ](https://profiles.wordpress.org/ufmedia/)

[Traduce “Switcheroo” ao teu idioma.](https://translate.wordpress.org/projects/wp-plugins/switcheroo)

### Interesado no desenvolvemento?

[Revisa o código](https://plugins.trac.wordpress.org/browser/switcheroo/), bota 
unha ollada ao[repositorio SVN](https://plugins.svn.wordpress.org/switcheroo/), 
ou subscríbete ao [log de desenvolvemento](https://plugins.trac.wordpress.org/log/switcheroo/)
por [RSS](https://plugins.trac.wordpress.org/log/switcheroo/?limit=100&mode=stop_on_copy&format=rss).

## Rexistro de cambios

#### 1.0.2

 * switcheroo.json can now be placed in the root, wp-content or active theme folder.

#### 1.0.1

 * Updated ahead of directory publication.

#### 1.0.0

 * Initial release.

## Meta

 *  Versión **1.0.2**
 *  Última actualización **Fai 1 ano**
 *  Instalacións activas **Menos de 10**
 *  Versión de WordPress ** 5.0 ou superior **
 *  Probado ata **6.7.5**
 *  Versión de PHP ** 8.0 ou superior **
 *  Idioma
 * [English (US)](https://wordpress.org/plugins/switcheroo/)
 * Etiquetas
 * [development](https://gl.wordpress.org/plugins/tags/development/)[feature flags](https://gl.wordpress.org/plugins/tags/feature-flags/)
   [site management](https://gl.wordpress.org/plugins/tags/site-management/)
 *  [Vista avanzada](https://gl.wordpress.org/plugins/switcheroo/advanced/)

## Valoracións

Aínda non se enviaron valoracións.

[Your review](https://wordpress.org/support/plugin/switcheroo/reviews/#new-post)

[Ver todas as valoracións](https://wordpress.org/support/plugin/switcheroo/reviews/)

## Colaboradores

 *   [ John Thompson ](https://profiles.wordpress.org/ufmedia/)

## Soporte

Tes algo que dicir? Necesitas axuda?

 [Ver o foro de soporte](https://wordpress.org/support/plugin/switcheroo/)