Skip to content

Commit ea92d24

Browse files
remove disallow plugin uploads
1 parent 3285dc7 commit ea92d24

5 files changed

Lines changed: 10 additions & 17 deletions

File tree

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ ibericode mods
44
A collection of lightweight WordPress plugins that we commonly use on our sites.
55

66
- Allow SVG uploads
7-
- Disable installing or updating plugins through the WP Admin interface.
87
- Disable the `/wp-json/wp/v2/users` REST API endpoint.
98
- Adds `Robots: noindex` HTTP header to all non-singular pages (except the front page).
10-
- Protect WP Login through a 2 second timeout and `Origin` check.
9+
- Reject all WP Login attempts if submitted within 2.5 seconds of page load.
1110
- Purge Bunny CDN Cache on `save_post`
1211
- Set HTTP `Cache-Control` header on all safe requests for logged-out users.
1312
- Configure `wp_mail()` to use SMTP.
@@ -17,7 +16,9 @@ Some of these are simple no-ops if the relevant PHP constants are not set.
1716

1817
## Install
1918

20-
We install this plugin on all our sites through Composer, but you can also just download the ZIP and drop it in `wp-content/plugins`.
19+
Download the ZIP and drop it in `wp-content/plugins`.
20+
21+
Alternatively, install through Composer:
2122

2223
```json
2324
{

ibericode-mods.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
License URI: https://www.gnu.org/licenses/gpl-2.0.html
1414
*/
1515

16+
if (PHP_VERSION_ID < 80300) {
17+
return;
18+
}
19+
1620
require __DIR__ . '/includes/allow-svg-uploads.php';
1721
require __DIR__ . '/includes/noindex-archive-pages.php';
1822
require __DIR__ . '/includes/disable-rest-api-users-endpoint.php';
@@ -21,4 +25,3 @@
2125
require __DIR__ . '/includes/protect-wp-login.php';
2226
require __DIR__ . '/includes/smtp-mailer.php';
2327
require __DIR__ . '/includes/stop-comment-spam.php';
24-
require __DIR__ . '/includes/disable-plugin-and-theme-updates.php';

includes/allow-svg-uploads.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
add_filter('upload_mimes', function (array $mime_types) {
3+
add_filter('upload_mimes', function (array $mime_types): array {
44
$mime_types['svg'] = 'image/svg+xml';
55
return $mime_types;
66
});

includes/disable-plugin-and-theme-updates.php

Lines changed: 0 additions & 11 deletions
This file was deleted.

includes/noindex-archive-pages.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
add_filter('wp_robots', function (array $robots) {
3+
add_filter('wp_robots', function (array $robots): array {
44
if (!is_singular() && !is_front_page()) {
55
$robots['noindex'] = true;
66
}

0 commit comments

Comments
 (0)