84% sharethis-follow-buttons

Code Review | ShareThis Follow Buttons

WordPress plugin ShareThis Follow Buttons scored84%from 54 tests.

About plugin

  • Plugin page: sharethis-follow-...
  • Plugin version: 1.4.1
  • PHP version: 7.4.16
  • WordPress compatibility: 5.9-6.4.1
  • WordPress version: 6.3.1
  • First release: Apr 10, 2018
  • Latest release: Nov 28, 2023
  • Number of updates: 27
  • Update frequency: every 76.2 days
  • Top authors: ShareThis (100%)

Code review

54 tests

User reviews

1 review

Install metrics

600+ active /17,932 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.19MB] [CPU: ▼12.95ms] Passed 4 tests

Server-side resources used by ShareThis Follow Buttons
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0837.40 ▼3.20
Dashboard /wp-admin3.37 ▲0.0746.54 ▼4.84
Posts /wp-admin/edit.php3.49 ▲0.1344.89 ▼4.05
Add New Post /wp-admin/post-new.php4.89 ▼0.9956.37 ▼39.70
Media Library /wp-admin/upload.php3.30 ▲0.0735.88 ▲2.34

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

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

Browser metrics Passed 4 tests

A check of browser resources used by ShareThis Follow Buttons
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,933 ▲18614.28 ▼0.06603.66 ▲601.9640.02 ▼4.69
Dashboard /wp-admin2,263 ▲825.10 ▼0.5294.92 ▼20.3842.15 ▼3.21
Posts /wp-admin/edit.php2,147 ▲442.42 ▲0.4351.47 ▲10.8834.42 ▲0.03
Add New Post /wp-admin/post-new.php6,265 ▲4,73226.26 ▲3.36912.53 ▲320.3960.25 ▲2.20
Media Library /wp-admin/upload.php1,466 ▲664.59 ▲0.42102.77 ▲8.3139.77 ▼2.51

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
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_st_follow_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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
  • 12× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'SharethisFollowButtons\\Plugin_Base' not found in wp-content/plugins/sharethis-follow-buttons/php/class-plugin.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function checked() in wp-content/plugins/sharethis-follow-buttons/templates/minute-control/meta-box.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function SharethisFollowButtons\\trailingslashit() in wp-content/plugins/sharethis-follow-buttons/php/class-plugin-base.php:149
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/sharethis-follow-buttons/templates/follow-buttons/widget.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/sharethis-follow-buttons/php/class-button-widget.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/sharethis-follow-buttons/templates/follow-buttons/shortcode-templatecode.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/sharethis-follow-buttons/templates/follow-buttons/follow-button-settings.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/sharethis-follow-buttons/templates/follow-buttons/list.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/sharethis-follow-buttons/templates/follow-buttons/button-config.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/sharethis-follow-buttons/templates/follow-buttons/enable-buttons.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Screenshots: Screenshot #4 (Register your Follow buttons.) image not found
You can take inspiration from this readme.txt

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

"ShareThis Follow Buttons" version 1.4.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin3,444 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
PHP152736651,612
CSS31797935
JavaScript4161191860
Markdown216025
JSON10012

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity37.00
▷ Minimum class complexity4.00
▷ Maximum class complexity77.00
Average method complexity3.86
▷ 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 methods34.76%
▷ Public methods5282.54%
▷ Protected methods11.59%
▷ Private methods1015.87%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.05MB with 0.03MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/finished-step.png2.65KB1.30KB▼ 50.72%
assets/sharethis-setup-logo.png48.91KB20.52KB▼ 58.05%