78% simple-share-buttons-adder

Code Review | Simple Share Buttons Adder

WordPress plugin Simple Share Buttons Adder scored78%from 54 tests.

About plugin

  • Plugin page: simple-share-butt...
  • Plugin version: 8.4.8
  • PHP version: 7.4.16
  • WordPress compatibility: 5.9-6.2.2
  • WordPress version: 6.3.1
  • First release: Mar 9, 2013
  • Latest release: Jun 8, 2023
  • Number of updates: 209
  • Update frequency: every 17.9 days
  • Top authors: DavidoffNeal (96.17%)harvitronix (4.31%)

Code review

54 tests

User reviews

625 reviews

Install metrics

70,000+ active /3,924,590 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.94MB] [CPU: ▲0.43ms] Passed 4 tests

A check of server-side resources used by Simple Share Buttons Adder
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.45 ▲0.9951.10 ▲5.05
Dashboard /wp-admin4.28 ▲0.9354.12 ▼9.38
Posts /wp-admin/edit.php4.33 ▲0.9753.45 ▲4.42
Add New Post /wp-admin/post-new.php6.82 ▲0.93100.92 ▲4.15
Media Library /wp-admin/upload.php4.14 ▲0.9139.64 ▲2.53
Simple Share Buttons /wp-admin/options-general.php?page=simple-share-buttons-adder8.32178.80

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 383 new files
Database: no new tables, 10 new options
New WordPress options
ssba_settings
theysaidso_admin_options
db_upgraded
widget_ssba_widget
ssba_version
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
ssba_buttons
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Simple Share Buttons Adder
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,947 ▲18613.73 ▼0.629.34 ▲7.5044.43 ▲0.98
Dashboard /wp-admin2,241 ▲645.64 ▼0.0390.04 ▼7.2740.07 ▲3.68
Posts /wp-admin/edit.php2,152 ▲492.00 ▲0.0335.15 ▼4.5635.98 ▲0.90
Add New Post /wp-admin/post-new.php6,205 ▲4,66919.32 ▼4.06860.87 ▲185.4362.48 ▲8.24
Media Library /wp-admin/upload.php1,452 ▲524.24 ▲0.0897.46 ▼12.8344.40 ▼9.87
Simple Share Buttons /wp-admin/options-general.php?page=simple-share-buttons-adder13,1505.45249.03156.57

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
Please take a closer look at the following
  • 150× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/simple-share-buttons-adder/images/networks/digg-white.svg.php
    • > /wp-content/plugins/simple-share-buttons-adder/images/networks/flipboard.svg.php
    • > /wp-content/plugins/simple-share-buttons-adder/images/networks/renren-white.svg.php
    • > /wp-content/plugins/simple-share-buttons-adder/images/networks/medium-white.svg.php
    • > /wp-content/plugins/simple-share-buttons-adder/images/networks/line-white.svg.php
    • > /wp-content/plugins/simple-share-buttons-adder/images/networks/yummly-white.svg.php
    • > /wp-content/plugins/simple-share-buttons-adder/images/networks/wordpress-white.svg.php
    • > /wp-content/plugins/simple-share-buttons-adder/images/networks/discord.svg.php
    • > /wp-content/plugins/simple-share-buttons-adder/images/networks/outlook.svg.php
    • > /wp-content/plugins/simple-share-buttons-adder/images/networks/vimeo-white.svg.php
  • 18× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/simple-share-buttons-adder/templates/config/gdpr/landing.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/simple-share-buttons-adder/templates/admin-header.php:14
    • > PHP Notice
      Undefined variable: modern in wp-content/plugins/simple-share-buttons-adder/templates/plus-tab.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/simple-share-buttons-adder/templates/gdpr-tab.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/simple-share-buttons-adder/templates/config/gdpr/appearance.php:9
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/simple-share-buttons-adder/templates/plus-tab.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/simple-share-buttons-adder/templates/admin-footer.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function SimpleShareButtonsAdder\\trailingslashit() in wp-content/plugins/simple-share-buttons-adder/instance.php:11
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/simple-share-buttons-adder/templates/share-bar-tab.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_parse_args() in wp-content/plugins/simple-share-buttons-adder/templates/facebook-sdk.php:12

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)
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Tags: Too many tags (14 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can look at the official readme.txt

simple-share-buttons-adder/simple-share-buttons-adder.php Passed 13 tests

"Simple Share Buttons Adder" version 8.4.8's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
88 characters long description:
A simple plugin that enables you to add share buttons to all of your posts and/or pages.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin9,821 lines of code in 223 files:
LanguageFilesBlank linesComment linesLines of code
PHP1767801,4696,146
JavaScript62443071,412
CSS18140491,090
JSON100896
SVG2203277

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
These items need your attention
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 223)
Cyclomatic complexity
Average complexity per logical line of code0.53
Average class complexity57.67
▷ Minimum class complexity1.00
▷ Maximum class complexity256.00
Average method complexity7.36
▷ Minimum method complexity1.00
▷ Maximum method complexity223.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes12
▷ Abstract classes18.33%
▷ Concrete classes1191.67%
▷ Final classes00.00%
Methods107
▷ Static methods65.61%
▷ Public methods10396.26%
▷ Protected methods10.93%
▷ Private methods32.80%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
155 PNG files occupy 1.20MB with 0.35MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
buttons/simple/yummly.png5.01KB1.57KB▼ 68.60%
buttons/simple/facebook_save.png58.56KB26.18KB▼ 55.30%
buttons/simple/google.png0.79KB0.81KB0.00%
buttons/metal/twitter.png4.37KB3.47KB▼ 20.53%
buttons/pagepeel/email.png3.28KB3.30KB0.00%