56% university-quizzes-online

Code Review | University quizzes online

WordPress plugin University quizzes online scored56%from 54 tests.

About plugin

  • Plugin page: university-quizze...
  • Plugin version: 1.4
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Feb 19, 2021
  • Latest release: Apr 18, 2022
  • Number of updates: 12
  • Update frequency: every 35.3 days
  • Top authors: oleksandr87 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /706 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
Install script ran successfully

Server metrics [RAM: ▼0.20MB] [CPU: ▼18.18ms] Passed 4 tests

An overview of server-side resources used by University quizzes online
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.42 ▼0.0524.69 ▼13.95
Dashboard /wp-admin3.10 ▼0.2128.71 ▼22.07
Posts /wp-admin/edit.php3.23 ▼0.1334.84 ▼11.72
Add New Post /wp-admin/post-new.php5.48 ▼0.4170.57 ▼24.99
Media Library /wp-admin/upload.php3.18 ▼0.0526.23 ▼9.81
University quizzes online /wp-admin/admin.php?page=universityquizzesonline3.0826.74
Courses /wp-admin/admin.php?page=universityquizzesonline_courses3.0833.39
Edit Course /wp-admin/admin.php?page=universityquizzesonline_course_edit3.0824.79
Questions /wp-admin/admin.php?page=universityquizzesonline_questions3.0825.74
Edit Course /wp-admin/admin.php?page=universityquizzesonline_question_edit3.0826.42

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 17 new files
Database: 3 new tables, 7 new options
New tables
wp_squizmagicstar_attempts
wp_squizmagicstar_courses
wp_squizmagicstar_questions
New WordPress options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
jal_db_version
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for University quizzes online
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,831 ▲6014.74 ▲0.171.75 ▼0.1647.63 ▲7.29
Dashboard /wp-admin2,234 ▲435.84 ▲0.9094.30 ▼10.3137.14 ▼5.87
Posts /wp-admin/edit.php2,120 ▲342.18 ▲0.2136.62 ▼0.2333.85 ▲0.34
Add New Post /wp-admin/post-new.php1,539 ▲2017.51 ▼5.60673.13 ▲71.5251.36 ▼0.38
Media Library /wp-admin/upload.php1,413 ▲254.18 ▼0.0497.38 ▼7.0740.67 ▼4.98
University quizzes online /wp-admin/admin.php?page=universityquizzesonline1,4529.09275.3194.92
Courses /wp-admin/admin.php?page=universityquizzesonline_courses1,2771.7225.7629.48
Edit Course /wp-admin/admin.php?page=universityquizzesonline_course_edit7892.0222.5425.34
Questions /wp-admin/admin.php?page=universityquizzesonline_questions1,2161.7225.6525.88
Edit Course /wp-admin/admin.php?page=universityquizzesonline_question_edit7922.0423.1224.41

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The uninstall procedure failed, leaving 3 tables in the database
    • wp_squizmagicstar_questions
    • wp_squizmagicstar_courses
    • wp_squizmagicstar_attempts
  • This plugin does not fully uninstall, leaving 7 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • jal_db_version
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=universityquizzesonline_question_edit
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, function 'squizmagicstarscripts_admin' not found or invalid function name
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=universityquizzesonline_questions
    • > Notice in wp-content/plugins/university-quizzes-online/s_universityquizzesonline_menu_questions.php+149
    Undefined index: wp_qms_per_page_now
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=universityquizzesonline_courses
    • > Notice in wp-content/plugins/university-quizzes-online/s_universityquizzesonline_menu_courses.php+39
    Undefined index: wp_qmsa_course_search_name
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=universityquizzesonline_courses
    • > Notice in wp-content/plugins/university-quizzes-online/s_universityquizzesonline_menu_courses.php+40
    Undefined index: wp_qmsa_course_search_active
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=universityquizzesonline_questions
    • > Notice in wp-content/plugins/university-quizzes-online/s_universityquizzesonline_menu_questions.php+205
    Undefined index: orderby
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=universityquizzesonline_questions
    • > Notice in wp-content/plugins/university-quizzes-online/s_universityquizzesonline_menu_questions.php+206
    Undefined index: order
    • > GET request to /wp-admin/admin.php?page=universityquizzesonline_courses
    • > Notice in wp-content/plugins/university-quizzes-online/s_universityquizzesonline_menu_courses.php+268
    Undefined variable: wp_qms_search_active_db
    • > GET request to /wp-admin/admin.php?page=universityquizzesonline_courses
    • > Notice in wp-content/plugins/university-quizzes-online/s_universityquizzesonline_menu_courses.php+268
    Undefined variable: wpqmssearchnamedb
    • > GET request to /wp-admin/admin.php?page=universityquizzesonline_courses
    • > Notice in wp-content/plugins/university-quizzes-online/s_universityquizzesonline_menu_courses.php+268
    Undefined variable: qadmin_orderby_new
    • > GET request to /wp-admin/admin.php?page=universityquizzesonline_courses
    • > Warning in wp-content/plugins/university-quizzes-online/s_universityquizzesonline_menu_courses.php+284
    count(): Parameter must be an array or an object that implements Countable
    • > GET request to /wp-admin/admin.php?page=universityquizzesonline_course_edit
    • > Notice in wp-content/plugins/university-quizzes-online/s_universityquizzesonline_menu_course_edit.php+7
    Undefined index: id_course
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=universityquizzesonline_questions
    • > Notice in wp-content/plugins/university-quizzes-online/s_universityquizzesonline_menu_questions.php+43
    Undefined index: wp_qmsa_question_search_name
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=universityquizzesonline_questions
    • > Notice in wp-content/plugins/university-quizzes-online/s_universityquizzesonline_menu_questions.php+44
    Undefined index: wp_qmsa_question_search_course
    • > GET request to /wp-admin/admin.php?page=universityquizzesonline_questions
    • > Warning in wp-content/plugins/university-quizzes-online/s_universityquizzesonline_menu_questions.php+250
    Use of undefined constant wp_qms_questions_hidden - assumed 'wp_qms_questions_hidden' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/admin.php?page=universityquizzesonline_questions
    • > Notice in wp-content/plugins/university-quizzes-online/s_universityquizzesonline_menu_questions.php+262
    Undefined variable: wp_qms_search_course_iddb
    • > GET request to /wp-admin/admin.php?page=universityquizzesonline_questions
    • > Notice in wp-content/plugins/university-quizzes-online/s_universityquizzesonline_menu_questions.php+262
    Undefined variable: wp_qms_search_question_namedb
    • > GET request to /wp-admin/admin.php?page=universityquizzesonline_questions
    • > Notice in wp-content/plugins/university-quizzes-online/s_universityquizzesonline_menu_questions.php+262
    Undefined variable: qadmin_qmsedit_orderby_new
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=universityquizzesonline_questions
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=universityquizzesonline_questions
    • > Warning in wp-admin/includes/class-wp-list-table.php+1389
    in_array() expects parameter 2 to be array, string given
    • > GET request to /wp-admin/admin.php?page=universityquizzesonline_question_edit
    • > Notice in wp-content/plugins/university-quizzes-online/s_universityquizzesonline_menu_question_edit.php+6
    Undefined index: id_question

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
Almost there! Just fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/university-quizzes-online/s_universityquizzesonline_menu_main.php
  • 15× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_var() on null in wp-content/plugins/university-quizzes-online/s_universityquizzesonline_only_courses.php:8
    • > PHP Notice
      Undefined variable: quiz_ms_atts in wp-content/plugins/university-quizzes-online/s_universityquizzesonline_only_courses.php on line 5
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/university-quizzes-online/s_universityquizzesonline_free_courses.php on line 3
    • > PHP Warning
      Use of undefined constant id - assumed 'id' (this will throw an Error in a future version of PHP) in wp-content/plugins/university-quizzes-online/s_universityquizzesonline_only_courses.php on line 5
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/university-quizzes-online/s_universityquizzesonline_menu_questions.php on line 3
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/university-quizzes-online/s_universityquizzesonline_only_courses.php on line 3
    • > PHP Notice
      Undefined index: id_course in wp-content/plugins/university-quizzes-online/s_universityquizzesonline_free_courses.php on line 5
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/university-quizzes-online/s_universityquizzesonline_menu_questions.php on line 3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/university-quizzes-online/s_universityquizzesonline_menu_courses.php on line 3
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/university-quizzes-online/s_universityquizzesonline_only_courses.php on line 5

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
These are user-side errors you should fix
    • > GET request to /wp-admin/admin.php?page=universityquizzesonline_questions
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=universityquizzesonline_questions 143:69 Uncaught SyntaxError: Unexpected token ';'

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Requires at least: Version not formatted correctly
  • Screenshots: Screenshot #1 (Screenshot 2) image not found
You can look at the official readme.txt

university-quizzes-online/s_universityquizzesonline.php 85% from 13 tests

The entry point to "University quizzes online" version 1.4 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("university-quizzes-online.php" instead of "s_universityquizzesonline.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 149 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected2,299 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP14490632,299

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity33.00
▷ Minimum class complexity31.00
▷ Maximum class complexity35.00
Average method complexity5.57
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods14
▷ Static methods00.00%
▷ Public methods14100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions17
▷ Named functions17100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png13.01KB7.99KB▼ 38.56%
screenshot-2.png6.77KB4.37KB▼ 35.52%