^ Except dependencies like Parsedown.
The readme is now out of date. The legacy version of Parsedown was removed because we no longer need to support PHP versions older than 5.3. The stub file that loads ParsedownModern.php stays in place because it has the "class_exists" check.
See #300. Apparently, when using the `files` autoloading mechanism, Composer will only include the files for one version of the library (i.e. the first one loaded). Let's see if we can fix that by switching to a `psr-0` autoloader. This requires a bunch of changes to the standalone autoloader and the factory registration process.
The readme.txt format that's used by WordPress is not quite standard Markdown. It includes a couple of features that are not directly supported by popular Markdown parsers. One of those features is parsing "= string =" as "<h4>string</h4>" (the opening "=" must be at the start of the line). Leading whitespace is allowed. This syntax is typically for plugin version numbers in the changelog section.
The problem: the readme parser discards leading whitespace when parsing these headers. This means it can also discard the previous line break character(s). As a result, this markup:
* abc
= 1.2.3 =
* def
Becomes this:
* abc
<h4>1.2.3</h4>
* def
The way that Parsedown handles this markup is to make the H4 a part of the preceding list item. And that's a bug.
Fixed by keeping leading whitespace instead of throwing it away.
Closes#68
The update checker uses class_exists in several ways:
- As a guard clause around `class Whatever` definitions. This ensures we don't try to define a class that has already been loaded by a different plugin. In this case, autoloading is not necessary because we already know how to load the class. Also, we *want to* load our version of that class if possible - the version that gets loaded by somebody else's autoloader might be different and incompatible.
- As a guard clause before `require` statements that include a class. This is conceptually the same as the previous example.
- To enable optional features if Debug Bar is active. The latest compatible version of Debug Bar doesn't use autoloading, so it would again be unnecessary in this case.
- Added experimental GitHub support. The new PucGitHubChecker subclass can check a GitHub repository for plugin updates. Depending on configuration, it will use either the latest release, the latest tag, or the specified branch. It can also automagically extract version details (description, changelog, etc) from a number of different locations - release names, plugin headers, readme.txt, changelog.md and more.
- The "slug" field of the metadata file is no longer used. The update checker will now use the slug passed to the class constructor, or generate a slug based on the plugin file name.
- Other minor changes to slug handling.
- Version bump to 2.0.