77% you-video-gallery

Code Review | You Video Gallery

WordPress plugin You Video Gallery scored77%from 54 tests.

About plugin

  • Plugin page: you-video-gallery
  • Plugin version: 1.0.5.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.3
  • WordPress version: 6.3.1
  • First release: Jun 30, 2016
  • Latest release: Aug 13, 2023
  • Number of updates: 10
  • Update frequency: every 260.0 days
  • Top authors: Litonice13 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,791 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
Install script ran successfully

Server metrics [RAM: ▲0.10MB] [CPU: ▼5.06ms] Passed 4 tests

Server-side resources used by You Video Gallery
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1041.93 ▲0.06
Dashboard /wp-admin3.40 ▲0.1054.37 ▼0.85
Posts /wp-admin/edit.php3.51 ▲0.1648.44 ▼1.81
Add New Post /wp-admin/post-new.php5.98 ▲0.0983.52 ▼17.64
Media Library /wp-admin/upload.php3.32 ▲0.0941.11 ▲5.04
Video Gallery Plugin /wp-admin/options-general.php?page=youtube-video-gallery-plugin3.2933.64

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 44 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
can_compress_scripts
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by You Video Gallery
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲4514.29 ▼0.073.18 ▲1.3944.55 ▲6.02
Dashboard /wp-admin2,201 ▲275.59 ▲0.0196.68 ▲7.9542.57 ▲4.14
Posts /wp-admin/edit.php2,106 ▲61.99 ▼0.0338.42 ▲2.0930.40 ▼6.34
Add New Post /wp-admin/post-new.php1,533 ▲522.88 ▼0.28648.04 ▼1.9259.82 ▼6.38
Media Library /wp-admin/upload.php1,406 ▲64.13 ▼0.10101.55 ▲4.4643.61 ▼1.85
Video Gallery Plugin /wp-admin/options-general.php?page=youtube-video-gallery-plugin1,0712.0326.9846.63

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

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
Please fix the following items
  • 3× PHP files output text when accessed directly:
    • > /wp-content/plugins/you-video-gallery/includes/help.php
    • > /wp-content/plugins/you-video-gallery/admin/partials/plugin-name-admin-display.php
    • > /wp-content/plugins/you-video-gallery/public/partials/video-gallery-plugin-public-display.php
  • 10× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/you-video-gallery/includes/class-tgm-plugin-activation.php:2016
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_plugin_active() in wp-content/plugins/you-video-gallery/includes/easy-blocks.php:9
    • > PHP Warning
      Use of undefined constant VIDEO_GALLERY_PLUGIN_DIR - assumed 'VIDEO_GALLERY_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/you-video-gallery/includes/help.php on line 63
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/you-video-gallery/includes/easy-blocks.php on line 8
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/you-video-gallery/includes/help.php on line 1
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/you-video-gallery/includes/help.php on line 52
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/you-video-gallery/includes/help.php on line 49
    • > PHP Warning
      include_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/you-video-gallery/includes/easy-blocks.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/you-video-gallery/public/class-video-gallery-plugin-public.php:120
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHwp-admin/includes/plugin.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/you-video-gallery/includes/easy-blocks.php on line 8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Tags: You are using too many tags: 19 tag instead of maximum 10
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Post Shortcode Preview), #2 (Admin Shortcodes), #3 (Output Preview Video)
You can look at the official readme.txt

you-video-gallery/video-gallery-plugin.php 85% from 13 tests

The main PHP script in "You Video Gallery" version 1.0.5.1 is automatically included on every request by WordPress
You should first fix the following items:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("you-video-gallery.php" instead of "video-gallery-plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected2,916 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP157292,1252,231
JavaScript513782431
CSS333136254

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity25.29
▷ Minimum class complexity1.00
▷ Maximum class complexity195.00
Average method complexity3.48
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes14
▷ Abstract classes00.00%
▷ Concrete classes14100.00%
▷ Final classes00.00%
Methods137
▷ Static methods75.11%
▷ Public methods10979.56%
▷ Protected methods2316.79%
▷ Private methods53.65%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants457.14%
▷ Class constants342.86%
▷ Public constants3100.00%

Plugin size 0% from 2 tests

Image compression 0% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
10 PNG files occupy 0.91MB with 0.91MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
(invalid) public/css/preload-circle.png26.39KB0.00KB▼ 100.00%
(invalid) public/css/preload-quads.png12.33KB0.00KB▼ 100.00%
(invalid) public/css/preload-dots.png20.62KB0.00KB▼ 100.00%
(invalid) public/css/preload-ios.png47.94KB0.00KB▼ 100.00%
(invalid) admin/image/playlist_id.png50.95KB0.00KB▼ 100.00%