78% social-bar-lite

Code Review | Social Bar Lite

WordPress plugin Social Bar Lite scored78%from 54 tests.

About plugin

  • Plugin page: social-bar-lite
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jul 1, 2016
  • Latest release: Aug 17, 2016
  • Number of updates: 16
  • Update frequency: every 10.0 days
  • Top authors: infranetworking (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,692 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.05MB] [CPU: ▼7.40ms] Passed 4 tests

This is a short check of server-side resources used by Social Bar Lite
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0427.77 ▼18.81
Dashboard /wp-admin3.36 ▲0.0648.55 ▼3.32
Posts /wp-admin/edit.php3.48 ▲0.1247.61 ▲1.63
Add New Post /wp-admin/post-new.php5.94 ▲0.0586.39 ▼9.11
Media Library /wp-admin/upload.php3.29 ▲0.0539.48 ▲3.88

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 19 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Social Bar Lite
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,986 ▲22914.67 ▲0.4041.52 ▲39.4140.60 ▼7.09
Dashboard /wp-admin2,219 ▲314.85 ▼0.18127.83 ▲18.5744.63 ▲3.32
Posts /wp-admin/edit.php2,084 ▼52.03 ▲0.0136.99 ▼13.6532.35 ▼1.81
Add New Post /wp-admin/post-new.php1,538 ▲423.03 ▼0.01635.72 ▼17.1589.56 ▲26.27
Media Library /wp-admin/upload.php1,407 ▲224.22 ▲0.03103.26 ▼16.4143.18 ▼1.96

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments

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
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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 items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/social-bar-lite/views/showbar.php
  • 11× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'social_bl_appModel' not found in wp-content/plugins/social-bar-lite/models/social_bl_dataPlugin.php:3
    • > PHP Warning
      Use of undefined constant SOCIAL_BL_PLUGIN_NAME_VAR - assumed 'SOCIAL_BL_PLUGIN_NAME_VAR' (this will throw an Error in a future version of PHP) in wp-content/plugins/social-bar-lite/views/showbar.php on line 5
    • > PHP Notice
      Undefined variable: title_module in wp-content/plugins/social-bar-lite/views/settings.php on line 3
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/social-bar-lite/views/showbar.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/social-bar-lite/views/settings.php:6
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/social-bar-lite/views/showbar.php on line 3
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/social-bar-lite/views/showbar.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'social_bl_appController' not found in wp-content/plugins/social-bar-lite/controllers/social_bl_masterPluginController.php:3
    • > PHP Warning
      Use of undefined constant SOCIAL_BL_PLUGIN_NAME_VAR - assumed 'SOCIAL_BL_PLUGIN_NAME_VAR' (this will throw an Error in a future version of PHP) in wp-content/plugins/social-bar-lite/views/showbar.php on line 3
    • > PHP Warning
      Use of undefined constant SOCIAL_BL_PLUGIN_NAME_VAR - assumed 'SOCIAL_BL_PLUGIN_NAME_VAR' (this will throw an Error in a future version of PHP) in wp-content/plugins/social-bar-lite/views/showbar.php on line 10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 90% 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:
  • Requires at least: Invalid plugin version format
You can look at the official readme.txt

social-bar-lite/social_bl_wp-socialbarlite.php 85% from 13 tests

The main PHP file in "Social Bar Lite" ver. 1.0.2 adds more information about the plugin and also serves as the entry point for this plugin
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-bar-lite.php" instead of "social_bl_wp-socialbarlite.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 280 characters long)

Code Analysis Passed 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 plugin518 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP79620365
JavaScript591089
CSS29864

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity8.50
▷ Minimum class complexity1.00
▷ Maximum class complexity29.00
Average method complexity3.14
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods14
▷ Static methods00.00%
▷ Public methods14100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
statics/images/Facebook.png33.65KB14.38KB▼ 57.26%
statics/images/Twitter.png3.58KB0.78KB▼ 78.25%