10% social-media-widgets

Code Review | Social Media Widget

WordPress plugin Social Media Widget scored 10% from 54 tests.

About plugin

  • Plugin page: social-media-widgets
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.1-4.3
  • WordPress version: 6.3.1
  • First release: Sep 14, 2015
  • Latest release: Sep 21, 2015
  • Number of updates: 3
  • Update frequency: every 3.0 days
  • Top authors: ashirbad.cs (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

800+ active / 24,087 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
It is recommended to fix the following installer errors
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/social-media-widgets/social-media-widget.php+133
    Function create_function() is deprecated

Server metrics [RAM: ▼1.96MB] [CPU: ▼51.15ms] Passed 4 tests

An overview of server-side resources used by Social Media Widget
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.434.47 ▼35.38
Dashboard /wp-admin2.05 ▼1.266.20 ▼38.97
Posts /wp-admin/edit.php2.05 ▼1.314.97 ▼47.63
Add New Post /wp-admin/post-new.php2.05 ▼3.845.57 ▼82.63
Media Library /wp-admin/upload.php2.05 ▼1.185.85 ▼26.23

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 11 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-comments
can_compress_scripts
widget_social_media_widget
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Social Media Widget
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲7113.62 ▼0.804.81 ▲3.3243.53 ▲5.97
Dashboard /wp-admin2,208 ▲194.84 ▼0.09107.25 ▼10.9637.83 ▼7.98
Posts /wp-admin/edit.php2,094 ▲52.02 ▲0.0135.25 ▼6.0230.21 ▼4.33
Add New Post /wp-admin/post-new.php1,533 ▲523.30 ▲0.05609.51 ▼66.5750.66 ▼4.21
Media Library /wp-admin/upload.php1,393 ▲114.20 ▼0.0096.05 ▼6.9044.30 ▲1.02

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Uninstall procedure validation failed for this plugin
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the socialmediaStylesheet handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • Zombie WordPress options detected upon uninstall: 7 options
    • theysaidso_admin_options
    • db_upgraded
    • widget_social_media_widget
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

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 take a closer look at the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_register_style() in wp-content/plugins/social-media-widgets/social-media-widget.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 79% from 29 tests

readme.txt 81% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Donate link: Invalid URI ("")
  • Screenshots: Add a description for screenshot #2 in social-media-widgets/assets to your readme.txt
  • Tags: Too many tags (19 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

social-media-widgets/social-media-widget.php 77% from 13 tests

The primary PHP file in "Social Media Widget" version 1.0 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("social-media-widgets.php" instead of "social-media-widget.php")
  • Description: The description should be shorter than 140 characters (currently 185 characters long)
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin149 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP1172393
CSS10056

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.10
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity6.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%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
8 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/icon_twitter_h.png2.08KB1.02KB▼ 50.92%
assets/img/icon_facebook_h.png1.90KB0.83KB▼ 56.09%
assets/img/icon_g-plus.png2.23KB1.13KB▼ 49.26%
assets/img/icon_g-plus_h.png2.34KB1.21KB▼ 48.23%
assets/img/icon_pinterest_h.png2.37KB1.23KB▼ 48.25%