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

Excessive DB queries in admin #1169

Closed
ParhamG opened this issue Sep 2, 2020 · 3 comments · Fixed by #1201
Closed

Excessive DB queries in admin #1169

ParhamG opened this issue Sep 2, 2020 · 3 comments · Fixed by #1201
Labels
needs discussion The issue/PR needs further discussion before a solution can be implemented

Comments

@ParhamG
Copy link
Contributor

ParhamG commented Sep 2, 2020

It seems like running setup_storage()/verify_db() on every requests in admin dashboard is excessive? It is causing the following two DB queries to run on every requests in admin dashboard:

SHOW TABLES LIKE 'wp_stream'
SHOW TABLES LIKE 'wp_stream_meta'

System Information

  • Stream plugin version: 3.5.1
  • WordPress version: 5.5.1
  • PHP version: 7.4
@kidunot89 kidunot89 added the needs discussion The issue/PR needs further discussion before a solution can be implemented label Sep 4, 2020
@kidunot89
Copy link
Contributor

kidunot89 commented Sep 4, 2020

@kasparsd How do you think this should be address this? I don't believe this functionality is vital to the plugin, so simply removing this function and the add_action statement on Line 75 should resolve the issue with no breaks 🤞.

@lkraav
Copy link
Contributor

lkraav commented Sep 4, 2020

Yeah, it seems like that function should only run on plugin activation hook?

@kidunot89
Copy link
Contributor

kidunot89 commented Sep 7, 2020

@lkraav I don't think that's necessary since the activation hook is where the database changes are setup and error handling already existed in the case of a database failure.

Also if the check causing the issue fails all it does is print an admin notice telling the user to reinstall the plugin. Seems a little redundant to me as an error handling measure 🤷‍♂️.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs discussion The issue/PR needs further discussion before a solution can be implemented
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants