PHPackages                             ricardofiorani/php-cloudflare-amp-validator - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. ricardofiorani/php-cloudflare-amp-validator

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

ricardofiorani/php-cloudflare-amp-validator
===========================================

A PHP wrapper for Cloudflare AMP validator

v1.0(7y ago)5141[2 PRs](https://github.com/ricardofiorani/php-cloudflare-amp-validator/pulls)MITPHPPHP &gt;=7.1

Since Sep 12Pushed 5y agoCompare

[ Source](https://github.com/ricardofiorani/php-cloudflare-amp-validator)[ Packagist](https://packagist.org/packages/ricardofiorani/php-cloudflare-amp-validator)[ RSS](/packages/ricardofiorani-php-cloudflare-amp-validator/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)Dependencies (6)Versions (4)Used By (0)

NOT WORKING ANYMORE / FEATURE DISABLED BY CLOUDFLARE
====================================================

[](#not-working-anymore--feature-disabled-by-cloudflare)

As Cloudflare announced on , their AMP validator is no longer available.

Well, it was nice while it lasted :)

PHP Cloudflare AMP Validator
============================

[](#php-cloudflare-amp-validator)

[![Build Status](https://camo.githubusercontent.com/f7b9631333d644e39f5564fafa6fea1ffbe3a1f24d722647d178b7c140af879a/68747470733a2f2f6170692e7472617669732d63692e6f72672f7269636172646f66696f72616e692f7068702d636c6f7564666c6172652d616d702d76616c696461746f722e7376673f6272616e63683d6d6173746572)](http://travis-ci.org/ricardofiorani/php-cloudflare-amp-validator)[![Minimum PHP Version](https://camo.githubusercontent.com/f8809bf59af11bfbf7ad0f6056b2a2ed4734a4c8f412a6a6dbfc4e781ce6f973/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7269636172646f66696f72616e692f7068702d636c6f7564666c6172652d616d702d76616c696461746f722e737667)](https://php.net/)[![License](https://camo.githubusercontent.com/f83e979e94caa886ecf82ae06fb1c3d7a4f429574867b3bdf07598de67d81146/68747470733a2f2f706f7365722e707567782e6f72672f7269636172646f66696f72616e692f7068702d636c6f7564666c6172652d616d702d76616c696461746f722f6c6963656e73652e706e67)](https://packagist.org/packages/ricardofiorani/php-cloudflare-amp-validator)[![Total Downloads](https://camo.githubusercontent.com/688c20f56e8c1fa13c3f411531e8fe188eefbcfb1733feca1f764fdf260cbf8b/68747470733a2f2f706f7365722e707567782e6f72672f7269636172646f66696f72616e692f7068702d636c6f7564666c6172652d616d702d76616c696461746f722f642f746f74616c2e706e67)](https://packagist.org/packages/ricardofiorani/php-cloudflare-amp-validator)[![Coding Standards](https://camo.githubusercontent.com/bbde1fa96ef88cc4935dac2851741d5045ad4e348558501bc1031ca96926c7ef/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f63732d5053522d2d342d79656c6c6f772e737667)](https://github.com/php-fig-rectified/fig-rectified-standards)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/ee0fdb6570a7a10b0b93a79ba52838d534500fb50255a62534e9fe6af55e0e64/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7269636172646f66696f72616e692f7068702d636c6f7564666c6172652d616d702d76616c696461746f722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/ricardofiorani/php-cloudflare-amp-validator/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/c50ebdecb10dfe926281d22ee9064f978da7cbe7a5d678172d965afeea0b21c1/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7269636172646f66696f72616e692f7068702d636c6f7564666c6172652d616d702d76616c696461746f722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/ricardofiorani/php-cloudflare-amp-validator/?branch=master)

PHP Cloudflare AMP Validator is a PHP Library that wraps the [Cloudflare AMP validation API](https://blog.cloudflare.com/amp-validator-api/).

Requirements
------------

[](#requirements)

- PHP &gt;=7.1
- A PSR-18 HttpClient

Install
-------

[](#install)

Via Composer

```
$ composer require ricardofiorani/php-cloudflare-amp-validator
```

Usage
-----

[](#usage)

```
use \RicardoFiorani\Validator\Validator;

$httpClient = new \Your\Psr18\HttpClient();
$requestFactory = new \Your\PSR-17\RequestFactoryInterface;
$validator = new Validator($httpClient, $requestFactory);
//or you can use the default request factory by ignoring the second parameter
$validator = new Validator($httpClient);
var_dump($validator->validateUrl('https://amp.mywebsite.com')->isValid());

$content = $yourHtmlRenderer->render();
var_dump($validator->validateContent($content)->isValid());
```

Testing
-------

[](#testing)

```
$ composer test
```

Credits
-------

[](#credits)

- [Ricardo Fiorani](https://github.com/ricardofiorani)
- [All Contributors](https://github.com/ricardofiorani/php-cloudflare-amp-validator/graphs/contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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

2841d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1641075?v=4)[Ricardo Fiorani](/maintainers/ricardofiorani)[@ricardofiorani](https://github.com/ricardofiorani)

---

Top Contributors

[![ricardofiorani](https://avatars.githubusercontent.com/u/1641075?v=4)](https://github.com/ricardofiorani "ricardofiorani (7 commits)")[![mkingbe](https://avatars.githubusercontent.com/u/32457059?v=4)](https://github.com/mkingbe "mkingbe (6 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (2 commits)")

---

Tags

ampamp-htmlautomated-testingcicloudflarecloudflare-ampcloudflare-apiphpvalidatorgoogleampAMPHTML

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ricardofiorani-php-cloudflare-amp-validator/health.svg)

```
[![Health](https://phpackages.com/badges/ricardofiorani-php-cloudflare-amp-validator/health.svg)](https://phpackages.com/packages/ricardofiorani-php-cloudflare-amp-validator)
```

###  Alternatives

[guzzlehttp/guzzle

Guzzle is a PHP HTTP client library

23.5k1.0B34.2k](/packages/guzzlehttp-guzzle)[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.2k532.1M2.5k](/packages/aws-aws-sdk-php)[aporat/store-receipt-validator

PHP receipt validator for Apple App Store and Amazon Appstore

6513.9M11](/packages/aporat-store-receipt-validator)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.8M712](/packages/sylius-sylius)[kreait/firebase-php

Firebase Admin SDK

2.4k42.7M84](/packages/kreait-firebase-php)[gotenberg/gotenberg-php

A PHP client for interacting with Gotenberg, a developer-friendly API for converting numerous document formats into PDF files, and more!

3845.9M26](/packages/gotenberg-gotenberg-php)

PHPackages © 2026

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