Extension:PageTriage

From mediawiki.org
This page is a translated version of the page Extension:PageTriage and the translation is 72% complete.
Outdated translations are marked like this.
MediaWiki manüel uzantıları
PageTriage
Sürüm durumu: kararlı
Uygulama Özel sayfa , Kullanıcı arayüzü
Açıklama Yeni sayfaların incelenmesini ve onaylanmasını kolaylaştırır
Yazar(lar) Ryan Kaldari, Benny Situ
Uyumluluk politikası MediaWiki ile birlikte anlık görüntüler yayımlanır. Master geriye dönük olarak uyumlu değil.
MediaWiki >= 1.42.0
Veritabanı değişiklikleri Evet
Tablolar pagetriage_log
pagetriage_page
pagetriage_page_tags
pagetriage_tags
Lisans MIT Lisansı
İndir
Örnek Special:NewPagesFeed on the English Wikipedia
  • $wgPageTriageMaxAge
  • $wgTalkPageNoteTemplate
  • $wgPageTriageNamespaces
  • $wgPageTriageMarkPatrolledLinkExpiry
  • $wgPageTriageDeletionTagsOptionsMessages
  • $wgPageTriageTagsOptionsMessages
  • $wgPageTriageEnabledEchoEvents
  • $wgPageTriageEnableOresFilters
  • $wgPageTriageEnableCopyvio
  • $wgPageTriageProjectLink
  • $wgPageTriageCurationModules
  • $wgPageTriageLearnMoreUrl
  • $wgPageTriageEnableExtendedFeatures
  • $wgPageTriageMaxNoIndexAge
  • $wgPageTriageDraftNamespaceId
  • $wgPageTriageRedirectAutoreviewAge
  • $wgPageTriageDeletionTagsOptionsContentLanguageMessages
  • $wgPageTriageEnableCurationToolbar
  • $wgPtTemplatePath
  • $wgPageTriagePagesPerRequest
  • $wgPageTriageFeedbackUrl
  • $wgPageTriageNoIndexUnreviewedNewArticles
  • pagetriage-copyvio
Quarterly downloads 17 (Ranked 137th)
Translatewiki.net adresinde mevcutsa, PageTriage uzantısını çevirin
Sorunlar Açık görevler · Hata bildir

PageTriage, yeni oluşturulan maddelerin önceliklendirilmesi için zengin özelliklere sahip bir arayüz sağlamayı amaçlayan bir uzantıdır. Yeni maddeleri incelemek, etiketlemek ve geliştirmek için ek işlevler eklerken "yeni sayfa devriyesi" temel işlevinin yerini alması amaçlanmıştır. Bir Special:NewPagesFeed sayfası ve "patrol" iznine sahip olanlar için yeni sayfalara bir sayfa iyileştirme araç çubuğu ekler. Wikimedia Vakfı'nın Özellik Mühendislik ekibi tarafından geliştirilmiştir. Ek ayrıntılar için Page Curation sayfasına bakın.

Önemli bir not, yapılandırma ve kodun bir kısmının İngilizce Vikipedi'nin iş akışlarına özgü olduğu ve şu anda kurulduğu için uzantının uluslararasılaşmasının neredeyse imkansız olduğudur. (Phabricator:T50552 sayfasına bakın.)

An overview of the page curation feature. The interface in the video is outdated but the content remains useful.

Kurulum

Screenshot of Special:NewPagesFeed as it appeared in 2012
  • Dosyaları indirin ve extensions/ klasörünüzdeki PageTriage adlı dizine yerleştirin.
    Developers and code contributors should install the extension from Git instead, using:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/PageTriage
  • LocalSettings.php dosyanızın altına aşağıdaki kodu ekleyin:
    wfLoadExtension( 'PageTriage' );
    
  • Bu uzantının ihtiyaç duyduğu gerekli veritabanı tablolarını otomatik olarak oluşturacak betik güncelleme komutunu çalıştırın.
  • Yes Yapıldı – Uzantının başarıyla yüklendiğini doğrulamak için vikinizde Special:Version seçeneğine gidin.

Checking for successful install

Uzantının gerçekten çalıştığını görmek için:

  • Anonim bir kullanıcı olarak yeni bir taslak sayfası ekleyin.

Yeni sayfa "Kategorisiz", "Öksüz" vb. olarak işaretlenmiş şekilde görünmelidir. Sayfa iyileştirme araç çubuğunu görmek için:

  • "sysop" iznine sahip bir kullanıcı olarak oturum açın veya "patrol" iznine sahip bir grup ekleyin ve bu gruba bir kullanıcı ekleyin ve bu kullanıcı olarak oturum açın.
  • Şimdi yeni sayfanın yanında bir "İncele" düğmesi görmelisiniz.
  • Bunu tıklayın ve yeni sayfada sayfa iyileştirme araç çubuğunu görmelisiniz.

Advanced installation

Additional extensions

For full functionality, you'll also need to install some additional extensions, although PageTriage works without them.

  • Echo - Allows users to receive notifications for things like when an article they created has been marked as reviewed.
  • ORES - In Special:NewPagesFeed, allows filtering by "predicted class" (articlequality: stub, start, c-class, b-class, good, featured) and "potential issues" (draftquality: vandalism, spam, attack, copyvio). The predictions are done with machine learning (except for copyvio, which is done via a third party bot using an API, but is included here because draftquality needs to be turned on). ORES AI is typically trained by editors via https://labels.wmflabs.org/ui/, or by analyzing reverts. The ORES database provides probabilities which are accessed via the ORES extension. A threshold (tolerable false positive rate) is applied to this data, and some of the thresholds are set in the ORES extension's extension.json file.
  • WikiLove - Adds a button to the Page Curation toolbar that allows you to leave a person a barnstar more easily.

Enabling draft namespace

By default, the draft namespace is disabled, but can be enabled with the following update to LocalSettings.php

// These three settings are optional, and will enable the Articles-for-Creation mode.
$wgPageTriageDraftNamespaceId = 118;
$wgExtraNamespaces[ $wgPageTriageDraftNamespaceId ] = 'Draft';
$wgExtraNamespaces[ $wgPageTriageDraftNamespaceId + 1 ] = 'Draft_talk';

When enabled, a new "articles for creation" tab will show up on Special:NewPagesFeed.

By default pages edited in the draft namespace will be "unsubmitted".

Articles in the draft namespace can be submitted for review by adding [[Category:Pending_AfC_submissions]] to the draft page. At which point they will show up under "awaiting review".

Note the toolbar controlled by the configuration variable $wgPageTriageEnableCurationToolbar does not show up in the draft namespace.

Cron jobs

To make sure old articles are eventually taken out of the new pages feed, you should set up a cron job to run the following file every 48 hours: cron/updatePageTriageQueue.php

Manual testing

Special:NewPagesFeed -> Articles for Creation

  • Enable draftspace by following the directions above in the section #Enabling draft namespace.
  • In Special:NewPagesFeed, to place a draft in one of the AFC states, you need to create a page in the "Draft" namespace, and add it to the following categories:
    • Unsubmitted: (no category)
    • Awaiting review: Category:Pending AfC submissions
    • Under review: Category:Pending AfC submissions being reviewed now
    • Declined: Category:Declined AfC submissions

Note: The Page Curation toolbar does not display for drafts.

ORES

Enwiki has the ORES extension installed, which provides machine learning predictions of an article's quality and of some common issues. ORES works fine in production, but requires some setup if you want to test in a localhost environment. It can be desirable to test with ORES turned on, for example, if you are changing the layout of Special:NewPagesFeed. Here is a localhost testing procedure:

  • Clone Extension:ORES and add wfLoadExtension( 'ORES' ); in LocalSettings.php
  • Add this to LocalSettings.php
$wgPageTriageEnableOresFilters = true;
$wgOresWikiId = 'enwiki';
$wgOresModels = [
	'articlequality' => [ 'enabled' => true, 'namespaces' => [ 0 ], 'cleanParent' => true ],
	'draftquality' => [ 'enabled' => true, 'namespaces' => [ 0 ], 'types' => [ 1 ] ]
];
  • Run php extensions/ORES/maintenance/BackfillPageTriageQueue.php

Determining if a page is reviewed

Status codes

There are status codes used to track whether a page is reviewed or not. These are the values given when you query patrol_status, ptrp_reviewed, and ptrl_reviewed:

  • Unreviewed
    • 0 - unreviewed
  • Reviewed
    • 1 - reviewed (someone clicked the green check mark in the Page Curation toolbar)
    • 2 - patrolled (someone clicked the "Mark as patrolled" link at the bottom right corner of a page)
    • 3 - autopatrolled (someone with the autopatrol user right created the page, or moved the page from a non-tracked namespace to a tracked namespace)
    • no result - will occur if the page is not in a tracked namespace (mainspace, userspace, and draftspace), if the article was created before PageTriage was installed, or if the article was reviewed for longer than 30 days (these records are deleted by a cron job)

Via the API

To check the review status of pages using an API query, you can use api.php?action=query&prop=isreviewed.

Sample JavaScript code:

/**
 * @param {number} pageID The page ID number. A positive number with no commas.
 */
async isReviewed(pageID) {
	let api = new mw.Api();
	let response = await api.get( {
		action: 'query',
		format: 'json',
		formatversion: '2',
		prop: 'isreviewed',
		pageids: pageID,
	} );
	return response.query.pages[0].isreviewed;
}

/**
 * @param {string} title One title. Can include namespace. Example: User:Test
 */
async function isReviewed(title) {
	let api = new mw.Api();
	let response = await api.get( {
		action: 'query',
		format: 'json',
		formatversion: '2',
		prop: 'isreviewed',
		titles: title,
	} );
	return response.query.pages[0].isreviewed;
}

Via SQL

To check the review status of pages using an SQL query, you need to query the pagetriage_page table and the ptrp_reviewed field. Follow the directions in #Status codes to interpret the values of this field.

/* By page_id */
SELECT ptrp_reviewed
FROM pagetriage_page
WHERE ptrp_page_id = 71318376

/* By page_title and page_namespace */
SELECT ptrp_reviewed
FROM pagetriage_page
JOIN page ON page_id = ptrp_page_id
WHERE page_title = 'Živko_Kostadinović' -- underscores, not spaces
	AND page_namespace = 0

SQL

SQL tables

Name Prefix Description Old entry deletion strategy Service classes (when refactoring, SQL queries should be moved to here) Data classes
pagetriage_page ptrp_ The main table. Log of all pages created after PageTriage was installed. One entry per page. Stores the "mark as reviewed" statuses mentioned above. Also stores the last time a tag was placed on the page by PageTriage. Query ptrp_reviewed > 0 in this table to figure out if a page is marked as reviewed. No entry also means the page is reviewed. All articles deleted once ptrp_reviewed > 0 (marked as reviewed) and older than 30 days. All redirects deleted after 180 days regardless of patrol status. QueueManager, QueueLookup QueueRecord
pagetriage_page_tags ptrpt_ Stores metadata about pages, to make the filters in the Page Curation toolbar work. For example, if you pick the filter "Were previously deleted", then PageTriage will query this table looking for the recreated tag ID. The tag ID is discovered by checking the pagetriage_tags table. See #pagetriage_page_tags for list of tags. All article metadata deleted once ptrp_reviewed > 0 (marked as reviewed) and older than 30 days. All redirect metadata deleted after 180 days regardless of patrol status.
pagetriage_tags ptrt_ A dictionary of page_tags, and their corresponding ID number. See #pagetriage_page_tags for list of tags.

pagetriage_page_tags

pagetriage_page_tags data is updated by calling ArticleCompileProcessor::newFromPageId( [ $pageId ] )->compileMetadata(). This is called in the following hooks:

  • onPageMoveComplete() - runs when moving a page
  • onLinksUpdateComplete() - runs when saving an edit
  • onMarkPatrolledComplete() - runs when clicking the "Mark this page as patrolled" link in bottom right corner of certain pages

It is called asynchronously. The user will see that their edit succeeded and can continue browsing the website, and the page tags update will occur in the background, invisibly to the user.

List of tags

The pagetriage_page_tags are as follows:

  • Author information
    • user_id
    • user_name - there's a filter where you can type in their username
    • user_editcount
    • user_creation_date
    • user_autoconfirmed
    • user_experience - Experience level: newcomer (non-autoconfirmed), learner (newly autoconfirmed), experienced, or anonymous. These experience levels are baked into core and can be accessed with MediaWikiServices::getInstance()->getUserFactory()->newFromUserIdentity( $performer )->getExperienceLevel()
    • user_bot
    • user_block_status
  • Deletion tags - will display a black trash can icon if marked for deletion
    • afd_status
    • blp_prod_status
    • csd_status
    • prod_status
  • Special:NewPagesFeed red warning text
    • category_count - No categories
    • linkcount - Orphan
    • reference - No citations
    • recreated - Previously deleted
    • user_block_status - Blocked
  • Page information
    • page_len - size of article, in bytes
    • rev_count - number of edits to the article
    • snippet - text from beginning of article, used in Special:NewPagesFeed to preview the article
  • afc_state - 1 unsubmitted, 2 pending, 3 under review, 4 declined
  • copyvio - latest revision ID that has been tagged as a likely copyright violation, if any

Wikicode

Viki üzerinde yapılandırma

PageTriage'in çoğunu viki üzerinde MediaWiki:PageTriageExternalDeletionTagsOptions.js ve MediaWiki:PageTriageExternalTagsOptions.js sayfaları üzerinden yapılandırmak mümkündür, ancak yapılandırmanın yapısı gelecekte değişebilir (İngilizce Vikipedi'nin yanı sıra vikilere daha iyi uyum sağlamak için). Aşağıdakilere bakarak yapılandırmanın nasıl çalıştığı hakkında genel bir fikir edinebilirsiniz:

From a coding perspective, the default .js file is loaded first, and the English Wikipedia customisation file is loaded second. It's not either/or, both files are loaded. So if there is a variable set in the first file and in the second file, the second file's variable will overwrite the first one.

(etiket ekle) ve (silme için aday göster) düğmelerinin altındaki iyileştirme araç çubuğunda listelenen iyileştirme şablonlarını tanımlayan iki üst düzey jQuery değişkeni vardır. Bunlar:

$.pageTriageTagsOptions = {};
$.pageTriageDeletionTagsOptions = { Main: {}, User: {} };

"Ana" ve "Kullanıcı", iyileştirme yapılan sayfanın ad alanını ifade eder. Yukarıdaki üç kümedeki her bir alt öğe, araç çubuğunun sol tarafında gösterilen sekmeleri tanımlar ve aşağıdaki forma sahiptir:

{
    label: 'Short title',
    desc: 'A longer description.', // Text only, no HTML or Wikitext markup
    multiple: false, // Whether more than one of the tags can selected at once.
    tags: { tag1 = {}, tag2 = {} }
}

Ardından, listelenen gerçek şablonlar yukarıdaki tags değişkeni altında tanımlanır. Her silme şablonu aşağıdaki forma sahiptir:

{
    tag: 'Actual_template_name', // Without the 'Template:' prefix.
    label: 'Friendly template title',
    desc: 'A longer description.', // Text only, no HTML or Wikitext markup
    code: '',
    params: {},
    anchor: '',
    talkpagenotiftopictitle: 'message-name', // The message name (e.g. pagetriage-del-tags-speedy-deletion-nomination-notify-topic-title) used as the section/topic title when posting to the editing user's talk page.  Usually, you can reuse one of the existing messages (currently pagetriage-del-tags-speedy-deletion-nomination-notify-topic-title, pagetriage-del-tags-prod-notify-topic-title, pagetriage-del-tags-xfd-notify-topic-title).  If you need a new one, file a task so $wgPageTriageDeletionTagsOptionsContentLanguageMessages or the PageTriage repository can be updated.
    talkpagenotiftpl: 'Template_name' // The template that will be added to the editing user's talk page, not including the talk page heading (handled by talkpagenotiftopictitle).
}

Şu anda bazı etiketlerin bulunması gerekir:

  1. $.pageTriageDeletionTagsOptions.Main.xfd.tags.articlefordeletion

Örnek

Dolayısıyla, yerleşik silme şablonlarından herhangi birini kullanmak istemiyorsanız (NewPagesFeed_Templates.xml üzerinden içe aktarılabilir) ardından, MediaWiki:PageTriageExternalDeletionTagsOptions.js sayfanızın altına aşağıdakileri ekleyerek hepsini tek bir tane ile değiştirebilirsiniz:

var deletionSection = {
    label: 'Deletion',
    desc: 'Nominate for deletion.',
    multiple: false,
    tags: {
        articlefordeletion: {
            tag: 'delete',
            label: 'Delete',
            desc: 'Nominate this page for deletion.',
            code: '',
            params: {},
            anchor: '',
            talkpagenotiftopictitle: 'pagetriage-del-tags-xfd-notify-topic-title',
            talkpagenotiftpl: 'Deletion notification'
        }
    }
};
$.pageTriageDeletionTagsOptions = { Main: { xfd: deletionSection }, User: { xfd: deletionSection } };

PHP

Uzantı yapılandırması

Uzantı, 'patrol' hakkına dayanmaktadır. Devriye gezintisini yapılandırma hakkında daha fazla bilgi için, bkz. Manual:Patrolling sayfasına bakın.

Aşağıdaki yapılandırma değişkenleri LocalSettings.php dosyanızdan ayarlanabilir:

Variable Default Description
$wgPageTriageEnableCurationToolbar true İyileştirme araç çubuğunu devre dışı bırakmak için false olarak ayarlayın (varsayılan true)
$wgPageTriageInfiniteScrolling true Yeni sayfa beslemesinde sonsuz kaydırmanın kullanılıp kullanılmayacağı (varsayılan true)
$wgPageTriageMaxAge 90 The age (in days) at which PageTriage allows unreviewed articles to become indexed by search engines (if $wgPageTriageNoIndexUnreviewedNewArticles is true).
$wgPageTriageNamespaces NS_MAIN The namespaces that PageTriage is active in.
$wgPageTriageNoIndexUnreviewedNewArticles false Yeni, incelenmemiş maddelerin noindex olarak ayarlanması gerekiyorsa bunu true olarak ayarlayın. Diğer bir deyişle, incelenene kadar arama motorları tarafından indekslenmemeleri gerekiyor. (varsayılan false)

Yapılandırma değişkenlerinin tam listesi için extension.json sayfasına bakın.

API

PageTriage, kullanılabilecek aşağıdaki API uç noktalarını ekler:

API Description Type Triggering action
pagetriageaction Mark a page as reviewed or unreviewed, and logs the action in Special:Log. Write
  • Using the Page Curation toolbar to mark a page as reviewed
  • Using the Page Curation toolbar to mark a page as unreviewed
pagetriagelist Retrieves the list of pages in the queue, and each page's metadata, including their reviewed status. To retrieve one page, you must provide the page_id. To provide multiple pages, you must select one of showreviewed/showunreviewed, and one of showredirs/showdeleted/showothers, or no pages will be returned. Read
  • Loading the Page Curation toolbar (automatically loaded if you have the patrol userright and view a page that is unpatrolled or recently patrolled)
  • Viewing Special:NewPagesFeed (provides the list of articles)
pagetriagestats Sıradaki sayfaların sayısı ve en iyi yorumcularla ilgili istatistikleri alır Read
  • Viewing Special:NewPagesFeed (provides the total articles in the header, and provides the stats in the footer)
pagetriagetagcopyvio Mark an article as a potential copyright violation, and logs the action in Special:Log. Write
  • Marking as a copyright violation by a bot with the copyviobot userright
pagetriagetagging Add clean-up tags or deletion templates to a page, and logs the action in Special:Log. Write
  • Using the Page Curation toolbar to place a maintenance tag on an article
  • Using the Page Curation toolbar to place a deletion tag on an article

Special:Log

The following logs are created by the extension:

Special:Log log_type log_action Description Notes
Page curation log pagetriage-curation delete, enqueue, reviewed, tag, unreviewed Logs deletion tagging, maintenance tagging, marking page as reviewed, marking page as unreviewed
Potential copyright violation log pagetriage-copyvio insert Allows a bot to log potential copyright violations Doesn't display unless you set $wgPageTriageEnableCopyvio to true

Entry points

The extension's features can be triggered by various actions:

Entry point type File location Notes
5 APIs includes/Api/*
1 special page includes/SpecialNewPagesFeed.php
20 hooks
  • includes/Hooks.php
  • includes/HookHandlers/UndeleteHookHandler.php
  • includes/HookHandlers/Schema.php
1 cron job cron/updatePageTriageQueue.php runs every 48 hours
7 maintenance scripts maintenance/* need to be run manually

Here is a list of some actions and the corresponding entry points they trigger:

Action Entry points used
View Main page
  • Hooks.php -> onBeforeCreateEchoEvent()
  • Hooks.php -> onArticleViewFooter()
Save an edit to the Main page
  • Hooks.php -> onRevisionFromEditComplete()
  • Hooks.php -> onPageSaveComplete()
  • Hooks.php -> onArticleViewFooter()
  • Hooks.php -> onLinksUpdateComplete()
Type in search box, triggering search suggestions
  • Hooks.php -> onBeforeCreateEchoEvent()
  • Hooks.php -> onApiMain__moduleManager()
View Special:NewPagesFeed
  • Hooks.php -> onBeforeCreateEchoEvent()
  • SpecialNewPagesFeed
  • ApiPageTriageStats
  • ApiPageTriageList
View an unreviewed article while logged in

and having the patrol permission.

  • Hooks.php -> onBeforeCreateEchoEvent()
  • Hooks.php -> onArticleViewFooter()
  • Hooks.php -> onResourceLoaderGetConfigVars()
  • Hooks.php -> onDefinedTags()
  • Hooks.php -> onApiMain__moduleManager()
  • ApiPageTriageList (by page_id)

Hooks

File Group Hook Actions it performs
Hooks.php Move page onPageMoveComplete Changes patrolled status, updates cache, updates metadata in pagetriage_page_tags table.
Edit page onRevisionFromEditComplete Handles marking redirects that flip to articles as unreviewed. DeferredUpdate.
onPageSaveComplete Add new articles to the New Pages Feed and pagetriage_page table.
onLinksUpdateComplete DeferredUpdate of metadata / pagetriage_page_tags table.
Every page load onArticleViewFooter
  • Turn on noindex for new, unreviewed articles.
  • Displays the Page Curation toolbar on recently created pages.
  • Create "Add to New Pages Feed" toolbox link for old articles.
Help:Patrolled edits onMarkPatrolledComplete Marking as patrolled (the patrol link shows up in template namespace, for example) will also mark as reviewed in PageTriage.
Blocking and unblocking onBlockIpComplete Update article metadata / pagetriage_page_tags when a user gets blocked or unblocked. This is so Special:NewPagesFeed can display "Blocked" by articles created by blocked users.
onUnblockUserComplete
onResourceLoaderGetConfigVars Adjusts some config vars related to draft namespace ID.
Extension:Echo onBeforeCreateEchoEvent Code that makes PageTriage Echo notifications work. For example, the notification to article creators that their article was marked as reviewed.
onEchoGetDefaultNotifiedUsers
onLocalUserCreated
Extension:ORES onORESCheckModels Code that makes PageTriage ORES filters in Special:NewPagesFeed work. For example, filtering by article size or by predicted vandalism/spam/copyvio.
Help:Tags onListDefinedTags Code that makes PageTriage tags work. Tags can be attached to individual revisions to show that a tool helped make the edit. For PageTriage, it tags edits "PageTriage".
onChangeTagsAllowedAdd
onChangeTagsListActive
API onApiMain__moduleManager Disables the pagetriagetagging API, if that feature is turned off in PageTriage's settings.
Delete or undelete page onPageDeleteComplete If a page is deleted, also delete its data from the PageTriage queue, and remove it from the cache.
HookHandlers/

UndeleteHookHandler.php

onArticleUndelete If a page is undeleted, add it back to the PageTriage queue, regardless of autopatrol status. Fixes a bug where undeleted pages were automatically marked as reviewed.
HookHandlers/ Schema.php SQL onLoadExtensionSchemaUpdates
  • The code that installs PageTriage's 4 SQL tables when you run php maintenance/update.php.
  • Will also alter schemas from previous versions to match the latest schema.
  • This is also where all the pagetriage_tags are hard-coded.

Cron jobs and maintenance scripts

File What it does Why run it? When is it useful? Safe to delete maintenance script?
cron/updatePageTriageQueue.php Every 48 hours, remove some items from the new pages feed after certain time limits. Removed items can be re-added by clicking "Add to the New Pages Feed". Keeps the SQL tables from getting too big.
maintenance/cleanupPageTriage.php Remove page with namespace other than NS_MAIN/NS_USER from pagetriage queue. Fix a bug? T321982
maintenance/cleanupPageTriageLog.php Maintenance script that updates parameter name from '4::tags' to 'tags' in pagetriage-curation log and (now defunct) pagetriage-deletion log One time conversion of old log entries to modern format? Logs are now always written in the new format. [1]. Probably
maintenance/cleanupPageTriagePageTags.php Remove page from pagetriage_page_tags if they are not in pagetriage_page Fix a bug that made it into production. All solved now. [2]. Probably
maintenance/DeleteAfcStates.php Delete the afc_state tag value for every page in the queue (drafts and non-drafts). Normally all pages have this tag even if they're not drafts. Fix a bug that made it into production. All solved now. [3]. T203184#4592953. Probably
maintenance/FixNominatedForDeletion.php Set pagetriage_page.ptrp_deleted if the page is has any pagetriage_page_tags related to deletion (e.g. prod_status, blp_prod_status, etc.) Fix a bug that made it into production. All solved now. [4]. T202582. Probably
maintenance/populateDraftQueue.php Add missing Draft namespace pages to the AfC triage queue. Related to deploying PageTriage's draftspace feature into an environment that already has a draftspace. [5].
maintenance/updateUserMetadata.php Former cron job. Update expired user metadata in the pagetriage_page_tags table [6]. T341432.

NOINDEX

NOINDEX refers to the HTML code <meta name="robots" content="noindex">, which can be inserted into a page to stop the page from appearing in search engine results. In default installations of MediaWiki, all pages are indexed unless they contain the wikicode __NOINDEX__. When $wgPageTriageNoIndexUnreviewedNewArticles is set to true, PageTriage will take over deciding what pages are indexed. The logic that determines this is located in includes/Hooks.php, in the onArticleViewFooter() method.

First check

  • First check: Noindex the page if ALL of the following are true:
    • $wgPageTriageNoIndexUnreviewedNewArticles is turned on
    • Page age is less than $wgPageTriageMaxAge (set to 90 days on enwiki)
    • Page is in pagetriage_page table[1]
    • Page is marked as unpatrolled (ptrp_status = 0)

Second check

  • Second check: If the wikitext has the __NOINDEX__ magic word, noindex the page if ALL of the following are true:
    • Page age is less than $wgPageTriageMaxNoIndexAge (set to 90 days on enwiki)
    • If $wgPageTriageMaxNoIndexAge is not null, page is in pagetriage_page table[2]

The main use case for the __NOINDEX__ magic word is in deletion templates and maintenance tag templates that are transcluded into mainspace or draftspace. See this search.

Is the page in the pagetriage_page table?

In regards to the requirement "Page is in pagetriage_page table", there are several ways a for a page to get into this table:

  • Not been deleted by a PageTriage cron job
    • One cron job deletes redirects older than $wgPageTriageRedirectAutoreviewAge days old (default 180 days as of Sep 2022), regardless of patrol status. In other words, this cron job autopatrols them.
    • Another cron job deletes reviewed pages after 30 days of being reviewed
  • In a namespace that PageTriage is configured to patrol
  • Isn't an article that is so old it predates the installation of PageTriage

JavaScript

Directory structure

  • /modules/
    • ext.pageTriage.article - related to marking an article as reviewed
    • ext.pageTriage.defaultTagsOptions - lists of deletion tags and maintenance tags used by the Page Curation toolbar
    • ext.pageTriage.enqueue - related to the "Add to the New Pages feed" link that shows up in the left menu toolbox, and the ooui alert box it generates
    • ext.pageTriage.init - creates a mw.pageTriage object
    • ext.pageTriage.newPagesFeed - Special:NewPagesFeed
    • ext.pageTriage.toolbar - Page Curation toolbar
    • ext.pageTriage.toolbarStartup - ActionQueue and toolbar startup code
    • ext.pageTriage.util - Backbone.js models (article, revision, stats)
    • external - contains external libraries including backbone, jquery.tipoff, jquery.badge, jquery.waypoint, and underscore


Toolbar

The toolbar has three states: maximized, minimized, and hidden. The maximized toolbar is the full-size toolbar with all buttons. The minimized toolbar still displays and floats, but simply says "Curation" and has an X you can click to close it. The hidden toolbar doesn't display at all, and can be re-opened by clicking the "Open Page Curation" link in the left menu.

External libraries

Backbone and Underscore are unusual libraries to use in MediaWiki extensions, and jQuery UI is deprecated. Long term, we are interested in replacing these front end libraries, to make the extension easier to maintain.

İstemci tarafı kancalar

mw.hook

  • ext.pageTriage.toolbar.ready

mw.pageTriage.actionQueue

PageTriage, diğer betiklerin ve araçların onunla bütünleşmesine izin vermek için özel bir eylem kuyruğu sistemi sağlar. Bu, vaatleri kullanması dışında mw.hook ile benzer. Bu, mw.pageTriage.actionQueue modülü kullanılarak yapılır. Nasıl yapılacağına ilişkin belgeler için kaynak kodu içindeki sistem nasıl çalıştığını yorumlara bakın. This is similar to mw.hook except that it uses promises. This is done using the mw.pageTriage.actionQueue module. See the comments in the source code for documentation on how the system works. It is not currently used by any scripts or gadgets on enwiki, but it is used internally by PageTriage.

actionQueue modülü, mw.hook ext.pageTriage.toolbar.ready tetikledikten sonra kullanılabilir. PageTriage, eylem kuyruğu işleyicisine aşağıda belirtilen diğer verilere ek olarak aşağıdaki verileri içeren bir Nesne verecektir:

  • pageid — İncelenen sayfanın kimliği.
  • title — Ad alanı dahil sayfanın başlığı.
  • reviewer — PageTriage kullananların kullanıcı adı.
  • creator — Sayfayı oluşturan kişinin kullanıcı adı.
  • reviewed — Sayfanın şu anda incelenmiş olarak işaretlenip işaretlenmeyeceği.

Kullanılabilir eylemler
  • delete — İnceleyen, bir sayfayı silmek için etiketlediğinde tetiklenir. İşleyiciye verilen veriler ayrıca şunları içerir:
    • tags — Sayfaya eklenen tüm şablonların bir nesnesi. Anahtarlar şablon başlığıdır ve değerler, hızlı silme kodu gibi şeyler dahil olmak üzere bir meta veri nesnesidir.
  • mark — Bir sayfanın inceleme durumu değiştiğinde tetiklenir. Ayrıca şunları içerir:
    • note — İnceleyicinin, sayfayı oluşturan kişi için eklediği kişisel mesaj. Bu boş olabilir.
  • tags — Sayfaya bakım etiketleri eklendiğinde tetiklenir. Ayrıca şunları içerir:
    • tags — Sayfaya eklenen tüm şablonların başlıkları dizisi.
    • note — İnceleyicinin, sayfayı oluşturan kişi için eklediği kişisel mesaj. Bu boş olabilir.

Örnek

Eylem kuyruğunu kullanmak için, yukarıda belirtilen bir eylem başlatıldığında çalıştırılacak bir işlevi kaydedin. PageTriage, sayfayı yenilemek gibi başka bir şey yapmadan önce eşzamansız kodların tamamlanmasını bekler. Örneğin, bir sayfa incelendi olarak işaretlendikten sonra Sandbox ile düzenlemek için şunu kullanabilirsiniz:

$( function () {
	// You must first listen for the ext.pageTriage.toolbar.ready event using mw.hook, to ensure your handler is registered at the right time.
	mw.hook( 'ext.pageTriage.toolbar.ready' ).add( function ( queue ) {
    	// Listen for the 'mark' action.
		queue.add( 'mark', function ( data ) {
			return new mw.Api().edit( 'Sandbox', function ( revision ) {
				// Replace 'foo' with the note the reviewer left.
				return revision.content.replace( 'foo', data.note );
			} );
		} );
	} );
} );

Where are preferences stored?

Preferences such as the user's Special:NewPagesFeed selected filters are stored as MediaWiki user preferences. The preference name is userjs-NewPagesFeedFilterOptions. It is set using mw.Api().saveOption() and read using mw.user.options.get(). This data ends up in the SQL user_properties table. Temporary accounts (IP masking) will not be able to store their preferences.

Ayrıca bakınız

Notes

  1. Checked by isPageUnreviewed()
  2. Checked by isNewEnoughToNoIndex(), if it doesn't exit early due to $wgPageTriageMaxNoIndexAge being null.