78% track-site-traffic

Code Review | Tracking Inbound & Outbond traffic

WordPress plugin Tracking Inbound & Outbond traffic scored 78% from 54 tests.

About plugin

  • Plugin page: track-site-traffic
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-3.6
  • WordPress version: 5.8.1
  • First release: Sep 13, 2013
  • Latest release: Nov 12, 2013
  • Number of updates: 8
  • Update frequency: every 7.8 days
  • Top authors: dkchauhan (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active / 2,121 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

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

An overview of server-side resources used by Tracking Inbound & Outbond traffic
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.89 ▲0.1738.24 ▲9.13
Dashboard /wp-admin2.79 ▼0.2724.18 ▼35.36
Posts /wp-admin/edit.php2.79 ▼0.3223.49 ▼27.27
Add New Post /wp-admin/post-new.php2.79 ▼2.6427.31 ▼645.14
Media Library /wp-admin/upload.php2.79 ▼0.2121.45 ▼15.90

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 13 new files
Database: 1 new table, 1 new option
New tables
wp_ntracker
New WordPress options
plugin_ntracker_settings

Browser metrics Passed 4 tests

This is an overview of browser requirements for Tracking Inbound & Outbond traffic
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,728 ▲13216.09 ▲0.1711.92 ▲1.0647.46 ▼8.16
Dashboard /wp-admin2,992 ▲585.88 ▼0.05160.92 ▼8.04114.33 ▼5.03
Posts /wp-admin/edit.php2,764 ▲252.71 ▼0.0172.87 ▲0.74102.51 ▲10.75
Add New Post /wp-admin/post-new.php1,744 ▲12915.83 ▼5.79430.07 ▲78.78120.60 ▲4.52
Media Library /wp-admin/upload.php1,832 ▲255.03 ▼0.02164.16 ▼20.50125.12 ▼0.18
Trackit /wp-admin/tracker.php260.900.0910.28

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin cannot be uninstalled
    • > User deprecated in wp-includes/functions.php+5495
    has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.

Smoke tests 50% 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)
Even though everything seems fine, this is not an exhaustive test

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
Please take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/track-site-traffic/tracker.php:466

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following user-side errors
    • > GET request to /wp-admin/tracker.php
    • > Network (severe)
    wp-admin/tracker.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
4 plugin tags: incoming traffic, referal link, track site traffic, traffic count

track-site-traffic/tracker.php 92% from 13 tests

The primary PHP file in "Tracking Inbound & Outbond traffic" version 1.0 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("track-site-traffic.php" instead of "tracker.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin455 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP18650347
CSS27289
JavaScript30119

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.18
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%
Functions19
▷ Named functions19100.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
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/button.png0.24KB0.22KB▼ 8.10%
img/button_current.png0.24KB0.21KB▼ 14.98%