/** * Install constructor * * @return void **/ function __construct() { add_action('shopp_activate', array($this, 'activate')); add_action('shopp_deactivate', array($this, 'deactivate')); add_action('shopp_reinstall', array($this, 'install')); add_action('shopp_setup', array($this, 'setup')); add_action('shopp_setup', array($this, 'images')); add_action('shopp_setup', array($this, 'roles')); add_action('shopp_setup', array($this, 'maintenance')); self::$errors = array('header' => __('Shopp Activation Error', 'Shopp'), 'intro' => __('Sorry! Shopp cannot be activated for this WordPress install.'), 'dbprivileges' => __('Shopp cannot be installed because the database privileges do not allow Shopp to create new tables.', 'Shopp'), 'nodbschema-install' => sprintf(__('Could not install the Shopp database tables because the table definitions file is missing. (%s)', 'Shopp'), SHOPP_DBSCHEMA), 'nodbschema-upgrade' => sprintf(__('Could not upgrade the Shopp database tables because the table definitions file is missing. (%s)', 'Shopp'), SHOPP_DBSCHEMA), 'nextstep' => sprintf(__('Try contacting your web hosting provider or server administrator for help. For more information about this error, see the %sShopp Documentation%s', 'Shopp'), '<a href="' . SHOPP_DOCS . '">', '</a>'), 'continue' => __('Return to Plugins page')); self::$nextstep = array('dbprivileges' => sprintf(__('Try contacting your web hosting provider or server administrator for help. For more information about this error, see the %sShopp Documentation%s', 'Shopp'), '<a href="' . SHOPP_DOCS . '">', '</a>'), 'nodbschema-install' => sprintf(__('For more information about this error, see the %sShopp Documentation%s', 'Shopp'), '<a href="' . SHOPP_DOCS . '">', '</a>'), 'nodbschema-upgrade' => sprintf(__('For more information about this error, see the %sShopp Documentation%s', 'Shopp'), '<a href="' . SHOPP_DOCS . '">', '</a>')); }
/** * Begins database updates * * @since 1.3.6 * * @return void **/ public function upgrades() { if (empty($_GET['action']) || 'shopp-upgrade' != $_GET['action']) { return; } // Prevent unauthorized users from upgrading (without giving admin's a chance to backup) if (!current_user_can('activate_plugins')) { return; } // Prevent outsiders from the upgrade process check_admin_referer('shopp-upgrade'); $Installer = new ShoppInstallation(); $Installer->upgrade(); $welcome = add_query_arg(array('page' => $this->Admin->pagename('welcome')), admin_url('admin.php')); Shopp::redirect($welcome, true); }