I’ve noticed that my-calendar does not actually create tables and set up defaults when it is first activated.
When the plugin is first activated and the method registered with register_activation_hook (check_my_calendar) is called, nothing is created, tables or options.
It appears that it is an issue with $mc_version not being declared globally. When the plugin is first included in the activation process and the check_my_calendar function is first called, $mc_version is undefined as well as my_calendar_version, so the test to see if you are using the latest version returns true since they match. (line 400 my-calendar.php). Declaring $mc_version as global in my-calendar.php fixes this issue.
global $mc_version; $mc_version = 'X.X.X';
I ran into this issue because I’ve got another plugin I’m working on that activates multiple plugins at once and needs them configured and running after activation. This would normally not be an issue and would probably never be noticed since wordpress redirects and reloads the page after plugin activation causing the plugins to be reloaded. Since my-calendar is written to check if it’s installed and configured every time it is loaded, it does the install during the plugin page reload.
- The topic ‘[Plugin: My Calendar] plugin activation quirk’ is closed to new replies.