58% xt-visitor-counter

Code Review | XT Visitor Counter

WordPress plugin XT Visitor Counter scored 58% from 54 tests.

About plugin

  • Plugin page: xt-visitor-counter
  • Plugin version: 1.4.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.4.2
  • WordPress version: 5.9.2
  • First release: Jul 21, 2016
  • Latest release: Jul 25, 2020
  • Number of updates: 22
  • Update frequency: every 66.6 days
  • Top authors: xtrsyz (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

10,000+ active / 72,340 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼1.15MB] [CPU: ▼327.68ms] Passed 4 tests

This is a short check of server-side resources used by XT Visitor Counter
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.0960.08 ▲3.79
Dashboard /wp-admin3.18 ▼0.2319.63 ▼19.79
Posts /wp-admin/edit.php3.18 ▼0.4621.79 ▼21.78
Add New Post /wp-admin/post-new.php3.18 ▼3.7918.67 ▼1,264.48
Media Library /wp-admin/upload.php3.18 ▼0.1222.34 ▼4.66
XT Visitor Counter /wp-admin/options-general.php?page=xtvc_options_general3.1822.30

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 142 new files
Database: 1 new table, 1 new option
New tables
wp_xt_statistic
New WordPress options
widget_xt_visitor_counter

Browser metrics Passed 4 tests

A check of browser resources used by XT Visitor Counter
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,800 ▲4215.79 ▲0.236.78 ▲0.472.79 ▲0.39
Dashboard /wp-admin2,897 ▲396.13 ▼0.06122.06 ▼18.22156.64 ▼8.13
Posts /wp-admin/edit.php2,696 ▲83.23 ▼0.0064.30 ▼1.34140.87 ▼3.45
Add New Post /wp-admin/post-new.php1,714 ▼320.81 ▼1.13444.42 ▼18.75162.50 ▲2.54
Media Library /wp-admin/upload.php1,703 ▲25.57 ▲0.06138.35 ▼11.13187.40 ▲1.02
XT Visitor Counter /wp-admin/options-general.php?page=xtvc_options_general1,7683.0874.66151.11

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > User deprecated in wp-includes/functions.php+5600
    has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • Zombie tables detected upon uninstall: 1 table
    • wp_xt_statistic
  • The uninstall procedure has failed, leaving 1 option in the database
    • widget_xt_visitor_counter

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just 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+5600
    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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 4× PHP files trigger server errors when accessed directly:
    • > 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
    • > 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

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
7 plugin tags: blog stats, traffic count, visitor counter, traffic counter, visitor traffic...

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

The main PHP file in "XT Visitor Counter" ver. 1.4.2 adds more information about the plugin and also serves as the entry point for this plugin
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 an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
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

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
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

PNG files should be compressed to save space and minimize bandwidth usage
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/mvcmonth.png0.39KB0.25KB▼ 36.02%
counter/hits.png0.56KB0.38KB▼ 32.06%
counter/yesterday.png0.56KB0.38KB▼ 32.06%
counter/visit.png0.60KB0.47KB▼ 22.53%
counter/year.png0.39KB0.25KB▼ 36.34%