94% sw-post-views-count

Code Review | SW Post Views Count

WordPress plugin SW Post Views Count scored 94% from 54 tests.

About plugin

  • Plugin page: sw-post-views-count
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.9.6
  • WordPress version: 5.8.1
  • First release: Oct 23, 2018
  • Latest release: Oct 23, 2018
  • Number of updates: 6
  • Update frequency: every 0.3 days
  • Top authors: sagarwalzade16 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 375 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.01MB] [CPU: ▼139.35ms] Passed 4 tests

A check of server-side resources used by SW Post Views Count
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.86 ▲0.1452.95 ▲29.15
Dashboard /wp-admin3.09 ▲0.0364.60 ▲8.11
Posts /wp-admin/edit.php3.07 ▼0.0344.71 ▼3.47
Add New Post /wp-admin/post-new.php5.45 ▲0.01103.12 ▼565.43
Media Library /wp-admin/upload.php3.03 ▲0.0338.36 ▲3.38

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 8 new files
Database: 1 new table, no new options
New tables
wp_swpcv_daily_views

Browser metrics Passed 4 tests

A check of browser resources used by SW Post Views Count
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,681 ▲6815.91 ▲0.3415.56 ▲4.9254.73 ▼0.81
Dashboard /wp-admin2,969 ▲355.87 ▼0.04157.05 ▼20.48118.56 ▲7.15
Posts /wp-admin/edit.php2,756 ▲172.71 ▼0.0078.63 ▲10.7287.07 ▼0.47
Add New Post /wp-admin/post-new.php1,744 ▲6118.23 ▼0.07429.03 ▼14.04131.78 ▲11.22
Media Library /wp-admin/upload.php1,809 ▲55.05 ▲0.02184.65 ▼25.88120.10 ▲2.07

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
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 75% 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)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sw-post-views-count/admin/admin-functions.php:68
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/sw-post-views-count/sw-post-views-count.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
2 plugin tags: post views, wordpress post view count

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

The main PHP script in "SW Post Views Count" version 1.0.0 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

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
Success! There were no dangerous files found in this plugin265 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP35459199
CSS113166

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.29
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%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
3 PNG files occupy 0.26MB with 0.17MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/screenshot1.png98.64KB35.27KB▼ 64.24%
images/screenshot2.png94.62KB31.24KB▼ 66.99%
images/screenshot3.png68.98KB24.64KB▼ 64.28%