73% socialinks-widget

Code Review | Socialinks Widget

WordPress plugin Socialinks Widget scored 73% from 54 tests.

About plugin

  • Plugin page: socialinks-widget
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.1
  • WordPress version: 5.9.2
  • First release: Dec 17, 2011
  • Latest release: Feb 7, 2015
  • Number of updates: 5
  • Update frequency: every 229.6 days
  • Top authors: zourbuth (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 3,151 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▼2.14MB] [CPU: ▼346.31ms] Passed 4 tests

An overview of server-side resources used by Socialinks Widget
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.22 ▼1.298.06 ▼43.05
Dashboard /wp-admin2.24 ▼1.167.24 ▼28.06
Posts /wp-admin/edit.php2.25 ▼1.397.82 ▼32.71
Add New Post /wp-admin/post-new.php2.24 ▼4.737.53 ▼1,281.42
Media Library /wp-admin/upload.php2.24 ▼1.0522.87 ▼3.76

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 80 new files
Database: no new tables, 1 new option
New WordPress options
widget_socialinks

Browser metrics Passed 4 tests

This is an overview of browser requirements for Socialinks Widget
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,781 ▲2615.68 ▲0.046.40 ▼0.102.57 ▼0.27
Dashboard /wp-admin2,871 ▲136.14 ▼0.08121.26 ▼27.96156.30 ▼9.79
Posts /wp-admin/edit.php2,694 ▼03.24 ▼0.0088.10 ▲19.63143.99 ▲2.01
Add New Post /wp-admin/post-new.php1,661 ▼9716.19 ▼5.09429.52 ▼42.86177.25 ▲11.15
Media Library /wp-admin/upload.php1,698 ▼05.54 ▲0.11139.68 ▼7.50191.53 ▼24.80

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/socialinks-widget/widget.php+12
    Methods with the same name as their class will not be constructors in a future version of PHP; Socialink_Widget has a deprecated constructor
  • Zombie WordPress options detected upon uninstall: 1 option
    • widget_socialinks

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/socialinks-widget/index.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/socialinks-widget/widget.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Tags: Please delete some tags, you are using 15 tag instead of maximum 10
You can look at the official readme.txt

socialinks-widget/index.php 85% from 13 tests

"Socialinks Widget" version 1.0.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Description: Please don't use more than 140 characters for the plugin description (currently 168 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("socialinks-widget.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin860 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
CSS2158395
PHP24775270
PO File25252144
JavaScript116551

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity28.00
▷ Minimum class complexity28.00
▷ Maximum class complexity28.00
Average method complexity6.40
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
69 PNG files occupy 0.04MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/social/mobileme_16.png0.60KB0.43KB▼ 28.11%
images/social/gamespot_16.png0.78KB0.64KB▼ 17.59%
images/social/myspace_16.png0.64KB0.42KB▼ 34.19%
images/social/windows_16.png0.77KB0.75KB▼ 3.66%
images/social/sharethis_16.png0.67KB0.52KB▼ 23.08%