78% yt-subscribe-button

Code Review | YT Subscribe Button

WordPress plugin YT Subscribe Button scored78%from 54 tests.

About plugin

  • Plugin page: yt-subscribe-button
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-4.9.8
  • WordPress version: 6.3.1
  • First release: Oct 24, 2018
  • Latest release: Oct 25, 2018
  • Number of updates: 6
  • Update frequency: every 0.3 days
  • Top authors: officialnadir (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /604 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼0.27MB] [CPU: ▼12.05ms] Passed 4 tests

A check of server-side resources used by YT Subscribe Button
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.09 ▼1.415.26 ▼35.21
Dashboard /wp-admin3.49 ▲0.1148.04 ▼19.04
Posts /wp-admin/edit.php3.60 ▲0.2150.13 ▲1.82
Add New Post /wp-admin/post-new.php5.98 ▲0.06106.28 ▲4.24
Media Library /wp-admin/upload.php3.41 ▲0.1538.64 ▲5.05

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: no files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_ytsubscribebutton_widget
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for YT Subscribe Button
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,834 ▲8814.02 ▼0.356.60 ▲4.7943.32 ▼1.86
Dashboard /wp-admin2,220 ▲355.03 ▲0.14111.40 ▼1.9748.20 ▲3.51
Posts /wp-admin/edit.php2,103 ▲142.49 ▲0.4338.21 ▲1.9534.05 ▼3.25
Add New Post /wp-admin/post-new.php1,525 ▼823.18 ▲0.14601.90 ▼87.2856.76 ▲1.40
Media Library /wp-admin/upload.php1,399 ▲84.34 ▲0.1296.81 ▼1.3539.11 ▼4.69

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Zombie WordPress options were found after uninstall: 7 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • widget_ytsubscribebutton_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/yt-subscribe-button/YTSubscribeButton.php
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/yt-subscribe-button/includes/YTSubscribeButton-class.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/yt-subscribe-button/includes/YTSubscribeButton-scripts.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
2 plugin tags: youtube widgets, youtube subscribe buttons

yt-subscribe-button/YTSubscribeButton.php 92% from 13 tests

This is the main PHP file of "YT Subscribe Button" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("yt-subscribe-button.php" instead of "YTSubscribeButton.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
There were no executable files found in this plugin140 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP34851124
Markdown19016

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity14.00
▷ Minimum class complexity14.00
▷ Maximum class complexity14.00
Average method complexity4.25
▷ Minimum method complexity1.00
▷ Maximum method complexity9.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%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin