10% visitors-counter

Code Review | Wordpress Visitors

WordPress plugin Wordpress Visitors scored10%from 54 tests.

About plugin

  • Plugin page: visitors-counter
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.6
  • WordPress version: 6.3.1
  • First release: Aug 13, 2016
  • Latest release: Aug 20, 2016
  • Number of updates: 18
  • Update frequency: every 0.4 days
  • Top authors: zilonjakir (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /2,587 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Please fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Warning in wp-content/plugins/visitors-counter/wp_visitors.php+41
    Declaration of wp_visitors::update() should be compatible with WP_Widget::update($new_instance, $old_instance)

Server metrics [RAM: ▼2.19MB] [CPU: ▼58.02ms] Passed 4 tests

This is a short check of server-side resources used by Wordpress Visitors
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.07 ▼1.668.29 ▼34.68
Dashboard /wp-admin2.09 ▼1.475.83 ▼52.14
Posts /wp-admin/edit.php2.09 ▼1.585.70 ▼44.42
Add New Post /wp-admin/post-new.php2.09 ▼4.056.08 ▼100.84
Media Library /wp-admin/upload.php2.09 ▼1.406.15 ▼33.29

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 5 new files
Database: 1 new table, 8 new options
New tables
wp_counter_total
New WordPress options
widget_recent-comments
widget_wp_visitors
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
dbsync_db_version

Browser metrics Passed 4 tests

An overview of browser requirements for Wordpress Visitors
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,873 ▲8713.85 ▼0.537.82 ▲5.7439.15 ▼4.45
Dashboard /wp-admin2,195 ▲155.64 ▼0.0385.30 ▼3.3944.24 ▲5.11
Posts /wp-admin/edit.php2,100 ▼02.01 ▲0.0442.52 ▲4.6035.67 ▲0.35
Add New Post /wp-admin/post-new.php1,526 ▼017.72 ▲0.07669.21 ▼31.1056.76 ▲2.17
Media Library /wp-admin/upload.php1,403 ▲34.25 ▲0.13104.24 ▼12.9646.42 ▼2.42

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
These items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Warning in wp-content/plugins/visitors-counter/wp_visitors.php+41
    Declaration of wp_visitors::update() should be compatible with WP_Widget::update($new_instance, $old_instance)
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_counter_total
  • This plugin does not fully uninstall, leaving 8 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • dbsync_db_version
    • widget_wp_visitors

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/visitors-counter/total_visitor_counter.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/visitors-counter/total_visitor_counter.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Screenshots: Please add descriptions for these screenshots #1, #2 in visitors-counter/assets to your readme.txt
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === visitors-counter === )
The official readme.txt might help

visitors-counter/wp_visitors.php 92% from 13 tests

The entry point to "Wordpress Visitors" version 1.0 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("visitors-counter.php" instead of "wp_visitors.php")

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
There were no executable files found in this plugin189 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP24442138
JavaScript111051

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.03
Average class complexity2.00
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.18
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods981.82%
▷ Protected methods00.00%
▷ Private methods218.18%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG files were detected