public static function initialisePlugin() { // NB Network activation will not upgrade a site // do upgrade will check current upgrade script version and apply as necessary upgrader::checkUpgrade(); // 2 is required for $file to be populated add_filter('plugin_row_meta', array(__CLASS__, 'filter_plugin_row_meta'), 10, 2); add_action('do_robots', array(__CLASS__, 'addRobotLinks'), 100, 0); add_action('wp_head', array(__CLASS__, 'addRssLink'), 100); // only include admin files when necessary. if (is_admin()) { include_once 'settings.php'; include_once 'postMetaData.php'; include_once 'categoryMetaData.php'; settings::addHooks(); categoryMetaData::addHooks(); postMetaData::addHooks(); } if (!wp_get_schedule('xmsg_ping')) { // ping in 2 hours from when setup. wp_schedule_event(time() + 60 * 60 * 2, 'daily', 'xmsg_ping'); } add_action('xmsg_ping', array(__CLASS__, 'doPing')); // NB Network activation will not have set up the rules for the site. // Check if they exist and then reactivate. if (get_option(RULES_OPTION_NAME, null) != RULES_VERSION) { add_action('wp_loaded', array(__CLASS__, 'activateRewriteRules'), 99999, 1); } }