73% wp-post-real-time-statistics

Code Review | WP Post Statistics (Visitors & Visits Counter)

WordPress plugin WP Post Statistics (Visitors & Visits Counter) scored73%from 54 tests.

About plugin

  • Plugin page: wp-post-real-time...
  • Plugin version: 2.6
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-6.0
  • WordPress version: 6.3.1
  • First release: Jan 21, 2017
  • Latest release: May 25, 2022
  • Number of updates: 41
  • Update frequency: every 47.5 days
  • Top authors: osamaesh (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

3,000+ active /15,224 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.26MB] [CPU: ▼1.70ms] Passed 4 tests

An overview of server-side resources used by WP Post Statistics (Visitors & Visits Counter)
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.72 ▲0.2542.65 ▲1.49
Dashboard /wp-admin3.57 ▲0.2655.76 ▲6.48
Posts /wp-admin/edit.php3.69 ▲0.3256.14 ▲1.59
Add New Post /wp-admin/post-new.php6.17 ▲0.2891.76 ▼16.04
Media Library /wp-admin/upload.php3.49 ▲0.2641.72 ▲6.15

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 268 new files
Database: 1 new table, 6 new options
New tables
wp_poststats_visits
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Post Statistics (Visitors & Visits Counter)
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,828 ▲6714.73 ▲0.131.79 ▼0.8844.51 ▼4.17
Dashboard /wp-admin2,231 ▲545.93 ▲0.3086.89 ▼1.7140.16 ▼3.11
Posts /wp-admin/edit.php2,427 ▲3272.56 ▲0.5339.85 ▲2.6331.04 ▼8.31
Add New Post /wp-admin/post-new.php1,562 ▲3623.62 ▲0.46694.20 ▼31.8936.70 ▼32.20
Media Library /wp-admin/upload.php1,436 ▲394.63 ▲0.48115.71 ▲13.9948.04 ▲0.49

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_poststats_visits
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • 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
Please fix the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/wp-post-real-time-statistics/index.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 90% from 29 tests

readme.txt 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (Posts statistics page), #2 (Geo Locations page)
  • Tags: You are using too many tags: 11 tag instead of maximum 10
You can take inspiration from this readme.txt

wp-post-real-time-statistics/index.php 92% from 13 tests

"WP Post Statistics (Visitors & Visits Counter)" version 2.6's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wp-post-real-time-statistics.php" instead of "index.php")

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 plugin12,324 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript111,4983,44610,784
CSS410066983
PHP215028557

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity68.00
▷ Minimum class complexity68.00
▷ Maximum class complexity68.00
Average method complexity4.94
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods17
▷ Static methods1694.12%
▷ Public methods17100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions00.00%
▷ Anonymous functions10100.00%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
248 compressed PNG files occupy 0.28MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/flag/bz.png0.60KB0.58KB▼ 3.41%
images/flag/ly.png0.37KB0.34KB▼ 9.66%
images/flag/ci.png0.42KB0.46KB0.00%
images/flag/et.png0.55KB0.54KB▼ 1.94%
images/flag/az.png0.46KB0.38KB▼ 18.64%