89% flat-rate-per-countryregion-for-woocommerce

Code Review | Flat Rate per State/Country/Region for WooCommerce

WordPress plugin Flat Rate per State/Country/Region for WooCommerce scored 89% from 54 tests.

About plugin

  • Plugin page: flat-rate-per-cou...
  • Plugin version: 2.8
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Nov 4, 2013
  • Latest release: May 25, 2023
  • Number of updates: 102
  • Update frequency: every 34.2 days
  • Top authors: webdados (100%)

Code review

54 tests

User reviews

35 reviews

Install metrics

2,000+ active / 94,461 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.26MB] [CPU: ▼3.98ms] Passed 4 tests

Server-side resources used by Flat Rate per State/Country/Region for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.72 ▲0.2639.06 ▼1.27
Dashboard /wp-admin3.56 ▲0.2649.75 ▼0.68
Posts /wp-admin/edit.php3.68 ▲0.3249.86 ▼0.18
Add New Post /wp-admin/post-new.php6.14 ▲0.2689.39 ▼13.78
Media Library /wp-admin/upload.php3.49 ▲0.2637.50 ▲4.34

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Flat Rate per State/Country/Region for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.26 ▼1.034.53 ▲2.8343.92 ▼2.31
Dashboard /wp-admin2,203 ▲185.81 ▲0.9598.61 ▼6.0638.89 ▼2.95
Posts /wp-admin/edit.php2,086 ▼32.05 ▲0.0635.77 ▼2.4630.68 ▼4.05
Add New Post /wp-admin/post-new.php1,542 ▲518.10 ▼5.22608.28 ▼9.4966.45 ▲6.84
Media Library /wp-admin/upload.php1,388 ▼34.16 ▼0.04102.37 ▼5.3842.24 ▼4.04

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
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 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
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Tags: Please reduce the number of tags, currently 15 tag instead of maximum 10
You can look at the official readme.txt

flat-rate-per-countryregion-for-woocommerce/woocommerce_flatrate_percountry.php 85% from 13 tests

"Flat Rate per State/Country/Region for WooCommerce" version 2.8's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("flat-rate-per-countryregion-for-woocommerce.php" instead of "woocommerce_flatrate_percountry.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 147 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin1,310 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP2371521,295
SVG11115

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
Please tend to the following items
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 149)
Cyclomatic complexity
Average complexity per logical line of code0.78
Average class complexity229.00
▷ Minimum class complexity229.00
▷ Maximum class complexity229.00
Average method complexity15.25
▷ Minimum method complexity1.00
▷ Maximum method complexity149.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods16
▷ Static methods00.00%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions571.43%
▷ Anonymous functions228.57%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 compressed PNG file occupies 0.01MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
webdados_invoicexpress_nag/invoicexpress-woocommerce-logo.png8.10KB7.67KB▼ 5.25%