84% caddy

Code Review | Caddy - Smart Side Cart for WooCommerce

WordPress plugin Caddy - Smart Side Cart for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: caddy
  • Plugin version: 1.9.7
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Jun 12, 2020
  • Latest release: Feb 10, 2023
  • Number of updates: 44
  • Update frequency: every 22.1 days
  • Top authors: tribeinteractive (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

3,000+ active /33,573 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.00MB] [CPU: ▼6.95ms] Passed 4 tests

This is a short check of server-side resources used by Caddy - Smart Side Cart for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0141.22 ▼0.72
Dashboard /wp-admin3.35 ▼0.0346.94 ▼23.43
Posts /wp-admin/edit.php3.41 ▲0.0148.73 ▲2.06
Add New Post /wp-admin/post-new.php5.94 ▲0.01108.50 ▲2.48
Media Library /wp-admin/upload.php3.28 ▲0.0134.41 ▼5.72

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Caddy - Smart Side Cart for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,796 ▲5013.87 ▼0.781.70 ▲0.0944.72 ▼0.44
Dashboard /wp-admin2,199 ▲225.53 ▼0.1486.77 ▼6.1642.61 ▲3.44
Posts /wp-admin/edit.php2,105 ▲52.14 ▲0.1737.49 ▼1.2537.07 ▼3.89
Add New Post /wp-admin/post-new.php1,544 ▲1618.45 ▼4.70648.69 ▼72.3652.24 ▲0.70
Media Library /wp-admin/upload.php1,404 ▲44.18 ▲0.08105.44 ▼13.7746.39 ▼0.80

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts

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)
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 fix the following
  • 6× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/caddy/admin/partials/caddy-addons-page.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/caddy/includes/class-caddy-saved-items-widget.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/caddy/includes/class-caddy-cart-widget.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/caddy/admin/partials/caddy-admin-style-screen.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/caddy/admin/partials/caddy-admin-display.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/caddy/admin/partials/caddy-admin-settings-screen.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
The official readme.txt might help

caddy/caddy.php 92% from 13 tests

The principal PHP file in "Caddy - Smart Side Cart for WooCommerce" v. 1.9.7 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Requires at least: Required version must match the one declared in readme.txt ("5.0" instead of "4.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin6,955 lines of code in 49 files:
LanguageFilesBlank linesComment linesLines of code
CSS10429252,434
PHP214698492,352
JavaScript9205234834
SVG700788
PO File2244321547

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.34
Average class complexity24.33
▷ Minimum class complexity1.00
▷ Maximum class complexity144.00
Average method complexity3.84
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods74
▷ Static methods22.70%
▷ Public methods6993.24%
▷ Protected methods00.00%
▷ Private methods56.76%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
3 PNG files occupy 0.05MB with 0.03MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/img/box-emoji.png25.34KB11.35KB▼ 55.23%
public/img/voltage-emoji.png10.04KB4.52KB▼ 54.95%
public/img/sparkles-emoji.png11.90KB5.22KB▼ 56.18%