Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Feature Flags

Contributors: Mohan Raj Pachaiyappan
Tags: feature-flags, feature-flag, wp-feature-flags
Requires at least: 4.2
Tested up to: 6.1
Stable tag: 1.0.0
Requires PHP: 5.6
Contributor link: https://github.com/m0hanraj

## Description

Feature flags allows developers to configure features behind the feature flags on both Server(PHP) and Client(JS/TS) side.

## Frequently Asked Questions

### Does this plugin work with PHP 8?

Yes, it's actively tested and working up to PHP 8.2

### Does this plugin work with latest WordPress?

Yes, it's actively tested and working up to WordPress 6.1.1

## Changelog ##

### 1.0.0 ###

* Provides WP admin dashboard to manage (On/Off) feature flags
* Provides SDK for PHP and JavaScript with example code to add features behind the flag
* First class TypeScript support


6 changes: 5 additions & 1 deletion includes/Api/Flags.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,14 @@ public function validate_flag_input( $param ) {
$input_data = $param->get_json_params();
$valid_keys = [ 'id', 'name', 'enabled' ];

if ( ! isset( $input_data ) || ! is_array( $input_data ) || 0 === count( $input_data ) ) {
if ( ! isset( $input_data ) || ! is_array( $input_data ) ) {
return false;
}

if ( 0 === count( $input_data ) ) {
return true;
}

foreach ( $input_data as $flag_key => $flag ) {
foreach ( $valid_keys as $key => $value ) {
if ( ! array_key_exists( $value, $flag ) ) {
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6128,7 +6128,7 @@ human-signals@^1.1.1:
resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3"
integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==

husky@^8.0.3:
husky@^8.0.0:
version "8.0.3"
resolved "https://registry.yarnpkg.com/husky/-/husky-8.0.3.tgz#4936d7212e46d1dea28fef29bb3a108872cd9184"
integrity sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==
Expand Down