84% user-role-counter

Code Review | User Counter

WordPress plugin User Counter scored84%from 54 tests.

About plugin

  • Plugin page: user-role-counter
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jun 8, 2023
  • Latest release: Aug 11, 2023
  • Number of updates: 4
  • Update frequency: every 16.0 days
  • Top authors: markmemayank (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /210 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.01MB] [CPU: ▼5.69ms] Passed 4 tests

Analyzing server-side resources used by User Counter
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.40 ▼3.44
Dashboard /wp-admin3.26 ▼0.0442.35 ▼11.64
Posts /wp-admin/edit.php3.36 ▲0.0145.25 ▼3.49
Add New Post /wp-admin/post-new.php5.89 ▲0.0184.58 ▼4.17
Media Library /wp-admin/upload.php3.23 ▲0.0136.30 ▲0.87

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

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

Browser metrics Passed 4 tests

Checking browser requirements for User Counter
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,873 ▲11214.44 ▼0.091.82 ▲0.0946.82 ▲4.82
Dashboard /wp-admin2,279 ▲985.66 ▼0.0786.43 ▼17.8840.88 ▲0.64
Posts /wp-admin/edit.php2,103 ▲32.00 ▲0.0138.19 ▲0.8136.64 ▲2.01
Add New Post /wp-admin/post-new.php1,526 ▼1123.74 ▼1.46633.63 ▲3.1482.45 ▼8.95
Media Library /wp-admin/upload.php1,400 ▼04.20 ▲0.0299.65 ▼9.9443.35 ▼1.73

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
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • 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
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 1× 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/user-role-counter/user-counter.php:45

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
1 plugin tags: count the number of all type of users

user-role-counter/user-counter.php 92% from 13 tests

The primary PHP file in "User Counter" version 1.0 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("user-role-counter.php" instead of "user-counter.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected33 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP14833

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.22
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%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There were not PNG files found in your plugin