User:Kingbotk/Plugin

The Kingbotk plugin is a set of AWB plugins written by Kingboyk in VB.NET and used by various automated bot accounts including Kingbotk. The plugin also provides features to assist article reviewers, and ships with a reusable library of functions and objects for use by programmers.

26 February 2007
It would probably be wise to have AWB skip pages which contain WikiProjectBanners or WikiProjectBannerShell for now as the plugin might move templates from out of that container, or place new banners at the top of the page. If you have any ideas about how to proceed please place them on the talk page. --kingboyk 20:06, 26 February 2007 (UTC) Edited --kingboyk 15:28, 2 March 2007 (UTC)

Downloading and using the plugin

 * User guide

Shipped with AWB version 4.1.0.0.
 * Download '''Version 1.4.0.3 9 September 2007

Warning and disclaimer

 * This tool is released as is and without warranty. You are RESPONSIBLE FOR YOUR OWN EDITS.
 * AWB and this plugin are both very powerful tools. You should familiarise yourself fully with the guidelines, instructions and operation of both tools before using them.
 * Ensure you have the latest version, or that any upgrades/changes in newer versions don't apply to you.
 * Instructions for automated use with a bot account:
 * The above guidelines doubly apply when doing automated edits, particularly making sure you understand what the plugin does and doesn't do.
 * The template tagging feature is extremely well tested, but sometimes new internal changes introduce the risk of something breaking or a new bug. Always run a manual test if a version's release notes says it includes such changes. The author runs tests too but can't test for every eventuality and relies to an extent on the users to test.
 * Before using a new template plugin do a few manual edits first. Some template plugins (WPBio, WPMilHist, WPAustralia, Generic) are very well tested; others might never have been used.
 * If you've run successful tests on a new version or found a bug please post on the talk page asap.

Specification
This plugin comes with several WikiProject-specific tools:

Templating plugins
All templating plugins:
 * Work together. Multiple plugins can be active at the same time to allow tagging for more than one project.
 * Have optional user configurable parameters
 * Use safe, well tested regular expressions to avoid double tagging, recognise badly formatted tags, and safely integrate new parameters into existing templates

WPBiography plugin

 * If WPBiography is missing, it adds it


 * The importance= parameter is replaced with priority=
 * Living=yes is optionally added/replaced if missing or =no
 * Blp is replaced with living=yes
 * Activepolitician is replaced with activepol=yes
 * reqphoto is replaced with needs-photo=yes
 * BioCOTWs is replaced with collaboration-candidate=yes
 * listas= is calculated and added if no DEFAULTSORT key is present (manual mode only; there are too many variations in human naming for this to be done by bots)
 * listas= is removed if a valid DEFAULTSORT key is present
 * the template call is reformatted and (if living=yes) moved to the top of the talk page, so that the living persons bio warning gets its proper placement
 * marks parameter and template renaming as minor edits, parameter value changes as major

Albums plugin

 * If Album is missing, it adds it
 * Needsinfobox is replaced with needs-infobox=yes

Australia plugin

 * If Australia is missing, it adds it

India plugin

 * If India is missing, it adds it
 * reqphoto is replaced with image-needed=yes

Military History plugin

 * If WPMILHIST is missing, it adds it

Novels plugin

 * If NovelsWikiProject is missing, it adds it
 * marks parameter and template renaming as minor edits, parameter value changes as major
 * is replaced with needs-infobox=yes
 * is replaced with incomp-infobox=yes
 * reqphoto is replaced with needs-infobox-cover=yes

Songs plugin

 * If Songs is missing, it adds it
 * sir is replaced with needs-infobox=yes

General

 * Move talkheader to the top
 * Move skiptotoctalk to the top
 * Replace the DEFAULTSORT template with the same magic word
 * Move the DEFAULTSORT magic word to the top

Generic templates plugin

 * If your WikiProject's template is "generic" (you have a class= parameter and no workgroups, and no need for other customised programatic logic) the plugin now supports your template! Simply enter the name of the template, any alternate names (redirects), and click a few boxes to configure the plugin. See Generic WikiProject templates for more information. Note that even if your Project's template has workgroups, you can use the plugin on talk pages/categories which don't need a new workgroup parameter to be added. The plugin doesn't remove parameters it has no knowledge of; rather, if your Project doesn't have a specific plugin you simply won't be able to add such parameters.

Wikipedia Assessments plugin

 * Loads and optionally cleans articles, then prompts user to (p)review the article
 * Presents reviewer with an assessment form, with checkbox options for class, importance, etc
 * Allows reviewer to leave a /Comment

WPBiography plugin

 * , (marked as minor),,  (no changes made by bot - page skipped), , ,  (a bit more going on here),  (blank page)
 * Logs

Version 2

 * Given the rate of change of WikiProject templates, I think we need to consider extending the "generic template" functionality to include adding/changing/removing user-configurable template parameters. Instead of developing plugins for each template, WikiProjects would be encouraged to build and share their own XML settings files. Possibly some WikiProjects will need programatic support still, if the plugin needs to apply more advanced logic to their templating, but I think most won't.
 * WikiProjectBanners/WikiProjectBannerShell needs to be supported but I'm not sure yet how. Do we place WPBiography with living=yes inside or out? Do we create WikiProjectBanners instances or just recognise their presence? Current code which puts any talkheader present to the top, and any WPBio with living=yes as second in priority, would need to be amended too.
 * Do we want to have the plugin (via AWB?) load the article and look for stub and infobox templates?

Manual assessment

 * Look at whether it would be practical/desirable to have extra params/templates on the manual assessments popup form (per Talk)

Other planned changes

 * The todo comments in code
 * Consider controlling length of edit summaries by using a generic collection of important/unimportant edit summary items, and deciding on which to use at the end of processing the article (currently large category names, more than one template at a time, or multiple parameters are causing the edit summary to get chopped).



Possible future enhancements

 * Sanity-check parameter values and (in bot mode) log any which need manual inspection. Currently the plugin just ignores parms and values it doesn't know about, and only logs badly misformed tags (those which break it's main regular expression).

Bot

 * Rather than just working through Category:Living people and tagging with living=yes, the bot could check any biography and apply AWB's living people check to add it to the category, then tag the talk page with living=yes. This would require a new permission for my bot as I'm currently permitted to do talk-page tagging only. At the present time it's not a necessary change as I have enough to do tagging the living people and then the people by occupation categories. It might be useful for making more of an intelligent bot, however.
 * In the longer term, plugins could be used to make AWB more of a bot. Save talk page lists in a database, periodically scan categories and compare against the WPBio living persons category/transclusions. Bot manager, predefined jobs (including creating lists).

Version history
'''Version history. Select show to expand.'''

Done

 * Menu items and user interface
 * Multiple plugins per DLL.
 * Turn plugin on/off
 * Statistics tab
 * Read/write XML settings
 * Implement template positional placement code per User_talk:Kingboyk
 * Leave the category talk pages in the list and tag with class=Cat
 * Manual assessments: clean up article, inspect it in preview mode, and then open talk page for tagging and applying assessmentgive
 * Bot mode: give AWB a kick if freezes up.
 * Check that the article attached to the talk page hasn't been deleted (red link)
 * Support for "generic WikiProject templates", allowing users to define their own template instance without it having to be specifically programmed in
 * Added Milhist, Albums, Songs template plugins
 * Added new Milhist, Bio and Australia workgroups
 * Two new boilerplate text buttons on the Comments form, per User:Plange
 * Timer-reset button
 * Option to turn nudging on/off
 * Context menu and XML settings for WP Novels
 * Log uploads
 * Logging features split out to a separate independent DLL (WikiFunctions2)
 * Full support for WP India
 * Bug fix: Date formatting in log entries where user's Windows settings aren't English
 * Modified settings load/save code in line with AWB changes. Plugin can also convert old settings schema to new.
 * Automated edit summaries in assessments mode

Feature requests
Please place your requests on the talk page; a developer will move requests which are being considered here.


 * Perhaps sanity check existing params, see Talk. --kingboyk 16:10, 28 September 2006 (UTC)
 * Ability to replace one template with another using the generic templates plugin. Mike Peel 11:30, 2 December 2006 (UTC)
 * Or - rather than have all this parameter support specific to each project what about defining the parameters in the XML settings and generically coding for all of them. Indications could be made for radio button type options to group the parameters to be alternatives to each other. (i.e. like the "stub, start, a-class, b-class" etc). :: Kevinalewis  :  (Talk Page) / (Desk)  17:54, 7 December 2006 (UTC)
 * I'm hoping to move to a more user-configurable model in version 2. These are both good ideas which I'll consider at the time. --kingboyk 20:03, 27 March 2007 (UTC)
 * Note that Mike no longer uses Windows or AWB.
 * Could you have the plugin remove the "auto=yes" parameter from the WPBiography tag, if it exists, when assessing such an article for another WikiProject? jwillburtalk 02:45, 24 April 2007 (UTC)
 * See if there's any reasonable way of adding a "photo/image needed" tag in assessments mode, when user is adding a WP template which doesn't have a needs photo parameter. (Per a post by User:JodyB). --kingboyk 15:17, 28 April 2007 (UTC)

Technologies used
The plugin makes use of various technologies including: inheritance (see also polymorphism and encapsulation), interfaces, regular expressions, reflection, XML, XHTML, GDI+, and Windows Forms. Of course most modern programs use most or all of these but listing them like this makes me look clever ;)

Developers
The plugin was conceived and developed by, and is maintained by,. Since version 0.90.1 has also had SVN write access and he will be helping me with development and adding new features.

The plugin is written in VB.NET. If you have experience in very object orientated VB.NET library programming and some time to spare, I will consider giving you SVN access. Please drop me a line by any of the usual methods.