90% wp-youtube-video-optimizer

Code Review | WP YouTube Video Optimizer

WordPress plugin WP YouTube Video Optimizer scored90%from 54 tests.

About plugin

  • Plugin page: wp-youtube-video-...
  • Plugin version: 1.2
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-4.9.6
  • WordPress version: 6.3.1
  • First release: Jul 20, 2017
  • Latest release: May 23, 2018
  • Number of updates: 19
  • Update frequency: every 16.2 days
  • Top authors: measuremarketing (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

50+ active /1,333 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: ▲0.01MB] [CPU: ▼5.79ms] Passed 4 tests

An overview of server-side resources used by WP YouTube Video Optimizer
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0142.94 ▲0.55
Dashboard /wp-admin3.31 ▲0.0146.90 ▼2.67
Posts /wp-admin/edit.php3.37 ▲0.0144.09 ▼2.62
Add New Post /wp-admin/post-new.php5.90 ▲0.0180.11 ▼18.43
Media Library /wp-admin/upload.php3.24 ▲0.0134.25 ▲1.40

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for WP YouTube Video Optimizer
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.05 ▼0.352.06 ▲0.3844.20 ▲1.26
Dashboard /wp-admin2,192 ▲155.56 ▼0.1098.77 ▼0.1644.21 ▼3.73
Posts /wp-admin/edit.php2,100 ▼01.96 ▼0.0334.85 ▲0.8334.67 ▼1.77
Add New Post /wp-admin/post-new.php1,535 ▲918.35 ▼4.65632.03 ▼40.6965.10 ▲7.19
Media Library /wp-admin/upload.php1,403 ▲64.21 ▲0.0797.30 ▼7.6141.68 ▼4.47

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
8 plugin tags: youtube, embed, optimised youtube video, performance, speed...

wp-youtube-video-optimizer/wp-youtube-video-optimizer.php 92% from 13 tests

The main PHP file in "WP YouTube Video Optimizer" ver. 1.2 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 167 characters long)

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
There were no executable files found in this plugin78 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP15837
CSS10034
JavaScript1007

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.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 Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
3 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/play-icons.png6.06KB3.00KB▼ 50.54%
assets/img/play-black.png13.56KB10.70KB▼ 21.09%
assets/img/play-red.png31.52KB21.03KB▼ 33.28%