84% the-hits-counter

Code Review | The Hits Counter

WordPress plugin The Hits Counter scored84%from 54 tests.

About plugin

  • Plugin page: the-hits-counter
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.1-6.2.2
  • WordPress version: 6.3.1
  • First release: Jul 11, 2015
  • Latest release: May 27, 2023
  • Number of updates: 6
  • Update frequency: every 479.8 days
  • Top authors: gagan0123 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /7,269 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼3.97ms] Passed 4 tests

Analyzing server-side resources used by The Hits Counter
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.74 ▲0.0142.81 ▼0.15
Dashboard /wp-admin3.58 ▲0.0169.26 ▲12.61
Posts /wp-admin/edit.php3.69 ▲0.0150.15 ▼5.77
Add New Post /wp-admin/post-new.php6.16 ▲0.0190.82 ▼13.27
Media Library /wp-admin/upload.php3.50 ▲0.0139.17 ▲3.33

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for The Hits Counter
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.75 ▲0.451.76 ▲0.0243.52 ▲1.91
Dashboard /wp-admin2,192 ▲155.58 ▼0.0888.83 ▼1.2640.96 ▼6.81
Posts /wp-admin/edit.php2,100 ▼01.99 ▼0.0134.74 ▼10.1935.28 ▼1.30
Add New Post /wp-admin/post-new.php1,554 ▲2322.92 ▼0.18660.09 ▼48.1857.52 ▼9.86
Media Library /wp-admin/upload.php1,397 ▼04.23 ▼0.07115.13 ▲8.3948.53 ▲3.67

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options

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)
Everything seems fine, however 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
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/the-hits-counter/init.php:22

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
2 plugin tags: counter, hits

the-hits-counter/init.php 92% from 13 tests

Analyzing the main PHP file in "The Hits Counter" version 1.0
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("the-hits-counter.php" instead of "init.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin44 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP2113644

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
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

Using a strong compression for your PNG files is a great way to speed-up your plugin
PNG images were not found in this plugin