From db9ec93e8a323683953624e296487c2ea7963f6e Mon Sep 17 00:00:00 2001 From: Agent Isai <43097272+AgentIsai@users.noreply.github.com> Date: Sun, 13 Oct 2024 23:23:00 -0500 Subject: [PATCH 1/4] Don't index special pages --- GlobalSettings.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/GlobalSettings.php b/GlobalSettings.php index d1c8f28d53..9e309914be 100644 --- a/GlobalSettings.php +++ b/GlobalSettings.php @@ -12,6 +12,13 @@ $wgHooks['ManageWikiCoreFormSubmission'][] = 'MirahezeFunctions::onManageWikiCoreFormSubmission'; $wgHooks['MediaWikiServices'][] = 'MirahezeFunctions::onMediaWikiServices'; +$wgHooks['BeforePageDisplay'][] = function ( &$out, &$skin ) { + if ( $out->getTitle()->isSpecialPage() ) { + $out->setRobotPolicy( 'noindex,nofollow' ); + } + return true; +}; + if ( $wmgMirahezeContactPageFooter && $wi->isExtensionActive( 'ContactPage' ) ) { $wgHooks['SkinAddFooterLinks'][] = static function ( Skin $skin, string $key, array &$footerlinks ) { if ( $key === 'places' ) { From 04e6b28da9416ca3bfebe326b956e8979bb3fd88 Mon Sep 17 00:00:00 2001 From: Agent Isai <43097272+AgentIsai@users.noreply.github.com> Date: Sun, 13 Oct 2024 23:28:44 -0500 Subject: [PATCH 2/4] Fix tabbing --- GlobalSettings.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/GlobalSettings.php b/GlobalSettings.php index 9e309914be..2b7fe47c60 100644 --- a/GlobalSettings.php +++ b/GlobalSettings.php @@ -11,12 +11,11 @@ $wgHooks['ManageWikiCoreAddFormFields'][] = 'MirahezeFunctions::onManageWikiCoreAddFormFields'; $wgHooks['ManageWikiCoreFormSubmission'][] = 'MirahezeFunctions::onManageWikiCoreFormSubmission'; $wgHooks['MediaWikiServices'][] = 'MirahezeFunctions::onMediaWikiServices'; - $wgHooks['BeforePageDisplay'][] = function ( &$out, &$skin ) { - if ( $out->getTitle()->isSpecialPage() ) { - $out->setRobotPolicy( 'noindex,nofollow' ); - } - return true; + if ( $out->getTitle()->isSpecialPage() ) { + $out->setRobotPolicy( 'noindex,nofollow' ); + } + return true; }; if ( $wmgMirahezeContactPageFooter && $wi->isExtensionActive( 'ContactPage' ) ) { From b2a49dfb9c9acc4365b534b685837be9de8681c9 Mon Sep 17 00:00:00 2001 From: Agent Isai <43097272+AgentIsai@users.noreply.github.com> Date: Sun, 13 Oct 2024 23:47:05 -0500 Subject: [PATCH 3/4] Fix comment location --- GlobalSettings.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/GlobalSettings.php b/GlobalSettings.php index 2b7fe47c60..c1527737dc 100644 --- a/GlobalSettings.php +++ b/GlobalSettings.php @@ -615,7 +615,8 @@ $wgEnabledTranscodeSet['1440p.vp9.webm'] = false; $wgEnabledTranscodeSet['2160p.vp9.webm'] = false; - $wgTranscodeBackgroundMemoryLimit = 4 * 1024 * 1024; // 4GB + // 4GB + $wgTranscodeBackgroundMemoryLimit = 4 * 1024 * 1024; // This allows using 2x the threads for VP9 encoding, but will // fail if running a too-old ffmpeg version. From ad7fa749816e44aababd44518e9b37f737fe313e Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 14 Oct 2024 04:47:31 +0000 Subject: [PATCH 4/4] CI: lint code to MediaWiki standards Check commit and GitHub actions for more details --- GlobalSettings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GlobalSettings.php b/GlobalSettings.php index c1527737dc..cfe6d6dcc3 100644 --- a/GlobalSettings.php +++ b/GlobalSettings.php @@ -11,7 +11,7 @@ $wgHooks['ManageWikiCoreAddFormFields'][] = 'MirahezeFunctions::onManageWikiCoreAddFormFields'; $wgHooks['ManageWikiCoreFormSubmission'][] = 'MirahezeFunctions::onManageWikiCoreFormSubmission'; $wgHooks['MediaWikiServices'][] = 'MirahezeFunctions::onMediaWikiServices'; -$wgHooks['BeforePageDisplay'][] = function ( &$out, &$skin ) { +$wgHooks['BeforePageDisplay'][] = static function ( &$out, &$skin ) { if ( $out->getTitle()->isSpecialPage() ) { $out->setRobotPolicy( 'noindex,nofollow' ); }