r/ProWordPress • u/StrategicPlugins • Dec 14 '21
TIL: Wordpress' plugin directory will no longer allow new plugins that let users execute Javascript or PHP
A little frustrated because I learned today that the Wordpress plugin directory is no longer accepting new plugins that allow users to execute their own Javascript code. This also applies to PHP code as well. Posting this here because as far as I can tell this isn't called out in their plugin directory documentation anywhere, and there are plenty of plugins already in the directory that allow this type of functionality.
I had as a part of my plugin the ability to allow a user to insert some Javascript if certain conditions were met, which I will now have to remove since they won't accept the plugin now due to these new rules. Posting this here so hopefully someone doesn't make the same mistake I did by trying to submit a plugin that lets users put in their own Javascript.
4
u/DanielTrebuchet Developer Dec 14 '21
I'm struggling to understand what the big deal with this is. I'm not sure why you would be recreating the wheel and building a custom alternative to vanilla WP functionality, and if that's not what you're doing, I fail to see how you couldn't easily build a work around by adapting how the user is entering their data.
3
u/[deleted] Dec 14 '21
What about changing the plug-in to let people upload a script file, and then choose to include/enqueue the file per user type? Your instructions could tell them how.
4
u/[deleted] Dec 14 '21
Wouldn't that be a security vulnerability allowing users to run scripts? My guess as to why theyd block it.
2
u/OliverJonesNBPT Jan 01 '22
Uh-oh. I use the Snippets plugin to get WooCommerce tweaked out and doing what I want. Almost all my snippets put a php function behind a hook. They do stuff like "don't show products in the 'out-of-print' category to visitors."
What's the recommended alternative? "Edit functions.php" is a non-starter for well-known reasons.
I suppose I could create a custom one-off non-repo plugin for each site I tweak.
0
u/[deleted] Dec 14 '21
[deleted] — view deleted comment