MediaWiki master
Todo List
Class Article

Move and refactor remaining code

Deprecate

Member Article::getRobotPolicy ( $action, ParserOutput $pOutput=null)
actions other than 'view'
Member BackupDumper::backupDb ()
Fixme: the –server parameter is currently not respected, as it doesn't seem terribly easy to ask the load balancer for a particular connection by name.
Class BaseTemplate
Phase this class out and make it an alias for QuickTemplate. Move methods individually as-appropriate either down to QuickTemplate, or (with deprecation) up to SkinTemplate.
Class BitmapMetadataHandler
Other image formats.
Member BitmapMetadataHandler::Tiff ( $filename)
Add XMP support, so this function actually makes sense to put here.
Member CacheTime::isDifferentRevision ( $id)
We always return false if $this->getCacheRevisionId() is null; this prevents invalidating the whole parser cache when this change is deployed. Someday that should probably be changed.
Class ChangesListFilterGroup
Might want to make a super-class or trait to share behavior (especially re conflicts) between ChangesListFilter and ChangesListFilterGroup. What to call it. FilterStructure? That would also let me make setUnidirectionalConflict protected.
Class ChangeTagsLogItem
Abstract out a base class for this and RevDelLogItem, similar to the RevisionItem class but specifically for log items.
Member Cookie::validateCookieDomain ( $domain, $originDomain=null)

fixme fails to detect 3-letter top-level domains

fixme fails to detect 2-letter top-level domains for single-domain use (probably not a big problem in practice, but there are test cases)

Member CoreTagHooks::gallery (?string $content, array $attributes, Parser $parser)
break Parser::renderImageGallery out here too.
File deleteOrphanedRevisions.php
More efficient cleanup of text records
Class DifferenceEngine
This class is huge and poorly defined. It should be split into a controller responsible for interpreting query parameters, retrieving data and checking permissions; and a HTML renderer.
File dumpMessages.php
Make this more useful, right now just dumps content language
Class EmailNotification

Use UserOptionsLookup and other services, consider converting this to a service

If the volume becomes too great, we could send out bulk mails (bcc:user1,user2...) grouped by users having the same timeoffset in their preferences. This would however need to carefully consider impact of failure rate, re-try behaviour, and idempotence.

Member EnhancedChangesList::makeCacheGroupingKey (RCCacheEntry $cacheEntry)
use rc_source to group, if set; fallback to rc_type
Class EraseArchivedFile
Maybe add some simple logging
Member Exif::__construct ( $file, $byteOrder='')
FIXME: The following are broke: SubjectArea. Need to test the more obscure tags. DigitalZoomRatio = 0/0 is rejected. need to determine if that's valid. Possibly should treat 0/0 = 0. need to read exif spec on that.
Member ExifBitmapHandler::getRotationForExifFromOrientation ( $orientation)
FIXME: Orientation can include flipping as well; see if this is an issue!
Member FileRepo::$name
make protected
Member GIFHandler::getImageArea ( $image)
Add unit tests
Class HttpStatus
document
Member ImagePage::makeMetadataTable ( $metadata)
FIXME: Bad interface, see note on MediaHandler::formatMetadata().
Member LanguageYue::segmentByWord ( $string)
FIXME: Only do this for Han characters...
Member LanguageZh_hans::segmentByWord ( $string)
FIXME: Only do this for Han characters...
Member MediaHandler::formatMetadata ( $image, $context=false)
FIXME: This interface is not very flexible. The media handler should generate HTML instead. It can do all the formatting according to some standard. That makes it possible to do things like visual indication of grouped and chained streams in ogg container files.
Namespace MediaWiki\Api

: create a UploadCommandFactory and UploadComand classes to share logic with Special:Upload

: split the different cases of upload in subclasses or submethods.

Member MediaWiki\Api\ApiUpload::getUploadImageInfo (UploadBase $upload)
Extract the logic actually needed by the jobs, and separate it from the structure used in API responses.
Member MediaWiki\Api\ApiUpload::handleStashException ( $e)
Internationalize the exceptions then get rid of this
Member MediaWiki\Block\BlockUser::parseExpiryInput (string $expiry)
strtotime() only accepts English strings. This means the expiry input can only be specified in English.
Member MediaWiki\Content\Content::getTextForSearchIndex ()

Test that this actually works

Make sure this also works with LuceneSearch / WikiSearch

Member MediaWiki\Content\Content::getWikitextForTransclusion ()

Allow native handling, bypassing wikitext representation, like for includable special pages.

Allow transclusion into other content models than Wikitext!

Used in WikiPage and MessageCache to get message text. Not so nice. What should we use instead?!

Member MediaWiki\Content\ContentHandler::createDifferenceEngine (IContextSource $context, $old=0, $new=0, $rcid=0, $refreshCache=false, $unhide=false)
This is page-level functionality so it should not belong to ContentHandler. Move it to a better place once one exists (e.g. PageTypeHandler).
Member MediaWiki\Content\ContentHandler::getFieldsForSearchIndex (SearchEngine $engine)
Expose title, redirect, namespace, text, source_text, text_bytes field mappings here. (see T142670 and T143409)
Class MediaWiki\Content\JavaScriptContentHandler
Create a ScriptContentHandler base class, do highlighting stuff there?
Class MediaWiki\Html\FormOptions
This badly needs some examples and tests :) The usage in SpecialRecentchanges class is a good ersatz in the meantime.
Class MediaWiki\HTMLForm\Field\HTMLSelectAndOtherField
FIXME: If made 'required', only the text field should be compulsory.
Member MediaWiki\HTMLForm\HTMLForm::displaySection ( $fields, $sectionName='', $fieldsetIDPrefix='', &$hasUserVisibleFields=false)
Document
Member MediaWiki\HTMLForm\HTMLForm::setMessagePrefix ( $p)
Currently only used for the "<fieldset>" legend on forms with multiple sections; should be used elsewhere?
Member MediaWiki\HTMLForm\HTMLForm::setSubmitID ( $t)
FIXME: Integrity of $t is not validated
Member MediaWiki\HTMLForm\HTMLFormField::isSubmitAttempt (WebRequest $request)
Consider moving this to HTMLForm?
Member MediaWiki\Language\Language::getBlockDurations ( $includeOther=true)
FIXME: This uses a rather odd syntax for the options, should it be converted to the standard "**<duration>|<displayname>" format?
Member MediaWiki\Language\Language::sprintfDate ( $format, $ts, DateTimeZone $zone=null, &$ttl='unused')
handling of "o" format character for Iranian, Hebrew, Hijri & Thai?
Member MediaWiki\Language\Language::translateBlockExpiry ( $str, UserIdentity $user=null, $now=0)
Maybe translate block durations. Note that this function is somewhat misnamed: it deals with translating the duration ("1 week", "4 days", etc.), not the expiry time (which is an absolute timestamp). Please note: do NOT add this blindly, as it is used on old expiry lengths recorded in log entries. You'd need to provide the start date to match up with it.
Class MediaWiki\Linker\Linker
turn this into a legacy interface for HtmlPageLinkRenderer and similar services.
Member MediaWiki\Linker\Linker::buildRollbackLink (RevisionRecord $revRecord, IContextSource $context=null, $editCount=false)
Unused outside of this file - should it be made private?
Member MediaWiki\Linker\Linker::getRollbackEditCount (RevisionRecord $revRecord, $verify=true)
Unused outside of this file - should it be made private?
Member MediaWiki\Linker\Linker::makeMediaLinkFile (LinkTarget $title, $file, $html='')
Handle invalid or missing images better.
Member MediaWiki\Mail\EmailUser::validateTarget (UserEmailContact $target)
This method might perhaps be moved to a UserEmailContactLookup or something.
Member MediaWiki\MainConfigSchema::ExtraNamespaces
Add a note about maintenance/namespaceDupes.php
Member MediaWiki\MainConfigSchema::FooterIcons
Reformat documentation.
Member MediaWiki\MainConfigSchema::TextModelsToParse

Make the ToC suppression configurable by the content model (T313455), not a side effect of inclusion here.

On the long run, it would be nice to put categories etc into a separate structure, or at least parse only the contents of comments in the scripts.

Member MediaWiki\Message\Message::isBlank ()
FIXME: Merge with isDisabled()?
Class MediaWiki\Output\OutputPage

document

FIXME: Another class handles sending the whole page to the client.

Member MediaWiki\Output\OutputPage::disallowUserJs ()
this should be given a more accurate name
Member MediaWiki\Page\MergeHistory::merge (Authority $performer, $reason='')
if all versions of page A are moved to B and then a user tries to do a reverse-merge via the "unmerge" log link, then page A will still be a redirect (as it was after the original merge), though it will have the old revisions back from before (as expected). The user may have to "undo" the redirect manually to finish the "unmerge". Maybe this should delete redirects at the source page of merges?
Member MediaWiki\Pager\ContributionsPager::formatRow ( $row)
This would probably look a lot nicer in a table.
Member MediaWiki\Parser\ParserCacheMetadata::getCacheTime ()
remove legacy -1
Member MediaWiki\Parser\Parsoid\HtmlToContentTransform::getOriginalHtml ()
Make this method redundant, nothing should operate on HTML strings.
Member MediaWiki\Parser\Sanitizer::escapeClass (string $class)
For extra validity, input should be validated UTF-8.
Member MediaWiki\Parser\Sanitizer::mergeAttributes (array $a, array $b)
implement merging for other attributes such as style
Member MediaWiki\Parser\Sanitizer::validateAttributes (array $attribs, array $allowed)

Check for legal values where the DTD limits things.

Check for unique id attribute :P

Member MediaWiki\Parser\Sanitizer::validateTagAttributes (array $attribs, string $element)

Check for legal values where the DTD limits things.

Check for unique id attribute :P

Class MediaWiki\Permissions\PermissionStatus
Add compat code for PermissionManager::getPermissionErrors and additional info about user blocks.
Member MediaWiki\Preferences\DefaultPreferencesFactory::profilePreferences (User $user, IContextSource $context, &$defaultPreferences)
Inject user Language instead of using context.
Member MediaWiki\Registration\ExtensionProcessor::extractConfig1 (array $info)
In the future, this should be done via Config interfaces
Member MediaWiki\Registration\ExtensionProcessor::extractConfig2 (array $info, $dir)
In the future, this should be done via Config interfaces
Member MediaWiki\Rest\Handler\ParsoidHandler::assertDomainIsCorrect ( $domain)
Remove this when we no longer need to support the {domain} parameter with backwards compatibility with the parsoid extension.
Member MediaWiki\Revision\RevisionStore::__construct (ILoadBalancer $loadBalancer, SqlBlobStore $blobStore, WANObjectCache $cache, BagOStuff $localCache, CommentStore $commentStore, NameTableStore $contentModelStore, NameTableStore $slotRoleStore, SlotRoleRegistry $slotRoleRegistry, ActorStore $actorStore, IContentHandlerFactory $contentHandlerFactory, PageStore $pageStore, TitleFactory $titleFactory, HookContainer $hookContainer, $wikiId=WikiAwareEntity::LOCAL)
$blobStore should be allowed to be any BlobStore!
Member MediaWiki\Revision\RevisionStore::getRcIdIfUnpatrolled (RevisionRecord $rev)
This is overly specific, so move or kill this method.
Member MediaWiki\Revision\RevisionStore::getRecentChange (RevisionRecord $rev, $flags=0)
move this somewhere else?
Member MediaWiki\Revision\RevisionStore::newNullRevision (IDatabase $dbw, PageIdentity $page, CommentStoreComment $comment, $minor, UserIdentity $user)
Introduce newFromParentRevision(). newNullRevision can then be based on that (or go away).
Member MediaWiki\RevisionList\RevisionItem::getDiffLink ()
Essentially a copy of RevDelRevisionItem::getDiffLink. That class should inherit from this one, and implement an appropriate interface instead of extending RevDelItem
Member MediaWiki\RevisionList\RevisionItem::getHTML ()
Essentially a copy of RevDelRevisionItem::getHTML. That class should inherit from this one, and implement an appropriate interface instead of extending RevDelItem
Member MediaWiki\RevisionList\RevisionItem::getRevisionLink ()
Essentially a copy of RevDelRevisionItem::getRevisionLink. That class should inherit from this one, and implement an appropriate interface instead of extending RevDelItem
Class MediaWiki\SpecialPage\ChangesListSpecialPage
Most of the functions here should be protected instead of public.
Member MediaWiki\SpecialPage\ChangesListSpecialPage::getExtraOptions ( $opts)

This should handle options returned by getDefaultOptions().

Not called by anything in this class (but is in subclasses), should be called by something… doHeader() maybe?

Class MediaWiki\Specials\SpecialAllPages
Rewrite using IndexPager
Member MediaWiki\Specials\SpecialBlock::getSuggestedDurations (Language $lang=null, $includeOther=true)

FIXME: This uses a rather odd syntax for the options, should it be converted to the standard "**<duration>|<displayname>" format?

Member MediaWiki\Specials\SpecialLinkSearch::getMaxResults ()
FIXME This special page should not use LIMIT for paging
Member MediaWiki\Specials\SpecialRevisionDelete::addUsageText ()
FIXME: Wikimedia-specific policy text
Member MediaWiki\Specials\SpecialRevisionDelete::tryShowFile ( $archiveName)
Mostly copied from Special:Undelete. Refactor.
Class MediaWiki\Specials\SpecialUncategorizedImages
FIXME: Use an instance of UncategorizedPagesPage or something
Class MediaWiki\Specials\SpecialUncategorizedPages
FIXME: Make $requestedNamespace selectable, unify all subclasses into one
Member MediaWiki\Specials\SpecialUpload::rotationEnabled ()
What about non-BitmapHandler handled files?
Class MediaWiki\Storage\DerivedPageDataUpdater
Define interfaces for the different use cases of DerivedPageDataUpdater, particularly providing access to post-PST content and ParserOutput to callbacks during revision creation, which currently use WikiPage::prepareContentForEdit, and allowing updates to be triggered on purge, import, and undeletion, which currently use WikiPage::doEditUpdates() and Content::getSecondaryDataUpdates().
Member MediaWiki\Storage\DerivedPageDataUpdater::getRevision ()
This is currently used by PageUpdater::makeNewRevision() to construct an unsaved MutableRevisionRecord instance. Introduce something like an UnsavedRevisionFactory service for that purpose instead!
Member MediaWiki\Storage\DerivedPageDataUpdater::isChange ()
This should probably be fixed.
Member MediaWiki\Storage\SqlBlobStore::compressData (&$blob)
make this private, there should be no need to use this method outside this class.
Member MediaWiki\Storage\SqlBlobStore::decompressData (string $blob, array $blobFlags)
make this private, there should be no need to use this method outside this class.
Member MediaWiki\Storage\SqlBlobStore::expandBlob ( $raw, $flags, $blobAddress=null)
make this private, there should be no need to use this method outside this class.
Member MediaWiki\Title\MediaWikiTitleCodec::splitTitleString ( $text, $defaultNamespace=NS_MAIN)

This method should be split up and an appropriate interface defined for use by the Title class.

this method is only exposed as a temporary measure to ease refactoring. It was copied with minimal changes from Title::secureAndSplit().

Member MediaWiki\Title\Title::getContentModel ( $flags=0)
Deprecate this in favor of SlotRecord::getModel()
Member MediaWiki\Title\TitleFormatter::getNamespaceName ( $namespace, $text)
Move this to a separate interface
Member MediaWiki\User\User::saveSettings ()
Only rarely do all these fields need to be set!
Member MediaWiki\Utils\UrlUtils::expand (string $url, $defaultProto=PROTO_FALLBACK)
this won't work with current-path-relative URLs like "subdir/foo.html", etc.
Member MediaWiki\Utils\UrlUtils::expandIRI (string $url)
handle punycode domains too
Member MediaWiki\WikiMap\WikiMap::getWikiName ( $wikiID)
We can give more info than just the wiki id!
File mwdocgen.php
document
Member MWHttpRequest::isValidURI ( $uri)
FIXME this is wildly inaccurate and fails to actually check most stuff
Member MWHttpRequest::setData (array $args)
overload the args param
Member PageArchive::listFiles ()
Does this belong in Image for fuller encapsulation?
Class Preprocessor_Hash
: Consider replacing descriptor arrays with objects of a new class. Benchmark and measure resulting memory impact.
Member PurgeChangedPages::pageableSortedRows (IResultWrapper $res, $column, $limit)
move this elsewhere
File rebuildrecentchanges.php
Document
File rebuildtextindex.php
document
Class RecentChange
Deprecate access to mAttribs (direct or via getAttributes). Right now we're having to include both rc_comment and rc_comment_text/rc_comment_data so random crap works right.
Member SearchEngine::getTextFromContent (Title $t, Content $c=null)
This isn't ideal, we'd really like to have content-specific handling here
Class SearchEngineDummy

FIXME: Dummy class should probably try something at least mildly useful, such as a LIKE search through titles.

Class StripState
document, briefly.
Member TransformationalImageHandler::getClientScalingThumbnailImage ( $image, $scalerParams)
FIXME: No rotation support
Class UnregisteredLocalFile
Currently it doesn't really work in the repository role, there are lots of functions missing. It is used by the WebStore extension in the standalone role.
File update.php

document

Member UploadBase::checkSvgScriptCallback ( $element, $attribs, $data=null)
Replace this with a allow list filter!
Member WatchAction::getExpiryOptions (MessageLocalizer $msgLocalizer, $watchedItem)
Move this somewhere better when it's being used in more than just this action.
Member Wikimedia\Diff\Diff::__construct ( $from_lines, $to_lines)
Don't do work in the constructor, use a service to create diffs instead (T257472).
Class Wikimedia\Diff\DiffFormatter

document

Class Wikimedia\Diff\TableDiffFormatter
document
Member Wikimedia\Diff\WordLevelDiff::__construct ( $linesBefore, $linesAfter)
Don't do work in the constructor, use a service to create diffs instead (T257472).
Member Wikimedia\FileBackend\FSFile\TempFSFile::getUsableTempDirectory ()
Is there any useful way to test this? Would it be useful to make this non-static on TempFSFileFactory?
Member Wikimedia\Rdbms\Platform\ISQLPlatform::makeWhereFrom2d ( $data, $baseKey, $subKey)
This is effectively specific to MediaWiki's LinkBatch. Consider deprecating or generalising slightly.
Class Wikimedia\Stats\BufferingStatsdDataFactory
Evaluate upstream's StatsdService class, which implements similar buffering logic and was released in statsd-php-client 1.0.13, shortly after we implemented this here for statsd-php-client 1.0.12 at the time.
Member WikiPage::getActionOverrides ()
Move this UI stuff somewhere else
Member WikiPage::insertOn ( $dbw, $pageId=null)
Factor out into a PageStore service, to be used by PageUpdater.
Member WikiPage::supportsSections ()

The skin should check this and not offer section functionality if sections are not supported.

The EditPage should check this and not offer section functionality if sections are not supported.

Member WikiPage::updateRevisionOn ( $dbw, RevisionRecord $revision, $lastRevision=null, $lastRevIsRedirect=null)
Factor out into a PageStore service, or move into PageUpdater.
Member WikiRevision::$isTemp
Unused?