83% woo-product-multi-layout

Code Review | Woo Product Multi Layout lite

WordPress plugin Woo Product Multi Layout lite scored 83% from 54 tests.

About plugin

  • Plugin page: woo-product-multi...
  • Plugin version: 1.7
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6-5.2.9
  • WordPress version: 6.3.1
  • First release: Feb 8, 2017
  • Latest release: May 2, 2019
  • Number of updates: 33
  • Update frequency: every 24.6 days
  • Top authors: proscriptsell (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

500+ active / 18,797 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▲0.78ms] Passed 4 tests

Analyzing server-side resources used by Woo Product Multi Layout lite
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.72 ▲0.86
Dashboard /wp-admin3.31 ▲0.0046.88 ▲2.61
Posts /wp-admin/edit.php3.36 ▲0.0045.68 ▲0.69
Add New Post /wp-admin/post-new.php5.89 ▲0.0082.35 ▼0.94
Media Library /wp-admin/upload.php3.23 ▲0.0036.32 ▲2.49

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 46 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Woo Product Multi Layout lite
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲413.16 ▼1.291.81 ▼0.4645.40 ▲6.05
Dashboard /wp-admin2,221 ▲154.93 ▲0.08108.26 ▲1.0145.35 ▲6.81
Posts /wp-admin/edit.php2,104 ▲182.05 ▲0.0134.59 ▼4.8932.73 ▼1.46
Add New Post /wp-admin/post-new.php1,554 ▲3422.91 ▼0.16716.40 ▲43.1156.54 ▲6.05
Media Library /wp-admin/upload.php1,403 ▲154.18 ▼0.0496.95 ▼1.7844.78 ▼1.19

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded

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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 13× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/woo-product-multi-layout/class/class-loader.php
    • > /wp-content/plugins/woo-product-multi-layout/templates/template-listbox.php
    • > /wp-content/plugins/woo-product-multi-layout/class/class-views.php
    • > /wp-content/plugins/woo-product-multi-layout/templates/template-oddeven.php
    • > /wp-content/plugins/woo-product-multi-layout/class/class-admin.php
    • > /wp-content/plugins/woo-product-multi-layout/class/class-notice.php
    • > /wp-content/plugins/woo-product-multi-layout/templates/template-grid.php
    • > /wp-content/plugins/woo-product-multi-layout/class/class-addons.php
    • > /wp-content/plugins/woo-product-multi-layout/class/class-options.php
    • > /wp-content/plugins/woo-product-multi-layout/class/class-editor.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: These screenshots require images: #1 (Grid Layout), #2 (List Layout), #3 (Table Layout), #4 (Carousel Layout), #5 (Create New layout options), #6 (Admin settings)
  • Tags: Too many tags (13 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

woo-product-multi-layout/woo-product-multi-layout-lite.php 77% from 13 tests

This is the main PHP file of "Woo Product Multi Layout lite" version 1.7, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes
  • Main file name: Name the main plugin file the same as the plugin slug ("woo-product-multi-layout.php" instead of "woo-product-multi-layout-lite.php")
  • Requires at least: The required version number did not match the one declared in readme.txt ("3.5" instead of "2.6")

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 detected18,372 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
JSON10012,927
PHP143545322,775
JavaScript5245591,464
CSS46866905
PO File1113118268
SVG10133

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity42.62
▷ Minimum class complexity2.00
▷ Maximum class complexity142.00
Average method complexity6.37
▷ Minimum method complexity1.00
▷ Maximum method complexity59.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods62
▷ Static methods00.00%
▷ Public methods4775.81%
▷ Protected methods00.00%
▷ Private methods1524.19%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
17 PNG files occupy 1.84MB with 1.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/admin/images/template-list.png2.94KB1.39KB▼ 52.68%
assets/admin/images/template-grid.png3.75KB1.73KB▼ 53.79%
assets/admin/images/template-boxCarousel.png5.43KB2.92KB▼ 46.20%
screenshot-4.png96.83KB27.33KB▼ 71.77%
assets/admin/images/template-oddeven.png3.92KB1.98KB▼ 49.46%