10% dx2-post-hit-counter

Code Review | DX2 Post Hit Counter

WordPress plugin DX2 Post Hit Counter scored 10% from 54 tests.

About plugin

  • Plugin page: dx2-post-hit-counter
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.7.3
  • WordPress version: 6.3.1
  • First release: Aug 25, 2016
  • Latest release: Mar 31, 2017
  • Number of updates: 14
  • Update frequency: every 15.6 days
  • Top authors: dx2systems (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

90+ active / 3,172 total downloads

Benchmarks

Plugin footprint 23% 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 cannot be installed
    • > Deprecated in wp-content/plugins/dx2-post-hit-counter/dx2posthitcounter.php+542
    Function create_function() is deprecated

Server metrics [RAM: ▼1.96MB] [CPU: ▼50.40ms] Passed 4 tests

A check of server-side resources used by DX2 Post Hit Counter
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.433.88 ▼40.66
Dashboard /wp-admin2.05 ▼1.255.53 ▼40.75
Posts /wp-admin/edit.php2.05 ▼1.317.67 ▼36.89
Add New Post /wp-admin/post-new.php2.05 ▼3.845.95 ▼83.29
Media Library /wp-admin/upload.php2.05 ▼1.184.86 ▼30.58
Todays Top Posts /wp-admin/admin.php?page=dx2-top-posts2.055.52

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 7 new files
Database: 1 new table, 7 new options
New tables
wp_dx2hits_posthits
New WordPress options
widget_recent-posts
widget_recent-comments
db_upgraded
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_dx2hits_popular_posts_widget

Browser metrics Passed 4 tests

An overview of browser requirements for DX2 Post Hit Counter
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,863 ▲10614.69 ▲0.013.88 ▲1.7641.01 ▼4.22
Dashboard /wp-admin2,258 ▲676.77 ▲1.76142.04 ▲37.5741.37 ▲3.93
Posts /wp-admin/edit.php2,109 ▲201.99 ▼0.0436.73 ▼2.7335.00 ▲1.77
Add New Post /wp-admin/post-new.php1,521 ▲123.30 ▲0.35667.89 ▲52.0357.86 ▼2.55
Media Library /wp-admin/upload.php1,384 ▼44.19 ▼0.0596.74 ▲0.2440.60 ▼1.78
Todays Top Posts /wp-admin/admin.php?page=dx2-top-posts7572.0524.0622.91

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/dx2-post-hit-counter/dx2posthitcounter.php+542
    Function create_function() is deprecated
  • Zombie tables were found after uninstall: 1 table
    • wp_dx2hits_posthits
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_dx2hits_popular_posts_widget
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% 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)
These server-side errors were triggered
    • > GET request to /wp-admin/admin.php?page=dx2-top-posts
    • > Deprecated in wp-content/plugins/dx2-post-hit-counter/dx2posthitcounter.php+542
    Function create_function() is deprecated
    • > GET request to /wp-admin/admin.php?page=dx2-top-posts
    • > Notice in wp-content/plugins/dx2-post-hit-counter/dx2posthitcounter.php+420
    Undefined offset: 0
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=dx2-top-posts
    • > Notice in wp-content/plugins/dx2-post-hit-counter/dx2posthitcounter.php+420
    Trying to access array offset on value of type null
    • > GET request to /wp-admin/admin.php?page=dx2-top-posts
    • > Notice in wp-content/plugins/dx2-post-hit-counter/dx2posthitcounter.php+420
    Undefined offset: 1

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Plugin Name: Please specify the plugin name on the first line ( === dx2-post-hit-counter === )
The official readme.txt is a good inspiration

dx2-post-hit-counter/dx2posthitcounter.php 92% from 13 tests

"DX2 Post Hit Counter" version 1.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("dx2-post-hit-counter.php" instead of "dx2posthitcounter.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin580 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP18474470
JavaScript449103
CSS1007

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity19.00
▷ Minimum class complexity19.00
▷ Maximum class complexity19.00
Average method complexity5.50
▷ Minimum method complexity1.00
▷ Maximum method complexity13.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%
Functions18
▷ Named functions18100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin