10% youtube-channel-gallery

Code Review | Youtube Channel Gallery

WordPress plugin Youtube Channel Gallery scored 10% from 54 tests.

About plugin

  • Plugin page: youtube-channel-g...
  • Plugin version: 2.4
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-4.3.1
  • WordPress version: 5.9.2
  • First release: Jul 10, 2012
  • Latest release: Sep 29, 2015
  • Number of updates: 196
  • Update frequency: every 6.0 days
  • Top authors: javitxu123 (100%)

Code review

54 tests

User reviews

87 reviews

Install metrics

10,000+ active / 433,339 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
It is recommended to fix the following installer errors
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/youtube-channel-gallery/youtube-channel-gallery.php+1223
    Function create_function() is deprecated

Server metrics [RAM: ▼2.02MB] [CPU: ▼340.89ms] Passed 4 tests

Server-side resources used by Youtube Channel Gallery
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.35 ▼1.165.03 ▼49.94
Dashboard /wp-admin2.37 ▼1.044.51 ▼34.70
Posts /wp-admin/edit.php2.37 ▼1.276.18 ▼39.28
Add New Post /wp-admin/post-new.php2.37 ▼4.605.41 ▼1,239.62
Media Library /wp-admin/upload.php2.37 ▼0.925.17 ▼22.92

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 34 new files
Database: no new tables, 1 new option
New WordPress options
widget_youtubechannelgallery_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Youtube Channel Gallery
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,785 ▲4115.66 ▼0.226.06 ▼0.312.81 ▲0.60
Dashboard /wp-admin2,878 ▲276.17 ▲0.04120.80 ▼30.07156.27 ▼18.37
Posts /wp-admin/edit.php2,688 ▼63.24 ▲0.0064.02 ▼0.75139.44 ▼7.97
Add New Post /wp-admin/post-new.php1,698 ▼7521.67 ▲0.66400.24 ▼39.29151.50 ▼3.18
Media Library /wp-admin/upload.php1,695 ▼35.53 ▲0.03140.71 ▼10.08190.34 ▼14.12

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/youtube-channel-gallery/youtube-channel-gallery.php+1223
    Function create_function() is deprecated
  • Zombie WordPress options detected upon uninstall: 1 option
    • widget_youtubechannelgallery_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
The following issues need your attention
  • 3× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/youtube-channel-gallery/templates/title.php
    • > /wp-content/plugins/youtube-channel-gallery/templates/thumb.php
    • > /wp-content/plugins/youtube-channel-gallery/templates/player.php
  • 58× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Undefined variable: ytchag_ratio in wp-content/plugins/youtube-channel-gallery/templates/player.php on line 1
    • > PHP Notice
      Trying to get property 'id' of non-object in wp-content/plugins/youtube-channel-gallery/templates/thumb.php on line 2
    • > PHP Notice
      Undefined variable: youtube_url in wp-content/plugins/youtube-channel-gallery/templates/player.php on line 4
    • > PHP Notice
      Undefined variable: thumb in wp-content/plugins/youtube-channel-gallery/templates/thumb.php on line 1
    • > PHP Notice
      Undefined variable: ytchag_link in wp-content/plugins/youtube-channel-gallery/templates/link.php on line 1
    • > PHP Notice
      Undefined variable: thumb in wp-content/plugins/youtube-channel-gallery/templates/thumb.php on line 2
    • > PHP Notice
      Undefined variable: ytchag_thumb_ratio in wp-content/plugins/youtube-channel-gallery/templates/thumbs.php on line 1
    • > PHP Notice
      Trying to get property 'id' of non-object in wp-content/plugins/youtube-channel-gallery/templates/title.php on line 4
    • > PHP Notice
      Undefined variable: ytchag_width_value in wp-content/plugins/youtube-channel-gallery/templates/player.php on line 2
    • > PHP Notice
      Undefined variable: thumb in wp-content/plugins/youtube-channel-gallery/templates/thumb.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Please fix the following attributes:
  • Tags: Too many tags (13 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can look at the official readme.txt

youtube-channel-gallery/youtube-channel-gallery.php Passed 13 tests

"Youtube Channel Gallery" version 2.4's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
71 characters long description:
Show a youtube video and a gallery of thumbnails for a youtube channel.

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
No dangerous file extensions were detected5,058 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
PO File51,1801,8111,666
PHP103421371,616
CSS440121,353
JavaScript310639423

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity145.00
▷ Minimum class complexity145.00
▷ Maximum class complexity145.00
Average method complexity10.00
▷ Minimum method complexity1.00
▷ Maximum method complexity85.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods16
▷ Static methods00.00%
▷ Public methods1487.50%
▷ Protected methods00.00%
▷ Private methods212.50%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
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
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/play.png0.69KB0.63KB▼ 9.09%
img/private.png5.00KB2.24KB▼ 55.16%