78% share-button

Code Review | WordPress Social Share Buttons

WordPress plugin WordPress Social Share Buttons scored78%from 54 tests.

About plugin

  • Plugin page: share-button
  • Plugin version: 1.19
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-6.1
  • WordPress version: 6.3.1
  • First release: Feb 26, 2010
  • Latest release: Mar 12, 2023
  • Number of updates: 43
  • Update frequency: every 110.6 days
  • Top authors: maxfoundry (58.14%)basszje (44.19%)

Code review

54 tests

User reviews

27 reviews

Install metrics

2,000+ active /47,560 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.03MB] [CPU: ▼2.52ms] Passed 4 tests

This is a short check of server-side resources used by WordPress Social Share Buttons
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0336.68 ▲0.06
Dashboard /wp-admin3.34 ▲0.0345.18 ▼4.48
Posts /wp-admin/edit.php3.39 ▲0.0350.25 ▲2.53
Add New Post /wp-admin/post-new.php5.92 ▲0.0391.28 ▼8.09
Media Library /wp-admin/upload.php3.26 ▲0.0336.71 ▲2.43

Server storage [IO: ▲0.66MB] [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: 115 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for WordPress Social Share Buttons
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,810 ▲6414.74 ▲0.081.67 ▼0.1838.72 ▼4.97
Dashboard /wp-admin2,216 ▲285.83 ▼0.0296.46 ▼2.6439.16 ▼4.99
Posts /wp-admin/edit.php2,098 ▲92.05 ▲0.0640.65 ▼0.9136.29 ▼1.92
Add New Post /wp-admin/post-new.php1,533 ▲1223.13 ▼0.13676.91 ▼0.2855.76 ▼12.52
Media Library /wp-admin/upload.php1,398 ▲134.26 ▲0.01106.95 ▲9.9746.61 ▼6.23

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
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
Please take a closer look at the following
  • 47× PHP files perform the action of outputting non-empty strings when accessed directly (only 10 are shown):
    • > /wp-content/plugins/share-button/classes/blocks/admin_block.php
    • > /wp-content/plugins/share-button/classes/styles/horizontal-style.php
    • > /wp-content/plugins/share-button/classes/class-presets.php
    • > /wp-content/plugins/share-button/classes/blocks/layout-block.php
    • > /wp-content/plugins/share-button/classes/styles/round-style.php
    • > /wp-content/plugins/share-button/admin/page_editor.php
    • > /wp-content/plugins/share-button/classes/blocks/twitter_block.php
    • > /wp-content/plugins/share-button/classes/class-block.php
    • > /wp-content/plugins/share-button/classes/blocks/count_block.php
    • > /wp-content/plugins/share-button/classes/blocks/preview_block.php
  • 7× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'MBSocial\\mbNetwork' not found in wp-content/plugins/share-button/classes/network/twitter.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'MBSocial\\mbNetwork' not found in wp-content/plugins/share-button/classes/network/pinterest.php:5
    • > PHP Notice
      Undefined variable: title in wp-content/plugins/share-button/admin/header.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/share-button/admin/header.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'MBSocial\\collection' not found in wp-content/plugins/share-button/admin/share_editor.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'MBSocial\\mbNetwork' not found in wp-content/plugins/share-button/classes/network/custom.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function MBSocial\\MBSocial() in wp-content/plugins/share-button/admin/page_networks.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
6 plugin tags: twitter, wordpress social share, instagram, social icons, facebook...

share-button/share-button.php 85% from 13 tests

The primary PHP file in "WordPress Social Share Buttons" version 1.19 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Domain Path: The domain path folder does not exist ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin11,428 lines of code in 77 files:
LanguageFilesBlank linesComment linesLines of code
PHP572,7551,6508,710
Sass9186541,030
CSS41339956
JavaScript626542731
SVG1001

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity17.59
▷ Minimum class complexity1.00
▷ Maximum class complexity134.00
Average method complexity3.83
▷ Minimum method complexity1.00
▷ Maximum method complexity77.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes59
▷ Abstract classes23.39%
▷ Concrete classes5796.61%
▷ Final classes00.00%
Methods347
▷ Static methods4613.26%
▷ Public methods32092.22%
▷ Protected methods246.92%
▷ Private methods30.86%
Functions5
▷ Named functions480.00%
▷ Anonymous functions120.00%
Constants13
▷ Global constants430.77%
▷ Class constants969.23%
▷ Public constants9100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
28 PNG files occupy 0.05MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/icons/display_icons.png17.72KB1.13KB▼ 93.59%
images/icons/shape_circle.png0.71KB0.51KB▼ 28.02%
images/icons/icon_bottomleft.png0.21KB0.11KB▼ 49.77%
images/icons/icon_bottomright.png0.21KB0.11KB▼ 48.36%
images/icons/icon_vertical.png0.22KB0.09KB▼ 57.89%