Skip to content

Include custom post type archives in static exports - #12

Merged
batuhan merged 1 commit into
mainfrom
batuhan/include-cpt-archives
Aug 7, 2026
Merged

Include custom post type archives in static exports#12
batuhan merged 1 commit into
mainfrom
batuhan/include-cpt-archives

Conversation

@batuhan

@batuhan batuhan commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • include public custom post type archive URLs in Simply Static exports
  • respect configured Simply Static post type selections
  • release as plugin 0.5.7

Verification

  • ./bin/test.sh
  • ./bin/test-wordpress.sh

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Summary by CodeRabbit

  • New Features

    • Simply Static exports now include archive pages for eligible public custom content types.
    • Archive inclusion respects configured content-type selections and avoids duplicate URLs.
  • Bug Fixes

    • Improved completeness of static exports by capturing applicable custom archive routes.
  • Tests

    • Added coverage for archive discovery, filtering, configured selections, and duplicate handling.
  • Chores

    • Updated the plugin version to 0.5.7.
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a4191809-2d66-42cd-96d3-08da12504189

📥 Commits

Reviewing files that changed from the base of the PR and between 5f8e029 and 3642af9.

📒 Files selected for processing (5)
  • includes/class-spacefast-plugin.php
  • readme.txt
  • spacefast-wordpress.php
  • tests/acceptance/wordpress.php
  • tests/behavior.php

📝 Walkthrough

Walkthrough

The plugin now adds eligible public custom post-type archive URLs to Simply Static exports. It excludes attachments, unavailable archives, and unselected post types. The release version is updated to 0.5.7 with matching tests and changelog entries.

Changes

Static archive export

Layer / File(s) Summary
Archive URL collection
includes/class-spacefast-plugin.php, tests/behavior.php
The plugin filters Simply Static URLs and adds deduplicated archives for eligible public post types. Tests cover public and private post types and configured selections.
Release version update
spacefast-wordpress.php, readme.txt, tests/acceptance/wordpress.php
Plugin metadata, runtime version, stable tag, changelog, and acceptance assertions now use version 0.5.7.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant SimplyStatic
  participant SpacefastPlugin
  participant WordPressPostTypes
  SimplyStatic->>SpacefastPlugin: apply ss_additional_urls
  SpacefastPlugin->>WordPressPostTypes: get public post types
  WordPressPostTypes-->>SpacefastPlugin: post-type objects and names
  SpacefastPlugin->>WordPressPostTypes: get archive links
  WordPressPostTypes-->>SpacefastPlugin: archive URLs or false
  SpacefastPlugin-->>SimplyStatic: original and deduplicated archive URLs
Loading

Possibly related PRs

  • spacefast/wordpress#5: Introduces the Simply Static setup extended here with custom post-type archive URLs.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: including custom post type archive URLs in static exports.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch batuhan/include-cpt-archives

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@batuhan
batuhan merged commit 9c67a66 into main Aug 7, 2026
5 checks passed
@batuhan
batuhan deleted the batuhan/include-cpt-archives branch August 7, 2026 22:35

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3642af9468

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

? $options['post_types']
: array();
$configured = ! empty( $options['post_types_configured'] ) || array() !== $selected;
$post_types = get_post_types( array( 'public' => true ), 'objects' );

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Filter archives by front-end viewability

When a post type is registered with public => false, publicly_queryable => true, and has_archive => true, WordPress can expose a working front-end archive, but this query omits it because it checks only public. Conversely, a type can be public while explicitly not publicly queryable and will be added even though its archive route is not viewable. Determine eligibility using the post type's front-end viewability so valid archive links are exported without queueing inaccessible routes.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant