72% quote-calculator-constructor

Code Review | Quote Calculator Constructor

WordPress plugin Quote Calculator Constructor scored 72% from 54 tests.

About plugin

  • Plugin page: quote-calculator-...
  • Plugin version: 1.1
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.2
  • WordPress version: 6.3.1
  • First release: Oct 21, 2019
  • Latest release: Oct 29, 2019
  • Number of updates: 8
  • Update frequency: every 1.1 days
  • Top authors: evgendob (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 817 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▼0.61MB] [CPU: ▼20.97ms] Passed 4 tests

Analyzing server-side resources used by Quote Calculator Constructor
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1226.25 ▼14.24
Dashboard /wp-admin3.34 ▲0.0334.82 ▼13.43
Posts /wp-admin/edit.php3.40 ▲0.0440.80 ▼2.53
Add New Post /wp-admin/post-new.php3.30 ▼2.5943.41 ▼53.69
Media Library /wp-admin/upload.php3.30 ▲0.0734.75 ▼1.31
Add New /wp-admin/post-new.php?post_type=calculator3.3039.11
All Calculator /wp-admin/edit.php?post_type=calculator3.3933.60

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 133 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Quote Calculator Constructor
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,527 ▲79219.24 ▲4.8621.17 ▲19.4239.59 ▼3.06
Dashboard /wp-admin2,395 ▲2076.63 ▲0.78113.22 ▲6.1736.45 ▼2.84
Posts /wp-admin/edit.php2,297 ▲2113.64 ▲1.6463.68 ▲28.6833.85 ▲2.92
Add New Post /wp-admin/post-new.php1,562 ▲4323.18 ▼0.13640.00 ▼100.2135.88 ▼27.24
Media Library /wp-admin/upload.php1,434 ▲464.41 ▲0.17107.83 ▼4.9549.16 ▲1.25
Add New /wp-admin/post-new.php?post_type=calculator1,8913.7662.4744.92
All Calculator /wp-admin/edit.php?post_type=calculator1,2503.6658.1925.11

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
    • > GET request to /wp-admin/post-new.php?post_type=calculator
    • > Notice in wp-content/plugins/quote-calculator-constructor/modules/meta_box.php+62
    Undefined index: post_type
    • > GET request to /wp-admin/post-new.php?post_type=calculator
    • > Notice in wp-content/plugins/quote-calculator-constructor/modules/meta_box.php+79
    Undefined index: interface_data
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=calculator
    • > Notice in wp-content/plugins/quote-calculator-constructor/modules/scripts.php+53
    Undefined index: localization
    • > GET request to /wp-admin/post-new.php?post_type=calculator
    • > Notice in wp-content/plugins/quote-calculator-constructor/modules/formElementsClass.php+25
    Undefined index: width
    • > GET request to /wp-admin/post-new.php?post_type=calculator
    • > Notice in wp-content/plugins/quote-calculator-constructor/modules/formElementsClass.php+27
    Undefined index: id
    • > GET request to /wp-admin/post-new.php?post_type=calculator
    • > Notice in wp-content/plugins/quote-calculator-constructor/modules/formElementsClass.php+33
    Undefined index: sub_text
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=calculator
    • > Notice in wp-content/plugins/quote-calculator-constructor/modules/formElementsClass.php+261
    Undefined variable: out

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
Almost there! Just fix the following items
  • 6× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/quote-calculator-constructor/modules/hooks.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/quote-calculator-constructor/modules/cpt.php:26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/quote-calculator-constructor/modules/scripts.php:65
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/quote-calculator-constructor/modules/shortcodes.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_Action() in wp-content/plugins/quote-calculator-constructor/modules/meta_box.php:126
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/quote-calculator-constructor/modules/shortcodes.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/edit.php?post_type=calculator
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core,moxiejs,plupload,jquery-ui-mouse,jquery-ui-sortable&ver=6.3.1 1:28609 "jQuery.Deferred exception: \"undefined\" is not valid JSON" "SyntaxError: \"undefined\" is not valid JSON\n at parse (\u003Canonymous>)\n at Function.\u003Canonymous> (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core,moxiejs,plupload,jquery-ui-mouse,jquery-ui-sortable&ver=6.3.1:5:3161)\n at e.\u003Ccomputed> [as parseJSON] (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core,moxiejs,plupload,jquery-ui-mouse,jquery-ui-sortable&ver=6.3.1:5:1582)\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/quote-calculator-constructor/modules/js/admin.js?ver=6.3.1:398:19)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core,moxiejs,plupload,jquery-ui-mouse,jquery-ui-sortable&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core,moxiejs,plupload,jquery-ui-mouse,jquery-ui-sortable&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/edit.php?post_type=calculator
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core,moxiejs,plupload,jquery-ui-mouse,jquery-ui-sortable&ver=6.3.1 4:3160 Uncaught SyntaxError: "undefined" is not valid JSON

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
4 plugin tags: quote generator, calculator plugin, loan quote, loan calculator

quote-calculator-constructor/wp-calc-creator.php 92% from 13 tests

The main PHP script in "Quote Calculator Constructor" version 1.1 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("quote-calculator-constructor.php" instead of "wp-calc-creator.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin47,872 lines of code in 122 files:
LanguageFilesBlank linesComment linesLines of code
CSS154,05411230,387
JavaScript142,5911,4008,233
Sass674331565,594
LESS1319311,149
Markdown224401,134
PHP822829740
SVG100504
JSON10078
PO File132864753

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 issues
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity14.83
▷ Minimum class complexity1.00
▷ Maximum class complexity51.00
Average method complexity5.15
▷ Minimum method complexity1.00
▷ Maximum method complexity51.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods20
▷ Static methods00.00%
▷ Public methods20100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions583.33%
▷ Anonymous functions116.67%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 compressed PNG files occupy 0.02MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
modules/inc/assets/css/glyphicons-halflings.png12.50KB10.35KB▼ 17.19%
modules/inc/assets/css/glyphicons-halflings-white.png8.57KB9.20KB0.00%