93% freightview-for-woocommerce

Code Review | Freightview for WooCommerce

WordPress plugin Freightview for WooCommerce scored 93% from 53 tests.

About plugin

  • Plugin page: freightview-for-w...
  • Plugin version: 1.6.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-5.6.2
  • WordPress version: 5.8.1
  • First release: Mar 29, 2016
  • Latest release: Apr 7, 2021
  • Number of updates: 69
  • Update frequency: every 26.7 days
  • Top authors: freightview (100%)

Code review

53 tests

User reviews

2 reviews

Install metrics

30+ active / 2,411 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.24MB] [CPU: ▼764.00ms] Passed 4 tests

Server-side resources used by Freightview for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.06 ▲0.3435.88 ▲14.06
Dashboard /wp-admin3.28 ▲0.2342.77 ▲2.09
Posts /wp-admin/edit.php3.39 ▲0.2942.44 ▼0.67
Add New Post /wp-admin/post-new.php5.64 ▲0.2292.82 ▼3,044.07
Media Library /wp-admin/upload.php3.22 ▲0.2229.76 ▼13.35

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 7 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Freightview for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,650 ▲4415.72 ▲0.258.16 ▼1.3146.37 ▼2.22
Dashboard /wp-admin2,934 ▲815.94 ▼0.07135.00 ▲0.73105.25 ▼1.67
Posts /wp-admin/edit.php2,706 ▲32.69 ▲0.0166.21 ▼0.8688.72 ▼2.89
Add New Post /wp-admin/post-new.php1,853 ▼18518.99 ▼0.45363.07 ▼11.17105.01 ▲2.03
Media Library /wp-admin/upload.php1,772 ▼05.02 ▲0.03141.05 ▼3.95110.06 ▼3.60

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled successfully, without leaving any zombie files or tables

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)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 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
Please fix the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_upload_dir() in wp-content/plugins/freightview-for-woocommerce/woocommerce-freightview.php:29

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 90% 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
4 plugin tags: freight, shopping cart, shipping, woocommerce

freightview-for-woocommerce/woocommerce-freightview.php 77% from 13 tests

"Freightview for WooCommerce" version 1.6.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("freightview-for-woocommerce.php" instead of "woocommerce-freightview.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Domain Path: The domain path points to a folder that does not exist ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin1,568 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP21861451,331
JavaScript2170137
CSS280100

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity44.67
▷ Minimum class complexity5.00
▷ Maximum class complexity119.00
Average method complexity3.69
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods17
▷ Static methods635.29%
▷ Public methods1588.24%
▷ Protected methods15.88%
▷ Private methods15.88%
Functions26
▷ Named functions2076.92%
▷ Anonymous functions623.08%
Constants6
▷ Global constants466.67%
▷ Class constants233.33%
▷ Public constants2100.00%

Plugin size Passed 1 test

Image compression Passed 1 test

Using a strong compression for your PNG files is a great way to speed-up your plugin
There are no PNG files in this plugin