Automated WordPress Installation with themes/plugins - wordpress

I have used Fantastico and Softaculous in the past to install WordPress, however they are limited in that they require me to step through the wizard manually, and they can't set the default theme or install plugins.
Is it possible to write a script that automates the process? Would this be possible in PHP?
Even if it's not possible with a script, I am at least hoping to find a way to set the default WordPress theme upon installation.

You can switch themes using the switch_theme function. As for automating, of course it's possible. Your script could grab the wordpress code base with curl, includes a wp_config.php file you've already filled out, read the database info from that file in order to create the database and grant permissions as appropriate, and then run the wp_install process itself.

You can create a custom script in Softaculous and have your themes or plugins pre installed.
Here is the guide :
http://www.softaculous.com/docs/Making_Custom_Package

Related

Wordpress - migrating posts and images only

I am changing my Wordpress theme. I've set it up on a development server. I now want to import the posts, pages and media to populate the database.
I have been using the built-in Wordpress import/export function which is erratic when it comes to media. Sometimes all the imports fail, sometimes some of them fail. It's problematic and I am giving up on that.
Is there a reliable plugin that I can use? I've been searching without success.
The best way to create a dev environment for wordpress is to create a mirror copy of it and then changing its url.
You would need to copy over all the files and restore the database on the dev environment and then hard coding your dev url in wp-config.php. At that point, you can upload the new theme and activate it.
I've tried all types of plugins as well as WP built-in export/import functions. The solution that worked well for me was All-in-One Migration plus All-in-One Migration Extension so allow the transfer of 16GB of data. I've had one or two hiccups along the way but the technical support folks at ServMask are very responsive and solved the issues expeditiously.

Is it possible to host my WordPress plugin in GitHub?

I know that the WordPress plugin directory is hosting site and not a listing site.
In order for your plugin to appear in the directory is to host your plugin with them using SVN.
I have used their SVN for a while and just wonder if I can instead use a GitHub repository and whenever I release a new version on GitHub it will automatically release an update on the WordPress sites which the plugin is installed.
I really think that if I used GitHub in hosting my plugin, it will not appear in the WordPress plugin directory? Am I right or wrong about it?
I want to use GitHub to release and at the same time, I want my plugin in the WordPress plugin directory.
I have tried so far following this tutorial: https://www.smashingmagazine.com/2015/08/deploy-wordpress-plugins-with-github-using-transients/
But this is for self-hosted plugins.
Unfortunately there's not a straight way to get what you're looking for. At the root of it, you need to have your Plugin hosted and maintained on their SVN.
That said, there are some Git to SVN Mirroring options available that, while a bit convoluted to set up (and sometimes providing mixed results) should be able to handle what you need if you can bear to walk through the initial set-up.
Check out the following gist: https://gist.github.com/kasparsd/3749872.
If you set it up properly, you'll be able to effectively deal with your plugin like it's hosted on GitHub where it will mirror itself into WordPress's SVN, so it will show up in the Plugin Repository.
Unfortunately I haven't seen it even broached as an issue since what, 2015? So the odds of native GitHub repo integegration at this point don't seem all that high.

Wordpress Multisite - Get plugin to pull info from a single install on mainsite

I am using a plugin that needs to be setup on each individual sub site so that an api key can be activated.
Is there a way to change wp-config or the plugin data so that the subsites pull their plugin information from the network install page vs the individual plugin activation in order to avoid having to install and activate on each subsite?
Sounds like the plugin is not made for multisite. You cannot simply change that. Either the plugin source code has to be modified or you can make a new plugin that tries to modify how the plugin works.
The second option is recommended and I imagine it should hide the settings page on each individual site and also filter the option where the API data is saved. In any case, it is a job for a programmer who can make WordPress plugins.

How to edit a wordpress theme without having to zip and upload?

I am trying to create a new WordPress theme. My issue is wanting to update the way it looks and see results in real time.
I suppose one option would be to write a script that automates zipping and copies the files over to the themes folder of my locally run WordPress site.
Is this the best way? It doesn't feel very elegant. Any ideas?
Just use a tool like MAMP / WAMP (or whatever you are using currently) and set up a local test install, in this folder you will have wp-content/themes/your-theme. You can directly edit files here and keep refreshing your browser to preview changes. Once you are satisfied you can commit to your version control or zip and upload like you do now.
Cheers

Building a Wordpress site on Openshift to scale

Openshift's default app generator sets Wordpress creation of sites to be a non-scalable version of their gears. I'd like to know if there is a way to set a scalable instance and install wordpress on it.
thanks!
I am working on this today actually and got a scalable wordpress site up and running on OpenShift. (www.runcloudrun.com)
I disabled the symlinks in the action_hooks and manually added my theme and plugins to the php/wp-content/themes and plugins directory. I also used a S3 plugin to store all of my media files on amazon s3 so my images and media would scale once OpenShift adds addiontal gears.
I am writing a blog post on how to do all of this and it should be posted later this week.
Edit to add the blog post: http://www.runcloudrun.com/?p=22
--
gs
You can checkout this AppFog solution. And if you visit his Github you'd find an OpenShift wrapper as well. These two might give you all the sparks it needs to think out a scalable solution on Openshift.
Just use the git source URL and create a new app with PHP. Once the app is created, add MySQL to it.
Once you've created the app, the important next step is to check in your modules directly to the Git repo.
By default, we wanted folks to be able to download plugins directly from Wordpress, but when you scale, those files aren't copied over. Also, the filesystem for each gear in a scaled app isn't shared, so modules uploaded after you scale aren't magically copied to all gears. Given that limitation, we decided to mark the QuickStart not scalable, so as to prevent unfamiliar users from getting into trouble.
If you're familiar with Wordpress just check those modules in directly to your source, and everything will scale.

Resources