{"id":50105795,"url":"https://github.com/polettoespana/carttrigger-bag","last_synced_at":"2026-05-23T10:13:54.336Z","repository":{"id":341209428,"uuid":"1169216698","full_name":"polettoespana/carttrigger-bag","owner":"polettoespana","description":"WooCommerce plugin that extends the native brand taxonomy with three modules: Custom Fields (key–value pairs via shortcode or PHP), Awards    (badges with logo, event and year), and Gallery (responsive grid with PhotoSwipe lightbox). Card-based admin UI, drag \u0026 drop, WPML/Polylang ready.","archived":false,"fork":false,"pushed_at":"2026-04-15T08:46:39.000Z","size":459,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-15T10:35:35.282Z","etag":null,"topics":["brands","custom","fields","gallery","woocommerce","woocommerce-plugin"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/polettoespana.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":"2026-02-28T10:54:04.000Z","updated_at":"2026-04-15T08:46:43.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/polettoespana/carttrigger-bag","commit_stats":null,"previous_names":["polettoespana/carttrigger-bag"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/polettoespana/carttrigger-bag","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polettoespana%2Fcarttrigger-bag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polettoespana%2Fcarttrigger-bag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polettoespana%2Fcarttrigger-bag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polettoespana%2Fcarttrigger-bag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/polettoespana","download_url":"https://codeload.github.com/polettoespana/carttrigger-bag/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polettoespana%2Fcarttrigger-bag/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33391096,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-23T04:15:53.637Z","status":"ssl_error","status_checked_at":"2026-05-23T04:15:53.242Z","response_time":53,"last_error":"SSL_read: 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":["brands","custom","fields","gallery","woocommerce","woocommerce-plugin"],"created_at":"2026-05-23T10:13:51.833Z","updated_at":"2026-05-23T10:13:54.328Z","avatar_url":"https://github.com/polettoespana.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CartTrigger – BAG\n\n\u003cp\u003e\n  \u003cimg src=\"https://img.shields.io/badge/version-2.0.9-0a0a23?style=flat-square\" alt=\"Version 2.0.9\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/WordPress-6.3%2B-3858e9?style=flat-square\u0026logo=wordpress\u0026logoColor=white\" alt=\"WordPress 6.3+\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/WooCommerce-required-96588a?style=flat-square\u0026logo=woocommerce\u0026logoColor=white\" alt=\"WooCommerce required\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/PHP-7.4%2B-777bb4?style=flat-square\u0026logo=php\u0026logoColor=white\" alt=\"PHP 7.4+\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/license-GPLv2-38a169?style=flat-square\" alt=\"GPLv2\"\u003e\n\u003c/p\u003e\n\n**BAG** stands for **Brand · Awards · Gallery**. A WooCommerce plugin that extends the native brand taxonomy with custom fields, award badges, and lifestyle image galleries — all managed from a clean card-based admin UI, with shortcodes and PHP helpers for full frontend flexibility.\n\n## Modules\n\n### Brand · Custom Fields\n\nAttach unlimited key–value pairs to any brand. Output them anywhere via shortcode or PHP helper. CSS classes are fully customisable, including Tailwind arbitrary-value classes (e.g. `text-[11px]`).\n\n### Brand · Awards\n\nManage awards and recognitions per brand — optional logo, award name, event name, and year. Display them as a styled card list.\n\n### Brand · Gallery\n\nUpload a curated image gallery per brand. Display it as a responsive grid with optional native WooCommerce lightbox (PhotoSwipe). Images can be removed individually and reordered by drag \u0026 drop.\n\n## Shortcodes\n\nOn a brand taxonomy page the `brand` attribute is optional — the plugin auto-detects the current term.\n\n### `[ctbag_custom_fields]`\n\n```\n[ctbag_custom_fields\n  brand=\"slug\"\n  wrapper_class=\"grid grid-cols-2 sm:grid-cols-3 gap-x-8 gap-y-4 max-w-2xl\"\n  dt_class=\"font-grotesk text-xs font-semibold uppercase tracking-widest text-blu-800/40 mb-1\"\n  dd_class=\"font-inter text-sm text-blu-900\"\n]\n```\n\n### `[ctbag_awards]`\n\n```\n[ctbag_awards\n  brand=\"slug\"\n  title=\"Awards\"\n  title_class=\"editorial-label block mb-6\"\n  line_class=\"line-deco w-20 mb-10\"\n  wrapper_class=\"flex flex-col divide-y divide-blu-900/8 max-w-2xl\"\n  card_class=\"flex items-start gap-4 py-5\"\n  img_class=\"w-10 h-10 object-contain shrink-0 opacity-70 mt-0.5\"\n  name_class=\"font-grotesk text-sm text-blu-900 leading-snug\"\n  event_class=\"font-inter text-xs text-blu-800/60 mt-1\"\n  year_class=\"font-mono-accent text-xs text-blu-800/40 block mt-1\"\n]\n```\n\n### `[ctbag_gallery]`\n\n```\n[ctbag_gallery\n  brand=\"slug\"\n  title=\"Gallery\"\n  title_class=\"editorial-label block mb-6\"\n  line_class=\"line-deco w-20 mb-10\"\n  wrapper_class=\"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3\"\n  item_class=\"block aspect-square overflow-hidden group\"\n  img_class=\"w-full h-full object-cover transition-transform duration-500 group-hover:scale-105\"\n  size_thumb=\"medium\"\n  size_full=\"large\"\n  lightbox=\"1\"\n]\n```\n\n\u003e **Tip:** use `size_thumb=\"medium\"` (300 px) for multi-column grids instead of the default `medium_large` (768 px) to reduce image weight by 4–6× with no visible quality loss.\n\n## PHP helpers\n\nAll shortcodes are also available as direct PHP functions — recommended when using Tailwind arbitrary-value classes (e.g. `text-[11px]`) that would otherwise be mangled by the WordPress shortcode parser:\n\n```php\necho ctbag_custom_fields([\n    'wrapper_class' =\u003e 'grid grid-cols-2 gap-4',\n    'dt_class'      =\u003e 'text-[10px] uppercase tracking-widest',\n]);\n\necho ctbag_awards([\n    'title'         =\u003e __('Awards', 'your-textdomain'),\n    'wrapper_class' =\u003e 'grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4',\n    'card_class'    =\u003e 'flex flex-col items-center text-center p-5 border aspect-square',\n]);\n\necho ctbag_gallery([\n    'title'      =\u003e __('Gallery', 'your-textdomain'),\n    'size_thumb' =\u003e 'medium',\n    'lightbox'   =\u003e '1',\n]);\n```\n\n## Admin UI\n\n| Module               | Features                                                                               |\n| -------------------- | -------------------------------------------------------------------------------------- |\n| **HTML Description** | TinyMCE editor on both Add and Edit brand screens                                      |\n| **Custom Fields**    | Key–value repeater with drag \u0026 drop reordering via handle icon                         |\n| **Awards**           | Logo upload, event name, year — drag \u0026 drop reordering                                 |\n| **Gallery**          | Multi-image uploader, × button for individual removal on hover, drag \u0026 drop reordering |\n\nAll modules are grouped in collapsible card panels with a built-in shortcode reference.\n\n## Requirements\n\n- WordPress **6.3** or later\n- WooCommerce _(required, 8.0+ recommended)_\n- PHP **7.4** or later\n\nTested with WordPress **6.9** and WooCommerce **10.6.1**.\n\n## Installation\n\n1. Clone this repository or download the ZIP and upload to `/wp-content/plugins/`.\n2. Activate the plugin from **Plugins** in your WordPress admin.\n3. Navigate to **Products → Brands** and edit any brand to start adding content.\n\n## Changelog\n\n### 2.0.9\n\n- Fix: corrected Contributors username in readme.txt to match the WordPress.org plugin owner account (`polettoespana`).\n\n### 2.0.8\n\n- Perf: PhotoSwipe CSS and JS are now enqueued only on brand pages that have a gallery. Brands without a gallery no longer load 4 unnecessary assets (2 CSS + 2 JS).\n\n### 2.0.7\n\n- Fix: gallery images not saved after selection in the media uploader. Root cause: HTML input had `id=\"ctb_gallery\"` while the admin JS targeted `#ctbag_gallery`, so the hidden field was never updated before form submission.\n\n### 2.0.6\n\n- Fix: fatal error on brand save due to mismatched method name after 2.0.5 prefix rename (`ctbag_save_term_meta`).\n- Fix: added one-time migration to move existing term meta from legacy `ctb_*` keys to `ctbag_*` keys.\n\n### 2.0.5\n\n- Compliance: renamed all shortcodes and PHP helper functions from `ctb_*` to `ctbag_*` to meet the WordPress.org 5-character prefix requirement.\n- Compliance: extracted inline gallery lightbox JavaScript to an external file loaded via `wp_enqueue_script()`.\n\n### 2.0.4\n\n- Gallery: individual image removal with an × button on hover, without reopening the media uploader.\n- Gallery: drag \u0026 drop reordering of thumbnails (jQuery UI Sortable).\n- Custom Fields: drag \u0026 drop reordering via a handle icon.\n- Awards: drag \u0026 drop reordering via a handle icon.\n\n### 2.0.3\n\n- Fix: double-quote characters in award names, event names, and custom field values were corrupted on save. Awards and custom fields are now stored as native PHP arrays via `maybe_serialize()`.\n- Fix: accented characters (é, à, ó…) in award/field text were silently dropped on some server configurations. Replaced `sanitize_text_field()` with `wp_strip_all_tags()`.\n\n### 2.0.0\n\n- Complete rewrite with professional admin UI (module cards).\n- HTML Description module with TinyMCE editor on Add and Edit brand screens.\n- Native WooCommerce lightbox (PhotoSwipe) support for gallery shortcode.\n- Plugin fully internationalised — translations for Italian (it_IT) and Spanish (es_ES).\n\n[GPLv2 or later](https://www.gnu.org/licenses/gpl-2.0.html) — developed by [Poletto 1976 S.L.U.](https://poletto.es)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolettoespana%2Fcarttrigger-bag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpolettoespana%2Fcarttrigger-bag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolettoespana%2Fcarttrigger-bag/lists"}