{"id":51023101,"url":"https://github.com/lemmon/kirby-plugin-helpful","last_synced_at":"2026-06-21T17:31:00.120Z","repository":{"id":353115379,"uuid":"1124039906","full_name":"lemmon/kirby-plugin-helpful","owner":"lemmon","description":null,"archived":false,"fork":false,"pushed_at":"2026-04-22T13:41:20.000Z","size":29,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-22T15:28:13.248Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lemmon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-12-28T07:32:28.000Z","updated_at":"2026-04-22T13:41:25.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/lemmon/kirby-plugin-helpful","commit_stats":null,"previous_names":["lemmon/kirby-plugin-helpful"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/lemmon/kirby-plugin-helpful","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lemmon%2Fkirby-plugin-helpful","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lemmon%2Fkirby-plugin-helpful/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lemmon%2Fkirby-plugin-helpful/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lemmon%2Fkirby-plugin-helpful/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lemmon","download_url":"https://codeload.github.com/lemmon/kirby-plugin-helpful/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lemmon%2Fkirby-plugin-helpful/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34620358,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-21T02:00:05.568Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2026-06-21T17:30:59.445Z","updated_at":"2026-06-21T17:31:00.114Z","avatar_url":"https://github.com/lemmon.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Helpful Feedback for Kirby\n\nA minimal, privacy-friendly \"Was this page helpful?\" widget for Kirby CMS. Plain HTML POST, no JavaScript required. HTMX progressively enhances if present.\n\n**Intentionally opinionated.** Three config options (`secret`, `storage.dir`, `cache`). Rate limits, dedupe windows, IP anonymization, token TTL, session behavior, log filename, and HTMX attributes are baked in -- if you need to tune them, fork the plugin.\n\n## Installation\n\n```bash\ncomposer require lemmon/kirby-helpful\n# or\ngit submodule add git@github.com:lemmon/kirby-plugin-helpful.git site/plugins/helpful\n```\n\n## Usage\n\n```php\n\u003c?php snippet('helpful') ?\u003e\n```\n\nOverride labels per call when needed:\n\n```php\n\u003c?php snippet('helpful', [\n    'question'     =\u003e 'Was this guide useful?',\n    'confirmation' =\u003e 'Thanks!',\n]) ?\u003e\n```\n\nLabels read from `t('helpful.*')` with English fallbacks. Add translation keys for i18n instead of per-call overrides:\n\n```\nhelpful.question:     Bylo to užitečné?\nhelpful.yes:          Ano\nhelpful.no:           Ne\nhelpful.confirmation: Díky za zpětnou vazbu.\n```\n\nBEM-like classes for styling: `helpful`, `helpful__question`, `helpful__actions`, `helpful__button`, `helpful__confirmation`. No CSS ships with the plugin.\n\n## Storage\n\nEvery valid vote is appended to `{storage-root}/helpful/votes.jsonl` as one JSON object per line. The log is the source of truth; counts are derived on demand:\n\n```php\nuse Lemmon\\Helpful\\Helpful;\n\n$totals = Helpful::counts($page-\u003euuid()-\u003etoString());\n// =\u003e ['yes' =\u003e 42, 'no' =\u003e 3]\n```\n\nVotes are keyed by the full page UUID string (`page://…` from `$page-\u003euuid()-\u003etoString()`), not the filesystem path, so data survives renames. UUIDs are enabled in Kirby by default; if you have turned them off globally, this plugin is not a fit.\n\nEach JSONL line is a small JSON object; new writes use a `page` key. Older `pageId` (path) lines from a previous version are not counted for `Helpful::counts()`.\n\nCounts are cached for 5 minutes; the entry for a page is invalidated after each successful vote.\n\nThe log path resolves in this order:\n\n1. `lemmon.helpful.storage.dir` override -- wins if set.\n2. `{storage-root}/helpful/` if the site registers a `storage` root.\n3. `{site-root}/storage/helpful/` as the zero-config fallback.\n\n### Register a shared `storage` root (recommended)\n\nThe `storage/` directory is intended as a universal, Git-ignored area for runtime-only plugin data. Register it once in `public/index.php`:\n\n```php\n$kirby = new Kirby([\n    'roots' =\u003e [\n        'index'   =\u003e __DIR__,\n        'base'    =\u003e $base = dirname(__DIR__),\n        'site'    =\u003e $base . '/site',\n        'content' =\u003e $base . '/content',\n        'storage' =\u003e $base . '/storage',\n    ],\n]);\n```\n\nThen add `/storage` to `.gitignore`.\n\n## HTMX (optional)\n\nThe form always renders with `hx-post`, `hx-target=\"this\"`, and `hx-swap=\"outerHTML\"` attributes. They are ignored when HTMX is not loaded; when it is, you get partial swaps for free.\n\n## Configuration\n\n```php\nreturn [\n    'lemmon.helpful.secret'      =\u003e null,          // HMAC secret; falls back to Kirby's content token\n    'lemmon.helpful.storage.dir' =\u003e null,          // absolute path override\n    'lemmon.helpful.cache'       =\u003e [\n        'active' =\u003e true,\n        'type'   =\u003e 'file',\n        'prefix' =\u003e 'lemmon/helpful',              // see note below\n    ],\n];\n```\n\nThe `cache` option is the plugin-cache config key Kirby resolves for `kirby()-\u003ecache('lemmon.helpful')` (see `AppCaches::cacheOptionsKey`). The explicit `prefix` bypasses Kirby's default `{indexUrl-slug}/lemmon/helpful` path, so caches stay in one place across CLI and HTTP invocations. Redis/memcached users only need to change `type` + driver options.\n\nTo turn the widget off: remove `snippet('helpful')` from your templates, or disable the whole plugin in `site/config` with `'lemmon/helpful' =\u003e false` (Kirby does not load the plugin, so the route and snippet are both gone). There is no per-plugin `enabled` option -- that would only duplicate what Kirby already gives you.\n\n### Baked-in defaults\n\n| Behavior           | Value                                           |\n| ------------------ | ----------------------------------------------- |\n| Token TTL          | 30 min                                          |\n| Dedupe window      | 24 h (per IP + page)                            |\n| Rate limit (IP)    | 30 votes / 10 min                               |\n| Rate limit (page)  | 3 votes per IP + page / 24 h                    |\n| Counts cache TTL   | 5 min                                           |\n| IPv4 anonymization | /24 (last octet zeroed)                         |\n| IPv6 anonymization | /64 (last 8 bytes zeroed)                       |\n| Session dedupe     | always on, `kirby_session` cookie, long session |\n| Log filename       | `votes.jsonl`                                   |\n| User agent         | not stored                                      |\n\n## Security\n\nSet a strong secret in production:\n\n```php\n'lemmon.helpful.secret' =\u003e bin2hex(random_bytes(32)),\n// or: openssl rand -hex 32\n```\n\nIf the secret leaks, attackers can forge tokens and bypass rate limiting. Load it from env / secret manager; never commit it.\n\n## License\n\nMIT. See `LICENSE`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flemmon%2Fkirby-plugin-helpful","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flemmon%2Fkirby-plugin-helpful","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flemmon%2Fkirby-plugin-helpful/lists"}