78% shipping-simulator-for-woocommerce

Code Review | Shipping Simulator for WooCommerce

WordPress plugin Shipping Simulator for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: shipping-simulato...
  • Plugin version: 2.3.3
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.4
  • WordPress version: 6.3.1
  • First release: Jul 18, 2022
  • Latest release: Nov 19, 2023
  • Number of updates: 40
  • Update frequency: every 12.2 days
  • Top authors: luizbills (100%)

Code review

54 tests

User reviews

20 reviews

Install metrics

3,000+ active /16,604 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.37MB] [CPU: ▼3.21ms] Passed 4 tests

Server-side resources used by Shipping Simulator for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.87 ▲0.4043.84 ▲1.50
Dashboard /wp-admin3.70 ▲0.3652.54 ▼6.89
Posts /wp-admin/edit.php3.75 ▲0.4047.31 ▲0.54
Add New Post /wp-admin/post-new.php6.22 ▲0.3386.35 ▼7.81
Media Library /wp-admin/upload.php3.61 ▲0.3836.23 ▲1.34

Server storage [IO: ▲0.20MB] [DB: ▲0.31MB] Passed 3 tests

Filesystem and database footprint
No storage issues were detected
Filesystem: 65 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
db_upgraded
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Shipping Simulator for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲7214.67 ▼0.051.92 ▲0.2544.14 ▼0.91
Dashboard /wp-admin2,221 ▲405.54 ▼0.1183.80 ▼27.7940.44 ▼6.95
Posts /wp-admin/edit.php2,129 ▲291.94 ▲0.0039.75 ▼3.7938.40 ▲0.86
Add New Post /wp-admin/post-new.php1,551 ▲2523.10 ▲0.09659.43 ▼18.1757.78 ▼3.58
Media Library /wp-admin/upload.php1,429 ▲264.20 ▼0.03106.89 ▲7.2851.80 ▲10.57

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts

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)
Even though no errors were found, this is by no means 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
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/shipping-simulator-for-woocommerce/templates/shipping-simulator-results-wrapper.php
    • > /wp-content/plugins/shipping-simulator-for-woocommerce/templates/shipping-simulator-results.php
  • 8× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Notice
      Undefined variable: rates in wp-content/plugins/shipping-simulator-for-woocommerce/templates/shipping-simulator-results.php on line 3
    • > PHP Warning
      count(): Parameter must be an array or an object that implements Countable in wp-content/plugins/shipping-simulator-for-woocommerce/templates/shipping-simulator-results.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/shipping-simulator-for-woocommerce/templates/shipping-simulator-form.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/shipping-simulator-for-woocommerce/templates/notice-donation.php:7
    • > PHP Fatal error
      Trait 'Shipping_Simulator\\Core\\Traits\\Common_Helpers' not found in wp-content/plugins/shipping-simulator-for-woocommerce/classes/Helpers.php on line 15
    • > PHP Fatal error
      Trait 'Shipping_Simulator\\Core\\Traits\\Config_Helpers' not found in wp-content/plugins/shipping-simulator-for-woocommerce/core/Traits/Template_Helpers.php on line 7
    • > PHP Notice
      Undefined variable: notice in wp-content/plugins/shipping-simulator-for-woocommerce/templates/shipping-simulator-results.php on line 26
    • > PHP Fatal error
      Uncaught Error: Class 'Shipping_Simulator\\Admin\\Settings' not found in wp-content/plugins/shipping-simulator-for-woocommerce/classes/Admin/inc/settings_fields.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
8 plugin tags: product, simulador de frete, brazil, shipping simulator, brasil...

shipping-simulator-for-woocommerce/main.php 85% from 13 tests

The main PHP file in "Shipping Simulator for WooCommerce" ver. 2.3.3 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: Name the main plugin file the same as the plugin slug ("shipping-simulator-for-woocommerce.php" instead of "main.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
No dangerous file extensions were detected3,133 lines of code in 58 files:
LanguageFilesBlank linesComment linesLines of code
PHP485294912,553
PO File17493204
JavaScript2284163
Markdown1750109
CSS24054
JSON30049
SVG1001

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity10.69
▷ Minimum class complexity1.00
▷ Maximum class complexity48.00
Average method complexity2.59
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces7
Interfaces0
Traits7
Classes25
▷ Abstract classes520.00%
▷ Concrete classes2080.00%
▷ Final classes1470.00%
Methods186
▷ Static methods8143.55%
▷ Public methods16588.71%
▷ Protected methods168.60%
▷ Private methods52.69%
Functions8
▷ Named functions00.00%
▷ Anonymous functions8100.00%
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
No PNG images were found in this plugin