83% youtube-video-player

Code Review | YouTube Embed, Playlist and Popup by WpDevArt

WordPress plugin YouTube Embed, Playlist and Popup by WpDevArt scored83%from 54 tests.

About plugin

  • Plugin page: youtube-video-player
  • Plugin version: 2.6.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2.0-6.2
  • WordPress version: 6.3.1
  • First release: Feb 16, 2015
  • Latest release: Mar 31, 2023
  • Number of updates: 1
  • Update frequency: every 365.0 days

Code review

54 tests

User reviews

38 reviews

Install metrics

4,000+ active /631,216 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.31MB] [CPU: ▼1.61ms] Passed 4 tests

An overview of server-side resources used by YouTube Embed, Playlist and Popup by WpDevArt
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.79 ▲0.3343.71 ▼0.52
Dashboard /wp-admin3.62 ▲0.3150.18 ▲0.13
Posts /wp-admin/edit.php3.73 ▲0.3750.61 ▲6.07
Add New Post /wp-admin/post-new.php6.19 ▲0.3086.40 ▼12.13
Media Library /wp-admin/upload.php3.54 ▲0.3144.23 ▲9.92
Hire an Expert /wp-admin/admin.php?page=youtube-plus-hire-expert3.5136.50
Post/Page Defaults /wp-admin/admin.php?page=YouTube-Embed3.5137.07
Featured Plugins /wp-admin/admin.php?page=youtube-plus-featured-plugins3.5135.00
Widget Defaults /wp-admin/admin.php?page=youtube-plus-widget-default3.5241.30

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for YouTube Embed, Playlist and Popup by WpDevArt
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,956 ▲19514.35 ▼0.2813.54 ▲11.8641.23 ▲0.08
Dashboard /wp-admin2,242 ▲655.71 ▲0.1280.42 ▼24.0777.08 ▲33.13
Posts /wp-admin/edit.php2,143 ▲432.06 ▲0.1034.24 ▼2.2431.32 ▼3.24
Add New Post /wp-admin/post-new.php6,236 ▲4,70819.05 ▼4.04894.58 ▲222.0138.98 ▼13.91
Media Library /wp-admin/upload.php1,444 ▲414.20 ▼0.0494.92 ▼7.0078.71 ▲33.28
Hire an Expert /wp-admin/admin.php?page=youtube-plus-hire-expert9001.7723.7431.30
Post/Page Defaults /wp-admin/admin.php?page=YouTube-Embed1,3232.2132.8647.14
Featured Plugins /wp-admin/admin.php?page=youtube-plus-featured-plugins1,1471.9926.7943.12
Widget Defaults /wp-admin/admin.php?page=youtube-plus-widget-default1,3252.1730.1438.20

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 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
  • The uninstall procedure has failed, leaving 7 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_youtube_embed_widget
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options

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
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following items
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/youtube-video-player/front_end/front_end_widget.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/youtube-video-player/youtube-embed.php:29
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/youtube-video-player/admin/admin_menu.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: youtube widget, youtube embed, youtube playlist, youtube, youtube player

youtube-video-player/youtube-embed.php 85% from 13 tests

The main PHP file in "YouTube Embed, Playlist and Popup by WpDevArt" ver. 2.6.5 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Description: Please keep the plugin description shorter than 140 characters (currently 152 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("youtube-video-player.php" instead of "youtube-embed.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin3,966 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP9200861,946
CSS545641,601
JavaScript2461418
SVG1001

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity10.78
▷ Minimum class complexity1.00
▷ Maximum class complexity22.00
Average method complexity3.15
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods41
▷ Static methods00.00%
▷ Public methods3278.05%
▷ Protected methods00.00%
▷ Private methods921.95%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

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
42 PNG files occupy 0.51MB with 0.24MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/support.png2.21KB1.14KB▼ 48.50%
admin/images/featured_plugins/facebook-comments-icon.png35.96KB9.11KB▼ 74.67%
admin/styles/images/ui-icons_ffffff_256x240.png6.32KB4.18KB▼ 33.80%
admin/styles/images/ui-icons_222222_256x240.png6.84KB4.18KB▼ 38.88%
admin/styles/images/hire_expert/6.png4.20KB2.78KB▼ 33.81%