72% hd-quiz-limit-attempts

Code Review | HD Quiz - Limit Attempts

WordPress plugin HD Quiz - Limit Attempts scored72%from 54 tests.

About plugin

  • Plugin page: hd-quiz-limit-att...
  • Plugin version: 0.4
  • PHP compatiblity: 5.6.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.3
  • WordPress version: 6.3.1
  • First release: Jan 24, 2023
  • Latest release: Oct 18, 2023
  • Number of updates: 9
  • Update frequency: every 29.7 days
  • Top authors: Harmonic_Design (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /833 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼4.33ms] Passed 4 tests

An overview of server-side resources used by HD Quiz - Limit Attempts
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0239.40 ▲3.18
Dashboard /wp-admin3.32 ▲0.0244.36 ▼4.13
Posts /wp-admin/edit.php3.37 ▲0.0242.44 ▼5.45
Add New Post /wp-admin/post-new.php5.90 ▲0.0291.66 ▼7.46
Media Library /wp-admin/upload.php3.24 ▲0.0234.20 ▼0.26
Limit Attempts /wp-admin/admin.php?page=hdq_limit3.2435.78

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

HD Quiz - Limit Attempts: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.23 ▼0.171.66 ▲0.1943.88 ▲3.98
Dashboard /wp-admin2,195 ▲175.54 ▼0.1481.32 ▼25.9438.43 ▼7.16
Posts /wp-admin/edit.php2,097 ▼62.00 ▲0.0636.32 ▼3.7534.82 ▲0.40
Add New Post /wp-admin/post-new.php1,537 ▲118.57 ▲0.42590.18 ▼24.0186.33 ▲24.08
Media Library /wp-admin/upload.php1,403 ▲64.18 ▼0.0695.62 ▼5.5939.76 ▼4.24
Limit Attempts /wp-admin/admin.php?page=hdq_limit1,6946.74142.72113.24

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget

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)
Smoke test failed, please fix the following
    • > GET request to /wp-admin/admin.php?page=hdq_limit
    • > Warning in wp-content/plugins/hd-quiz-limit-attempts/includes/limit.php+14
    Use of undefined constant HDQ_PLUGIN_VERSION - assumed 'HDQ_PLUGIN_VERSION' (this will throw an Error in a future version of PHP)

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/hd-quiz-limit-attempts/index.php
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_style() in wp-content/plugins/hd-quiz-limit-attempts/includes/limit.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/hd-quiz-limit-attempts/includes/functions.php:44

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Tags: There are too many tags (13 tag instead of maximum 10)
The official readme.txt is a good inspiration

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

"HD Quiz - Limit Attempts" version 0.4's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("hd-quiz-limit-attempts.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin2,037 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP5161531,072
JavaScript2237567
CSS1749398

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity52.50
▷ Minimum class complexity25.00
▷ Maximum class complexity80.00
Average method complexity3.10
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods49
▷ Static methods00.00%
▷ Public methods1734.69%
▷ Protected methods00.00%
▷ Private methods3265.31%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
includes/web-logo.png7.63KB2.65KB▼ 65.33%