Fandom

Wikia Developers Wiki

CacheCheck

915pages on
this wiki
Add New Page
Talk4 Share
CacheCheck crosses out resolved entries on the cached special pages (listed below) when you load those pages. This is intended to save time in cleanup because you won't have to check each listed page to make sure it still needs work. Note that the script can take several seconds to check over all of the things listed on the page, especially for large listings. The script will also cross off links to these pages from Special:SpecialPages if there is nothing listed on the linked page.

Installation

Add this JavaScript on your wiki:

Global Personal Site-wide
w:Special:Mypage/global.js Special:Mypage/common.js MediaWiki:Common.js
window.cacheSkip = [];
window.cacheSkipLimit = 1000;
window.topLevelCat = '';
importArticles({
    type: 'script',
    articles: [
        'u:dev:CacheCheck/code.js'
    ]
});
importArticles — Best Practices for installing JavaScript on Fandom
The importArticles statement is designed to combine multiple HTTP requests into a single data transfer, allowing multiple scripts to load and execute faster. If you've been installing several different scripts, your JavaScript file has probably accumulated unnecessary import statements. Click "Expand" to learn how to efficiently batch import scripts to speed up performance and make your code look cleaner. One other approach is by using the MediaWiki:ImportJS.
If your JavaScript file has several lines of code that say importScript, importScriptPage, or importArticles, you may be able to combine them! By batch importing a collection of scripts with a single import, your JavaScript code will load faster and look cleaner. Consider the example below. On the left is an example of what your JavaScript file might currently look like. On the right is how you could improve that code.
Multiple imports — messy and slow One import — clean and efficient
importScriptPage('AjaxRC/code.js','dev');
 
importScript('MediaWiki:localScript.js');
 
importArticle({
  type: 'script',
  article: 'u:dev:FloatingToc/code.js'
});
 
importScriptPage('page1.js', 'wikiname');
 
importScriptPage('page2.js', 'wikiname');
importArticles({
    type: 'script',
    articles: [
        'u:dev:AjaxRC/code.js',
        'MediaWiki:localScript.js',
        'u:dev:FloatingToc/code.js',
        'u:wikiname:page1.js',
        'u:wikiname:page2.js'
    ]
});
Note: In this example, pay close attention to the placement of commas and other punctuation. For people who aren't familiar with programming (and even those who are!), a common mistake when writing code is to accidentally delete, forget, or misplace critical symbols like commas or quotation marks. This can cause a syntax error that breaks the code. Carefully follow the convention shown here when using importArticles.
But there's much more to importArticles than just this! For more examples and advanced usage, see the help page at Help:Including additional JavaScript and CSS.


Customization

Note that the first two lines of the installation code can be omitted if you are not changing their values.

"cacheSkip" is a list of the pages you do not want the script to run on. You can copy this list and remove the pages that you do want it to run on (be careful that there are quotes around each page and commas between them are intact):

cacheSkip = ['Specialpages', 'Deadendpages', 'Lonelypages',
    'Uncategorizedcategories', 'Uncategorizedpages', 'Uncategorizedimages', 'Uncategorizedtemplates',
    'Unusedcategories', 'Unusedimages', 'Unusedtemplates', 'UnusedVideos',
    'Wantedcategories', 'Wantedpages', 'Wantedfiles', 'Wantedtemplates'];

If "cacheSkipLimit" is lower than the number of results shown on a page, the script will not run on that page. (For example, if you are viewing Special:WantedPages?limit=500 and this value is set to 250, the script will not run.) You can also set this value to -1 to make the script not run on any pages.

You can use "topLevelCat" to specify the top level category on your wiki, which should not be categorized. If it is the only category listed in UncategorizedCategories, that link will be crossed off on SpecialPages.

Notes

Please report any bugs or suggestions to me or on the talk page. I'd be happy to add any features that are desired. This script has not been tested on Monobook, but should work the same.

If you import ListFiles after this script has run on a gallery-type special page, resolved images will not be included in the raw text list.

The UnusedVideos query appears to be broken at the moment.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.