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

Do not check for plugin updates when there are no plugins #2605

Merged
merged 1 commit into from
Oct 5, 2023

Conversation

jom
Copy link
Member

@jom jom commented Oct 5, 2023

Changes Proposed in this Pull Request

  • Only sends plugin update requests when there are first-party plugins installed

Testing Instructions


Plugin build for 678169c
📦 Download plugin zip
▶️ Open in playground

@jom jom requested a review from a team October 5, 2023 15:30
@jom jom self-assigned this Oct 5, 2023
@jom jom changed the title Do not check for plugin updates when there are none Do not check for plugin updates when there are no plugins Oct 5, 2023
Copy link
Member

@fjorgemota fjorgemota left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good, but, where (e.g. on which pages) should this code be running?

I see that on the /wp-admin/update-core.php?force-check=1 page the update_plugins transient is being updated, but it doesn't seem to be triggering the hook pre_set_site_transient_update_plugins, although the addon is correctly appearing on the list of plugins to be updated... 🤔

Testing on PHP 8.2.10 and WP 6.3.1

@fjorgemota
Copy link
Member

Nevermind the comment above, I just found out that wp transient delete --all deletes only the site transients, while the ones used by this algorithm are related to the "network", so we need to run wp transient delete --network --all instead.

And the weird thing is that I'm testing on a non-multisite WP installation, but oh well. I'll test further and update the review =)

@fjorgemota fjorgemota self-requested a review October 5, 2023 17:08
Copy link
Member

@fjorgemota fjorgemota left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and works well!

@jom jom merged commit 534d65f into trunk Oct 5, 2023
9 checks passed
@jom jom deleted the fix/only-check-with-plugins branch October 5, 2023 17:16
@jom
Copy link
Member Author

jom commented Oct 5, 2023

Thanks, @fjorgemota!

@gikaragia gikaragia added this to the 2.0.0 milestone Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants