WordPress / WordPress/wordpress-importer
Update plugin to call `wp_slash` on wp5.5+ and `wp_slash_strings_only` on older versions
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 89
- Forks
- 96
- Avg merge
- 1h 13m
- Merged PRs (30d)
- 2
Description
Coming from core#50635 "the plugin could probably be updated to call wp_slash() on WP 5.5+, and wp_slash_strings_only() on older versions."
Relevant thread;
Should references of wp_slash_strings_only be removed from the WordPress Importer phpunit data?
When you install from svn the wordpress-importer dir is installed to the tests/phpunit/data/plugins and the wordpress-importer/class-wp-import.php contains references to wp_slash_strings_only, as well there's a pluggable wp_slash_strings_only function in the wordpress-importer/compat.php.
Good catch, thanks! I think the plugin can be left as is for now, as it aims to be compatible with WP 3.7+, and the fix for wp_slash() to handle non-string values is only available since WP 5.5.
That said, the plugin could probably be updated to call wp_slash() on WP 5.5+, and wp_slash_strings_only() on older versions.
Opening this ticket to look into addressing the deprecation.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with wordpress-importer/class-wp-import.php and compat.php, then inspect the WordPress Importer PHPUnit data references mentioned in the thread. Compare the available slash functions across WordPress versions, and consider the core#50635 discussion first. Done means the importer uses the appropriate function for WordPress 5.5+ and older supported versions without the deprecated reference.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, wordpress
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100