Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Data Liberation] Refactor Entity Readers class diagram #2096

Open
wants to merge 10 commits into
base: trunk
Choose a base branch
from

Conversation

adamziel
Copy link
Collaborator

@adamziel adamziel commented Dec 17, 2024

Sets the stage for the EPub importer. A part of #2080

Refactors and clean up the Data Liberation package. This includes renaming, reorganizing file paths, improving class structure, and removing deprecated/unused code.

Key Changes

Refactor:

Cleanup:

  • Deleted unused and redundant byte reader classes (WP_Byte_Reader, WP_File_Reader, etc.).
  • Removed legacy files such as WXR_Import_Info.

New Additions:

  • Added WP_Directory_Tree_Entity_Reader to improve handling of directory tree imports.
  • Introduced WP_Import_HTML_Processor for better HTML import functionality.

Testing instructions

Confirm the CI tests passed

Adds a basic WP_HTML_To_Blocks class that accepts HTML and outputs block markup.

It only considers the markup and won't consider any visual changes introduced via CSS or JavaScript.

A part of #1894

 ## Example

```html
$html = <<<HTML
<meta name="post_title" content="My first post">
<p>Hello <b>world</b>!</p>
HTML;

$converter = new WP_HTML_To_Blocks( $html );
$converter->convert();

var_dump( $converter->get_all_metadata() );
/*
 * array( 'post_title' => array( 'My first post' ) )
 */

var_dump( $converter->get_block_markup() );
/*
 * <!-- wp:paragraph -->
 * <p>Hello <b>world</b>!</p>
 * <!-- /wp:paragraph -->
 */
```

 ## Testing instructions

This PR mostly adds new code. Just confirm the unit tests pass in CI.
@adamziel adamziel marked this pull request as draft December 17, 2024 13:53
@adamziel adamziel marked this pull request as ready for review December 17, 2024 13:56
@adamziel adamziel self-assigned this Dec 17, 2024
Base automatically changed from html-importer to trunk December 19, 2024 13:00
@adamziel adamziel requested a review from a team as a code owner December 19, 2024 13:00
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
Status: Needs review
Development

Successfully merging this pull request may close these issues.

1 participant