84% wp-online-users-stats

Code Review | WP Online Users Stats

WordPress plugin WP Online Users Stats scored84%from 54 tests.

About plugin

  • Plugin page: wp-online-users-s...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.4
  • WordPress version: 6.3.1
  • First release: Jul 4, 2017
  • Latest release: Apr 25, 2020
  • Number of updates: 8
  • Update frequency: every 128.5 days
  • Top authors: hk1993 (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active /4,132 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.11MB] [CPU: ▼9.52ms] Passed 4 tests

Analyzing server-side resources used by WP Online Users Stats
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1239.78 ▲0.29
Dashboard /wp-admin3.42 ▲0.0850.61 ▼7.04
Posts /wp-admin/edit.php3.53 ▲0.1847.78 ▼5.93
Add New Post /wp-admin/post-new.php6.02 ▲0.1383.50 ▼25.40
Media Library /wp-admin/upload.php3.34 ▲0.1136.98 ▲1.69

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

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

Browser metrics Passed 4 tests

WP Online Users Stats: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,956 ▲19514.31 ▲0.0618.05 ▲16.4439.88 ▲0.06
Dashboard /wp-admin2,230 ▲505.09 ▼0.4893.95 ▲7.9884.41 ▲42.90
Posts /wp-admin/edit.php2,134 ▲342.44 ▲0.4742.03 ▲2.1434.56 ▼2.00
Add New Post /wp-admin/post-new.php1,555 ▲2023.01 ▲4.77678.03 ▲58.8737.07 ▼26.27
Media Library /wp-admin/upload.php1,432 ▲294.54 ▲0.37106.24 ▲8.4771.28 ▲28.21

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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 take a closer look at the following
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wp-online-users-stats/public/partials/wp-online-users-stats-public-display.php
    • > /wp-content/plugins/wp-online-users-stats/admin/partials/wp-online-users-stats-admin-display.php

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

readme.txt 88% 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:
  • Screenshots: Add an image for screenshot #3 (You will see sub menu created name as "Online Users")
  • Tags: Too many tags (14 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

wp-online-users-stats/wp-online-users-stats.php Passed 13 tests

"WP Online Users Stats" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
96 characters long description:
This is a short description of what the plugin does. It's displayed in the WordPress admin area.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin7,546 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript52,0017,0656,498
PHP14197719525
CSS5738523

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity8.60
▷ Minimum class complexity1.00
▷ Maximum class complexity34.00
Average method complexity2.41
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods54
▷ Static methods2750.00%
▷ Public methods4990.74%
▷ Protected methods00.00%
▷ Private methods59.26%
Functions4
▷ Named functions4100.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
7 compressed PNG files occupy 0.00MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/images/sort_desc.png0.15KB0.25KB0.00%
public/images/sort_asc.png0.16KB0.25KB0.00%
public/images/sort_both.png0.20KB0.29KB0.00%
admin/images/sort_asc.png0.16KB0.25KB0.00%
admin/images/sort_both.png0.20KB0.29KB0.00%