10% visitor-counter

Code Review | Online Counter

WordPress plugin Online Counter scored10%from 54 tests.

About plugin

  • Plugin page: visitor-counter
  • Plugin version: 2.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.0
  • WordPress version: 6.3.1
  • First release: Nov 12, 2014
  • Latest release: Nov 12, 2014
  • Number of updates: 2
  • Update frequency: every 10.0 days
  • Top authors: husselholf (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /12,024 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
It is recommended to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/visitor-counter/image.php+129
    Methods with the same name as their class will not be constructors in a future version of PHP; wHitCounter has a deprecated constructor

Server metrics [RAM: ▼1.89MB] [CPU: ▼60.03ms] Passed 4 tests

This is a short check of server-side resources used by Online Counter
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.10 ▼1.374.87 ▼40.18
Dashboard /wp-admin2.12 ▼1.196.10 ▼44.16
Posts /wp-admin/edit.php2.12 ▼1.246.07 ▼46.99
Add New Post /wp-admin/post-new.php2.12 ▼3.776.54 ▼108.79
Media Library /wp-admin/upload.php2.12 ▼1.116.09 ▼29.39
Hit Counter /wp-admin/options-general.php?page=visitor-hit-counter2.125.53

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 1,553 new files
Database: no new tables, 13 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_theysaidso_widget
vthc_display_credit
vthc_data
vthc_display_footer
theysaidso_admin_options
widget_recent-posts
vthc_style
vthc_count_only_unique
...

Browser metrics Passed 4 tests

A check of browser resources used by Online Counter
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,475 ▼31114.35 ▼0.020.59 ▼1.3213.27 ▼28.59
Dashboard /wp-admin2,211 ▲315.56 ▼0.0896.32 ▲5.7345.42 ▼2.86
Posts /wp-admin/edit.php2,119 ▲191.93 ▼0.0140.28 ▲3.0441.30 ▲5.77
Add New Post /wp-admin/post-new.php1,387 ▼14120.89 ▼2.16533.68 ▼188.5346.26 ▼15.07
Media Library /wp-admin/upload.php1,410 ▲104.19 ▲0.09100.27 ▼14.6443.08 ▼9.05
Hit Counter /wp-admin/options-general.php?page=visitor-hit-counter6901.247.1228.79

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/visitor-counter/image.php+129
    Methods with the same name as their class will not be constructors in a future version of PHP; wHitCounter has a deprecated constructor
  • This plugin does not fully uninstall, leaving 13 options in the database
    • vthc_data
    • widget_recent-posts
    • can_compress_scripts
    • vthc_count_only_unique
    • vthc_display_footer
    • widget_recent-comments
    • vthc_style
    • widget_theysaidso_widget
    • vthc_check_update
    • widget_whitcounter
    • ...

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
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=visitor-hit-counter
    • > Deprecated in wp-content/plugins/visitor-counter/image.php+129
    Methods with the same name as their class will not be constructors in a future version of PHP; wHitCounter has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=visitor-hit-counter
    • > Deprecated in wp-content/plugins/visitor-counter/image.php+169
    Function create_function() is deprecated
    • > GET request to /wp-admin/options-general.php?page=visitor-hit-counter
    • > Warning in wp-content/plugins/visitor-counter/hitcounter_menu.php+41
    opendir(wp-content/plugins/visitor-hit-counter/styles/): failed to open dir: No such file or directory

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/visitor-counter/hitcounter_menu.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/visitor-counter/image.php:93

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% 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:
  • Tags: You are using too many tags: 22 tag instead of maximum 10
You can take inspiration from this readme.txt

visitor-counter/image.php 92% from 13 tests

This is the main PHP file of "Online Counter" version 2.6, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("visitor-counter.php" instead of "image.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected282 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP23428282

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity9.50
▷ Minimum class complexity6.00
▷ Maximum class complexity13.00
Average method complexity3.12
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
PNG images were not found in this plugin