77% gs-youtube-gallery

Code Review | Youtube Video Galleries with WP Youtube Gallery Plugin

WordPress plugin Youtube Video Galleries with WP Youtube Gallery Plugin scored77%from 54 tests.

About plugin

  • Plugin page: gs-youtube-gallery
  • Plugin version: 1.2.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-6.3
  • WordPress version: 6.3.1
  • First release: Mar 16, 2018
  • Latest release: Aug 30, 2023
  • Number of updates: 39
  • Update frequency: every 51.1 days
  • Top authors: samdani (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

100+ active /4,304 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.47MB] [CPU: ▲8.17ms] 75% from 4 tests

This is a short check of server-side resources used by Youtube Video Galleries with WP Youtube Gallery Plugin
Please take the time to fix the following items
  • CPU: Total CPU usage should be kept under 500.00ms (currently 644.82ms on /wp-admin/admin.php?page=gs-youtube-plugins-premium)
PageMemory (MB)CPU Time (ms)
Home /3.92 ▲0.4642.15 ▲4.66
Dashboard /wp-admin3.84 ▲0.5357.15 ▲7.26
Posts /wp-admin/edit.php3.89 ▲0.5358.03 ▲11.00
Add New Post /wp-admin/post-new.php6.33 ▲0.4498.31 ▲9.74
Media Library /wp-admin/upload.php3.67 ▲0.4449.16 ▲13.07
GS Plugins Lite /wp-admin/admin.php?page=gs-youtube-plugins-lite3.94674.91
YT Gallery Settings /wp-admin/admin.php?page=youtube-gallery-settings3.6638.15
GS Plugins Pro /wp-admin/admin.php?page=gs-youtube-plugins-premium3.82644.82
Help & Usage /wp-admin/admin.php?page=gs-youtube-plugins-help3.6637.59

Server storage [IO: ▲0.60MB] [DB: ▲0.04MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 20 new files
Database: no new tables, 8 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
db_upgraded
gs_youtubegalleries_style_settings
gs_youtubegalleries_settings
theysaidso_admin_options
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Youtube Video Galleries with WP Youtube Gallery Plugin
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,020 ▲27414.97 ▲0.601.71 ▼0.4148.27 ▲4.24
Dashboard /wp-admin2,404 ▲2166.62 ▲0.74129.72 ▲8.6692.98 ▲47.32
Posts /wp-admin/edit.php2,328 ▲2393.65 ▲1.6354.64 ▲16.0084.91 ▲47.55
Add New Post /wp-admin/post-new.php1,738 ▲22422.47 ▲4.98625.04 ▼50.0936.75 ▼20.98
Media Library /wp-admin/upload.php1,458 ▲704.29 ▲0.1082.39 ▼33.0885.58 ▲36.95
GS Plugins Lite /wp-admin/admin.php?page=gs-youtube-plugins-lite2,7353.3148.89148.81
YT Gallery Settings /wp-admin/admin.php?page=youtube-gallery-settings1,6215.5593.1695.72
GS Plugins Pro /wp-admin/admin.php?page=gs-youtube-plugins-premium2,4033.2252.6260.51
Help & Usage /wp-admin/admin.php?page=gs-youtube-plugins-help1,1453.1841.1539.83

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 8 options
    • gs_youtubegalleries_style_settings
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • gs_youtubegalleries_settings

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% 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
Almost there! Just fix the following items
  • 12× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/gs-youtube-gallery/gs_youtubegalleries.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'GS_Youtubegalleries_WeDevs_Settings_API' not found in wp-content/plugins/gs-youtube-gallery/gs-youtubegalleries-files/admin/gs_youtubegalleries_options_config.php:17
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/gs-youtube-gallery/gs-youtubegalleries-files/includes/templates/gs_ytgal_theme1_grid.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/gs-youtube-gallery/gs-youtubegalleries-files/gs-common-pages/gs-youtube-common-pages.php:3
    • > PHP Notice
      Undefined variable: gsytgal_json in wp-content/plugins/gs-youtube-gallery/gs-youtubegalleries-files/includes/templates/gs_ytgal_theme1_grid.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gs-youtube-gallery/gs-youtubegalleries-files/gs_youtubegalleries_scripts.php:17
    • > PHP Fatal error
      require_once(): Failed opening required 'GSYOUTUBEGALLERIES_FILES_DIR/includes/gs_youtubegalleries_shortcode.php' (include_path='.:/usr/share/php') in wp-content/plugins/gs-youtube-gallery/gs-youtubegalleries-files/includes/gs-youtube-root.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/gs-youtube-gallery/gs-youtubegalleries-files/includes/gs_youtubegalleries_shortcode.php:11
    • > PHP Warning
      Use of undefined constant GSYOUTUBEGALLERIES_FILES_DIR - assumed 'GSYOUTUBEGALLERIES_FILES_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/gs-youtube-gallery/gs-youtubegalleries-files/includes/gs-youtube-root.php on line 7
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/gs-youtube-gallery/gs-youtubegalleries-files/includes/templates/gs_ytgal_theme1_grid.php on line 10

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please take a look at the following user-side issues
    • > GET request to /wp-admin/admin.php?page=youtube-gallery-settings
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'ambient-light-sensor'.
    • > GET request to /wp-admin/admin.php?page=youtube-gallery-settings
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'bluetooth'.

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: youtube gallery plugin wordpress, youtube plugin, wp youtube gallery plugin, youtube, youtube gallery plugin

gs-youtube-gallery/gs_youtubegalleries.php 77% from 13 tests

The main file in "Youtube Video Galleries with WP Youtube Gallery Plugin" v. 1.2.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("gs-youtube-gallery.php" instead of "gs_youtubegalleries.php")
  • Description: The description should be shorter than 140 characters (currently 394 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected4,810 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
CSS5154252,208
PHP115396672,080
Sass11016521
SVG1001

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity32.80
▷ Minimum class complexity2.00
▷ Maximum class complexity67.00
Average method complexity2.42
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods99
▷ Static methods11.01%
▷ Public methods8282.83%
▷ Protected methods55.05%
▷ Private methods1212.12%
Functions18
▷ Named functions1688.89%
▷ Anonymous functions211.11%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
gs-youtubegalleries-files/assets/css/gs-youtube-icon.png0.84KB0.80KB▼ 4.76%