Guide

Development

Building, testing and finding your way around the source tree. The toolchain is Go 1.26.6 and GNU Make; every task below has a Make target so CI and a laptop run the same command.

Setup and build

Prerequisites

  • Go 1.26.6 or later (the version go.mod declares; earlier 1.26 patches carry the standard-library advisories this tool is exposed to)
  • Make

Setup

 1# Clone the repository
 2git clone https://github.com/tradik/wpexporter.git
 3cd wpexporter
 4
 5# Install dependencies
 6make deps
 7
 8# Install development tools
 9make dev-install
10
11# Run in development mode
12make dev

Building

1# Build for current platform
2make build
3
4# Build release binaries for all platforms
5make release

Testing

 1# Run tests
 2make test
 3
 4# Run linter
 5make lint
 6
 7# Run the security scanner
 8make sec
 9
10# Format code
11make format
12
13# Everything CI runs: vet, lint, gosec, tests
14make check

make sec builds gosec from the tools/ module rather than expecting it on PATH, so it is the same binary — and the same exclusion list — the pipeline uses. Nothing to install; the first run compiles it into build/.

Project structure

wpexporter/
├── cmd/
│   ├── wpexporter/          # umbrella command — export, xmlrpc, mcp
│   ├── wpexportjson/        # REST API exporter
│   ├── wpxmlrpc/            # XML-RPC exporter
│   └── wpmcp/               # MCP server
├── internal/
│   ├── api/                 # WordPress REST client
│   ├── xmlrpc/              # XML-RPC client
│   ├── mcp/                 # MCP protocol server
│   ├── bruteforce/          # ID enumeration for unlisted content
│   ├── cli/                 # command wiring shared by the binaries
│   ├── config/              # configuration, CLI and file
│   ├── export/              # one exporter per output format
│   ├── media/               # media download and URL rewriting
│   ├── seo/                 # assisted crawl and metadata extraction
│   ├── flathtml/            # HTML to Markdown conversion
│   ├── basichtml/           # HTML reduction for store importers
│   ├── filter/              # content filters (paths, types)
│   ├── cache/               # HTTP response cache
│   ├── checkpoint/          # resume state
│   └── version/             # build stamp
├── pkg/
│   └── models/              # data models, the only exported package
├── docs/                    # the guides, published at wpexporter.tradik.com
├── templates/ssgtheme/      # the documentation site's theme
├── man/                     # man pages
├── tools/                   # separate module: gosec, pinned by tools/go.sum
├── Makefile                 # build automation
├── go.mod                   # Go module definition
└── README.md                # project overview