84% saferoute-woocommerce

Code Review | SafeRoute WooCommerce

WordPress plugin SafeRoute WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: saferoute-woocomm...
  • Plugin version: 3.2.12
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.2.2
  • WordPress version: 6.3.1
  • First release: Apr 29, 2019
  • Latest release: Oct 19, 2023
  • Number of updates: 59
  • Update frequency: every 27.7 days
  • Top authors: dmitrymezentsev (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /2,270 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▲0.36ms] Passed 4 tests

Analyzing server-side resources used by SafeRoute WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0434.75 ▼3.49
Dashboard /wp-admin3.35 ▲0.0552.13 ▲0.41
Posts /wp-admin/edit.php3.46 ▲0.1149.82 ▲5.21
Add New Post /wp-admin/post-new.php5.93 ▲0.0485.83 ▼0.71
Media Library /wp-admin/upload.php3.27 ▲0.0439.49 ▲8.02

Server storage [IO: ▲0.25MB] [DB: ▲0.07MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 22 new files
Database: no new tables, 19 new options
New WordPress options
send_orders_as_confirmed
statuses_matching_option
hide_checkout_billing_block
widget_recent-posts
show_details_in_delivery_name
saferoute_admin_notices
can_compress_scripts
card_cod_pay_method_option
saferoute_shop_id
price_declared_percent
...

Browser metrics Passed 4 tests

An overview of browser requirements for SafeRoute WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲6614.60 ▲0.331.66 ▼0.0538.18 ▼5.77
Dashboard /wp-admin2,233 ▲564.84 ▼0.8388.42 ▲2.8540.50 ▲1.13
Posts /wp-admin/edit.php2,138 ▲382.27 ▲0.2753.81 ▲19.6536.00 ▼1.17
Add New Post /wp-admin/post-new.php1,564 ▲3618.42 ▼4.73604.83 ▲9.3877.38 ▲27.53
Media Library /wp-admin/upload.php1,441 ▲384.29 ▲0.1099.92 ▲1.2246.39 ▲2.43

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • saferoute_admin_notices
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/saferoute-woocommerce/views/checkout-widget-block.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'SafeRouteWooCommerceBase' not found in wp-content/plugins/saferoute-woocommerce/includes/SafeRouteWooCommerceAdminApi.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/saferoute-woocommerce/views/admin-settings-page.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 93% 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
7 plugin tags: saferoute, delivery, cdek, boxberry, woocommerce...

saferoute-woocommerce/saferoute_woocommerce.php 85% from 13 tests

The main file in "SafeRoute WooCommerce" v. 3.2.12 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("saferoute-woocommerce.php" instead of "saferoute_woocommerce.php")
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin3,221 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP123735512,061
PO File1329365673
JavaScript48458375
CSS22512112

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity26.33
▷ Minimum class complexity1.00
▷ Maximum class complexity93.00
Average method complexity3.48
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes222.22%
Methods77
▷ Static methods6685.71%
▷ Public methods6179.22%
▷ Protected methods11.30%
▷ Private methods1519.48%
Functions38
▷ Named functions410.53%
▷ Anonymous functions3489.47%
Constants51
▷ Global constants00.00%
▷ Class constants51100.00%
▷ Public constants5098.04%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There were not PNG files found in your plugin