52% wp-quiz

Code Review | Best Quiz Plugin for WordPress: WP Quiz

WordPress plugin Best Quiz Plugin for WordPress: WP Quiz scored52%from 54 tests.

About plugin

  • Plugin page: wp-quiz
  • Plugin version: 2.0.10
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-5.9.1
  • WordPress version: 6.3.1
  • First release: Sep 2, 2016
  • Latest release: Mar 17, 2022
  • Number of updates: 61
  • Update frequency: every 33.2 days
  • Top authors: MyThemeShop (100%)

Code review

54 tests

User reviews

58 reviews

Install metrics

6,000+ active /279,732 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.64MB] [CPU: ▼20.99ms] Passed 4 tests

Analyzing server-side resources used by Best Quiz Plugin for WordPress: WP Quiz
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.44 ▲0.9746.27 ▲7.84
Dashboard /wp-admin4.72 ▲1.4139.19 ▼9.51
Posts /wp-admin/edit.php4.72 ▲1.3636.36 ▼11.04
Add New Post /wp-admin/post-new.php4.72 ▼1.1734.75 ▼64.17
Media Library /wp-admin/upload.php4.72 ▲1.4934.59 ▲0.75
Add new quiz /wp-admin/admin.php?page=wp-quiz-new4.7232.37
Import/Export /wp-admin/edit.php?post_type=wp_quiz&page=wp_quiz_ie4.7231.44
All Quizzes /wp-admin/edit.php?post_type=wp_quiz4.7233.13
Add New Quiz /wp-admin/post-new.php?post_type=wp_quiz4.7231.94

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 575 new files
Database: 1 new table, 8 new options
New tables
wp_wp_quiz_play_data
New WordPress options
wp_quiz_old_slug
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-comments
widget_recent-posts
wp_quiz_db_version
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Best Quiz Plugin for WordPress: WP Quiz
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,838 ▲9213.31 ▼0.901.88 ▲0.1545.80 ▲2.77
Dashboard /wp-admin2,237 ▲464.88 ▼0.02107.19 ▲5.1140.44 ▼3.32
Posts /wp-admin/edit.php2,120 ▲282.06 ▲0.0439.55 ▼2.0234.75 ▼2.03
Add New Post /wp-admin/post-new.php1,562 ▲4823.37 ▲5.79659.74 ▲41.8155.82 ▲3.71
Media Library /wp-admin/upload.php1,416 ▲314.24 ▲0.0295.02 ▼4.9042.51 ▼0.14
Add new quiz /wp-admin/admin.php?page=wp-quiz-new8342.0623.4323.99
Import/Export /wp-admin/edit.php?post_type=wp_quiz&page=wp_quiz_ie1,0111.8831.0531.98
All Quizzes /wp-admin/edit.php?post_type=wp_quiz1,1091.9329.8430.47
Add New Quiz /wp-admin/post-new.php?post_type=wp_quiz9111.8629.0728.27

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Uninstall procedure validation failed for this plugin
    • > Warning in wp-content/plugins/wp-quiz/vendor/cmb2/cmb2/includes/helper-functions.php+44
    include_once(wp-content/plugins/wp-quiz/vendor/cmb2/cmb2/includes/CMB2_Hookup.php): failed to open stream: No such file or directory
  • Zombie tables were found after uninstall: 1 table
    • wp_wp_quiz_play_data
  • This plugin does not fully uninstall, leaving 8 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • wp_quiz_db_version
    • wp_quiz_old_slug
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded

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 errors were triggered by the plugin
  • 24 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=wp_quiz
    • > Warning in wp-content/plugins/wp-quiz/vendor/cmb2/cmb2/includes/helper-functions.php+44
    include_once(wp-content/plugins/wp-quiz/vendor/cmb2/cmb2/includes/CMB2_Hookup.php): failed to open stream: No such file or directory
  • 24 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=wp_quiz
    • > Warning in wp-content/plugins/wp-quiz/vendor/cmb2/cmb2/includes/helper-functions.php+44
    include_once(): Failed opening 'wp-content/plugins/wp-quiz/vendor/cmb2/cmb2/includes/CMB2_Hookup.php' for inclusion (include_path='.:/usr/share/php')
  • 24 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=wp_quiz
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, class 'CMB2_Hookup' not found

SRP 0% 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
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wp-quiz/templates/global/progress-bar.php
    • > /wp-content/plugins/wp-quiz/templates/global/quiz-close.php
  • 139× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Undefined variable: quiz in wp-content/plugins/wp-quiz/templates/quiz-types/flip/questions/question.php on line 13
    • > PHP Notice
      Undefined variable: cmb in wp-content/plugins/wp-quiz/includes/Admin/views/quiz-types/trivia/tab-content.php on line 10
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/wp-quiz/vendor/cmb2/cmb2/includes/types/CMB2_Type_Text_Datetime_Timestamp_Timezone.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/wp-quiz/vendor/cmb2/cmb2/includes/types/CMB2_Type_Checkbox.php:13
    • > PHP Notice
      Undefined variable: cmb in wp-content/plugins/wp-quiz/includes/Admin/views/quiz-types/trivia/tab-settings.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_quiz_type() on null in wp-content/plugins/wp-quiz/templates/quiz-types/personality/questions/question.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WPQuiz\\Modules\\Subscription\\MailServices\\MailService' not found in wp-content/plugins/wp-quiz/includes/Modules/Subscription/MailServices/GetResponse.php:16
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_setting() on null in wp-content/plugins/wp-quiz/templates/quiz-types/flip/custom-css.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text_Date' not found in wp-content/plugins/wp-quiz/vendor/cmb2/cmb2/includes/types/CMB2_Type_Text_Time.php:13
    • > PHP Fatal error
      Uncaught Error: Call to a member function add_field() on null in wp-content/plugins/wp-quiz/includes/Admin/views/quiz-types/personality/tab-content.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Tags: You are using too many tags: 12 tag instead of maximum 10
The official readme.txt is a good inspiration

wp-quiz/wp-quiz.php 92% from 13 tests

"Best Quiz Plugin for WordPress: WP Quiz" version 2.0.10's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 177 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected64,128 lines of code in 406 files:
LanguageFilesBlank linesComment linesLines of code
PO File12014,31518,50232,323
PHP1753,93611,01515,503
CSS207871,2047,515
Sass47882663,838
JavaScript338161,0833,601
Markdown42770865
JSON610469
SVG12014

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity15.63
▷ Minimum class complexity1.00
▷ Maximum class complexity188.00
Average method complexity2.92
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces17
Interfaces0
Traits2
Classes128
▷ Abstract classes1410.94%
▷ Concrete classes11489.06%
▷ Final classes00.00%
Methods996
▷ Static methods16916.97%
▷ Public methods80480.72%
▷ Protected methods18718.78%
▷ Private methods50.50%
Functions39
▷ Named functions3692.31%
▷ Anonymous functions37.69%
Constants17
▷ Global constants423.53%
▷ Class constants1376.47%
▷ Public constants13100.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
20 PNG files occupy 0.06MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/cmb2/cmb2/images/ui-bg_flat_0_aaaaaa_40x100.png0.18KB0.08KB▼ 51.67%
assets/admin/images/dropdown.png1.21KB0.15KB▼ 87.33%
vendor/cmb2/cmb2/images/ui-bg_glass_75_e6e6e6_1x400.png0.11KB0.14KB0.00%
includes/libs/cmb-field-select2/screenshot-3.png3.22KB3.26KB0.00%
assets/frontend/images/spritesheet.png9.69KB5.37KB▼ 44.52%