2017 © Pedro Peláez
 

wordpress-plugin api-alarm-manager

image

helsingborg-stad/api-alarm-manager

  • Monday, May 14, 2018
  • by sebastianthulin
  • Repository
  • 5 Watchers
  • 0 Stars
  • 22 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 43 Versions
  • 0 % Grown

The README.md

Api Alarm Manager

Creates WordPress Rest API endpoints for contal alarms and fire danger levels., (*1)

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., (*2)

Fire danger levels

Fire danger levels are posts that are created in WordPress. The posts are then fetched from the WordPress Rest API., (*3)

Constants

define('API_ALARM_MANAGER_ARCHIVE_ALARMS_ON_REMOTE', true); - REQUIRED to archive alarms on remote server., (*4)

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 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"., (*5)

Devcontainer ftp/sftp 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., (*6)

Use the following details to set up a connection to either ftp or sftp from the WordPress admin panel:, (*7)

SFTP

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

FTP

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

Devcontainer ftp/sftp 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:, (*8)

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

PHP Tests

Municipio uses PHPUnit for unit testing. For mocking and stubbing we use WP_Mock. This means that you can use WP_Mock, Mockery(since this is a wrapper for WP_Mock) and PHPUnit_MockObject for mocking and stubbing., (*9)

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., (*10)

Running PHPUnit tests

Run composer test in the terminal., (*11)

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., (*12)

The Versions

14/05 2018

dev-master

9999999-dev

  Sources   Download

MIT

The Requires

 

by Kristoffer Svanmark

14/05 2018

1.1.15

1.1.15.0

  Sources   Download

MIT

The Requires

 

by Kristoffer Svanmark

14/05 2018

1.1.14

1.1.14.0

  Sources   Download

MIT

The Requires

 

by Kristoffer Svanmark

11/05 2018

1.1.13

1.1.13.0

  Sources   Download

MIT

The Requires

 

by Kristoffer Svanmark

11/05 2018

1.1.12

1.1.12.0

  Sources   Download

MIT

The Requires

 

by Kristoffer Svanmark

11/05 2018

1.1.11

1.1.11.0

  Sources   Download

MIT

The Requires

 

by Kristoffer Svanmark

29/03 2018

dev-develop

dev-develop

  Sources   Download

MIT

The Requires

 

by Kristoffer Svanmark

29/03 2018

1.1.10

1.1.10.0

  Sources   Download

MIT

The Requires

 

by Kristoffer Svanmark

29/03 2018

1.1.9

1.1.9.0

  Sources   Download

MIT

The Requires

 

by Kristoffer Svanmark

28/03 2018

1.1.8

1.1.8.0

  Sources   Download

MIT

The Requires

 

by Kristoffer Svanmark

28/03 2018

1.1.7

1.1.7.0

  Sources   Download

MIT

The Requires

 

by Kristoffer Svanmark

28/03 2018

1.1.6

1.1.6.0

  Sources   Download

MIT

The Requires

 

by Kristoffer Svanmark

28/03 2018

1.1.5

1.1.5.0

  Sources   Download

MIT

The Requires

 

by Kristoffer Svanmark

28/03 2018

1.1.4

1.1.4.0

  Sources   Download

MIT

The Requires

 

by Kristoffer Svanmark

28/03 2018

1.1.3

1.1.3.0

  Sources   Download

MIT

The Requires

 

by Kristoffer Svanmark

28/03 2018

1.1.1

1.1.1.0

  Sources   Download

MIT

The Requires

 

by Kristoffer Svanmark

22/05 2017

1.1.0

1.1.0.0

  Sources   Download

MIT

The Requires

 

by Kristoffer Svanmark

22/05 2017

1.1.2

1.1.2.0

  Sources   Download

MIT

The Requires

 

by Kristoffer Svanmark

16/05 2017

1.0.3

1.0.3.0

  Sources   Download

MIT

The Requires

 

by Kristoffer Svanmark

16/05 2017

1.0.2

1.0.2.0

  Sources   Download

MIT

The Requires

 

by Kristoffer Svanmark

16/05 2017
16/05 2017
16/05 2017
16/05 2017
11/05 2017
11/05 2017
11/05 2017
11/05 2017

0.2.7

0.2.7.0

  Sources   Download

MIT

The Requires

 

by Kristoffer Svanmark

11/05 2017

0.2.6

0.2.6.0

  Sources   Download

MIT

The Requires

 

by Kristoffer Svanmark

03/05 2017

0.2.5

0.2.5.0

  Sources   Download

MIT

The Requires

 

by Kristoffer Svanmark

25/04 2017
29/03 2017
29/03 2017
29/03 2017
23/03 2017
23/03 2017
23/03 2017
23/03 2017
23/03 2017
23/03 2017
23/03 2017
23/03 2017