As you know if you follow this blog, I am a big fan of James Brausch and his products. One of his products that I recently aquired is MuVar - a software package that you put on your webhost and it automatically tracks and optimizes your webpage.
Recently on his blog, James asked for reviews of MuVar. I want to give a glowing review, but I can’t (yet). When some of the things I address below are fixed, then MuVar gets a big thumbs up from me.
(James, if you or someone from your organization reads this, please feel free to let me know if I missed something in the install videos, or take and implement the fixes below - and then let me know - I really, really want to give a glowing review because after it is working MuVar is awesome!)
The Good:
Testing is always good. Automated testing where the program takes the results and applies them to your website so it is continually being optimized to make more sales is even better. And a simple, easy to use interface that sets all this up is the best!
MuVar is all of this.
The Bad:
When I first tried to use MuVar it simply didn’t work. I would use the interface to add variables and any quotes (double and single) would end up with multiple backslashes before them. So if I had a testimonial on my web page such as:
“This is Steve’s best software”
it would end up looking like:
\”This is Steve\’s best software\”
I googled around and found that this was a (mis)configuration on my server (actually the default configuration of a PHP install) and also found a fix which I applied. (Fixes are below in the “Ugly” section)
Next, after I got that problem fixed, I found that on some variables, no matter how many times I entered in a new one, MuVar would somehow be caching a previous version, so I would end up with 3 variables all containing the same stuff - which was from a different variable alltogether.
Come to find out, this was a problem with cookies. It was either a misconfiguration of my server (again) or something wrong with my browser. I fixed this by changing the use of cookies in one part of MuVar to the use of REQUEST variables instead.
So finally, I got MuVar working.
And it is very cool. A great idea, implemented with an easy to use interface. Of course for most people you won’t run into the problems I did. But I am sure that some will. So, if you do end up with similar problems to mine, Apply the fixes below.
The Ugly:
In order to avoid the backslash problem, I had to either modify my php.ini file by changing
; magic_quotes_gpc = On
to
magic_quotes_gpc = Off
It turns out that PHP defaults to “escaping” or adding a backslash to all quotes that are in POST, GET, REQUEST or COOKIE variables.
If you don’t have access to your php.ini, then you can edit the misc.php file and add the following code:
if (get_magic_quotes_gpc()) {
function stripslashes_deep($value)
{
$value = is_array($value) ?
array_map('stripslashes_deep', $value) :
stripslashes($value);
return $value;
}
$_REQUEST= array_map('stripslashes_deep', $_REQUEST);
$_POST = array_map('stripslashes_deep', $_POST);
$_GET = array_map('stripslashes_deep', $_GET);
$_COOKIE = array_map('stripslashes_deep', $_COOKIE);
}
|
I added it right at the top of misc.php at about line 10 right after
$testVal="This is a test.";
This fixed the extra slashes problem.
Now, to fix the cookies problem, I had to modify two files: review.php where I added the following at about line 47
find this line:
echo "<form name='reviewver' action = 'addverdoit.php' method = 'post'>";
echo "<input type='submit' value=' Add It! ' id='submit1' name='submit'>";
and insert the following after it:
echo "<input type=hidden name=\"var\" value=\"$theVarName\">";
echo "<input type=hidden name=\"before\" value=\"$theVarBefore\">";
echo "<input type=hidden name=\"after\" value=\"$theVarAfter\">";
|
And in addverdoit.php:
Change all instances of _COOKIE to _REQUEST, so that
$theVarName="Unknown";
if (isset($_COOKIE["var"]))
{
$theVarName=$_COOKIE["var"];
}
if (isset($_COOKIE["before"]))
{
$theVarBefore=$_COOKIE["before"];
}
else
{
$theVarBefore="";
}
if (isset($_COOKIE["after"]))
{
$theVarAfter=$_COOKIE["after"];
}
else
{
$theVarAfter="";
}
|
Becomes:
$theVarName="Unknown";
if (isset($_REQUEST["var"]))
{
$theVarName=$_REQUEST["var"];
}
if (isset($_REQUEST["before"]))
{
$theVarBefore=$_REQUEST["before"];
}
else
{
$theVarBefore="";
}
if (isset($_REQUEST["after"]))
{
$theVarAfter=$_REQUEST["after"];
}
else
{
$theVarAfter="";
}
|
With these changes, MuVar works perfectly for me. And I can highly recommend it. Actually, even after taking the time to make the fixes, I can still recommend it.
So go ahead and Buy Muvar - and try it, then if you run into the same problems I did, apply the fixes (They only take 5 minutes to apply.) You will be glad you did!
-Steve Oliphant