66% social-media-builder

Code Review | Social Media Share Buttons

WordPress plugin Social Media Share Buttons scored66%from 54 tests.

About plugin

  • Plugin page: social-media-builder
  • Plugin version: 2.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-5.0
  • WordPress version: 6.3.1
  • First release: Dec 24, 2015
  • Latest release: Dec 7, 2018
  • Number of updates: 211
  • Update frequency: every 5.1 days
  • Top authors: Sygnoos (100%)

Code review

54 tests

User reviews

60 reviews

Install metrics

3,000+ active /272,476 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.18MB] [CPU: ▼1.09ms] Passed 4 tests

Analyzing server-side resources used by Social Media Share Buttons
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.65 ▲0.1840.56 ▼5.79
Dashboard /wp-admin3.48 ▲0.1852.40 ▼1.92
Posts /wp-admin/edit.php3.60 ▲0.2454.61 ▲3.83
Add New Post /wp-admin/post-new.php6.08 ▲0.20100.14 ▲0.72
Media Library /wp-admin/upload.php3.41 ▲0.1839.83 ▲2.65
Add New /wp-admin/admin.php?page=create-button3.5433.23
More plugins /wp-admin/admin.php?page=show-more-plugins3.3837.45
All Buttons /wp-admin/admin.php?page=socialmediabuilder3.6741.63

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 359 new files
Database: 1 new table, 8 new options
New tables
wp_sgmb_widget
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-comments
SGMB_SHARE_BUTTON_VERSION
widget_recent-posts
widget_theysaidso_widget
widget_sgmbwidget
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Social Media Share Buttons
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,865 ▲10413.42 ▼1.161.78 ▼0.1543.77 ▲0.53
Dashboard /wp-admin2,274 ▲715.06 ▲0.16110.07 ▼6.5742.60 ▼0.44
Posts /wp-admin/edit.php2,155 ▲552.31 ▲0.3141.48 ▲2.7135.87 ▲1.20
Add New Post /wp-admin/post-new.php1,572 ▲2723.26 ▼0.11696.90 ▲32.9840.14 ▼14.48
Media Library /wp-admin/upload.php1,453 ▲504.43 ▲0.15100.39 ▼8.4041.11 ▼8.67
Add New /wp-admin/admin.php?page=create-button3,3483.13107.63293.02
More plugins /wp-admin/admin.php?page=show-more-plugins9541.8928.3226.79
All Buttons /wp-admin/admin.php?page=socialmediabuilder1,2173.2445.9834.80

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 8 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_sgmbwidget
    • widget_recent-comments
    • widget_theysaidso_widget
    • SGMB_SHARE_BUTTON_VERSION
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=create-button
    • > Notice in wp-content/plugins/social-media-builder/view/sgmb_buttons_create.php+10
    Undefined index: button
  • 11 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=create-button
    • > Notice in wp-content/plugins/social-media-builder/view/sgmb_buttons_create.php+434
    Undefined index: id
    • > GET request to /wp-admin/admin.php?page=create-button
    • > Notice in wp-content/plugins/social-media-builder/view/sgmb_buttons_create.php+39
    Undefined index: title
  • 44 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=create-button
    • > Notice in wp-content/plugins/social-media-builder/view/sgmb_buttons_create.php+547
    Undefined index: options
  • 92 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=create-button
    • > Notice in wp-content/plugins/social-media-builder/view/sgmb_buttons_create.php+547
    Trying to access array offset on value of type null
  • 24 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=create-button
    • > Notice in wp-content/plugins/social-media-builder/view/option-pages/twitterFollow.php+29
    Undefined index: buttonOptions
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=create-button
    • > Notice in wp-content/plugins/social-media-builder/classes/pages/SgmbAddNewSection.php+24
    Undefined index: sgmbDropdownLabelFontSize
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=create-button
    • > Notice in wp-content/plugins/social-media-builder/classes/pages/SgmbAddNewSection.php+57
    Undefined index: fbLikeLayout
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=create-button
    • > Notice in wp-content/plugins/social-media-builder/classes/pages/SgmbAddNewSection.php+57
    Undefined index: fbLikeActionType
  • 13 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=create-button
    • > Notice in wp-content/plugins/social-media-builder/classes/pages/SgmbAddNewSection.php+93
    Undefined index: buttonsPanelEffect
  • 13 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=create-button
    • > Notice in wp-content/plugins/social-media-builder/classes/pages/SgmbAddNewSection.php+93
    Undefined index: buttonsEffect
  • 13 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=create-button
    • > Notice in wp-content/plugins/social-media-builder/classes/pages/SgmbAddNewSection.php+93
    Undefined index: iconsEffect

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 fix the following items
  • 15× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/social-media-builder/view/option-pages/twitter.php
    • > /wp-content/plugins/social-media-builder/view/option-pages/tumblr.php
    • > /wp-content/plugins/social-media-builder/view/option-pages/email.php
    • > /wp-content/plugins/social-media-builder/view/option-pages/pinterest.php
    • > /wp-content/plugins/social-media-builder/view/option-pages/stumbleupon.php
    • > /wp-content/plugins/social-media-builder/view/sgmb_more_plugins.php
    • > /wp-content/plugins/social-media-builder/view/option-pages/googleplus.php
    • > /wp-content/plugins/social-media-builder/view/option-pages/reddit.php
    • > /wp-content/plugins/social-media-builder/view/option-pages/line.php
    • > /wp-content/plugins/social-media-builder/view/option-pages/twitterFollow.php
  • 7× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      require_once(): Failed opening required 'SGMB_CLASSESSgmbWidget.php' (include_path='.:/usr/share/php') in wp-content/plugins/social-media-builder/classes/SGMB.php on line 2
    • > PHP Warning
      Use of undefined constant SGMB_CLASSES - assumed 'SGMB_CLASSES' (this will throw an Error in a future version of PHP) in wp-content/plugins/social-media-builder/classes/SGMB.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/social-media-builder/classes/SgmbWidget.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'SgmbAddNewSection' not found in wp-content/plugins/social-media-builder/view/option-pages/fbLike.php:18
    • > PHP Warning
      require_once(SGMB_CLASSESSgmbWidget.php): failed to open stream: No such file or directory in wp-content/plugins/social-media-builder/classes/SGMB.php on line 2
    • > PHP Warning
      Use of undefined constant SGMB_URL - assumed 'SGMB_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/social-media-builder/view/sgmb_more_plugins.php on line 43
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/social-media-builder/config.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=create-button
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: Cannot read properties of undefined (reading 'shareText')" "TypeError: Cannot read properties of undefined (reading 'shareText')\n at SGMBWidget.show (/wp-content/plugins/social-media-builder/js/addNewSection/SGMBWidget.js:56:18)\n at HTMLDocument.\u003Canonymous> (/wp-admin/admin.php?page=create-button:1011:9)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=create-button
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: Cannot read properties of undefined (reading 'shareText')
    • > GET request to /wp-admin/admin.php?page=show-more-plugins
    • > Network (severe)
    http://ps.w.org/popup-builder/assets/icon-128x128.png?rev=1338083 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=show-more-plugins
    • > Network (severe)
    http://ps.w.org/review-builder/assets/icon-128x128.png?rev=1489430 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
5 plugin tags: share, social media, social buttons, share buttons, social

social-media-builder/sgmb-buttons.php 85% from 13 tests

The principal PHP file in "Social Media Share Buttons" v. 2.1.0 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("social-media-builder.php" instead of "sgmb-buttons.php")
  • Description: The description should be shorter than 140 characters (currently 143 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin14,353 lines of code in 68 files:
LanguageFilesBlank linesComment linesLines of code
CSS241,0081876,843
JavaScript138333664,020
PHP303125562,850
SVG100640

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity29.30
▷ Minimum class complexity1.00
▷ Maximum class complexity117.00
Average method complexity3.26
▷ Minimum method complexity1.00
▷ Maximum method complexity39.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods125
▷ Static methods1512.00%
▷ Public methods10382.40%
▷ Protected methods2116.80%
▷ Private methods10.80%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants13
▷ Global constants13100.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
283 compressed PNG files occupy 1.91MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/multi-stumbleupon.png5.18KB5.36KB0.00%
img/cork-mewe.png2.68KB2.78KB0.00%
img/positions/floatTopCenter.png11.95KB3.62KB▼ 69.73%
img/cork-line.png4.92KB5.10KB0.00%
img/heart-mewe.png2.48KB2.57KB0.00%