Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Routines Can Run on Front-End Requests #1188

Open
kevinfodness opened this issue Oct 30, 2024 · 0 comments
Open

Upgrade Routines Can Run on Front-End Requests #1188

kevinfodness opened this issue Oct 30, 2024 · 0 comments
Labels
bug Something isn't working php Requires understanding PHP

Comments

@kevinfodness
Copy link
Member

Description of the bug

The upgrade routine in includes/class-apple-news.php that compares the currently installed version of the plugin to an option value of the last recorded version of the plugin and executes database migration code if the versions are different is not coded to prevent execution on the front-end. This upgrade code should only ever be executed in an admin context (is_admin()).

Steps To Reproduce

  1. Update the source files for the plugin to a newer version which triggers an update routine (e.g., from 2.4.0 to 2.5.0) directly on the filesystem (rather than clicking an upgrade link in the admin).
  2. Visit the front-end of the site while logged out and notice that the upgrade routine executes even though the current user is not logged in.

Additional Information

No response

@kevinfodness kevinfodness added bug Something isn't working php Requires understanding PHP labels Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working php Requires understanding PHP
Projects
None yet
Development

No branches or pull requests

1 participant