';
$plugins = array();
$fname = $splittestpx_filepath;
$p = strpos ($fname, '/wp-content/plugins/');
if (! $p) $p = strpos ($fname, '\\wp-content\\plugins\\');
if ($p) $fname = substr ($fname, $p + 20);
$plugins[0] = $fname;
deactivate_plugins ($plugins);
echo 'The ' . $pname . ' plugin has been deactivated';
die ('
Once the problem has been resolved, go to the Plugins menu and re-activate the plugin
Click "Refresh" on your browser to continue');
}
function SplitTestPxPluginDeactivate ()
{
delete_option ('splittestpx1717_status');
}
function SplitTestPxPluginEditSettings ()
{
global $splittestpx_levels, $splittestpx_maxitems, $splittestpx_linkfolder, $splittestpx_codethanks, $splittestpx_autolock,
$splittestpx_code1, $splittestpx_code2, $splittestpx_code3;
echo '
";
echo 'Send people to the following URL instead of the thank you page. This URL will record the sale and then redirect the person to your thank you page: ' . $salecodelink . '
';
}
}
$active = get_option('splittestpx1717_active');
if ($active)
{
$numitems = get_option ('splittestpx1717_numitems');
if (! $numitems || $numitems > $splittestpx_maxitems) $numitems = $splittestpx_maxitems;
$cycles = intval (get_option ('splittestpx1717_cycles'));
$hnum = intval (get_option ('splittestpx1717_hnum'));
$maxsales = 0;
for ($c = 1; $c <= $numitems; $c ++)
{
$salev = get_option ("splittestpx1717_sale$c");
if ($salev > $maxsales) $maxsales = $salev;
}
$plock = get_option ('splittestpx1717_locked');
if ($plock)
{
$autostr = '';
if ($splittestpx_autolock && $maxsales >= $splittestpx_autolock) $autostr = " (due to reaching $splittestpx_autolock sales)";
echo "System Is Locked To Option $plock$autostr
';
}
}
echo " \n";
if (function_exists ('home_url')) $prepend = home_url ($splittestpx_linkfolder);
else $prepend = get_bloginfo ('url') . $splittestpx_linkfolder;
$testpageurl = get_option('splittestpx1717_testpageurl');
echo 'Current Stats';
if ($testpageurl) echo ' (use the links to view the test page with the different headlines)';
echo '
';
echo ' ';
echo '';
if (! $plock)
{
echo ' ';
}
echo ' ';
if (! $testpageurl) echo 'Note: This URL should get set automatically the first time you visit the page that contains ' . $splittestpx_code1 . ' ';
echo "
\n";
}
echo 'Enter the headlines to be tested in the boxes below. In your blog page, put the text ' . $splittestpx_code1 . ' where the Headline should appear. ';
if ($splittestpx_levels >= 2) echo ' Put the text ' . $splittestpx_code2 . ' where the SubHeadline should appear. ';
if ($splittestpx_levels >= 3) echo 'Put the text ' . $splittestpx_code3 . ' where the SubSubHeadline should appear.';
echo "
\n";
echo '\n";
echo '
';
echo 'The plugin needs to keep track every time someone visits your thank you page
';
echo 'If your thank you page is on this blog, just include the text ' . $splittestpx_codethanks . ' somewhere in the page (it doesn\'t matter where)
';
echo 'If your thank you page is not on this blog, enter the URL of the thank you page in the box below';
if (! $salecodelink) echo ' and the plugin will give you a new URL to send people to instead. The new URL will record the sale and then redirect the person to your thank you page.';
echo "
\n";
$saleurl = get_option ('splittestpx1717_saleurl');
echo ' ';
if ($salecodelink) echo 'Send people to the following URL instead of the thank you page. This URL will record the sale and then redirect the person to your thank you page: ' . $salecodelink;
}
function SplitTestPxPluginMenu ()
{
global $splittestpx_filepath;
add_options_page ('Headline Tester', 'Headline Tester', 'activate_plugins', $splittestpx_filepath, 'SplitTestPxPluginEditSettings');
}
function SplitTestPxPluginContent ($content)
{
if (is_feed()) return $content;
global $splittestpx_codebase;
if (strpos ($content, $splittestpx_codebase) === false) return $content;
global $splittestpx_levels, $splittestpx_maxitems, $splittestpx_hnum, $splittestpx_linkfolder, $splittestpx_cookie,
$splittestpx_code1, $splittestpx_code2, $splittestpx_code3, $splittestpx_codethanks;
if (strpos ($content, $splittestpx_codethanks) !== false)
{
if (function_exists ('home_url')) $prepend = home_url ($splittestpx_linkfolder);
else $prepend = get_bloginfo ('url') . $splittestpx_linkfolder;
$salelink = $prepend . 'sale';
$inscode = '';
$content = str_replace ($splittestpx_codethanks, $inscode, $content);
return $content;
}
$pageurl = get_option('splittestpx1717_testpageurl');
if (! $pageurl) update_option ('splittestpx1717_testpageurl', get_permalink());
if (! get_option ('splittestpx1717_active'))
{
$content = str_replace ($splittestpx_code1, 'ERROR - no headlines have been set up. Enter your Headlines using the "Headline Tester" option in the admin "Settings" menu', $content);
$content = str_replace ($splittestpx_code2, '', $content);
$content = str_replace ($splittestpx_code3, '', $content);
return $content;
}
$scriptcode = '';
$hnum = $splittestpx_hnum;
if (! $hnum) $hnum = get_option ('splittestpx1717_locked');
if (! $hnum)
{
if (isset ($_COOKIE[$splittestpx_cookie])) $hnum = intval($_COOKIE[$splittestpx_cookie]);
if ($hnum < 0 || $hnum > $splittestpx_maxitems) $hnum = 0;
if (! $hnum)
{
$hnum = get_option ('splittestpx1717_hnum') + 1;
$numitems = get_option ('splittestpx1717_numitems');
if (! $numitems || $numitems >= $splittestpx_maxitems) $numitems = $splittestpx_maxitem;
if ($hnum < 0 || $hnum > $numitems)
{
$hnum = 1;
$cycles = get_option ('splittestpx1717_cycles') + 1;
update_option ('splittestpx1717_cycles', $cycles);
}
update_option ('splittestpx1717_hnum', $hnum);
$scriptcode = '';
}
}
{
$headline = explode ('|', get_option ('splittestpx1717_headline'));
$str = '';
if (isset ($headline[$hnum - 1])) $str = $headline[$hnum - 1];
$content = str_replace ($splittestpx_code1, $scriptcode . $str, $content);
$scriptcode = '';
}
if ($splittestpx_levels >= 2)
{
$headline = explode ('|', get_option ('splittestpx1717_subheadline'));
$str = '';
if (isset ($headline[$hnum - 1])) $str = $headline[$hnum - 1];
$content = str_replace ($splittestpx_code2, $scriptcode . $str, $content);
$scriptcode = '';
}
if ($splittestpx_levels >= 3)
{
$headline = explode ('|', get_option ('splittestpx1717_subsubheadline'));
$str = '';
if (isset ($headline[$hnum - 1])) $str = $headline[$hnum - 1];
$content = str_replace ($splittestpx_code3, $scriptcode . $str, $content);
$scriptcode = '';
}
return $content;
}
function SplitTestPxPluginLinkHandler ()
{
global $splittestpx_linkfolder;
if (strpos ($_SERVER['REQUEST_URI'], '/' . $splittestpx_linkfolder) === false) return;
if (function_exists ('home_url')) $prepend = home_url ($splittestpx_linkfolder);
else $prepend = get_bloginfo ('url') . $splittestpx_linkfolder;
$p = strpos ($prepend, '/', 9);
$prepend = substr ($prepend, $p);
if (strncmp ($_SERVER['REQUEST_URI'], $prepend, strlen($prepend)) != 0) return;
global $splittestpx_cookie, $splittestpx_hnum, $splittestpx_maxitems, $splittestpx_autolock;
$option = substr ($_SERVER['REQUEST_URI'], strlen($prepend));
if (substr ($option, 0, 4) == 'sale')
{
if (! get_option ('splittestpx1717_locked') && isset ($_COOKIE[$splittestpx_cookie]))
{
$hnum = intval($_COOKIE[$splittestpx_cookie]);
if ($_COOKIE[$splittestpx_cookie] != $hnum . 'S')
{
setcookie ($splittestpx_cookie, $hnum . 'S', time()+365*86400, '/');
if ($hnum < 0 || $hnum > $splittestpx_maxitems) $hnum = 0;
if ($hnum)
{
$optname = 'splittestpx1717_sale' . $hnum;
$numsales = get_option ($optname) + 1;
update_option ($optname, $numsales);
if ($splittestpx_autolock && $numsales >= $splittestpx_autolock)
{
update_option ('splittestpx1717_locked', $hnum);
}
}
}
}
$saleurl = get_option ('splittestpx1717_saleurl');
if ($saleurl)
{
$hnum = intval (substr ($option, 4));
if ($hnum == get_option ('splittestpx1717_salecode')) header ("Location: $saleurl");
}
exit ();
}
elseif (substr ($option, 0, 6) == 'option')
{
$hnum = intval (substr ($option, 6));
if ($hnum < 0 || $hnum > $splittestpx_maxitems) $hnum = 0;
$pageurl = get_option('splittestpx1717_testpageurl');
if (! $hnum)
{
die ('Invalid option number in URL');
}
elseif ($pageurl)
{
$p = strpos ($pageurl, '/', 9);
$_SERVER['REQUEST_URI'] = substr ($pageurl, $p);
$splittestpx_hnum = $hnum;
return;
}
else
{
die ('Please set the sales page URL in the blog admin Settings menu');
}
}
}
add_action ('init', 'SplitTestPxPluginLinkHandler');
add_action ('admin_head', 'SplitTestPxPluginAdmin');
if (function_exists ('register_deactivation_hook')) register_deactivation_hook ($splittestpx_filepath, 'SplitTestPxPluginDeactivate');
add_filter ('the_content', 'SplitTestPxPluginContent');
add_action ('admin_menu', 'SplitTestPxPluginMenu');
?>
Health & Beauty | The Morning Letter
Extraordinary solutions to everyday situations delivered every morning to over 12,700 subscribers!
The Sarcastic Photographer… “Say CHEEEESE!” “Oh my! Is that Cheddar or Gouda?” “Where are you from?” “Oh, what a lovely place, and famous too! I understand that’s where they invented the tooth brush. Anywhere else and it would’ve been called … Continue reading →
Do you suffer from any of the following? Tenderness of the jaw muscles, neck or upper back? Grinding your teeth, including in your sleep? Headaches, often when you wake up? Pain or difficulty in chewing, yawning or opening wide? Jaws … Continue reading →
Take Heed! This could one of the most important messages you’ll ever receive! The Centers for Disease Control and Prevention (CDC) and the Annual 2004 United States Renal Report estimate that 26 million adults living in the United States have … Continue reading →
There was a time, and not too long ago either! – When I would have given my very soul in exchange for just one complete and blissful night of uninterrupted sleep. For years – A LOT of years!! – I … Continue reading →
Wouldn’t it be great if you could throw away your eyeglasses and improve your vision naturally? Think about it… You would no longer need expensive eye exams or have to pay ridiculously inflated prices for lenses and frames. There would be … Continue reading →
“Hi, I’m Buck Melanoma, Moley Russell’s wart!” In the move Uncle Buck, John Candy then flips a quarter to the warty school principal and tells her to hire a rat to gnaw that thing off her face. People have been … Continue reading →
“At first, I was glad when the annoying voices in my head turned to whistling instead, but I became concerned when the high-pitched noise did not go away after a few days. I think it is tinnitus. How do I … Continue reading →
Your kidneys started out like everyone else’s, working away for endless hours to clean up the blood from your cheeseburgers-and-cola diet. From the dark nothingness of your belly, the bean-shaped organ begins to pulse with other super powers like lowering … Continue reading →
Trying the Next Shiny, New Thing Decreased energy, aches and pains, bothersome fatigue and looking and feeling “old” are all a part of life, isn’t it? Maybe even exercise programs and the latest diet or nutrition programs leave much to … Continue reading →
Abs workouts. They’re a dime a dozen. But the products aren’t. Those are a little more expensive. Whether you want a highly unfashionable belt, a really big kickball or a stripped-down rocking chair, you are going to have to pay. … Continue reading →
Every morning we make it our business to deliver actionable, "out of the box" solutions & ideas to your inbox - how to do everything in life... only MUCH smarter!
Join over 12,700 subscribers today!
* Spam free zone! Your email is 100% safe and secure and of course will never be sold, shared or rented.