Skip to content

SQLite module: Wrong user details #601

Closed

Description

@mukeshpanchal27

Bug Description

User information get wrong when SQLite is enabled.

Steps to reproduce

  1. Setup WordPress with an email wordpress@example.com
  2. Go to Admin Panel > Users > Add New user with email test@test.com and First and Last name
  3. Log out
  4. Login with test@test.com user
  5. Go to Admin Panel > Users and delete wordpress@example.com user
  6. Now Activate SQLite module (Go to Admin Panel > Settings > Performance > SQLite Integration)
  7. Check User details at Admin Panel > Users
  8. The new WordPress installation uses the email address wordpress@example.com rather than test@test.com 
  9. It should use the original user information instead of the old WP setup admin user details.

Additional Context

  • PHP Version: 7.4.33
  • OS: Mac
  • Browser: chrome
  • Plugin Version: 1.7.0
  • Device: Macbook Pro
  • SQLite version: 3.34.1

Activity

  1. felixarntz commented on Dec 14, 2022

    @felixarntz
    Member

    @mukeshpanchal27 To confirm: I think the problem here is that the new admin user in the SQLite DB will have the wrong email address. That's because the code right now always passes the current admin_email email address to wp_install(), which wp_install() then automatically uses for the initial user account as well.

    However, if we just change that parameter, it would mean that the user will have the correct email, but the admin_email would be wrong.

    So I think what we need to do is first pass the user's email to wp_install(), but then afterwards modify the admin_email option to restore the original admin_email address (not attached to any user since that user was deleted).

  2. added this to the 1.8.0 milestone on Dec 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

[Type] Bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions