PHPackages                             helsingborg-stad/api-alarm-manager - 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. [API Development](/categories/api)
4. /
5. helsingborg-stad/api-alarm-manager

ActiveWordpress-plugin[API Development](/categories/api)

helsingborg-stad/api-alarm-manager
==================================

2.4.1(9mo ago)21.5k1[2 PRs](https://github.com/helsingborg-stad/api-alarm-manager/pulls)MITPHPPHP &gt;=8.2CI passing

Since Mar 22Pushed 9mo ago9 watchersCompare

[ Source](https://github.com/helsingborg-stad/api-alarm-manager)[ Packagist](https://packagist.org/packages/helsingborg-stad/api-alarm-manager)[ RSS](/packages/helsingborg-stad-api-alarm-manager/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (8)Versions (96)Used By (0)

Api Alarm Manager
=================

[](#api-alarm-manager)

Creates WordPress Rest API endpoints for contal alarms and fire danger levels.

Alarms
------

[](#alarms)

Alarms are imported from a remote FTP/SFTP server. The alarms are then stored in the WordPress database and can be fetched from the WordPress Rest API. After the alarms have been imported, they are moved to an archive folder on the remote server. For the alarms to be archived on the remote server, the const `API_ALARM_MANAGER_ARCHIVE_ALARMS_ON_REMOTE` must be set to `true`. Otherwise the alarm files on the remote server will note be altered.

Fire danger levels
------------------

[](#fire-danger-levels)

Fire danger levels are posts that are created in WordPress. The posts are then fetched from the WordPress Rest API.

Constants
---------

[](#constants)

define('API\_ALARM\_MANAGER\_ARCHIVE\_ALARMS\_ON\_REMOTE', true); - REQUIRED to archive alarms on remote server.

Devcontainer
------------

[](#devcontainer)

This project uses a devcontainer for development. This means that you can use VS Code to develop the project. To use the devcontainer, you need to install the [Remote - Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension for VS Code. When you have installed the extension, you can open the project in a container by clicking the green button in the bottom left corner of VS Code and select "Remote-Containers: Reopen in Container".

### Devcontainer ftp/sftp services

[](#devcontainer-ftpsftp-services)

To make it easier to test this plugins functionality on your local machine you can use the ftp/sftp services that are installed in the devcontainer. The services and their credentials are listed in the `./devcontainer/docker-compose.yml` file.

Use the following details to set up a connection to either ftp or sftp from the WordPress admin panel:

#### SFTP

[](#sftp)

- server: sftp
- username: demo
- password: demo
- FTP/SFTP folder: /files
- FTP/SFTP archive folder: /archive

#### FTP

[](#ftp)

- server: ftp
- username: demo
- password: demo
- FTP/SFTP folder: /files
- FTP/SFTP archive folder: /archive

### Devcontainer ftp/sftp test files

[](#devcontainer-ftpsftp-test-files)

A number of files for testing locally are available in the `./devcontainer/remoteFiles`. To prepare or reset test files run the shell script `./.vscode/tasks/reset-dummy-files` from the terminal:

```
sh ./vscode/tasks/reset-dummy-files.sh
```

PHP Tests
---------

[](#php-tests)

Municipio uses [PHPUnit](https://phpunit.de/) for unit testing. For mocking and stubbing we use [WP\_Mock](https://wp-mock.gitbook.io/). This means that you can use WP\_Mock, [Mockery](https://github.com/mockery/mockery)(since this is a wrapper for WP\_Mock) and PHPUnit\_MockObject for mocking and stubbing.

### PHPUnit Tests file structure

[](#phpunit-tests-file-structure)

All tests are stored in the `tests/phpunit/tests` folder. The file structure should mirror the file structure of the theme. The file name should be the same as the file you want to test. For example, if you want to test the file `src/Controller/Base.php` you should create the file `tests/phpunit/tests/Controller/Base.php`. To avoid having too large test files, you can instead create a folder with the same name as the file you want to test and put the test files inside. Please note that for separating files by which class function you are testing, you should name the file e.g. `Base.functionName.php`.

### Running PHPUnit tests

[](#running-phpunit-tests)

Run `composer test` in the terminal.

### Running PHPUnit tests with code coverage

[](#running-phpunit-tests-with-code-coverage)

Run `composer test:coverage` in the terminal. This will generate a code coverage report in the `tests/phpunit/.coverage` folder.

###  Health Score

51

—

FairBetter than 96% of packages

Maintenance58

Moderate activity, may be stable

Popularity20

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity92

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 60.5% 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 ~39 days

Total

79

Last Release

271d ago

Major Versions

0.2.12 → 1.0.02017-05-16

1.3.7 → 2.0.12023-12-14

PHP version history (2 changes)2.0.2PHP &gt;=8.1

2.3.4PHP &gt;=8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/f46fe64973c3e89d15c745c0bf601c25983bafea81d30e64d4bf813a6f8c8c7c?d=identicon)[sebastianthulin](/maintainers/sebastianthulin)

---

Top Contributors

[![Svanmark](https://avatars.githubusercontent.com/u/457482?v=4)](https://github.com/Svanmark "Svanmark (95 commits)")[![thorbrink](https://avatars.githubusercontent.com/u/1064724?v=4)](https://github.com/thorbrink "thorbrink (34 commits)")[![sebastianthulin](https://avatars.githubusercontent.com/u/797129?v=4)](https://github.com/sebastianthulin "sebastianthulin (17 commits)")[![silvergrund](https://avatars.githubusercontent.com/u/4200504?v=4)](https://github.com/silvergrund "silvergrund (9 commits)")[![NiclasNorin](https://avatars.githubusercontent.com/u/103985736?v=4)](https://github.com/NiclasNorin "NiclasNorin (1 commits)")[![petter-a](https://avatars.githubusercontent.com/u/40427478?v=4)](https://github.com/petter-a "petter-a (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/helsingborg-stad-api-alarm-manager/health.svg)

```
[![Health](https://phpackages.com/badges/helsingborg-stad-api-alarm-manager/health.svg)](https://phpackages.com/packages/helsingborg-stad-api-alarm-manager)
```

###  Alternatives

[google/apiclient

Client library for Google APIs

9.8k191.4M997](/packages/google-apiclient)[wheelpros/fitment-platform-api

Magento 2 (Open Source)

12.1k1.2k](/packages/wheelpros-fitment-platform-api)[packbackbooks/lti-1p3-tool

A library used for building IMS-certified LTI 1.3 tool providers in PHP.

51438.3k2](/packages/packbackbooks-lti-1p3-tool)[yoti/yoti-php-sdk

Yoti SDK for quickly integrating your PHP backend with Yoti

27539.9k1](/packages/yoti-yoti-php-sdk)[helsingborg-stad/municipio

A bootstrap theme for creating municipality sites.

4127.7k10](/packages/helsingborg-stad-municipio)[hoels/app-store-server-library-php

The PHP server library for the App Store Server API and App Store Server Notifications.

44162.2k](/packages/hoels-app-store-server-library-php)

PHPackages © 2026

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