74% wp-show-stats

Code Review | WP Show Stats

WordPress plugin WP Show Stats scored74%from 54 tests.

About plugin

  • Plugin page: wp-show-stats
  • Plugin version: 1.4.2
  • PHP compatiblity: 5.5.9+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.2.1
  • WordPress version: 6.3.1
  • First release: Mar 12, 2015
  • Latest release: May 22, 2019
  • Number of updates: 27
  • Update frequency: every 56.7 days
  • Top authors: ashishajani (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

700+ active /25,743 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▼1.05MB] [CPU: ▼44.85ms] Passed 4 tests

Server-side resources used by WP Show Stats
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.92 ▼0.5416.38 ▼25.63
Dashboard /wp-admin2.96 ▼0.3418.38 ▼40.30
Posts /wp-admin/edit.php2.96 ▼0.4019.19 ▼34.81
Add New Post /wp-admin/post-new.php2.96 ▼2.9321.14 ▼78.64
Media Library /wp-admin/upload.php2.96 ▼0.2718.31 ▼20.05

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

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

Browser metrics Passed 4 tests

WP Show Stats: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,848 ▲8714.35 ▲0.091.79 ▼0.0838.63 ▼5.92
Dashboard /wp-admin2,251 ▲715.77 ▲0.1589.82 ▼1.0642.11 ▼6.65
Posts /wp-admin/edit.php2,159 ▲592.26 ▲0.2539.77 ▼0.9837.98 ▲2.18
Add New Post /wp-admin/post-new.php1,573 ▲4722.90 ▼0.18657.61 ▼20.5952.48 ▲3.46
Media Library /wp-admin/upload.php1,462 ▲624.36 ▲0.19105.03 ▼0.6942.47 ▼3.70

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/wp-show-stats/wp-show-stats.php+57
    Trying to access array offset on value of type bool
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts

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)
Good news, no errors were detected

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
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/wp-show-stats/includes/wp-show-stats-sidebar.php
    • > /wp-content/plugins/wp-show-stats/wp-show-stats.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
6 plugin tags: wordpress statistics plugin, analysis plugin, wordpress statistics, wordpress stats, analysis...

wp-show-stats/wp-show-stats.php Passed 13 tests

The principal PHP file in "WP Show Stats" v. 1.4.2 is loaded by WordPress automatically on each request
117 characters long description:
Very useful plugin to see stats related to Pages, Posts, Comments, Categories, Users, Custom post types at one place.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin1,447 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP112161201,425
CSS22622

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.28
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%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
8 PNG files occupy 0.05MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/ui-icons_777620_256x240.png4.44KB4.17KB▼ 6.02%
images/ui-icons_454545_256x240.png6.91KB4.18KB▼ 39.44%
images/ui-icons_444444_256x240.png6.83KB4.17KB▼ 38.86%
images/ui-icons_cc0000_256x240.png4.44KB4.17KB▼ 6.02%
images/ui-icons_777777_256x240.png6.83KB4.17KB▼ 38.92%