67% elex-embed-youtube-video-gallery

Code Review | ELEX Embed YouTube Video Gallery

WordPress plugin ELEX Embed YouTube Video Gallery scored67%from 54 tests.

About plugin

  • Plugin page: elex-embed-youtub...
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.1.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.1
  • WordPress version: 6.3.1
  • First release: Mar 7, 2023
  • Latest release: Mar 9, 2023
  • Number of updates: 3
  • Update frequency: every 0.7 days
  • Top authors: elextensions (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /262 total downloads

Benchmarks

Plugin footprint 65% 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: ▲1.45MB] [CPU: ▲6.08ms] Passed 4 tests

Analyzing server-side resources used by ELEX Embed YouTube Video Gallery
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.90 ▲1.4451.94 ▲0.73
Dashboard /wp-admin4.76 ▲1.4559.43 ▲1.05
Posts /wp-admin/edit.php4.87 ▲1.5167.38 ▲15.24
Add New Post /wp-admin/post-new.php7.33 ▲1.44110.60 ▲7.28
Media Library /wp-admin/upload.php4.70 ▲1.4757.39 ▲16.55
Gallery & Settings /wp-admin/admin.php?page=ehyt_settings5.0154.91
Go Premium! /wp-admin/admin.php?page=go-premium4.6742.41

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 1,196 new files
Database: 4 new tables, 10 new options
New tables
wp_elex_galleries
wp_elex_categories
wp_elex_gallery_source
wp_elex_gallery_videos
New WordPress options
db_upgraded
elex_yt_video_player_settings
widget_recent-posts
elex_yt_configuration_settings
elex-embed-youtube-video-gallery/elex-embed-youtube-video-gallery-basic.php_activation_date
theysaidso_admin_options
elex_yt_gallery_settings
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by ELEX Embed YouTube Video Gallery
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,391 ▲63014.93 ▲0.5611.19 ▲9.2842.75 ▼0.76
Dashboard /wp-admin2,602 ▲4255.39 ▼0.18115.57 ▲11.3888.10 ▲44.19
Posts /wp-admin/edit.php2,479 ▲3763.10 ▲1.1459.20 ▲21.7960.58 ▲24.97
Add New Post /wp-admin/post-new.php1,996 ▲47023.21 ▲0.15684.78 ▲11.9739.25 ▼29.93
Media Library /wp-admin/upload.php1,811 ▲4084.95 ▲0.76112.69 ▲1.5084.52 ▲35.41
Gallery & Settings /wp-admin/admin.php?page=ehyt_settings1,5992.9039.1654.72
Go Premium! /wp-admin/admin.php?page=go-premium1,4192.4035.0857.26

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie tables were found after uninstall: 4 tables
    • wp_elex_categories
    • wp_elex_gallery_source
    • wp_elex_gallery_videos
    • wp_elex_galleries
  • The uninstall procedure has failed, leaving 10 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • elex_yt_video_player_settings
    • elex_yt_configuration_settings
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • elex_yt_gallery_settings
    • elex-embed-youtube-video-gallery/elex-embed-youtube-video-gallery-basic.php_activation_date

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 4× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/elex-embed-youtube-video-gallery/resources/css/tab.php
    • > /wp-content/plugins/elex-embed-youtube-video-gallery/review_and_troubleshoot_notify/resources/logo.php
    • > /wp-content/plugins/elex-embed-youtube-video-gallery/resources/css/youtubeapi.php
    • > /wp-content/plugins/elex-embed-youtube-video-gallery/resources/view/gallery-list.php
  • 591× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Model' not found in wp-content/plugins/elex-embed-youtube-video-gallery/vendor/google/apiclient-services/src/YouTube/SuperChatEventSnippet.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Crypt\\Common\\AsymmetricKey' not found in wp-content/plugins/elex-embed-youtube-video-gallery/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC.php:54
    • > PHP Warning
      Class 'Google\\AuthHandler\\Guzzle5AuthHandler' not found in wp-content/plugins/elex-embed-youtube-video-gallery/vendor/google/apiclient/src/aliases.php on line 33
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Crypt\\EC\\BaseCurves\\Binary' not found in wp-content/plugins/elex-embed-youtube-video-gallery/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/sect113r1.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Log\\LoggerInterface' not found in wp-content/plugins/elex-embed-youtube-video-gallery/vendor/psr/log/Psr/Log/AbstractLogger.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Auth\\CredentialsLoader' not found in wp-content/plugins/elex-embed-youtube-video-gallery/vendor/google/auth/src/Credentials/ServiceAccountCredentials.php:61
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Crypt\\Common\\Formats\\Keys\\PuTTY' not found in wp-content/plugins/elex-embed-youtube-video-gallery/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/PuTTY.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Model' not found in wp-content/plugins/elex-embed-youtube-video-gallery/vendor/google/apiclient-services/src/YouTube/ChannelToStoreLinkDetails.php:20
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/elex-embed-youtube-video-gallery/elex-embed-youtube-video-gallery-basic.php on line 16
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Crypt\\EC\\BaseCurves\\KoblitzPrime' not found in wp-content/plugins/elex-embed-youtube-video-gallery/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/secp256k1.php:23

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 86% 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
Attributes that require attention:
  • Donate link: Invalid URI ("")
Please take inspiration from this readme.txt

elex-embed-youtube-video-gallery/elex-embed-youtube-video-gallery-basic.php 77% from 13 tests

"ELEX Embed YouTube Video Gallery" version 1.0.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Domain Path: The domain path folder was not found ("/lang")
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("elex-embed-youtube-video-gallery.php" instead of "elex-embed-youtube-video-gallery-basic.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected137,325 lines of code in 1,119 files:
LanguageFilesBlank linesComment linesLines of code
PHP94014,05552,74394,348
JSON231016,757
CSS1142221113,429
Markdown301,82305,486
JavaScript245071735,463
Sass37086940
SVG7702676
YAML6255103
XML210461
Python117349
Dockerfile18010
Bourne Shell1203

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
The following items need your attention
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity10.84
▷ Minimum class complexity1.00
▷ Maximum class complexity670.00
Average method complexity2.56
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces86
Interfaces38
Traits13
Classes850
▷ Abstract classes21725.53%
▷ Concrete classes63374.47%
▷ Final classes528.21%
Methods5,538
▷ Static methods78214.12%
▷ Public methods4,63083.60%
▷ Protected methods3947.11%
▷ Private methods5149.28%
Functions238
▷ Named functions7732.35%
▷ Anonymous functions16167.65%
Constants649
▷ Global constants9114.02%
▷ Class constants55885.98%
▷ Public constants55098.57%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
25 PNG files occupy 2.08MB with 1.36MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
resources/images/logo/Embed YouTube Video gallery Premium.png82.93KB20.84KB▼ 74.87%
resources/images/logo/ship calculator.png102.70KB27.53KB▼ 73.19%
resources/images/logo/Stamps.com.png145.14KB39.72KB▼ 72.64%
resources/icon/right-arrow.png0.23KB0.16KB▼ 31.20%
resources/images/logo/Youtube optimizer.png80.45KB19.62KB▼ 75.61%