10% social-media-badge-widget

Code Review | Social Media Badge Widget

WordPress plugin Social Media Badge Widget scored10%from 54 tests.

About plugin

  • Plugin page: social-media-badg...
  • Plugin version: 2.7.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-4.3
  • WordPress version: 6.3.1
  • First release: Jul 23, 2012
  • Latest release: Sep 18, 2015
  • Number of updates: 55
  • Update frequency: every 21.0 days
  • Top authors: StressFree Sites (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

400+ active /50,210 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Please fix the following installer errors
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/social-media-badge-widget/social-media-badge-widget.php+211
    Methods with the same name as their class will not be constructors in a future version of PHP; Social_Media_Badge_Widget has a deprecated constructor

Server metrics [RAM: ▼1.75MB] [CPU: ▼53.31ms] Passed 4 tests

Analyzing server-side resources used by Social Media Badge Widget
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.25 ▼1.215.00 ▼32.21
Dashboard /wp-admin2.27 ▼1.086.30 ▼57.20
Posts /wp-admin/edit.php2.27 ▼1.095.80 ▼38.49
Add New Post /wp-admin/post-new.php2.27 ▼3.626.63 ▼85.33
Media Library /wp-admin/upload.php2.27 ▼0.966.39 ▼24.94
Social Media Badge Widget /wp-admin/options-general.php?page=social-media-badge-widget2.275.78

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 122 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-posts
can_compress_scripts
db_upgraded
theysaidso_admin_options
smbw_settings
widget_recent-comments
widget_theysaidso_widget
widget_social-media-badge-widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Social Media Badge Widget
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,930 ▲16913.56 ▼0.8110.10 ▲8.5843.15 ▲5.22
Dashboard /wp-admin2,213 ▲395.58 ▲0.0582.49 ▼25.0738.78 ▼4.20
Posts /wp-admin/edit.php2,121 ▲212.12 ▲0.0932.94 ▼1.8935.03 ▲1.36
Add New Post /wp-admin/post-new.php1,552 ▲1723.19 ▲5.03677.21 ▲62.0457.53 ▼14.35
Media Library /wp-admin/upload.php1,421 ▲214.20 ▲0.0095.39 ▲2.8440.63 ▼2.05
Social Media Badge Widget /wp-admin/options-general.php?page=social-media-badge-widget1,4646.21145.0680.89

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/social-media-badge-widget/social-media-badge-widget.php+211
    Methods with the same name as their class will not be constructors in a future version of PHP; Social_Media_Badge_Widget has a deprecated constructor
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • widget_theysaidso_widget
    • widget_social-media-badge-widget
    • theysaidso_admin_options
    • widget_recent-posts
    • smbw_settings
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=social-media-badge-widget
    • > Deprecated in wp-content/plugins/social-media-badge-widget/social-media-badge-widget.php+211
    Methods with the same name as their class will not be constructors in a future version of PHP; Social_Media_Badge_Widget has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=social-media-badge-widget
    • > Deprecated in wp-content/plugins/social-media-badge-widget/social-media-badge-widget.php+472
    Function create_function() is deprecated

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/social-media-badge-widget/social-media-badge-widget.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/social-media-badge-widget/social-media-badge-widget-admin.php:45

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please take a look at the following user-side issues
    • > GET request to /wp-admin/options-general.php?page=social-media-badge-widget
    • > Network (severe)
    wp-content/plugins/business-contact-widget/images/spacd.jpg - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/options-general.php?page=social-media-badge-widget
    • > Network (severe)
    wp-content/plugins/social-media-badge-widget/css/images/ui-bg_flat_100_E4E4E4_40x100.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/options-general.php?page=social-media-badge-widget
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'ambient-light-sensor'.
    • > GET request to /wp-admin/options-general.php?page=social-media-badge-widget
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'bluetooth'.

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention:
  • Screenshots: Add images for these screenshots: #1 (Widget front end - overview.), #2 (Widget front end - display Facebook business profile.), #3 (Widget front end - social stream colour on hover.), #4 (Widget front end - LinkedIn widget pops out of accordion to fully display.), #5 (Widget backend - details of widget.), #6 (Widget backend - display which social channels to display.), #7 (Settings backend - easily add the different social channels.), #8 (Settings backend - customise the styling options.)
You can take inspiration from this readme.txt

social-media-badge-widget/social-media-badge-widget.php 85% from 13 tests

"Social Media Badge Widget" version 2.7.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Description: Please keep the plugin description shorter than 140 characters (currently 150 characters long)
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

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
There were no executable files found in this plugin1,379 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP210074824
CSS138197300
PO File17676197
JavaScript4202458

PHP code Passed 2 tests

An short overview of 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.26
Average class complexity32.00
▷ Minimum class complexity32.00
▷ Maximum class complexity32.00
Average method complexity8.75
▷ Minimum method complexity1.00
▷ Maximum method complexity32.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
94 PNG files occupy 0.73MB with 0.37MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/linkedin_grey.png2.97KB0.33KB▼ 88.81%
css/images/ui-bg_highlight-soft_100_deedf7_1x100.png0.38KB0.18KB▼ 52.97%
css/images/ui-bg_glass_75_e6e6e6_1x400.png0.26KB0.15KB▼ 42.37%
css/images/ui-bg_glass_75_dadada_1x400.png0.26KB0.16KB▼ 38.93%
images/twitter_grey.png0.64KB0.46KB▼ 28.57%