Commit Graph

18 Commits

Author SHA1 Message Date
Toni Viemerö 46ee454f68 Fix PHP 8.4 deprecation errors
Remove type declarations for parameters that are nullable to get rid of
deprecation errors in a backwards compatible way.
2025-04-29 17:53:45 +03:00
Yahnis Elsts a42e1e7346 Use wp_strip_all_tags() instead of strip_tags() when available
Supposedly, it's better at stripping the contents of <script> and <style> tags.
2023-05-01 12:22:04 +03:00
Yahnis Elsts 4b6127f0f2 Put all^ PUC classes in namespaces.
^ 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.
2022-10-08 23:15:37 +03:00
Yahnis Elsts 9748abe1bd Add support for "Requires PHP" header fields.
In the update metadata the field is called "requires_php".

Closes #355
2020-04-07 16:06:24 +03:00
Yahnis Elsts bbe88a70d6 Attempt to fix errors caused by using Composer-generated autoloaders when multiple versions of the library are loaded at the same time.
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.
2019-09-27 17:06:01 +03:00
Yahnis Elsts f11ffce720 Fix the parser ignoring the last readme.txt section when it's empty. 2018-09-26 11:18:00 +03:00
Adrien Foulon 89e8849957
Fix PHP notice "Undefined offset: 1 in readme-parser.php on line 124".
The for loop was iterating including the count index of the $_sections, it should be excluding
2018-09-23 16:47:42 +02:00
Yahnis Elsts f7f63d203d Fix PHP notice "Undefined offset: 1 in readme-parser.php on line 161".
Let's discard incorrectly formatted "upgrade notice" sections instead of triggering PHP notices.
2018-01-08 12:49:22 +02:00
Anu Gupta c7fcfb38b1 Force evaluation order for PHP 7 conpat
As per http://php.net/manual/en/migration70.incompatible.php#migration70.incompatible.variable-handling.indirect

In PHP 7, indirect access to variables, properties, and methods is now evaluated strictly in left-to-right order. Code that used the old right-to-left evaluation order must be rewritten to explicitly use that evaluation order with curly braces
2017-09-07 00:49:29 +01:00
Yahnis Elsts f41dc30d28 Minor fixes and some comments 2016-12-28 16:09:28 +02:00
Yahnis Elsts f64c3170cc BitBucket support is now semi-usable.
More testing required. Could probably refactor to reduce duplication; lots of overlap with GitHub integration.
2016-12-22 19:10:05 +02:00
Yahnis Elsts 5b427b4e28 Minor: Fix typo in a comment. 2016-12-22 16:05:15 +02:00
Yahnis Elsts 73852adb2d Fix parsing of "= version =" headers in readme.txt
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
2016-09-14 19:42:09 +03:00
Yahnis Elsts 71631d1306 Minor: Fix inconsistent whitespace. 2016-03-15 13:56:45 +02:00
Bas de Kort 0b4a9d16cf Add: Parsedown.php (1.6.0) 2016-03-11 06:51:43 +01:00
Bas de Kort d91e930c7b Rename Parsedown.php to ParsedownLegacy.php 2016-03-11 06:51:09 +01:00
Yahnis Elsts 317a45dc45 Prevent class_exists() from calling autoloaders.
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.
2015-06-17 12:30:05 +03:00
Yahnis Elsts 03dd38fd71 Add support for updating plugins hosted on GitHub.
- 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.
2015-02-10 11:46:46 +02:00