84% advanced-quiz

Code Review | Wp-Adv-Quiz

WordPress plugin Wp-Adv-Quiz scored84%from 54 tests.

About plugin

  • Plugin page: advanced-quiz
  • Plugin version: 1.0.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.3
  • WordPress version: 6.3.1
  • First release: Feb 3, 2022
  • Latest release: Sep 3, 2023
  • Number of updates: 33
  • Update frequency: every 17.5 days
  • Top authors: markusbegerow (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active /2,006 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
Install script ran successfully

Server metrics [RAM: ▲0.14MB] [CPU: ▼2.09ms] Passed 4 tests

Analyzing server-side resources used by Wp-Adv-Quiz
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0839.09 ▼0.78
Dashboard /wp-admin3.50 ▲0.2047.99 ▼2.96
Posts /wp-admin/edit.php3.58 ▲0.2246.92 ▼1.26
Add New Post /wp-admin/post-new.php5.96 ▲0.0783.28 ▼3.37
Media Library /wp-admin/upload.php3.48 ▲0.2536.14 ▲0.09
WP-Adv-Quiz /wp-admin/admin.php?page=wpAdvQuiz3.6042.52
Global settings /wp-admin/admin.php?page=wpAdvQuiz_glSettings3.5349.14
Support & More /wp-admin/admin.php?page=wpAdvQuiz_waq_support3.3431.34

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 163 new files
Database: 10 new tables, 8 new options
New tables
wp_wp_adv_quiz_toplist
wp_wp_adv_quiz_statistic_ref
wp_wp_adv_quiz_master
wp_wp_adv_quiz_lock
wp_wp_adv_quiz_question
wp_wp_adv_quiz_category
wp_wp_adv_quiz_statistic
wp_wp_adv_quiz_template
wp_wp_adv_quiz_form
wp_wp_adv_quiz_prerequisite
New WordPress options
widget_theysaidso_widget
wpAdvQuiz_dbVersion
widget_recent-posts
wpAdvQuiz_version
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Wp-Adv-Quiz
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,937 ▲19113.67 ▼1.015.28 ▲3.5844.31 ▲0.07
Dashboard /wp-admin2,234 ▲465.82 ▲0.9195.97 ▼12.5837.99 ▲0.37
Posts /wp-admin/edit.php2,123 ▲342.05 ▲0.0035.26 ▼4.9834.83 ▼2.69
Add New Post /wp-admin/post-new.php6,205 ▲4,67226.29 ▲3.13926.94 ▲213.1862.89 ▲14.96
Media Library /wp-admin/upload.php1,416 ▲254.20 ▼0.00103.40 ▲3.3846.64 ▲3.22
WP-Adv-Quiz /wp-admin/admin.php?page=wpAdvQuiz1,2942.0447.3233.41
Global settings /wp-admin/admin.php?page=wpAdvQuiz_glSettings1,7902.1541.7524.31
Support & More /wp-admin/admin.php?page=wpAdvQuiz_waq_support8641.9326.1029.03

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 72× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WpAdvQuiz_Controller_Controller' not found in wp-content/plugins/advanced-quiz/lib/controller/WpAdvQuiz_Controller_StyleManager.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WpAdvQuiz_Controller_Controller' not found in wp-content/plugins/advanced-quiz/lib/controller/WpAdvQuiz_Controller_ImportExport.php:3
    • > PHP Fatal error
      Uncaught Error: Interface 'WpAdvQuiz_Helper_QuestionImpoterInterface' not found in wp-content/plugins/advanced-quiz/lib/helper/WpAdvQuiz_Helper_JsonQuestionImporter.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WpAdvQuiz_Model_Mapper' not found in wp-content/plugins/advanced-quiz/lib/model/WpAdvQuiz_Model_TemplateMapper.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WpAdvQuiz_Model_Mapper' not found in wp-content/plugins/advanced-quiz/lib/model/WpAdvQuiz_Model_StatisticMapper.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WpAdvQuiz_View_View' not found in wp-content/plugins/advanced-quiz/lib/view/WpAdvQuiz_View_QuizOverall.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WpAdvQuiz_Model_Mapper' not found in wp-content/plugins/advanced-quiz/lib/model/WpAdvQuiz_Model_LockMapper.php:3
    • > PHP Fatal error
      Uncaught Error: Interface 'WpAdvQuiz_Helper_StatisticExporterInterface' not found in wp-content/plugins/advanced-quiz/lib/helper/WpAdvQuiz_Helper_ExcelStatisticExporter.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WpAdvQuiz_Model_Model' not found in wp-content/plugins/advanced-quiz/lib/model/WpAdvQuiz_Model_Toplist.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WpAdvQuiz_Model_Model' not found in wp-content/plugins/advanced-quiz/lib/model/WpAdvQuiz_Model_Template.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
9 plugin tags: answer, score, assessment, quiz, learning...

advanced-quiz/wp-adv-quiz.php 85% from 13 tests

The primary PHP file in "Wp-Adv-Quiz" version 1.0.2 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("advanced-quiz.php" instead of "wp-adv-quiz.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected25,155 lines of code in 118 files:
LanguageFilesBlank linesComment linesLines of code
PHP1044,15492818,148
JavaScript91,1311,0635,005
PO File15321,0401,443
CSS3985516
Markdown18043

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity16.22
▷ Minimum class complexity1.00
▷ Maximum class complexity175.00
Average method complexity2.59
▷ Minimum method complexity1.00
▷ Maximum method complexity56.00
Code structure
Namespaces0
Interfaces5
Traits0
Classes97
▷ Abstract classes00.00%
▷ Concrete classes97100.00%
▷ Final classes00.00%
Methods983
▷ Static methods535.39%
▷ Public methods72073.25%
▷ Protected methods11311.50%
▷ Private methods15015.26%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants48
▷ Global constants918.75%
▷ Class constants3981.25%
▷ Public constants39100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
39 PNG files occupy 0.33MB with 0.15MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/formStatisticOverview.png38.97KB19.25KB▼ 50.61%
img/hideAnswerMessageBox.png13.65KB5.49KB▼ 59.75%
css/images/ui-bg_glass_55_fbf9ee_1x400.png0.33KB0.12KB▼ 62.09%
img/questionOverview.png10.75KB4.91KB▼ 54.35%
css/images/ui-icons_2e83ff_256x240.png4.44KB4.17KB▼ 6.02%