Is it necessary to auto delete my WP plugin database tables when users deactivate/delete my plugin?

In my opinion, a best practice would be to clean everything on uninstallation. It’s also mentioned as a best practice in the docs: When your plugin is uninstalled, you’ll want to clear out any plugin options and/or settings specific to to the plugin, and/or other database entities such as tables. However, if you’re struggling to … Read more

Why is one phpunit test throwing an error on one class when all other classes are similar without error?

the async property is marked as protected, so that usually signifies that it is related more to your implementation’s details rather than functionality. Ideally you would write your tests to test the public methods you have exposed. Testing that the class property you set in the constructor of one class is an instanceof what was … Read more

Use $_GET inside a shortcode print empty Array

$_GET is a glob var. which is triger/created when you’re sending html form data og visit a link. When is send from form you can add the needet info in “action” atr. But from youre example i see onlu that you return from the function some string…did not see the part of adding it to … Read more

Is there a best practice remediation for PhpStorm’s warning that void function the_post_thumbnail is used?

The solution is simple, don’t echo the result of that function, there is no result to echo. echo the_post_thumbnail(array(155,55)); Is equivalent to something like this: echo ”; the_post_thumbnail(array(155,55)); Functions that begin with the_ in WP don’t return things, they output things. Some of them let you pass a parameter that lets them return instead, but … Read more

Would Gutenberg be considered a PlugIn?

It’s slightly complicated. The default editor in WordPress is what’s properly called the “block editor”, but while this editor was being developed it was known as the “Gutenberg” project. The development on Gutenberg was done in the form of a plugin, which people could install for the purposes of testing and contributing. When WordPress 5.0 … Read more

How to tell which one of my plugins are paid or free?

Usually premium plugins that came with the purchase of a theme are updated via an external updater, not the wordpress built-in one. That could be one of the clues. One obvious clue would be that the plugin has some kind of login/licence key system. But when it comes to taking a look in the code, … Read more

Save values from a pre_post_update

The second attempt is closer to the result, as it is filer, not action, and you can return proper data. But code has several mistakes, I have fixed them. The proper number of parameters for the filter is 3. The first parameter is $data which should be modified and returned. It is the standard behaviour … Read more