10% youtube-sidebar

Code Review | YouTube Sidebar

WordPress plugin YouTube Sidebar scored10%from 54 tests.

About plugin

  • Plugin page: youtube-sidebar
  • Plugin version: 3.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8.0-4.2.2
  • WordPress version: 6.3.1
  • First release: Dec 22, 2009
  • Latest release: Jun 12, 2015
  • Number of updates: 31
  • Update frequency: every 64.5 days
  • Top authors: WebTechGlobal (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

60+ active /19,348 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
It is recommended to fix the following installer errors
  • Install procedure had errors
    • > Warning in wp-content/plugins/youtube-sidebar/classes/class-youtubesidebar.php+449
    count(): Parameter must be an array or an object that implements Countable

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

An overview of server-side resources used by YouTube Sidebar
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.07 ▼1.404.93 ▼36.52
Dashboard /wp-admin2.09 ▼1.265.66 ▼63.52
Posts /wp-admin/edit.php2.09 ▼1.275.92 ▼45.16
Add New Post /wp-admin/post-new.php2.09 ▼3.806.55 ▼99.27
Media Library /wp-admin/upload.php2.09 ▼1.145.80 ▼31.44
Plugins Dashboard /wp-admin/admin.php?page=youtubesidebar2.096.14
YouTube Sidebar /wp-admin/upload.php?page=youtubesidebar2.096.61

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 80 new files
Database: no new tables, 13 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
youtubesidebar_installeddate
youtubesidebar_settings
widget_recent-comments
youtubesidebar_is_installed
theysaidso_admin_options
db_upgraded
can_compress_scripts
youtubesidebar_installedversion
...

Browser metrics Passed 4 tests

YouTube Sidebar: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲3414.27 ▼0.382.07 ▲0.2348.67 ▲4.11
Dashboard /wp-admin2,199 ▲225.60 ▼0.0583.48 ▼15.1938.95 ▼4.70
Posts /wp-admin/edit.php2,107 ▲252.12 ▲0.1137.11 ▼1.9635.46 ▼0.91
Add New Post /wp-admin/post-new.php1,552 ▲2123.68 ▲0.06687.09 ▼22.1057.76 ▲3.21
Media Library /wp-admin/upload.php1,401 ▼24.26 ▲0.05108.70 ▲3.6948.75 ▲1.21
Plugins Dashboard /wp-admin/admin.php?page=youtubesidebar2,66818.16369.53103.01
YouTube Sidebar /wp-admin/upload.php?page=youtubesidebar2,62915.58353.9460.46

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin cannot be uninstalled
    • > Warning in wp-content/plugins/youtube-sidebar/classes/class-youtubesidebar.php+449
    count(): Parameter must be an array or an object that implements Countable
  • This plugin did not uninstall successfully, leaving 13 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • youtubesidebar_installedversion
    • db_upgraded
    • youtubesidebar_installeddate
    • youtubesidebar_schedule
    • youtubesidebar_formvalidation
    • youtubesidebar_is_installed
    • can_compress_scripts
    • widget_recent-comments
    • ...

Smoke tests 0% 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
  • 126 occurences, only the last one shown
    • > GET request to /wp-admin/upload.php?page=youtubesidebar
    • > Warning in wp-content/plugins/youtube-sidebar/classes/class-youtubesidebar.php+449
    count(): Parameter must be an array or an object that implements Countable
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/upload.php?page=youtubesidebar
    • > User deprecated in wp-includes/functions.php+5453
    Function get_currentuserinfo is deprecated since version 4.5.0! Use wp_get_current_user() instead.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/upload.php?page=youtubesidebar
    • > Notice in wp-content/plugins/youtube-sidebar/classes/class-ui.php+176
    Undefined index: viewtitle
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/upload.php?page=youtubesidebar
    • > Notice in wp-content/plugins/youtube-sidebar/classes/class-ui.php+155
    Undefined index: tabs
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/upload.php?page=youtubesidebar
    • > Warning in wp-content/plugins/youtube-sidebar/classes/class-ui.php+155
    Invalid argument supplied for foreach()

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 fix the following
  • 26× PHP files perform the action of outputting non-empty strings when accessed directly (only 10 are shown):
    • > /wp-content/plugins/youtube-sidebar/arrays/settings_array.php
    • > /wp-content/plugins/youtube-sidebar/classes/class-categories.php
    • > /wp-content/plugins/youtube-sidebar/views/main.php
    • > /wp-content/plugins/youtube-sidebar/arrays/schedule_array.php
    • > /wp-content/plugins/youtube-sidebar/youtubesidebar.php
    • > /wp-content/plugins/youtube-sidebar/views/appearancesection.php
    • > /wp-content/plugins/youtube-sidebar/views/commentssection.php
    • > /wp-content/plugins/youtube-sidebar/posttypes/flags.php
    • > /wp-content/plugins/youtube-sidebar/classes/class-flags.php
    • > /wp-content/plugins/youtube-sidebar/arrays/tableschema_array.php
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'YOUTUBESIDEBAR_UI' not found in wp-content/plugins/youtube-sidebar/classes/class-forms.php:10

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
These are user-side errors you should fix
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/upload.php?page=youtubesidebar
    • > Network (severe)
    wp-content/plugins/youtubesidebar/css/notifications.css?ver=1.0.0 - Failed to load resource: the server responded with a status of 404 (Not Found)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/upload.php?page=youtubesidebar
    • > Network (severe)
    wp-content/plugins/youtubesidebar/css/admin.css?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=youtubesidebar
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=youtubesidebar 315:24 Uncaught TypeError: $ is not a function
    • > GET request to /wp-admin/admin.php?page=youtubesidebar
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=youtubesidebar 337:24 Uncaught TypeError: $ is not a function
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/upload.php?page=youtubesidebar
    • > Console-api (warning) in unknown
    http://pagead2.googlesyndication.com/pagead/show_ads.js 52:253 "You are using deprecated show_ads.js script to display AdSense ads. To improve performance of your ads switch to the modern adsbygoogle.js script. See instructions on https://support.google.com/adsense/answer/9190028."
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/upload.php?page=youtubesidebar
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'ambient-light-sensor'.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/upload.php?page=youtubesidebar
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'bluetooth'.
    • > GET request to /wp-admin/admin.php?page=youtubesidebar
    • > Network (severe)
    https://googleads.g.doubleclick.net/pagead/ads?client=ca-pub-4923567693678329&output=html&h=250&slotname=5814814678&adk=4156426086&adf=3552772855&pi=t.ma~as.5814814678&w=250&lmt=1697317445&url=http%3A%2F%2Fwp.com%2Fwp-admin%2Fadmin.php%3Fpage%3Dyoutubesidebar&wgl=1&dt=1697317444662&bpp=242&bdt=149&idt=428&shv=r20231011&mjsv=m202310100101&ptt=5&saldr=sd&abxe=1&correlator=2249129823273&frm=20&pv=2&ga_vid=1392534367.1697317445&ga_sid=1697317445&ga_hid=362720720&ga_fc=0&u_tz=180&u_his=14&u_h=600&u_w=800&u_ah=600&u_aw=800&u_cd=24&u_sd=1&adx=491&ady=1753&biw=785&bih=585&scr_x=0&scr_y=0&eid=44759926%2C44759875%2C31078363%2C31078658%2C42532334%2C44805098%2C44805112%2C31078297&oid=2&pvsid=2828052960629571&tmod=1208951399&uas=0&nvt=1&fc=896&brdim=0%2C0%2C0%2C0%2C800%2C0%2C800%2C600%2C800%2C600&vis=1&rsz=o%7Co%7CpeEbr%7C&abl=NS&pfx=0&fu=1024&bc=23&ifi=1&uci=a!1&btvi=1&fsb=1&xpc=J9xOWJOoOg&p=http%3A//wp.com&dtd=455 - Failed to load resource: the server responded with a status of 403 ()
    • > GET request to /wp-admin/admin.php?page=youtubesidebar
    • > Network (severe)
    https://googleads.g.doubleclick.net/pagead/ads?client=ca-pub-4923567693678329&output=html&h=200&slotname=7291547875&adk=957470934&adf=2342189458&pi=t.ma~as.7291547875&w=200&lmt=1697317445&url=http%3A%2F%2Fwp.com%2Fwp-admin%2Fadmin.php%3Fpage%3Dyoutubesidebar&wgl=1&dt=1697317444670&bpp=235&bdt=157&idt=465&shv=r20231011&mjsv=m202310100101&ptt=5&saldr=sd&abxe=1&prev_slotnames=5814814678&correlator=2249129823273&frm=20&pv=1&ga_vid=1392534367.1697317445&ga_sid=1697317445&ga_hid=362720720&ga_fc=0&u_tz=180&u_his=14&u_h=600&u_w=800&u_ah=600&u_aw=800&u_cd=24&u_sd=1&adx=491&ady=2023&biw=785&bih=585&scr_x=0&scr_y=0&eid=44759926%2C44759875%2C31078363%2C31078658%2C42532334%2C44805098%2C44805112%2C31078297&oid=2&pvsid=2828052960629571&tmod=1208951399&uas=0&nvt=1&fc=896&brdim=0%2C0%2C0%2C0%2C800%2C0%2C800%2C600%2C800%2C600&vis=1&rsz=o%7Co%7CpeEbr%7C&abl=NS&pfx=0&fu=1024&bc=23&ifi=2&uci=a!2&btvi=2&fsb=1&xpc=VdH5VcJXds&p=http%3A//wp.com&dtd=474 - Failed to load resource: the server responded with a status of 403 ()
    • > GET request to /wp-admin/admin.php?page=youtubesidebar
    • > Network (severe)
    https://googleads.g.doubleclick.net/pagead/ads?client=ca-pub-4923567693678329&output=html&h=125&slotname=8768281070&adk=117996738&adf=200143806&pi=t.ma~as.8768281070&w=125&lmt=1697317445&url=http%3A%2F%2Fwp.com%2Fwp-admin%2Fadmin.php%3Fpage%3Dyoutubesidebar&wgl=1&dt=1697317444672&bpp=234&bdt=158&idt=480&shv=r20231011&mjsv=m202310100101&ptt=5&saldr=sd&abxe=1&prev_slotnames=5814814678%2C7291547875&correlator=2249129823273&frm=20&pv=1&ga_vid=1392534367.1697317445&ga_sid=1697317445&ga_hid=362720720&ga_fc=0&u_tz=180&u_his=14&u_h=600&u_w=800&u_ah=600&u_aw=800&u_cd=24&u_sd=1&adx=491&ady=2243&biw=785&bih=585&scr_x=0&scr_y=0&eid=44759926%2C44759875%2C31078363%2C31078658%2C42532334%2C44805098%2C44805112%2C31078297&oid=2&pvsid=2828052960629571&tmod=1208951399&uas=0&nvt=1&fc=896&brdim=0%2C0%2C0%2C0%2C800%2C0%2C800%2C600%2C800%2C600&vis=1&rsz=o%7Co%7CpeEbr%7C&abl=NS&pfx=0&fu=1024&bc=23&ifi=3&uci=a!3&btvi=3&fsb=1&xpc=MM7JrvexeO&p=http%3A//wp.com&dtd=486 - Failed to load resource: the server responded with a status of 403 ()
    • > GET request to /wp-admin/upload.php?page=youtubesidebar
    • > Javascript (severe) in unknown
    /wp-admin/upload.php?page=youtubesidebar 315:24 Uncaught TypeError: $ is not a function
    • > GET request to /wp-admin/upload.php?page=youtubesidebar
    • > Javascript (severe) in unknown
    /wp-admin/upload.php?page=youtubesidebar 337:24 Uncaught TypeError: $ is not a function
    • > GET request to /wp-admin/upload.php?page=youtubesidebar
    • > Network (severe)
    https://googleads.g.doubleclick.net/pagead/ads?client=ca-pub-4923567693678329&output=html&h=125&slotname=8768281070&adk=117996738&adf=200143806&pi=t.ma~as.8768281070&w=125&lmt=1697317448&url=http%3A%2F%2Fwp.com%2Fwp-admin%2Fupload.php%3Fpage%3Dyoutubesidebar&wgl=1&dt=1697317448137&bpp=81&bdt=105&idt=258&shv=r20231011&mjsv=m202310100101&ptt=5&saldr=sd&abxe=1&cookie=ID%3Dec161b6b319558df-223bb7b5dfe20011%3AT%3D1697317445%3ART%3D1697317445%3AS%3DALNI_MYaH9WZlaiXkeCNJBqovpOLpF_Ikw&gpic=UID%3D00000c9886ac7ab3%3AT%3D1697317445%3ART%3D1697317445%3AS%3DALNI_Mb3iwfTpfr4hG_QV6zPzjHm4AfDEQ&prev_slotnames=5814814678%2C7291547875&correlator=5279901541955&frm=20&pv=1&ga_vid=1998474634.1697317448&ga_sid=1697317448&ga_hid=955391248&ga_fc=0&u_tz=180&u_his=16&u_h=600&u_w=800&u_ah=600&u_aw=800&u_cd=24&u_sd=1&adx=491&ady=2243&biw=785&bih=585&scr_x=0&scr_y=0&eid=44759926%2C44759875%2C31078363%2C31078657%2C44805099%2C44805335%2C44804171&oid=2&pvsid=1190374314166415&tmod=1208951399&uas=0&nvt=1&fc=896&brdim=0%2C0%2C0%2C0%2C800%2C0%2C800%2C600%2C800%2C600&vis=1&rsz=o%7Co%7CpeEbr%7C&abl=NS&pfx=0&fu=1024&bc=23&ifi=3&uci=a!3&btvi=3&fsb=1&xpc=N3mBSFhQEP&p=http%3A//wp.com&dtd=295 - Failed to load resource: the server responded with a status of 403 ()
    • > GET request to /wp-admin/upload.php?page=youtubesidebar
    • > Network (severe)
    https://googleads.g.doubleclick.net/pagead/ads?client=ca-pub-4923567693678329&output=html&h=250&slotname=5814814678&adk=4156426086&adf=3552772855&pi=t.ma~as.5814814678&w=250&lmt=1697317448&url=http%3A%2F%2Fwp.com%2Fwp-admin%2Fupload.php%3Fpage%3Dyoutubesidebar&wgl=1&dt=1697317448132&bpp=83&bdt=100&idt=179&shv=r20231011&mjsv=m202310100101&ptt=5&saldr=sd&abxe=1&cookie=ID%3Dec161b6b319558df-223bb7b5dfe20011%3AT%3D1697317445%3ART%3D1697317445%3AS%3DALNI_MYaH9WZlaiXkeCNJBqovpOLpF_Ikw&gpic=UID%3D00000c9886ac7ab3%3AT%3D1697317445%3ART%3D1697317445%3AS%3DALNI_Mb3iwfTpfr4hG_QV6zPzjHm4AfDEQ&correlator=5279901541955&frm=20&pv=2&ga_vid=1998474634.1697317448&ga_sid=1697317448&ga_hid=955391248&ga_fc=0&u_tz=180&u_his=16&u_h=600&u_w=800&u_ah=600&u_aw=800&u_cd=24&u_sd=1&adx=491&ady=1753&biw=785&bih=585&scr_x=0&scr_y=0&eid=44759926%2C44759875%2C31078363%2C31078657%2C44805099%2C44805335%2C44804171&oid=2&pvsid=1190374314166415&tmod=1208951399&uas=0&nvt=1&fc=896&brdim=0%2C0%2C0%2C0%2C800%2C0%2C800%2C600%2C800%2C600&vis=1&rsz=o%7Co%7CpeEbr%7C&abl=NS&pfx=0&fu=1024&bc=23&ifi=1&uci=a!1&btvi=1&fsb=1&xpc=3mugkQMUgF&p=http%3A//wp.com&dtd=200 - Failed to load resource: the server responded with a status of 403 ()
    • > GET request to /wp-admin/upload.php?page=youtubesidebar
    • > Network (severe)
    https://googleads.g.doubleclick.net/pagead/ads?client=ca-pub-4923567693678329&output=html&h=200&slotname=7291547875&adk=957470934&adf=2342189458&pi=t.ma~as.7291547875&w=200&lmt=1697317448&url=http%3A%2F%2Fwp.com%2Fwp-admin%2Fupload.php%3Fpage%3Dyoutubesidebar&wgl=1&dt=1697317448135&bpp=82&bdt=103&idt=239&shv=r20231011&mjsv=m202310100101&ptt=5&saldr=sd&abxe=1&cookie=ID%3Dec161b6b319558df-223bb7b5dfe20011%3AT%3D1697317445%3ART%3D1697317445%3AS%3DALNI_MYaH9WZlaiXkeCNJBqovpOLpF_Ikw&gpic=UID%3D00000c9886ac7ab3%3AT%3D1697317445%3ART%3D1697317445%3AS%3DALNI_Mb3iwfTpfr4hG_QV6zPzjHm4AfDEQ&prev_slotnames=5814814678&correlator=5279901541955&frm=20&pv=1&ga_vid=1998474634.1697317448&ga_sid=1697317448&ga_hid=955391248&ga_fc=0&u_tz=180&u_his=16&u_h=600&u_w=800&u_ah=600&u_aw=800&u_cd=24&u_sd=1&adx=491&ady=2023&biw=785&bih=585&scr_x=0&scr_y=0&eid=44759926%2C44759875%2C31078363%2C31078657%2C44805099%2C44805335%2C44804171&oid=2&pvsid=1190374314166415&tmod=1208951399&uas=0&nvt=1&fc=896&brdim=0%2C0%2C0%2C0%2C800%2C0%2C800%2C600%2C800%2C600&vis=1&rsz=o%7Co%7CpeEbr%7C&abl=NS&pfx=0&fu=1024&bc=23&ifi=2&uci=a!2&btvi=2&fsb=1&xpc=55ZoPq9ggv&p=http%3A//wp.com&dtd=245 - Failed to load resource: the server responded with a status of 403 ()

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Plugin Name: Please specify the plugin name on the first line ( === youtube-sidebar === )
The official readme.txt is a good inspiration

youtube-sidebar/youtubesidebar.php 85% from 13 tests

The main PHP file in "YouTube Sidebar" ver. 3.0.0 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("youtube-sidebar.php" instead of "youtubesidebar.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected9,651 lines of code in 39 files:
LanguageFilesBlank linesComment linesLines of code
PHP332,0345,2967,665
PO File16231,3881,339
CSS39349615
JavaScript2113932

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity55.00
▷ Minimum class complexity1.00
▷ Maximum class complexity295.00
Average method complexity3.99
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes24
▷ Abstract classes14.17%
▷ Concrete classes2395.83%
▷ Final classes00.00%
Methods434
▷ Static methods51.15%
▷ Public methods41996.54%
▷ Protected methods143.23%
▷ Private methods10.23%
Functions22
▷ Named functions22100.00%
▷ Anonymous functions00.00%
Constants28
▷ Global constants2692.86%
▷ Class constants27.14%
▷ Public constants2100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
27 PNG files occupy 2.12MB with 1.91MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/webtechglobal-logo.png42.41KB2.90KB▼ 93.16%
images/info_extra.png147.75KB16.54KB▼ 88.81%
images/restricted_extra.png124.49KB14.43KB▼ 88.41%
images/warning_large.png52.42KB4.12KB▼ 92.14%
images/error_extra.png140.55KB16.75KB▼ 88.08%