84% pageviews

Code Review | Pageviews

WordPress plugin Pageviews scored 84% from 54 tests.

About plugin

  • Plugin page: pageviews
  • Plugin version: 0.11.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.5
  • WordPress version: 5.8.1
  • First release: Jul 8, 2016
  • Latest release: Feb 21, 2020
  • Number of updates: 24
  • Update frequency: every 66.6 days
  • Top authors: soulseekah (58.33%)pressjitsu (45.83%)

Code review

54 tests

User reviews

7 reviews

Install metrics

4,000+ active / 37,788 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.58MB] [CPU: ▼191.70ms] Passed 4 tests

A check of server-side resources used by Pageviews
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.89 ▲0.052,836.82 ▲2,798.19
Dashboard /wp-admin3.11 ▲0.0553.27 ▲2.04
Posts /wp-admin/edit.php3.19 ▲0.0950.58 ▼0.21
Add New Post /wp-admin/post-new.php2.95 ▼2.4830.12 ▼767.41
Media Library /wp-admin/upload.php3.05 ▲0.0537.70 ▼1.22

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Pageviews
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,850 ▲24416.58 ▲0.9118.45 ▲7.6450.20 ▼9.13
Dashboard /wp-admin2,985 ▲515.94 ▼0.06147.97 ▼2.80118.16 ▼0.06
Posts /wp-admin/edit.php2,772 ▲332.58 ▼0.1368.94 ▼8.5299.77 ▲6.50
Add New Post /wp-admin/post-new.php1,636 ▼4721.39 ▲2.60296.25 ▼140.48110.80 ▼8.61
Media Library /wp-admin/upload.php1,778 ▼295.00 ▼0.06166.37 ▲15.54127.98 ▼14.78

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Zombie WordPress options were found after uninstall: 1 option
    • pageviews_config

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

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
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Notice
      Undefined variable: message in wp-content/plugins/pageviews/templates/admin-notice.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_js() in wp-content/plugins/pageviews/templates/admin-notice.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/pageviews/includes/rest-controller.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/pageviews/templates/auth.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/pageviews/pageviews.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
6 plugin tags: views, analytics, pageviews, hits, stats...

pageviews/pageviews.php Passed 13 tests

The primary PHP file in "Pageviews" version 0.11.0 is used by WordPress to initiate all plugin functionality
78 characters long description:
A simple and lightweight pageviews counter for your WordPress posts and pages.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin418 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP48257354
JavaScript212264

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity16.00
▷ Minimum class complexity13.00
▷ Maximum class complexity19.00
Average method complexity2.47
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods20
▷ Static methods20100.00%
▷ Public methods20100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin