68% feature-flags

Code Review | Feature Flags

WordPress plugin Feature Flags scored68%from 54 tests.

About plugin

  • Plugin page: feature-flags
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.1
  • WordPress version: 6.3.1
  • First release: Apr 24, 2023
  • Latest release: Jun 23, 2023
  • Number of updates: 3
  • Update frequency: every 21.7 days
  • Top authors: mohanrajp (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /238 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼20.28ms] Passed 4 tests

Analyzing server-side resources used by Feature Flags
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0241.34 ▲0.97
Dashboard /wp-admin3.32 ▲0.0252.24 ▼4.53
Posts /wp-admin/edit.php3.37 ▲0.0152.56 ▼2.48
Add New Post /wp-admin/post-new.php5.93 ▲0.0486.96 ▼73.59
Media Library /wp-admin/upload.php3.24 ▲0.0138.14 ▼0.52

Server storage [IO: ▲11.77MB] [DB: ▲0.00MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 3,188 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Feature Flags
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,828 ▲4214.55 ▲0.391.71 ▼0.4343.93 ▼11.43
Dashboard /wp-admin2,227 ▲565.59 ▼0.1398.22 ▼39.6842.97 ▼15.81
Posts /wp-admin/edit.php2,134 ▲312.00 ▼0.0238.44 ▼1.0133.77 ▼2.72
Add New Post /wp-admin/post-new.php1,544 ▲922.89 ▲4.67684.84 ▲17.6659.28 ▼1.93
Media Library /wp-admin/upload.php1,434 ▲374.21 ▲0.00108.70 ▲10.6944.40 ▲1.98

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/feature-flags/vendor/nikic/php-parser/grammar/rebuildParsers.php
    • > /wp-content/plugins/feature-flags/vendor/antecedent/patchwork/src/Console.php
  • 1501× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Mockery\\Matcher\\MatcherAbstract' not found in wp-content/plugins/feature-flags/vendor/mockery/mockery/library/Mockery/Matcher/AndAnyOtherArgs.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'PHP_CodeSniffer\\Tests\\Standards\\AbstractSniffUnitTest' not found in wp-content/plugins/feature-flags/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/ControlStructures/ElseIfDeclarationUnitTest.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Mockery\\Matcher\\MatcherAbstract' not found in wp-content/plugins/feature-flags/vendor/mockery/mockery/library/Mockery/Matcher/Ducktype.php:23
    • > PHP Fatal error
      Uncaught Error: Interface 'PHP_CodeSniffer\\Reports\\Report' not found in wp-content/plugins/feature-flags/vendor/squizlabs/php_codesniffer/src/Reports/Cbf.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'PHP_CodeSniffer\\Sniffs\\Sniff' not found in wp-content/plugins/feature-flags/vendor/squizlabs/php_codesniffer/src/Standards/PSR12/Sniffs/Properties/ConstantVisibilitySniff.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'SebastianBergmann\\CodeCoverage\\Exception' not found in wp-content/plugins/feature-flags/vendor/phpunit/php-code-coverage/src/Exception/WriteOperationFailedException.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Brain\\Monkey\\Expectation\\Exception\\Exception' not found in wp-content/plugins/feature-flags/vendor/brain/monkey/src/Expectation/Exception/NotAllowedMethod.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Hamcrest\\Text\\SubstringMatcher' not found in wp-content/plugins/feature-flags/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Text/StringEndsWith.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\Constraint\\Constraint' not found in wp-content/plugins/feature-flags/vendor/phpunit/phpunit/src/Framework/Constraint/Math/IsNan.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'PHP_CodeSniffer\\Sniffs\\AbstractScopeSniff' not found in wp-content/plugins/feature-flags/vendor/automattic/vipwpcs/WordPressVIPMinimum/Sniffs/Classes/DeclarationCompatibilitySniff.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
4 plugin tags: flags, wp feature flags, feature flags, feature-flags

feature-flags/plugin.php 85% from 13 tests

The entry point to "Feature Flags" version 1.0.0 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("feature-flags.php" instead of "plugin.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Almost there! Just fix the following issues
  • Do not distribute dangerous files with your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/feature-flags/vendor/squizlabs/php_codesniffer/bin/phpcbf.bat
      • wp-content/plugins/feature-flags/vendor/squizlabs/php_codesniffer/bin/phpcs.bat
197,955 lines of code in 2,692 files:
LanguageFilesBlank linesComment linesLines of code
PHP2,08738,15369,104166,048
Markdown873,11807,185
Pascal1303,2317,1186,576
XML1864177546,252
JSON411204,240
JavaScript647648742,157
yacc3336122,050
reStructuredText381,0521,3411,250
XSD4601,094
CSS3822198799
YAML8514209
Python17015542
Bourne Shell18041
DOS Batch241010
SVG2002

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Please fix the following
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 478)
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity10.66
▷ Minimum class complexity1.00
▷ Maximum class complexity724.00
Average method complexity3.30
▷ Minimum method complexity1.00
▷ Maximum method complexity478.00
Code structure
Namespaces323
Interfaces85
Traits7
Classes1,837
▷ Abstract classes754.08%
▷ Concrete classes1,76295.92%
▷ Final classes45325.71%
Methods8,234
▷ Static methods7959.66%
▷ Public methods6,60780.24%
▷ Protected methods95211.56%
▷ Private methods6758.20%
Functions1,891
▷ Named functions54128.61%
▷ Anonymous functions1,35071.39%
Constants779
▷ Global constants12215.66%
▷ Class constants65784.34%
▷ Public constants60892.54%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin