84% wc-shipping-discount

Code Review | Shipping Discount for WooCommerce

WordPress plugin Shipping Discount for WooCommerce scored 84% from 54 tests.

About plugin

  • Plugin page: wc-shipping-discount
  • Plugin version: 1.0.12
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.3
  • WordPress version: 6.3.1
  • First release: May 29, 2019
  • Latest release: Aug 21, 2023
  • Number of updates: 21
  • Update frequency: every 73.7 days
  • Top authors: oneteamsoftware (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

400+ active / 8,232 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: ▼3.66ms] Passed 4 tests

An overview of server-side resources used by Shipping Discount for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0039.67 ▼4.12
Dashboard /wp-admin3.31 ▲0.0046.21 ▼2.35
Posts /wp-admin/edit.php3.36 ▲0.0046.23 ▼0.77
Add New Post /wp-admin/post-new.php5.89 ▲0.0095.02 ▼7.41
Media Library /wp-admin/upload.php3.23 ▲0.0031.82 ▼0.43

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Shipping Discount for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6514.80 ▲0.431.65 ▼0.1140.82 ▼8.38
Dashboard /wp-admin2,206 ▲184.84 ▼1.07114.12 ▲6.7738.62 ▼2.05
Posts /wp-admin/edit.php2,089 ▼01.98 ▼0.0540.66 ▲4.2634.64 ▲0.97
Add New Post /wp-admin/post-new.php1,533 ▼923.35 ▲5.04682.26 ▲35.7465.82 ▲17.21
Media Library /wp-admin/upload.php1,388 ▲34.22 ▲0.0297.00 ▼1.3443.00 ▼7.59

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
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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 items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Shipping_Method' not found in wp-content/plugins/wc-shipping-discount/includes/ShippingMethod.php:6

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 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
8 plugin tags: shipping discount, woocommerce shipping discount, discount, shipping, woocommerce...

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

The main PHP file in "Shipping Discount for WooCommerce" ver. 1.0.12 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Domain Path: The domain path folder does not exist ("/languages")

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
Good job! No executable or dangerous file extensions detected592 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP414599592

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity20.33
▷ Minimum class complexity2.00
▷ Maximum class complexity43.00
Average method complexity2.87
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods31
▷ Static methods13.23%
▷ Public methods1754.84%
▷ Protected methods1445.16%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/1TeamSoftware-icon.png0.59KB0.75KB0.00%
assets/images/1TeamSoftware-logo.png14.55KB4.50KB▼ 69.05%