88% ffl-api

Code Review | FFL API - Federal Firearm E-commerce Store Checkout Plugin

WordPress plugin FFL API - Federal Firearm E-commerce Store Checkout Plugin scored 88% from 54 tests.

About plugin

  • Plugin page: ffl-api
  • Plugin version: 1.5.5
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-5.8
  • WordPress version: 5.8.1
  • First release: Feb 26, 2020
  • Latest release: Jul 26, 2021
  • Number of updates: 15
  • Update frequency: every 34.4 days
  • Top authors: optimum7 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active / 817 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.00MB] [CPU: ▼139.40ms] Passed 4 tests

A check of server-side resources used by FFL API - Federal Firearm E-commerce Store Checkout Plugin
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.83 ▲0.1239.02 ▲14.25
Dashboard /wp-admin3.06 ▲0.0044.40 ▲5.54
Posts /wp-admin/edit.php3.11 ▲0.0044.13 ▲0.77
Add New Post /wp-admin/post-new.php5.42 ▼0.0287.09 ▼565.06
Media Library /wp-admin/upload.php3.00 ▲0.0033.64 ▲1.14

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 117 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for FFL API - Federal Firearm E-commerce Store Checkout Plugin
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,679 ▲8315.84 ▲0.258.95 ▼3.0646.15 ▼5.31
Dashboard /wp-admin2,973 ▲395.94 ▼0.09134.91 ▼14.66106.58 ▼7.91
Posts /wp-admin/edit.php2,739 ▼02.70 ▼0.0264.31 ▼0.3688.76 ▼2.32
Add New Post /wp-admin/post-new.php1,872 ▲37219.09 ▲0.50369.62 ▼2.38103.62 ▼9.23
Media Library /wp-admin/upload.php1,810 ▲35.05 ▲0.05162.24 ▲4.01120.07 ▼5.24

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 3× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/ffl-api/wp-dynamic-css/bootstrap.php
    • > /wp-content/plugins/ffl-api/admin/partials/ffl-api-admin-display.php
    • > /wp-content/plugins/ffl-api/public/partials/ffl-api-public-display.php
  • 19× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Puc_v4p8_UpdateChecker' not found in wp-content/plugins/ffl-api/plugin-update-checker/Puc/v4p8/Theme/UpdateChecker.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Puc_v4p8_Factory' not found in wp-content/plugins/ffl-api/plugin-update-checker/Puc/v4/Factory.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Puc_v4p8_Vcs_Api' not found in wp-content/plugins/ffl-api/plugin-update-checker/Puc/v4p8/Vcs/BitBucketApi.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Puc_v4p8_InstalledPackage' not found in wp-content/plugins/ffl-api/plugin-update-checker/Puc/v4p8/Theme/Package.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Puc_v4p8_Theme_UpdateChecker' not found in wp-content/plugins/ffl-api/plugin-update-checker/Puc/v4p8/Vcs/ThemeUpdateChecker.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Puc_v4p8_Update' not found in wp-content/plugins/ffl-api/plugin-update-checker/Puc/v4p8/Theme/Update.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Puc_v4p8_Metadata' not found in wp-content/plugins/ffl-api/plugin-update-checker/Puc/v4p8/Update.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Puc_v4p8_Metadata' not found in wp-content/plugins/ffl-api/plugin-update-checker/Puc/v4p8/Plugin/Info.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Puc_v4p8_InstalledPackage' not found in wp-content/plugins/ffl-api/plugin-update-checker/Puc/v4p8/Plugin/Package.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Puc_v4p8_Vcs_Api' not found in wp-content/plugins/ffl-api/plugin-update-checker/Puc/v4p8/Vcs/GitLabApi.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
7 plugin tags: google maps, ecommerce checkout, map api, ffl, woocommerce...

ffl-api/ffl-api.php 92% from 13 tests

The main PHP file in "FFL API - Federal Firearm E-commerce Store Checkout Plugin" ver. 1.5.5 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Requires at least: Required version does not match the one declared in readme.txt ("5.0" instead of "3.0.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected7,860 lines of code in 88 files:
LanguageFilesBlank linesComment linesLines of code
PHP571,8143,1436,447
PO File169295532
Markdown21830530
JavaScript46838160
CSS414596
JSON58095

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity19.65
▷ Minimum class complexity1.00
▷ Maximum class complexity159.00
Average method complexity2.99
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes45
▷ Abstract classes511.11%
▷ Concrete classes4088.89%
▷ Final classes00.00%
Methods452
▷ Static methods296.42%
▷ Public methods26959.51%
▷ Protected methods16436.28%
▷ Private methods194.20%
Functions19
▷ Named functions1894.74%
▷ Anonymous functions15.26%
Constants5
▷ Global constants240.00%
▷ Class constants360.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/example.png42.16KB12.28KB▼ 70.88%
admin/images/ffl-logo.png17.42KB11.79KB▼ 32.30%