83% wp-network-stats

Code Review | WP Network Stats

WordPress plugin WP Network Stats scored 83% from 54 tests.

About plugin

  • Plugin page: wp-network-stats
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.6
  • WordPress version: 6.3.1
  • First release: Jun 29, 2016
  • Latest release: Sep 7, 2016
  • Number of updates: 25
  • Update frequency: every 2.8 days
  • Top authors: harshit_ps (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,328 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.36MB] [CPU: ▼2.47ms] Passed 4 tests

This is a short check of server-side resources used by WP Network Stats
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.86 ▲0.3944.94 ▼5.33
Dashboard /wp-admin3.70 ▲0.3957.95 ▲0.16
Posts /wp-admin/edit.php3.75 ▲0.3954.93 ▲4.34
Add New Post /wp-admin/post-new.php6.21 ▲0.33107.28 ▼7.73
Media Library /wp-admin/upload.php3.56 ▲0.3340.81 ▲3.02

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 55 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Network Stats
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,883 ▲13713.87 ▼0.398.40 ▲6.5846.68 ▼6.73
Dashboard /wp-admin2,206 ▲185.91 ▲0.07124.41 ▲9.9550.73 ▲0.45
Posts /wp-admin/edit.php2,092 ▲32.02 ▼0.0440.30 ▼0.6633.84 ▼3.60
Add New Post /wp-admin/post-new.php1,533 ▲1423.31 ▲2.29803.91 ▲57.8564.02 ▲8.28
Media Library /wp-admin/upload.php1,388 ▲34.12 ▲0.02104.89 ▼14.7452.76 ▼2.82

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wp-network-stats/public/partials/network-stats-public-display.php
    • > /wp-content/plugins/wp-network-stats/admin/partials/network-stats-admin-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 87% 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:
  • Screenshots: These screenshots need descriptions #12, #13, #14 in wp-network-stats/assets to your readme.txt
  • Tags: Please delete some tags, you are using 18 tag instead of maximum 10
You can look at the official readme.txt

wp-network-stats/wp-network-stats.php 85% from 13 tests

"WP Network Stats" version 1.0.4's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 160 characters long)

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
No dangerous file extensions were detected14,750 lines of code in 38 files:
LanguageFilesBlank linesComment linesLines of code
CSS822497,494
JavaScript121,2651,0775,120
PHP175731,4901,848
SVG100288

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity20.00
▷ Minimum class complexity1.00
▷ Maximum class complexity94.00
Average method complexity3.15
▷ Minimum method complexity1.00
▷ Maximum method complexity46.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods106
▷ Static methods3129.25%
▷ Public methods9387.74%
▷ Protected methods00.00%
▷ Private methods1312.26%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants23
▷ Global constants23100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected