62% wp-stats-manager

Code Review | WP Visitor Statistics (Real Time Traffic)

WordPress plugin WP Visitor Statistics (Real Time Traffic) scored62%from 54 tests.

About plugin

  • Plugin page: wp-stats-manager
  • Plugin version: 6.9.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.2
  • WordPress version: 6.3.1
  • First release: Oct 24, 2017
  • Latest release: Aug 28, 2023
  • Number of updates: 223
  • Update frequency: every 9.6 days
  • Top authors: osamaesh (100%)

Code review

54 tests

User reviews

124 reviews

Install metrics

20,000+ active /569,270 total downloads

Benchmarks

Plugin footprint 65% 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲2.79MB] [CPU: ▲13.14ms] Passed 4 tests

An overview of server-side resources used by WP Visitor Statistics (Real Time Traffic)
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /6.25 ▲2.7860.86 ▲20.83
Dashboard /wp-admin6.15 ▲2.8062.86 ▲4.10
Posts /wp-admin/edit.php6.20 ▲2.8461.66 ▲14.73
Add New Post /wp-admin/post-new.php8.68 ▲2.79112.04 ▲12.89
Media Library /wp-admin/upload.php6.01 ▲2.7863.70 ▲33.00
Content /wp-admin/admin.php?page=wsm_content6.0255.54
Add ons /wp-admin/admin.php?page=wsm_addons6.0354.89
Traffic /wp-admin/admin.php?page=wsm_traffic6.16103.48
I.P. Exclusion /wp-admin/admin.php?page=wsm_ipexc6.0455.88
Settings /wp-admin/admin.php?page=wsm_settings6.5479.40
Traffic Sources /wp-admin/admin.php?page=wsm_trafficsrc6.0151.05
Visitors /wp-admin/admin.php?page=wsm_visitors6.0249.14

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 88 new files
Database: 16 new tables, 11 new options
New tables
wp_wsm_logVisit
wp_wsm_yearlyMonthlyReport
wp_wsm_resolutions
wp_wsm_searchEngines
wp_wsm_monthlyDailyReport
wp_wsm_url_log
wp_wsm_browsers
wp_wsm_oSystems
wp_wsm_logUniqueVisit
wp_wsm_yearwise_report
...
New WordPress options
widget_theysaidso_widget
widget_recent-comments
wsmKeepData
wsm_tables
wsm_popup_status
can_compress_scripts
wsm_dailyReportedTime
widget_recent-posts
db_upgraded
theysaidso_admin_options
...

Browser metrics Passed 4 tests

An overview of browser requirements for WP Visitor Statistics (Real Time Traffic)
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,913 ▲12714.76 ▲0.4918.05 ▲16.2343.37 ▲0.09
Dashboard /wp-admin2,257 ▲885.53 ▼0.3884.87 ▼13.0637.96 ▼6.87
Posts /wp-admin/edit.php2,165 ▲652.01 ▲0.0236.15 ▲0.0934.62 ▲0.51
Add New Post /wp-admin/post-new.php1,577 ▲5123.01 ▲0.01670.08 ▲46.4053.74 ▲0.04
Media Library /wp-admin/upload.php1,468 ▲684.23 ▲0.0598.89 ▲1.0744.99 ▲0.79
Content /wp-admin/admin.php?page=wsm_content2,9784.2976.5692.98
Add ons /wp-admin/admin.php?page=wsm_addons1,2733.5844.5395.16
Traffic /wp-admin/admin.php?page=wsm_traffic2,0045.61128.89101.12
I.P. Exclusion /wp-admin/admin.php?page=wsm_ipexc1,3593.9351.3477.29
Settings /wp-admin/admin.php?page=wsm_settings8,2703.9970.3984.28
Traffic Sources /wp-admin/admin.php?page=wsm_trafficsrc2,8854.1371.4381.35
Visitors /wp-admin/admin.php?page=wsm_visitors2,9994.1080.7555.96

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • Zombie tables were found after uninstall: 16 tables
    • wp_wsm_countries
    • wp_wsm_resolutions
    • wp_wsm_browsers
    • wp_wsm_logVisit
    • wp_wsm_yearlyMonthlyReport
    • wp_wsm_toolBars
    • wp_wsm_regions
    • wp_wsm_logUniqueVisit
    • wp_wsm_oSystems
    • wp_wsm_searchEngines
    • ...
  • Zombie WordPress options were found after uninstall: 11 options
    • db_upgraded
    • wsm_popup_status
    • wsm_dailyReportedTime
    • widget_recent-posts
    • theysaidso_admin_options
    • wsm_tables
    • widget_theysaidso_widget
    • wsmKeepData
    • wsm_lastHitTime
    • can_compress_scripts
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wsm_visitors
    • > Notice in wp-content/plugins/wp-stats-manager/includes/wsm_admin_interface.php+1333
    Undefined index: wsm_bosl
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wsm_content
    • > Notice in wp-content/plugins/wp-stats-manager/includes/wsm_functions.php+3132
    Undefined variable: search_filter
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wsm_traffic
    • > Notice in wp-content/plugins/wp-stats-manager/includes/wsm_db.php+1719
    Undefined offset: 1
  • 120 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wsm_traffic
    • > Notice in wp-content/plugins/wp-stats-manager/includes/wsm_db.php+1719
    Undefined index:
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wsm_traffic
    • > Notice in wp-content/plugins/wp-stats-manager/includes/wsm_db.php+1719
    Undefined offset: 2
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wsm_traffic
    • > Notice in wp-content/plugins/wp-stats-manager/includes/wsm_db.php+1719
    Undefined offset: 3
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wsm_traffic
    • > Notice in wp-content/plugins/wp-stats-manager/includes/wsm_db.php+1719
    Undefined offset: 4
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wsm_traffic
    • > Notice in wp-content/plugins/wp-stats-manager/includes/wsm_db.php+1719
    Undefined offset: 5
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wsm_traffic
    • > Notice in wp-content/plugins/wp-stats-manager/includes/wsm_db.php+1719
    Undefined offset: 6
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wsm_traffic
    • > Notice in wp-content/plugins/wp-stats-manager/includes/wsm_db.php+1719
    Undefined offset: 7
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wsm_traffic
    • > Notice in wp-content/plugins/wp-stats-manager/includes/wsm_db.php+1719
    Undefined offset: 8
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wsm_traffic
    • > Notice in wp-content/plugins/wp-stats-manager/includes/wsm_db.php+1719
    Undefined offset: 9
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wsm_traffic
    • > Notice in wp-content/plugins/wp-stats-manager/includes/wsm_db.php+1719
    Undefined offset: 10
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wsm_traffic
    • > Notice in wp-content/plugins/wp-stats-manager/includes/wsm_db.php+1719
    Undefined offset: 11
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wsm_traffic
    • > Notice in wp-content/plugins/wp-stats-manager/includes/wsm_db.php+1719
    Undefined offset: 12
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wsm_traffic
    • > Notice in wp-content/plugins/wp-stats-manager/includes/wsm_db.php+1719
    Undefined offset: 13
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wsm_traffic
    • > Notice in wp-content/plugins/wp-stats-manager/includes/wsm_db.php+1719
    Undefined offset: 14
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wsm_traffic
    • > Notice in wp-content/plugins/wp-stats-manager/includes/wsm_db.php+1719
    Undefined offset: 15
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wsm_traffic
    • > Notice in wp-content/plugins/wp-stats-manager/includes/wsm_db.php+1719
    Undefined offset: 16
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wsm_traffic
    • > Notice in wp-content/plugins/wp-stats-manager/includes/wsm_db.php+1719
    Undefined offset: 17
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wsm_traffic
    • > Notice in wp-content/plugins/wp-stats-manager/includes/wsm_db.php+1719
    Undefined offset: 18
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wsm_traffic
    • > Notice in wp-content/plugins/wp-stats-manager/includes/wsm_db.php+1719
    Undefined offset: 19
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wsm_traffic
    • > Notice in wp-content/plugins/wp-stats-manager/includes/wsm_db.php+1719
    Undefined offset: 20
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wsm_traffic
    • > Notice in wp-content/plugins/wp-stats-manager/includes/wsm_db.php+1719
    Undefined offset: 21
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wsm_traffic
    • > Notice in wp-content/plugins/wp-stats-manager/includes/wsm_db.php+1719
    Undefined offset: 22
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wsm_traffic
    • > Notice in wp-content/plugins/wp-stats-manager/includes/wsm_db.php+1719
    Undefined offset: 23
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wsm_traffic
    • > Notice in wp-content/plugins/wp-stats-manager/includes/wsm_db.php+1719
    Undefined offset: 24
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wsm_traffic
    • > Notice in wp-content/plugins/wp-stats-manager/includes/wsm_db.php+1719
    Undefined offset: 25
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wsm_traffic
    • > Notice in wp-content/plugins/wp-stats-manager/includes/wsm_db.php+1719
    Undefined offset: 26
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wsm_traffic
    • > Notice in wp-content/plugins/wp-stats-manager/includes/wsm_db.php+1719
    Undefined offset: 27
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wsm_traffic
    • > Notice in wp-content/plugins/wp-stats-manager/includes/wsm_db.php+1719
    Undefined offset: 28
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wsm_traffic
    • > Notice in wp-content/plugins/wp-stats-manager/includes/wsm_db.php+1719
    Undefined offset: 29
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wsm_traffic
    • > Notice in wp-content/plugins/wp-stats-manager/includes/wsm_db.php+1719
    Undefined offset: 30
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wsm_visitors
    • > Notice in wp-content/plugins/wp-stats-manager/includes/wsm_statistics.php+3252
    Undefined variable: searchengine
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wsm_trafficsrc
    • > Notice in wp-content/plugins/wp-stats-manager/includes/wsm_db.php+952
    Undefined variable: sqlReportQuery
    • > GET request to /wp-admin/admin.php?page=wsm_trafficsrc
    • > Notice in wp-content/plugins/wp-stats-manager/includes/wsm_functions.php+3050
    Undefined variable: html

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wp-stats-manager/wp-stats-manager.php
    • > /wp-content/plugins/wp-stats-manager/includes/wsm_modal.php
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      Use of undefined constant WSM_URL - assumed 'WSM_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-stats-manager/includes/wsm_modal.php on line 131
    • > PHP Warning
      Use of undefined constant WSM_URL - assumed 'WSM_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-stats-manager/includes/wsm_modal.php on line 125

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

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 to be fixed:
  • Screenshots: Add images for these screenshots: #8 (screenshot-8), #9 (screenshot-9)
  • Tags: Please delete some tags, you are using 50 tag instead of maximum 10
The official readme.txt might help

wp-stats-manager/wp-stats-manager.php Passed 13 tests

The main PHP file in "WP Visitor Statistics (Real Time Traffic)" ver. 6.9.4 adds more information about the plugin and also serves as the entry point for this plugin
128 characters long description:
This plugin will track the web analytics for each page and show various analytics report in admin panel as well as in front end.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected32,752 lines of code in 43 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript202,2285,35816,013
PHP111,3071,48313,818
PO File37261,0881,630
CSS91181141,291

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
These items need your attention
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 106)
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity302.00
▷ Minimum class complexity18.00
▷ Maximum class complexity641.00
Average method complexity7.34
▷ Minimum method complexity1.00
▷ Maximum method complexity106.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods276
▷ Static methods4114.86%
▷ Public methods27398.91%
▷ Protected methods00.00%
▷ Private methods31.09%
Functions52
▷ Named functions4790.38%
▷ Anonymous functions59.62%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
29 PNG files occupy 0.38MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/search-engine.png34.77KB12.03KB▼ 65.40%
images/arrow_rotate_anticlockwise.png0.72KB0.69KB▼ 5.13%
images/ui-bg_glass_55_fbf9ee_1x400.png0.12KB0.14KB0.00%
images/ui-bg_glass_75_dadada_1x400.png0.11KB0.16KB0.00%
images/search-engines.png34.77KB12.03KB▼ 65.40%