73% automatic-youtube-gallery

Code Review | Automatic YouTube Gallery

WordPress plugin Automatic YouTube Gallery scored73%from 54 tests.

About plugin

  • Plugin page: automatic-youtube...
  • Plugin version: 2.3.5
  • PHP compatiblity: 5.6.20+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.3
  • WordPress version: 6.3.1
  • First release: Dec 12, 2018
  • Latest release: Aug 7, 2023
  • Number of updates: 37
  • Update frequency: every 46.1 days
  • Top authors: plugins360 (100%)

Code review

54 tests

User reviews

19 reviews

Install metrics

6,000+ active /66,725 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: ▲5.50MB] [CPU: ▲30.23ms] 75% from 4 tests

Analyzing server-side resources used by Automatic YouTube Gallery
The following require your attention
  • Extra RAM: Extra memory usage should kept under 5MB (currently 5.50MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /9.22 ▲5.7671.97 ▲32.83
Dashboard /wp-admin9.24 ▲5.90141.11 ▲80.20
Posts /wp-admin/edit.php9.24 ▲5.8986.87 ▲37.81
Add New Post /wp-admin/post-new.php10.32 ▲4.43111.10 ▲16.97
Media Library /wp-admin/upload.php9.24 ▲6.0269.03 ▲33.32
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius9.2462.98

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 244 new files
Database: 1 new table, 17 new options
New tables
wp_ayg_videos
New WordPress options
widget_theysaidso_widget
fs_active_plugins
widget_ayg-widget
ayg_version
widget_recent-posts
ayg_general_settings
theysaidso_admin_options
fs_debug_mode
can_compress_scripts
ayg_livestream_settings
...

Browser metrics Passed 4 tests

A check of browser resources used by Automatic YouTube Gallery
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,992 ▲24614.83 ▲0.301.79 ▲0.2131.39 ▼9.15
Dashboard /wp-admin2,398 ▲2216.42 ▲0.84123.68 ▲37.6146.10 ▲9.10
Posts /wp-admin/edit.php2,330 ▲2303.66 ▲1.6559.55 ▲22.8340.65 ▲4.01
Add New Post /wp-admin/post-new.php6,425 ▲4,89928.59 ▲5.03910.33 ▲218.6338.19 ▼27.95
Media Library /wp-admin/upload.php1,466 ▲634.35 ▲0.1089.31 ▼11.1547.10 ▲2.24
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,2923.4042.4824.76

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/automatic-youtube-gallery/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • This plugin did not uninstall successfully, leaving 10 options in the database
    • fs_active_plugins
    • fs_accounts
    • widget_ayg-widget
    • widget_recent-comments
    • theysaidso_admin_options
    • fs_debug_mode
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 10× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sanitize_text_field() in wp-content/plugins/automatic-youtube-gallery/public/templates/pagination.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/automatic-youtube-gallery/public/templates/theme-livestream.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/automatic-youtube-gallery/admin/templates/settings.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/automatic-youtube-gallery/admin/templates/dashboard.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ayg_get_editor_fields() in wp-content/plugins/automatic-youtube-gallery/admin/templates/builder.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/automatic-youtube-gallery/admin/templates/api-key.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ayg_get_single_video_url() in wp-content/plugins/automatic-youtube-gallery/public/templates/thumbnail.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sanitize_text_field() in wp-content/plugins/automatic-youtube-gallery/public/templates/theme-single.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sanitize_text_field() in wp-content/plugins/automatic-youtube-gallery/public/templates/theme-classic.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/automatic-youtube-gallery/widget/templates/admin.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: youtube live, youtube embed, youtube channel, youtube gallery, youtube playlist

automatic-youtube-gallery/automatic-youtube-gallery.php 92% from 13 tests

The entry point to "Automatic YouTube Gallery" version 2.3.5 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Description: The description should be shorter than 140 characters (currently 158 characters long)

Code Analysis 97% from 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 detected65,388 lines of code in 176 files:
LanguageFilesBlank linesComment linesLines of code
PHP1428,59318,38435,680
JSON40028,034
JavaScript112662201,171
CSS179665483
XML10019
HTML1001

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Please fix the following
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity78.68
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.54
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes60
▷ Abstract classes23.33%
▷ Concrete classes5896.67%
▷ Final classes00.00%
Methods1,345
▷ Static methods19914.80%
▷ Public methods93569.52%
▷ Protected methods171.26%
▷ Private methods39329.22%
Functions123
▷ Named functions123100.00%
▷ Anonymous functions00.00%
Constants151
▷ Global constants10468.87%
▷ Class constants4731.13%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/images/logo.png1.51KB1.49KB▼ 1.23%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%