10% hit-counter-max

Code Review | Hit Counter Max

WordPress plugin Hit Counter Max scored10%from 54 tests.

About plugin

  • Plugin page: hit-counter-max
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.0.0-4.1
  • WordPress version: 6.3.1
  • First release: Mar 6, 2015
  • Latest release: Mar 6, 2015
  • Number of updates: 2
  • Update frequency: every 3.5 days
  • Top authors: jamesdouglasm (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

900+ active /30,541 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
These installer errors require your attention
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/hit-counter-max/image.php+186
    Function create_function() is deprecated

Server metrics [RAM: ▼1.95MB] [CPU: ▼55.33ms] Passed 4 tests

An overview of server-side resources used by Hit Counter Max
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.04 ▼1.424.66 ▼39.59
Dashboard /wp-admin2.06 ▼1.245.45 ▼48.97
Posts /wp-admin/edit.php2.06 ▼1.296.24 ▼46.78
Add New Post /wp-admin/post-new.php2.06 ▼3.825.87 ▼85.96
Media Library /wp-admin/upload.php2.06 ▼1.175.23 ▼33.45
Hit Counter Max /wp-admin/options-general.php?page=hit-counter-max2.065.52

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

How much does this plugin use your filesystem and database?
Please try to fix the following items
  • Illegal file modification found: 2 files (0.00KB) outside of "wp-content/plugins/hit-counter-max/" and "wp-content/uploads/"
    • (new file) wp-content/cache/hookd/wp.com/8b8203326e2a9c70947a
    • (new file) wp-content/cache/hookd/wp.com/index.html
Filesystem: 1,456 new files
Database: no new tables, 15 new options
New WordPress options
wphcu_count_only_unique
wphcu_style
wphcu_check_update
theysaidso_admin_options
widget_recent-comments
wphcu_display_credit
wphcu_display_footer
wphcu_data
wphcu_css
widget_theysaidso_widget
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Hit Counter Max
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,449 ▼31214.02 ▼0.250.52 ▼1.4120.78 ▼24.14
Dashboard /wp-admin2,193 ▲135.55 ▼0.1089.48 ▼11.6039.14 ▼5.93
Posts /wp-admin/edit.php2,104 ▲42.01 ▲0.0540.02 ▲2.1834.29 ▲0.38
Add New Post /wp-admin/post-new.php1,552 ▲2623.30 ▲5.79682.02 ▼4.7567.97 ▲12.63
Media Library /wp-admin/upload.php1,404 ▲44.22 ▼0.05107.03 ▼6.4350.62 ▲1.80
Hit Counter Max /wp-admin/options-general.php?page=hit-counter-max2,8271.2733.11111.92

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
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/hit-counter-max/image.php+186
    Function create_function() is deprecated
  • The uninstall procedure has failed, leaving 8 options in the database
    • widget_recent-comments
    • wphcu_align
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_whitcounter

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=hit-counter-max
    • > Deprecated in wp-content/plugins/hit-counter-max/image.php+186
    Function create_function() is deprecated
  • 144 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=hit-counter-max
    • > Notice in wp-content/plugins/hit-counter-max/settings_wphcu.php+60
    Undefined variable: done
  • 144 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=hit-counter-max
    • > Notice in wp-content/plugins/hit-counter-max/settings_wphcu.php+60
    Trying to access array offset on value of type null

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
The following issues need your attention
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/hit-counter-max/image.php:101
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/hit-counter-max/settings_wphcu.php:17

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 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Tags: There are too many tags (13 tag instead of maximum 10)
  • Screenshots: Screenshot #1 (View sample of the setting menu.) image not found
The official readme.txt might help

hit-counter-max/image.php 92% from 13 tests

The main PHP file in "Hit Counter Max" ver. 2.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 ("hit-counter-max.php" instead of "image.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin432 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP36048432

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity11.33
▷ Minimum class complexity5.00
▷ Maximum class complexity17.00
Average method complexity2.63
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods19
▷ Static methods00.00%
▷ Public methods19100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.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
1 PNG file occupies 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png41.94KB16.90KB▼ 59.70%