Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Fix WordPress Plugin Theme Check Error WordPress

  • REFUNDED

I want to use this plugin for WordPress themes updates - https://github.com/YahnisElsts/plugin-update-checker

But it generates some errors upon Theme Check WordPress plugin, please check this issue - https://github.com/YahnisElsts/plugin-update-checker/issues/188

I fixed most of the errors simply removing some files from plugin, such as ParsedownLegacy.php And I followed recommendations from plugin developer.
But file Parsedown.php still contains this error, don't know how to deal with it.

WARNING: Found PHP short tags in file Parsedown.php.
Line 762: if (preg_match('/^[(.+?)]:[ ]<?(\S+?)>?(?:[ ]+''(['')])?[ ]$/', $Line['text'], $matches))

What I want in the end is the working plugin without any Theme Check errors.

Thanks.

Answers (4)

2018-04-10

Francisco Javier Carazo Gil answers:

Good morning,

The warning appears because inside of the string of the preg_match this is present:

Line 762: if (preg_match('/^[(.+?)]:[ ]<?(\S+?)>?(?:[ ]+''(['')])?[ ]$/', $Line['text'], $matches))

You can send an issue in GitHub to YahnisElsts. Maybe he can do a new check but yes, it seems like if this is trying to find some PHP code so it will need to do something similar to this.

The problem now is not on plugin-update-checker, the problem is in Theme Check. It must not create warnings for strings inside a function.

2018-04-10

Arnav Joy answers:

Can you show us URL of your site?

2018-04-10

Cesar Contreras answers:

The warning appears because characters similar to the short PHP tags are present within the preg_match string.

They are only Warning and Information messages that do not affect the functioning of your plugin at all.
you can disable those error messages in PHP for your WordPress from your configuration file wp-config

- Inside your wp-config.php file, look for the following line:
define ('WP_DEBUG', true);
-It is also possible, that this line is already set to false. In that case, you’ll see the following code:
define('WP_DEBUG', false);

- In either case, you need to replace this line with the following code:
ini_set('display_errors','Off');
ini_set('error_reporting', E_ALL );
define('WP_DEBUG', false);
define('WP_DEBUG_DISPLAY', false);


*Don’t forget to save your changes and upload your wp-config.php file back to the server.

You can now visit your website to confirm that the PHP errors, notices, and warnings have disappeared from your website.

2018-04-10

Reigel Gallarde answers:

this is the short tag.. <?

replace each with [<]? and it will still has same effect but will not be detected as short tag