94% wp-post-visit-count

Code Review | WP Post Visit Count

WordPress plugin WP Post Visit Count scored 94% from 54 tests.

About plugin

  • Plugin page: wp-post-visit-count
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.4
  • WordPress version: 5.9.2
  • First release: Dec 7, 2015
  • Latest release: Dec 10, 2015
  • Number of updates: 3
  • Update frequency: every 1.3 days
  • Top authors: rksh8148 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active / 1,841 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.01MB] [CPU: ▼288.81ms] Passed 4 tests

An overview of server-side resources used by WP Post Visit Count
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0256.64 ▲4.68
Dashboard /wp-admin3.42 ▲0.0234.69 ▼2.13
Posts /wp-admin/edit.php3.66 ▲0.0239.93 ▼4.06
Add New Post /wp-admin/post-new.php6.89 ▼0.0898.35 ▼1,150.02
Media Library /wp-admin/upload.php3.31 ▲0.0125.81 ▲0.96
WP Post Visit Count /wp-admin/options-general.php?page=wpvc_options3.2724.49

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 4 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by WP Post Visit Count
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,787 ▲3315.91 ▲0.666.09 ▼0.052.45 ▼0.66
Dashboard /wp-admin2,879 ▲216.08 ▲0.03123.38 ▼16.57205.67 ▲43.71
Posts /wp-admin/edit.php2,706 ▲213.24 ▲0.0165.22 ▼0.63143.61 ▼2.73
Add New Post /wp-admin/post-new.php1,755 ▲9421.26 ▲5.35455.49 ▲44.27191.74 ▲22.35
Media Library /wp-admin/upload.php1,703 ▲55.52 ▼0.01152.14 ▲12.60240.39 ▲50.11
WP Post Visit Count /wp-admin/options-general.php?page=wpvc_options9732.3654.7097.65

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Uninstall script ran successfully

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 | 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× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-post-visit-count/wp-post-visit-count.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 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Plugin Name: You should set the name of your plugin on the first line ( === wp-post-visit-count === )
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Screen shot for view column in posts table.), #2 (Screen shot for options page for future use.)
The official readme.txt might help

wp-post-visit-count/wp-post-visit-count.php Passed 13 tests

The primary PHP file in "WP Post Visit Count" version 1.0 is used by WordPress to initiate all plugin functionality
101 characters long description:
This plugin counts the post visits. Use 'post_views_count' meta key to get current post visit counts.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin65 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1393565

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.26
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%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
2 PNG files occupy 0.08MB with 0.04MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png33.65KB15.79KB▼ 53.06%
screenshot-1.png51.49KB23.93KB▼ 53.52%