84% better-share-buttons

Code Review | Better Share Buttons

WordPress plugin Better Share Buttons scored84%from 54 tests.

About plugin

  • Plugin page: better-share-buttons
  • Plugin version: 1.8
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-6.4
  • WordPress version: 6.3.1
  • First release: Mar 16, 2023
  • Latest release: Oct 25, 2023
  • Number of updates: 21
  • Update frequency: every 11.1 days
  • Top authors: kubiq (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /402 total downloads


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.16MB] [CPU: ▼6.40ms] Passed 4 tests

This is a short check of server-side resources used by Better Share Buttons
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1844.07 ▼1.13
Dashboard /wp-admin3.48 ▲0.1349.07 ▼12.22
Posts /wp-admin/edit.php3.53 ▲0.1744.45 ▼1.10
Add New Post /wp-admin/post-new.php6.06 ▲0.1784.14 ▼9.38
Media Library /wp-admin/upload.php3.40 ▲0.1733.77 ▼2.86
Add New /wp-admin/post-new.php?post_type=share_buttons3.5443.24
All Share Buttons /wp-admin/edit.php?post_type=share_buttons3.4432.55

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 20 new files
Database: no new tables, 6 new options
New WordPress options

Browser metrics Passed 4 tests

Better Share Buttons: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,823 ▲7714.28 ▼0.111.72 ▲0.2044.53 ▲5.03
Dashboard /wp-admin2,226 ▲495.52 ▼0.0481.21 ▼8.1438.53 ▼0.30
Posts /wp-admin/edit.php2,131 ▲312.02 ▲0.0335.26 ▼2.2436.32 ▲2.01
Add New Post /wp-admin/post-new.php1,552 ▲2623.09 ▲0.05676.69 ▼25.7766.01 ▲12.96
Media Library /wp-admin/upload.php1,431 ▲344.20 ▼0.0094.79 ▼3.2441.29 ▼0.14
Add New /wp-admin/post-new.php?post_type=share_buttons1,7422.7852.7971.60
All Share Buttons /wp-admin/edit.php?post_type=share_buttons1,0951.9628.5726.09

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/better-share-buttons/better-share-buttons.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _x() in wp-content/plugins/better-share-buttons/networks.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected


Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Please a description for screenshot #1 in better-share-buttons/assets to your readme.txt
  • Tags: Please reduce the number of tags, currently 16 tag instead of maximum 10
Please take inspiration from this readme.txt

better-share-buttons/better-share-buttons.php Passed 13 tests

The principal PHP file in "Better Share Buttons" v. 1.8 is loaded by WordPress automatically on each request
42 characters long description:
Share buttons for social networks and more

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin1,346 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity40.00
▷ Minimum class complexity40.00
▷ Maximum class complexity40.00
Average method complexity4.90
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
▷ Static methods00.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions00.00%
▷ Anonymous functions00.00%
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
PNG images were not found in this plugin