93% add-social-buttons

Code Review | Add Social Buttons

WordPress plugin Add Social Buttons scored 93% from 54 tests.

About plugin

  • Plugin page: add-social-buttons
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.8
  • WordPress version: 5.9.2
  • First release: Sep 23, 2018
  • Latest release: Sep 23, 2018
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: ericwebr (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 382 total downloads


Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼301.09ms] Passed 4 tests

Server-side resources used by Add Social Buttons
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0454.68 ▲3.21
Dashboard /wp-admin3.44 ▲0.0432.36 ▼2.46
Posts /wp-admin/edit.php3.68 ▲0.0437.35 ▼1.74
Add New Post /wp-admin/post-new.php6.92 ▼0.0593.63 ▼1,192.01
Media Library /wp-admin/upload.php3.32 ▲0.0225.02 ▼8.16
All Social Buttonss /wp-admin/edit.php?post_type=addsocialbuttons3.3626.22
Add New /wp-admin/post-new.php?post_type=addsocialbuttons3.6036.03

Server storage [IO: ▲0.08MB] [DB: ▲0.01MB] Passed 3 tests

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 23 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Add Social Buttons: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,803 ▲5916.22 ▲0.245.59 ▼1.412.38 ▲0.20
Dashboard /wp-admin2,923 ▲726.08 ▼0.13119.71 ▼10.65155.81 ▼5.14
Posts /wp-admin/edit.php2,691 ▲63.25 ▲0.0264.00 ▲0.62138.93 ▲2.22
Add New Post /wp-admin/post-new.php1,742 ▼922.50 ▲0.98436.61 ▼8.88160.06 ▲2.98
Media Library /wp-admin/upload.php1,733 ▲325.48 ▼0.01134.10 ▼10.31184.75 ▼9.58
All Social Buttonss /wp-admin/edit.php?post_type=addsocialbuttons1,4203.1660.41112.44
Add New /wp-admin/post-new.php?post_type=addsocialbuttons2,2873.9192.82131.24

Uninstaller [IO: ▲0.00MB] [DB: ▲0.01MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Uninstaller ran successfully

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 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/add-social-buttons/includes/scripts.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/add-social-buttons/addsocialbuttons.php:17

User-side errors Passed 1 test

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


Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Screenshots: Screenshot #1 (The review edition page) image not found
The official readme.txt might help

add-social-buttons/addsocialbuttons.php 85% from 13 tests

This is the main PHP file of "Add Social Buttons" version 1.0.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: Name the main plugin file the same as the plugin slug ("add-social-buttons.php" instead of "addsocialbuttons.php")

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
Everything looks great! No dangerous files found in this plugin411 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions10100.00%
▷ Anonymous functions00.00%
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
12 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/pinterest.png6.26KB3.38KB▼ 46.03%
assets/img/twitter.png2.84KB1.58KB▼ 44.50%
assets/img/flickr.png2.19KB1.60KB▼ 26.90%
assets/img/linkedin.png1.62KB0.92KB▼ 43.60%
assets/img/behance.png3.09KB2.13KB▼ 31.16%