83% on-the-fly-youtube-embeds

Code Review | On The Fly YouTube Embeds

WordPress plugin On The Fly YouTube Embeds scored83%from 54 tests.

About plugin

  • Plugin page: on-the-fly-youtub...
  • Plugin version: 1.1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 2.0.2-3.4.2
  • WordPress version: 6.3.1
  • First release: Oct 17, 2012
  • Latest release: Oct 23, 2012
  • Number of updates: 7
  • Update frequency: every 0.9 days
  • Top authors: Joe Anzalone (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /4,495 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼3.42ms] Passed 4 tests

Analyzing server-side resources used by On The Fly YouTube Embeds
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0243.24 ▼8.28
Dashboard /wp-admin3.33 ▲0.0347.76 ▼5.78
Posts /wp-admin/edit.php3.38 ▲0.0252.60 ▲2.19
Add New Post /wp-admin/post-new.php5.91 ▲0.0299.79 ▼0.82
Media Library /wp-admin/upload.php3.25 ▲0.0238.18 ▲1.20
OTF YouTube Embeds /wp-admin/options-general.php?page=on-the-fly-youtube-embeds/main.php3.2532.11

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for On The Fly YouTube Embeds
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.27 ▼0.011.80 ▼0.2644.58 ▼0.84
Dashboard /wp-admin2,199 ▲285.61 ▼0.0690.82 ▼7.3842.06 ▼2.96
Posts /wp-admin/edit.php2,104 ▲71.99 ▼0.0239.86 ▲1.7336.32 ▲0.55
Add New Post /wp-admin/post-new.php1,531 ▲523.22 ▲0.18674.38 ▼15.3052.14 ▲2.67
Media Library /wp-admin/upload.php1,398 ▲44.26 ▲0.0798.27 ▼9.6740.63 ▼7.15
OTF YouTube Embeds /wp-admin/options-general.php?page=on-the-fly-youtube-embeds/main.php1,0662.0126.3048.95

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% from 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 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
Please fix the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/on-the-fly-youtube-embeds/main.php:149

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Screenshots: These screenshots require images: #1 (Settings screen), #2 (This page was dynamically created simply by visiting http://JoeAnzalone.com/video/SCsKRbChILA/)
You can look at the official readme.txt

on-the-fly-youtube-embeds/main.php 85% from 13 tests

The principal PHP file in "On The Fly YouTube Embeds" v. 1.1.3 is loaded by WordPress automatically on each request
The following require your attention:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 150 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("on-the-fly-youtube-embeds.php" instead of "main.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
No dangerous file extensions were detected491 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP1119156414
CSS191163
JavaScript15114

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity41.00
▷ Minimum class complexity41.00
▷ Maximum class complexity41.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods20
▷ Static methods00.00%
▷ Public methods20100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
2 PNG files occupy 0.66MB with 0.47MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png155.65KB46.24KB▼ 70.29%
screenshot-2.png517.83KB141.94KB▼ 72.59%