84% web-visitor-counter

Code Review | Web Visitor Counter

WordPress plugin Web Visitor Counter scored 84% from 54 tests.

About plugin

  • Plugin page: web-visitor-counter
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.8
  • WordPress version: 6.3.1
  • First release: Aug 4, 2021
  • Latest release: Aug 4, 2021
  • Number of updates: 2
  • Update frequency: every 2.5 days
  • Top authors: jennyong (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 1,051 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.06MB] [CPU: ▼4.49ms] Passed 4 tests

This is a short check of server-side resources used by Web Visitor Counter
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0641.20 ▼1.09
Dashboard /wp-admin3.35 ▲0.0543.15 ▼3.93
Posts /wp-admin/edit.php3.47 ▲0.1146.71 ▲4.92
Add New Post /wp-admin/post-new.php5.95 ▲0.0783.11 ▼10.46
Media Library /wp-admin/upload.php3.28 ▲0.0533.23 ▼2.49

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 22 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-posts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Web Visitor Counter
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,887 ▲13014.02 ▼0.627.53 ▲5.3936.81 ▼2.82
Dashboard /wp-admin2,210 ▲225.88 ▲0.97101.45 ▼0.1941.12 ▼5.15
Posts /wp-admin/edit.php2,093 ▲42.01 ▲0.0539.23 ▲4.5235.16 ▲2.15
Add New Post /wp-admin/post-new.php1,518 ▼1517.59 ▼5.27596.28 ▼58.8457.43 ▲7.35
Media Library /wp-admin/upload.php1,392 ▲44.29 ▲0.0494.70 ▼8.5241.23 ▼3.99

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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 does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/web-visitor-counter/admin/partials/web-visitor-counter-admin-display.php
    • > /wp-content/plugins/web-visitor-counter/public/partials/web-visitor-counter-public-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (This screen shot description corresponds to screenshot-1.(png|jpg|jpeg|gif). Note that the screenshot is taken from), #2 (This is the second screen shot)
The official readme.txt is a good inspiration

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

The primary PHP file in "Web Visitor Counter" version 1.0.0 is used by WordPress to initiate all plugin functionality
61 characters long description:
Show page or post view count to site visitor in a simple way.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin198 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP12125534187
JavaScript24546
CSS2085

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.11
Average class complexity1.86
▷ Minimum class complexity1.00
▷ Maximum class complexity4.00
Average method complexity1.24
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods25
▷ Static methods28.00%
▷ Public methods2080.00%
▷ Protected methods00.00%
▷ Private methods520.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
No PNG files were detected