84% woocommerce-grid-list-toggle

Code Review | WooCommerce Grid / List toggle

WordPress plugin WooCommerce Grid / List toggle scored84%from 54 tests.

About plugin

  • Plugin page: woocommerce-grid-...
  • Plugin version: 1.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9.5
  • WordPress version: 6.3.1
  • First release: Aug 25, 2012
  • Latest release: May 11, 2018
  • Number of updates: 37
  • Update frequency: every 56.4 days
  • Top authors: jameskoster (100%)

Code review

54 tests

User reviews

30 reviews

Install metrics

20,000+ active /527,342 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

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

Server-side resources used by WooCommerce Grid / List toggle
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0234.74 ▼8.27
Dashboard /wp-admin3.32 ▲0.0243.99 ▼0.80
Posts /wp-admin/edit.php3.38 ▲0.0246.82 ▲1.24
Add New Post /wp-admin/post-new.php5.91 ▲0.0280.94 ▼9.94
Media Library /wp-admin/upload.php3.25 ▲0.0235.29 ▼0.38

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

WooCommerce Grid / List toggle: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.23 ▼1.354.32 ▲0.5537.71 ▼10.76
Dashboard /wp-admin2,206 ▲245.91 ▲0.05109.57 ▲3.8641.97 ▲3.63
Posts /wp-admin/edit.php2,089 ▼01.99 ▲0.0240.32 ▲4.4534.57 ▼1.64
Add New Post /wp-admin/post-new.php1,538 ▲2422.89 ▲5.29578.95 ▼120.0354.64 ▲5.46
Media Library /wp-admin/upload.php1,388 ▲64.20 ▲0.0197.75 ▲1.0342.03 ▼6.41

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/woocommerce-grid-list-toggle/woocommerce-grid-list-toggle.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
5 plugin tags: woocommerce, products, grid, ecommerce, list

woocommerce-grid-list-toggle/woocommerce-grid-list-toggle.php Passed 13 tests

Analyzing the main PHP file in "WooCommerce Grid / List toggle" version 1.2.1
48 characters long description:
Adds a grid/list view toggle to product archives

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected268 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP1254597
CSS20386
JavaScript4222282
Markdown1103

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity6.00
▷ Minimum class complexity6.00
▷ Maximum class complexity6.00
Average method complexity1.45
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin