93% youtube-upload-widget

Code Review | YouTube Upload Widget

WordPress plugin YouTube Upload Widget scored 93% from 54 tests.

About plugin

  • Plugin page: youtube-upload-wi...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-3.5.1
  • WordPress version: 5.8.1
  • First release: Mar 29, 2013
  • Latest release: Apr 2, 2013
  • Number of updates: 13
  • Update frequency: every 0.2 days
  • Top authors: PeteMall (84.62%)aaroncampbell (23.08%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active / 8,260 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

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

A check of server-side resources used by YouTube Upload Widget
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.86 ▲0.0334.48 ▼6.61
Dashboard /wp-admin3.08 ▲0.0349.28 ▼1.57
Posts /wp-admin/edit.php3.14 ▲0.0349.40 ▼0.47
Add New Post /wp-admin/post-new.php5.44 ▲0.0190.97 ▼567.33
Media Library /wp-admin/upload.php3.03 ▲0.0336.28 ▲3.15

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 11 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for YouTube Upload Widget
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,679 ▲8415.99 ▲0.4611.99 ▲1.3247.14 ▼4.87
Dashboard /wp-admin2,973 ▲426.10 ▲0.12149.58 ▼11.34112.17 ▲1.12
Posts /wp-admin/edit.php2,739 ▼02.72 ▲0.0072.46 ▼2.3887.85 ▼16.97
Add New Post /wp-admin/post-new.php1,685 ▲218.48 ▼0.22391.25 ▼32.86114.06 ▲1.32
Media Library /wp-admin/upload.php1,807 ▼35.04 ▼0.00154.99 ▼14.11116.49 ▼3.61

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_print_scripts() in wp-content/plugins/youtube-upload-widget/yt-popup.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/youtube-upload-widget/youtube.php:36

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
6 plugin tags: record, webcam, google, video, youtube...

youtube-upload-widget/youtube.php 77% from 13 tests

The main file in "YouTube Upload Widget" v. 1.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Description: The description should be shorter than 140 characters (currently 341 characters long)
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: Name the main plugin file the same as the plugin slug ("youtube-upload-widget.php" instead of "youtube.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
Success! There were no dangerous files found in this plugin221 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP22745165
JavaScript131756

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity6.00
▷ Minimum class complexity6.00
▷ Maximum class complexity6.00
Average method complexity1.71
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
4 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/yt-icon.png2.28KB0.76KB▼ 66.77%
img/logo-icon-small-vflPKchsX.png8.79KB3.28KB▼ 62.74%
img/yt-icon-color.png2.44KB0.92KB▼ 62.23%
img/yt-brand-standard-logo.png3.61KB2.42KB▼ 33.05%