84% posts-visitors

Code Review | Posts Visitors

WordPress plugin Posts Visitors scored 84% from 54 tests.

About plugin

  • Plugin page: posts-visitors
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-5.9
  • WordPress version: 6.3.1
  • First release: May 3, 2022
  • Latest release: May 11, 2022
  • Number of updates: 3
  • Update frequency: every 2.7 days
  • Top authors: hudamedoukh (100%)

Code review

54 tests

User reviews

1 review

Install metrics

80+ active / 489 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.05MB] [CPU: ▼3.43ms] Passed 4 tests

This is a short check of server-side resources used by Posts Visitors
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0441.44 ▼3.46
Dashboard /wp-admin3.35 ▲0.0548.49 ▲2.73
Posts /wp-admin/edit.php3.40 ▲0.0548.11 ▼1.24
Add New Post /wp-admin/post-new.php5.96 ▲0.0787.52 ▼10.57
Media Library /wp-admin/upload.php3.27 ▲0.0534.17 ▲1.55

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 15 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Posts Visitors
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,856 ▲12113.20 ▼1.471.75 ▼0.1541.01 ▼5.32
Dashboard /wp-admin2,259 ▲685.85 ▲0.9794.61 ▼6.2641.51 ▼0.00
Posts /wp-admin/edit.php2,122 ▲332.01 ▼0.0134.58 ▼5.4030.14 ▼3.44
Add New Post /wp-admin/post-new.php1,531 ▲1723.56 ▲6.10661.05 ▲29.8154.28 ▼10.32
Media Library /wp-admin/upload.php1,411 ▲234.29 ▲0.0994.45 ▼2.9441.34 ▲1.67

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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 take a closer look at the following
  • 5× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/posts-visitors/includes/posts-visitors-shortcode.php
    • > /wp-content/plugins/posts-visitors/includes/posts-visitors-functions.php
    • > /wp-content/plugins/posts-visitors/includes/posts-visitors-settings.php
    • > /wp-content/plugins/posts-visitors/posts-visitors.php
    • > /wp-content/plugins/posts-visitors/includes/posts-visitors-dashboard.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 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
7 plugin tags: posts, hits, posts visitors, visitors, counter...

posts-visitors/posts-visitors.php Passed 13 tests

Analyzing the main PHP file in "Posts Visitors" version 1.0.0
72 characters long description:
A plugin allows you to display how many times the post had been visited.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected625 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP7154140511
JavaScript214460
CSS17554

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity6.60
▷ Minimum class complexity1.00
▷ Maximum class complexity15.00
Average method complexity2.12
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods25
▷ Static methods00.00%
▷ Public methods25100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
There are no PNG files in this plugin