84% countdown-to-force-logout

Code Review | Countdown to force logout

WordPress plugin Countdown to force logout scored84%from 54 tests.

About plugin

  • Plugin page: countdown-to-forc...
  • Plugin version: 1.04
  • PHP compatiblity: 8.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4
  • WordPress version: 6.3.1
  • First release: Aug 11, 2022
  • Latest release: Oct 27, 2023
  • Number of updates: 15
  • Update frequency: every 29.4 days
  • Top authors: Katsushi Kawamori (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /918 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼3.72ms] Passed 4 tests

A check of server-side resources used by Countdown to force logout
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0438.03 ▼2.82
Dashboard /wp-admin3.34 ▲0.0346.32 ▼6.30
Posts /wp-admin/edit.php3.39 ▲0.0346.45 ▲2.99
Add New Post /wp-admin/post-new.php5.94 ▲0.0583.96 ▼8.76
Media Library /wp-admin/upload.php3.27 ▲0.0440.73 ▲5.40

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Countdown to force logout
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,873 ▲11215.84 ▲1.251.75 ▲0.1643.98 ▼3.28
Dashboard /wp-admin2,264 ▲847.66 ▲2.05184.33 ▲97.2837.04 ▼2.05
Posts /wp-admin/edit.php2,195 ▲956.40 ▲4.4164.04 ▲29.0931.78 ▼8.25
Add New Post /wp-admin/post-new.php1,560 ▲3218.37 ▼4.83591.06 ▼82.7448.66 ▼1.12
Media Library /wp-admin/upload.php1,556 ▲1598.58 ▲4.40144.06 ▲48.1947.10 ▲5.05

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: 6 options
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not 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
Almost there! Just 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/countdown-to-force-logout/lib/class-countdowntoforcelogout.php:37
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/countdown-to-force-logout/lib/class-countdowntoforcelogout.php:37

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
3 plugin tags: logout, notify, countdown

countdown-to-force-logout/countdowntoforcelogout.php 92% from 13 tests

The principal PHP file in "Countdown to force logout" v. 1.04 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("countdown-to-force-logout.php" instead of "countdowntoforcelogout.php")

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
There were no executable files found in this plugin223 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP33588126
JavaScript213167
JSON10020
Sass1009
CSS1001

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity1.86
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods685.71%
▷ Protected methods00.00%
▷ Private methods114.29%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.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
No PNG images were found in this plugin