53% xt-visitor-counter

Code Review | XT Visitor Counter

WordPress plugin XT Visitor Counter scored53%from 54 tests.

About plugin

  • Plugin page: xt-visitor-counter
  • Plugin version: 1.4.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.1.1
  • WordPress version: 6.3.1
  • First release: Jul 21, 2016
  • Latest release: Jan 31, 2023
  • Number of updates: 23
  • Update frequency: every 103.7 days
  • Top authors: xtrsyz (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

10,000+ active /90,978 total downloads

Benchmarks

Plugin footprint 48% 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.94MB] [CPU: ▼31.30ms] Passed 4 tests

Server-side resources used by XT Visitor Counter
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0240.15 ▲2.20
Dashboard /wp-admin3.00 ▼0.3023.40 ▼24.45
Posts /wp-admin/edit.php3.00 ▼0.3526.15 ▼19.11
Add New Post /wp-admin/post-new.php3.00 ▼2.8822.85 ▼65.05
Media Library /wp-admin/upload.php3.00 ▼0.2219.33 ▼16.59
XT Visitor Counter /wp-admin/options-general.php?page=xtvc_options_general3.0022.36

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 142 new files
Database: 1 new table, 7 new options
New tables
wp_xt_statistic
New WordPress options
widget_recent-comments
widget_xt_visitor_counter
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for XT Visitor Counter
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.23 ▼1.201.64 ▼0.0541.77 ▲0.69
Dashboard /wp-admin2,213 ▲255.84 ▲0.9698.83 ▼13.0939.35 ▼4.36
Posts /wp-admin/edit.php2,093 ▲42.06 ▲0.0438.34 ▲2.5033.90 ▼1.28
Add New Post /wp-admin/post-new.php1,545 ▲1118.55 ▼4.69611.31 ▼73.8251.04 ▲7.73
Media Library /wp-admin/upload.php1,392 ▲44.22 ▼0.0193.64 ▼13.1742.39 ▼0.78
XT Visitor Counter /wp-admin/options-general.php?page=xtvc_options_general1,2762.5341.16111.68

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Uninstall procedure had uncaught errors
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_xt_statistic
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_xt_visitor_counter
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=xtvc_options_general
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
    • > GET request to /wp-admin/options-general.php?page=xtvc_options_general
    • > Notice in wp-content/plugins/xt-visitor-counter/xt-visitor-counter-options-general.php+6
    Undefined index: reset_xtvc
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=xtvc_options_general
    • > Notice in wp-content/plugins/xt-visitor-counter/xt-visitor-counter.php+102
    Undefined variable: done
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=xtvc_options_general
    • > Notice in wp-content/plugins/xt-visitor-counter/xt-visitor-counter.php+102
    Trying to access array offset on value of type null

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/xt-visitor-counter/xt-visitor-counter-widgets.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/xt-visitor-counter/xt-visitor-counter-widgets.php:2
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/xt-visitor-counter/xt-visitor-counter.php on line 29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/xt-visitor-counter/xt-visitor-counter-options-general.php:2

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There are user-side issues you should fix
    • > GET request to /wp-admin/options-general.php?page=xtvc_options_general
    • > Network (severe)
    https://promo.propellerads.com/728x90_06.gif - Failed to load resource: net::ERR_CERT_DATE_INVALID

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
7 plugin tags: blog traffic, traffic count, visitor traffic, blog stats, traffic counter...

xt-visitor-counter/xt-visitor-counter.php Passed 13 tests

This is the main PHP file of "XT Visitor Counter" version 1.4.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
107 characters long description:
XT Visitor Counter is a widgets which will display the Visitor counter and traffic statistics on WordPress.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin470 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP34121440
CSS10230
HTML1080

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity24.00
▷ Minimum class complexity24.00
▷ Maximum class complexity24.00
Average method complexity8.67
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods3
▷ Static methods00.00%
▷ Public methods3100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions990.00%
▷ Anonymous functions110.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
16 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
counter/mvcyesterday.png0.56KB0.38KB▼ 32.06%
counter/mvctoday.png0.42KB0.26KB▼ 38.89%
counter/mvcvisit.png0.60KB0.47KB▼ 22.53%
counter/online.png0.56KB0.38KB▼ 31.36%
counter/yesterday.png0.56KB0.38KB▼ 32.06%