74% shipping-rate-by-zipcodes

Code Review | Shipping Rate By Zipcodes

WordPress plugin Shipping Rate By Zipcodes 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 16, 2023
  • Latest release: Jun 16, 2023
  • Number of updates: 13
  • Update frequency: N/A
  • Top authors: tridenttechnolabs (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /123 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

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

An overview of server-side resources used by Shipping Rate By Zipcodes
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0141.32 ▼8.02
Dashboard /wp-admin3.31 ▲0.0151.86 ▼0.31
Posts /wp-admin/edit.php3.37 ▲0.0150.83 ▼11.06
Add New Post /wp-admin/post-new.php5.91 ▲0.0390.85 ▼20.00
Media Library /wp-admin/upload.php3.24 ▲0.0135.62 ▼3.68

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 5 new files
Database: 1 new table, 6 new options
New tables
wp_shiprate_zipcodes
New WordPress options
widget_theysaidso_widget
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Shipping Rate By Zipcodes
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,870 ▲8413.46 ▼1.077.74 ▲5.4339.26 ▼5.20
Dashboard /wp-admin2,200 ▲205.59 ▼0.0187.90 ▼12.7239.06 ▼7.17
Posts /wp-admin/edit.php2,105 ▼01.99 ▲0.0238.59 ▲0.8034.54 ▼8.50
Add New Post /wp-admin/post-new.php1,539 ▲1324.36 ▲1.04630.74 ▼64.2870.06 ▲13.41
Media Library /wp-admin/upload.php1,399 ▼14.20 ▲0.02101.98 ▼10.0350.99 ▲2.08

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_shiprate_zipcodes
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts

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/shipping-rate-by-zipcodes/zipcoderate-method-class.php:3

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 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: zipcode shipping, custom rate, postalcode shipping, post code, shipping rate

shipping-rate-by-zipcodes/shipping_rate_by_zipcodes.php 92% from 13 tests

"Shipping Rate By Zipcodes" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("shipping-rate-by-zipcodes.php" instead of "shipping_rate_by_zipcodes.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
Success! There were no dangerous files found in this plugin453 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP2147114431
JavaScript17022

PHP code Passed 2 tests

An overview 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.24
Average class complexity11.50
▷ Minimum class complexity5.00
▷ Maximum class complexity18.00
Average method complexity1.84
▷ 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

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin