73% gallery-videos

Code Review | Video Gallery - Best WordPress YouTube Gallery Plugin

WordPress plugin Video Gallery - Best WordPress YouTube Gallery Plugin scored73%from 54 tests.

About plugin

  • Plugin page: gallery-videos
  • Plugin version: 2.1.6
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.4
  • WordPress version: 6.3.1
  • First release: Jul 8, 2016
  • Latest release: Nov 25, 2023
  • Number of updates: 224
  • Update frequency: every 12.0 days
  • Top authors: totalsoft (100%)

Code review

54 tests

User reviews

167 reviews

Install metrics

10,000+ active /588,259 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.85MB] [CPU: ▼3.94ms] Passed 4 tests

An overview of server-side resources used by Video Gallery - Best WordPress YouTube Gallery Plugin
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.13 ▲0.6740.59 ▼19.55
Dashboard /wp-admin4.25 ▲0.9550.03 ▲2.32
Posts /wp-admin/edit.php4.31 ▲0.9551.41 ▲2.21
Add New Post /wp-admin/post-new.php6.79 ▲0.9187.58 ▼0.72
Media Library /wp-admin/upload.php4.11 ▲0.8842.57 ▲12.21
Add Gallery /wp-admin/admin.php?page=tsvg-builder5.7742.69
All Galleries /wp-admin/admin.php?page=tsvg-admin4.0938.17

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 171 new files
Database: 2 new tables, 7 new options
New tables
wp_ts_galleryv_videos
wp_ts_galleryv_manager
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
widget_ts_video_gallery_widget
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Video Gallery - Best WordPress YouTube Gallery Plugin
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,930 ▲14313.39 ▼1.298.47 ▲6.6739.52 ▼4.52
Dashboard /wp-admin2,210 ▲395.52 ▲0.0195.33 ▲4.5374.98 ▲35.10
Posts /wp-admin/edit.php2,162 ▲592.25 ▲0.2740.67 ▼6.4231.88 ▼10.73
Add New Post /wp-admin/post-new.php1,580 ▲5023.35 ▲0.29707.54 ▲69.7237.64 ▼21.61
Media Library /wp-admin/upload.php1,421 ▲214.12 ▼0.07112.06 ▲6.9669.19 ▲22.87
Add Gallery /wp-admin/admin.php?page=tsvg-builder1,4703.3158.3890.31
All Galleries /wp-admin/admin.php?page=tsvg-admin1,1731.6325.2436.33

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The uninstall procedure failed, leaving 2 tables in the database
    • wp_ts_galleryv_manager
    • wp_ts_galleryv_videos
  • The uninstall procedure has failed, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_ts_video_gallery_widget
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 33× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/gallery-videos/public/theme_partials/tsvg-elastic-video-gallery.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/gallery-videos/public/theme_partials/tsvg-grid-video-gallery.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/gallery-videos/public/pagina_partials/tsvg-cp-video-gallery_pagination.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/gallery-videos/public/pagina_partials/tsvg-sp-video-gallery_pagination.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/gallery-videos/public/pagina_partials/tsvg-cl-video-gallery_pagination.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/gallery-videos/public/pagina_partials/tsvg-lb-video-gallery_pagination.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/gallery-videos/public/popup_partials/tsvg-gr-video-gallery_popup.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/gallery-videos/public/pagina_partials/tsvg-th-video-gallery_pagination.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/gallery-videos/public/popup_partials/tsvg-cp-video-gallery_popup.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/gallery-videos/public/popup_partials/tsvg-el-video-gallery_popup.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: wordpress gallery plugin, image gallery, gallery, video gallery, photo gallery

gallery-videos/index.php 92% from 13 tests

The entry point to "Video Gallery - Best WordPress YouTube Gallery Plugin" version 2.1.6 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("gallery-videos.php" instead of "index.php")

Code Analysis 97% from 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 plugin52,690 lines of code in 76 files:
LanguageFilesBlank linesComment linesLines of code
PHP401284234,127
CSS1206610,482
JavaScript1603567,776
SVG800305

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
These items need your attention
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 101)
Cyclomatic complexity
Average complexity per logical line of code0.06
Average class complexity33.60
▷ Minimum class complexity1.00
▷ Maximum class complexity163.00
Average method complexity4.90
▷ Minimum method complexity1.00
▷ Maximum method complexity101.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods71
▷ Static methods811.27%
▷ Public methods6591.55%
▷ Protected methods00.00%
▷ Private methods68.45%
Functions5
▷ Named functions360.00%
▷ Anonymous functions240.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
75 PNG files occupy 1.45MB with 0.63MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/img/fancy_gallery.png61.90KB17.57KB▼ 71.62%
public/Images/HTML5Player/lightbox-navcontrol.png0.18KB0.11KB▼ 40.44%
public/Images/HTML5Player/html5boxplayer_playpause.png1.18KB1.11KB▼ 6.02%
admin/img/elastic-gallery.png64.98KB17.69KB▼ 72.78%
public/Images/HTML5Player/html5boxplayer_playvideo.png1.71KB1.29KB▼ 24.46%