Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions projects/packages/monitor/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Files to include in the mirror repo, but excluded via gitignore
# Remember to end all directories with `/**` to properly tag every file.
# /src/js/example.min.js production-include

# Files to exclude from the mirror repo, but included in the monorepo.
# (see also entries in the monorepo root .gitattributes)
# Remember to end all directories with `/**` to properly tag every file.
#
# Source files compiled during build (uncomment as needed):
# src/**/*.ts production-exclude
# src/**/*.tsx production-exclude
# src/**/*.jsx production-exclude
# src/**/*.scss production-exclude
#
# wp-build stuff compiled during build (uncomment as needed):
# packages/** production-exclude
# routes/** production-exclude
# widgets/** production-exclude
2 changes: 2 additions & 0 deletions projects/packages/monitor/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
vendor/
node_modules/
13 changes: 13 additions & 0 deletions projects/packages/monitor/.phan/config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php
/**
* This configuration will be read and overlaid on top of the
* default configuration. Command-line arguments will be applied
* after this file is read.
*
* @package automattic/jetpack-monitor
*/

// Require base config.
require __DIR__ . '/../../../../.phan/config.base.php';

return make_phan_config( dirname( __DIR__ ) );
24 changes: 24 additions & 0 deletions projects/packages/monitor/.phpcs.dir.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0"?>
<ruleset>

<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array">
<element value="jetpack-monitor" />
</property>
</properties>
</rule>
<rule ref="Jetpack.Functions.I18n">
<properties>
<property name="text_domain" value="jetpack-monitor" />
</properties>
</rule>

<rule ref="WordPress.Utils.I18nTextDomainFixer">
<properties>
<property name="old_text_domain" type="array" />
<property name="new_text_domain" value="jetpack-monitor" />
</properties>
</rule>

</ruleset>
7 changes: 7 additions & 0 deletions projects/packages/monitor/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

18 changes: 18 additions & 0 deletions projects/packages/monitor/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# monitor

Downtime monitoring for Jetpack-connected sites. WordPress.com checks a site every five minutes while its `monitor` module is on; this package keeps each user's email alerts in step with WordPress.com.

Call `\Automattic\Jetpack\Monitor\Monitor::init()` early. It makes `monitor` a module a standalone plugin can switch on, subscribes whoever turns it on to the alerts, and forgets saved choices when a user unlinks or the site disconnects.

## Using this package in your WordPress plugin

If you plan on using this package in your WordPress plugin, we would recommend that you use [Jetpack Autoloader](https://packagist.org/packages/automattic/jetpack-autoloader) as your autoloader. This will allow for maximum interoperability with other plugins that use this package as well.

## Security

Need to report a security vulnerability? Go to [https://automattic.com/security/](https://automattic.com/security/) or directly to our security bug bounty site [https://hackerone.com/automattic](https://hackerone.com/automattic).

## License

monitor is licensed under [GNU General Public License v2 (or later)](./LICENSE.txt)

Empty file.
4 changes: 4 additions & 0 deletions projects/packages/monitor/changelog/initial-version
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: added

Initial version.
64 changes: 64 additions & 0 deletions projects/packages/monitor/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"name": "automattic/jetpack-monitor",
"description": "Downtime monitoring for connected sites: the module's email alerts and status from WordPress.com.",
"type": "jetpack-library",
"license": "GPL-2.0-or-later",
"require": {
"php": ">=7.4",
"automattic/jetpack-connection": "@dev"
},
"require-dev": {
"yoast/phpunit-polyfills": "^4.0.0",
"automattic/jetpack-test-environment": "@dev",
"automattic/phpunit-select-config": "@dev"
},
"autoload": {
"classmap": [
"src/"
]
},
"autoload-dev": {
"psr-4": {
"Automattic\\Jetpack\\Monitor\\": "tests/php"
}
},
"scripts": {
"phpunit": [
"phpunit-select-config phpunit.#.xml.dist --colors=always"
],
"test-php": [
"@composer phpunit"
],
"test-php-coverage": [
"php -dpcov.directory=. ./vendor/bin/phpunit-select-config phpunit.#.xml.dist --coverage-php \"$COVERAGE_DIR/php.cov\""
]
},
"repositories": [
{
"type": "path",
"url": "../../packages/*",
"options": {
"monorepo": true
}
}
],
"minimum-stability": "dev",
"prefer-stable": true,
"extra": {
"autotagger": true,
"branch-alias": {
"dev-trunk": "0.1.x-dev"
},
"changelogger": {
"link-template": "https://github.com/Automattic/jetpack-monitor/compare/v${old}...v${new}"
},
"mirror-repo": "Automattic/jetpack-monitor",
"textdomain": "jetpack-monitor",
"version-constants": {
"::PACKAGE_VERSION": "src/class-monitor.php"
}
},
"suggest": {
"automattic/jetpack-autoloader": "Allow for better interoperability with other plugins that use this package."
}
}
24 changes: 24 additions & 0 deletions projects/packages/monitor/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "@automattic/jetpack-monitor",
"version": "0.1.0-alpha",
"private": true,
"description": "Downtime monitoring for connected sites: the module's email alerts and status from WordPress.com.",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/packages/monitor/#readme",
"bugs": {
"url": "https://github.com/Automattic/jetpack/labels/[Package] Monitor"
},
"repository": {
"type": "git",
"url": "https://github.com/Automattic/jetpack.git",
"directory": "projects/packages/monitor"
},
"license": "GPL-2.0-or-later",
"author": "Automattic",
"scripts": {
"build": "echo 'Not implemented.'",
"build-js": "echo 'Not implemented.'",
"build-production": "echo 'Not implemented.'",
"build-production-js": "echo 'Not implemented.'",
"clean": "true"
}
}
36 changes: 36 additions & 0 deletions projects/packages/monitor/phpunit.11.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="tests/php/bootstrap.php"
cacheDirectory=".phpunit.cache"
colors="true"
executionOrder="depends"
beStrictAboutOutputDuringTests="true"
displayDetailsOnPhpunitDeprecations="true"
displayDetailsOnTestsThatTriggerDeprecations="true"
displayDetailsOnTestsThatTriggerErrors="true"
displayDetailsOnTestsThatTriggerNotices="true"
displayDetailsOnTestsThatTriggerWarnings="true"
failOnDeprecation="true"
failOnEmptyTestSuite="true"
failOnPhpunitDeprecation="true"
failOnNotice="true"
failOnRisky="true"
failOnWarning="true"
>
<testsuites>
<testsuite name="main">
<directory suffix="Test.php">tests/php</directory>
</testsuite>
</testsuites>

<source>
<include>
<!-- Better to only include "src" than to add "." and then exclude "tests", "vendor", and so on, as PHPUnit still scans the excluded directories. -->
<!-- Add additional lines for any files or directories outside of src/ that need coverage. -->
<directory suffix=".php">src</directory>
</include>
</source>
<coverage ignoreDeprecatedCodeUnits="true">
</coverage>
</phpunit>
1 change: 1 addition & 0 deletions projects/packages/monitor/phpunit.12.xml.dist
17 changes: 17 additions & 0 deletions projects/packages/monitor/phpunit.9.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.6/phpunit.xsd"
bootstrap="tests/php/bootstrap.php"
cacheResultFile=".phpunit.cache/test-results"
colors="true"
executionOrder="depends"
beStrictAboutOutputDuringTests="true"
failOnRisky="true"
failOnWarning="true"
>
<testsuites>
<testsuite name="main">
<directory suffix="Test.php">tests/php</directory>
</testsuite>
</testsuites>
</phpunit>
Loading
Loading