83% traffic-stats-widget

Code Review | Plugin Name: Traffic Stats Widget Plugin

WordPress plugin Plugin Name: Traffic Stats Widget Pluginscored 83% from 53 tests.

About plugin

  • Plugin page: traffic-stats-widget
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8.0-4.0.1
  • WordPress version: 5.8.1
  • First release: Feb 12, 2013
  • Latest release: Feb 27, 2015
  • Number of updates: 31
  • Update frequency: every 24.0 days
  • Top authors: helenthomaswp (100%)

Code review

53 tests

User reviews

7 reviews

Install metrics

1,000+ active / 48,777 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▼1.72MB] [CPU: ▼303.44ms] Passed 4 tests

Analyzing server-side resources used by Plugin Name: Traffic Stats Widget Plugin
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /1.91 ▼0.8110.89 ▼10.21
Dashboard /wp-admin1.93 ▼1.139.76 ▼34.87
Posts /wp-admin/edit.php1.93 ▼1.1811.54 ▼34.86
Add New Post /wp-admin/post-new.php1.93 ▼3.509.83 ▼1,112.77
Media Library /wp-admin/upload.php1.93 ▼1.0811.17 ▼31.24

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 8 new files
Database: 1 new table, no new options
New tables
wp_tsw_log

Browser metrics Passed 4 tests

Checking browser requirements for Plugin Name: Traffic Stats Widget Plugin
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,657 ▲5116.00 ▲0.418.96 ▼0.4145.83 ▼0.32
Dashboard /wp-admin2,929 ▲796.12 ▲0.30146.19 ▲8.1698.74 ▼2.74
Posts /wp-admin/edit.php2,708 ▲52.70 ▲0.0167.50 ▼2.6984.34 ▼5.68
Add New Post /wp-admin/post-new.php1,658 ▲17718.41 ▼0.16386.42 ▼1.54107.54 ▼1.47
Media Library /wp-admin/upload.php1,777 ▲55.02 ▲0.03151.44 ▼6.44109.91 ▼7.97

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • The plugin did not uninstall gracefully
    • > User deprecated in wp-includes/functions.php+5211
    register_sidebar_widget is deprecated since version 2.8.0! Use wp_register_sidebar_widget() instead.

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 fix 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/traffic-stats-widget/wp-traffic-stats-widget.php:336

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === Plugin Name: Traffic Stats Widget Plugin=== )
  • Screenshots: Add images for these screenshots: #1 (On the blog the widget looks like this), #2 (Admin Page)
You can look at the official readme.txt

traffic-stats-widget/wp-traffic-stats-widget.php 92% from 13 tests

The main file in "Plugin Name: Traffic Stats Widget Plugin" v. 1.0.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("traffic-stats-widget.php" instead of "wp-traffic-stats-widget.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
No dangerous file extensions were detected296 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP16619260
JavaScript16021
CSS12015

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.32
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%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 1 test

Image compression Passed 1 test

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin