Can an SBT plugin embed tasks from another plugin? - sbt

I've created a plugin that generates some web resources that need to be compiled using the sbt-webpack plugin. Ideally my plugin would just have a task bundle that will generate some resources and then it will bundle them with the webpack task from the sbt-webpack plugin.
What is the right way to incorporate tasks from different plugins into the code defining my tasks in my plugin?

Declaring a dependency on another plugin should be enough. You need to add this line to your auto-plugin:
override def requires = stejskal.sbt.WebpackPlugin
This will ensure that sbt-webpack is enabled whenever your plugins is and its settings will be loaded before the ones you define in your plugin. Plus whatever keys sbt-webpack adds to its autoImport object will be available to the users of your plugin as well.

Related

Can I get Wordpress Plugin Data through Wordpress API?

I am looking to build a wordpress website with GatsbyJS (so no PHP usage. Just using Wordpress API and react JSX on the front-end).
I know I can get any core wordpress data at /wp-json route, but I'm not sure about plugin data. I've tried to look up plugin data and it does not seem to be included in wp-json.
I found this "compatible plugins" page: https://v2.wp-api.org/guide/plugins/
Does this mean that for most other plugins data would not be present in the Wordpress API?
Correct. Unless these plugins expose their data via the REST API (either by extending the existing endpoints or by creating their own, like some plugins do), you won't be able to access it.
In such cases, you either ask the developers to expose their plugin's data via the REST API or you code some custom endpoints yourself to get the data you need from them.

drupal core install module and change the enable link to work with module_filter

I am using the filter module which makes it easier to manage modules which uses "/admin/modules?filter=" to list specific modules.
Since in core when installing new modules it displays the "enable newly added module" link, which actually only links to all modules,
I was wondering if it might be possible to create a custom module that replaces that link and redirects instead to "/admin/modules?filter=NEWLY_INSTALLED_MODULES_SEPARATED_BY_%20" ?
https://www.drupal.org/project/module_filter/issues/2952200#comment-12584379

Getting started with Redux in WordPress

I apologize if this has been asked before, but after doing some research, I could not find any resources answering this specific question of mine.
I'm trying to use the Redux framework in my WordPress theme. I used the builder to get started, which is linked to on the plugin page. I customized my framework there and chose the option of "embed only" (Embed Only: TGM is not used and Redux is embedded within the theme/plugin). I also exported as a custom theme, which uses Underscores. As a result, I now have admin directory inside of my theme, with an "options-init.php" file in it. I've been modifying this file to add my options. Is this right? In the documentation it mentions to look for a sample-config.php file, and to copy that and modify it, but I can't find that anywhere. I want to make sure I'm doing this right before I get too far and find an issue.
Also, how do I make sure the framework stays up to date with the latest security patches? Is it a better idea to install it as a plugin rather than embed it in the theme itself?
Lead dev of Redux Framework here. It is very much a better idea to run Redux via a plugin if you want your users to have security updates.
Another option is to embed redux, but to use TGM to suggest for users to install the plugin. This way your theme is not dependent on Redux, but the moment they install the plugin, that version of Redux will take over.
It's up to you, but the plugin is the way to go.

Notify When Update(s) Performed

I'm looking to create a tally of the number of core, theme and plugin updates performed on a given WP installation. I envisage that this would involve creating an option into which I store and int value that is incremented every time a core, theme &/or plugin update is successfully performed.
To enable this I was hoping for some hooks are called when each of these update types are performed. However, I can't seem to find any relevant hooks for plugin and theme updates.
For core updates, it looks like I can simply increment the relevant options field whenever the '_core_updated_successfully' hook is called.
Are there any relevant hooks available for plugins and themes?
Can you suggest an alternative methodology?
Thanks in advance.
You can run the upgrader_process_complete action hook. it runs when the download process for a plugin install or update finishes. It takes a type parameter for core, plugin or theme.

Plugin System for symfony2

Is there a known tutorial that shows how to create a plugin system for symfony2?
Something like the big cms' have, a folder in the root directory where you can place your plugins.
Google just made a fool with me because the symfony1 bundles were called "plugins".
I imagine plugins to be just bundles, but not in the src but in the new plugins one.
They should be registered at runtime.
I believe you can use Event Dispatcher from Symfony to achive want you want. The below link might help you.
http://symfony.com/doc/master/components/event_dispatcher/introduction.html
I don't have any guide to explain how to use this for plugin system as I am personally looking for it.

Resources