83% subscribe-bar-youtube

Code Review | YouTube Subscribe Bar

WordPress plugin YouTube Subscribe Bar scored 83% from 54 tests.

About plugin

  • Plugin page: subscribe-bar-you...
  • Plugin version: 1.1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-5.8
  • WordPress version: 6.3.1
  • First release: Feb 21, 2018
  • Latest release: Jul 30, 2021
  • Number of updates: 5
  • Update frequency: every 251.0 days
  • Top authors: peterwilsoncc (80%)deb255 (40%)

Code review

54 tests

User reviews

3 reviews

Install metrics

200+ active / 5,534 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼3.21ms] Passed 4 tests

This is a short check of server-side resources used by YouTube Subscribe Bar
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0336.86 ▼5.62
Dashboard /wp-admin3.32 ▲0.0247.49 ▼2.78
Posts /wp-admin/edit.php3.37 ▲0.0245.20 ▼3.79
Add New Post /wp-admin/post-new.php5.90 ▲0.0297.74 ▲2.74
Media Library /wp-admin/upload.php3.25 ▲0.0234.48 ▼0.66
YouTube Subscribe Bar /wp-admin/options-general.php?page=youtube-subscribe-bar3.2832.99

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 26 new files
Database: no new tables, 7 new options
New WordPress options
youtube-subscribe-bar-settings
db_upgraded
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

YouTube Subscribe Bar: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,851 ▲11613.28 ▼1.124.35 ▲2.7241.15 ▼7.98
Dashboard /wp-admin2,230 ▲424.91 ▼0.02105.08 ▼6.2044.17 ▲0.59
Posts /wp-admin/edit.php2,113 ▲212.03 ▲0.0536.35 ▼3.7834.18 ▼2.55
Add New Post /wp-admin/post-new.php1,560 ▲1818.25 ▲0.18603.55 ▼32.4358.82 ▲4.31
Media Library /wp-admin/upload.php1,412 ▲244.29 ▲0.0393.28 ▼10.5242.09 ▼1.96
YouTube Subscribe Bar /wp-admin/options-general.php?page=youtube-subscribe-bar1,1952.3943.2130.02

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget

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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 5× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Notice
      Undefined variable: saved_state in wp-content/plugins/subscribe-bar-youtube/views/admin_view.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/subscribe-bar-youtube/views/admin_view.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/subscribe-bar-youtube/views/view.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/subscribe-bar-youtube/views/admin_view_sidebar.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/subscribe-bar-youtube/views/activate_welcome_view.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed: Please take inspiration from this readme.txt

subscribe-bar-youtube/youtube-subscribe-bar.php 85% from 13 tests

The main PHP script in "YouTube Subscribe Bar" version 1.1.0 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("subscribe-bar-youtube.php" instead of "youtube-subscribe-bar.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin817 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
PHP17154379812
CSS2002
JavaScript2002
JSON1001

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity14.33
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.74
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods47
▷ Static methods48.51%
▷ Public methods4697.87%
▷ Protected methods00.00%
▷ Private methods12.13%
Functions3
▷ Named functions266.67%
▷ Anonymous functions133.33%
Constants3
▷ Global constants3100.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
No PNG files were detected