84% fancy-product-designer-rest-api

Code Review | Fancy Product Designer REST API

WordPress plugin Fancy Product Designer REST API scored84%from 54 tests.

About plugin

  • Plugin page: fancy-product-des...
  • Plugin version: 1.6.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.2
  • WordPress version: 6.3.1
  • First release: Feb 4, 2017
  • Latest release: Dec 21, 2019
  • Number of updates: 95
  • Update frequency: every 11.1 days
  • Top authors: webradykal (100%)

Code review

54 tests

User reviews

1 review

Install metrics

900+ active /31,343 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼3.83ms] Passed 4 tests

Analyzing server-side resources used by Fancy Product Designer REST API
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0540.28 ▼3.09
Dashboard /wp-admin3.35 ▲0.0546.12 ▼0.06
Posts /wp-admin/edit.php3.40 ▲0.0449.79 ▲1.83
Add New Post /wp-admin/post-new.php5.93 ▲0.0584.01 ▼12.98
Media Library /wp-admin/upload.php3.27 ▲0.0436.84 ▲0.80

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Fancy Product Designer REST API
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,839 ▲9313.28 ▼1.001.91 ▼0.1540.36 ▼2.67
Dashboard /wp-admin2,220 ▲294.85 ▼0.05115.62 ▲6.1239.36 ▼6.69
Posts /wp-admin/edit.php2,102 ▲102.13 ▲0.1041.58 ▼5.0537.48 ▲3.06
Add New Post /wp-admin/post-new.php1,553 ▲3923.19 ▲5.67643.83 ▼85.4254.20 ▼0.00
Media Library /wp-admin/upload.php1,404 ▲164.26 ▲0.0598.34 ▼14.4342.07 ▼5.36

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% 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)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
Almost there! Just fix the following items
  • 10× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_rest_route() in wp-content/plugins/fancy-product-designer-rest-api/routes/class-route-designs.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_rest_route() in wp-content/plugins/fancy-product-designer-rest-api/routes/class-route-options.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_rest_route() in wp-content/plugins/fancy-product-designer-rest-api/routes/class-route-ui-layouts.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_rest_route() in wp-content/plugins/fancy-product-designer-rest-api/routes/class-route-orders.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_rest_route() in wp-content/plugins/fancy-product-designer-rest-api/routes/class-route-pricing-rules.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/fancy-product-designer-rest-api/class-rest-routes.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_rest_route() in wp-content/plugins/fancy-product-designer-rest-api/routes/class-route-products.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/fancy-product-designer-rest-api/fancy-product-designer-rest-api.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_rest_route() in wp-content/plugins/fancy-product-designer-rest-api/routes/class-route-views.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_rest_route() in wp-content/plugins/fancy-product-designer-rest-api/routes/class-route-templates.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention: You can look at the official readme.txt

fancy-product-designer-rest-api/fancy-product-designer-rest-api.php Passed 13 tests

The entry point to "Fancy Product Designer REST API" version 1.6.4 is a PHP file that has certain tags in its header comment area
69 characters long description:
A REST-API Implementation to use with Fancy Product Designer - Admin.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin1,149 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP10372341,149

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity13.10
▷ Minimum class complexity3.00
▷ Maximum class complexity33.00
Average method complexity2.65
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods57
▷ Static methods11.75%
▷ Public methods5698.25%
▷ Protected methods00.00%
▷ Private methods11.75%
Functions87
▷ Named functions00.00%
▷ Anonymous functions87100.00%
Constants3
▷ Global constants00.00%
▷ Class constants3100.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
There were not PNG files found in your plugin