83% grid-list-toggle-for-woocommerce

Code Review | Grid & List Toggle for Woocommerce

WordPress plugin Grid & List Toggle for Woocommerce scored83%from 54 tests.

About plugin

  • Plugin page: grid-list-toggle-...
  • Plugin version: 1.4.2
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6.0-5.3
  • WordPress version: 6.3.1
  • First release: Mar 7, 2016
  • Latest release: Jan 24, 2020
  • Number of updates: 103
  • Update frequency: every 13.8 days
  • Top authors: phoeniixx (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

300+ active /22,632 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼10.17ms] Passed 4 tests

Server-side resources used by Grid & List Toggle for Woocommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0237.45 ▼4.44
Dashboard /wp-admin3.32 ▼0.0247.38 ▼19.94
Posts /wp-admin/edit.php3.38 ▲0.0247.48 ▼4.61
Add New Post /wp-admin/post-new.php5.91 ▲0.0293.15 ▼11.67
Media Library /wp-admin/upload.php3.25 ▲0.0237.98 ▲0.90

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 37 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Grid & List Toggle for Woocommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.33 ▼0.021.64 ▼0.1440.82 ▲0.09
Dashboard /wp-admin2,195 ▲185.54 ▼0.3089.90 ▼2.7939.62 ▼0.24
Posts /wp-admin/edit.php2,103 ▲32.02 ▲0.0340.71 ▼1.1039.39 ▲2.60
Add New Post /wp-admin/post-new.php1,526 ▼223.14 ▲0.00655.05 ▲18.3652.01 ▼1.52
Media Library /wp-admin/upload.php1,400 ▲34.18 ▼0.0099.55 ▼7.9546.89 ▲4.53

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
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% 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 no errors were found, 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
Please take a closer look at the following
  • 5× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/grid-list-toggle-for-woocommerce/phoen_premium.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/grid-list-toggle-for-woocommerce/libs/tgm/class-tgm-plugin-activation.php:2109
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/grid-list-toggle-for-woocommerce/woocommerce/loop/loop-start.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/grid-list-toggle-for-woocommerce/libs/tgm/class-tgm-plugin-activation.php:2109
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/grid-list-toggle-for-woocommerce/libs/tgm/class-tgm-plugin-activation.php:2109

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Tags: You are using too many tags: 23 tag instead of maximum 10
Please take inspiration from this readme.txt

grid-list-toggle-for-woocommerce/woocommerce_grid_list.php 77% from 13 tests

"Grid & List Toggle for Woocommerce" version 1.4.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Text Domain: Please use dashes and lowercase characters for text domains
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("grid-list-toggle-for-woocommerce.php" instead of "woocommerce_grid_list.php")
  • Requires at least: The required version number must match the one declared in readme.txt ("4.0" instead of "2.6.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin2,568 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP76871,6802,403
JavaScript84729137
CSS15028

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity48.14
▷ Minimum class complexity1.00
▷ Maximum class complexity206.00
Average method complexity4.27
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods101
▷ Static methods54.95%
▷ Public methods7877.23%
▷ Protected methods2322.77%
▷ Private methods00.00%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
7 PNG files occupy 0.02MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/head-arrow.png1.68KB1.43KB▼ 14.83%
images/logo-wp.png1.20KB0.57KB▼ 52.72%
images/image-frame-even.png0.67KB0.62KB▼ 8.42%
images/image-frame-odd.png0.90KB0.81KB▼ 10.31%
images/premium-head.png6.61KB5.20KB▼ 21.37%