93% woocommerce-full-width-add-to-cart-forms

Code Review | WooCommerce Stacked Product Layout

WordPress plugin WooCommerce Stacked Product Layout scored 93% from 53 tests.

About plugin

  • Plugin page: woocommerce-full-...
  • Plugin version: 1.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-4.9
  • WordPress version: 5.8.1
  • First release: Oct 29, 2014
  • Latest release: May 6, 2020
  • Number of updates: 27
  • Update frequency: every 74.7 days
  • Top authors: franticpsyx (100%)

Code review

53 tests

User reviews

2 reviews

Install metrics

1,000+ active / 12,240 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

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

Server-side resources used by WooCommerce Stacked Product Layout
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.87 ▲0.1534.88 ▲8.32
Dashboard /wp-admin3.10 ▲0.0442.86 ▲0.10
Posts /wp-admin/edit.php3.15 ▲0.0441.38 ▼4.54
Add New Post /wp-admin/post-new.php5.46 ▲0.0389.80 ▼1,049.38
Media Library /wp-admin/upload.php3.04 ▲0.0333.47 ▼4.63

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 5 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for WooCommerce Stacked Product Layout
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,649 ▲4315.83 ▲0.2410.04 ▲1.5549.97 ▼1.63
Dashboard /wp-admin2,927 ▲775.92 ▼0.06142.43 ▲6.60102.41 ▼4.62
Posts /wp-admin/edit.php2,706 ▼02.69 ▼0.0068.57 ▼2.3696.00 ▲0.09
Add New Post /wp-admin/post-new.php1,653 ▲218.65 ▲1.45364.52 ▼21.57109.05 ▼5.60
Media Library /wp-admin/upload.php1,775 ▲35.03 ▲0.04154.96 ▲0.37111.45 ▼9.03

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The plugin uninstalled successfully, without leaving any zombie files or tables

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)
The smoke test was a success, however most plugin functionality was not tested

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
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woocommerce-full-width-add-to-cart-forms/woocommerce-full-width-add-to-cart.php:67

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 86% 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 to be fixed:
  • Tags: Please reduce the number of tags, currently 11 tag instead of maximum 10
You can look at the official readme.txt

woocommerce-full-width-add-to-cart-forms/woocommerce-full-width-add-to-cart.php 77% from 13 tests

The principal PHP file in "WooCommerce Stacked Product Layout" v. 1.2.1 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Description: Please keep the plugin description shorter than 140 characters (currently 219 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("woocommerce-full-width-add-to-cart-forms.php" instead of "woocommerce-full-width-add-to-cart.php")

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
No dangerous file extensions were detected257 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP281145253
CSS1004

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity16.00
▷ Minimum class complexity5.00
▷ Maximum class complexity27.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods20
▷ Static methods1890.00%
▷ Public methods1890.00%
▷ Protected methods00.00%
▷ Private methods210.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 1 test

Image compression Passed 1 test

Using a strong compression for your PNG files is a great way to speed-up your plugin
There are no PNG files in this plugin