74% shipping-rate-by-cities

Code Review | Shipping Rate By Cities

WordPress plugin Shipping Rate By Cities scored74%from 54 tests.

About plugin

  • Plugin page: shipping-rate-by-...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-6.2
  • WordPress version: 6.3.1
  • First release: Jun 9, 2023
  • Latest release: Jun 16, 2023
  • Number of updates: 19
  • Update frequency: every 0.4 days
  • Top authors: tridenttechnolabs (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /256 total downloads

Benchmarks

Plugin footprint 65% 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.03MB] [CPU: ▼8.80ms] Passed 4 tests

Server-side resources used by Shipping Rate By Cities
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0337.96 ▼5.91
Dashboard /wp-admin3.34 ▲0.0345.41 ▼7.23
Posts /wp-admin/edit.php3.39 ▲0.0349.29 ▲1.64
Add New Post /wp-admin/post-new.php5.94 ▲0.0585.34 ▼17.49
Media Library /wp-admin/upload.php3.26 ▲0.0337.38 ▼4.58

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 5 new files
Database: 1 new table, 6 new options
New tables
wp_shiprate_cities
New WordPress options
widget_recent-posts
can_compress_scripts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Shipping Rate By Cities
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,881 ▲13513.73 ▼0.666.08 ▲4.2242.52 ▼4.09
Dashboard /wp-admin2,208 ▲235.81 ▲0.01110.73 ▼5.4536.72 ▼10.16
Posts /wp-admin/edit.php2,091 ▲22.03 ▲0.0340.55 ▲0.1935.23 ▲2.99
Add New Post /wp-admin/post-new.php1,539 ▲418.22 ▼5.06655.06 ▼2.0759.14 ▲9.89
Media Library /wp-admin/upload.php1,390 ▼14.23 ▲0.0496.95 ▼5.8742.23 ▼2.87

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_shiprate_cities
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Shipping_Method' not found in wp-content/plugins/shipping-rate-by-cities/shiprate-cities-method-class.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
6 plugin tags: shipping rate, woocommerce cities, custom shipping, shipping cities, woocommerce shipping...

shipping-rate-by-cities/shipping_rate_by_cities.php 92% from 13 tests

Analyzing the main PHP file in "Shipping Rate By Cities" version 1.0.0
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("shipping-rate-by-cities.php" instead of "shipping_rate_by_cities.php")

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
No dangerous file extensions were detected495 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP2165137473
JavaScript17022

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity12.00
▷ Minimum class complexity9.00
▷ Maximum class complexity15.00
Average method complexity1.88
▷ Minimum method complexity1.00
▷ Maximum method complexity7.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

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