66% ultimate-viral-quiz

Code Review | Ultimate Viral Quiz

WordPress plugin Ultimate Viral Quiz scored 66% from 54 tests.

About plugin

  • Plugin page: ultimate-viral-quiz
  • Plugin version: 1.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.2
  • WordPress version: 6.3.1
  • First release: Jun 10, 2019
  • Latest release: Jun 10, 2019
  • Number of updates: 2
  • Update frequency: every 1.0 days
  • Top authors: hameha (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

40+ active / 3,006 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.89MB] [CPU: ▲4.49ms] Passed 4 tests

A check of server-side resources used by Ultimate Viral Quiz
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.29 ▲0.8340.63 ▼1.88
Dashboard /wp-admin4.22 ▲0.9253.19 ▲8.60
Posts /wp-admin/edit.php4.29 ▲0.9359.47 ▲10.51
Add New Post /wp-admin/post-new.php6.81 ▲0.92101.13 ▲2.05
Media Library /wp-admin/upload.php4.14 ▲0.9143.15 ▲9.20
Settings /wp-admin/admin.php?page=uvq-settings4.1447.20
Add List /wp-admin/admin.php?page=uvq-add-list4.1141.54
Add PersonalityQuiz /wp-admin/admin.php?page=uvq-add-personalityquiz4.1144.10
Add TriviaQuiz /wp-admin/admin.php?page=uvq-add-triviaquiz4.1142.34
All Quizzes /wp-admin/admin.php?page=uvq-all-quizzes4.1444.02
Add Rank /wp-admin/admin.php?page=uvq-add-rank4.1139.84
Add Poll /wp-admin/admin.php?page=uvq-add-poll4.1144.03

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 344 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_uvq_listbuzzes
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Ultimate Viral Quiz
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,262 ▲52717.75 ▲3.1417.26 ▲15.3339.02 ▼5.12
Dashboard /wp-admin2,496 ▲3057.54 ▲2.71159.89 ▲54.76125.43 ▲84.88
Posts /wp-admin/edit.php2,411 ▲3224.81 ▲2.8463.97 ▲29.2886.96 ▲55.70
Add New Post /wp-admin/post-new.php1,671 ▲15118.99 ▼4.17698.44 ▲18.5436.33 ▼15.33
Media Library /wp-admin/upload.php1,547 ▲1625.97 ▲1.71101.56 ▲1.0190.05 ▲45.51
Settings /wp-admin/admin.php?page=uvq-settings1,3574.5459.46114.23
Add List /wp-admin/admin.php?page=uvq-add-list2,56914.16309.53101.37
Add PersonalityQuiz /wp-admin/admin.php?page=uvq-add-personalityquiz3,19014.76342.82120.84
Add TriviaQuiz /wp-admin/admin.php?page=uvq-add-triviaquiz2,94011.36290.64113.75
All Quizzes /wp-admin/admin.php?page=uvq-all-quizzes1,2865.1071.8995.37
Add Rank /wp-admin/admin.php?page=uvq-add-rank2,47514.42265.94106.53
Add Poll /wp-admin/admin.php?page=uvq-add-poll2,64612.49287.44107.39

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 did not uninstall successfully, leaving 7 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • widget_uvq_listbuzzes
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 0% 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
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=uvq-add-poll
    • > User notice in wp-includes/functions.php+5905
    Function WP_Scripts::localize was called incorrectly. The $l10n parameter must be an array. To pass arbitrary data to scripts, use the wp_add_inline_script() function instead. Please see Debugging in WordPress for more information. (This message was added in version 5.7.0.)

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/ultimate-viral-quiz/bestbugcore/classes/fields/hidden.view.php
    • > /wp-content/plugins/ultimate-viral-quiz/bestbugcore/classes/index.php
  • 44× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WideImage_Exception' not found in wp-content/plugins/ultimate-viral-quiz/includes/libs/wideimage/OperationFactory.php:28
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/ultimate-viral-quiz/includes/admin/templates/quizzes.view.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_user_logged_in() in wp-content/plugins/ultimate-viral-quiz/includes/shortcodes/view/user_forgot_password.view.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post() in wp-content/plugins/ultimate-viral-quiz/includes/shortcodes/view/quiz_list.view.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function bb_esc_html() in wp-content/plugins/ultimate-viral-quiz/bestbugcore/classes/fields/textfield.view.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function bb_esc_html() in wp-content/plugins/ultimate-viral-quiz/bestbugcore/classes/fields/dropdown.view.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'WideImage_Image' not found in wp-content/plugins/ultimate-viral-quiz/includes/libs/wideimage/PaletteImage.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/ultimate-viral-quiz/includes/shortcodes/view/editor_control.view.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function bb_esc_html() in wp-content/plugins/ultimate-viral-quiz/bestbugcore/classes/fields/toggle.view.php:1
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/ultimate-viral-quiz/includes/shortcodes/view/quiz_personalityquiz.view.php:1

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There are user-side issues you should fix
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=uvq-add-poll
    • > Javascript (severe) in unknown
    /wp-content/plugins/ultimate-viral-quiz/bestbugcore//assets/admin/js/script.js?ver=1.0 289:23 Uncaught TypeError: $(...).live is not a function
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=uvq-add-poll
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload,jcrop&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).live is not a function" "TypeError: $(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/ultimate-viral-quiz//assets/admin/js/script.js?ver=1.0:6:28)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload,jcrop&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,moxiejs,plupload,jcrop&ver=6.3.1:2:27292)" undefined
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=uvq-add-poll
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload,jcrop&ver=6.3.1 1:28721 Uncaught TypeError: $(...).live is not a function
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=uvq-add-poll
    • > Other (warning) in unknown
    https://www.youtube.com/s/player/f7e1823a/www-widgetapi.vflset/www-widgetapi.js 1223 Unrecognized feature: 'web-share'.

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% 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
These attributes need your attention:
  • Screenshots: Add a description for screenshot #2 in ultimate-viral-quiz/assets to your readme.txt
  • Tags: Please delete some tags, you are using 15 tag instead of maximum 10
You can look at the official readme.txt

ultimate-viral-quiz/index.php 85% from 13 tests

Analyzing the main PHP file in "Ultimate Viral Quiz" version 1.0
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("ultimate-viral-quiz.php" instead of "index.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 190 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin44,596 lines of code in 307 files:
LanguageFilesBlank linesComment linesLines of code
Sass335155313,090
CSS151,2585511,960
PHP1121,7492,8519,814
JavaScript1441,1511,5109,341
SVG310391

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity14.69
▷ Minimum class complexity1.00
▷ Maximum class complexity246.00
Average method complexity3.60
▷ Minimum method complexity1.00
▷ Maximum method complexity63.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes84
▷ Abstract classes22.38%
▷ Concrete classes8297.62%
▷ Final classes00.00%
Methods447
▷ Static methods5111.41%
▷ Public methods42294.41%
▷ Protected methods194.25%
▷ Private methods61.34%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants45
▷ Global constants3680.00%
▷ Class constants920.00%
▷ Public constants9100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
8 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
bestbugcore/assets/admin/images/15_15_15_15_15.png1.04KB0.13KB▼ 87.74%
bestbugcore/assets/admin/images/logo-white.png1.23KB0.56KB▼ 54.46%
assets/admin/images/logo.png1.42KB0.78KB▼ 44.95%
bestbugcore/assets/admin/images/switch.png0.53KB0.64KB0.00%
bestbugcore/assets/admin/images/logo.png1.87KB0.57KB▼ 69.83%