10% post-views-stats

Code Review | Post views Stats

WordPress plugin Post views Stats scored10%from 54 tests.

About plugin

  • Plugin page: post-views-stats
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 2.9.2-4.9.8
  • WordPress version: 6.3.1
  • First release: Dec 19, 2012
  • Latest release: Nov 28, 2018
  • Number of updates: 27
  • Update frequency: every 117.7 days
  • Top authors: cybernetikz (100%)

Code review

54 tests

User reviews

15 reviews

Install metrics

2,000+ active /64,497 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
These installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/post-views-stats/cn-post-views-stats.php+239
    Function create_function() is deprecated

Server metrics [RAM: ▼1.90MB] [CPU: ▼54.41ms] Passed 4 tests

This is a short check of server-side resources used by Post views Stats
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.09 ▼1.384.93 ▼35.51
Dashboard /wp-admin2.11 ▼1.205.68 ▼45.97
Posts /wp-admin/edit.php2.11 ▼1.255.49 ▼42.60
Add New Post /wp-admin/post-new.php2.11 ▼3.785.85 ▼93.57
Media Library /wp-admin/upload.php2.11 ▼1.126.29 ▼33.50

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 25 new files
Database: 1 new table, 7 new options
New tables
wp_cn_track_post
New WordPress options
widget_cntpv_widget
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Post views Stats
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲5914.35 ▼0.382.17 ▲0.3743.33 ▲3.83
Dashboard /wp-admin2,211 ▲315.67 ▲0.0788.75 ▲0.7491.57 ▲48.93
Posts /wp-admin/edit.php2,144 ▲412.20 ▲0.2137.31 ▲0.9540.06 ▲4.94
Add New Post /wp-admin/post-new.php1,718 ▲19224.75 ▲1.21728.44 ▲38.9449.11 ▼9.74
Media Library /wp-admin/upload.php1,431 ▲344.32 ▲0.13101.59 ▼5.9561.69 ▲17.92

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/post-views-stats/cn-post-views-stats.php+239
    Function create_function() is deprecated
  • Zombie tables detected upon uninstall: 1 table
    • wp_cn_track_post
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_theysaidso_widget
    • widget_cntpv_widget
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/post-views-stats/view.php
    • > /wp-content/plugins/post-views-stats/cn-post-views-stats.php
    • > /wp-content/plugins/post-views-stats/view-most-popular.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 81% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Donate link: Invalid URI found ("")
  • Tags: Please reduce the number of tags, currently 20 tag instead of maximum 10
  • Screenshots: These screenshots require images: #1 (layout for most popular post in the sidebar), #2 (post view counts in the wp admin area), #3 (view count column in all post page), #4 (layout for widget for most popular post)
The official readme.txt might help

post-views-stats/cn-post-views-stats.php 85% from 13 tests

"Post views Stats" version 1.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("post-views-stats.php" instead of "cn-post-views-stats.php")
  • Description: The description should be shorter than 140 characters (currently 250 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
There were no executable files found in this plugin890 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
CSS22232599
PHP33414291

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity1.75
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions13
▷ Named functions13100.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.04MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/images/ui-icons_444444_256x240.png6.83KB4.17KB▼ 38.86%
css/images/ui-icons_777620_256x240.png4.44KB4.17KB▼ 6.02%
css/images/ui-icons_ffffff_256x240.png6.15KB4.17KB▼ 32.13%
css/images/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%
css/images/ui-icons_777777_256x240.png6.83KB4.17KB▼ 38.92%