78% hd-quiz

Code Review | HD Quiz

WordPress plugin HD Quiz scored78%from 54 tests.

About plugin

  • Plugin page: hd-quiz
  • Plugin version: 1.8.11
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Oct 2, 2015
  • Latest release: Nov 25, 2023
  • Number of updates: 171
  • Update frequency: every 17.4 days
  • Top authors: Harmonic_Design (100%)

Code review

54 tests

User reviews

123 reviews

Install metrics

7,000+ active /161,688 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.54MB] [CPU: ▲3.83ms] Passed 4 tests

This is a short check of server-side resources used by HD Quiz
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.05 ▲0.5945.25 ▲4.96
Dashboard /wp-admin3.87 ▲0.5751.07 ▼1.40
Posts /wp-admin/edit.php3.92 ▲0.5749.78 ▲5.19
Add New Post /wp-admin/post-new.php6.39 ▲0.5191.27 ▲6.57
Media Library /wp-admin/upload.php3.73 ▲0.5044.72 ▲8.09
Addons /wp-admin/admin.php?page=hdq_addons3.77356.78
Tools /wp-admin/admin.php?page=hdq_tools3.7032.85
Quizzes /wp-admin/admin.php?page=hdq_quizzes3.7639.04
About / Options /wp-admin/admin.php?page=hdq_options3.7138.62

Server storage [IO: ▲0.33MB] [DB: ▲0.07MB] Passed 3 tests

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 46 new files
Database: no new tables, 9 new options
New WordPress options
db_upgraded
widget_recent-comments
hdq_new_addon
can_compress_scripts
hdq_data_upgraded
theysaidso_admin_options
HDQ_PLUGIN_VERSION
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for HD Quiz
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,823 ▲7614.01 ▼0.701.72 ▲0.0644.62 ▲1.63
Dashboard /wp-admin2,231 ▲565.63 ▼0.0282.64 ▼29.8336.58 ▼9.87
Posts /wp-admin/edit.php2,139 ▲391.99 ▲0.0237.28 ▲0.9633.10 ▼5.03
Add New Post /wp-admin/post-new.php6,390 ▲4,86427.67 ▲6.44919.35 ▲256.8355.55 ▲2.47
Media Library /wp-admin/upload.php1,433 ▲394.27 ▲0.0794.05 ▼3.5539.80 ▼1.96
Addons /wp-admin/admin.php?page=hdq_addons1,0141.8027.6859.84
Tools /wp-admin/admin.php?page=hdq_tools9261.8726.6545.58
Quizzes /wp-admin/admin.php?page=hdq_quizzes1,4376.85125.2272.25
About / Options /wp-admin/admin.php?page=hdq_options1,2721.7728.1070.98

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 9 options
    • hdq_data_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • hdq_new_addon
    • widget_recent-posts
    • HDQ_PLUGIN_VERSION
    • 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 0% 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 return non-empty strings:
    • > /wp-content/plugins/hd-quiz/index.php
  • 18× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_style() in wp-content/plugins/hd-quiz/includes/template.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function hdq_user_permission() in wp-content/plugins/hd-quiz/includes/hdq_quizzes.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_the_title() in wp-content/plugins/hd-quiz/includes/templates/title.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/hd-quiz/includes/addons.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/hd-quiz/includes/tools.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function hdq_print_question_title() in wp-content/plugins/hd-quiz/includes/templates/image.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/hd-quiz/includes/post-type.php:49
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/hd-quiz/includes/tools/csv_import.php:284
    • > PHP Fatal error
      Uncaught Error: Call to undefined function hdq_print_question_title() in wp-content/plugins/hd-quiz/includes/templates/select-all-text.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function hdq_user_permission() in wp-content/plugins/hd-quiz/includes/settings/questions.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Screenshots: A description for screenshot #5 is missing in hd-quiz/assets to your readme.txt
  • Tags: You are using too many tags: 17 tag instead of maximum 10
You can look at the official readme.txt

hd-quiz/index.php 92% from 13 tests

The main file in "HD Quiz" v. 1.8.11 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("hd-quiz.php" instead of "index.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
There were no executable files found in this plugin8,337 lines of code in 39 files:
LanguageFilesBlank linesComment linesLines of code
PHP325502454,460
JavaScript5162852,308
CSS227841,569

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity9.00
▷ Minimum class complexity9.00
▷ Maximum class complexity9.00
Average method complexity3.67
▷ Minimum method complexity2.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods3
▷ Static methods00.00%
▷ Public methods3100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions122
▷ Named functions12199.18%
▷ Anonymous functions10.82%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
5 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/images/hd-logo.png2.88KB2.84KB▼ 1.43%
includes/images/hd_patreon.png11.12KB9.14KB▼ 17.76%
includes/images/fbshare.png3.47KB2.29KB▼ 34.08%
includes/images/share.png1.81KB1.74KB▼ 3.89%
includes/images/twshare.png5.31KB2.04KB▼ 61.52%