<?php use Megaforms\Vendor\Core\PluginMigration; if (!defined('WP_UNINSTALL_PLUGIN')) { exit; } require_once 'megaforms.php'; spl_autoload_register('MegaformsBootstrap::autoload'); try { /** @method PluginMigration down */ PluginMigration::load()->down(); } catch (\Megaforms\Vendor\Exceptions\MegaformsException $error) { Megaforms\Vendor\Libs\Helpers\CommonHelpers::handle_exception($error); }
public static function boot() { spl_autoload_register('MegaformsBootstrap::autoload'); try { // Error based on capabilities.php // Topic : https://wordpress.org/support/topic/fatal-error-call-to-undefined-function-wp_get_current_user-4 // if ( ! current_user_can( 'activate_plugins' ) ){ // wp_die('User can\'t activate plugins'); // } $thePlugin = new Megaforms\Vendor\Plugin(); $thePlugin->run(); } catch (Megaforms\Vendor\Exceptions\MegaformsException $error) { $error = Megaforms\Vendor\Libs\Helpers\CommonHelpers::handle_exception($error); MegaformsBootstrap::admin_notice($error); } }