68% n-media-wp-simple-quiz

Code Review | Easy Quiz Maker

WordPress plugin Easy Quiz Maker scored68%from 54 tests.

About plugin

  • Plugin page: n-media-wp-simple...
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.1.1
  • WordPress version: 6.3.1
  • First release: Dec 28, 2018
  • Latest release: Feb 22, 2023
  • Number of updates: 20
  • Update frequency: every 75.9 days
  • Top authors: nmedia (90%)ansarbhatti (15%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /7,315 total downloads

Benchmarks

Plugin footprint 65% 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 gracefully, with no errors

Server metrics [RAM: ▼0.69MB] [CPU: ▼37.31ms] Passed 4 tests

An overview of server-side resources used by Easy Quiz Maker
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.2043.02 ▲3.57
Dashboard /wp-admin3.25 ▼0.0525.78 ▼25.67
Posts /wp-admin/edit.php3.25 ▼0.1124.66 ▼26.31
Add New Post /wp-admin/post-new.php3.25 ▼2.6425.12 ▼83.45
Media Library /wp-admin/upload.php3.25 ▲0.0224.60 ▼13.80
WP Simple Quiz /wp-admin/edit.php?post_type=wqt3.2523.57
Result /wp-admin/edit.php?post_type=wqt_result3.2526.12

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 117 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Easy Quiz Maker
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲6614.39 ▼0.371.91 ▲0.4045.11 ▲4.62
Dashboard /wp-admin2,206 ▲265.55 ▼0.1092.67 ▲4.2979.22 ▲34.10
Posts /wp-admin/edit.php2,126 ▲292.00 ▼0.0236.51 ▼0.2832.43 ▼3.79
Add New Post /wp-admin/post-new.php1,561 ▲3523.15 ▼0.05722.82 ▲22.8649.39 ▼6.13
Media Library /wp-admin/upload.php1,417 ▲174.18 ▼0.0595.41 ▼22.9483.01 ▲34.59
WP Simple Quiz /wp-admin/edit.php?post_type=wqt1,1351.9331.0429.96
Result /wp-admin/edit.php?post_type=wqt_result1,1021.9630.1729.12

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • The plugin did not uninstall gracefully
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% 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
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=wqt_result
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)

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
  • 19× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/n-media-wp-simple-quiz/inc/shortcodes.php
    • > /wp-content/plugins/n-media-wp-simple-quiz/templates/shortcodes/quiz-rander.php
    • > /wp-content/plugins/n-media-wp-simple-quiz/templates/admin/result-print-pdf.php
    • > /wp-content/plugins/n-media-wp-simple-quiz/templates/admin/quiz-result-email.php
    • > /wp-content/plugins/n-media-wp-simple-quiz/templates/admin/submit-member-list.php
    • > /wp-content/plugins/n-media-wp-simple-quiz/templates/admin/user-info.php
    • > /wp-content/plugins/n-media-wp-simple-quiz/templates/admin/quiz-result.php
    • > /wp-content/plugins/n-media-wp-simple-quiz/inc/cpt.php
    • > /wp-content/plugins/n-media-wp-simple-quiz/inc/helpers.php
    • > /wp-content/plugins/n-media-wp-simple-quiz/templates/admin/quiz-form-style.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues 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 need to be fixed:
  • Tags: Please reduce the number of tags, currently 21 tag instead of maximum 10
Please take inspiration from this readme.txt

n-media-wp-simple-quiz/wp-simple-quiz.php 85% from 13 tests

This is the main PHP file of "Easy Quiz Maker" version 2.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("n-media-wp-simple-quiz.php" instead of "wp-simple-quiz.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin22,456 lines of code in 76 files:
LanguageFilesBlank linesComment linesLines of code
CSS112431335,691
SVG4035,435
JavaScript71,2623264,860
PHP235822151,788
Sass1434341,768
LESS1434441,758
PO File34054231,156

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity6.00
▷ Minimum class complexity1.00
▷ Maximum class complexity12.00
Average method complexity1.37
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods41
▷ Static methods24.88%
▷ Public methods41100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions35
▷ Named functions35100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
15 PNG files occupy 0.07MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/ui/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.27KB0.18KB▼ 35.00%
css/ui/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png0.20KB0.09KB▼ 57.49%
css/ui/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png0.26KB0.16KB▼ 38.93%
css/ui/css/smoothness/images/ui-icons_454545_256x240.png6.83KB4.17KB▼ 38.86%
css/ui/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png0.32KB0.15KB▼ 54.82%