Skip to content

Commit 74621e2

Browse files
pfefferlematticbot
andauthored
Fix: Show error if site uses "Almost Pretty Permalink" structure (#1570)
* Fix #1282 Show an error if site uses the old "Almost Pretty Permalink" structure. We can not guarantee that the plugin works properly with that setup. Fix #1282 * Add changelog * improve wording props AI --------- Co-authored-by: Automattic Bot <[email protected]>
1 parent 0d375b6 commit 74621e2

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: patch
2+
Type: fixed
3+
4+
Show Site Health error if site uses old "Almost Pretty Permalinks" structure.

includes/wp-admin/class-health-check.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,18 @@ public static function test_pretty_permalinks() {
432432
esc_url( admin_url( 'options-permalink.php' ) )
433433
)
434434
);
435+
} elseif ( str_starts_with( $permalink_structure, '/index.php' ) ) {
436+
$result['status'] = 'critical';
437+
$result['label'] = \__( 'Your permalink structure needs to be updated for ActivityPub to work properly.', 'activitypub' );
438+
$result['badge']['color'] = 'red';
439+
$result['description'] = \sprintf(
440+
'<p>%s</p>',
441+
sprintf(
442+
/* translators: %s: Permalink settings URL. */
443+
\__( 'Your current permalink structure includes <code>/index.php</code> which is not compatible with ActivityPub. Please <a href="%s">update your permalink settings</a> to use a standard format without <code>/index.php</code>.', 'activitypub' ),
444+
esc_url( admin_url( 'options-permalink.php' ) )
445+
)
446+
);
435447
}
436448

437449
return $result;

0 commit comments

Comments
 (0)