68% quotegenerator

Code Review | Quote Generator

WordPress plugin Quote Generator scored68%from 54 tests.

About plugin

  • Plugin page: quotegenerator
  • Plugin version: 3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.1-4.7.2
  • WordPress version: 6.3.1
  • First release: Sep 30, 2015
  • Latest release: Apr 12, 2019
  • Number of updates: 46
  • Update frequency: every 28.0 days
  • Top authors: Quotegenerator (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

20+ active /3,222 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.12MB] [CPU: ▼7.74ms] Passed 4 tests

Server-side resources used by Quote Generator
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0535.45 ▼8.19
Dashboard /wp-admin3.45 ▲0.1055.78 ▼6.09
Posts /wp-admin/edit.php3.56 ▲0.2052.36 ▲3.60
Add New Post /wp-admin/post-new.php6.05 ▲0.1685.00 ▼20.28
Media Library /wp-admin/upload.php3.39 ▲0.1639.64 ▲7.42
Quote_Generator /wp-admin/options-general.php?page=quotegenerator3.7734.22

Server storage [IO: ▲2.01MB] [DB: ▲0.01MB] Passed 3 tests

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 66 new files
Database: 4 new tables, 96 new options
New tables
wp_qg_calendar
wp_qg_invoices
wp_qg_itemx
wp_qg_orders
New WordPress options
setting_qgc3
setting_qg35
setting_qg6
setting_qg34
setting_qg36
setting_qg28
setting_qg18
setting_qg33
setting_qg31
setting_qg7
...

Browser metrics Passed 4 tests

An overview of browser requirements for Quote Generator
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,813 ▲4213.27 ▼1.351.86 ▼0.1043.53 ▼0.31
Dashboard /wp-admin2,219 ▲344.92 ▼0.93111.47 ▲9.5639.53 ▼0.75
Posts /wp-admin/edit.php2,105 ▲162.06 ▲0.0537.11 ▼4.1733.87 ▼0.06
Add New Post /wp-admin/post-new.php1,522 ▼1123.37 ▲0.18677.74 ▲67.9158.57 ▲5.73
Media Library /wp-admin/upload.php1,404 ▲134.19 ▼0.03112.53 ▲11.1544.75 ▲1.80
Quote_Generator /wp-admin/options-general.php?page=quotegenerator8761.7328.6230.39

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie tables detected upon uninstall: 4 tables
    • wp_qg_calendar
    • wp_qg_invoices
    • wp_qg_orders
    • wp_qg_itemx
  • This plugin did not uninstall successfully, leaving 26 options in the database
    • setting_qgc13
    • setting_qgc3
    • setting_qgc5
    • can_compress_scripts
    • setting_qgc19
    • setting_qgc16
    • setting_qgc6
    • setting_qgc15
    • db_upgraded
    • widget_theysaidso_widget
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 17× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/quotegenerator/includes/orders.php:14
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/template.php): failed to open stream: No such file or directory in wp-content/plugins/quotegenerator/includes/metabox.php on line 3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/quotegenerator/includes/metabox.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/template.php' (include_path='.:/usr/share/php') in wp-content/plugins/quotegenerator/includes/metabox.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/quotegenerator/includes/invoices.php:13
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-config.php' (include_path='.:/usr/share/php') in wp-content/plugins/quotegenerator/qg-options.php on line 5
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/template.php' (include_path='.:/usr/share/php') in wp-content/plugins/quotegenerator/includes/metabox.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/quotegenerator/includes/calendar.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/quotegenerator/qg-settings.php:3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/quotegenerator/qg-options.php on line 5

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please take a look at the following user-side issues
    • > GET request to /wp-admin/options-general.php?page=quotegenerator
    • > Javascript (severe) in unknown
    /wp-content/plugins/quotegenerator/assets/js/qg_query.js 1673:12 Uncaught TypeError: $ is not a function

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Requires at least: Invalid version format
You can look at the official readme.txt

quotegenerator/quotegenerator.php Passed 13 tests

This is the main PHP file of "Quote Generator" version 3.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
55 characters long description:
Online quote (sales) and appointment scheduling plugin.

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
Good job! No executable or dangerous file extensions detected13,463 lines of code in 33 files:
LanguageFilesBlank linesComment linesLines of code
XML86508,035
JavaScript3464582,467
PHP19608632,198
CSS3655763

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity7.50
▷ Minimum class complexity3.00
▷ Maximum class complexity12.00
Average method complexity2.08
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods12
▷ Static methods216.67%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions990.00%
▷ Anonymous functions110.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
19 PNG files occupy 0.15MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/payment.png9.00KB3.84KB▼ 57.34%
assets/img/info.png4.05KB1.36KB▼ 66.40%
assets/img/arrowd.png1.30KB1.20KB▼ 7.31%
assets/img/order.png10.74KB4.20KB▼ 60.93%
assets/img/language.png1.55KB1.88KB0.00%