67% wp-persistent-login

Code Review | WordPress Persistent Login

WordPress plugin WordPress Persistent Login scored67%from 54 tests.

About plugin

  • Plugin page: wp-persistent-login
  • Plugin version: 2.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Aug 22, 2014
  • Latest release: Nov 19, 2023
  • Number of updates: 111
  • Update frequency: every 30.4 days
  • Top authors: lukeseager (89.19%)b9media (11.71%)

Code review

54 tests

User reviews

21 reviews

Install metrics

6,000+ active /70,441 total downloads

Benchmarks

Plugin footprint 65% 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.60MB] [CPU: ▲0.67ms] 75% from 4 tests

Server-side resources used by WordPress Persistent Login
The following require your attention
  • CPU: The total CPU usage must kept under 500.00ms (currently 1,852.77ms on /wp-admin/users.php?page=wp-persistent-login)
PageMemory (MB)CPU Time (ms)
Home /4.11 ▲0.6438.60 ▼0.29
Dashboard /wp-admin3.94 ▲0.6050.34 ▼6.79
Posts /wp-admin/edit.php3.99 ▲0.6449.94 ▲3.90
Add New Post /wp-admin/post-new.php6.46 ▲0.5794.17 ▲5.87
Media Library /wp-admin/upload.php3.84 ▲0.6139.68 ▲7.82
Persistent Login /wp-admin/users.php?page=wp-persistent-login3.951,852.77
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius4.0536.92

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 339 new files
Database: no new tables, 11 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
persistent_login_db_version
persistent_login_options
fs_debug_mode
db_upgraded
widget_recent-comments
widget_recent-posts
fs_active_plugins
fs_accounts
...

Browser metrics Passed 4 tests

An overview of browser requirements for WordPress Persistent Login
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,823 ▲7614.68 ▲0.331.72 ▲0.1130.44 ▼8.85
Dashboard /wp-admin2,216 ▲365.62 ▼0.0190.79 ▼0.3140.16 ▼6.66
Posts /wp-admin/edit.php2,125 ▲281.98 ▼0.0240.46 ▲1.3238.03 ▼3.91
Add New Post /wp-admin/post-new.php1,534 ▼123.39 ▲4.75726.86 ▲30.5257.97 ▼1.91
Media Library /wp-admin/upload.php1,421 ▲184.17 ▲0.02107.61 ▲11.3550.22 ▲8.19
Persistent Login /wp-admin/users.php?page=wp-persistent-login9831.6525.1557.43
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius1,0861.6528.9227.14

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/wp-persistent-login/includes/freemius/includes/class-freemius.php+8546
    Undefined property: stdClass::$plugins
  • This plugin does not fully uninstall, leaving 9 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • fs_active_plugins
    • db_upgraded
    • fs_debug_mode
    • widget_recent-comments
    • widget_recent-posts
    • fs_accounts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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 | 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
  • 10× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wp-persistent-login/vendor/whichbrowser/parser/bin/update-profiles.php
    • > /wp-content/plugins/wp-persistent-login/classes/wp-persistent-login-login-history.php
    • > /wp-content/plugins/wp-persistent-login/classes/wp-persistent-login-profile.php
    • > /wp-content/plugins/wp-persistent-login/classes/wp-persistent-login-email.php
    • > /wp-content/plugins/wp-persistent-login/classes/wp-persistent-login.php
    • > /wp-content/plugins/wp-persistent-login/classes/wp-persistent-login-settings.php
    • > /wp-content/plugins/wp-persistent-login/classes/wp-persistent-login-user-count.php
    • > /wp-content/plugins/wp-persistent-login/vendor/whichbrowser/parser/bin/update-chrome.php
    • > /wp-content/plugins/wp-persistent-login/vendor/whichbrowser/parser/bin/update-browser-ids.php
    • > /wp-content/plugins/wp-persistent-login/classes/wp-persistent-login-admin.php
  • 76× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-persistent-login/includes/database-upgrades.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'WhichBrowser\\Model\\Primitive\ameVersion' not found in wp-content/plugins/wp-persistent-login/vendor/whichbrowser/parser/src/Model/Family.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WhichBrowser\\Model\\Main' not found in wp-content/plugins/wp-persistent-login/vendor/whichbrowser/parser/src/Parser.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WhichBrowser\\Constants\\DeviceType' not found in wp-content/plugins/wp-persistent-login/vendor/whichbrowser/parser/data/models-palmos.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'WhichBrowser\\Constants\\DeviceType' not found in wp-content/plugins/wp-persistent-login/vendor/whichbrowser/parser/data/models-feature.php:8
    • > PHP Warning
      array_shift() expects parameter 1 to be array, null given in wp-content/plugins/wp-persistent-login/vendor/whichbrowser/parser/bin/query.php on line 11
    • > PHP Fatal error
      Uncaught Error: Class 'WhichBrowser\\Data\\DeviceModels' not found in wp-content/plugins/wp-persistent-login/vendor/whichbrowser/parser/data/indices/models-s30plus.php:5
    • > PHP Warning
      file_get_contents(): Failed to enable crypto in wp-content/plugins/wp-persistent-login/vendor/whichbrowser/parser/bin/update-browser-ids.php on line 7
    • > PHP Fatal error
      Uncaught Error: Class 'WhichBrowser\\Model\\Primitive\ameVersion' not found in wp-content/plugins/wp-persistent-login/vendor/whichbrowser/parser/src/Model/Engine.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WhichBrowser\\Data\\DeviceModels' not found in wp-content/plugins/wp-persistent-login/vendor/whichbrowser/parser/data/indices/models-feature.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Donate link: Invalid URI found ("")
You can look at the official readme.txt

wp-persistent-login/wp_persistent_login.php 92% from 13 tests

The entry point to "WordPress Persistent Login" version 2.1.0 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wp-persistent-login.php" instead of "wp_persistent_login.php")

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin92,242 lines of code in 289 files:
LanguageFilesBlank linesComment linesLines of code
PHP26313,37119,78090,999
Markdown42300441
PO File1120160362
JavaScript44564230
JSON470197
CSS130013

PHP code 0% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
It is recommended to fix the following
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 3,096)
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 107)
Cyclomatic complexity
Average complexity per logical line of code0.58
Average class complexity54.82
▷ Minimum class complexity1.00
▷ Maximum class complexity3,096.00
Average method complexity5.17
▷ Minimum method complexity1.00
▷ Maximum method complexity107.00
Code structure
Namespaces12
Interfaces5
Traits25
Classes100
▷ Abstract classes22.00%
▷ Concrete classes9898.00%
▷ Final classes00.00%
Methods1,708
▷ Static methods23613.82%
▷ Public methods1,07562.94%
▷ Protected methods422.46%
▷ Private methods59134.60%
Functions130
▷ Named functions11689.23%
▷ Anonymous functions1410.77%
Constants232
▷ Global constants11047.41%
▷ Class constants12252.59%
▷ Public constants122100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
includes/freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%