78% woo-shipping-additional-days

Code Review | Shipping Additional Days for WooCommerce

WordPress plugin Shipping Additional Days for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: woo-shipping-addi...
  • Plugin version: 1.3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-5.5
  • WordPress version: 6.3.1
  • First release: May 5, 2017
  • Latest release: Feb 5, 2021
  • Number of updates: 17
  • Update frequency: every 80.7 days
  • Top authors: mariovalney (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

400+ active /11,248 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.07MB] [CPU: ▲2.36ms] Passed 4 tests

This is a short check of server-side resources used by Shipping Additional Days for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0848.84 ▲7.61
Dashboard /wp-admin3.38 ▲0.0759.07 ▲6.95
Posts /wp-admin/edit.php3.49 ▲0.1351.16 ▼5.02
Add New Post /wp-admin/post-new.php5.96 ▲0.07118.83 ▲21.13
Media Library /wp-admin/upload.php3.30 ▲0.0738.50 ▼0.11

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 14 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Shipping Additional Days for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.48 ▲0.082.16 ▲0.3747.12 ▲0.65
Dashboard /wp-admin2,206 ▲215.89 ▲0.03104.16 ▼5.2140.26 ▼3.69
Posts /wp-admin/edit.php2,089 ▼01.98 ▼0.0440.83 ▲2.1635.83 ▲2.36
Add New Post /wp-admin/post-new.php1,533 ▲1923.05 ▲5.55683.65 ▼97.6251.74 ▼7.10
Media Library /wp-admin/upload.php1,391 ▲64.25 ▲0.03104.22 ▼8.7541.25 ▼5.85

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

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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 10× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/woo-shipping-additional-days/modules/shipping-classes/includes/functions-shipping-classes.php
    • > /wp-content/plugins/woo-shipping-additional-days/woo-shipping-additional-days.php
    • > /wp-content/plugins/woo-shipping-additional-days/modules/shipping-classes/class-module-shipping-classes.php
    • > /wp-content/plugins/woo-shipping-additional-days/modules/shipping/class-module-shipping.php
    • > /wp-content/plugins/woo-shipping-additional-days/includes/functions-core.php
    • > /wp-content/plugins/woo-shipping-additional-days/modules/shipping/includes/class-shipping-plugin.php
    • > /wp-content/plugins/woo-shipping-additional-days/modules/products/class-module-products.php
    • > /wp-content/plugins/woo-shipping-additional-days/modules/shipping/includes/class-woocommerce-local-pickup.php
    • > /wp-content/plugins/woo-shipping-additional-days/modules/products/includes/functions-products.php
    • > /wp-content/plugins/woo-shipping-additional-days/modules/shipping/includes/class-woocommerce-correios.php
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_products_additional_time() in wp-content/plugins/woo-shipping-additional-days/modules/products/includes/views/product-shipping-additional-time.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/woo-shipping-additional-days/modules/shipping/includes/views/status-report-errors.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
8 plugin tags: shipping, shop, woo commerce, e-commerce, correios...

woo-shipping-additional-days/woo-shipping-additional-days.php 85% from 13 tests

Analyzing the main PHP file in "Shipping Additional Days for WooCommerce" version 1.3.0
Please take the time to fix the following:
  • Requires at least: Required version must match the one declared in readme.txt ("4.4" instead of "4.1")
  • Domain Path: The domain path points to a folder that does not exist ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin370 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP13111410370

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity4.43
▷ Minimum class complexity1.00
▷ Maximum class complexity8.00
Average method complexity1.57
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes114.29%
▷ Concrete classes685.71%
▷ Final classes00.00%
Methods38
▷ Static methods00.00%
▷ Public methods2257.89%
▷ Protected methods410.53%
▷ Private methods1231.58%
Functions6
▷ Named functions466.67%
▷ Anonymous functions233.33%
Constants11
▷ Global constants872.73%
▷ Class constants327.27%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin