77% shipping-by-rules-for-woocommerce

Code Review | Shipping by Rules for WooCommerce

WordPress plugin Shipping by Rules for WooCommerce scored77%from 54 tests.

About plugin

  • Plugin page: shipping-by-rules...
  • Plugin version: 2.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 2.2-4.9.4
  • WordPress version: 6.3.1
  • First release: Jan 12, 2016
  • Latest release: Feb 25, 2018
  • Number of updates: 30
  • Update frequency: every 25.9 days
  • Top authors: opentools (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

900+ active /23,737 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.03MB] [CPU: ▼5.16ms] Passed 4 tests

This is a short check of server-side resources used by Shipping by Rules for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0343.41 ▼1.77
Dashboard /wp-admin3.33 ▲0.0352.13 ▼2.18
Posts /wp-admin/edit.php3.38 ▲0.0350.08 ▼3.09
Add New Post /wp-admin/post-new.php5.91 ▲0.0386.84 ▼13.59
Media Library /wp-admin/upload.php3.26 ▲0.0340.33 ▲6.38

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Shipping by Rules for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲6614.79 ▲0.411.90 ▼0.0048.84 ▲4.08
Dashboard /wp-admin2,215 ▲245.83 ▲0.9399.03 ▼2.3442.22 ▲1.82
Posts /wp-admin/edit.php2,101 ▲122.01 ▼0.0437.13 ▼1.6834.37 ▼1.03
Add New Post /wp-admin/post-new.php1,549 ▲1623.28 ▲0.15680.77 ▼9.9361.69 ▼22.88
Media Library /wp-admin/upload.php1,403 ▲154.21 ▲0.0198.01 ▼2.5642.48 ▼2.28

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
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

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
The following issues need your attention
  • 5× PHP files output text when accessed directly:
    • > /wp-content/plugins/shipping-by-rules-for-woocommerce/includes/rules_shipping_framework_woocommerce_advanced.php
    • > /wp-content/plugins/shipping-by-rules-for-woocommerce/library/rules_shipping_framework.php
    • > /wp-content/plugins/shipping-by-rules-for-woocommerce/legacy-includes/legacy-rules_shipping_framework_woocommerce_advanced.php
    • > /wp-content/plugins/shipping-by-rules-for-woocommerce/legacy-includes/legacy-rules_shipping_framework_woocommerce.php
    • > /wp-content/plugins/shipping-by-rules-for-woocommerce/includes/rules_shipping_framework_woocommerce.php
  • 7× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/shipping-by-rules-for-woocommerce/legacy-woocommerce-shipping-by-rules.php on line 37
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATH/wp-admin/includes/plugin.php' (include_path='.:/usr/share/php') in wp-content/plugins/shipping-by-rules-for-woocommerce/legacy-woocommerce-shipping-by-rules.php on line 37
    • > PHP Warning
      require_once(ABSPATH/wp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/shipping-by-rules-for-woocommerce/legacy-woocommerce-shipping-by-rules.php on line 37
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATH/wp-admin/includes/plugin.php' (include_path='.:/usr/share/php') in wp-content/plugins/shipping-by-rules-for-woocommerce/woocommerce-shipping-by-rules.php on line 72
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Shipping_Method' not found in wp-content/plugins/shipping-by-rules-for-woocommerce/legacy-includes/legacy-rules-shipping-method.php:11
    • > PHP Warning
      require_once(ABSPATH/wp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/shipping-by-rules-for-woocommerce/woocommerce-shipping-by-rules.php on line 72
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/shipping-by-rules-for-woocommerce/woocommerce-shipping-by-rules.php on line 72

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 83% from 29 tests

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

shipping-by-rules-for-woocommerce/woocommerce-shipping-by-rules.php 62% from 13 tests

This is the main PHP file of "Shipping by Rules for WooCommerce" version 2.0.6, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Requires at least: Required version must match the one declared in readme.txt ("4.0" instead of "2.2")
  • Domain Path: The domain path should use only dashes and lowercase characters ("")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("shipping-by-rules-for-woocommerce.php" instead of "woocommerce-shipping-by-rules.php")
  • Domain Path: The domain path must begin with a forward slash character ("/")

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
There were no executable files found in this plugin3,154 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
PHP205119952,859
CSS32815194
JavaScript31518101

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity35.85
▷ Minimum class complexity3.00
▷ Maximum class complexity171.00
Average method complexity3.38
▷ Minimum method complexity1.00
▷ Maximum method complexity50.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods186
▷ Static methods115.91%
▷ Public methods12768.28%
▷ Protected methods5931.72%
▷ Private methods00.00%
Functions7
▷ Named functions685.71%
▷ Anonymous functions114.29%
Constants0
▷ Global constants00.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
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/advlogo100.png9.30KB4.42KB▼ 52.50%