Skip to content

Bundle the Patreon button instead of loading it from Patreon's CDN - #212

Merged
avandenberghe merged 1 commit into
develop33from
issue-200-local-patreon-button
Oct 4, 2026
Merged

avandenberghe merged 1 commit into
develop33from
issue-200-local-patreon-button

Conversation

@avandenberghe

Copy link
Copy Markdown
Collaborator

Closes #200.

Problem
The Recent Topics ACP page loaded its "Become a patron" image from https://c5.patreon.com/external/logo/become_a_patron_button.png. Every view of the page made the admin's browser call Patreon, and the button would break if Patreon moved the file.

Fix

  • adm/style/images/become_a_patron_button.png: the same 217×51 PNG (3,086 bytes), now shipped with the extension.
  • acp/recenttopics_module.php: passes U_PATREON_BUTTON ($phpbb_root_path . 'ext/avathar/recenttopics/adm/style/images/become_a_patron_button.png'). In the ACP, $phpbb_root_path is ./../, which resolves from adm/.
  • adm/style/acp_recenttopics.html: <img src="{{ U_PATREON_BUTTON }}">. The link to the Patreon page itself is unchanged.

Tests

  • New tests/acp/acp_template_test.php:
    • the ACP template contains no patreon.com/external URL;
    • the bundled PNG exists.
      Both failed before the change.
  • New functional test test_acp_patreon_button_is_local: the rendered ACP page's button src is the bundled file, and that URL returns 200. CI only.
  • tests/tests.md updated. Unit suite: 71 tests, 0 failures locally, with the harness now loading functions_content.php like CI.

Checked on the local board: with the image copied into the board's extension folder, adm/./../ext/avathar/recenttopics/adm/style/images/become_a_patron_button.png returns 200 image/png (3,086 bytes). The board doesn't block direct access to ext/. The copy was removed afterwards.

No changelog entry or version bump, per this repo's convention. I'll confirm this PR's CI run before calling it ready.

🤖 Generated with Claude Code

The ACP page loaded its "Become a patron" image from
c5.patreon.com, so every view of the page made the admin's browser
call a third party, and the button would break if Patreon moved the
file. Ship the image with the extension and pass its URL to the
template as U_PATREON_BUTTON.

Closes #200

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@avandenberghe
avandenberghe merged commit f2fcab8 into develop33 Oct 4, 2026
27 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ACP page loads Patreon button image from an external URL on every view

1 participant