PHPackages                             ndlano/h5p-caretaker - 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. ndlano/h5p-caretaker

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ndlano/h5p-caretaker
====================

Library that is supposed to help people take care of H5P content types

1.1.1(6mo ago)01001MITPHPPHP &gt;=8

Since Feb 19Pushed 6mo ago2 watchersCompare

[ Source](https://github.com/NDLANO/h5p-caretaker)[ Packagist](https://packagist.org/packages/ndlano/h5p-caretaker)[ RSS](/packages/ndlano-h5p-caretaker/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)DependenciesVersions (10)Used By (0)

H5P Caretaker
=============

[](#h5p-caretaker)

The H5P Caretaker is a library that is supposed to help people take care of H5P content types. It expects an H5P content files as input and will return a JSON object that contains structured information about issues that may hinder sharing the content, e.g. missing alternative texts for images, missing or incompatible license information of subcontent, etc.

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

[](#installation)

This library is not meant to be used standalone. The common use case is to use it as a dependency for your own application, e.g. inside a plugin of some kind or as a standalone application.

In fact, there is a [reference H5P Caretaker client](https://github.com/ndlano/h5p-caretaker-client)which displays the results found by this library and a PHP based [reference H5P Caretaker server](https://github.com/ndlano/h5p-caretaker-server) that glues this library to the client.

Using the library
-----------------

[](#using-the-library)

In your own project, you can use common `composer` practices to use this library. Inside your `composer.json` file, you should add an entry like this:

```
"require": {
    "ndlano/h5p-caretaker": "^1.1.0"
}

```

and then run `composer update` or run `composer require ndlano/h5p-caretaker` that should do the same.

The common use case then is to fetch an H5P content file (.h5p), pass it to the library and then to further process the results.

Your own project either uses the common `autoload` procedure itself, meaning that the library will be loaded as a depencency automatically. Alternatively, you'll have to run something like

```
require_once __DIR__ . '/vendor/autoload.php';
use Ndlano\H5PCaretaker\H5PCaretaker;

```

You many need to adjust the path, of course, depending on where your PHP code lives at.

### Instantiating

[](#instantiating)

You can then instantiate an H5PCaretaker instance via something like.

```
$h5pCaretaker = new H5PCaretaker($config);

```

`$config` is expected to be an associative array like this:

**Property****Type****Description****Required**localeStringISO 639 Set 1 language code, representing the requested language for the reporting data. *Default: en*OptionaluploadsPathStringPath to where the H5P content files may be unpacked to temporarily. *Default: `uploads` inside the h5p-caretaker folder (must be writable by server)*OptionalcachePathStringPath to where external reports that are fetched from the web can be cached. *Default: `cache` inside the h5p-caretaker folder (must be writable by server)*OptionalcacheTimeoutIntDefine how long (in seconds) external ressources (e.g. Libretext accessibility data) will be cached. \_Default: `86400` (24 hours)OptionalAfter instantiating, you can use certain methods

### analyze($params: array) =&gt; array

[](#analyzeparams-array--array)

Use analyze to retrieve the report.

$params is expected to be an associative array that at least contains the file path to the H5P content that is supposed to be analyzed.

**Property****Type****Description****Required**fileStringFile path to H5P content file that should be analyzed.RequiredMore properties may become available in the future in order to tweak the analysis.

The return value is going to be a JSON object represented in an associative array. Please refer to the [report properties documentation](docs/report-properties.md) for details.

### write($changes: array) =&gt; array

[](#writechanges-array--array)

Use to receive a modified version of the file

**Property****Type****Description****Required**fileStringFile path to H5P content file that should be modified.RequiredchangesarrayArray of change objectsRequiredA change object represents a change that should be performed on the H5P file parameters: in h5p.json or content.json and potentially in the content folder. The object will look like:

**Property****Type****Description****Required**uuidStringUnique identifier for the changeRequiredsemanticsPathStringPath to field in semantics where change is due. Starts with `root` for changes to the main content metadataRequiredfilePathStringRelative path to file inside `content`. Needs to be set when files are supposed to be changed.OptionalvalueStringValut that the semantics field should be set to or command for file changes.RequiredCurrently, these commands for file changes are available:

- *scale-down height|width pixels*: Scale down an image to a height/width of `pixels (number)` while preserving the aspect ratio and the file type.
- *convert jpeg/png/gif/bmp*: Convert an image to the respective image file type.

Contribution
------------

[](#contribution)

If you think that some feature of the H5P content should be checked, please raise an issue in order to discuss it. Please note though that this library does not render the content, but merely assesses the parmeters, media and libraries that are found on the server. Therefore, it is e.g. not possible to detect contrast issues impeding accessibility, etc.

If you want to contribute code, you are welcome. Please also raise an issue beforehand to talk about your ideas. Please see the [coding information documentation](docs/coding-information.md) for technical details.

If you want to contribute translation, you will find easily understandable translation files in `app/lang`.

Future Development
------------------

[](#future-development)

There are some ideas on what this library should be able to do in the future:

- Allow to use large language models to fill in missing data, e.g. set missing alternative texts for images.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance66

Regular maintenance activity

Popularity10

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 99.4% 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

Every ~34 days

Recently: every ~56 days

Total

8

Last Release

204d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/40d335f55bc5365ef7691f97568fe114e29dffb9581b9a635139330ccc6cd2bc?d=identicon)[otacke](/maintainers/otacke)

![](https://www.gravatar.com/avatar/39da21ebb19b82351d7cb85bc36df660053eb68e5d408b634603b5a7a0ece587?d=identicon)[ndla\_explore](/maintainers/ndla_explore)

---

Top Contributors

[![otacke](https://avatars.githubusercontent.com/u/16688047?v=4)](https://github.com/otacke "otacke (171 commits)")[![Hipjea](https://avatars.githubusercontent.com/u/7727752?v=4)](https://github.com/Hipjea "Hipjea (1 commits)")

---

Tags

h5p

### Embed Badge

![Health badge](/badges/ndlano-h5p-caretaker/health.svg)

```
[![Health](https://phpackages.com/badges/ndlano-h5p-caretaker/health.svg)](https://phpackages.com/packages/ndlano-h5p-caretaker)
```

###  Alternatives

[pixelant/pxa-survey

Create simple survey. View results in the BE module

197.2k](/packages/pixelant-pxa-survey)

PHPackages © 2026

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