10% super-simple-quiz

Code Review | Super Simple Quiz

WordPress plugin Super Simple Quiz scored10%from 54 tests.

About plugin

  • Plugin page: super-simple-quiz
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2.0-5.4
  • WordPress version: 6.3.1
  • First release: Sep 17, 2019
  • Latest release: Jun 11, 2020
  • Number of updates: 7
  • Update frequency: every 38.3 days
  • Top authors: glazyrinae (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /957 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
These installer errors require your attention
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/super-simple-quiz/includes/class-simple-quiz-initialization.php+17
    define(): Declaration of case-insensitive constants is deprecated

Server metrics [RAM: ▼1.93MB] [CPU: ▼55.26ms] Passed 4 tests

Analyzing server-side resources used by Super Simple Quiz
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.06 ▼1.415.03 ▼41.54
Dashboard /wp-admin2.08 ▼1.235.08 ▼45.60
Posts /wp-admin/edit.php2.08 ▼1.286.45 ▼42.51
Add New Post /wp-admin/post-new.php2.08 ▼3.815.75 ▼91.38
Media Library /wp-admin/upload.php2.08 ▼1.154.87 ▼32.65
Add new question /wp-admin/admin.php?page=do_question2.085.23
Simple Quiz List /wp-admin/admin.php?page=wp_simple_quiz2.088.78
/wp-admin/admin.php?page=do_quiz2.085.35
List of quiz results /wp-admin/admin.php?page=quiz_results2.086.60

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 49 new files
Database: 4 new tables, 6 new options
New tables
wp_ssq_quizzes_questions
wp_ssq_quizzes_answers
wp_ssq_quizzes_results
wp_ssq_quizzes
New WordPress options
widget_recent-comments
can_compress_scripts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Super Simple Quiz
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,925 ▲16413.73 ▼0.6210.68 ▲8.5942.32 ▼4.33
Dashboard /wp-admin2,244 ▲645.60 ▼0.0795.35 ▲6.7142.92 ▲3.02
Posts /wp-admin/edit.php2,135 ▲352.03 ▲0.0535.96 ▼2.2732.88 ▼2.85
Add New Post /wp-admin/post-new.php1,554 ▲2621.86 ▼1.60648.03 ▲13.0156.52 ▲6.23
Media Library /wp-admin/upload.php1,429 ▲264.22 ▼0.02101.65 ▼4.3042.81 ▲0.40
Add new question /wp-admin/admin.php?page=do_question1,5706.54137.0169.16
Simple Quiz List /wp-admin/admin.php?page=wp_simple_quiz1,0561.6727.7729.44
/wp-admin/admin.php?page=do_quiz1,5866.57131.7248.54
List of quiz results /wp-admin/admin.php?page=quiz_results1,0451.6627.8125.70

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/super-simple-quiz/includes/class-simple-quiz-initialization.php+17
    define(): Declaration of case-insensitive constants is deprecated
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options

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
  • 44 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=quiz_results
    • > Deprecated in wp-content/plugins/super-simple-quiz/includes/class-simple-quiz-initialization.php+33
    define(): Declaration of case-insensitive constants is deprecated
    • > GET request to /wp-admin/admin.php?page=do_question
    • > Notice in wp-content/plugins/super-simple-quiz/admin/partials/class-render-question-form.php+29
    Undefined index: id_quiz

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 take a closer look at the following
  • 23× 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 plugin_dir_path() in wp-content/plugins/super-simple-quiz/admin/classes/class-controller-table-results.php:10
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/super-simple-quiz/includes/class-simple-quiz-initialization.php on line 10
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/super-simple-quiz/admin/classes/class-render-table-quizzes.php on line 11
    • > 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/super-simple-quiz/admin/classes/class-render-table-questions.php on line 11
    • > 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/super-simple-quiz/admin/classes/class-render-table-questions.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/super-simple-quiz/admin/classes/class-controller-table-quizzes.php:10
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/upgrade.php' (include_path='.:/usr/share/php') in wp-content/plugins/super-simple-quiz/includes/class-simple-quiz-activator.php on line 13
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/super-simple-quiz/includes/class-simple-quiz-initialization.php on line 10
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/upgrade.php): failed to open stream: No such file or directory in wp-content/plugins/super-simple-quiz/includes/class-simple-quiz-activator.php on line 13
    • > PHP Fatal error
      require(): Failed opening required 'ABSPATHWPINC/class-wp-editor.php' (include_path='.:/usr/share/php') in wp-content/plugins/super-simple-quiz/admin/partials/class-render-question-form.php on line 11

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=quiz_results
    • > 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: $(...).die is not a function" "TypeError: $(...).die is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/super-simple-quiz/admin/js/simple-quiz-admin.js?ver=1.0.0:75:27)\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
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=quiz_results
    • > 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: $(...).die is not a function

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
2 plugin tags: quiz, questionnaire

super-simple-quiz/simple-quiz.php 77% from 13 tests

The primary PHP file in "Super Simple Quiz" version 1.0.1 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 168 characters long)
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("super-simple-quiz.php" instead of "simple-quiz.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin1,998 lines of code in 28 files:
LanguageFilesBlank linesComment linesLines of code
PHP234247251,522
JavaScript26020202
PO File16286145
CSS2812129

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity10.65
▷ Minimum class complexity1.00
▷ Maximum class complexity41.00
Average method complexity2.58
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces0
Interfaces0
Traits6
Classes14
▷ Abstract classes00.00%
▷ Concrete classes14100.00%
▷ Final classes00.00%
Methods114
▷ Static methods97.89%
▷ Public methods10995.61%
▷ Protected methods00.00%
▷ Private methods54.39%
Functions8
▷ Named functions562.50%
▷ Anonymous functions337.50%
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
6 PNG files occupy 0.35MB with 0.15MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/banner-1544x500.png89.53KB33.00KB▼ 63.13%
assets/banners/banner-1544x500.png89.53KB33.00KB▼ 63.13%
public/img/right.png0.30KB0.27KB▼ 10.78%
public/img/left.png0.33KB0.28KB▼ 16.08%
assets/banner-772x250.png89.53KB33.00KB▼ 63.13%