78% ytshare

Code Review | YTShare

WordPress plugin YTShare scored78%from 54 tests.

About plugin

  • Plugin page: ytshare
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.8
  • WordPress version: 6.3.1
  • First release: Apr 21, 2014
  • Latest release: Apr 22, 2014
  • Number of updates: 7
  • Update frequency: every 0.1 days
  • Top authors: tomwhale (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /674 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

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

This is a short check of server-side resources used by YTShare
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0244.64 ▲0.39
Dashboard /wp-admin3.33 ▲0.0249.54 ▼6.28
Posts /wp-admin/edit.php3.38 ▲0.0257.92 ▲5.60
Add New Post /wp-admin/post-new.php5.91 ▲0.0290.45 ▼23.70
Media Library /wp-admin/upload.php3.25 ▲0.0240.30 ▲1.35
YTShare Settings /wp-admin/options-general.php?page=ytshare3.1935.52

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 11 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
can_compress_scripts
YTShareAdminOptions
db_upgraded
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for YTShare
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,901 ▲14013.47 ▼0.889.20 ▲7.4343.01 ▲0.44
Dashboard /wp-admin2,202 ▲255.62 ▼0.0488.88 ▲0.8339.65 ▼1.55
Posts /wp-admin/edit.php2,107 ▲42.00 ▲0.0154.72 ▲11.4047.05 ▲4.50
Add New Post /wp-admin/post-new.php1,531 ▲523.07 ▲0.09682.67 ▲69.0250.49 ▲0.90
Media Library /wp-admin/upload.php1,407 ▲44.21 ▲0.0299.98 ▼4.9340.52 ▼2.32
YTShare Settings /wp-admin/options-general.php?page=ytshare8312.0022.4531.70

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
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • YTShareAdminOptions
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=ytshare
    • > Notice in wp-content/plugins/ytshare/includes/class-admin.php+31
    Undefined index: heading
    • > GET request to /wp-admin/options-general.php?page=ytshare
    • > Notice in wp-content/plugins/ytshare/includes/class-admin.php+35
    Undefined index: subheading
    • > GET request to /wp-admin/options-general.php?page=ytshare
    • > Notice in wp-content/plugins/ytshare/includes/class-admin.php+39
    Undefined index: fbid
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=ytshare
    • > Notice in wp-content/plugins/ytshare/views/admin.php+33
    Undefined index: css

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/ytshare/includes/functions.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Contributors: Plugin contributors not specified
You can look at the official readme.txt

ytshare/ytshare.php Passed 13 tests

The primary PHP file in "YTShare" version 1.1 is used by WordPress to initiate all plugin functionality
55 characters long description:
A share box pops up when a video is paused or finishes.

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 plugin287 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP75223194
CSS18059
JavaScript13034

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity4.00
▷ Minimum class complexity3.00
▷ Maximum class complexity5.00
Average method complexity1.67
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
close.png1.17KB0.29KB▼ 74.83%