62% watu

Code Review | Watu Quiz

WordPress plugin Watu Quiz scored62%from 54 tests.

About plugin

  • Plugin page: watu
  • Plugin version: 3.4.0.2
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Oct 11, 2011
  • Latest release: Sep 7, 2023
  • Number of updates: 290
  • Update frequency: every 15.0 days
  • Top authors: prasunsen (100%)

Code review

54 tests

User reviews

132 reviews

Install metrics

5,000+ active /374,539 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.47MB] [CPU: ▼2.35ms] Passed 4 tests

Server-side resources used by Watu Quiz
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.93 ▲0.4747.59 ▼1.36
Dashboard /wp-admin3.77 ▲0.4753.44 ▲4.98
Posts /wp-admin/edit.php3.89 ▲0.5354.74 ▼0.42
Add New Post /wp-admin/post-new.php6.37 ▲0.4988.06 ▼12.59
Media Library /wp-admin/upload.php3.70 ▲0.4745.41 ▲8.92
Add/Edit Quiz /wp-admin/admin.php?page=watu_exam3.8039.14
Help & Support /wp-admin/admin.php?page=watu_help3.7039.11
Watu Quizzes /wp-admin/admin.php?page=watu_exams3.7140.14
Manage Questions /wp-admin/admin.php?page=watu_questions3.6437.58
Settings /wp-admin/admin.php?page=watu_options3.7443.62
Import Questions /wp-admin/admin.php?page=watu_import_questions3.6435.73
Manage Grades /wp-admin/admin.php?page=watu_grades3.6432.35
Social Sharing /wp-admin/admin.php?page=watu_social_sharing3.6839.03
Add/Edit Question /wp-admin/admin.php?page=watu_question3.6433.82
Quiz submissions /wp-admin/admin.php?page=watu_takings3.6436.29

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 56 new files
Database: 6 new tables, 6 new options
New tables
wp_watu_question
wp_watu_master
wp_watu_qcats
wp_watu_takings
wp_watu_grading
wp_watu_answer
New WordPress options
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Watu Quiz
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,919 ▲15813.84 ▼0.729.66 ▲7.7841.93 ▼4.53
Dashboard /wp-admin2,234 ▲635.59 ▲0.0684.84 ▼3.4344.15 ▲0.33
Posts /wp-admin/edit.php2,142 ▲422.00 ▼0.0138.81 ▲1.3037.29 ▲4.05
Add New Post /wp-admin/post-new.php1,561 ▲3523.08 ▼0.40678.94 ▲61.0059.24 ▼0.77
Media Library /wp-admin/upload.php1,442 ▲424.24 ▲0.04112.26 ▲12.6747.21 ▲3.72
Add/Edit Quiz /wp-admin/admin.php?page=watu_exam3,3228.32180.6788.11
Help & Support /wp-admin/admin.php?page=watu_help1,0942.0423.6430.88
Watu Quizzes /wp-admin/admin.php?page=watu_exams1,1282.0528.1443.54
Manage Questions /wp-admin/admin.php?page=watu_questions1,2382.0726.5132.08
Settings /wp-admin/admin.php?page=watu_options1,2641.6823.9133.46
Import Questions /wp-admin/admin.php?page=watu_import_questions8972.0526.2831.18
Manage Grades /wp-admin/admin.php?page=watu_grades7071.188.1712.03
Social Sharing /wp-admin/admin.php?page=watu_social_sharing9552.0223.6130.30
Add/Edit Question /wp-admin/admin.php?page=watu_question2,1477.90158.4349.41
Quiz submissions /wp-admin/admin.php?page=watu_takings1,2042.0723.5031.80

Uninstaller [IO: ▲0.00MB] [DB: ▲0.01MB] 50% 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
  • This plugin does not fully uninstall, leaving 6 tables in the database
    • wp_watu_takings
    • wp_watu_question
    • wp_watu_answer
    • wp_watu_qcats
    • wp_watu_grading
    • wp_watu_master
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • 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)
Please fix the following server-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=watu_takings
    • > Notice in wp-content/plugins/watu/views/takings.php+7
    Trying to get property 'name' of non-object
    • > GET request to /wp-admin/admin.php?page=watu_exam
    • > Notice in wp-content/plugins/watu/views/exam_form.php+33
    Trying to get property 'pull_random' of non-object
    • > GET request to /wp-admin/admin.php?page=watu_exam
    • > Notice in wp-content/plugins/watu/views/exam_form.php+47
    Trying to get property 'times_to_take' of non-object
    • > GET request to /wp-admin/admin.php?page=watu_exam
    • > Notice in wp-content/plugins/watu/views/exam_form.php+154
    Trying to get property 'description' of non-object
    • > GET request to /wp-admin/admin.php?page=watu_exam
    • > Notice in wp-content/plugins/watu/views/exam_form.php+170
    Trying to get property 'email_output' of non-object
    • > GET request to /wp-admin/admin.php?page=watu_exams
    • > Notice in wp-content/plugins/watu/views/exams.html.php+50
    Undefined variable: class
  • 14 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=watu_question
    • > Notice in wp-content/plugins/watu/views/question-form.html.php+208
    Undefined index: quiz
    • > GET request to /wp-admin/admin.php?page=watu_questions
    • > Notice in wp-content/plugins/watu/views/questions.html.php+118
    Undefined variable: bgcolor
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=watu_grades
    • > Notice in wp-content/plugins/watu/controllers/grades.php+8
    Undefined index: quiz_id
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=watu_takings
    • > Notice in wp-content/plugins/watu/views/takings.php+75
    Trying to get property 'ID' of non-object
    • > GET request to /wp-admin/admin.php?page=watu_question
    • > Notice in wp-content/plugins/watu/controllers/questions.php+190
    Undefined index: action
    • > GET request to /wp-admin/admin.php?page=watu_question
    • > Notice in wp-content/plugins/watu/views/question-form.html.php+172
    Undefined offset: 0
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=watu_question
    • > Notice in wp-content/plugins/watu/views/question-form.html.php+172
    Trying to get property 'correct' of non-object
    • > GET request to /wp-admin/admin.php?page=watu_question
    • > Notice in wp-content/plugins/watu/views/question-form.html.php+172
    Undefined offset: 1
    • > GET request to /wp-admin/admin.php?page=watu_question
    • > Notice in wp-content/plugins/watu/views/question-form.html.php+172
    Undefined offset: 2
    • > GET request to /wp-admin/admin.php?page=watu_question
    • > Notice in wp-content/plugins/watu/views/question-form.html.php+172
    Undefined offset: 3
    • > GET request to /wp-admin/admin.php?page=watu_question
    • > Notice in wp-content/plugins/watu/views/question-form.html.php+187
    Undefined variable: question
    • > GET request to /wp-admin/admin.php?page=watu_question
    • > Notice in wp-content/plugins/watu/views/question-form.html.php+187
    Trying to get property 'feedback' of non-object
    • > GET request to /wp-admin/admin.php?page=watu_question
    • > Notice in wp-content/plugins/watu/views/question-form.html.php+198
    Undefined variable: user_ID
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=watu_takings
    • > Notice in wp-content/plugins/watu/controllers/takings.php+160
    Undefined index: exam_id
    • > GET request to /wp-admin/admin.php?page=watu_takings
    • > Notice in wp-content/plugins/watu/controllers/takings.php+209
    Undefined index: dn
    • > GET request to /wp-admin/admin.php?page=watu_takings
    • > Notice in wp-content/plugins/watu/controllers/takings.php+209
    Undefined index: dnf
    • > GET request to /wp-admin/admin.php?page=watu_takings
    • > Notice in wp-content/plugins/watu/controllers/takings.php+209
    Undefined index: email
    • > GET request to /wp-admin/admin.php?page=watu_takings
    • > Notice in wp-content/plugins/watu/controllers/takings.php+210
    Undefined index: emailf
    • > GET request to /wp-admin/admin.php?page=watu_takings
    • > Notice in wp-content/plugins/watu/controllers/takings.php+210
    Undefined index: ip
    • > GET request to /wp-admin/admin.php?page=watu_takings
    • > Notice in wp-content/plugins/watu/controllers/takings.php+210
    Undefined index: ipf
    • > GET request to /wp-admin/admin.php?page=watu_takings
    • > Notice in wp-content/plugins/watu/controllers/takings.php+210
    Undefined index: date
    • > GET request to /wp-admin/admin.php?page=watu_takings
    • > Notice in wp-content/plugins/watu/controllers/takings.php+211
    Undefined index: datef
    • > GET request to /wp-admin/admin.php?page=watu_takings
    • > Notice in wp-content/plugins/watu/controllers/takings.php+211
    Undefined index: points
    • > GET request to /wp-admin/admin.php?page=watu_takings
    • > Notice in wp-content/plugins/watu/controllers/takings.php+211
    Undefined index: pointsf
    • > GET request to /wp-admin/admin.php?page=watu_takings
    • > Notice in wp-content/plugins/watu/controllers/takings.php+212
    Undefined index: grade_id
    • > GET request to /wp-admin/admin.php?page=watu_takings
    • > Notice in wp-content/plugins/watu/controllers/takings.php+212
    Undefined index: source_url

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
Please fix the following items
  • 21× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/watu/views/taking_details.html.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/watu/views/exam_form.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/watu/views/import.html.php:2
    • > PHP Notice
      Undefined variable: single_page in wp-content/plugins/watu/views/show_exam.html.php on line 1
    • > PHP Warning
      Use of undefined constant WATU_URL - assumed 'WATU_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/watu/views/taking_details.html.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/watu/views/show_exam.html.php:58
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/watu/views/show_exam.html.php on line 13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/watu/views/sidebar.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/watu/views/grades.html.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/watu/views/sharing-options.html.php:2

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)
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=watu_exam
    • > Network (severe)
    wp-content/plugins/watu/lib/images/ui-bg_flat_75_ffffff_40x100.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=watu_questions
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: jQuery(...).sortable is not a function" "TypeError: jQuery(...).sortable is not a function\n at HTMLDocument.\u003Canonymous> (/wp-admin/admin.php?page=watu_questions:356:31)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=watu_questions
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: jQuery(...).sortable is not a function

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Screenshots: These screenshots require images: #1 (List of your exams with shortcodes for embedding in posts or pages), #2 (The form for creating and editing an exam/test), #3 (You can add unlimited number of questions in each quiz or exam, and each question can be of single-answer, multiple-answer, or open-end type.)
  • Screenshots: Add descriptions for screenshots #4, #5 in watu/assets to your readme.txt
You can take inspiration from this readme.txt

watu/watu.php 85% from 13 tests

"Watu Quiz" version 3.4.0.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Domain Path: The domain path folder was not found ("/languages")
  • Description: Keep the plugin description shorter than 140 characters (currently 491 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin11,484 lines of code in 37 files:
LanguageFilesBlank linesComment linesLines of code
PO File62,4222,4667,330
PHP287132773,307
CSS28085610
JavaScript15622237

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.54
Average class complexity17.80
▷ Minimum class complexity4.00
▷ Maximum class complexity30.00
Average method complexity8.64
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods11
▷ Static methods1090.91%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions49
▷ Named functions49100.00%
▷ Anonymous functions00.00%
Constants12
▷ Global constants12100.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
8 PNG files occupy 0.07MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
wrong.png0.64KB0.72KB0.00%
img/share/facebook.png1.89KB0.74KB▼ 60.82%
img/arrow-down.png0.24KB0.25KB0.00%
correct.png0.52KB0.52KB0.00%
screenshot-3.png16.18KB6.54KB▼ 59.61%