67% woo-quote-calculator-order

Code Review | Woocommerce Quote Calculator

WordPress plugin Woocommerce Quote Calculator scored67%from 54 tests.

About plugin

  • Plugin page: woo-quote-calcula...
  • Plugin version: 1.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.1
  • WordPress version: 6.3.1
  • First release: Jun 3, 2016
  • Latest release: Feb 1, 2023
  • Number of updates: 11
  • Update frequency: every 221.3 days
  • Top authors: chenyenming (63.64%)mansurahamed (45.45%)

Code review

54 tests

User reviews

4 reviews

Install metrics

60+ active /4,610 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

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

A check of server-side resources used by Woocommerce Quote Calculator
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0234.55 ▼2.00
Dashboard /wp-admin3.33 ▼0.0245.11 ▼10.97
Posts /wp-admin/edit.php3.38 ▲0.0247.18 ▼1.31
Add New Post /wp-admin/post-new.php5.91 ▲0.0292.91 ▼10.38
Media Library /wp-admin/upload.php3.25 ▲0.0236.31 ▼0.59
Add New /wp-admin/admin.php?page=WooQco-newquote3.2230.72
Export /wp-admin/admin.php?page=WooQco-export3.2237.72
Import /wp-admin/admin.php?page=WooQco-import3.2129.47
Woo Quotes /wp-admin/admin.php?page=woo-qco3.2132.33
Help /wp-admin/admin.php?page=WooQco-help3.2129.70

Server storage [IO: ▲1.53MB] [DB: ▲0.00MB] 67% from 3 tests

How much does this plugin use your filesystem and database?
Please try to fix the following items
  • Illegal file modification found: 1 file (0.00KB) outside of "wp-content/plugins/woo-quote-calculator-order/" and "wp-content/uploads/"
    • (new file) wp-admin/woo-simple-quote-2023-10-08.csv
Filesystem: 53 new files
Database: 1 new table, 6 new options
New tables
wp_woo_quote_calculator
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Woocommerce Quote Calculator
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,834 ▲8813.19 ▼1.211.58 ▼0.1840.12 ▼2.69
Dashboard /wp-admin2,240 ▲494.95 ▼0.07106.42 ▼0.3578.75 ▲32.83
Posts /wp-admin/edit.php2,126 ▲341.97 ▼0.0836.88 ▼5.8533.68 ▼3.15
Add New Post /wp-admin/post-new.php1,545 ▲923.04 ▼0.27690.63 ▲34.5753.14 ▼1.42
Media Library /wp-admin/upload.php1,425 ▲374.23 ▲0.0197.16 ▼10.3373.73 ▲25.82
Add New /wp-admin/admin.php?page=WooQco-newquote1,0461.8728.6456.93
Export /wp-admin/admin.php?page=WooQco-export9162.0723.9033.71
Import /wp-admin/admin.php?page=WooQco-import9292.0221.0833.66
Woo Quotes /wp-admin/admin.php?page=woo-qco9492.1722.5635.58
Help /wp-admin/admin.php?page=WooQco-help1,1631.8723.35125.53

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_woo_quote_calculator
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts

Smoke tests 50% 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 everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-quote-calculator-order/classes/WooQcoModel.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/woo-quote-calculator-order/classes/WooQcoShortcode.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-quote-calculator-order/classes/WooQcoModel.php:2

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/admin.php?page=WooQco-newquote
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=WooQco-newquote 291:27 Uncaught SyntaxError: Unexpected token '}'
    • > GET request to /wp-admin/admin.php?page=WooQco-newquote
    • > Network (severe)
    wp-content/plugins/woo-quote-calculator-order/css/NewQuoteCss.css - Failed to load resource: the server responded with a status of 404 (Not Found)

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:
  • Tags: Please delete some tags, you are using 11 tag instead of maximum 10
The official readme.txt is a good inspiration

woo-quote-calculator-order/woo_quote_calculator_and_order.php 85% from 13 tests

The primary PHP file in "Woocommerce Quote Calculator" version 1.1 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("woo-quote-calculator-order.php" instead of "woo_quote_calculator_and_order.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 432 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin2,542 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP101464361,270
SVG100655
CSS6525441
HTML1350154
JavaScript20022

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity19.30
▷ Minimum class complexity1.00
▷ Maximum class complexity82.00
Average method complexity4.73
▷ Minimum method complexity1.00
▷ Maximum method complexity41.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods49
▷ Static methods3061.22%
▷ Public methods4795.92%
▷ Protected methods12.04%
▷ Private methods12.04%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
22 PNG files occupy 0.60MB with 0.38MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/icon.png3.18KB0.78KB▼ 75.57%
documentation/images/frontend-1.png33.53KB14.06KB▼ 58.05%
images/close-icon.png3.80KB1.08KB▼ 71.70%
documentation/images/fields.png43.17KB18.84KB▼ 56.35%
documentation/images/edit.png72.50KB30.47KB▼ 57.98%