Download the PHP package automattic/jetpack-feature-flags without Composer

On this page you can find all versions of the php package automattic/jetpack-feature-flags. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package jetpack-feature-flags

Jetpack Feature Flags

Shared utilities for registering and checking lightweight feature flags in Jetpack packages and plugins.

This package intentionally does not store flag state. Consumers register flags with defaults, then external code can control them through the jetpack_feature_flag_enabled filter.

When To Use a Feature Flag

A feature flag is for temporary branching where you need to change behaviour without changing code:

Reach for something else when the toggle is permanent: site configuration, a user-facing setting/preference, or a plain constant. If a flag would live forever, it is really config and should graduate to a real setting.

When To Register

Register flags unconditionally, as early as your code loads — at package init or plugin bootstrap, before anything calls is_enabled(). Registration is cheap and stores no state, so there is no reason to defer or guard it. Registering every flag up front (rather than lazily, deep inside a request branch) means the full set is always discoverable through Feature_Flags::all() for tooling, debugging, and admin listings.

The controlling filter, by contrast, can be added at any time — it is read when is_enabled() runs, not when the flag is registered.

Naming and Ownership

Retiring a Flag

Flags are temporary. Once a feature is fully shipped (or fully abandoned), remove the flag promptly: delete the register() call, collapse the is_enabled() branches down to the winning path, and drop any filter overrides that referenced it. Leaving stale flags behind turns them into permanent, undocumented config and makes the codebase harder to reason about.

Usage

Flag names must match /^[a-z0-9][a-z0-9_-]*$/. This is enforced at lint time by the Jetpack.FeatureFlags.FeatureFlagName PHPCS sniff (so there is no runtime cost); normalize any dynamic or user-supplied input before registering.

Controlling Flags

Feature flag state is resolved through a single filter:

The registered default is passed as the first argument. Unknown flags default to false, but still pass through the same filter.

A dynamic per-flag variant, jetpack_feature_flag_enabled_{$flag_name}, runs after the generic filter. It mirrors WordPress's option_{$option} convention, so a single flag can be toggled with a one-liner:

Using This Package In Your WordPress Plugin

If you plan on using this package in your WordPress plugin, we recommend using Jetpack Autoloader as your autoloader for maximum interoperability with other plugins that use this package.

Security

Need to report a security vulnerability? Go to https://automattic.com/security/ or directly to our security bug bounty site https://hackerone.com/automattic.

License

Jetpack Feature Flags is licensed under GNU General Public License v2 (or later).


All versions of jetpack-feature-flags with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package automattic/jetpack-feature-flags contains the following files

Loading the files please wait ...