90% woo-shipping-discount

Code Review | WooCommerce Shipping Discount

WordPress plugin WooCommerce Shipping Discount scored 90% from 54 tests.

About plugin

  • Plugin page: woo-shipping-disc...
  • Plugin version: 0.1.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.0-5.0
  • WordPress version: 6.3.1
  • First release: Oct 21, 2018
  • Latest release: Jan 2, 2019
  • Number of updates: 5
  • Update frequency: every 14.6 days
  • Top authors: moacirbrg (100%)

Code review

54 tests

User reviews

1 review

Install metrics

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

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

Server-side resources used by WooCommerce Shipping Discount
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0034.59 ▼4.13
Dashboard /wp-admin3.31 ▲0.0146.85 ▼1.05
Posts /wp-admin/edit.php3.36 ▲0.0047.48 ▲1.88
Add New Post /wp-admin/post-new.php5.89 ▲0.0097.02 ▼1.89
Media Library /wp-admin/upload.php3.23 ▲0.0037.69 ▲3.77

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for WooCommerce Shipping Discount
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.21 ▼1.144.79 ▲2.5840.63 ▲1.23
Dashboard /wp-admin2,206 ▲184.84 ▼1.03109.03 ▲1.3737.83 ▼2.41
Posts /wp-admin/edit.php2,089 ▼01.99 ▼0.0439.42 ▲3.0935.49 ▼0.38
Add New Post /wp-admin/post-new.php1,542 ▲2218.15 ▼5.10607.32 ▼36.2063.22 ▲12.89
Media Library /wp-admin/upload.php1,391 ▲64.24 ▲0.0198.78 ▼1.5442.80 ▼1.19

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests Passed 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 everything seems fine, this is not an exhaustive test

SRP Passed 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
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
4 plugin tags: delivery, woocommerce, shipping, discount

woo-shipping-discount/woo-shipping-discount.php 92% from 13 tests

The main PHP file in "WooCommerce Shipping Discount" ver. 0.1.1 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Requires at least: Required version must match the one declared in readme.txt ("4.9" instead of "4.9.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin162 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP4254096
PO File2121266

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity4.50
▷ Minimum class complexity2.00
▷ Maximum class complexity7.00
Average method complexity1.78
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods9
▷ Static methods9100.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants2
▷ Global constants2100.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