73% flat-shipping-rate-by-city-for-woocommerce

Code Review | Shipping Rates by City for WooCommerce

WordPress plugin Shipping Rates by City for WooCommerce scored73%from 54 tests.

About plugin

  • Plugin page: flat-shipping-rat...
  • Plugin version: 1.0.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Jul 16, 2021
  • Latest release: Jan 12, 2023
  • Number of updates: 8
  • Update frequency: every 68.3 days
  • Top authors: logiceverest (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

1,000+ active /7,044 total downloads

Benchmarks

Plugin footprint 65% 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 gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼3.84ms] Passed 4 tests

This is a short check of server-side resources used by Shipping Rates by City for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0135.17 ▼4.58
Dashboard /wp-admin3.31 ▲0.0145.00 ▼3.38
Posts /wp-admin/edit.php3.36 ▲0.0145.89 ▼3.03
Add New Post /wp-admin/post-new.php5.91 ▲0.0388.36 ▼4.35
Media Library /wp-admin/upload.php3.24 ▲0.0133.49 ▼1.37

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

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

Browser metrics Passed 4 tests

Shipping Rates by City for WooCommerce: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,870 ▲10913.41 ▼0.947.31 ▲5.7840.54 ▲1.17
Dashboard /wp-admin2,197 ▲205.60 ▲0.0792.48 ▲7.6644.28 ▲0.18
Posts /wp-admin/edit.php2,102 ▲52.01 ▲0.0339.37 ▲3.1734.13 ▼0.98
Add New Post /wp-admin/post-new.php1,532 ▲622.91 ▼0.63634.54 ▼33.4051.51 ▼6.65
Media Library /wp-admin/upload.php1,405 ▲84.29 ▲0.06103.07 ▼1.4645.84 ▼1.41

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_wccfee_cities
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 75% 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 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
Almost there! Just fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Shipping_Method' not found in wp-content/plugins/flat-shipping-rate-by-city-for-woocommerce/shipping-method-class.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Tags: Too many tags (14 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Donate link: Invalid URI found ("")
Please take inspiration from this readme.txt

flat-shipping-rate-by-city-for-woocommerce/flat-shipping-rate-by-city.php 77% from 13 tests

This is the main PHP file of "Shipping Rates by City for WooCommerce" version 1.0.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Domain Path: The domain path points to a folder that does not exist ("/lang")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("flat-shipping-rate-by-city-for-woocommerce.php" instead of "flat-shipping-rate-by-city.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected336 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP2109131314
JavaScript15022

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity12.50
▷ Minimum class complexity11.00
▷ Maximum class complexity14.00
Average method complexity1.92
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods25
▷ Static methods14.00%
▷ Public methods2184.00%
▷ Protected methods00.00%
▷ Private methods416.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.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 files were detected