10% onionbuzz-viral-quiz

Code Review | OnionBuzz

WordPress plugin OnionBuzz scored10%from 54 tests.

About plugin

  • Plugin page: onionbuzz-viral-quiz
  • Plugin version: 1.0.7
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-4.8.2
  • WordPress version: 6.3.1
  • First release: Sep 14, 2017
  • Latest release: Jan 8, 2018
  • Number of updates: 14
  • Update frequency: every 8.3 days
  • Top authors: arcanoid (85.71%)looks_awesome (21.43%)

Code review

54 tests

User reviews

3 reviews

Install metrics

200+ active /6,547 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
It is recommended to fix the following installer errors
  • The plugin cannot be installed
    • > Notice in wp-content/plugins/onionbuzz-viral-quiz/lib/Core/OBVQ_Config.php+27
    Trying to access array offset on value of type null

Server metrics [RAM: ▲0.49MB] [CPU: ▲8.54ms] Passed 4 tests

Analyzing server-side resources used by OnionBuzz
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.88 ▲0.4258.16 ▲17.66
Dashboard /wp-admin3.88 ▲0.5866.96 ▲12.34
Posts /wp-admin/edit.php3.92 ▲0.5673.01 ▲24.27
Add New Post /wp-admin/post-new.php6.38 ▲0.4997.97 ▼14.62
Media Library /wp-admin/upload.php3.72 ▲0.4955.38 ▲18.77
Settings /wp-admin/admin.php?page=la_onionbuzz_settings4.0452.94
Feeds /wp-admin/admin.php?page=la_onionbuzz_feeds3.8556.16
Stories /wp-admin/admin.php?page=la_onionbuzz_dashboard4.2357.92

Server storage [IO: ▲4.39MB] [DB: ▲0.02MB] Passed 3 tests

Filesystem and database footprint
This plugin installed successfully
Filesystem: 210 new files
Database: 13 new tables, 9 new options
New tables
wp_ob_questions
wp_ob_answer2result
wp_ob_settings
wp_ob_score
wp_ob_results
wp_ob_feed2quiz
wp_ob_feeds
wp_ob_quizzes
wp_ob_answers
wp_ob_result_unlocks
...
New WordPress options
feeds_children
widget_recent-comments
widget_widget_onionbuzz_categories
widget_theysaidso_widget
widget_widget_onionbuzz_recent_posts
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for OnionBuzz
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,153 ▲39214.98 ▲0.2412.70 ▲10.7839.21 ▼5.83
Dashboard /wp-admin2,402 ▲2226.17 ▲0.49119.59 ▲16.5542.10 ▲2.77
Posts /wp-admin/edit.php2,347 ▲2473.43 ▲1.4061.35 ▲21.4435.50 ▼3.01
Add New Post /wp-admin/post-new.php1,553 ▲2723.26 ▲0.19641.98 ▼44.1036.04 ▼23.30
Media Library /wp-admin/upload.php1,484 ▲844.14 ▼0.0280.74 ▼38.8043.77 ▼3.78
Settings /wp-admin/admin.php?page=la_onionbuzz_settings1,7234.5072.3940.78
Feeds /wp-admin/admin.php?page=la_onionbuzz_feeds1,2654.0965.4640.68
Stories /wp-admin/admin.php?page=la_onionbuzz_dashboard1,2854.0764.0831.05

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method OBVQ_WpPluginAutoload\OBVQ_Lifecycle::deactivate() should not be called statically
  • The uninstall procedure failed, leaving 13 tables in the database
    • wp_ob_settings
    • wp_ob_answers
    • wp_ob_answer2result
    • wp_ob_questions
    • wp_ob_quizzes
    • wp_ob_adv_settings
    • wp_ob_score
    • wp_ob_result_unlocks
    • wp_ob_advertisings
    • wp_ob_results
    • ...
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • feeds_children
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_widget_onionbuzz_categories
    • can_compress_scripts
    • widget_widget_onionbuzz_recent_posts
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/admin.php?page=la_onionbuzz_settings
    • > Notice in wp-content/plugins/onionbuzz-viral-quiz/src/Admin/OBVQ_Admin.php+511
    Undefined variable: placeholder_ids_array
    • > GET request to /wp-admin/admin.php?page=la_onionbuzz_settings
    • > Warning in wp-content/plugins/onionbuzz-viral-quiz/src/Admin/OBVQ_Admin.php+511
    count(): Parameter must be an array or an object that implements Countable

SRP 0% 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
  • 7× PHP files output text when accessed directly:
    • > /wp-content/plugins/onionbuzz-viral-quiz/templates/admin/templates/feed.php
    • > /wp-content/plugins/onionbuzz-viral-quiz/templates/admin/settings-tabs.php
    • > /wp-content/plugins/onionbuzz-viral-quiz/templates/admin/menu-top.php
    • > /wp-content/plugins/onionbuzz-viral-quiz/templates/admin/templates/pagination.php
    • > /wp-content/plugins/onionbuzz-viral-quiz/templates/admin/quiz-tabs.php
    • > /wp-content/plugins/onionbuzz-viral-quiz/templates/admin/templates/quiz.php
    • > /wp-content/plugins/onionbuzz-viral-quiz/tests/lib/wp-tests-config.php
  • 294× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/onionbuzz-viral-quiz/templates/frontend/templates/quiz-shortcode-slider.php on line 193
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/onionbuzz-viral-quiz/templates/frontend/templates/quiz-shortcode-slider.php on line 1
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/onionbuzz-viral-quiz/templates/admin/quiz-tabs.php on line 2
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/onionbuzz-viral-quiz/templates/frontend/templates/quiz-shortcode-slider.php on line 48
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/onionbuzz-viral-quiz/templates/frontend/templates/quiz-shortcode.php on line 1
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/onionbuzz-viral-quiz/templates/admin/quiz-questions.php on line 4
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/onionbuzz-viral-quiz/templates/frontend/templates/quiz-shortcode-slider.php on line 211
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/onionbuzz-viral-quiz/templates/frontend/templates/quiz-shortcode-slider.php on line 37
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/onionbuzz-viral-quiz/templates/admin/quiz-tabs.php on line 28
    • > PHP Fatal error
      Uncaught Error: Call to a member function render() on null in wp-content/plugins/onionbuzz-viral-quiz/templates/admin/quiz-stats.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Tags: You are using too many tags: 15 tag instead of maximum 10
Please take inspiration from this readme.txt

onionbuzz-viral-quiz/plugin.php 85% from 13 tests

The main PHP script in "OnionBuzz" version 1.0.7 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("onionbuzz-viral-quiz.php" instead of "plugin.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 279 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin42,966 lines of code in 166 files:
LanguageFilesBlank linesComment linesLines of code
CSS181,14744118,092
SVG220179,637
JavaScript621,4221,0147,597
PHP611,3791,3507,486
PO File1354494
Bourne Shell19346
INI10814

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.43
Average class complexity19.96
▷ Minimum class complexity1.00
▷ Maximum class complexity134.00
Average method complexity2.87
▷ Minimum method complexity1.00
▷ Maximum method complexity77.00
Code structure
Namespaces7
Interfaces0
Traits0
Classes25
▷ Abstract classes14.00%
▷ Concrete classes2496.00%
▷ Final classes00.00%
Methods254
▷ Static methods93.54%
▷ Public methods24395.67%
▷ Protected methods31.18%
▷ Private methods83.15%
Functions2
▷ Named functions00.00%
▷ Anonymous functions2100.00%
Constants28
▷ Global constants1967.86%
▷ Class constants932.14%
▷ 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
21 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
static/vendors/jquery-ui/images/ui-icons_777620_256x240.png4.44KB4.17KB▼ 6.02%
static/vendors/bootstrap-colorpicker/img/bootstrap-colorpicker/alpha.png0.48KB1.68KB0.00%
static/admin/images/no-image.png1.26KB0.53KB▼ 57.61%
static/admin/images/ico-drag.png0.28KB0.22KB▼ 18.44%
static/admin/images/arrow-grey-down.png0.96KB0.11KB▼ 88.29%