83% conditional-shipping-for-woocommerce

Code Review | Conditional Shipping for WooCommerce

WordPress plugin Conditional Shipping for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: conditional-shipp...
  • Plugin version: 3.1.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-6.3
  • WordPress version: 6.3.1
  • First release: Sep 11, 2017
  • Latest release: Oct 9, 2023
  • Number of updates: 87
  • Update frequency: every 25.6 days
  • Top authors: wooelements (100%)

Code review

54 tests

User reviews

19 reviews

Install metrics

10,000+ active /156,487 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼4.71ms] Passed 4 tests

Server-side resources used by Conditional Shipping for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0240.25 ▼2.04
Dashboard /wp-admin3.32 ▲0.0250.81 ▼6.38
Posts /wp-admin/edit.php3.37 ▲0.0251.50 ▼3.08
Add New Post /wp-admin/post-new.php5.90 ▲0.0286.30 ▼7.34
Media Library /wp-admin/upload.php3.24 ▲0.0238.20 ▲1.03

Server storage [IO: ▲0.64MB] [DB: ▲0.00MB] 67% from 3 tests

How much does this plugin use your filesystem and database?
Just a few items left to fix
  • You have illegally modified 1 file (4.00KB) outside of "wp-content/plugins/conditional-shipping-for-woocommerce/" and "wp-content/uploads/"
    • (new file) wp-content/mgd_mirror/mgd_maximinodotpy-gitdown-test-repository
Filesystem: 30 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Conditional Shipping for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5413.23 ▼1.451.66 ▼0.0442.81 ▲1.62
Dashboard /wp-admin2,218 ▲155.83 ▼0.0797.94 ▼48.1142.06 ▼12.38
Posts /wp-admin/edit.php2,100 ▼02.05 ▲0.0143.65 ▲2.7344.12 ▲7.91
Add New Post /wp-admin/post-new.php1,526 ▼517.48 ▼5.66615.61 ▼50.4146.74 ▼10.52
Media Library /wp-admin/upload.php1,400 ▲34.21 ▼0.03102.45 ▲3.0743.58 ▼1.72

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/conditional-shipping-for-woocommerce/includes/class-conditional-shipping-updater.php:254
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/conditional-shipping-for-woocommerce/includes/frontend/views/debug.html.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes: You can look at the official readme.txt

conditional-shipping-for-woocommerce/woo-conditional-shipping.php 85% from 13 tests

"Conditional Shipping for WooCommerce" version 3.1.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.6" instead of "5.0.0")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("conditional-shipping-for-woocommerce.php" instead of "woo-conditional-shipping.php")

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
Success! There were no dangerous files found in this plugin4,247 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
PHP126084942,791
Sass21060501
CSS411910497
JavaScript2120114456
SVG2002

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity42.62
▷ Minimum class complexity1.00
▷ Maximum class complexity88.00
Average method complexity4.58
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods93
▷ Static methods2425.81%
▷ Public methods6468.82%
▷ Protected methods00.00%
▷ Private methods2931.18%
Functions43
▷ Named functions3888.37%
▷ Anonymous functions511.63%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
5 PNG files occupy 0.34MB with 0.18MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-2.png88.59KB32.99KB▼ 62.76%
assets/screenshot-3.png101.95KB38.92KB▼ 61.83%
assets/screenshot-1.png107.74KB42.48KB▼ 60.57%
assets/banner-772x250.png49.86KB22.22KB▼ 55.43%
assets/icon-128x128.png3.10KB2.53KB▼ 18.51%