62% who-hit-the-page-hit-counter

Code Review | Who Hit The Page - Hit Counter

WordPress plugin Who Hit The Page - Hit Counter scored 62% from 54 tests.

About plugin

  • Plugin page: who-hit-the-page-...
  • Plugin version: 1.4.14.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.4
  • WordPress version: 5.9.2
  • First release: Jun 18, 2013
  • Latest release: Apr 10, 2020
  • Number of updates: 67
  • Update frequency: every 37.2 days
  • Top authors: mahlamusa (100%)

Code review

54 tests

User reviews

15 reviews

Install metrics

2,000+ active / 69,561 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.86MB] [CPU: ▼285.50ms] Passed 4 tests

An overview of server-side resources used by Who Hit The Page - Hit Counter
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.41 ▲0.9058.96 ▲5.23
Dashboard /wp-admin4.26 ▲0.8539.67 ▲4.58
Posts /wp-admin/edit.php4.49 ▲0.8544.01 ▲5.81
Add New Post /wp-admin/post-new.php7.79 ▲0.83101.78 ▼1,152.58
Media Library /wp-admin/upload.php4.20 ▲0.9031.74 ▲0.79
/wp-admin/admin.php?page=whtp-force-update4.1729.12
Who Hit The Page /wp-admin/admin.php?page=whtp-admin-menu4.2134.52
View Page Hits /wp-admin/admin.php?page=whtp-view-page-hits4.2129.85
View IP Hits /wp-admin/admin.php?page=whtp-view-ip-hits4.2228.05
Denied IPs /wp-admin/admin.php?page=whtp-denied-ips4.2329.25
Help /wp-admin/admin.php?page=whtp-help4.2027.43
Settings /wp-admin/admin.php?page=whtp-settings4.2430.60
Visitor Stats /wp-admin/admin.php?page=whtp-visitor-stats4.2327.29

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 808 new files
Database: 6 new tables, 2 new options
New tables
wp_whtp_hitinfo
wp_whtp_ip2location
wp_whtp_ip_hits
wp_whtp_visiting_countries
wp_whtp_user_agents
wp_whtp_hits
New WordPress options
whtp_version
whtp_installed

Browser metrics Passed 4 tests

Checking browser requirements for Who Hit The Page - Hit Counter
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,862 ▲14015.87 ▲0.035.93 ▲0.192.22 ▼0.49
Dashboard /wp-admin2,968 ▲1076.25 ▼0.13123.95 ▼12.52177.60 ▲16.37
Posts /wp-admin/edit.php2,764 ▲703.43 ▼0.0062.75 ▼1.88136.54 ▼10.08
Add New Post /wp-admin/post-new.php1,708 ▼317.43 ▼3.67431.13 ▼8.20155.32 ▼7.33
Media Library /wp-admin/upload.php1,769 ▲745.68 ▼0.04124.01 ▼19.14205.97 ▲9.38
/wp-admin/admin.php?page=whtp-force-update1,0562.7055.2189.34
Who Hit The Page /wp-admin/admin.php?page=whtp-admin-menu1,1693.0259.6392.27
View Page Hits /wp-admin/admin.php?page=whtp-view-page-hits1,2313.1060.88101.80
View IP Hits /wp-admin/admin.php?page=whtp-view-ip-hits1,0852.9760.2084.81
Denied IPs /wp-admin/admin.php?page=whtp-denied-ips1,1122.9959.0689.38
Help /wp-admin/admin.php?page=whtp-help1,2672.9858.1894.27
Settings /wp-admin/admin.php?page=whtp-settings3,3523.0960.34100.08
Visitor Stats /wp-admin/admin.php?page=whtp-visitor-stats1,0992.9760.9380.94

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 tables in the database
    • wp_whtp_user_agents
    • wp_whtp_hits
    • wp_whtp_ip2location
    • wp_whtp_hitinfo
    • wp_whtp_ip_hits
    • wp_whtp_visiting_countries
  • Zombie WordPress options were found after uninstall: 2 options
    • whtp_version
    • whtp_installed

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=whtp-view-page-hits
    • > Warning in wp-content/plugins/who-hit-the-page-hit-counter/partials/view/all-page-hits.php+24
    count(): Parameter must be an array or an object that implements Countable

SRP 0% 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
The following issues need your attention
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/who-hit-the-page-hit-counter/vendor/mahlamusa/material-php/tests/test.php
  • 74× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromisorInterface' not found in wp-content/plugins/who-hit-the-page-hit-counter/vendor/guzzlehttp/guzzle/src/Pool.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/who-hit-the-page-hit-counter/vendor/guzzlehttp/psr7/src/FnStream.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/who-hit-the-page-hit-counter/partials/update/force-update.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Cookie\\CookieJar' not found in wp-content/plugins/who-hit-the-page-hit-counter/vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php:7
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/who-hit-the-page-hit-counter/includes/config.php on line 22
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Exception\\GuzzleException' not found in wp-content/plugins/who-hit-the-page-hit-counter/vendor/guzzlehttp/guzzle/src/Exception/InvalidArgumentException.php:5
    • > PHP Notice
      Undefined variable: filter_field_id in wp-content/plugins/who-hit-the-page-hit-counter/partials/pagination.php on line 8
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\RequestException' not found in wp-content/plugins/who-hit-the-page-hit-counter/vendor/guzzlehttp/guzzle/src/Exception/TooManyRedirectsException.php:4
    • > PHP Warning
      include(): Failed opening './vendor/autoload.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/who-hit-the-page-hit-counter/vendor/mahlamusa/material-php/tests/bootstrap.php on line 2
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/who-hit-the-page-hit-counter/includes/config.php on line 11

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
9 plugin tags: ip statistics, geolocation, visit counter, hit counter, visitor stats...

who-hit-the-page-hit-counter/who-hit-the-page.php 77% from 13 tests

"Who Hit The Page - Hit Counter" version 1.4.14.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 379 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("who-hit-the-page-hit-counter.php" instead of "who-hit-the-page.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

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
Success! There were no dangerous files found in this plugin20,709 lines of code in 179 files:
LanguageFilesBlank linesComment linesLines of code
PHP1492,8617,54015,992
Markdown171,13403,492
JSON200509
Sass1210321
PO File1138140287
JavaScript27039
XML21027
YAML26022
Dockerfile18010
make1409
CSS1001

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity14.97
▷ Minimum class complexity1.00
▷ Maximum class complexity203.00
Average method complexity2.77
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces13
Interfaces19
Traits3
Classes95
▷ Abstract classes33.16%
▷ Concrete classes9296.84%
▷ Final classes99.78%
Methods967
▷ Static methods20421.10%
▷ Public methods80082.73%
▷ Protected methods505.17%
▷ Private methods11712.10%
Functions185
▷ Named functions9350.27%
▷ Anonymous functions9249.73%
Constants143
▷ Global constants1812.59%
▷ Class constants12587.41%
▷ Public constants125100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
596 compressed PNG files occupy 0.26MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/flags/im.png0.24KB0.26KB0.00%
assets/src/images/flags/bw.png0.30KB0.23KB▼ 25.72%
assets/images/flags/ki.png0.54KB0.66KB0.00%
assets/images/flags/mg.png0.14KB0.18KB0.00%
assets/src/images/flags/fr.png0.26KB0.23KB▼ 11.94%