74% user-stats-wp

Code Review | User stats WP

WordPress plugin User stats WP scored74%from 54 tests.

About plugin

  • Plugin page: user-stats-wp
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.8
  • WordPress version: 6.3.1
  • First release: Jul 28, 2021
  • Latest release: Jul 28, 2021
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: worbee (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /309 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼8.19ms] Passed 4 tests

Analyzing server-side resources used by User stats WP
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0341.77 ▼4.25
Dashboard /wp-admin3.34 ▲0.0357.34 ▲3.27
Posts /wp-admin/edit.php3.39 ▲0.0348.17 ▼6.62
Add New Post /wp-admin/post-new.php5.94 ▲0.0588.98 ▼22.09
Media Library /wp-admin/upload.php3.26 ▲0.0336.67 ▲0.22

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for User stats WP
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,823 ▲6214.80 ▲0.242.03 ▲0.2043.94 ▲0.98
Dashboard /wp-admin2,229 ▲494.95 ▼0.72103.42 ▲14.4244.45 ▼0.66
Posts /wp-admin/edit.php2,137 ▲372.32 ▲0.3135.70 ▼4.1132.90 ▼3.00
Add New Post /wp-admin/post-new.php1,557 ▲2923.20 ▲0.08682.92 ▲43.1437.50 ▼20.71
Media Library /wp-admin/upload.php1,434 ▲344.50 ▲0.33103.80 ▼1.2841.65 ▼4.63

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
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_userstatswpworbee
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget

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 | 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
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/user-stats-wp/lib/dashboard.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/user-stats-wp/lib/assets.php:54
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/user-stats-wp/lib/dashboard.php:4

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 errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
4 plugin tags: statistics, stats, analytics, user

user-stats-wp/user-stats-wp.php 92% from 13 tests

Analyzing the main PHP file in "User stats WP" version 1.0.0
Please take the time to fix the following:
  • Requires at least: The required version number must match the one declared in readme.txt ("5.0" instead of "5.2")

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 plugin10,348 lines of code in 51 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript212,2077,2797,826
CSS23611262,303
PHP53530183
Sass19024
JSON10012

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.02
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%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
5 compressed PNG files occupy 0.00MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/datatables/DataTables-1.10.25/images/sort_desc_disabled.png0.14KB0.25KB0.00%
assets/datatables/DataTables-1.10.25/images/sort_both.png0.20KB0.29KB0.00%
assets/datatables/DataTables-1.10.25/images/sort_asc.png0.16KB0.25KB0.00%
assets/datatables/DataTables-1.10.25/images/sort_desc.png0.15KB0.25KB0.00%
assets/datatables/DataTables-1.10.25/images/sort_asc_disabled.png0.14KB0.25KB0.00%