68% simple-video-embed

Code Review | Simple Video Embed

WordPress plugin Simple Video Embed scored68%from 54 tests.

About plugin

  • Plugin page: simple-video-embed
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.3
  • WordPress version: 6.3.1
  • First release: Jun 29, 2015
  • Latest release: Sep 3, 2015
  • Number of updates: 26
  • Update frequency: every 3.6 days
  • Top authors: Almalerik (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /2,724 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.11MB] [CPU: ▼8.91ms] Passed 4 tests

This is a short check of server-side resources used by Simple Video Embed
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1242.97 ▼3.67
Dashboard /wp-admin3.43 ▲0.0850.22 ▼16.92
Posts /wp-admin/edit.php3.54 ▲0.1849.24 ▼3.48
Add New Post /wp-admin/post-new.php6.01 ▲0.1286.24 ▼11.55
Media Library /wp-admin/upload.php3.35 ▲0.1240.36 ▲2.73
Simple Video Embed /wp-admin/options-general.php?page=simple-video-embed3.3333.03

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 36 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

Simple Video Embed: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,880 ▲11913.96 ▼0.3914.02 ▲12.2744.48 ▲0.06
Dashboard /wp-admin2,204 ▲275.66 ▲0.0689.36 ▼11.2142.06 ▼1.86
Posts /wp-admin/edit.php2,109 ▲92.01 ▲0.0342.28 ▲4.9336.80 ▼2.43
Add New Post /wp-admin/post-new.php1,533 ▲523.04 ▼0.01695.47 ▲20.1054.11 ▼10.84
Media Library /wp-admin/upload.php1,406 ▲34.24 ▼0.02104.10 ▼2.5445.69 ▼3.39
Simple Video Embed /wp-admin/options-general.php?page=simple-video-embed9001.9923.8431.29

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Incomplete uninstall procedure, leaving 36 files (0.23MB) in the plugin directory
    • (new file) admin/index.php
    • (new file) admin/css/simple-video-embed-admin.css
    • (new file) admin/class-simple-video-embed-admin.php
    • (new file) admin/js/simple-video-embed-admin.js
    • (new file) README.txt
    • (new file) admin/partials/simple-video-embed-admin-display.php
    • (new file) admin/translations-mce.php
    • (new file) admin/js/simple-video-embed-mce.js
    • (new file) includes/class-simple-video-embed-activator.php
    • (new file) LICENSE.txt
    • ...
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% 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 0% 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
Almost there! Just fix the following items
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/simple-video-embed/public/partials/yt-playlist-no-thumb.php
    • > /wp-content/plugins/simple-video-embed/public/partials/yt-single-video.php
  • 6× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/simple-video-embed/public/partials/yt-playlist-thumb-columns.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/simple-video-embed/admin/partials/simple-video-embed-admin-display.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/simple-video-embed/public/class-simple-video-embed-public.php:167
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/simple-video-embed/public/partials/yt-playlist-video-slider.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/simple-video-embed/uninstall.php:28
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/simple-video-embed/public/partials/yt-playlist-thumb-slider.php:26

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === simple-video-embed === )
You can take inspiration from this readme.txt

simple-video-embed/simple-video-embed.php Passed 13 tests

The primary PHP file in "Simple Video Embed" version 1.0.4 is used by WordPress to initiate all plugin functionality
101 characters long description:
A simple plugin to embed responsive video and video playlist to posts or articles with nice features.

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 detected3,491 lines of code in 28 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript65009572,044
PHP192051,015826
CSS210437533
PO File1373888

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity5.78
▷ Minimum class complexity1.00
▷ Maximum class complexity33.00
Average method complexity1.96
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods46
▷ Static methods510.87%
▷ Public methods3984.78%
▷ Protected methods00.00%
▷ Private methods715.22%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
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
public/img/owl.video.play.png4.86KB2.74KB▼ 43.61%