88% baw-post-views-count

Code Review | Post Views Count (Support caching plugins!)

WordPress plugin Post Views Count (Support caching plugins!) scored 88% from 54 tests.

About plugin

  • Plugin page: baw-post-views-count
  • Plugin version: 3.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.4
  • WordPress version: 5.9.2
  • First release: Feb 29, 2012
  • Latest release: Oct 8, 2015
  • Number of updates: 61
  • Update frequency: every 21.8 days
  • Top authors: juliobox (100%)

Code review

54 tests

User reviews

35 reviews

Install metrics

8,000+ active / 266,424 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼302.43ms] Passed 4 tests

This is a short check of server-side resources used by Post Views Count (Support caching plugins!)
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.0657.02 ▲7.09
Dashboard /wp-admin3.44 ▲0.0432.48 ▼1.16
Posts /wp-admin/edit.php3.67 ▲0.0439.38 ▲4.08
Add New Post /wp-admin/post-new.php6.94 ▼0.0398.85 ▼1,213.84
Media Library /wp-admin/upload.php3.32 ▲0.0230.34 ▲1.21
Post Views Count /wp-admin/options-general.php?page=bawpvc_settings3.2954.40

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 7 new files
Database: no new tables, 1 new option
New WordPress options
bawpvc_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Post Views Count (Support caching plugins!)
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,909 ▲15515.65 ▲0.279.79 ▲3.352.51 ▼0.06
Dashboard /wp-admin2,904 ▲436.14 ▲0.07155.00 ▲20.61166.97 ▲9.35
Posts /wp-admin/edit.php2,708 ▲233.23 ▼0.0265.67 ▼0.04190.36 ▲35.42
Add New Post /wp-admin/post-new.php1,793 ▲1221.48 ▲4.35451.44 ▲36.05179.16 ▼1.61
Media Library /wp-admin/upload.php1,706 ▲115.45 ▼0.10137.08 ▼10.68193.49 ▼53.21
Post Views Count /wp-admin/options-general.php?page=bawpvc_settings1,1982.4453.81161.24

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
This plugin's uninstaller ran successfully

Smoke tests 50% 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 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/baw-post-views-count/about.php
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/baw-post-views-count/bawpv.php:48

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Screenshots: Please add descriptions for these screenshots #2, #3, #4, #5, #6, #7, #8 in baw-post-views-count/assets to your readme.txt
You can look at the official readme.txt

baw-post-views-count/bawpv.php 92% from 13 tests

"Post Views Count (Support caching plugins!)" version 3.0.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("baw-post-views-count.php" instead of "bawpv.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
Good job! No executable or dangerous file extensions detected654 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP25929552
PO File13640102

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity29.00
▷ Minimum class complexity29.00
▷ Maximum class complexity29.00
Average method complexity6.60
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions29
▷ Named functions29100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/bawlogo.png2.71KB1.36KB▼ 50.04%
images/paypal_big.png33.30KB10.26KB▼ 69.18%