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

[Enhancement]: WC_Admin_Notices bad performance impact #36652

Closed
smazur opened this issue Jan 27, 2023 · 3 comments · Fixed by #43767
Closed

[Enhancement]: WC_Admin_Notices bad performance impact #36652

smazur opened this issue Jan 27, 2023 · 3 comments · Fixed by #43767
Labels
focus: install-uninstall Issues related to installing, uninstalling, and upgrades. focus: notice Issues related to notices. focus: performance The issue/PR is related to performance. priority: normal The issue/PR is of normal priority—not many people are affected or there’s a workaround, etc. team: Proton WC Core development and maintenance type: community contribution type: enhancement The issue is a request for an enhancement.

Comments

@smazur
Copy link
Contributor

smazur commented Jan 27, 2023

Describe the solution you'd like

We have 42k products in our store and we noticed slow sql caused by following call chain:

WC_Admin_Notices::init() -> WC_Install::is_new_install() -> wp_count_posts( 'product' )

This affects all admin/ajax requests.

Describe alternatives you've considered

No response

Additional context

No response

@smazur smazur added status: awaiting triage This is a newly created issue waiting for triage. type: enhancement The issue is a request for an enhancement. labels Jan 27, 2023
@lsinger lsinger added focus: performance The issue/PR is related to performance. needs: developer feedback Issues that need feedback from one of the WooCommerce Core developers. and removed status: awaiting triage This is a newly created issue waiting for triage. labels Jan 31, 2023
@github-actions
Copy link
Contributor

Hi @smazur,

Thank you for opening the issue! It requires further feedback from the WooCommerce Core team.

We are adding the needs developer feedback label to this issue so that the Core team could take a look.

Please note it may take a few days for them to get to this issue. Thank you for your patience.

@barryhughes barryhughes added priority: normal The issue/PR is of normal priority—not many people are affected or there’s a workaround, etc. and removed needs: developer feedback Issues that need feedback from one of the WooCommerce Core developers. labels Apr 4, 2023
@barryhughes
Copy link
Member

Thanks! We'll aim to review the pull request shortly.

@rrennick rrennick added team: Proton WC Core development and maintenance focus: install-uninstall Issues related to installing, uninstalling, and upgrades. focus: notice Issues related to notices. labels Oct 24, 2023
@barryhughes
Copy link
Member

I'm not sure what went wrong with the original PR, but I've created a new one (taking a slightly different approach).

Please note that this represents an incremental step forward, but doesn't solve the problem of wp_count_posts( 'product' ) calls being triggered on each admin page completely, as this still seems to happen (at least in some cases, or until specific criteria is satisfied) via Admin\Features\OnboardingTasks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
focus: install-uninstall Issues related to installing, uninstalling, and upgrades. focus: notice Issues related to notices. focus: performance The issue/PR is related to performance. priority: normal The issue/PR is of normal priority—not many people are affected or there’s a workaround, etc. team: Proton WC Core development and maintenance type: community contribution type: enhancement The issue is a request for an enhancement.
Projects
None yet
4 participants