79% enhanced-youtube-embed

Code Review | Enhanced YouTube Embed

WordPress plugin Enhanced YouTube Embed scored79%from 54 tests.

About plugin

  • Plugin page: enhanced-youtube-...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.7
  • WordPress version: 6.3.1
  • First release: May 4, 2021
  • Latest release: May 4, 2021
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: stevepuddick (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /444 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲1.10MB] [CPU: ▼3.07ms] Passed 4 tests

Analyzing server-side resources used by Enhanced YouTube Embed
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.82 ▲1.3647.45 ▲0.04
Dashboard /wp-admin4.71 ▲1.4059.91 ▲11.74
Posts /wp-admin/edit.php4.72 ▲1.3664.45 ▲9.99
Add New Post /wp-admin/post-new.php6.18 ▲0.2960.44 ▼34.05
Media Library /wp-admin/upload.php4.60 ▲1.3749.29 ▲13.78

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 473 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Enhanced YouTube Embed
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,180 ▲43419.16 ▲4.984.89 ▲2.8436.18 ▼7.01
Dashboard /wp-admin2,486 ▲2959.25 ▲4.38194.16 ▲89.4741.97 ▲5.10
Posts /wp-admin/edit.php2,411 ▲3256.16 ▲4.1086.39 ▲48.7036.43 ▲2.83
Add New Post /wp-admin/post-new.php6,237 ▲4,70321.99 ▼1.42972.25 ▲283.7148.51 ▼14.40
Media Library /wp-admin/upload.php1,538 ▲1536.59 ▲2.41112.70 ▲13.0546.06 ▲1.01

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/enhanced-youtube-embed/public/partials/enhanced-youtube-embed-public-display.php
    • > /wp-content/plugins/enhanced-youtube-embed/vendor/htmlburger/carbon-fields/templates/Exception/incorrect-syntax.php
    • > /wp-content/plugins/enhanced-youtube-embed/admin/partials/enhanced-youtube-embed-admin-display.php
  • 112× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Container\\Condition\\Condition' not found in wp-content/plugins/enhanced-youtube-embed/vendor/htmlburger/carbon-fields/core/Container/Condition/Post_Format_Condition.php:10
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/enhanced-youtube-embed/vendor/htmlburger/carbon-fields/templates/Container/comment_meta.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Field\\Field' not found in wp-content/plugins/enhanced-youtube-embed/vendor/htmlburger/carbon-fields/core/Field/Complex_Field.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Container' not found in wp-content/plugins/enhanced-youtube-embed/vendor/htmlburger/carbon-fields/core/Block.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Datastore\\Key_Value_Datastore' not found in wp-content/plugins/enhanced-youtube-embed/vendor/htmlburger/carbon-fields/core/Datastore/Theme_Options_Datastore.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Container\\Condition\\Condition' not found in wp-content/plugins/enhanced-youtube-embed/vendor/htmlburger/carbon-fields/core/Container/Condition/Term_Condition.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Field\\Predefined_Options_Field' not found in wp-content/plugins/enhanced-youtube-embed/vendor/htmlburger/carbon-fields/core/Field/Select_Field.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Field\\Field' not found in wp-content/plugins/enhanced-youtube-embed/vendor/htmlburger/carbon-fields/core/Field/Broken_Field.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Field\\Field' not found in wp-content/plugins/enhanced-youtube-embed/vendor/htmlburger/carbon-fields/core/Field/Html_Field.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Field\\Field' not found in wp-content/plugins/enhanced-youtube-embed/vendor/htmlburger/carbon-fields/core/Field/Media_Gallery_Field.php:14

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 Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
3 plugin tags: video, youtube, embed

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

"Enhanced YouTube Embed" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
83 characters long description:
Additional options and settings for embedding YouTube videos with the block editor.

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 detected28,092 lines of code in 419 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1735,1928,51312,939
PHP1562,6027,2059,065
PO File268191,0202,202
Sass4833901,769
CSS93301,1471,689
JSON400360
Markdown324068

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity8.18
▷ Minimum class complexity1.00
▷ Maximum class complexity50.00
Average method complexity2.05
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces22
Interfaces5
Traits0
Classes129
▷ Abstract classes118.53%
▷ Concrete classes11891.47%
▷ Final classes10.85%
Methods927
▷ Static methods929.92%
▷ Public methods75281.12%
▷ Protected methods16517.80%
▷ Private methods101.08%
Functions106
▷ Named functions2422.64%
▷ Anonymous functions8277.36%
Constants29
▷ Global constants620.69%
▷ Class constants2379.31%
▷ Public constants23100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin