10% kento-wp-stats

Code Review | Kento Wordpress Stats

WordPress plugin Kento Wordpress Stats scored10%from 54 tests.

About plugin

  • Plugin page: kento-wp-stats
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.2.2
  • WordPress version: 6.3.1
  • First release: May 28, 2014
  • Latest release: Jun 9, 2015
  • Number of updates: 19
  • Update frequency: every 27.2 days
  • Top authors: kentothemes (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

80+ active /3,737 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
These installer errors require your attention
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/kento-wp-stats/includes/Browser.php+39
    Methods with the same name as their class will not be constructors in a future version of PHP; Browser_KNP has a deprecated constructor

Server metrics [RAM: ▼1.49MB] [CPU: ▼53.71ms] Passed 4 tests

Server-side resources used by Kento Wordpress Stats
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.50 ▼0.965.85 ▼35.28
Dashboard /wp-admin2.52 ▼0.787.30 ▼41.59
Posts /wp-admin/edit.php2.52 ▼0.848.56 ▼42.93
Add New Post /wp-admin/post-new.php2.52 ▼3.376.62 ▼95.05
Media Library /wp-admin/upload.php2.52 ▼0.716.61 ▼26.34
Live Stats /wp-admin/admin.php?page=kento_wp_stats_admin_online2.526.43
Visitors /wp-admin/admin.php?page=kento_wp_stats_admin_visitors2.527.18
Kento WP Stats /wp-admin/admin.php?page=kento_wp_stats_admin2.526.64

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 64 new files
Database: 2 new tables, 7 new options
New tables
wp_kento_wp_stats_online
wp_kento_wp_stats
New WordPress options
can_compress_scripts
kento_wp_stats_version
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Kento Wordpress Stats
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,938 ▲20314.13 ▼0.2410.62 ▲8.8742.34 ▼2.61
Dashboard /wp-admin2,246 ▲586.04 ▲1.1897.42 ▼4.2838.89 ▼4.52
Posts /wp-admin/edit.php2,132 ▲432.02 ▲0.0239.81 ▼1.5236.00 ▼3.44
Add New Post /wp-admin/post-new.php1,549 ▲3523.06 ▲5.51649.22 ▲35.9953.26 ▲0.83
Media Library /wp-admin/upload.php1,428 ▲434.19 ▼0.0697.63 ▼1.4740.40 ▼4.94
Live Stats /wp-admin/admin.php?page=kento_wp_stats_admin_online8061.7626.1628.76
Visitors /wp-admin/admin.php?page=kento_wp_stats_admin_visitors1,0322.1623.4237.51
Kento WP Stats /wp-admin/admin.php?page=kento_wp_stats_admin8411.7224.4329.48

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/kento-wp-stats/includes/Browser.php+39
    Methods with the same name as their class will not be constructors in a future version of PHP; Browser_KNP has a deprecated constructor
  • The uninstall procedure failed, leaving 2 tables in the database
    • wp_kento_wp_stats_online
    • wp_kento_wp_stats
  • Zombie WordPress options detected upon uninstall: 7 options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • kento_wp_stats_version
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=kento_wp_stats_admin
    • > Deprecated in wp-content/plugins/kento-wp-stats/includes/Browser.php+39
    Methods with the same name as their class will not be constructors in a future version of PHP; Browser_KNP has a deprecated constructor
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=kento_wp_stats_admin
    • > Deprecated in wp-content/plugins/kento-wp-stats/includes/geoplugin.class.php+29
    Methods with the same name as their class will not be constructors in a future version of PHP; geoPlugin has a deprecated constructor

SRP 0% 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
The following issues need your attention
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/kento-wp-stats/kento-wp-stats-admin-online.php
    • > /wp-content/plugins/kento-wp-stats/kento-wp-stats-admin-geo.php
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/kento-wp-stats/kento-wp-stats-admin.php:5
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/kento-wp-stats/kento-wp-stats-admin-visitors.php:49
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/kento-wp-stats/index.php:13

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 93% from 29 tests

readme.txt Passed 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
6 plugin tags: analytics, wordpress stats, visitors count, live visitors, web stats...

kento-wp-stats/index.php 85% from 13 tests

The primary PHP file in "Kento Wordpress Stats" version 1.1 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("kento-wp-stats.php" instead of "index.php")
  • Description: Please improve your description making it at least 10 characters long (currently 0 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected2,404 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP77343451,936
CSS2911449
JavaScript126019

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity73.00
▷ Minimum class complexity11.00
▷ Maximum class complexity135.00
Average method complexity3.09
▷ Minimum method complexity1.00
▷ Maximum method complexity32.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods69
▷ Static methods00.00%
▷ Public methods2637.68%
▷ Protected methods4362.32%
▷ Private methods00.00%
Functions28
▷ Named functions28100.00%
▷ Anonymous functions00.00%
Constants57
▷ Global constants11.75%
▷ Class constants5698.25%
▷ Public constants56100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
53 PNG files occupy 0.24MB with 0.13MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/platform/OpenBSD.png1.84KB1.17KB▼ 36.74%
css/browser/Yahoo-Slurp.png4.21KB1.38KB▼ 67.32%
css/isunique-no.png2.84KB0.14KB▼ 95.08%
css/browser/Netscape-Navigator.png1.36KB1.28KB▼ 5.76%
css/browser/Opera.png3.61KB1.20KB▼ 66.73%