Yoast / duplicate-post

Yoast Duplicate Post plugin for WordPress
https://yoast.com
GNU General Public License v2.0
46 stars 36 forks source link

Fix Possible NULL Value of `duplicate_post_taxonomies_blacklist` #360

Closed michael-sumner closed 5 months ago

michael-sumner commented 7 months ago

Context

Cloning a post can cause a critical error due to the type of get_option( 'duplicate_post_taxonomies_blacklist' ) which can be a NULL value.

Related Issues:

  1. https://wordpress.org/support/topic/taxonomies-are-not-copied-because-duplicate_post_taxonomies_blacklist-is-null/
  2. https://github.com/Yoast/duplicate-post/issues/263

Screenshot 2024-02-07 at 4 50 17 pm

Summary

This PR can be summarized in the following changelog entry:

Relevant technical choices:

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

It's a bit tricky to reproduce the problem because it looks like it can be caused by caching, or by pathological situations where the option value has been stored in the wrong way. We'll need to use filters to emulate those cases.

Reproduce the issue with NULL value

Reproduce the issue with a string value

test the fix with NULL value

test the fix with with a string value

Relevant test scenarios

Test instructions for QA when the code is in the RC

QA can test this PR by following these steps:

Impact check

This PR affects the following parts of the plugin, which may require extra testing:

UI changes

Documentation

Quality assurance

Innovation

Fixes #263

coveralls commented 5 months ago

Pull Request Test Coverage Report for Build 8390479200

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
admin-functions.php 0 8 0.0%
<!-- Total: 0 8 0.0% -->
Files with Coverage Reduction New Missed Lines %
admin-functions.php 2 0.0%
<!-- Total: 2 -->
Totals Coverage Status
Change from base Build 8307438743: -0.08%
Covered Lines: 1237
Relevant Lines: 2467

💛 - Coveralls
enricobattocchi commented 5 months ago

Thanks @michael-sumner! I added some more related fixes that I wasn't able to push before