89% wstats

Code Review | WStats Plugin

WordPress plugin WStats Plugin scored89%from 54 tests.

About plugin

  • Plugin page: wstats
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.8.1
  • WordPress version: 6.3.1
  • First release: Feb 2, 2014
  • Latest release: Feb 2, 2014
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: Kreshi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /774 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

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

Server-side resources used by WStats Plugin
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.94 ▼7.43
Dashboard /wp-admin3.31 ▲0.0151.24 ▲0.36
Posts /wp-admin/edit.php3.37 ▲0.0148.43 ▼0.51
Add New Post /wp-admin/post-new.php5.90 ▲0.0292.87 ▼9.80
Media Library /wp-admin/upload.php3.25 ▲0.0238.90 ▲6.24

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for WStats Plugin
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲8513.65 ▼0.931.62 ▼0.2642.50 ▲0.03
Dashboard /wp-admin2,212 ▲244.90 ▼0.17109.70 ▲7.8277.25 ▲32.73
Posts /wp-admin/edit.php2,107 ▲182.03 ▲0.0036.74 ▼2.0234.53 ▼0.18
Add New Post /wp-admin/post-new.php1,538 ▼518.09 ▼0.38643.27 ▲6.7758.08 ▲7.29
Media Library /wp-admin/upload.php1,403 ▲154.13 ▼0.17115.13 ▲16.1048.42 ▲4.98

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded

Smoke tests Passed 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 no errors were found, this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === wstats === )
You can look at the official readme.txt

wstats/wstats-plugin.php 92% from 13 tests

The principal PHP file in "WStats Plugin" v. 1.0 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("wstats.php" instead of "wstats-plugin.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 plugin1,459 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1218711,137
PHP510999322

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity2.50
▷ Minimum class complexity1.00
▷ Maximum class complexity6.00
Average method complexity1.67
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods9
▷ Static methods555.56%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.09MB with 0.05MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/star.png88.00KB32.73KB▼ 62.81%