10% lb-users-counter

Code Review | LB Users Counter

WordPress plugin LB Users Counter scored 10% from 54 tests.

About plugin

  • Plugin page: lb-users-counter
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-3.6
  • WordPress version: 5.8.1
  • First release: Aug 28, 2013
  • Latest release: Aug 29, 2013
  • Number of updates: 12
  • Update frequency: every 0.1 days
  • Top authors: Bonny85 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,855 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
It is recommended to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/lb-users-counter/class/lb_widget.class.php+12
    Methods with the same name as their class will not be constructors in a future version of PHP; lb_widget has a deprecated constructor

Server metrics [RAM: ▼1.82MB] [CPU: ▼188.78ms] Passed 4 tests

This is a short check of server-side resources used by LB Users Counter
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /1.81 ▼0.915.29 ▼24.30
Dashboard /wp-admin1.83 ▼1.229.07 ▼36.95
Posts /wp-admin/edit.php1.83 ▼1.276.30 ▼40.03
Add New Post /wp-admin/post-new.php1.83 ▼3.605.28 ▼650.98
Media Library /wp-admin/upload.php1.83 ▼1.175.53 ▼27.16

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 6 new files
Database: 1 new table, 1 new option
New tables
wp_lb_users_counter
New WordPress options
widget_lb_widget

Browser metrics Passed 4 tests

An overview of browser requirements for LB Users Counter
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,703 ▲10715.77 ▲0.179.48 ▲0.5151.78 ▲2.90
Dashboard /wp-admin2,973 ▲395.85 ▼0.09134.48 ▼8.72108.90 ▼11.00
Posts /wp-admin/edit.php2,736 ▼32.69 ▼0.0070.78 ▲7.0190.74 ▲1.15
Add New Post /wp-admin/post-new.php1,500 ▼018.61 ▼0.22366.55 ▲1.03106.28 ▼7.51
Media Library /wp-admin/upload.php1,810 ▲35.01 ▲0.01153.27 ▼2.35123.73 ▲3.65

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/lb-users-counter/class/lb_widget.class.php+12
    Methods with the same name as their class will not be constructors in a future version of PHP; lb_widget has a deprecated constructor
  • This plugin does not fully uninstall, leaving 1 option in the database
    • widget_lb_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 50% 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
Please take a closer look at the following
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lb-users-counter/class/lb_widget.class.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lb-users-counter/class/lb_widget.class.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
4 plugin tags: users, counter, login, widget

lb-users-counter/lb-users-counter.php Passed 13 tests

The entry point to "LB Users Counter" version 1.1 is a PHP file that has certain tags in its header comment area
133 characters long description:
Allows you to add a widget to a sidebar, where you can view some attributes with respect to the number of users browsing the website.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin232 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP37161192
PO File1131340

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity6.00
▷ Minimum class complexity2.00
▷ Maximum class complexity10.00
Average method complexity2.43
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods7
▷ Static methods342.86%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin