83% shipbob-express-rates

Code Review | ShipBob Express Rates

WordPress plugin ShipBob Express Rates scored83%from 54 tests.

About plugin

  • Plugin page: shipbob-express-r...
  • Plugin version: 2.1.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.6
  • WordPress version: 6.3.1
  • First release: Jan 29, 2019
  • Latest release: Nov 1, 2023
  • Number of updates: 19
  • Update frequency: every 91.7 days
  • Top authors: jradkiewicz (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /2,192 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

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

An overview of server-side resources used by ShipBob Express Rates
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0038.47 ▼3.81
Dashboard /wp-admin3.31 ▼0.0446.31 ▼17.93
Posts /wp-admin/edit.php3.36 ▲0.0050.38 ▲0.46
Add New Post /wp-admin/post-new.php5.89 ▲0.0083.24 ▼11.97
Media Library /wp-admin/upload.php3.23 ▲0.0042.42 ▲6.10

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 52 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for ShipBob Express Rates
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲6814.25 ▲0.021.87 ▲0.2140.97 ▼3.51
Dashboard /wp-admin2,198 ▲245.60 ▼0.0892.33 ▼5.1138.09 ▼5.18
Posts /wp-admin/edit.php2,103 ▲31.98 ▼0.0438.63 ▲4.0336.27 ▲0.11
Add New Post /wp-admin/post-new.php1,526 ▼1223.27 ▲5.05636.08 ▲25.5161.71 ▼13.91
Media Library /wp-admin/upload.php1,397 ▼64.19 ▼0.04102.89 ▲2.4241.30 ▼2.27

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 17× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/shipbob-express-rates/templates/admin/notice.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'ShipBob\\WooRates\\Controllers\\Controller' not found in wp-content/plugins/shipbob-express-rates/app/Controllers/AdminController.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'ShipBob\\WooRates\\Shipping\\ShippingMethod' not found in wp-content/plugins/shipbob-express-rates/app/Shipping/ShipBobMethod.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'ShipBob\\WooRates\\Services\\Service' not found in wp-content/plugins/shipbob-express-rates/app/Services/Settings.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'ShipBob\\WooRates\\Api\\HttpClient' not found in wp-content/plugins/shipbob-express-rates/app/Api/Orders.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'ShipBob\\WooRates\\Services\\Service' not found in wp-content/plugins/shipbob-express-rates/app/Services/Paths.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'ShipBob\\WooRates\\Controllers\\Controller' not found in wp-content/plugins/shipbob-express-rates/app/Controllers/PluginController.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'ShipBob\\WooRates\\Api\\HttpClient' not found in wp-content/plugins/shipbob-express-rates/app/Api/Rates.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/shipbob-express-rates/templates/admin/terms.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'ShipBob\\WooRates\\Services\\Service' not found in wp-content/plugins/shipbob-express-rates/app/Services/Assets.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 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
Attributes that require attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (The ShipBob Express settings panel.), #2 (Example of rates shown shipping methods in cart/checkout), #3 (ShipBob Express shipping method settings in Woocommerce)
Please take inspiration from this readme.txt

shipbob-express-rates/plugin.php 85% from 13 tests

The entry point to "ShipBob Express Rates" version 2.1.2 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 165 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("shipbob-express-rates.php" instead of "plugin.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 detected5,622 lines of code in 32 files:
LanguageFilesBlank linesComment linesLines of code
SVG3004,215
PHP234281,1401,167
Sass1432208
JavaScript2141025
JSON2006
CSS1031

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity8.00
▷ Minimum class complexity1.00
▷ Maximum class complexity39.00
Average method complexity2.16
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes19
▷ Abstract classes315.79%
▷ Concrete classes1684.21%
▷ Final classes00.00%
Methods102
▷ Static methods32.94%
▷ Public methods9189.22%
▷ Protected methods1110.78%
▷ Private methods00.00%
Functions14
▷ Named functions00.00%
▷ Anonymous functions14100.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
3 PNG files occupy 0.20MB with 0.11MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png16.70KB5.80KB▼ 65.25%
screenshot-3.png95.90KB42.31KB▼ 55.88%
screenshot-1.png87.39KB40.37KB▼ 53.80%