In every other forum I've used - if you fall off the first page you are in the black hole of never being seen again.
We're more clever than that around here. Notice the "No Replies" link at the top (or bottom) of the forum? We usually use that to find unanswered posts. So when you bump your own posts, you actually hurt yourself, as we will no longer see it.
Both $mcn_test_blabla and $this_is_broke are defined outside of the scope of the activation call to function mcn_test_install() and hence - if I wish to use their values within the mcn_test_install() function - I must explicitly call them into the functions scope via the "global" keyword.
They're outside the scope of your functions, yes, but that does not automatically make them globally scoped. In point of fact, at activation time, they are in the scope of the "activate_plugin" function, which is what makes the "include" call to your php file. Which makes them not global. After that first time, they will get included by wp-settings.php, and yes, in that case they will be global. But not that first time.
You need to declare them global before you use them *anywhere*, even in the main body of your plugin. Why? Because your plugin is being included in one of several places, and so you cannot make the assumption that your main body is always going to be globally scope. Yes, it usually is, but you cannot assume it will be all the time.
Quick demo in case you're still uncertain on what I mean:
File main.php
function activate_plugin($pluginfile) {
include $pluginfile; // we're including the file contents inside this function!
}
activate_plugin('example.php');
do_something();
In example.php:
/* my plugin */
$var = 'test'; // this $var is NOT globally scoped. Really.
function do_something() {
global $var;
echo $var;
}
What happens when you run main.php? If you think that it outputs "test", then you are mistaken.
If I run the exact same plugin code in Wordpress version 2.3.2 - it works.
Yes, and many things have changed since then. That's the way it rolls.