You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+33-14Lines changed: 33 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,14 +23,25 @@
23
23
24
24
---
25
25
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
+
26
37
## Usage
27
38
28
39
```php
29
40
use \TypistTech\WordfenceAPI\{Client, Feed, Record};
30
41
31
42
$client = new Client;
32
43
33
-
// Alternatively, use `Feed::Scanner`` for the scanner feed.
44
+
// Alternatively, use `Feed::Scanner` for the scanner feed.
34
45
$records = $client->fetch(Feed::Production);
35
46
36
47
foreach($records as $record) {
@@ -39,42 +50,50 @@ foreach($records as $record) {
39
50
}
40
51
```
41
52
42
-
## Installation
43
-
44
-
```bash
45
-
composer require typisttech/wordfence-api
46
-
```
47
-
48
53
## Known Issues
49
54
50
-
51
55
### `Allowed memory size of 999999 bytes exhausted (tried to allocate 99 bytes)`
52
56
53
57
> [!TIP]
54
58
> Set `memory_limit` on the fly as a temporary fix:
55
59
>
56
-
> ```bash
60
+
> ```sh
57
61
> php -d memory_limit=512MB your-script.php
58
62
>```
59
63
60
64
As of October 2025, the [production Wordfence vulnerability data feed](https://www.wordfence.com/api/intelligence/v2/vulnerabilities/production) is over 117 MB.
61
-
[`Client`](src/Client.php) downloads the feed into memory and `json_decode()` the entire feed all in one go.
65
+
[`Client::fetch()`](./src/Client.php) downloads the feed into memory and `json_decode()` the entire feed all in one go.
62
66
It causes PHP to run out of memory.
63
67
64
68
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.
65
69
If you know how to do that in PHP, please send pull requests. :bow:
66
70
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
+
67
87
## Credits
68
88
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/).
71
90
72
91
Full list of contributors can be found [on GitHub](https://github.com/typisttech/wordfence-api/graphs/contributors).
73
92
74
93
## Copyright and License
75
94
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.
0 commit comments