83% disable-shipments-when-the-free-one-is-active

Code Review | Disable Shipments when the free one is active

WordPress plugin Disable Shipments when the free one is active scored83%from 54 tests.

About plugin

  • Plugin page: disable-shipments...
  • Plugin version: 2.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2
  • WordPress version: 6.3.1
  • First release: Mar 17, 2020
  • Latest release: Jul 7, 2023
  • Number of updates: 5
  • Update frequency: every 242.8 days
  • Top authors: martatorre (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /440 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

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

Server-side resources used by Disable Shipments when the free one is active
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0136.31 ▲0.39
Dashboard /wp-admin3.31 ▲0.0141.96 ▼5.65
Posts /wp-admin/edit.php3.36 ▲0.0043.47 ▼4.11
Add New Post /wp-admin/post-new.php5.89 ▲0.0076.99 ▼16.41
Media Library /wp-admin/upload.php3.23 ▲0.0033.89 ▲0.20

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Disable Shipments when the free one is active
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲4313.22 ▼1.081.53 ▼0.5538.93 ▼8.08
Dashboard /wp-admin2,206 ▲174.86 ▼1.19112.47 ▼2.7542.51 ▼9.03
Posts /wp-admin/edit.php2,089 ▼32.02 ▼0.0334.23 ▼7.6934.07 ▼1.70
Add New Post /wp-admin/post-new.php1,536 ▲323.03 ▼0.18624.25 ▼46.4947.91 ▼10.00
Media Library /wp-admin/upload.php1,391 ▼04.18 ▲0.0398.10 ▼7.0842.12 ▼5.17

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/disable-shipments-when-the-free-one-is-active/disable-shipments.php:25

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Screenshots: Add images for these screenshots: #1 (Send email to customer on cancelled order in Woocommerce before plugin activation.), #2 (Send email to customer on cancelled order in Woocommerce after activation.)
You can take inspiration from this readme.txt

disable-shipments-when-the-free-one-is-active/disable-shipments.php 77% from 13 tests

The main file in "Disable Shipments when the free one is active" v. 2.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("disable-shipments-when-the-free-one-is-active.php" instead of "disable-shipments.php")
  • Text Domain: Please use dashes and lowercase characters for text domains
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected13 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP111213

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.60
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.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
No PNG files were detected