78% the-simplest-optional-shipping-by-products

Code Review | The Simplest: Optional Shipping by Products

WordPress plugin The Simplest: Optional Shipping by Products scored78%from 54 tests.

About plugin

  • Plugin page: the-simplest-opti...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.4.2
  • WordPress version: 6.3.1
  • First release: Jul 1, 2020
  • Latest release: Jul 1, 2020
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: thesimplestwp (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /355 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
Install script ran successfully

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

Analyzing server-side resources used by The Simplest: Optional Shipping by Products
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0141.35 ▼1.40
Dashboard /wp-admin3.31 ▲0.0153.46 ▲4.69
Posts /wp-admin/edit.php3.36 ▲0.0154.11 ▲6.33
Add New Post /wp-admin/post-new.php5.90 ▲0.0187.26 ▼17.19
Media Library /wp-admin/upload.php3.23 ▲0.0139.94 ▲3.81

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for The Simplest: Optional Shipping by Products
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.32 ▼0.031.64 ▼0.2743.18 ▼0.67
Dashboard /wp-admin2,195 ▲185.65 ▲0.0786.27 ▼7.9538.16 ▼3.66
Posts /wp-admin/edit.php2,100 ▼02.02 ▲0.0435.31 ▼0.3435.62 ▼2.76
Add New Post /wp-admin/post-new.php1,526 ▼023.28 ▲0.07681.88 ▼17.8267.79 ▲12.46
Media Library /wp-admin/upload.php1,400 ▼04.17 ▼0.03102.57 ▼3.2944.93 ▼1.85

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
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 50% 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)
Good news, no errors were detected

SRP 0% 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
  • 5× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/the-simplest-optional-shipping-by-products/classes/class-ts-osp-shipping-methods.php
    • > /wp-content/plugins/the-simplest-optional-shipping-by-products/views/shipping-methods-box.php
    • > /wp-content/plugins/the-simplest-optional-shipping-by-products/classes/class-ts-osp-product-panel.php
    • > /wp-content/plugins/the-simplest-optional-shipping-by-products/ts-optional-shipping-by-products.php
    • > /wp-content/plugins/the-simplest-optional-shipping-by-products/classes/class-ts-osp-main.php
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/the-simplest-optional-shipping-by-products/views/shipping-methods-box.php on line 11
    • > PHP Notice
      Undefined variable: all_shipping_methods in wp-content/plugins/the-simplest-optional-shipping-by-products/views/shipping-methods-box.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/the-simplest-optional-shipping-by-products/constants.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 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
5 plugin tags: disable shipping, products, woocommerce, optional shipping, shipping

the-simplest-optional-shipping-by-products/ts-optional-shipping-by-products.php 77% from 13 tests

"The Simplest: Optional Shipping by Products" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Domain Path: The domain path folder was not found ("/languages")
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("the-simplest-optional-shipping-by-products.php" instead of "ts-optional-shipping-by-products.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin162 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP641138162

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity5.33
▷ Minimum class complexity3.00
▷ Maximum class complexity8.00
Average method complexity2.08
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods12
▷ Static methods758.33%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There were not PNG files found in your plugin