84% views-counter

Code Review | Views Counter - Pages/Posts

WordPress plugin Views Counter - Pages/Posts scored84%from 54 tests.

About plugin

  • Plugin page: views-counter
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Dec 14, 2017
  • Latest release: Dec 15, 2017
  • Number of updates: 8
  • Update frequency: every 490.8 days
  • Top authors: mdshuvo (75%)cryonyx (37.5%)mdawaffe (25%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /633 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

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

An overview of server-side resources used by Views Counter - Pages/Posts
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0341.67 ▲1.10
Dashboard /wp-admin3.32 ▲0.0243.10 ▼11.64
Posts /wp-admin/edit.php3.37 ▲0.0252.03 ▲1.18
Add New Post /wp-admin/post-new.php5.90 ▲0.0279.29 ▼12.06
Media Library /wp-admin/upload.php3.24 ▲0.0236.31 ▲4.69

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
db_upgraded
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

Views Counter - Pages/Posts: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲2814.68 ▲0.122.30 ▲0.1243.10 ▼0.40
Dashboard /wp-admin2,195 ▲215.65 ▲0.1396.15 ▼4.1541.64 ▼1.99
Posts /wp-admin/edit.php2,110 ▲131.97 ▲0.0039.72 ▲2.9135.95 ▼3.31
Add New Post /wp-admin/post-new.php1,526 ▼223.24 ▼0.13675.16 ▼12.1478.52 ▲23.04
Media Library /wp-admin/upload.php1,400 ▼04.11 ▼0.16104.65 ▲0.2141.26 ▼4.45

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments

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)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_deactivation_hook() in wp-content/plugins/views-counter/view-count.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Tags: There are too many tags (14 tag instead of maximum 10)
You can take inspiration from this readme.txt

views-counter/view-count.php 92% from 13 tests

"Views Counter - Pages/Posts" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("views-counter.php" instead of "view-count.php")

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
Good job! No executable or dangerous file extensions detected61 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1141361

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.27
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%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected