83% social-media-widget-icon

Code Review | Social Media Widget

WordPress plugin Social Media Widget scored83%from 54 tests.

About plugin

  • Plugin page: social-media-widg...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-4.5.2
  • WordPress version: 6.3.1
  • First release: Jun 4, 2016
  • Latest release: Jun 4, 2016
  • Number of updates: 4
  • Update frequency: every 0.5 days
  • Top authors: superheroplugins (100%)

Code review

54 tests

User reviews

1 review

Install metrics

600+ active /13,838 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.35MB] [CPU: ▼5.00ms] Passed 4 tests

This is a short check of server-side resources used by Social Media Widget
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.82 ▲0.3643.36 ▼1.03
Dashboard /wp-admin3.66 ▲0.3545.78 ▼3.78
Posts /wp-admin/edit.php3.71 ▲0.3547.30 ▼1.54
Add New Post /wp-admin/post-new.php6.26 ▲0.3783.18 ▼13.63
Media Library /wp-admin/upload.php3.58 ▲0.3536.63 ▲1.33

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Social Media Widget
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,895 ▲16013.71 ▼0.965.36 ▲3.5341.87 ▼5.17
Dashboard /wp-admin2,211 ▲204.87 ▼0.02109.87 ▲3.3142.07 ▼5.35
Posts /wp-admin/edit.php2,097 ▲82.05 ▲0.0639.78 ▲0.7134.47 ▼1.28
Add New Post /wp-admin/post-new.php1,522 ▲217.67 ▼5.45670.79 ▼27.3763.77 ▲11.67
Media Library /wp-admin/upload.php1,396 ▲54.19 ▼0.0995.97 ▼4.2044.22 ▼0.21

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • The uninstall procedure has failed, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_social_media_widget
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/social-media-widget-icon/social-media-widget-functions.php:12

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

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Tags: You are using too many tags: 11 tag instead of maximum 10
The official readme.txt is a good inspiration

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

The main PHP script in "Social Media Widget" version 1.0 is automatically included on every request by WordPress
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("social-media-widget-icon.php" instead of "social-media-widget.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin6,211 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
CSS33621524,680
PHP27526963
SVG100520
JavaScript16048

PHP code 50% from 2 tests

A short review 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 891)
Cyclomatic complexity
Average complexity per logical line of code0.88
Average class complexity948.00
▷ Minimum class complexity948.00
▷ Maximum class complexity948.00
Average method complexity316.67
▷ Minimum method complexity1.00
▷ Maximum method complexity891.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods3
▷ Static methods00.00%
▷ Public methods3100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
105 PNG files occupy 0.86MB with 0.41MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/default-linkedin.png1.07KB0.99KB▼ 6.87%
assets/img/sprayed-facebook.png12.76KB5.29KB▼ 58.52%
assets/img/social-badges-linkedin.png17.98KB6.47KB▼ 64.00%
assets/img/white-rounded-twitter.png6.10KB2.95KB▼ 51.61%
assets/img/social-christmas-linkedin.png10.53KB4.64KB▼ 55.96%