-
Notifications
You must be signed in to change notification settings - Fork 101
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
Update WordPress Importer plugin to include post_type in the query for existing post #5410
base: develop
Are you sure you want to change the base?
Update WordPress Importer plugin to include post_type in the query for existing post #5410
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #5410 +/- ##
=============================================
- Coverage 29.03% 28.99% -0.05%
Complexity 4825 4825
=============================================
Files 283 283
Lines 20954 20942 -12
=============================================
- Hits 6085 6073 -12
Misses 14869 14869 ☔ View full report in Codecov by Sentry. |
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @dhusakovic, thanks for the PR! Would it be possible to do the change upstream so that when we update it to the latest version, the change doesn't get overwritten? https://github.com/WordPress/wordpress-importer
@rebeccahum I've created an issue and suggested the change here WordPress/wordpress-importer#162. Can we still push the update here while we wait for the upstream changes? |
@dhusakovic I'd prefer to keep it in sync with upstream to ensure it doesn't get overwritten with the way we have many moving parts in MU-plugins! However, I looked at the upstream issue and it looks like your suggestion would be a welcome change in a PR 🙂. |
This pull request has been marked stale because it has been open for 60 days with no activity. If there is no activity within 7 days, it will be closed. This is an automation to keep pull requests manageable and actionable and is not a comment on the quality of this pull request nor on the work done so far. Closed PRs are still valuable to the project and their branches are preserved. |
This pull request has been marked stale because it has been open for 60 days with no activity. If there is no activity within 7 days, it will be closed. This is an automation to keep pull requests manageable and actionable and is not a comment on the quality of this pull request nor on the work done so far. Closed PRs are still valuable to the project and their branches are preserved. |
Description
The post import process uses post_exists function to check whether each of the importing posts already exists. The query utilises the title and date parameters for this search, which will run through all the posts to try and find a match.
In cases where we have a large number of posts this process times out and the import fails.
Passing the post_type to post_exists function allows us to use the type_status_date key, which significantly drops the number of rows examined and the overall query time in certain instances, depending on how many posts of that post_type we have.
Changelog Description
Update to WordPress Importer plugin to improve the post_exists query time during post import process.
Pre-review checklist
Please make sure the items below have been covered before requesting a review: