84% youtube-embed

Code Review | YouTube Embed

WordPress plugin YouTube Embed scored84%from 54 tests.

About plugin

  • Plugin page: youtube-embed
  • Plugin version: 5.3
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.2
  • WordPress version: 6.3.1
  • First release: Jan 13, 2010
  • Latest release: Jul 22, 2023
  • Number of updates: 1,658
  • Update frequency: every 3.0 days
  • Top authors: dartiss (82.21%)Applian (11.16%)codedart (6.76%)

Code review

54 tests

User reviews

22 reviews

Install metrics

10,000+ active /731,431 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.28MB] [CPU: ▼4.05ms] Passed 4 tests

An overview of server-side resources used by YouTube Embed
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.75 ▲0.2945.03 ▲1.44
Dashboard /wp-admin3.58 ▲0.2748.26 ▼7.82
Posts /wp-admin/edit.php3.69 ▲0.3346.81 ▲1.23
Add New Post /wp-admin/post-new.php6.16 ▲0.2798.25 ▼11.03
Media Library /wp-admin/upload.php3.50 ▲0.2739.28 ▲6.83
Lists /wp-admin/admin.php?page=ye-list-options3.5137.54
Profiles /wp-admin/admin.php?page=ye-profile-options3.7342.24
YouTube Embed /wp-admin/options-general.php?page=ye-general-options3.5947.21

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 25 new files
Database: no new tables, 12 new options
New WordPress options
widget_recent-posts
youtube_embed_shortcode
youtube_embed_shortcode_site
youtube_embed_shortcode_admin
youtube_embed_version
widget_recent-comments
can_compress_scripts
youtube_embed_general
theysaidso_admin_options
widget_theysaidso_widget
...

Browser metrics Passed 4 tests

A check of browser resources used by YouTube Embed
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,848 ▲11313.28 ▼1.111.89 ▼0.2242.41 ▼8.61
Dashboard /wp-admin2,235 ▲504.85 ▼1.0198.29 ▼3.9938.25 ▼3.74
Posts /wp-admin/edit.php2,118 ▲292.00 ▲0.0438.17 ▲0.4436.33 ▲3.43
Add New Post /wp-admin/post-new.php1,555 ▲3623.17 ▲0.05682.99 ▲13.4253.17 ▼0.87
Media Library /wp-admin/upload.php1,417 ▲264.22 ▲0.0494.82 ▼3.7440.44 ▼2.13
Lists /wp-admin/admin.php?page=ye-list-options9432.0223.8832.75
Profiles /wp-admin/admin.php?page=ye-profile-options3,55216.69530.4786.40
YouTube Embed /wp-admin/options-general.php?page=ye-general-options1,4012.1927.4235.14

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Zombie WordPress options were found after uninstall: 7 options
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_youtube_embed_widget
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
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
Please fix the following
  • 9× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/youtube-embed/includes/add-scripts.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/youtube-embed/youtube-embed.php:31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/youtube-embed/includes/admin-config.php:35
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/youtube-embed/includes/options-general.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/youtube-embed/includes/generate-widgets.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/youtube-embed/includes/caching.php:64
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ye_get_profile() in wp-content/plugins/youtube-embed/includes/options-profiles.php:360
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/youtube-embed/includes/shortcodes.php:27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ye_get_list() in wp-content/plugins/youtube-embed/includes/options-lists.php:89

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
4 plugin tags: youtube, video, embed, insert

youtube-embed/youtube-embed.php Passed 13 tests

The primary PHP file in "YouTube Embed" version 5.3 is used by WordPress to initiate all plugin functionality
107 characters long description:
🎥 An incredibly fast, simple, yet powerful, method of embedding YouTube videos into your WordPress site.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin3,860 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP149058592,978
JavaScript318849848
CSS43034

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity9.00
▷ Minimum class complexity9.00
▷ Maximum class complexity9.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions59
▷ Named functions59100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/cross.png0.15KB0.18KB0.00%
images/tick.png0.15KB0.19KB0.00%