{"id":41715068,"url":"https://github.com/barning/2025child","last_synced_at":"2026-01-24T22:10:38.517Z","repository":{"id":310724476,"uuid":"1037357249","full_name":"barning/2025child","owner":"barning","description":"My personal child theme for twentytwentyfive","archived":false,"fork":false,"pushed_at":"2026-01-24T10:48:04.000Z","size":704,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-24T19:18:47.392Z","etag":null,"topics":["wordpress","wordpress-child-theme","wordpress-theme"],"latest_commit_sha":null,"homepage":"https://niklasbarning.de","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/barning.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-13T13:00:41.000Z","updated_at":"2026-01-09T21:13:57.000Z","dependencies_parsed_at":"2025-10-24T18:25:53.547Z","dependency_job_id":"f2208bb3-9df0-4336-b9ab-55ca3b5debeb","html_url":"https://github.com/barning/2025child","commit_stats":null,"previous_names":["barning/2025child"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/barning/2025child","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barning%2F2025child","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barning%2F2025child/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barning%2F2025child/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barning%2F2025child/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/barning","download_url":"https://codeload.github.com/barning/2025child/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barning%2F2025child/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28738065,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T21:19:41.845Z","status":"ssl_error","status_checked_at":"2026-01-24T21:13:38.675Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["wordpress","wordpress-child-theme","wordpress-theme"],"created_at":"2026-01-24T22:10:38.040Z","updated_at":"2026-01-24T22:10:38.509Z","avatar_url":"https://github.com/barning.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TwentyTwentyFive Child Theme — Overview\n\nThis child theme extends a block-based parent theme with a set of small, maintainable theme modules and custom Gutenberg blocks. It replaces certain plugin functionality with lightweight, theme-integrated code.\n\n## Summary\n\n- Child stylesheet is enqueued from `functions.php`.\n- Modular structure: PHP modules live in `inc/` and are autoloaded.\n- Block source is in `blocks/`; compiled assets live in `build/`.\n\n## Included Blocks \u0026 Modules\n\n- **Book Rating**\n\t- Location: `inc/book-rating.php`\n\t- Registration: `build/book-rating` (block assets) and server-side renderer at `blocks/book-rating/render.php`.\n\t- Purpose: Display a book card (cover, title, author). Rendering is done server-side in PHP.\n\n- **Media Recommendation (Film/Serie)**\n\t- Location: `inc/media-recommendation.php`\n\t- Registration: `build/media-recommendation` (block assets) and server-side renderer at `blocks/media-recommendation/render.php`.\n\t- Purpose: Display movies and TV shows with poster images and titles. Searches both movies and TV shows via TMDB API with server-side AJAX endpoint for security.\n\t- Features: Ambilight-style gradient effect that adapts to poster colors, responsive design matching book-rating block.\n\t- Setup: Requires TMDB API key configuration (see `MEDIA_RECOMMENDATION_SETUP.md`).\n\n- **Videogame Recommendation**\n\t- Location: `inc/videogame-recommendation.php`\n\t- Registration: `build/videogame-recommendation` (block assets) and server-side renderer at `blocks/videogame-recommendation/render.php`.\n\t- Purpose: Display video games with cover images and titles. Searches games via RAWG API with server-side AJAX endpoint for security.\n\t- Features: Ambilight-style gradient effect that adapts to cover colors, responsive design matching media-recommendation block.\n\t- Setup: Requires RAWG API key (free from [rawg.io/apidocs](https://rawg.io/apidocs)). Configure via WordPress Admin → Settings → Videogame Recommendation or define `RAWG_API_KEY` in `wp-config.php`.\n\n- **Magic Cards**\n\t- Location: `inc/magic-cards.php`\n\t- Registration: `build/magic-cards` (block assets) and server-side renderer at `blocks/magic-cards/render.php`.\n\t- Purpose: Display Magic: The Gathering cards (single cards from Scryfall/Gatherer or Moxfield deck embeds). Features card lookup with alternative print selection and lazy loading for images and iframes.\n\n- **Popular Posts**\n\t- Location: `inc/popular-posts.php`\n\t- Purpose: Provides a Gutenberg block to render a curated list of posts selected by editors.\n\n- **Visual Link Preview**\n\t- Location: `inc/visual-link-preview.php` (block) and `inc/visual-link-preview-async.php` (background fetch)\n\t- Behavior: Fetches metadata (OG/Twitter) using `wp_safe_remote_get()`, parses HTML with `DOMDocument`/`DOMXPath`, normalizes image URLs, and caches results in a transient (`child_vlp_\u003cmd5(url)\u003e`) for approximately 24 hours.\n\n- **Head/Footer Injections (Fediverse)**\n\t- Location: `inc/head-footer-injections.php`\n\t- Purpose: Adds a Customizer setting `fediverse_creator_handle` and outputs the `\u003cmeta name=\"fediverse:creator\"\u003e` tag in the page head when set.\n\n## Files \u0026 Folders (quick)\n\n- `blocks/` — block source (editor scripts, `block.json`, `render.php` where server-side rendering is required)\n- `build/` — compiled, shipped block assets (JS/CSS)\n- `inc/` — PHP modules registering blocks, render callbacks and helpers\n- `functions.php` — bootstraps the theme (loads `inc/*.php`, enqueues child stylesheet)\n\n## Development \u0026 Build\n\nPrerequisites (recommended): Node.js, npm\n\nFrom the theme root run:\n\n```bash\nnpm install\nnpm run build\n```\n\nTo create a distributable package:\n\n```bash\nnpm run dist\n```\n\nNote: After changes to `blocks/` always run `npm run build` to update the `build/` assets — the theme registers assets from that folder.\n\n## Automated Builds \u0026 Releases\n\nThe repository uses GitHub Actions to automatically build and release the theme:\n\n- **Pull Request Merged to main**: Triggers a build and uploads artifacts to the workflow run.\n- **Tag Pushed (v*)**: Triggers a build and automatically creates a GitHub release with the theme zip file attached.\n- **Release Published**: When a GitHub release is manually created/published, automatically builds and uploads the theme zip to that release.\n- **Manual Workflow Dispatch**: Can be triggered manually from the Actions tab.\n\nThe automated workflow ensures the `dist/twentytwentyfive-child.zip` file is always available for releases without needing to commit build artifacts to the repository.\n\n## Developer Notes\n\n- Styles: Each module registers `style-index.css` as a block style and also enqueues it globally as a frontend fallback when present.\n- Popular Posts: The block renders a curated list chosen by editors.\n- Visual Link Preview: Background fetch endpoint is `admin_post_child_vlp_fetch` (also available via `admin_post_nopriv_child_vlp_fetch`) and is responsible for fetch/parse/cache.\n\n## Performance Optimizations\n\nThe theme includes several performance optimizations to minimize filesystem I/O operations:\n\n- **Cached Module Loading**: `functions.php` caches the result of `glob()` when loading modules from `inc/` to avoid repeated filesystem scans on every page load.\n- **Static CSS Caching**: All block modules (book-rating, popular-posts, media-recommendation, visual-link-preview) use static variables to cache CSS file existence and modification time checks, reducing redundant `file_exists()` and `filemtime()` calls.\n- **Clean Code**: Removed unreachable dead code from the Visual Link Preview render callback to improve code maintainability and execution efficiency.\n\nThese optimizations are transparent to users and require no configuration.\n\n## Quick FAQ\n\n- Where do I set the Fediverse meta tag? → Customizer → \"Fediverse Author\" (setting `fediverse_creator_handle`).\n- Where are server-side renderers? → `blocks/\u003cblock\u003e/render.php` and the corresponding `inc/*.php` registration files.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarning%2F2025child","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbarning%2F2025child","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarning%2F2025child/lists"}