90% simple-youtube-embed

Code Review | Simple YouTube Embed

WordPress plugin Simple YouTube Embed scored90%from 54 tests.

About plugin

  • Plugin page: simple-youtube-embed
  • Plugin version: 1.1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.3
  • WordPress version: 6.3.1
  • First release: Jul 17, 2014
  • Latest release: Sep 11, 2023
  • Number of updates: 50
  • Update frequency: every 66.9 days
  • Top authors: naa986 (100%)

Code review

54 tests

User reviews

15 reviews

Install metrics

7,000+ active /130,333 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.04MB] [CPU: ▼7.26ms] Passed 4 tests

A check of server-side resources used by Simple YouTube Embed
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0440.45 ▼0.41
Dashboard /wp-admin3.35 ▲0.0546.76 ▼8.75
Posts /wp-admin/edit.php3.40 ▲0.0546.21 ▼2.42
Add New Post /wp-admin/post-new.php5.93 ▲0.0586.75 ▼17.44
Media Library /wp-admin/upload.php3.27 ▲0.0535.59 ▼0.09
Simple YouTube Embed /wp-admin/options-general.php?page=simple-youtube-embed-settings3.2433.73

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
db_upgraded
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Simple YouTube Embed
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.54 ▲0.362.10 ▲0.3944.39 ▲3.77
Dashboard /wp-admin2,199 ▲195.56 ▼0.0486.72 ▼1.9241.41 ▼4.03
Posts /wp-admin/edit.php2,104 ▲11.98 ▼0.0539.42 ▼1.0735.52 ▼1.96
Add New Post /wp-admin/post-new.php1,536 ▲823.12 ▼0.14704.32 ▲49.2654.61 ▼11.90
Media Library /wp-admin/upload.php1,407 ▲44.18 ▼0.11110.60 ▲5.5249.58 ▲2.04
Simple YouTube Embed /wp-admin/options-general.php?page=simple-youtube-embed-settings8072.1428.1438.18

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
5 plugin tags: youtube, embed, video, iframe, responsive

simple-youtube-embed/main.php 92% from 13 tests

The main PHP script in "Simple YouTube Embed" version 1.1.0.4 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("simple-youtube-embed.php" instead of "main.php")

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
There were no executable files found in this plugin327 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP22221231
JavaScript3111562
CSS10034

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity15.00
▷ Minimum class complexity15.00
▷ Maximum class complexity15.00
Average method complexity2.56
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
extensions/images/simple-youtube-embed-advanced-parameters.png3.98KB2.00KB▼ 49.72%