62% lessbuttons

Code Review | LessButtons Social Sharing and Statistics

WordPress plugin LessButtons Social Sharing and Statistics scored62%from 54 tests.

About plugin

  • Plugin page: lessbuttons
  • Plugin version: 1.6.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.9.2-4.6.1
  • WordPress version: 6.3.1
  • First release: Aug 26, 2014
  • Latest release: Oct 19, 2016
  • Number of updates: 108
  • Update frequency: every 7.3 days
  • Top authors: ktulhu (100%)

Code review

54 tests

User reviews

15 reviews

Install metrics

700+ active /27,737 total downloads

Benchmarks

Plugin footprint 65% 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.80MB] [CPU: ▼35.98ms] Passed 4 tests

Server-side resources used by LessButtons Social Sharing and Statistics
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1638.99 ▼1.92
Dashboard /wp-admin3.14 ▼0.1624.28 ▼36.50
Posts /wp-admin/edit.php3.14 ▼0.2123.18 ▼21.24
Add New Post /wp-admin/post-new.php3.14 ▼2.7424.30 ▼71.64
Media Library /wp-admin/upload.php3.14 ▼0.0820.03 ▼14.54
LessButtons /wp-admin/options-general.php?page=LessButtons3.1524.33

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 85 new files
Database: no new tables, 13 new options
New WordPress options
lessbuttons_updated
lessbuttons_placement_inside
lessbuttons_placement_outside
lessbuttons_zindex
lessbuttons_placement_custom_buttons
lessbuttons_conditionals
db_upgraded
lessbuttons_placement_onmobile
widget_theysaidso_widget
widget_recent-posts
...

Browser metrics Passed 4 tests

A check of browser resources used by LessButtons Social Sharing and Statistics
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,864 ▲9313.47 ▼0.925.38 ▲3.3147.83 ▼0.36
Dashboard /wp-admin2,210 ▲194.84 ▼0.06101.33 ▼7.8442.06 ▼3.73
Posts /wp-admin/edit.php2,096 ▲102.01 ▲0.0538.53 ▲0.8335.49 ▲1.70
Add New Post /wp-admin/post-new.php1,536 ▼623.34 ▲5.14641.39 ▲25.6650.80 ▼9.33
Media Library /wp-admin/upload.php1,386 ▼24.27 ▲0.0697.24 ▼3.3641.79 ▼1.46
LessButtons /wp-admin/options-general.php?page=LessButtons4,3412.6136.1866.89

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Uninstall procedure validation failed for this plugin
    • > 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.
  • Zombie WordPress options were found after uninstall: 13 options
    • can_compress_scripts
    • widget_recent-comments
    • lessbuttons_conditionals
    • lessbuttons_placement_custom_buttons
    • lessbuttons_updated
    • lessbuttons_zindex
    • widget_theysaidso_widget
    • lessbuttons_placement_inside
    • db_upgraded
    • widget_recent-posts
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=LessButtons
    • > 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.
    • > GET request to /wp-admin/options-general.php?page=LessButtons
    • > Notice in wp-content/plugins/lessbuttons/lessbuttons.php+264
    Undefined index: restore
    • > GET request to /wp-admin/options-general.php?page=LessButtons
    • > Notice in wp-content/plugins/lessbuttons/lessbuttons.php+268
    Undefined index: save

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
Almost there! Just fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lessbuttons/lessbuttons.php:36

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
These are user-side errors you should fix
    • > GET request to /wp-admin/options-general.php?page=LessButtons
    • > Network (severe)
    https://d3p4u3kahacfyu.cloudfront.net/images/sprite.32.small-fs8.png - Failed to load resource: net::ERR_NAME_NOT_RESOLVED

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Tags: There are too many tags (173 tag instead of maximum 10)
The official readme.txt might help

lessbuttons/lessbuttons.php Passed 13 tests

"LessButtons Social Sharing and Statistics" version 1.6.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
136 characters long description:
Social media share buttons with integrated analytics. Automatically display buttons for those social networks, where visitor registered.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected4,492 lines of code in 42 files:
LanguageFilesBlank linesComment linesLines of code
PO File411,5583,1983,883
PHP111539609

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.60
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions16
▷ Named functions16100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 compressed PNG file occupies 0.05MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/sprite.64.all-fs8.png50.97KB49.89KB▼ 2.12%