62% peters-login-redirect

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

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

About plugin

  • Plugin page: peters-login-redi...
  • Plugin version: 3.0.8.5
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.3
  • WordPress version: 6.3.1
  • First release: Sep 10, 2008
  • Latest release: Aug 25, 2023
  • Number of updates: 161
  • Update frequency: every 33.9 days
  • Top authors: pkthree (56.52%)Collizo4sky (40.37%)mej (4.35%)

Code review

54 tests

User reviews

408 reviews

Install metrics

100,000+ active /2,359,492 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.76MB] [CPU: ▲4.20ms] Passed 4 tests

Analyzing server-side resources used by LoginWP (Formerly Peter's Login Redirect)
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.21 ▲0.7554.77 ▲14.08
Dashboard /wp-admin4.06 ▲0.7652.23 ▲0.95
Posts /wp-admin/edit.php4.11 ▲0.7650.36 ▲3.36
Add New Post /wp-admin/post-new.php6.67 ▲0.7897.71 ▲4.80
Media Library /wp-admin/upload.php3.99 ▲0.7639.99 ▲7.67
FuseWP NEW /wp-admin/admin.php?page=loginwp-fusewp3.9035.59
Settings /wp-admin/admin.php?page=loginwp-settings3.8939.42
Redirection Rules /wp-admin/admin.php?page=loginwp-redirections4.1939.23

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 177 new files
Database: 1 new table, 8 new options
New tables
wp_login_redirects
New WordPress options
loginwp_from_ab_initio
widget_recent-posts
widget_theysaidso_widget
loginwp_install_date
db_upgraded
widget_recent-comments
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by LoginWP (Formerly Peter's Login Redirect)
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,849 ▲11413.29 ▼1.392.21 ▲0.2138.32 ▼12.31
Dashboard /wp-admin2,255 ▲674.89 ▼1.01112.25 ▼3.8445.45 ▲2.11
Posts /wp-admin/edit.php2,138 ▲492.05 ▲0.0140.54 ▲3.4737.10 ▲2.07
Add New Post /wp-admin/post-new.php1,566 ▲4718.26 ▼4.93621.39 ▼62.8267.70 ▲7.38
Media Library /wp-admin/upload.php1,440 ▲494.25 ▼0.0696.34 ▼15.2443.73 ▼2.76
FuseWP NEW /wp-admin/admin.php?page=loginwp-fusewp9202.2627.2644.18
Settings /wp-admin/admin.php?page=loginwp-settings1,1281.9127.3433.28
Redirection Rules /wp-admin/admin.php?page=loginwp-redirections1,5452.2429.6335.06

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_login_redirects
  • Zombie WordPress options detected upon uninstall: 8 options
    • widget_recent-comments
    • widget_recent-posts
    • loginwp_from_ab_initio
    • loginwp_install_date
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
    • > 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
The following issues need your attention
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/peters-login-redirect/wplogin_redirect_control.php
  • 124× GET requests to PHP files have triggered server-side errors or warnings (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/MantisBTInstaller.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/peters-login-redirect/vendor/composer/installers/src/Composer/Installers/OsclassInstaller.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/peters-login-redirect/vendor/composer/installers/src/Composer/Installers/WHMCSInstaller.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/peters-login-redirect/src/core/src/MoAdminNotice.php:9
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-upgrader-skin.php): failed to open stream: No such file or directory in wp-content/plugins/peters-login-redirect/src/core/src/Admin/Installer/PluginSilentUpgraderSkin.php on line 6
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/peters-login-redirect/vendor/composer/installers/src/Composer/Installers/GravInstaller.php:4
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-upgrader.php): failed to open stream: No such file or directory in wp-content/plugins/peters-login-redirect/src/core/src/Admin/Installer/PluginSilentUpgrader.php on line 10
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/peters-login-redirect/vendor/composer/installers/src/Composer/Installers/CodeIgniterInstaller.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/DrupalInstaller.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/MODULEWorkInstaller.php:4

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)
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention: The official readme.txt is a good inspiration

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

The main file in "LoginWP (Formerly Peter's Login Redirect)" v. 3.0.8.5 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: Name the main plugin file the same 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 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected8,359 lines of code in 157 files:
LanguageFilesBlank linesComment linesLines of code
PHP1401,6311,9027,192
JSON400415
JavaScript410049267
CSS1480249
YAML3313123
Markdown2390110
SVG3003

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity6.36
▷ Minimum class complexity1.00
▷ Maximum class complexity104.00
Average method complexity2.95
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces8
Interfaces0
Traits0
Classes122
▷ Abstract classes21.64%
▷ Concrete classes12098.36%
▷ Final classes00.00%
Methods345
▷ Static methods7622.03%
▷ Public methods28081.16%
▷ Protected methods5415.65%
▷ Private methods113.19%
Functions33
▷ Named functions1442.42%
▷ Anonymous functions1957.58%
Constants18
▷ Global constants1055.56%
▷ Class constants844.44%
▷ Public constants8100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
5 PNG files occupy 0.19MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
src/core/assets/images/loginwpXprofilepress.png8.67KB9.23KB0.00%
src/core/assets/images/fusewp-user-sync-edit-screen.png69.11KB69.12KB0.00%
src/core/assets/images/ppress-login-form.png21.60KB25.31KB0.00%
src/core/assets/images/loginwp.png15.02KB6.61KB▼ 55.97%
src/core/assets/images/fusewp-x-loginwp.png80.89KB19.95KB▼ 75.34%