Skip to content

Commit 7969053

Browse files
authored
Bikeshedding (#33)
* Rename test cases * GitHub Actions: Wait for all tests and lint * Normalize `composer.json` * Update feed sizes * Update readme
1 parent 562e2bd commit 7969053

File tree

12 files changed

+546
-1475
lines changed

12 files changed

+546
-1475
lines changed

.github/workflows/lint.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,10 @@ permissions:
1919
jobs:
2020
php:
2121
uses: typisttech/.github/.github/workflows/lint-php.yml@v3
22+
23+
wait-for-all-lint:
24+
needs:
25+
- php
26+
runs-on: ubuntu-latest
27+
steps:
28+
- run: exit 0

.github/workflows/test.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,10 @@ jobs:
110110
disable_search: true
111111
files: coverage-e2e.xml
112112
flags: e2e
113+
114+
wait-for-all-tests:
115+
needs:
116+
- pest
117+
runs-on: ubuntu-latest
118+
steps:
119+
- run: exit 0

README.md

Lines changed: 35 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,25 @@
2323

2424
---
2525

26+
> [!TIP]
27+
> **Hire Tang Rufus!**
28+
>
29+
> I am looking for my next role, freelance or full-time.
30+
> If you find this package useful, I can build you more API clients like this.
31+
> Let's talk if you are hiring PHP / Ruby / Go developers.
32+
>
33+
> Contact me at https://typist.tech/contact/
34+
35+
---
36+
2637
## Usage
2738

2839
```php
2940
use \TypistTech\WordfenceAPI\{Client, Feed, Record};
3041

3142
$client = new Client;
3243

33-
// Alternatively, use `Feed::Scanner`` for the scanner feed.
44+
// Alternatively, use `Feed::Scanner` for the scanner feed.
3445
$records = $client->fetch(Feed::Production);
3546

3647
foreach($records as $record) {
@@ -39,42 +50,50 @@ foreach($records as $record) {
3950
}
4051
```
4152

42-
## Installation
43-
44-
```bash
45-
composer require typisttech/wordfence-api
46-
```
47-
4853
## Known Issues
4954

50-
5155
### `Allowed memory size of 999999 bytes exhausted (tried to allocate 99 bytes)`
5256

5357
> [!TIP]
5458
> Set `memory_limit` on the fly as a temporary fix:
5559
>
56-
> ```bash
60+
> ```sh
5761
> php -d memory_limit=512MB your-script.php
5862
> ```
5963
60-
As of December 2024, the [production Wordfence vulnerability data feed](https://www.wordfence.com/api/intelligence/v2/vulnerabilities/production) is over 80 MB.
61-
[`Client`](src/Client.php) downloads the feed into memory and `json_decode()` the entire feed all in one go.
64+
As of October 2025, the [production Wordfence vulnerability data feed](https://www.wordfence.com/api/intelligence/v2/vulnerabilities/production) is over 117 MB.
65+
[`Client::fetch()`](./src/Client.php) downloads the feed into memory and `json_decode()` the entire feed all in one go.
6266
It causes PHP to run out of memory.
6367
6468
A possible solution is to use a streaming JSON parser like [`json.Decoder`](https://pkg.go.dev/encoding/json#example-Decoder.Decode-Stream) in Go.
6569
If you know how to do that in PHP, please send pull requests. :bow:
6670
71+
> [!TIP]
72+
> **Hire Tang Rufus!**
73+
>
74+
> There is no need to understand any of these quirks.
75+
> Let me handle them for you.
76+
> I am seeking my next job, freelance or full-time.
77+
>
78+
> If you are hiring PHP / Ruby / Go developers,
79+
> contact me at https://typist.tech/contact/
80+
81+
## Installation
82+
83+
```sh
84+
composer require typisttech/wordfence-api
85+
```
86+
6787
## Credits
6888

69-
[`Wordfence API`](https://github.com/typisttech/wordfence-api) is a [Typist Tech](https://typist.tech) project and
70-
maintained by [Tang Rufus](https://x.com/TangRufus), freelance developer [for hire](https://typist.tech/contact/).
89+
[`Wordfence API`](https://github.com/typisttech/wordfence-api) is a [Typist Tech](https://typist.tech) project and maintained by [Tang Rufus](https://x.com/TangRufus), freelance developer [for hire](https://typist.tech/contact/).
7190

7291
Full list of contributors can be found [on GitHub](https://github.com/typisttech/wordfence-api/graphs/contributors).
7392

7493
## Copyright and License
7594

76-
This project is a [free software](https://www.gnu.org/philosophy/free-sw.en.html) distributed under the terms of
77-
the MIT license. For the full license, see [LICENSE](./LICENSE).
95+
This project is a [free software](https://www.gnu.org/philosophy/free-sw.en.html) distributed under the terms of the MIT license.
96+
For the full license, see [LICENSE](./LICENSE).
7897

7998
### Wordfence Intelligence Terms and Conditions
8099

@@ -86,8 +105,7 @@ If you have any questions about the terms and conditions, please contact Wordfen
86105

87106
### MITRE Attribution Requirement
88107

89-
Any company or individual who uses Wordfence vulnerability database API needs to display the MITRE copyright
90-
claims included in that vulnerability record for any MITRE vulnerabilities that they display to their end user.
108+
Any company or individual who uses Wordfence vulnerability database API needs to display the MITRE copyright claims included in that vulnerability record for any MITRE vulnerabilities that they display to their end user.
91109

92110
Learn more at [Wordfence help documentation](https://www.wordfence.com/help/wordfence-intelligence/v2-accessing-and-consuming-the-vulnerability-data-feed/#mitre_attribution_requirement).
93111

composer.json

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,37 +10,35 @@
1010
"authors": [
1111
{
1212
"name": "Typist Tech",
13-
"email": "wordfence-api@typist.tech",
14-
"homepage": "https://typist.tech/"
13+
"homepage": "https://typist.tech"
1514
},
1615
{
1716
"name": "Tang Rufus",
1817
"email": "tangrufus@gmail.com",
19-
"homepage": "https://typist.tech/",
18+
"homepage": "https://tangrufus.com",
2019
"role": "Developer"
2120
}
2221
],
2322
"homepage": "https://github.com/typisttech/wordfence-api",
2423
"support": {
25-
"email": "wordfence-api@typist.tech",
2624
"issues": "https://github.com/typisttech/wordfence-api/issues",
27-
"source": "https://github.com/typisttech/wordfence-api"
25+
"source": "https://github.com/typisttech/wordfence-api",
26+
"security": "https://github.com/typisttech/wordfence-api/security"
2827
},
2928
"require": {
3029
"php": "^8.3",
3130
"composer/semver": "^3.4",
32-
"guzzlehttp/guzzle": "^7.9",
31+
"guzzlehttp/guzzle": "^7.9"
32+
},
33+
"require-dev": {
34+
"mockery/mockery": "^1.6",
35+
"pestphp/pest": "^4.1",
3336
"phpstan/extension-installer": "^1.4",
3437
"phpstan/phpstan": "^2.1",
3538
"phpstan/phpstan-deprecation-rules": "^2.0",
3639
"phpstan/phpstan-mockery": "^2.0",
3740
"phpstan/phpstan-strict-rules": "^2.0"
3841
},
39-
"require-dev": {
40-
"mockery/mockery": "^1.6",
41-
"pestphp/pest": "^4.1",
42-
"roave/security-advisories": "dev-latest"
43-
},
4442
"autoload": {
4543
"psr-4": {
4644
"TypistTech\\WordfenceApi\\": "src/"

0 commit comments

Comments
 (0)