84% ytsubcount

Code Review | Display YouTube sub button and count

WordPress plugin Display YouTube sub button and count scored84%from 54 tests.

About plugin

  • Plugin page: ytsubcount
  • Plugin version: 1.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-5.9
  • WordPress version: 6.3.1
  • First release: Apr 27, 2022
  • Latest release: May 3, 2022
  • Number of updates: 5
  • Update frequency: every 1.2 days
  • Top authors: nadalubbad (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,094 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
Installer ran successfully

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

Analyzing server-side resources used by Display YouTube sub button and count
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0343.16 ▼0.09
Dashboard /wp-admin3.34 ▲0.0350.38 ▼2.10
Posts /wp-admin/edit.php3.39 ▲0.0350.12 ▼0.89
Add New Post /wp-admin/post-new.php5.92 ▲0.0389.94 ▼19.13
Media Library /wp-admin/upload.php3.26 ▲0.0339.98 ▲2.10

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Display YouTube sub button and count
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,822 ▲6114.47 ▼0.286.83 ▲4.9645.17 ▲1.01
Dashboard /wp-admin2,195 ▲155.64 ▼0.0385.22 ▼5.3442.26 ▼1.26
Posts /wp-admin/edit.php2,100 ▲32.05 ▲0.0436.54 ▲0.2934.04 ▲1.02
Add New Post /wp-admin/post-new.php1,531 ▼2323.43 ▲5.23683.45 ▲57.1651.36 ▼11.45
Media Library /wp-admin/upload.php1,391 ▼34.21 ▼0.0597.10 ▼6.9243.87 ▼1.85

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_youtubesubscount_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
Almost there! Just fix the following items
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ytsubcount/inc/displaysubcount-scripts.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/ytsubcount/inc/displaysubcount-class.php:3

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 93% 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
3 plugin tags: count, channel, subscription

ytsubcount/display-youtube-subs-count.php 85% from 13 tests

"Display YouTube sub button and count" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes
  • Main file name: Name the main plugin file the same as the plugin slug ("ytsubcount.php" instead of "display-youtube-subs-count.php")

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
Good job! No executable or dangerous file extensions detected107 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP32810106
JavaScript1001

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.30
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%
Constants0
▷ Global constants00.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