MWI Plugin relative path to Mage.php

The MWI plugin http://www.mwi-plugin.com/ is a great plugin to integrate Magento and WordPress. It allows you to pull in Magento blocks, CSS, JS and other Magento functionality into a wordpress blog. However, one thing that bothered me with this wordpress plugin was it required you to enter the full path to the Mage.php file, starting from the server root. This does not allow for seamless movement of the website’s database between environments.

The below solution will allow you to enter a full path on the server if you’d like, or a relative path from the wordpress root to the Mage.php file. Open up file wp-content/plugins/magento-wordpress-integration/mwi.php and within function mwi_admin_page() just below the $magepath declaration right around line 134, add four lines to check for a relative path as below.

// Mage Path
$magepath = self::getValue('magepath');

//check for relative path from blog root
if(file_exists(ABSPATH . $magepath)) {
	$magepath = ABSPATH . $magepath;
//check for relative path from blog root

// notification/error messages

How to change WordPress avatar profile picture

Sign up at http://www.gravatar.com with the email address that you’ve associated in your blog with your admin user account, and upload you image to gravatar.com. After you’ve done that your gravatar.com image will appear whenever you post on your own blog or on other WordPress blogs (if you put that email address into the mail field of the comment form at that other blog).

Upgrading wordpress

Version 2.7 of wordpress recently came out and I needed to upgrade because the flash image uploader was no longer working for my version of wordpress as flash 10 broke it.  Anyway, the upgrade was pretty simple and I’ll include the basic steps below.

1. Backup your database and files.

2. Overwrite the files in the root of your wordpress site.  Be sure not to overwrite the config.php file.

3. Overwrite the wp-admin and wp-includes directories and all files inside them.

4. Go to the admin (wp-admin) and it’ll notify you if a database upgrade is required.  If it is, click the one button on the screen, wait a second, and then it’s done.

Piece of cake.

If you’re upgrading your wordpress site, I encourage you to follow their detailed instructions at http://codex.wordpress.org/Upgrading_WordPress