84% social-counts-youtube

Code Review | Social Counts - Youtube

WordPress plugin Social Counts - Youtube scored84%from 54 tests.

About plugin

  • Plugin page: social-counts-you...
  • Plugin version: 2.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-6.2.2
  • WordPress version: 6.3.1
  • First release: Feb 4, 2019
  • Latest release: Jun 8, 2023
  • Number of updates: 3
  • Update frequency: every 528.7 days
  • Top authors: milindaudichya (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /512 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

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

This is a short check of server-side resources used by Social Counts - Youtube
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0334.53 ▼3.59
Dashboard /wp-admin3.34 ▲0.0349.69 ▲3.24
Posts /wp-admin/edit.php3.39 ▲0.0347.51 ▼2.29
Add New Post /wp-admin/post-new.php5.92 ▲0.0382.01 ▼12.76
Media Library /wp-admin/upload.php3.27 ▲0.0332.71 ▲0.35

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 6 new files
Database: no new tables, 7 new options
New WordPress options
widget_socialcounts_widget
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Social Counts - Youtube
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,822 ▲3614.37 ▼0.165.87 ▲3.7438.98 ▼6.15
Dashboard /wp-admin2,195 ▲185.64 ▼0.0196.60 ▲8.6142.30 ▼0.29
Posts /wp-admin/edit.php2,100 ▼01.95 ▼0.0739.88 ▲4.3034.38 ▼1.21
Add New Post /wp-admin/post-new.php1,526 ▼1023.65 ▲0.71705.74 ▼4.1459.65 ▼3.20
Media Library /wp-admin/upload.php1,403 ▲34.21 ▲0.0598.44 ▼6.8845.36 ▼0.53

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-posts
    • widget_socialcounts_widget
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options

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)
Even though everything seems fine, this is not an exhaustive test

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 fix the following items
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/social-counts-youtube/includes/socialcounts-class.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/social-counts-youtube/includes/socialcounts-scripts.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention: You can take inspiration from this readme.txt

social-counts-youtube/socialcounts.php 92% from 13 tests

The entry point to "Social Counts - Youtube" version 2.0.0 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("social-counts-youtube.php" instead of "socialcounts.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected138 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP34049137
JavaScript1001

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity19.00
▷ Minimum class complexity19.00
▷ Maximum class complexity19.00
Average method complexity5.50
▷ Minimum method complexity1.00
▷ Maximum method complexity12.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

Using a strong compression for your PNG files is a great way to speed-up your plugin
There were not PNG files found in your plugin