83% faster-youtube-embed

Code Review | Faster YouTube Embed

WordPress plugin Faster YouTube Embed scored 83% from 54 tests.

About plugin

  • Plugin page: faster-youtube-embed
  • Plugin version: 1.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Jun 22, 2021
  • Latest release: Aug 1, 2023
  • Number of updates: 11
  • Update frequency: every 70.1 days
  • Top authors: htplugins (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active / 1,508 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.12MB] [CPU: ▼3.25ms] Passed 4 tests

This is a short check of server-side resources used by Faster YouTube Embed
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1335.18 ▼14.10
Dashboard /wp-admin3.40 ▲0.0943.90 ▼4.31
Posts /wp-admin/edit.php3.51 ▲0.1546.64 ▲1.83
Add New Post /wp-admin/post-new.php6.28 ▲0.3988.81 ▲8.46
Media Library /wp-admin/upload.php3.32 ▲0.0934.29 ▲3.57

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 16 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_htfaster_youtube_embed_default_widget
db_upgraded
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

Faster YouTube Embed: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,970 ▲22420.74 ▲6.31136.73 ▲135.1948.79 ▲11.19
Dashboard /wp-admin2,206 ▲185.83 ▼0.0799.67 ▼5.2339.71 ▼5.75
Posts /wp-admin/edit.php2,089 ▼32.00 ▼0.0139.17 ▲1.6835.54 ▼0.21
Add New Post /wp-admin/post-new.php6,415 ▲4,90121.11 ▲3.57867.25 ▲261.6436.23 ▼12.87
Media Library /wp-admin/upload.php1,385 ▼04.17 ▼0.02100.13 ▼0.9943.19 ▲1.77

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_htfaster_youtube_embed_default_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget

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
Even though everything seems fine, this is not an exhaustive test

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
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/faster-youtube-embed/include/default_widgets.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/faster-youtube-embed/include/youtube_shortcode.php:67
    • > PHP Fatal error
      Uncaught Error: Call to undefined function FasterYoutube\\Block\\add_action() in wp-content/plugins/faster-youtube-embed/block/block-init.php:32

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 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
5 plugin tags: embed videos, youtube embed, video embed, youtube video, video

faster-youtube-embed/youtube-embed.php 77% from 13 tests

The entry point to "Faster YouTube Embed" version 1.0.6 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 169 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("faster-youtube-embed.php" instead of "youtube-embed.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

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
No dangerous file extensions were detected12,270 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
JSON22011,682
PHP79186424
JavaScript3255392
CSS10072

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity6.25
▷ Minimum class complexity2.00
▷ Maximum class complexity9.00
Average method complexity1.78
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods27
▷ Static methods27.41%
▷ Public methods2385.19%
▷ Protected methods27.41%
▷ Private methods27.41%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants1090.91%
▷ Class constants19.09%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin