Login to download the latest version of Mint and your favorite Pepper, purchase additional licenses, or post in the Forum. Don't have an account? Create one!

In Partnership with Media Temple

Mint Forum

Configuring Mint for WordPress

Shaun Inman
Mint/Pepper Developer
Posted on Jan 28, '07 at 02:24 am

This howto was originally contributed by jalenack

Setting up Mint to record stats for your WordPress blog is fairly easy. First thing to do is set up the MySQL database.

Open your wp-config.php file in your main wordpress directory. This file contains the connection details needed to run WP. We’ll be lifting these details for Mint. Take note of the following:

// ** MySQL settings ** //
define('DB_NAME', 'myblogdatabase');     // The name of the database
define('DB_USER', 'username');     // Your MySQL username
define('DB_PASSWORD', 'password'); // ...and password
define('DB_HOST', 'localhost');     // ...and the server MySQL is running on

Now let’s copy the connection details to Mint. Open the db.php file in the config directory of Mint. Now, match the settings of WP to Mint.

$Mint = new Mint (array
(
    'server'    => 'DB_HOST',
    'username'  => 'DB_USER',
    'password'  => 'DB_PASSWORD',
    'database'  => 'DB_NAME',
    'tblPrefix' => 'mint_'
));

For example, if your DB_NAME in WordPress is ‘myblogdatabase’, then the fourth detail in the mint config should also be ‘myblogdatabase’, as you can see above.

That should get you all ready to go. Upload your Mint files if you haven’t already, and browse over to where you just put Mint. The installer should guide you through the main mint installation.

Now, you’ve got to add the JavaScript include. Copy the text given by the installer, which should look something like

<script src="/mint/?js" type="text/javascript"></script>

Next, edit your header.php file of your theme directory. Your theme directory is located at /wp-content/themes/<YOUR CURRENT THEME>/ .. Find the beginning <head> tag. Right after that, or anywhere inside the <head> tag, paste the JavaScript code you copied earlier. If you’ve lost it, you can get it again by going to your Mint preferences and clicking “Instructions”.

Alright, Mint should be tracking your hits now. Huzzah!

If you want to use the Local Search Pepper, it should be fairly easy to set up. Go to Preferences > Local Search and just add “/” to the first input and “s” to the second, and then click “Done”.

Shaun,

Will the WP Mint plugin work fine as well? Or not w/ 2.0?

Clay
Minted
Posted on Jan 29, '07 at 11:45 pm

I think that the WP Mint plugin should work fine. There’s no difference between the required javascript code from 1.x to 2.x.

BOK
Minted
Posted on Jan 30, '07 at 07:06 am

I can confirm it’s (still) working (unlike some older pepper like XXX Strong Mint and GeoIP).

jaredb
Third-Party Pepper Developer
Posted on Feb 07, '07 at 10:41 pm

Hey, I just made a WordPress plugin to handle adding the necessary includes to the feed files to make the “Bird Feeder” pepper work, without modifying the core WordPress files.

Give it a try here and let me know what you think.

Mr Papa
Minted
Posted on Feb 08, '07 at 01:00 am

unfortunately, plugin requires wp and mint to be in same databases….

jaredb
Third-Party Pepper Developer
Posted on Feb 08, '07 at 03:16 am

No, it doesn’t.

shokk
Third-Party Pepper Developer
Posted on Feb 22, '07 at 04:53 pm

One issue I have with Mint and Wordpress is that the pages are being listed as the url /blog/articles/2006/06/13 rather than the title of the pages. Is there something I need to set in Mint for this?

MacManX
Minted
Posted on Feb 24, '07 at 01:46 am

That’s strange. I have two Mint-monitored WordPress blogs and both display the page titles in the Referrers, Pages, and Searches panes. Would you be able to post a link to your blog?

shokk
Third-Party Pepper Developer
Posted on Feb 24, '07 at 09:53 am

The site is located at shokk.com/blog I found this which I am going to look over right now… haveamint.com/forum/troubleshooting/136 … #post_1654

shokk
Third-Party Pepper Developer
Posted on Feb 24, '07 at 10:05 am

Nope, the reorder script did not help the Readers tab show up. I also unchecked and rechecked that box in case that would help kick it into action.

shokk
Third-Party Pepper Developer
Posted on Feb 25, '07 at 01:38 pm

It’s there now after totally reinstalling Mint 2.03 and all the peppers!

Shaun Inman
Mint/Pepper Developer
Posted on Feb 26, '07 at 09:45 am

Shokk, you are seeing URLs instead of page titles because you have the Mint JavaScript include before your <title> tag. It needs to go after the <title> but before the closing </head> tag.

Once you update this you should see the title of any visited page rather than the url for all hits going forward. It will not affected previously recorded hits.

shokk
Third-Party Pepper Developer
Posted on Feb 26, '07 at 11:47 am

Fixed. Thanks.

oddstar
Minted
Posted on Mar 10, '07 at 04:31 am

Wow, this was really easy! Thanks

Trying to install for first time. Compatability test all OK, amended details in the db.php but domainname.com/mint only takes me to my own site, less the logo in the header.

Doesn’t access the instructions that need completing.

Any suggestions?

I am new in Mint.

Just a simple newbie question:

Is it better to have mint and WP in the same DB or in different ones?

Thank you

Shaun Inman
Mint/Pepper Developer
Posted on Jun 11, '07 at 09:48 am

@MyAppleStuff, this is likely the result of mod_rewrite. You need to turn off the rewrite engine in your Mint directory.

@toplinks, the individual apps might run more smoothly on separate databases but you may run into some problems with Mint intereop Wordpress plugins.

Vonster
Minted
Posted on Sep 22, '07 at 04:36 pm

I really wish I could just install a “Plugin” for wordpress. I kind of follow what this post is saying but it assumes I know code pretty well which I don’t. Ugh.

luc
Minted
Posted on Jan 09, '08 at 09:35 pm

Wow! That was easy! Two days after migrating to WordPress I have this shiny new stats program as a bonus. Now I have to suppress the urge to load this thing full with Peppers!

Thanks for the software!

markn
Minted
Posted on Jan 09, '08 at 09:56 pm

Does the Wp-Mint plug-in copy the Mint tables to the WP database?

I activated the plug-in and now I have what appears to be at least a copy of my Mint tables in my Wordpress database.

Can someone verify this for me? Thanks, Mark

markn
Minted
Posted on Jan 10, '08 at 09:16 am

I heard back from the developer of WP-Mint. He says that WP-Mint does not copy the Mint tables to the WP database. Not sure how they got there, but I’m going to remove them and see what happens.

I’ve uploaded the Mint files to my wp-content folder, but when I try to navigte there I’m getting my 404 page. I had the same problem when I uploaded the Mint files to my root folder, what am I doing wrong? I’m typing in the address as ronpaulchronilces.com/wp-content/mint, but I’ve also tried every other variation I can think of.

Shaun Inman
Mint/Pepper Developer
Posted on Feb 05, '08 at 10:27 am

I answered this question above. You need to disable mod_rewrite in your Mint directory.

Add the following to a file named .htaccess and upload it into your /mint/ directory (which should be in root):

<IfModule mod_rewrite.c>
    RewriteEngine   off
</IfModule>

You must be logged in to reply. Login above or create an account