Automatically enable custom theme, plugins and default content on installation?

Sure. wp_install_defaults() is a pluggable function. (As are wp_new_blog_notification() and wp_upgrade(), in case you ever need to override those too.) # in wp-config.php if ( defined(‘WP_INSTALLING’) && WP_INSTALLING ) { include_once dirname(__FILE__) . ‘/wp-content/install.php’; } # in wp-content/install.php function wp_install_defaults($user_id) { global $wpdb, $wp_rewrite, $current_site, $table_prefix; // do whatever you want here… }

Changing the wp db prefix after installation?

The basic idea should work– change the prefix in both wp-config.php and in the database itself. What isn’t covered would be cases where the prefix is used in other contexts such as when used as part of a “meta” key. Those cases you would need to trace down one by one. You could also have … Read more

Any post install tips after installing WordPress 3.0.1?

01 Database Security 01.01 change your database prefix during install or after install this is security by obscurity but helps with automated scripts that could run over all databases to inject bad code in your content like scripts, iframes or display: bits 01.02 install a database backup plugin to automate the backup e.g. http://wordpress.org/extend/plugins/wp-db-backup/ Read … Read more

Populate content on install

Searching for another thing, just stumbled upon this gem by @anmari 🙂 You have to put a Dropin plugin at the root of wp-content. Should be named install.php and contain a new version of the pluggable function wp_install_defaults. I used this gist for testing. And the only modification from the original function is the default … Read more

Combine multiple plugins into one?

Go through each plugin file and remove the plugin header. Create a loader.php file. Something like this: <?php /* Plugin Name: Combined Plugin Description: Contains plugin a, plugin b and plugin c */ include dirname(__FILE__) . ‘/plugin-a.php’; include dirname(__FILE__) . ‘/plugin-b.php’; include dirname(__FILE__) . ‘/plugin-c.php’;

How can I create a bash install script for my WordPress sites setup (WP+plugins+theme)?

To always get latest plugin take for example my plugin: http://wordpress.org/extend/plugins/wordpress-file-monitor-plus/ the download link for the latest is: http://downloads.wordpress.org/plugin/wordpress-file-monitor-plus.1.1.zip but if you remove the version from the download link you always get the latest version: http://downloads.wordpress.org/plugin/wordpress-file-monitor-plus.zip EDIT: Have you considered keeping a folder of the latest wordpress and plugins unpacked? Then as soon as a … Read more

A way to automatically install pages on theme install?

I got similiar situation where I needed to add page on theme activation and set it as homepage automatically. Here’s how I did it: add_action(‘after_setup_theme’, ‘mytheme_setup’); function mytheme_setup(){ if(get_option(‘page_on_front’)==’0′ && get_option(‘show_on_front’)==’posts’){ // Create homepage $homepage = array( ‘post_type’ => ‘page’, ‘post_title’ => ‘Home’, ‘post_content’ => ”, ‘post_status’ => ‘publish’, ‘post_author’ => 1 ); // Insert … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)