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

Import/Export issue (Line Breakers in Yoast's settings) #11964

Open
2 tasks
dromaniuk opened this issue Jan 4, 2019 · 5 comments
Open
2 tasks

Import/Export issue (Line Breakers in Yoast's settings) #11964

dromaniuk opened this issue Jan 4, 2019 · 5 comments
Labels
component: importers Importing data from other plugins. severity: major Yoast: Management Issues about options and management of the plugin

Comments

@dromaniuk
Copy link

  • [ + ] I've read and understood the contribution guidelines.
  • [ + ] I've searched for any related issues and avoided creating a duplicate issue.

Please give us a description of what happened.

https://wordpress.org/support/topic/import-export-issue/

Hi. I have a problems with importing of settings.
I go to SEO -> Tools -> Export Settings, and get the archive.
I’m uploading the archive, but recipient site says, that
Settings could not be imported: No settings found in file.

I researched this issue, and found that removing INI_SCANNER_RAW directive from wp-content/plugins/wordpress-seo/admin/import/class-import-settings.php:153 solves it.

But it’s bad practice. I’ve tried to check data, and found, that INI file contains next rows:

rssbefore = "%%BLOGLINK%%^M
%%POSTLINK%%"
rssafter = "%%BLOGLINK%%^M
%%AUTHORLINK%%"

i.e. line returns are present in the values of parameters.

I didn’t find any WP filters or hooks in your code, for fixing it myself. And now I have to unpack ZIP-archive and modify INI-file manually, for being able to use it.

May you solve it?
I use WP 5.0.2 and YoastSEO 9.0.3

UPD: I've already tested it with latest Yoast 9.3. The problem is the same. I export settings,import them on the same site, and get error "Settings could not be imported: No settings found."

Please describe what you expected to happen and why.

I expect that YoastSEO will not require from me additional actions, when I import/export settings.
If line breakers are restricted somewhere - I expect Yoast will restrict their input in form, and fix any such things in database.
Or at least encode multiline data to base64, for keeping INI format requirements. Or use JSON for exporting the settings.

How can we reproduce this behavior?

  1. go to Admin > SEO > Search Appearance > RSS tab and add any line breaks before exporting the zip file (or exporting INI-file as strings)
  2. Export settings
  3. Import them (I used the same site)

Technical info

  • WordPress version: 5.0.2
  • Yoast SEO version: 9.3
  • If relevant, which editor is affected (or editors):
  • [ + ] Classic Editor
  • Gutenberg
  • Classic Editor plugin
  • Which browser is affected (or browsers):
  • [ didn't check ] IE11
  • [ didn't check ] Edge
  • [ + ] Chrome
  • [ didn't check ] Firefox
  • [ didn't check ] Safari
  • Relevant plugins in case of a bug:
  • Tested with theme:
    It doesn't matter. I used Network Admin in WP multisite.
@Pcosta88
Copy link
Contributor

Pcosta88 commented Jan 8, 2019

Steps to Reproduce (expanded and with images)

1.On site A, Go to SEO-Search Appearance-RSS and add some Template Variables on two different lines (have a line break)

screen shot 2019-01-08 at 10 16 49 am

2.On site A site Go to SEO-Tools-Import/Export and copy all the export code (I have highlighted the RSS section)

screen shot 2019-01-08 at 10 18 43 am

3.On site B, copy/paste it into the SEO-Tools-Import/Export section and save. See that

Settings could not be imported: No settings found in file. is shown.

screen shot 2019-01-08 at 10 19 27 am

4.On site B see that nothing was imported into the RSS section

screen shot 2019-01-08 at 10 18 12 am

5.Go back to Site A and put the RSS template variables on same line

screen shot 2019-01-08 at 10 21 06 am

6. On site A site Go to SEO-Tools-Import/Export and copy all the export code (I have highlighted the RSS section)

screen shot 2019-01-08 at 10 21 36 am

7.On site B import it and see that it works

screen shot 2019-01-08 at 10 21 56 am

Tech Specs
WP: 5.0.2
Yoast SEO: 9.4

@Pcosta88
Copy link
Contributor

Pcosta88 commented Jan 8, 2019

@Pcosta88
Copy link
Contributor

Pcosta88 commented Jan 8, 2019

related: #9438

@andizer andizer added bug component: importers Importing data from other plugins. labels Jan 9, 2019
@Djennez Djennez added severity: major Yoast: Management Issues about options and management of the plugin and removed type: bug labels Oct 30, 2019
@Djennez Djennez removed the backlog label Dec 4, 2019
@dromaniuk
Copy link
Author

Any update?

@BrangGit
Copy link

BrangGit commented Sep 6, 2023

The issue still occurs in Yoast 21.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: importers Importing data from other plugins. severity: major Yoast: Management Issues about options and management of the plugin
Projects
None yet
Development

No branches or pull requests

5 participants