awesomemotive / one-click-demo-import

One Click Demo Import plugin
https://www.awesomemotive.com/
195 stars 83 forks source link

Feature Request : Add support for plugin install and activation #213

Closed ravishakya closed 3 years ago

ravishakya commented 4 years ago

I have a gym theme it has two demos. If user imports demo 1, then he doesn't need woocommerce. If user imports demo 2 the wocommerce and other woocommerce related plugins will also be installed. I know i can do that with some hooks but it will be useful if one click demo import has built in functionality for that.

eg.

/* Recommended plugin for this demo */

'import_file_name'           => 'Demo Import 1',
'categories'                 => array( 'Category 1', 'Category 2' ),
'plugins' => array(
            array(
               'name'      => __( 'Woocommerce', 'text-domain' ),
               'slug'      => 'woocommerce',
            ),
         )
capuderg commented 3 years ago

Hi @ravishakya,

better late than never -> We added support for required and recommended plugins in our plugin. 🥳

Please take a look at our docs: https://ocdi.com/quick-integration-guide/ especially the "Recommended Plugins" section which will explain how to add this new feature to the plugin.

Have a nice day!

ravishakya commented 3 years ago

Thank you that was a much-needed feature.

Some suggestions

  1. It would be better if I can choose plugins according to the demo. Let's say one demo may need a slider plugin and another might not.
  2. After importing demo content there are two buttons visit site and theme settings. It would be better if we(the developer ) has a little control over this. Meaning the visit site and theme settings should open in a new tab ( just my thought ). And theme settings may always not be the customizer. If I am using Elementor page builder I would like to redirect to the Elementor settings, not the customizer settings.

Thank You

capuderg commented 3 years ago

Hi @ravishakya,

Thank you very much for your feedback.

I've created a new GH issue for your second point: https://github.com/awesomemotive/one-click-demo-import/issues/239

And for your 1. suggestion, I think you could achieve that by checking these $_GET parameters: page=one-click-demo-import&step=import&import=1 and change the list of plugins based on the import value. Where 0 would be your first demo, 1 would be the second, and so on... But you would need to first define all of the possible theme recommended plugins and return that array if the import GET parameter is not set. And only if the GET parameter for import is set, return the filtered list of recommended plugins.

Let me know if you have any questions.