General refactoring suggestions

Open
#33 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
20/100
Issue type
Refactor
Clarity
Needs clarification
Activity status
Stale
Tech stack
php
Domain
backend

Research direction

Start by reviewing the WXR_Parser* classes and the WP_Import entry point, then separate the listed suggestions into independently scoped changes. Done means an agreed subset of the interface, visibility, property, naming, parser, and WP_Import refactors is implemented without leaving the remaining scope ambiguous.

Written by the indexing model from the issue text.

Description

[Type] Task

In doing #31, I made a note of a few general items that may improve the codebase. In no particular order:

  • Add interface, with parse() that WXR_Parser* classes can implement.
  • Make other properties and methods non-public.
  • Add $has_gzip property to WXR_Parser_Regex.
  • Add ~12 missing properties to WXR_Parser_XML (or to interface).
  • Rename WXR_Parser* classes to use prefix.
  • Refactor // phpcs:ignore in WXR_Parser_Regex (messy code I didn't want/need to touch in #31)
  • Split WP_Import so that it is polymorphic to handle how different versions handle things differently.
Dominant language
PHP
Stars
89
Forks
96
Avg merge
1h 13m
Merged PRs (30d)
2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from WordPress/wordpress-importer

All issues in WordPress/wordpress-importer

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.