79% tiny-youtube-post-widget

Code Review | Tiny YouTube Post Widget

WordPress plugin Tiny YouTube Post Widget scored79%from 54 tests.

About plugin

  • Plugin page: tiny-youtube-post...
  • Plugin version: 3.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.6.1
  • WordPress version: 6.3.1
  • First release: Mar 19, 2015
  • Latest release: Oct 8, 2016
  • Number of updates: 23
  • Update frequency: every 24.7 days
  • Top authors: rnaby (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

10+ active /2,016 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.36MB] [CPU: ▲2.01ms] Passed 4 tests

An overview of server-side resources used by Tiny YouTube Post Widget
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.83 ▲0.3744.49 ▲0.52
Dashboard /wp-admin3.69 ▲0.3951.15 ▲1.10
Posts /wp-admin/edit.php3.74 ▲0.3951.24 ▲0.29
Add New Post /wp-admin/post-new.php6.23 ▲0.3497.50 ▲6.45
Media Library /wp-admin/upload.php3.55 ▲0.3241.21 ▲6.11

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 45 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-comments
widget_recent-posts
db_upgraded
widget_sodathemes-tiny-youtube-post-widget
sodathemes_typw_post_types
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Tiny YouTube Post Widget
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,907 ▲15014.03 ▼0.428.34 ▲6.3442.62 ▼9.68
Dashboard /wp-admin2,230 ▲425.14 ▼0.71113.65 ▲8.9043.13 ▲2.26
Posts /wp-admin/edit.php2,116 ▲272.29 ▲0.3240.52 ▲1.0933.92 ▼1.87
Add New Post /wp-admin/post-new.php6,298 ▲4,75619.77 ▲1.34851.09 ▲225.4358.31 ▼11.29
Media Library /wp-admin/upload.php1,409 ▲244.43 ▲0.22105.59 ▲0.9345.13 ▲1.98

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin does not fully uninstall, leaving 8 options in the database
    • db_upgraded
    • sodathemes_typw_post_types
    • widget_recent-comments
    • widget_recent-posts
    • widget_sodathemes-tiny-youtube-post-widget
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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 take a closer look at the following
  • 4× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/tiny-youtube-post-widget/admin/partials/tiny-youtube-post-widget-admin-display.php
    • > /wp-content/plugins/tiny-youtube-post-widget/public/partials/html-public-iframe.php
    • > /wp-content/plugins/tiny-youtube-post-widget/widget/views/partials/html-public-iframe.php
    • > /wp-content/plugins/tiny-youtube-post-widget/public/partials/tiny-youtube-post-widget-public-display.php
  • 19× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/tiny-youtube-post-widget/widget/views/partials/html-public-iframe.php on line 7
    • > PHP Notice
      Undefined variable: title in wp-content/plugins/tiny-youtube-post-widget/widget/views/partials/html-public-iframe.php on line 5
    • > PHP Notice
      Undefined variable: args in wp-content/plugins/tiny-youtube-post-widget/widget/views/partials/html-public-iframe.php on line 5
    • > PHP Notice
      Undefined variable: args in wp-content/plugins/tiny-youtube-post-widget/widget/views/partials/html-public-iframe.php on line 5
    • > PHP Notice
      Undefined variable: args in wp-content/plugins/tiny-youtube-post-widget/widget/views/partials/html-public-iframe.php on line 7
    • > PHP Notice
      Undefined variable: width in wp-content/plugins/tiny-youtube-post-widget/widget/views/partials/html-public-iframe.php on line 4
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/tiny-youtube-post-widget/widget/views/partials/html-public-iframe.php on line 5
    • > PHP Notice
      Undefined variable: height in wp-content/plugins/tiny-youtube-post-widget/public/partials/html-public-iframe.php on line 4
    • > PHP Notice
      Undefined variable: width in wp-content/plugins/tiny-youtube-post-widget/public/partials/html-public-iframe.php on line 4
    • > PHP Notice
      Undefined variable: video in wp-content/plugins/tiny-youtube-post-widget/public/partials/html-public-iframe.php on line 3

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

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
4 plugin tags: meta-box, youtube, video, widget

tiny-youtube-post-widget/tiny-youtube-post-widget.php Passed 13 tests

The main PHP file in "Tiny YouTube Post Widget" ver. 3.0.1 adds more information about the plugin and also serves as the entry point for this plugin
101 characters long description:
This is a widget to display different YouTube videos in widget assigned for different posts or pages.

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
Good job! No executable or dangerous file extensions detected2,166 lines of code in 30 files:
LanguageFilesBlank linesComment linesLines of code
PHP203541,3741,677
JavaScript457131371
PO File2182268
CSS4112850

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity26.50
▷ Minimum class complexity1.00
▷ Maximum class complexity202.00
Average method complexity3.20
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods116
▷ Static methods32.59%
▷ Public methods11195.69%
▷ Protected methods00.00%
▷ Private methods54.31%
Functions13
▷ Named functions13100.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.01MB with 0.00MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/images/delete-16.png1.74KB0.90KB▼ 48.23%
lib/images/remove.png2.15KB1.67KB▼ 22.25%
lib/images/edit.png1.54KB1.38KB▼ 10.34%
lib/images/add.png1.84KB1.49KB▼ 19.11%