73% social-links-widget

Code Review | Social Links Widget

WordPress plugin Social Links Widget scored73%from 54 tests.

About plugin

  • Plugin page: social-links-widget
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.4.2
  • WordPress version: 6.3.1
  • First release: Apr 29, 2016
  • Latest release: May 4, 2016
  • Number of updates: 5
  • Update frequency: every 1.2 days
  • Top authors: farvehandleren (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /1,833 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▼0.94MB] [CPU: ▼28.51ms] Passed 4 tests

An overview of server-side resources used by Social Links Widget
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.87 ▼0.72
Dashboard /wp-admin3.00 ▼0.3026.37 ▼18.19
Posts /wp-admin/edit.php3.00 ▼0.3523.05 ▼24.44
Add New Post /wp-admin/post-new.php3.00 ▼2.8822.71 ▼67.22
Media Library /wp-admin/upload.php3.00 ▼0.2327.59 ▼4.19

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Social Links Widget
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲7913.63 ▼0.781.69 ▼0.2844.29 ▼12.76
Dashboard /wp-admin2,221 ▲364.86 ▼0.95110.15 ▲7.8278.46 ▲33.04
Posts /wp-admin/edit.php2,104 ▲181.98 ▼0.0437.66 ▲3.1933.51 ▼2.09
Add New Post /wp-admin/post-new.php1,688 ▲15224.64 ▲1.52711.98 ▲64.5159.53 ▼26.20
Media Library /wp-admin/upload.php1,397 ▲124.20 ▲0.01115.89 ▲14.7246.06 ▲0.30

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
The following items require your attention
  • Uninstall procedure had uncaught errors
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • This plugin does not fully uninstall, leaving 7 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_social_links_widget_widget
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function shortcode_exists() in wp-content/plugins/social-links-widget/main.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/social-links-widget/social-admin.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Plugin Name: You should set the name of your plugin on the first line ( === social-links-widget === )
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

social-links-widget/main.php 85% from 13 tests

The main file in "Social Links Widget" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Text Domain: The text domain should only use lowercase characters and dashes
  • Main file name: Name the main plugin file the same as the plugin slug ("social-links-widget.php" instead of "main.php")

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
Good job! No executable or dangerous file extensions detected175 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP22158135
CSS11040

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity5.00
▷ Minimum class complexity5.00
▷ Maximum class complexity5.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity3.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%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ 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
11 PNG files occupy 0.05MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/social-icon.png1.77KB0.94KB▼ 46.71%
social-icons/vimeo.png4.64KB2.75KB▼ 40.84%
social-icons/yt.png2.20KB0.70KB▼ 68.34%
social-icons/pin.png4.27KB1.29KB▼ 69.89%
img/social-icon1.png1.32KB0.64KB▼ 51.59%