83% sharethis-reaction-buttons

Code Review | ShareThis Reaction Buttons

WordPress plugin ShareThis Reaction Buttons scored83%from 54 tests.

About plugin

  • Plugin page: sharethis-reactio...
  • Plugin version: 1.3.1
  • PHP version: 7.4.16
  • WordPress compatibility: 5.9-6.1.1
  • WordPress version: 6.3.1
  • First release: Mar 21, 2018
  • Latest release: Dec 1, 2022
  • Number of updates: 28
  • Update frequency: every 61.4 days
  • Top authors: ShareThis (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

700+ active /13,202 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.37MB] [CPU: ▲5.31ms] Passed 4 tests

This is a short check of server-side resources used by ShareThis Reaction Buttons
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.86 ▲0.3544.47 ▼0.34
Dashboard /wp-admin53.84 ▲50.4510,401,678.36 ▲10,401,602.36
Posts /wp-admin/edit.php3.81 ▲0.4155.84 ▲3.69
Add New Post /wp-admin/post-new.php6.31 ▲0.38110.46 ▲13.22
Media Library /wp-admin/upload.php3.62 ▲0.3439.76 ▲4.69

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 42 new files
Database: no new tables, 12 new options
New WordPress options
db_upgraded
sharethis_property_id
widget_recent-comments
sharethis_token
sharethis_first_product
sharethis_button_config
widget_recent-posts
widget_st_reaction_widget
can_compress_scripts
widget_theysaidso_widget
...

Browser metrics Passed 4 tests

Checking browser requirements for ShareThis Reaction Buttons
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,907 ▲14613.84 ▼0.52703.72 ▲702.1640.59 ▼0.11
Dashboard /wp-admin2,264 ▲844.95 ▼0.7090.13 ▼8.4239.30 ▼2.74
Posts /wp-admin/edit.php2,165 ▲652.43 ▲0.4051.36 ▲15.8034.33 ▲0.01
Add New Post /wp-admin/post-new.php6,269 ▲4,74326.23 ▲3.23880.82 ▲180.6778.75 ▲23.48
Media Library /wp-admin/upload.php1,465 ▲624.54 ▲0.34108.47 ▼1.2843.75 ▼6.68

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
These items require your attention
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_st_reaction_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means 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
Please fix the following items
  • 11× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/sharethis-reaction-buttons/templates/reaction-buttons/button-config.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/sharethis-reaction-buttons/templates/reaction-buttons/onoff-buttons.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/sharethis-reaction-buttons/templates/reaction-buttons/list.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function checked() in wp-content/plugins/sharethis-reaction-buttons/templates/minute-control/meta-box.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/sharethis-reaction-buttons/templates/reaction-buttons/reaction-button-settings.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'SharethisReactionButtons\\Plugin_Base' not found in wp-content/plugins/sharethis-reaction-buttons/php/class-plugin.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function SharethisReactionButtons\\trailingslashit() in wp-content/plugins/sharethis-reaction-buttons/php/class-plugin-base.php:149
    • > PHP Fatal error
      Uncaught Error: Call to undefined function SharethisReactionButtons\\trailingslashit() in wp-content/plugins/sharethis-reaction-buttons/php/class-plugin-base.php:149
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/sharethis-reaction-buttons/templates/reaction-buttons/shortcode-templatecode.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/sharethis-reaction-buttons/php/class-button-widget.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% 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 to be fixed:
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
Please take inspiration from this readme.txt

sharethis-reaction-buttons/sharethis-reaction-buttons.php 92% from 13 tests

The main PHP file in "ShareThis Reaction Buttons" ver. 1.3.1 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Domain Path: The domain path points to a folder that does not exist ("/languages")

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
Success! There were no dangerous files found in this plugin5,270 lines of code in 30 files:
LanguageFilesBlank linesComment linesLines of code
JSON3002,509
PHP142746551,306
CSS31565843
JavaScript4129180606
SVG6006

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity41.40
▷ Minimum class complexity4.00
▷ Maximum class complexity99.00
Average method complexity4.21
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes5
▷ Abstract classes120.00%
▷ Concrete classes480.00%
▷ Final classes00.00%
Methods63
▷ Static methods00.00%
▷ Public methods5180.95%
▷ Protected methods11.59%
▷ Private methods1117.46%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
7 PNG files occupy 0.54MB with 0.35MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/sharethis-setup-logo.png48.91KB20.52KB▼ 58.05%
assets/banner-772x250.png70.00KB17.94KB▼ 74.37%
assets/128x128.png11.83KB5.10KB▼ 56.92%
assets/256x256.png19.83KB7.48KB▼ 62.29%
assets/screenshot-3.png219.83KB62.38KB▼ 71.62%