10% ssquiz

Code Review | SS Quiz

WordPress plugin SS Quiz scored10%from 54 tests.

About plugin

  • Plugin page: ssquiz
  • Plugin version: 2.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.6
  • WordPress version: 6.3.1
  • First release: Dec 17, 2011
  • Latest release: Aug 13, 2013
  • Number of updates: 62
  • Update frequency: every 9.8 days
  • Top authors: ssvadim (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

100+ active /23,097 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The following installer errors require your attention
  • This plugin did not install gracefully
    • > Warning in wp-content/plugins/ssquiz/ssquiz.php+93
    Creating default object from empty value

Server metrics [RAM: ▲0.27MB] [CPU: ▼5.86ms] Passed 4 tests

A check of server-side resources used by SS Quiz
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.74 ▲0.2844.61 ▲1.47
Dashboard /wp-admin3.58 ▲0.2346.86 ▼16.05
Posts /wp-admin/edit.php3.69 ▲0.3447.63 ▲5.08
Add New Post /wp-admin/post-new.php6.18 ▲0.2983.85 ▼10.99
Media Library /wp-admin/upload.php3.50 ▲0.2737.89 ▲2.15
Statistics /wp-admin/admin.php?page=ssquiz_menu_statistics3.4431.50
SS Quiz /wp-admin/admin.php?page=ssquiz_menu3.4432.09
Documentation /wp-admin/admin.php?page=ssquiz_menu_docs3.4732.97
Settings /wp-admin/admin.php?page=ssquiz_menu_settings3.5541.16

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 42 new files
Database: 3 new tables, 9 new options
New tables
wp_ssquiz_questions
wp_ssquiz_history
wp_ssquiz_quizzes
New WordPress options
ssquiz_settings
db_upgraded
ssquiz_history
ssquiz_page
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for SS Quiz
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,955 ▲20913.90 ▼0.478.25 ▲6.4439.73 ▼4.05
Dashboard /wp-admin2,234 ▲525.16 ▼0.7199.98 ▼17.0782.94 ▲38.93
Posts /wp-admin/edit.php2,137 ▲482.44 ▲0.3935.22 ▼7.2932.31 ▼9.41
Add New Post /wp-admin/post-new.php1,550 ▲823.49 ▲5.09754.82 ▲87.1338.17 ▼11.73
Media Library /wp-admin/upload.php1,428 ▲374.49 ▲0.29103.26 ▼2.4379.51 ▲34.80
Statistics /wp-admin/admin.php?page=ssquiz_menu_statistics9682.2434.8373.18
SS Quiz /wp-admin/admin.php?page=ssquiz_menu2,1128.11164.8498.54
Documentation /wp-admin/admin.php?page=ssquiz_menu_docs1,0362.0829.4664.77
Settings /wp-admin/admin.php?page=ssquiz_menu_settings2,79210.77203.94126.79

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
  • The uninstall procedure failed, leaving 3 tables in the database
    • wp_ssquiz_questions
    • wp_ssquiz_quizzes
    • wp_ssquiz_history
  • The uninstall procedure has failed, leaving 7 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • ssquiz_settings

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=ssquiz_menu_statistics
    • > Warning in wp-content/plugins/ssquiz/admin-statistics.php+78
    Creating default object from empty value
    • > GET request to /wp-admin/admin.php?page=ssquiz_menu
    • > Notice in wp-content/plugins/ssquiz/admin-main.php+254
    Undefined index: quiz_id
    • > GET request to /wp-admin/admin.php?page=ssquiz_menu
    • > Notice in wp-content/plugins/ssquiz/admin-main.php+258
    Undefined variable: selected
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ssquiz_menu
    • > Notice in wp-content/plugins/ssquiz/admin-main.php+149
    Undefined property: stdClass::$quiz_id
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ssquiz_menu
    • > Notice in wp-content/plugins/ssquiz/admin-main.php+228
    Only variables should be passed by reference

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 fix the following items
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ssquiz/admin-main.php:111
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ssquiz/admin-settings.php:37
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ssquiz/admin-statistics.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ssquiz/client-quiz.php:201
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/ssquiz/ssquiz.php:12

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please take a look at the following user-side issues
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ssquiz_menu_settings
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-mouse,jquery-ui-sortable&ver=6.3.1 1:28609 "jQuery.Deferred exception: Cannot read properties of undefined (reading 'mozilla')" "TypeError: Cannot read properties of undefined (reading 'mozilla')\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/ssquiz//ssquiz.js?ver=6.3.1:339:17)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-mouse,jquery-ui-sortable&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,jquery-ui-core,jquery-ui-mouse,jquery-ui-sortable&ver=6.3.1:2:27292)" undefined
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ssquiz_menu_settings
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-mouse,jquery-ui-sortable&ver=6.3.1 1:28721 Uncaught TypeError: Cannot read properties of undefined (reading 'mozilla')

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
Attributes that need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (User Answers), #2 (User checks correct answer), #3 (Statistics Page), #4 (Adding Question), #5 (Quizzes on Admin end)
The official readme.txt might help

ssquiz/ssquiz.php 92% from 13 tests

The principal PHP file in "SS Quiz" v. 2.0.5 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Description: The description should be shorter than 140 characters (currently 471 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin12,871 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
CSS37939,417
PHP6192741,442
PO File4421519948
JavaScript5206237809
SVG100255

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions38
▷ Named functions38100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
11 PNG files occupy 0.17MB with 0.11MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-5.png38.90KB18.03KB▼ 53.65%
screenshot-1.png10.97KB5.17KB▼ 52.91%
screenshot-2.png10.73KB4.81KB▼ 55.15%
assets/right.png3.33KB0.45KB▼ 86.56%
assets/wrong.png3.29KB0.64KB▼ 80.43%