78% wp-social-widget

Code Review | WP Social Widget

WordPress plugin WP Social Widget scored78%from 54 tests.

About plugin

  • Plugin page: wp-social-widget
  • Plugin version: 2.2.5
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-6.1
  • WordPress version: 6.3.1
  • First release: Dec 10, 2015
  • Latest release: Feb 5, 2023
  • Number of updates: 56
  • Update frequency: every 46.7 days
  • Top authors: ashokmhrj (76.79%)catchsquare (25%)

Code review

54 tests

User reviews

11 reviews

Install metrics

8,000+ active /104,454 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.19MB] [CPU: ▲1.58ms] Passed 4 tests

This is a short check of server-side resources used by WP Social Widget
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.92 ▲0.1953.29 ▲5.78
Dashboard /wp-admin3.76 ▲0.1952.21 ▼4.87
Posts /wp-admin/edit.php3.87 ▲0.1953.21 ▲3.71
Add New Post /wp-admin/post-new.php6.36 ▲0.2198.35 ▲1.71
Media Library /wp-admin/upload.php3.68 ▲0.1944.52 ▲9.72

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 15 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_wp-social-widget

Browser metrics Passed 4 tests

Checking browser requirements for WP Social Widget
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲5714.49 ▲0.101.72 ▼0.2246.79 ▲2.63
Dashboard /wp-admin2,217 ▲465.82 ▲0.2086.58 ▼16.0739.18 ▼5.41
Posts /wp-admin/edit.php2,109 ▲62.34 ▲0.3341.04 ▲5.5037.72 ▲4.44
Add New Post /wp-admin/post-new.php1,550 ▲2423.24 ▲5.69624.23 ▼67.0935.47 ▼17.17
Media Library /wp-admin/upload.php1,432 ▲324.46 ▲0.1794.65 ▼13.7142.93 ▼4.45

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • widget_wp-social-widget
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/wp-social-widget/socials.php
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-social-widget/inc/include_file.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wp-social-widget/inc/shortcodes.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wp-social-widget/inc/social-widget.php:6

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 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Tags: You are using too many tags: 50 tag instead of maximum 10
You can take inspiration from this readme.txt

wp-social-widget/socials.php 92% from 13 tests

The main PHP file in "WP Social Widget" ver. 2.2.5 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-social-widget.php" instead of "socials.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin996 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP416930685
CSS52516257
SVG10033
JavaScript14121

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
The following items need your attention
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 147)
Cyclomatic complexity
Average complexity per logical line of code0.66
Average class complexity206.00
▷ Minimum class complexity206.00
▷ Maximum class complexity206.00
Average method complexity52.25
▷ Minimum method complexity1.00
▷ Maximum method complexity147.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%
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

Using a strong compression for your PNG files is a great way to speed-up your plugin
PNG images were not found in this plugin