register(); return $iwp; } /** * @return \ImportWP\ImportWP */ function iwp() { global $iwp; return $iwp; } function iwp_is_pro_disabled() { return defined('IWP_PRO_VERSION') && version_compare(IWP_PRO_VERSION, IWP_CORE_MIN_PRO_VERSION, '<'); } /** * When updating ImportWP errors can arrise if the pro version has a different codebase * * Disable PRO functionality and alert user to reason. * * @return void */ function iwp_has_required_version_of_pro() { if (iwp_is_pro_disabled()) { remove_action('plugins_loaded', 'iwp_pro_loaded'); // Display compatability message $message = 'Import WP v' . IWP_VERSION . ' requires Import WP PRO v' . IWP_CORE_MIN_PRO_VERSION . ' or greater, Download the lastest version of Import WP Pro or Rollback Import WP to a compatable version.'; add_action('admin_notices', function () use ($message) { global $pagenow; if (!in_array($pagenow, ['plugins.php', 'update-core.php', 'index.php'])) { return; } echo '
' . $message . '