/** * Action method to run tools. */ public function action() { if (!isset($_GET['tool'])) { return; } $id = trim(htmlspecialchars(strip_tags($_GET['tool']))); if (isset($this->tools[$id])) { /** @var Tool $tool */ $tool = $this->tools[$id]; $this->wp->doAction('jigoshop\\migration\\before', $tool); $tool->migrate(null); $this->messages->addNotice(__('Migration complete', 'jigoshop')); $this->wp->wpRedirect($this->wp->adminUrl('admin.php?page=' . self::NAME)); } }