PHPackages                             lemmon/kirby-gitstats - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. lemmon/kirby-gitstats

ActiveKirby-plugin[Utility &amp; Helpers](/categories/utility)

lemmon/kirby-gitstats
=====================

Converts Kirby text fields into GitHub stats, giving you stars, forks and issue counts with a simple field method.

v0.1.0(6mo ago)06MITPHP

Since Nov 19Pushed 5mo agoCompare

[ Source](https://github.com/lemmon/kirby-plugin-gitstats)[ Packagist](https://packagist.org/packages/lemmon/kirby-gitstats)[ RSS](/packages/lemmon-kirby-gitstats/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

Git Stats for Kirby
===================

[](#git-stats-for-kirby)

Single-method helper for Kirby that exposes GitHub stats through any text field. Provide `owner/repo` or a full URL to receive stars, forks, watchers, open issues and other metadata, cached efficiently for repeated use.

Installation
------------

[](#installation)

### Composer

[](#composer)

```
composer require lemmon/kirby-gitstats
```

### Git Submodule

[](#git-submodule)

```
git submodule add https://github.com/lemmon/kirby-plugin-gitstats.git site/plugins/gitstats
```

### Manual

[](#manual)

[Download the plugin](https://api.github.com/repos/lemmon/kirby-plugin-gitstats/zipball) and extract it to `/site/plugins/gitstats`.

Usage
-----

[](#usage)

Add a text field to your blueprint and call the field method to fetch stats:

```
fields:
    repository:
        label: Repository
        type: text
        placeholder: lemmon/validator-php
```

```

    Stars
    Forks
    Watchers
    Open issues
    URL

```

Accepted field values:

- GitHub shorthand: `lemmon/validator-php`
- Full URL: `https://github.com/lemmon/validator-php`

The first release defaults to GitHub. Other providers may follow later.

Returned fields
---------------

[](#returned-fields)

Each successful call returns an associative array similar to:

```
[
  'provider' => 'github',
  'slug' => 'lemmon/validator-php',
  'owner' => 'lemmon',
  'name' => 'validator-php',
  'full_name' => 'lemmon/validator-php',
  'description' => 'Lightweight validator',
  'url' => 'https://github.com/lemmon/validator-php',
  'homepage' => null,
  'stars' => 123,
  'forks' => 4,
  'watchers' => 8,
  'open_issues' => 2,
  'language' => 'PHP',
  'default_branch' => 'main',
  'updated_at' => '2024-05-01T17:42:08Z',
]
```

Null is returned when the value cannot be parsed or the repository is not reachable.

Configuration
-------------

[](#configuration)

OptionDefaultPurpose`lemmon.gitstats.cacheTtlLower``1440` (24h)Preferred refresh interval in minutes; cached data newer than this is returned without refresh.`lemmon.gitstats.cacheTtlUpper``10080` (7d)Hard cache lifetime in minutes; entries older than this are refreshed and persisted again.`lemmon.gitstats.cacheRetryDelay``60` (1h)Retry/backoff window in minutes used when GitHub refresh fails; cached data is reused until it passes.Example Kirby config override:

```
return [
  'lemmon.gitstats.cacheTtlLower' => 1440,  // refresh roughly daily
  'lemmon.gitstats.cacheTtlUpper' => 20160, // keep entries up to 14 days
  'lemmon.gitstats.cacheRetryDelay' => 30,  // backoff for 30 minutes after a failed refresh
];
```

### Retry and provider backoff

[](#retry-and-provider-backoff)

- When cached data is older than `cacheTtlLower`, a refresh is attempted.
- If GitHub responds or times out with an error, the plugin reuses cached data, sets `next_refresh_at` for that repository, and marks GitHub as temporarily down for `cacheRetryDelay` minutes.
- While GitHub is marked down, other repositories served from cache skip refresh attempts; they resume after the backoff window.

Roadmap
-------

[](#roadmap)

- Add support for other common Git providers (GitLab, Bitbucket, Gitea).
- Introduce a CLI helper to refresh cached stats in the background.
- When refresh attempts fail after `cacheTtlLower` is met, reuse cached data and delay the next refresh (e.g., 1h or the next `cacheTtlLower` window).

License
-------

[](#license)

MIT License. See `LICENSE` for details.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance70

Regular maintenance activity

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity25

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

180d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/69d2fc0d66f2e8e99490f3781a67d2af0d6ca9cb3e48db4a6199336344d4310c?d=identicon)[lemmon](/maintainers/lemmon)

---

Top Contributors

[![lemmon](https://avatars.githubusercontent.com/u/251591?v=4)](https://github.com/lemmon "lemmon (2 commits)")

---

Tags

gitgithubgitstatskirbykirby-cmskirby-fieldkirby-pluginrepositorygithubgitrepositorykirbykirby-pluginkirby-cmsgitstatskirby-field

### Embed Badge

![Health badge](/badges/lemmon-kirby-gitstats/health.svg)

```
[![Health](https://phpackages.com/badges/lemmon-kirby-gitstats/health.svg)](https://phpackages.com/packages/lemmon-kirby-gitstats)
```

###  Alternatives

[belugadigital/kirby-navigation

Kirby 5 field for hierarchical menus with drag &amp; drop level indentation.

8713.4k](/packages/belugadigital-kirby-navigation)[bnomei/kirby3-dotenv

Kirby Plugin for environment variables from .env

4144.1k1](/packages/bnomei-kirby3-dotenv)[bnomei/kirby3-recently-modified

Kirby Section to display recently modified content pages

309.3k](/packages/bnomei-kirby3-recently-modified)[moritzebeling/kirby-favicon

Kirby plugin to meet all favicon needs

144.8k](/packages/moritzebeling-kirby-favicon)[tobimori/kirby-tailwind-merge

Tailwind Merge for Kirby CMS

276.3k](/packages/tobimori-kirby-tailwind-merge)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
