88% swiftninjapro-youtube-embed

Code Review | Smart YouTube and Twitch Embed

WordPress plugin Smart YouTube and Twitch Embed scored 88% from 54 tests.

About plugin

  • Plugin page: swiftninjapro-you...
  • Plugin version: 2.3.7
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.5
  • WordPress version: 5.8.1
  • First release: Mar 11, 2019
  • Latest release: Jan 14, 2021
  • Number of updates: 63
  • Update frequency: every 10.7 days
  • Top authors: swiftninjapro (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 2,518 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼139.60ms] Passed 4 tests

A check of server-side resources used by Smart YouTube and Twitch Embed
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.86 ▲0.1433.82 ▲13.65
Dashboard /wp-admin3.07 ▲0.0252.39 ▲4.48
Posts /wp-admin/edit.php3.13 ▲0.0243.48 ▼0.40
Add New Post /wp-admin/post-new.php5.43 ▼0.0091.88 ▼561.38
Media Library /wp-admin/upload.php3.02 ▲0.0131.45 ▼1.08
SwiftNinjaPro Settings /wp-admin/admin.php?page=swiftninjapro-settings3.0129.45
Youtube Embed /wp-admin/admin.php?page=swiftninjapro-youtube-embed3.0929.80

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 9 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Smart YouTube and Twitch Embed
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,740 ▲14415.99 ▲0.4111.16 ▲0.3450.44 ▲6.38
Dashboard /wp-admin2,996 ▲655.89 ▼0.05147.90 ▼16.89134.62 ▲28.06
Posts /wp-admin/edit.php2,776 ▲372.61 ▼0.1166.18 ▼16.2189.41 ▲2.02
Add New Post /wp-admin/post-new.php1,705 ▲3318.74 ▼0.16397.71 ▼4.78109.23 ▼2.04
Media Library /wp-admin/upload.php1,858 ▲485.03 ▲0.02134.07 ▼25.70131.85 ▲18.68
SwiftNinjaPro Settings /wp-admin/admin.php?page=swiftninjapro-settings1,0582.0850.9676.86
Youtube Embed /wp-admin/admin.php?page=swiftninjapro-youtube-embed1,2112.0952.9285.44

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
    • > GET request to /wp-admin/admin.php?page=swiftninjapro-youtube-embed
    • > Warning in wp-content/plugins/swiftninjapro-youtube-embed/templates/admin.php+94
    Cannot modify header information - headers already sent by (output started at wp-admin/includes/misc.php:1013)

SRP 50% 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
Please take a closer look at the following
  • 4× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/swiftninjapro-youtube-embed/templates/admin.php
    • > /wp-content/plugins/swiftninjapro-youtube-embed/main.php
    • > /wp-content/plugins/swiftninjapro-youtube-embed/swiftninjapro-youtube-embed.php
    • > /wp-content/plugins/swiftninjapro-youtube-embed/templates/settings-info.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
9 plugin tags: youtube, lazy load, twitch, video, embed...

swiftninjapro-youtube-embed/swiftninjapro-youtube-embed.php 92% from 13 tests

The entry point to "Smart YouTube and Twitch Embed" version 2.3.7 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 177 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin637 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP512039587
JavaScript12028
CSS11022

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.53
Average class complexity71.00
▷ Minimum class complexity22.00
▷ Maximum class complexity120.00
Average method complexity7.36
▷ Minimum method complexity1.00
▷ Maximum method complexity51.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods22
▷ Static methods00.00%
▷ Public methods22100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/settings_icon.png3.27KB1.85KB▼ 43.48%