84% sharethis-share-buttons

Code Review | ShareThis Share Buttons

WordPress plugin ShareThis Share Buttons scored84%from 54 tests.

About plugin

  • Plugin page: sharethis-share-b...
  • Plugin version: 2.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.4.1
  • WordPress version: 6.3.1
  • First release: Aug 21, 2017
  • Latest release: Nov 14, 2023
  • Number of updates: 88
  • Update frequency: every 25.9 days
  • Top authors: ShareThis (100%)

Code review

54 tests

User reviews

22 reviews

Install metrics

20,000+ active /470,516 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.47MB] [CPU: ▼2.62ms] Passed 4 tests

Analyzing server-side resources used by ShareThis Share Buttons
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.94 ▲0.4850.61 ▲11.27
Dashboard /wp-admin3.82 ▲0.4845.69 ▼23.43
Posts /wp-admin/edit.php3.87 ▲0.5247.09 ▼0.36
Add New Post /wp-admin/post-new.php6.37 ▲0.49105.81 ▲5.62
Media Library /wp-admin/upload.php3.68 ▲0.4539.21 ▲7.68

Server storage [IO: ▲0.97MB] [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: 42 new files
Database: no new tables, 16 new options
New WordPress options
sharethis_inline
sharethis_token
can_compress_scripts
sharethis_property_id
sharethis_button_config
sharethis_sticky_settings
sharethis_inline_settings
widget_recent-posts
sharethis_fract
widget_st_button_widget
...

Browser metrics Passed 4 tests

ShareThis Share Buttons: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,904 ▲16813.91 ▼0.22716.52 ▲714.8136.00 ▼9.72
Dashboard /wp-admin2,259 ▲785.65 ▼0.0682.71 ▼23.7934.96 ▼11.58
Posts /wp-admin/edit.php2,161 ▲612.02 ▲0.0546.78 ▲8.5237.41 ▼0.02
Add New Post /wp-admin/post-new.php6,234 ▲4,70626.14 ▲2.89850.94 ▲160.8851.70 ▼20.28
Media Library /wp-admin/upload.php1,464 ▲614.15 ▼0.12103.00 ▲5.3342.38 ▼0.72

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
    • widget_st_button_widget
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts

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: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 20× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'ShareThisShareButtons\\Plugin_Base' not found in wp-content/plugins/sharethis-share-buttons/php/class-plugin.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/sharethis-share-buttons/templates/share-buttons/shortcode-templatecode.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/sharethis-share-buttons/php/class-button-widget.php:15
    • > PHP Notice
      Undefined variable: button in wp-content/plugins/sharethis-share-buttons/templates/share-buttons/button-config.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/sharethis-share-buttons/templates/share-buttons/list.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/sharethis-share-buttons/php/class-button-widget.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/sharethis-share-buttons/templates/share-buttons/tabs.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/sharethis-share-buttons/templates/share-buttons/enable-buttons.php:10
    • > PHP Notice
      Undefined variable: sticky_enable in wp-content/plugins/sharethis-share-buttons/templates/minute-control/meta-box.php on line 41
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/sharethis-share-buttons/templates/general/gdpr/purposes.php:16

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 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
7 plugin tags: sharethis, share buttons, social sharing, social buttons, sharing tools...

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

"ShareThis Share Buttons" version 2.2.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Domain Path: The domain path is invalid: folder "/languages" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected5,617 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
PHP193787692,646
CSS3306111,633
JavaScript42722471,220
SVG300118

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity55.40
▷ Minimum class complexity4.00
▷ Maximum class complexity136.00
Average method complexity4.89
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes5
▷ Abstract classes120.00%
▷ Concrete classes480.00%
▷ Final classes00.00%
Methods70
▷ Static methods34.29%
▷ Public methods5477.14%
▷ Protected methods11.43%
▷ Private methods1521.43%
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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
7 PNG files occupy 0.65MB with 0.41MB 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/screenshot-3.png163.03KB57.77KB▼ 64.56%
assets/screenshot-2.png164.79KB54.70KB▼ 66.81%
assets/inline-setup-logo.png58.67KB14.64KB▼ 75.04%
assets/finished-step.png2.65KB1.30KB▼ 50.72%