Reindex Extension
Trigger reindexing of a specific WordPress plugin, theme, or core version.
Usage
/reindex plugins akismet- Reindex the Akismet plugin/reindex themes flavor- Reindex the flavor theme/reindex cores 6.7.1- Reindex WordPress core 6.7.1
Steps
- Parse arguments
$REPO: Repository type (plugins,themes, orcores)$SLUG: Extension slug (or version for cores)- Both are required
- Ensure binary is current
```bash
go install ./...
```
- Check if the server is running
```bash
curl -s http://localhost:8585/up 2>&1
```
- If server is running, trigger reindex via API:
```bash
curl -s -X POST "http://localhost:8585/api/reindex/$REPO/$SLUG" 2>&1
```
- If server is not running, use the index CLI directly:
- First, determine the zip URL for the extension
- Then run:
```bash
veloria index --repo=$REPO --slug=$SLUG --zipurl="$ZIP_URL" 2>&1
```
- Report results
```
## Reindex Results
- Extension: $REPO/$SLUG
- Method: API / CLI
- Status: success / failed
- Details: [output from command]
```
CLI vs API
| Method | When | Notes |
|--------|------|-------|
| API (/api/reindex) | Server running | Handles zip URL lookup, DB update, and hot-swap |
| CLI (veloria index) | Server not running | Requires explicit --zipurl, no DB update |
The API method is preferred as it handles the full pipeline including database updates and live index hot-swap.