10% simple-visitor-counter-widget

Code Review | Simple Visitor Counter

WordPress plugin Simple Visitor Counter scored10%from 54 tests.

About plugin

  • Plugin page: simple-visitor-co...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.7.2
  • WordPress version: 6.3.1
  • First release: Feb 9, 2017
  • Latest release: Feb 9, 2017
  • Number of updates: 9
  • Update frequency: N/A
  • Top authors: plugindeveloper112 (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

1,000+ active /31,262 total downloads

Benchmarks

Plugin footprint 40% 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
  • The plugin did not install without errors
    • > Warning in wp-content/plugins/simple-visitor-counter-widget/index.php+215
    Use of undefined constant ‘1’ - assumed '‘1’' (this will throw an Error in a future version of PHP)

Server metrics [RAM: ▼1.91MB] [CPU: ▼60.02ms] Passed 4 tests

This is a short check of server-side resources used by Simple Visitor Counter
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.09 ▼1.375.34 ▼36.04
Dashboard /wp-admin2.11 ▼1.246.17 ▼56.72
Posts /wp-admin/edit.php2.11 ▼1.255.16 ▼48.73
Add New Post /wp-admin/post-new.php2.11 ▼3.786.09 ▼98.60
Media Library /wp-admin/upload.php2.11 ▼1.125.46 ▼27.60

Server storage [IO: ▲0.01MB] [DB: ▲0.00MB] 67% from 3 tests

How much does this plugin use your filesystem and database?
These are issues you should consider
  • The plugin illegally modified 1 file (4.00KB) outside of "wp-content/plugins/simple-visitor-counter-widget/" and "wp-content/uploads/"
    • (new file) wp-content/mgd_mirror/mgd_maximinodotpy-gitdown-test-repository
Filesystem: 2 new files
Database: 1 new table, 8 new options
New tables
wp_vcp_log
New WordPress options
db_upgraded
widget_simplevistorcounter_widget
widget_recent-comments
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
vcp_db_version

Browser metrics Passed 4 tests

Simple Visitor Counter: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,842 ▲8113.57 ▼1.111.88 ▲0.2040.00 ▼1.22
Dashboard /wp-admin2,233 ▲304.87 ▼0.98103.59 ▼0.0543.03 ▲2.90
Posts /wp-admin/edit.php2,112 ▲122.01 ▼0.0237.65 ▲0.5241.18 ▲3.63
Add New Post /wp-admin/post-new.php1,384 ▼14221.60 ▲4.10556.03 ▼137.4656.31 ▼12.07
Media Library /wp-admin/upload.php1,409 ▲94.18 ▼0.0898.40 ▼19.4944.30 ▼6.75

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
These items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Warning in wp-content/plugins/simple-visitor-counter-widget/index.php+215
    Use of undefined constant ‘1’ - assumed '‘1’' (this will throw an Error in a future version of PHP)
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_simplevistorcounter_widget
    • theysaidso_admin_options
    • widget_recent-comments

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)
Good news, no errors were detected

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
Please take a closer look at the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/simple-visitor-counter-widget/index.php:12

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)
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === simple-visitor-counter-widget === )
You can look at the official readme.txt

simple-visitor-counter-widget/index.php 92% from 13 tests

The main PHP file in "Simple Visitor Counter" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("simple-visitor-counter-widget.php" instead of "index.php")

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
Good job! No executable or dangerous file extensions detected170 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP16317170

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity15.00
▷ Minimum class complexity15.00
▷ Maximum class complexity15.00
Average method complexity4.50
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.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

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin