68% user-stats

Code Review | User Stats

WordPress plugin User Stats scored68%from 54 tests.

About plugin

  • Plugin page: user-stats
  • Plugin version: 1.0.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-3.7.1
  • WordPress version: 6.3.1
  • First release: Sep 3, 2013
  • Latest release: Jan 9, 2014
  • Number of updates: 15
  • Update frequency: every 8.5 days
  • Top authors: ApinaPress (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

200+ active /10,391 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
Installer ran successfully

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

Server-side resources used by User Stats
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1138.55 ▼5.73
Dashboard /wp-admin3.42 ▲0.1150.42 ▲4.30
Posts /wp-admin/edit.php3.53 ▲0.1751.46 ▼2.94
Add New Post /wp-admin/post-new.php6.00 ▲0.1195.40 ▼5.45
Media Library /wp-admin/upload.php3.34 ▲0.1134.99 ▲1.51
User Stats /wp-admin/users.php?page=user-stats3.6334.07

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 43 new files
Database: 1 new table, 7 new options
New tables
wp_userstats_count
New WordPress options
db_upgraded
user_stats_nag
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for User Stats
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3213.91 ▼0.381.82 ▲0.2239.91 ▼1.49
Dashboard /wp-admin2,199 ▲225.63 ▼0.0390.35 ▼1.1740.10 ▼2.31
Posts /wp-admin/edit.php2,101 ▲12.02 ▲0.0739.49 ▲4.1336.15 ▼4.73
Add New Post /wp-admin/post-new.php1,537 ▲1117.98 ▼5.19625.42 ▼27.7066.97 ▲11.36
Media Library /wp-admin/upload.php1,401 ▲14.18 ▼0.02102.95 ▼5.0743.80 ▼1.04
User Stats /wp-admin/users.php?page=user-stats1,1012.3944.5436.89

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_userstats_count
  • The uninstall procedure has failed, leaving 7 options in the database
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • user_stats_nag
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
  • 20 occurences, only the last one shown
    • > GET request to /wp-admin/users.php?page=user-stats
    • > Notice in wp-content/plugins/user-stats/views/options.php+354
    Trying to access array offset on value of type bool

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 fix the following items
  • 7× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Notice
      Undefined variable: namespace in wp-content/plugins/user-stats/views/options.php on line 1
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/user-stats/lib/constants.php on line 19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/user-stats/lib/constants.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/user-stats/lib/shortcodes.php:2
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/user-stats/lib/constants.php on line 19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/user-stats/views/options.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/user-stats/lib/constants.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: statistics, stats, author, post count, user

user-stats/user-stats.php Passed 13 tests

The primary PHP file in "User Stats" version 1.0.7 is used by WordPress to initiate all plugin functionality
101 characters long description:
Get post count, post view count, cost per article, cost per 1000 views and more stats for your Users.

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
Everything looks great! No dangerous files found in this plugin2,201 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP54392351,012
CSS37443794
JavaScript412738211
PO File28184184

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity19.00
▷ Minimum class complexity19.00
▷ Maximum class complexity19.00
Average method complexity2.12
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods16
▷ Static methods318.75%
▷ Public methods1381.25%
▷ Protected methods00.00%
▷ Private methods318.75%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
16 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/images/ui-icons_cd0a0a_256x240.png4.44KB4.17KB▼ 6.02%
css/images/ui-bg_flat_75_ffffff_40x100.png0.20KB0.08KB▼ 58.17%
css/images/ui-bg_glass_95_fef1ec_1x400.png0.32KB0.15KB▼ 54.82%
css/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.27KB0.18KB▼ 35.00%
images/combine.png0.30KB0.45KB0.00%