87% user-page-and-post-tracking

Code Review | User Page and Post Tracking

WordPress plugin User Page and Post Tracking scored 87% from 54 tests.

About plugin

  • Plugin page: user-page-and-pos...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.6.1
  • WordPress version: 5.8.1
  • First release: Feb 12, 2021
  • Latest release: Feb 12, 2021
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: yogeshdalavi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 693 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼143.96ms] Passed 4 tests

Server-side resources used by User Page and Post Tracking
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.89 ▲0.1739.00 ▲16.07
Dashboard /wp-admin3.11 ▲0.0542.88 ▼5.86
Posts /wp-admin/edit.php3.23 ▲0.1245.94 ▲3.90
Add New Post /wp-admin/post-new.php5.47 ▲0.0485.85 ▼567.53
Media Library /wp-admin/upload.php3.05 ▲0.0433.27 ▼6.36

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 22 new files
Database: 1 new table, no new options
New tables
wp_user_page_post_tracking

Browser metrics Passed 4 tests

Checking browser requirements for User Page and Post Tracking
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,740 ▲14416.22 ▲0.7810.03 ▲1.6361.94 ▲13.93
Dashboard /wp-admin2,974 ▲436.00 ▲0.05140.25 ▼5.50117.16 ▲8.26
Posts /wp-admin/edit.php2,783 ▲442.71 ▲0.0169.25 ▲4.12100.24 ▲7.12
Add New Post /wp-admin/post-new.php1,504 ▲418.22 ▼0.53349.71 ▼22.05104.86 ▼3.74
Media Library /wp-admin/upload.php1,817 ▲45.01 ▼0.02147.77 ▲3.21118.60 ▼3.49

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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 items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/user-page-and-post-tracking/public/partials/user-page-post-tracking-public-display.php
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_current_user_id() in wp-content/plugins/user-page-and-post-tracking/admin/partials/user-page-post-tracking-admin-display.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 86% 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
These attributes need your attention:
  • Plugin Name: You should set the name of your plugin on the first line ( === user-page-and-post-tracking === )
The official readme.txt might help

user-page-and-post-tracking/user-page-post-tracking.php 77% from 13 tests

This is the main PHP file of "User Page and Post Tracking" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 150 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("user-page-and-post-tracking.php" instead of "user-page-post-tracking.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

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
Good job! No executable or dangerous file extensions detected238 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP12128514232
JavaScript24546
CSS2080

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.11
Average class complexity1.71
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.22
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods23
▷ Static methods28.70%
▷ Public methods1878.26%
▷ Protected methods00.00%
▷ Private methods521.74%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
No PNG files were detected