Skip to content

major redesign and feature addition.#3

Open
techtherapy wants to merge 29 commits intocodician-team:mainfrom
techtherapy:main
Open

major redesign and feature addition.#3
techtherapy wants to merge 29 commits intocodician-team:mainfrom
techtherapy:main

Conversation

@techtherapy
Copy link
Copy Markdown

WP Puller v2.0 — Multi-Asset Management

What's New

Manage unlimited themes and plugins from GitHub — all from one screen.

WP Puller v2.0 is a ground-up rewrite. The old single-asset tabbed interface is gone, replaced by a card-based dashboard that lets you manage as many GitHub-connected themes and plugins as you need.

Thanks to https://github.com/codician-team for building the original version!


Multi-Asset Support

  • Add unlimited themes and plugins, each with its own GitHub repo, branch, and settings
  • Each asset gets its own card showing name, version, commit, and connection status
  • Automatic migration from v1.x — your existing configuration carries over

Card-Based Admin Interface

  • Asset cards in a responsive grid, each showing live status at a glance: version, current commit SHA, last check time, and connection state
  • Slide-out panels for Settings, Branches, and Backups — one click from each card's footer icons
  • Bulk actions in the header: Check All for Updates, Update All
  • Confirmation modals for destructive actions (restore, delete, deploy, remove)
  • Notice bar with auto-dismiss for success/error/warning feedback

Shared Token Management

  • Store multiple GitHub Personal Access Tokens in a shared, encrypted vault
  • Reuse the same token across multiple assets — no need to paste it again
  • Supports both fine-grained (github_pat_) and classic (ghp_) tokens
  • AES-256-CBC encryption at rest using WordPress security salts
  • Orphaned tokens auto-cleaned when the last asset using them is removed

Branch Management

  • Branches panel shows the 20 most recently active branches, sorted by commit date
  • Fetches all branches (up to 1000 via GraphQL, 500 via REST) then sorts by recency — no more alphabetical guessing
  • Deploy any branch for testing — backup created automatically before switching
  • Use for Updates — promote a tested branch to be the configured updates branch
  • Compare any branch against the deployed/configured branch: see commits ahead/behind, files changed with additions and deletions
  • Configured branch shows a green "updates" badge; deployed branch highlighted in the table

Webhook-Based Auto-Updates

  • Single global webhook endpoint (/wp-json/wp-puller/v1/webhook) handles all assets
  • GitHub push events are matched to configured assets by repo URL and branch
  • HMAC-SHA256 signature verification with timing-safe comparison
  • Per-asset auto-update toggle — enable or disable webhook-triggered updates individually
  • Webhook panel accessible from the header with payload URL, secret, copy buttons, and step-by-step GitHub setup instructions
  • One-click secret regeneration

Backup System

  • Automatic backup before every update (manual or webhook)
  • Per-asset backup retention: 1–10 backups (configurable)
  • One-click restore from the Backups panel
  • Backup list shows name, creation date, file size, and detected version from asset headers
  • Manual delete with confirmation

Activity Log

  • Last 20 events displayed with status indicator, timestamp, and source
  • Logs show asset name and semantic version (e.g., "MyTheme updated successfully to 2.1.0")
  • Events logged: updates (success/failure), backups created, restores, webhook events, signature failures
  • Clear all logs with one click

Update Checking

  • Per-asset Check for Updates — shows current vs. latest version, commit SHAs, and update availability
  • Detects version from asset headers (style.css for themes, main PHP file for plugins)
  • Check All runs across every configured asset and displays results inline on each card

Theme & Plugin Support

  • Themes: validates style.css with Theme Name header, detects active theme
  • Plugins: scans PHP files for Plugin Name header, checks active status
  • Subdirectory support: set a path within the repo if the asset lives in a subfolder
  • Archive validation before install — helpful error messages if structure is wrong

Security

  • All AJAX endpoints protected by WordPress nonces and manage_options capability checks
  • Webhook signatures verified with HMAC-SHA256
  • Tokens encrypted at rest, decrypted only on demand
  • File operations use WordPress Filesystem API
  • Backup directory protected with .htaccess

Requirements

  • WordPress 5.0+
  • PHP 7.4+ with OpenSSL
  • Writable /wp-content/ directory
  • GitHub PAT for private repositories (public repos work without one)

Upgrade Notes

  • From v1.x: Activate the updated plugin — your single-asset configuration will be automatically migrated to the new multi-asset format. No manual steps required.
  • Webhook URL unchanged: If you already have a GitHub webhook configured, it will continue working.
  • Token re-encryption: Your existing PAT will be migrated into the new encrypted token vault.

claude and others added 29 commits February 27, 2026 22:06
Replace the branch text input with a select dropdown that fetches
available branches from the connected GitHub repository. Branches
can be loaded via a "Fetch Branches" button or automatically after
a successful connection test. The dropdown sorts the default branch
first and marks it with a "(default)" label.

https://claude.ai/code/session_01SZMpnFAk9wjPLb6CrWjGVb
- Branch Quick-Switch: New admin panel to list all branches with commit
  info, deploy any branch with one click, track deployed vs configured
  branch separately
- Branch Comparison: Compare any branch against the deployed branch
  showing commits, files changed, additions/deletions via GitHub API
- Plugin Support: New asset_type setting (theme/plugin) allowing
  deployment of WordPress plugins from GitHub repos with proper
  validation of Plugin Name headers
- New class-plugin-updater.php for plugin-specific update logic
- Extended GitHub API with compare_commits(), get_branches_with_info(),
  and get_tags() methods
- Extended backup system with create_plugin_backup() and
  restore_plugin_backup()
- Updated webhook handler to route to correct updater based on
  asset_type
- Version bumped to 1.1.0

https://claude.ai/code/session_018EhQmunL5BHeURwsQuqG36
Move commit detail fetching into get_branches_with_info() and sort
branches by commit date descending, returning only the top 10. This
fixes branch loading issues by reducing API calls and ensuring the
most relevant branches are shown first.

https://claude.ai/code/session_018EhQmunL5BHeURwsQuqG36
The settings "Fetch Branches" dropdown was still loading all branches
via get_branches(), while only the Branch Testing table had been fixed.
Now ajax_fetch_branches() reuses get_branches_with_info() with limit=10
so both UIs consistently show only the 10 most recent branches.

Bumps version to 1.1.1.

https://claude.ai/code/session_018EhQmunL5BHeURwsQuqG36
The JS fetchBranches() was re-sorting branches alphabetically after
receiving them from the backend, overriding the most-recent-first
order. Changed the sort to only pin the default branch to the top
while preserving the backend's recency order for the rest.

Bumps version to 1.1.2.

https://claude.ai/code/session_018EhQmunL5BHeURwsQuqG36
The REST API approach made N+1 individual API calls (one per branch
to get commit dates), which was prone to rate limiting. When those
calls failed, all timestamps were 0 and branches stayed alphabetical.

Now uses GitHub's GraphQL API to fetch branches with commit info in
a single API call, sorted by commit date. Falls back to REST if no
PAT is configured. Also clears cache in ajax_fetch_branches() and
preserves backend recency order in JS dropdown.

Bumps version to 1.1.3.

https://claude.ai/code/session_018EhQmunL5BHeURwsQuqG36
Remove the select dropdown and Fetch Branches button for the branch
setting. Users now type the branch name directly (e.g. main, develop).
This eliminates the problematic branch-fetching API calls that were
returning alphabetical instead of recent branches.

Removed: fetchBranches JS function, ajax_fetch_branches PHP handler,
Fetch Branches button, get_branches() API method, and related
localized strings.

Bumps version to 1.1.4.

https://claude.ai/code/session_018EhQmunL5BHeURwsQuqG36
The admin template always reads $status['theme_path'] for the path
input field, but the plugin updater's get_status() didn't include
this key, causing a PHP undefined index error when asset type is
set to plugin.

Bumps version to 1.1.5.

https://claude.ai/code/session_018EhQmunL5BHeURwsQuqG36
After saving settings via AJAX, the page never reloaded, so the
server-rendered "Not Configured" badge and disabled action buttons
persisted even though settings were saved correctly. This caused
the UI to appear stuck in an unconfigured state until a manual
page refresh.

Now reloads the page after a successful save, matching the behavior
already used by the update and deploy handlers.

https://claude.ai/code/session_018EhQmunL5BHeURwsQuqG36
Major refactor to allow managing both a theme AND a plugin deployment
at the same time, each with independent configuration:

- Add Theme/Plugin tab navigation to the admin page
- Each tab has its own status card, settings form, branch testing,
  and backups section
- Plugin updater now uses separate wp_puller_plugin_* option keys
  (repo_url, branch, path, auto_update, latest_commit, etc.) so
  it no longer conflicts with theme settings
- All AJAX handlers accept asset_type parameter to route to the
  correct updater instead of reading from a global option
- Webhook handler checks incoming pushes against both theme and
  plugin repo configurations, updating whichever matches
- After updating/deploying, version number and commit are updated
  live in the UI without requiring a page reload
- Save settings now returns updated status so the UI refreshes
  the status badge, version, and commit immediately
- Shared sections (webhook, activity log) remain below the tabs
- PAT is shared across both tabs (single GitHub token)
- Version bump to 1.2.0

https://claude.ai/code/session_018EhQmunL5BHeURwsQuqG36
Add get_raw_file method to GitHub API to fetch individual files from
the repo via raw.githubusercontent.com. Use it in both updaters'
check_for_updates to read the Version header from the repo's
style.css (themes) or {slug}.php (plugins).

The update check panel now shows:
- "Installed: 1.0.0 -> New: 1.1.0" when versions differ
- Version info alongside commit SHAs
- Current version when already up to date

https://claude.ai/code/session_018EhQmunL5BHeURwsQuqG36
…-aMpVQ

Tabbed UI, Branch Comparison, GraphQL Fetching & Webhook Routing
- Persist the active tab (Theme/Plugin) to localStorage so it is
  restored on the next page load
- Display the backed-up theme/plugin version number in both the
  Theme Backups and Plugin Backups lists by reading the file headers
  from the backup directory
- Bump plugin version from 1.2.0 to 1.3.0

https://claude.ai/code/session_01HvvCiLpsKF4jH1GRggRw5C
…rage

The localStorage approach was unreliable in some WordPress admin
environments. This switches to persisting the active tab via WordPress
user meta (wp_puller_active_tab):

- Server-side: PHP template reads user meta to render the correct
  active tab on page load (no JS flash/override needed)
- Client-side: tab switch fires a lightweight AJAX call to save the
  preference per-user
- Cleans up user meta on plugin uninstall

https://claude.ai/code/session_01HvvCiLpsKF4jH1GRggRw5C
Support managing multiple themes and plugins simultaneously with a
redesigned single-page admin interface:

- New unified WP_Puller_Asset_Updater replacing separate theme/plugin
  updaters, with type-specific helpers for validation and deployment
- Shared token storage (wp_puller_tokens) allowing PAT reuse across
  assets, with dropdown selection in settings
- Card grid layout showing all managed items with status, version,
  commit info, and per-item settings/branches/backups panels
- Per-asset GitHub API authentication via constructor PAT parameter
- Webhook handler iterates all assets to match pushed repo/branch
- Data migration from v1.3.0 flat options to v2.0.0 structured format
- Backup class updated for explicit theme slugs and per-asset counts
- Bulk actions: Check All for Updates, Update All
- Confirmation modals for destructive actions
- Updated uninstall.php for new option names

https://claude.ai/code/session_01HvvCiLpsKF4jH1GRggRw5C
- Rewrite admin.js with cleaner standalone functions, doAjax helper,
  and proper use of template's existing modal HTML
- Fix selectors to match template DOM: .wp-puller-open-panel with
  data-panel attr, .wp-puller-remove-item, input[name=token_mode]
  radio buttons, .wp-puller-token-select, .wp-puller-new-token-fields
- Add CSS selectors for notice-success/error/warning classes used by JS
- Add missing .wp-puller-card-active, .wp-puller-card-processing,
  .wp-puller-btn-loading, and .no-update/.has-update result styles
- Remove duplicate CSS rules

https://claude.ai/code/session_01HvvCiLpsKF4jH1GRggRw5C
1. Webhook settings per-asset: Moved from global section to per-asset
   panel with webhook icon in each card footer. Same URL/secret shown
   in context of the selected asset.

2. Activity log shows asset name and version: Logger now receives
   asset_label in meta from all updater calls. Template displays asset
   name (bold) and version badge in each log entry's meta line.

3. Branches panel improvements:
   - Renamed from "Branch Testing" to "Branches"
   - Shows branches sorted by recent activity with relative time column
   - "Use for Updates" button sets a branch as the configured updates
     branch (new wp_puller_set_updates_branch AJAX endpoint)
   - Configured branch shows green "updates" badge instead of plain
     "configured" text
   - Author shown inline under commit message to save space

https://claude.ai/code/session_01HvvCiLpsKF4jH1GRggRw5C
Webhook:
- Remove per-asset webhook icons from card footers
- Add global "Webhook" button in header actions area
- Webhook panel is now standalone (not tied to per-asset panel system)
- Close webhook panel when opening a per-asset panel and vice versa

Branch sorting (fixes unreliable ordering in large repos):
- GraphQL: Remove TAG_COMMIT_DATE ordering (only works for tags, not
  branches per GitHub docs). Instead fetch ALL branches paginated
  (100/page, up to 1000), add committedDate field, sort by date in PHP
- REST fallback: Paginate through all branches (100/page, up to 500),
  fetch commit details for up to 200, sort by timestamp in PHP
- Both paths: sorting and slicing now happens in get_branches_with_info
  rather than in each fetcher
- Configured and deployed branches are always included in results even
  if not in the top N by recency
- Increase default display limit from 10 to 20

https://claude.ai/code/session_01HvvCiLpsKF4jH1GRggRw5C
- Hide compare button on the base branch (deployed/configured) since
  self-comparison is meaningless; use deployed branch as compare base
- Log the actual semantic version from asset headers (style.css/plugin PHP)
  instead of the commit SHA, falling back to short_sha when unavailable

https://claude.ai/code/session_01HvvCiLpsKF4jH1GRggRw5C
Add align-items: start to the card grid so cards size independently
instead of stretching to match the tallest card in the same row.

https://claude.ai/code/session_01HvvCiLpsKF4jH1GRggRw5C
Revamped README for WP Puller v2.0, detailing new features, multi-asset support, and installation instructions.
see release notes
- Add repo link to each asset card showing the GitHub repository path
- Fix update button overlapping card edge by allowing flex-wrap and equal sizing
- Show version (installed vs available) and commit time when checking for updates
- Register plugin as top-level admin menu item instead of under Tools

https://claude.ai/code/session_013i3zDSMeMcbK3JM1AYdtBf
Enhance asset cards and fix admin menu visibility (v2.2.0)
Replace "WP Puller is open source. Star on GitHub" with linked
attribution: techtherapy/wp-puller is a fork of codician-team/wp-puller.

https://claude.ai/code/session_013i3zDSMeMcbK3JM1AYdtBf
- Replace hardcoded "Add New" button with a dropdown that lets users
  choose between Plugin and Theme when adding a new asset
- Create CLAUDE.md with project conventions: version bumping with every
  commit and including an updated wp-puller.zip build artifact
- Bump version to 2.3.0
- Include wp-puller.zip installable archive

https://claude.ai/code/session_013i3zDSMeMcbK3JM1AYdtBf
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.

2 participants