62% peters-login-redirect

Code Review | LoginWP (Formerly Peter's Login Redirect)

WordPress plugin LoginWP (Formerly Peter's Login Redirect) scored 62% from 54 tests.

About plugin

  • Plugin page: peters-login-redi...
  • Plugin version: 3.0.0.8
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.9
  • WordPress version: 5.9.2
  • First release: Sep 10, 2008
  • Latest release: Apr 5, 2022
  • Number of updates: 138
  • Update frequency: every 35.9 days
  • Top authors: pkthree (65.94%)Collizo4sky (34.78%)

Code review

54 tests

User reviews

297 reviews

Install metrics

100,000+ active / 1,602,825 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.70MB] [CPU: ▼310.61ms] Passed 4 tests

A check of server-side resources used by LoginWP (Formerly Peter's Login Redirect)
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.25 ▲0.7376.26 ▲4.74
Dashboard /wp-admin4.10 ▲0.6944.21 ▲4.40
Posts /wp-admin/edit.php4.38 ▲0.7452.83 ▲9.92
Add New Post /wp-admin/post-new.php7.62 ▲0.65119.86 ▼1,234.48
Media Library /wp-admin/upload.php4.04 ▲0.7537.41 ▼17.09
Settings /wp-admin/admin.php?page=loginwp-settings4.0130.73
Login Forms /wp-admin/admin.php?page=loginwp-ppress4.0231.03
Redirections /wp-admin/admin.php?page=loginwp-redirections4.2135.95

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 173 new files
Database: 1 new table, 2 new options
New tables
wp_login_redirects
New WordPress options
loginwp_install_date
loginwp_from_ab_initio

Browser metrics Passed 4 tests

An overview of browser requirements for LoginWP (Formerly Peter's Login Redirect)
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,959 ▲21416.00 ▲0.5114.55 ▲1.462.70 ▼1.33
Dashboard /wp-admin3,080 ▲1616.45 ▲0.08184.10 ▼21.90212.95 ▼13.19
Posts /wp-admin/edit.php2,774 ▲533.44 ▲0.0280.79 ▼22.44171.27 ▼7.92
Add New Post /wp-admin/post-new.php1,689 ▲2716.92 ▼0.09655.19 ▼3.04201.25 ▲7.94
Media Library /wp-admin/upload.php1,783 ▲515.77 ▲0.05208.81 ▲21.90239.26 ▼10.17
Settings /wp-admin/admin.php?page=loginwp-settings1,4072.8982.00161.76
Login Forms /wp-admin/admin.php?page=loginwp-ppress1,2232.8572.50207.73
Redirections /wp-admin/admin.php?page=loginwp-redirections2,0312.9973.54165.55

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_login_redirects
  • This plugin did not uninstall successfully, leaving 2 options in the database
    • loginwp_from_ab_initio
    • loginwp_install_date

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/admin.php?page=loginwp-settings
    • > Notice in wp-content/plugins/peters-login-redirect/src/core/src/Admin/SettingsPageApi.php+1011
    Undefined index: default_value

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
Please fix the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/peters-login-redirect/wplogin_redirect_control.php
  • 124× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/peters-login-redirect/vendor/composer/installers/src/Composer/Installers/DecibelInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/peters-login-redirect/vendor/composer/installers/src/Composer/Installers/AglInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/peters-login-redirect/vendor/composer/installers/src/Composer/Installers/LavaLiteInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/peters-login-redirect/vendor/composer/installers/src/Composer/Installers/MagentoInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/peters-login-redirect/vendor/composer/installers/src/Composer/Installers/PxcmsInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/peters-login-redirect/vendor/composer/installers/src/Composer/Installers/DokuWikiInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/peters-login-redirect/vendor/composer/installers/src/Composer/Installers/CraftInstaller.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/peters-login-redirect/vendor/composer/installers/src/Composer/Installers/OntoWikiInstaller.php:4
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/peters-login-redirect/src/core/src/Admin/Installer/PluginSilentUpgraderSkin.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/peters-login-redirect/src/core/src/MoAdminNotice.php:9

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Please fix the following attributes: The official readme.txt is a good inspiration

peters-login-redirect/wplogin_redirect.php 92% from 13 tests

The entry point to "LoginWP (Formerly Peter's Login Redirect)" version 3.0.0.8 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("peters-login-redirect.php" instead of "wplogin_redirect.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin7,577 lines of code in 155 files:
LanguageFilesBlank linesComment linesLines of code
PHP1391,4511,6836,522
JSON400415
CSS1480249
JavaScript35726155
YAML3313123
Markdown2390110
SVG3003

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity5.95
▷ Minimum class complexity1.00
▷ Maximum class complexity104.00
Average method complexity2.93
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces8
Interfaces0
Traits0
Classes121
▷ Abstract classes21.65%
▷ Concrete classes11998.35%
▷ Final classes00.00%
Methods321
▷ Static methods6720.87%
▷ Public methods26582.55%
▷ Protected methods4514.02%
▷ Private methods113.43%
Functions33
▷ Named functions1339.39%
▷ Anonymous functions2060.61%
Constants17
▷ Global constants1164.71%
▷ Class constants635.29%
▷ Public constants6100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.04MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
src/core/assets/images/loginwpXprofilepress.png8.67KB9.23KB0.00%
src/core/assets/images/ppress-login-form.png21.60KB25.31KB0.00%
src/core/assets/images/loginwp.png15.02KB6.61KB▼ 55.97%