68% chained-quiz

Code Review | Chained Quiz

WordPress plugin Chained Quiz scored68%from 54 tests.

About plugin

  • Plugin page: chained-quiz
  • Plugin version: 1.3.2.7
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.3
  • WordPress version: 6.3.1
  • First release: Dec 21, 2013
  • Latest release: Aug 10, 2023
  • Number of updates: 150
  • Update frequency: every 23.5 days
  • Top authors: prasunsen (98.67%)wakeop (2%)

Code review

54 tests

User reviews

38 reviews

Install metrics

2,000+ active /100,241 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.51MB] [CPU: ▼2.20ms] Passed 4 tests

An overview of server-side resources used by Chained Quiz
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.98 ▲0.5145.46 ▼7.39
Dashboard /wp-admin3.80 ▲0.5054.64 ▲4.42
Posts /wp-admin/edit.php3.92 ▲0.5657.13 ▲8.42
Add New Post /wp-admin/post-new.php6.40 ▲0.5289.13 ▼7.42
Media Library /wp-admin/upload.php3.73 ▲0.5039.91 ▲1.60
Settings /wp-admin/admin.php?page=chainedquiz_options3.7338.28
Integrations /wp-admin/admin.php?page=chainedquiz_integrations3.7136.31
Chained Quiz Results /wp-admin/admin.php?page=chainedquiz_results3.6735.48
Quizzes /wp-admin/admin.php?page=chained_quizzes3.7040.24
Chained Quiz Questions /wp-admin/admin.php?page=chainedquiz_questions3.6734.87
Social Sharing /wp-admin/admin.php?page=chainedquiz_social_sharing3.7139.93
Users Completed Quiz /wp-admin/admin.php?page=chainedquiz_list3.6735.37

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 44 new files
Database: 7 new tables, 15 new options
New tables
wp_chained_completed
wp_chained_questions
wp_chained_mail_relations
wp_chained_user_answers
wp_chained_quizzes
wp_chained_results
wp_chained_choices
New WordPress options
chainedquiz_cleanup
chained_fixed_sort_order
theysaidso_admin_options
chainedquiz_version
chained_csv_quotes
chained_sender_name
db_upgraded
widget_recent-posts
can_compress_scripts
chained_admin_subject
...

Browser metrics Passed 4 tests

Checking browser requirements for Chained Quiz
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,953 ▲20713.58 ▼0.608.17 ▲5.8141.11 ▼2.64
Dashboard /wp-admin2,245 ▲575.85 ▲0.95111.01 ▲6.1639.64 ▼2.00
Posts /wp-admin/edit.php2,134 ▲422.02 ▲0.0040.05 ▲0.0934.99 ▼2.41
Add New Post /wp-admin/post-new.php1,548 ▲623.35 ▲5.04664.68 ▲4.0550.03 ▼10.67
Media Library /wp-admin/upload.php1,433 ▲454.26 ▲0.0996.05 ▼9.6448.11 ▲2.14
Settings /wp-admin/admin.php?page=chainedquiz_options1,0602.0323.0428.99
Integrations /wp-admin/admin.php?page=chainedquiz_integrations8432.0626.2228.09
Chained Quiz Results /wp-admin/admin.php?page=chainedquiz_results1,6216.56129.1858.84
Quizzes /wp-admin/admin.php?page=chained_quizzes8772.0522.1129.80
Chained Quiz Questions /wp-admin/admin.php?page=chainedquiz_questions8692.0326.1528.95
Social Sharing /wp-admin/admin.php?page=chainedquiz_social_sharing9832.0323.3127.43
Users Completed Quiz /wp-admin/admin.php?page=chainedquiz_list9012.0522.3630.97

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The plugin did not uninstall successfully, leaving 7 tables in the database
    • wp_chained_user_answers
    • wp_chained_mail_relations
    • wp_chained_results
    • wp_chained_questions
    • wp_chained_quizzes
    • wp_chained_choices
    • wp_chained_completed
  • Zombie WordPress options were found after uninstall: 15 options
    • chained_sender_name
    • chainedquiz_version
    • db_upgraded
    • chained_sender_email
    • chained_admin_subject
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • ...

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=chainedquiz_list
    • > Notice in wp-content/plugins/chained-quiz/controllers/completed.php+8
    Undefined index: quiz_id
  • 13 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=chainedquiz_list
    • > Notice in wp-content/plugins/chained-quiz/views/completed.html.php+129
    Trying to get property 'id' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=chainedquiz_list
    • > Notice in wp-content/plugins/chained-quiz/views/completed.html.php+2
    Trying to get property 'title' of non-object

SRP 50% 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
  • 29× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/chained-quiz/views/chained-quizzes.html.php:2
    • > PHP Notice
      Undefined variable: active in wp-content/plugins/chained-quiz/views/integrations-tabs.html.php on line 2
    • > PHP Notice
      Undefined variable: target_image in wp-content/plugins/chained-quiz/views/social-share-snippet.html.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/chained-quiz/views/integrations.html.php:2
    • > PHP Notice
      Undefined variable: og_title in wp-content/plugins/chained-quiz/views/social-share-snippet.html.php on line 4
    • > PHP Notice
      Undefined variable: _question in wp-content/plugins/chained-quiz/views/display-quiz.html.php on line 34
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/chained-quiz/views/choice.html.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/chained-quiz/views/quiz.html.php:2
    • > PHP Notice
      Trying to get property 'id' of non-object in wp-content/plugins/chained-quiz/views/display-quiz.html.php on line 26
    • > PHP Notice
      Trying to get property 'id' of non-object in wp-content/plugins/chained-quiz/views/display-quiz.html.php on line 33

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: exam, survey, questionnaire, test, quiz

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

The entry point to "Chained Quiz" version 1.3.2.7 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • 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 review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin3,393 lines of code in 36 files:
LanguageFilesBlank linesComment linesLines of code
PHP336172522,737
PO File1208224539
JavaScript1191190
CSS15027

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity33.75
▷ Minimum class complexity3.00
▷ Maximum class complexity74.00
Average method complexity8.28
▷ Minimum method complexity1.00
▷ Maximum method complexity64.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods54
▷ Static methods3564.81%
▷ Public methods5296.30%
▷ Protected methods00.00%
▷ Private methods23.70%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants12
▷ Global constants12100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/arrow-down.png0.24KB0.25KB0.00%
img/arrow-up.png0.23KB0.25KB0.00%
img/share/facebook.png1.89KB0.74KB▼ 60.82%