83% statsd

Code Review | StatsD WordPress Client

WordPress plugin StatsD WordPress Client scored83%from 54 tests.

About plugin

  • Plugin page: statsd
  • Plugin version: 0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-4.6
  • WordPress version: 6.3.1
  • First release: Apr 29, 2014
  • Latest release: Aug 18, 2020
  • Number of updates: 9
  • Update frequency: every 255.9 days
  • Top authors: uglyrobot (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /2,895 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.11MB] [CPU: ▼4.85ms] Passed 4 tests

Server-side resources used by StatsD WordPress Client
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1238.64 ▼2.65
Dashboard /wp-admin3.41 ▲0.1145.95 ▼7.05
Posts /wp-admin/edit.php3.53 ▲0.1748.17 ▲1.51
Add New Post /wp-admin/post-new.php5.99 ▲0.1184.82 ▼11.21
Media Library /wp-admin/upload.php3.34 ▲0.1136.47 ▲2.36

Server storage [IO: ▲1.59MB] [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: 10 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

StatsD WordPress Client: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.27 ▼0.431.65 ▼0.2942.50 ▼4.58
Dashboard /wp-admin2,192 ▲155.62 ▼0.0093.07 ▲1.9839.28 ▲3.11
Posts /wp-admin/edit.php2,100 ▼01.97 ▼0.0335.30 ▼1.9931.93 ▼4.55
Add New Post /wp-admin/post-new.php1,537 ▲918.56 ▼4.38628.73 ▲24.4284.35 ▲19.35
Media Library /wp-admin/upload.php1,400 ▼04.21 ▲0.0395.19 ▼12.4342.31 ▼4.66

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 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
Please take a closer look at the following
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function network_home_url() in wp-content/plugins/statsd/trunk/statsd.php:40
    • > PHP Fatal error
      Uncaught Error: Call to undefined function network_home_url() in wp-content/plugins/statsd/statsd.php:40

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% 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
These attributes need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (Example dashboard created in Graphite with data collected from this plugin.), #2 (Track any other application stat in your WordPress site with 1 line of code in your plugin/theme.)
The official readme.txt is a good inspiration

statsd/statsd.php 92% from 13 tests

The main file in "StatsD WordPress Client" v. 0.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Description: The description should be shorter than 140 characters (currently 536 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected772 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP2222546772

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity12.67
▷ Minimum class complexity6.00
▷ Maximum class complexity22.00
Average method complexity1.58
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods120
▷ Static methods00.00%
▷ Public methods11898.33%
▷ Protected methods21.67%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
4 PNG files occupy 1.51MB with 0.94MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
trunk/screenshot-1.png436.19KB164.39KB▼ 62.31%
screenshot-2.png337.45KB125.74KB▼ 62.74%
trunk/screenshot-2.png337.45KB125.74KB▼ 62.74%
screenshot-1.png436.19KB164.39KB▼ 62.31%