84% video-widget-ytb-for-wp

Code Review | Video Widget YTB For WP

WordPress plugin Video Widget YTB For WP scored84%from 54 tests.

About plugin

  • Plugin page: video-widget-ytb-...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-4.7.5
  • WordPress version: 6.3.1
  • First release: Nov 23, 2015
  • Latest release: Aug 4, 2016
  • Number of updates: 8
  • Update frequency: every 70.4 days
  • Top authors: enqtran (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /1,927 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼0.83ms] Passed 4 tests

An overview of server-side resources used by Video Widget YTB For WP
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0343.04 ▲3.75
Dashboard /wp-admin3.33 ▲0.0350.02 ▼4.30
Posts /wp-admin/edit.php3.38 ▲0.0348.10 ▼0.38
Add New Post /wp-admin/post-new.php5.91 ▲0.0392.02 ▼2.39
Media Library /wp-admin/upload.php3.26 ▲0.0341.07 ▲4.17

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 5 new files
Database: no new tables, 7 new options
New WordPress options
widget_youtube_enqtran_widget
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Video Widget YTB For WP
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5413.34 ▼1.044.48 ▲2.8035.89 ▼4.79
Dashboard /wp-admin2,221 ▲185.84 ▲0.92100.70 ▼19.0242.64 ▼3.60
Posts /wp-admin/edit.php2,100 ▼02.02 ▲0.0138.24 ▼0.4934.48 ▼0.92
Add New Post /wp-admin/post-new.php1,545 ▲1423.16 ▼0.24658.45 ▼5.6851.47 ▼7.11
Media Library /wp-admin/upload.php1,394 ▼64.26 ▲0.07101.02 ▼0.0844.25 ▼4.12

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_youtube_enqtran_widget
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

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
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/video-widget-ytb-for-wp/plugin_video_widget_ytb_for_wp.php:19

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% 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 your attention:
  • Screenshots: Please add images for these screenshots: #1 (screenshot-1.png), #2 (screenshot-2.png)
Please take inspiration from this readme.txt

video-widget-ytb-for-wp/plugin_video_widget_ytb_for_wp.php 92% from 13 tests

"Video Widget YTB For WP" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("video-widget-ytb-for-wp.php" instead of "plugin_video_widget_ytb_for_wp.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected144 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1829144

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.11
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.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
2 PNG files occupy 0.07MB with 0.04MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png44.94KB17.22KB▼ 61.68%
screenshot-1.png22.75KB9.67KB▼ 57.49%