73% wp-slimstat

Code Review | SlimStat Analytics

WordPress plugin SlimStat Analytics scored73%from 54 tests.

About plugin

  • Plugin page: wp-slimstat
  • Plugin version: 5.1.2
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.4
  • WordPress version: 6.3.1
  • First release: Apr 12, 2010
  • Latest release: Dec 1, 2023
  • Number of updates: 1,159
  • Update frequency: every 4.3 days
  • Top authors: coolmann (98.02%)mostafa.s1990 (2.07%)

Code review

54 tests

User reviews

808 reviews

Install metrics

100,000+ active /6,006,457 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
Install script ran successfully

Server metrics [RAM: ▲0.83MB] [CPU: ▲7.20ms] Passed 4 tests

Analyzing server-side resources used by SlimStat Analytics
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.29 ▲0.8349.38 ▲8.28
Dashboard /wp-admin5.61 ▲2.2783.49 ▲18.29
Posts /wp-admin/edit.php4.19 ▲0.8353.91 ▲9.57
Add New Post /wp-admin/post-new.php6.72 ▲0.8495.46 ▲3.00
Media Library /wp-admin/upload.php4.06 ▲0.8342.18 ▲7.94
Traffic Sources /wp-admin/admin.php?page=slimview55.0356.20
Upgrade to Pro /wp-admin/admin.php?page=slimpro4.9343.46
Customize /wp-admin/admin.php?page=slimlayout4.9245.50
Site Analysis /wp-admin/admin.php?page=slimview45.0465.94
Audience /wp-admin/admin.php?page=slimview35.0462.12
Real-time /wp-admin/admin.php?page=slimview15.5754.31
Overview /wp-admin/admin.php?page=slimview25.0359.79
Settings /wp-admin/admin.php?page=slimconfig5.3247.63

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 878 new files
Database: 4 new tables, 8 new options
New tables
wp_slim_stats
wp_slim_events_archive
wp_slim_stats_archive
wp_slim_events
New WordPress options
slimstat_options
widget_slimstat_widget
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
db_upgraded
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for SlimStat Analytics
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,399 ▲65214.16 ▼0.1984.40 ▲82.8039.87 ▼4.89
Dashboard /wp-admin3,412 ▲1,23810.70 ▲5.08242.59 ▲153.1286.89 ▲41.50
Posts /wp-admin/edit.php2,153 ▲532.00 ▲0.0342.58 ▼0.0136.33 ▲1.17
Add New Post /wp-admin/post-new.php1,568 ▲4223.22 ▼0.06602.71 ▼100.3952.35 ▲3.91
Media Library /wp-admin/upload.php1,450 ▲534.16 ▼0.0598.53 ▼3.6240.62 ▼4.26
Traffic Sources /wp-admin/admin.php?page=slimview51,9847.10140.32328.53
Upgrade to Pro /wp-admin/admin.php?page=slimpro1,3856.6594.0181.27
Customize /wp-admin/admin.php?page=slimlayout2,5207.7896.8460.89
Site Analysis /wp-admin/admin.php?page=slimview41,9656.93194.21175.68
Audience /wp-admin/admin.php?page=slimview31,9668.47446.01167.86
Real-time /wp-admin/admin.php?page=slimview12,3647.4199.18154.48
Overview /wp-admin/admin.php?page=slimview21,8587.96316.34119.49
Settings /wp-admin/admin.php?page=slimconfig1,6266.5188.3393.14

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
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > Warning in wp-content/plugins/wp-slimstat/uninstall.php+68
    unlink(wp-content/uploads/wp-slimstat/maxmind.mmdb): No such file or directory
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_slimstat_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

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
  • 113× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'BrowscapPHP\\Helper\\QuoterInterface' not found in wp-content/plugins/wp-slimstat/vendor/browscap-php/browscap/browscap-php/src/Helper/Quoter.php:18
    • > PHP Fatal error
      Uncaught Error: Interface 'League\\Flysystem\\FilesystemException' not found in wp-content/plugins/wp-slimstat/vendor/browscap-php/league/flysystem/src/CorruptedPathDetected.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'League\\MimeTypeDetection\\ExtensionToMimeTypeMap' not found in wp-content/plugins/wp-slimstat/vendor/browscap-php/league/mime-type-detection/src/EmptyExtensionToMimeTypeMap.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Console\\Command\\Command' not found in wp-content/plugins/wp-slimstat/vendor/browscap-php/browscap/browscap-php/src/Command/FetchCommand.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'MatthiasMullie\\Scrapbook\\Adapters\\Collections\\Utils\\PrefixReset' not found in wp-content/plugins/wp-slimstat/vendor/browscap-php/matthiasmullie/scrapbook/src/Adapters/Collections/Memcached.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\String\\Inflector\\InflectorInterface' not found in wp-content/plugins/wp-slimstat/vendor/browscap-php/symfony/string/Inflector/EnglishInflector.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'League\\Flysystem\\StorageAttributes' not found in wp-content/plugins/wp-slimstat/vendor/browscap-php/league/flysystem/src/FileAttributes.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'League\\MimeTypeDetection\\ExtensionToMimeTypeMap' not found in wp-content/plugins/wp-slimstat/vendor/browscap-php/league/mime-type-detection/src/OverridingExtensionToMimeTypeMap.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'League\\Flysystem\\FilesystemException' not found in wp-content/plugins/wp-slimstat/vendor/browscap-php/league/flysystem/src/FilesystemOperationFailed.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'League\\Flysystem\\FilesystemOperationFailed' not found in wp-content/plugins/wp-slimstat/vendor/browscap-php/league/flysystem/src/UnableToReadFile.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention:
  • Requires php: Version format is invalid
  • Tags: Too many tags (15 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-slimstat/wp-slimstat.php Passed 13 tests

"SlimStat Analytics" version 5.1.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
46 characters long description:
The leading web analytics plugin for WordPress

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin93,296 lines of code in 514 files:
LanguageFilesBlank linesComment linesLines of code
PO File1223,07843,45441,438
PHP2175,1317,46735,066
SVG27125210,721
JSON3002,426
Sass139942,190
JavaScript62021451,347
Markdown211083
CSS20025

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
It is recommended to fix the following
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 111)
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity17.44
▷ Minimum class complexity1.00
▷ Maximum class complexity363.00
Average method complexity3.74
▷ Minimum method complexity1.00
▷ Maximum method complexity111.00
Code structure
Namespaces38
Interfaces38
Traits1
Classes150
▷ Abstract classes42.67%
▷ Concrete classes14697.33%
▷ Final classes4732.19%
Methods1,241
▷ Static methods27322.00%
▷ Public methods1,04884.45%
▷ Protected methods1139.11%
▷ Private methods806.45%
Functions111
▷ Named functions7971.17%
▷ Anonymous functions3228.83%
Constants149
▷ Global constants138.72%
▷ Class constants13691.28%
▷ Public constants11383.09%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
77 compressed PNG files occupy 0.07MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/images/browsers/netscape.png1.50KB1.44KB▼ 3.46%
admin/assets/images/browsers/feedburner.png0.70KB0.80KB0.00%
admin/assets/images/browsers/ie.png1.59KB1.49KB▼ 5.85%
admin/assets/images/browsers/chromium.png1.54KB1.47KB▼ 4.50%
admin/assets/images/browsers/facebookexternalhit.png0.28KB0.29KB0.00%