Skip to content

Split import revamp from import/export branch#4244

Merged
johngodley merged 6 commits into
trunkfrom
update/import-revamp
Jul 4, 2026
Merged

Split import revamp from import/export branch#4244
johngodley merged 6 commits into
trunkfrom
update/import-revamp

Conversation

@johngodley

@johngodley johngodley commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Split branch from #4243 to make it smaller and more reviewable.

The matching export PR is to follow in #4245

Between the two PRs this changes how import/export works:

  • PHP code is moved to a new directory with autoloading
  • Import/export is split into import and export sections
  • Export now supports exporting by groups, as well as unifying the export of logs into one interface
  • Export data can be combined into a single JSON file, and can include settings, groups
  • Export previews show estimated and actual sizes
  • Exports can also be triggered from bulk action menus on redirect, 404, and log pages for finer control
  • Export of grouped log pages is possible
  • Import page is updated to match exports
  • Copy/paste of redirects is possible

Copilot AI review requested due to automatic review settings July 4, 2026 08:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR splits out the “import” side of the import/export revamp into a smaller, reviewable set of changes. It introduces new Import/Export PHP infrastructure (autoloaded under Redirection\ImportExport) and a new Import UI flow (file / paste / plugin importers), plus supporting parsers/sanitizers and tests.

Changes:

  • Add new import/export PHP module (repositories, import runner, format handlers, parsers, sanitizers, plugin importers) and wire it via an Import/Export autoloader.
  • Introduce a new Import page UI (paste/file/plugin sources, options, preview/results, API error rendering) and expand API request helpers/types.
  • Add unit/integration tests and fixtures covering CSV/JSON parsing/sanitization and import behaviors.

Reviewed changes

Copilot reviewed 85 out of 85 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/unit/test-json-parser.php Unit tests for JSON parser
tests/unit/test-import-redirect.php Unit tests for dedupe/save flow
tests/unit/test-import-group.php Unit tests for group resolution
tests/unit/test-csv-sanitizer.php Unit tests for CSV sanitization
tests/unit/test-csv-parser.php Unit tests for CSV row parsing
tests/unit/stubs/functions.php WP stub helpers for unit tests
tests/unit/stubs/functions-http.php HTTP-related WP stubs
tests/unit/stubs/class-test-import-group-item.php Group stub for imports
tests/unit/stubs/class-red-item.php Redirect item stub
tests/unit/stubs/class-red-group.php Group stub
tests/integration/import-export/test-import-csv.php Integration tests for CSV import
tests/integration/import-export/fixtures/semicolon.csv CSV fixture
tests/integration/import-export/fixtures/multiline-ending.csv CSV fixture (multiline endings)
tests/integration/core/test-settings.php Integration test for portable options
tests/api-test.php Update API test capability handling
src/types/schemas/io.ts Extend IO schema types
src/page/import/types.ts Import page state/types
src/page/import/paste-importer.tsx Paste source importer card
src/page/import/index.tsx Import page composition
src/page/import/import-results.tsx Import/preview results UI
src/page/import/import-results.test.tsx Tests for results UI
src/page/import/import-options.tsx Import options (group/dupes/sections)
src/page/home/index.tsx Menu/title update for Import
src/page/export/download.ts Download/copy helpers for export
src/lib/api/errors.ts Preserve richer API error fields
src/lib/api-request/index.ts Add import/export endpoints/options
src/component/welcome-wizard/step-importing.tsx Wizard import execution step
src/component/import-export/importer.tsx Plugin importer UI card
src/component/import-export/importer.test.tsx Tests for importer card
src/component/import-export/import-sniff.test.ts Tests for sniffing pasted/file content
src/component/import-export/card.tsx Shared IO card component
src/component/import-export/api-error.tsx Import/export API error renderer
redirection.php Register Import/Export autoloader
models/options.php Add portable import/export options filter
models/group.php Add export representation for groups
includes/import-export/sanitizer/class-htaccess-sanitizer.php Sanitize .htaccess rule parts
includes/import-export/sanitizer/class-csv-sanitizer.php CSV formula-injection protection
includes/import-export/parser/class-json-parser.php JSON import parser
includes/import-export/parser/class-csv-parser.php CSV row parser for redirects
includes/import-export/importer/class-wordpress-old-slugs.php Importer: WordPress old slugs
includes/import-export/importer/class-slim-seo.php Importer: Slim SEO
includes/import-export/importer/class-simple301.php Importer: Simple 301 Redirects
includes/import-export/importer/class-seopress.php Importer: SEOPress
includes/import-export/importer/class-seo-redirection.php Importer: SEO Redirection
includes/import-export/importer/class-safe-redirect-manager.php Importer: Safe Redirect Manager
includes/import-export/importer/class-redirect-item-mapper.php Map external plugin data to redirects
includes/import-export/importer/class-rank-math.php Importer: RankMath
includes/import-export/importer/class-quick-redirects.php Importer: Quick Page/Post Redirects
includes/import-export/importer/class-pretty-links.php Importer: Pretty Links
includes/import-export/importer/class-plugin.php Base importer implementation
includes/import-export/importer/class-plugin-registry.php Registry + preview/import dispatch
includes/import-export/importer/class-fake-redirection.php Importer: Fake Redirection
includes/import-export/importer/class-eps301-redirects.php Importer: 301 Redirects
includes/import-export/format/class-rss.php RSS format handler
includes/import-export/format/class-nginx.php Nginx format handler
includes/import-export/format/class-csv.php CSV format handler
includes/import-export/format/class-apache.php Apache/.htaccess format handler
includes/import-export/class-redirect-repository.php Redirect persistence/lookup wrapper
includes/import-export/class-redirect-duplicate-matcher.php Duplicate matching logic
includes/import-export/class-import-service.php File import orchestrator
includes/import-export/class-import-redirect.php Import save + preview counters
includes/import-export/class-import-preview-group.php Dry-run group representation
includes/import-export/class-import-group.php Import group resolver/creator
includes/import-export/class-htaccess.php .htaccess exporter wrapper
includes/import-export/class-htaccess-target-builder.php Build htaccess targets/flags
includes/import-export/class-htaccess-rule-builder.php Build htaccess rules
includes/import-export/class-htaccess-encoder.php Encode/sanitize htaccess content
includes/import-export/class-group-repository.php Group lookup/export wrapper
includes/import-export/class-format-handler.php Base format contract/types
includes/import-export/class-format-factory.php Format handler factory
includes/import-export/class-file-reader.php File read/open helper
includes/import-export/class-export-details.php Shared export metadata

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/component/welcome-wizard/step-importing.tsx
Comment thread src/page/import/index.tsx Outdated
Comment thread includes/import-export/importer/class-simple301.php
Comment thread includes/import-export/importer/class-rank-math.php Outdated
Comment thread includes/import-export/parser/class-json-parser.php

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 87 out of 88 changed files in this pull request and generated 4 comments.

Comment thread includes/import-export/class-redirect-duplicate-matcher.php
Comment thread includes/import-export/parser/class-csv-parser.php
Comment thread includes/import-export/class-import-redirect.php
Comment thread includes/import-export/format/class-json.php

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 87 out of 88 changed files in this pull request and generated 1 comment.

Comment thread redirection.php
Keep CoPilot happy

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 87 out of 88 changed files in this pull request and generated 2 comments.

Comment thread includes/import-export/format/class-rss.php
Comment thread src/page/export/download.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 89 out of 90 changed files in this pull request and generated 1 comment.

Comment on lines 3 to 8
on:
pull_request:
branches:
- trunk
- main
push:
branches:
- trunk
- main

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Repo is using trunk, not main

@johngodley johngodley merged commit e82784b into trunk Jul 4, 2026
9 checks passed
@johngodley johngodley deleted the update/import-revamp branch July 4, 2026 11:39
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.

2 participants