Documentation / Setting up Staatic / Installation

Installation

Staatic is available in two editions; the free community edition and the paid premium edition. The premium edition comes with additional features on top of all features present in the community edition. Only one edition should be installed at the same time.

Before you proceed, you should check that your environment meets the minimum system requirements and make sure you have completed the preparation checklist.

Community edition

You can install the community edition of Staatic directly from your WordPress Admin Dashboard.

  1. From the Dashboard, click Plugins > Add New.
  2. In the Search field, enter Staatic and choose Staatic – Static Site Generator to install.
  3. After installation click Activate.

Alternatively, you can download the plugin from WordPress.org.

Premium edition

Note: these instructions apply to the manual installation of Staatic Premium. If you have a Staatic Cloud subscription, the Staatic Premium plugin is already preinstalled on your managed WordPress instance.

Note: if you already have the community version of Staatic installed, you can simply replace it with the premium edition by uploading the premium plugin .zip file.

The Premium edition of Staatic for WordPress can be downloaded from the Customer Portal.

  1. Go to app.staatic.com and login with your account details.
  2. Click Account > Subscription. Then, within the Downloads section click Staatic Premium to download the .zip file to your desktop.
  3. Head over to your WordPress Admin dashboard and click Plugins > Add New.
  4. Choose the .zip file you have just downloaded and click on Install.
  5. After installation click Activate.

Connect premium edition

The premium edition of Staatic for WordPress needs to be connected in order to use all of its functionalities.

  1. Go to app.staatic.com and login with your account details.
  2. Click Account > Sites. Then click on the View Icon next to the relevant site.
  3. Click the API tab and note the Client ID and Client Secret , which will be needed later.
  4. Go to your site’s WordPress Admin Dashboard and from the Dashboard, click Staatic > Settings.
  5. Then click the Premium tab and enter the Client ID and Client Secret you noted earlier.
  6. Finish by clicking Save.

Installation using Composer

Staatic also maintains a Composer package repository allowing you to install Staatic directly using your PHP package manager. You can view the available package versions on https://packages.staatic.com.

Note: An active subscription is required in order to use the Staatic package repository.

In order to use our package repository, add the following to your composer.json file:

{
  "repositories": [{
    "type": "composer",
    "url": "https://packages.staatic.com"
  }]
}

Then run composer require wordpress-plugin/staatic to install the community version, or run composer require wordpress-plugin/staatic-premium to install the premium version.

The first time Composer will ask for a username and password to authenticate with our repository. For the username, you can enter anything. The password is the Composer Authentication Key that can be retrieved from the Subscription page at https://app.staatic.com. After successfully authenticating, Composer can optionally store your credentials in auth.json.

You can also manually add the following to your composer auth.json file before running composer require.

{
    "http-basic": {
        "packages.staatic.com": {
            "username": "anything",
            "password": "[COMPOSER_AUTH_KEY]"
        }
    },
}

Installing into the right location

By default, Composer installs packages into the vendor directory. When dealing with WordPress, you usually want to install plugins into the wordpress/wp-content/plugins directory or similar.

This can be achieved by adding composer/installers to your composer.json require section together with the installer paths.

"require": {
    "composer/installers": "^2.2"
},
"extra": {
    "installer-paths": {
        "wordpress/wp-content/plugins/{$name}/": ["type:wordpress-plugin"]
    }
}

This will make sure that WordPress plugins are automatically installed into the wordpress/wp-content/plugins directory.

Full example

{
    "repositories": [
        {
            "type": "composer",
            "url": "https://packages.staatic.com"
        }
    ],
    "require": {
        "composer/installers": "^2.2",
        "wordpress-plugin/staatic-premium": "^1.3"
    },
    "config": {
        "allow-plugins": {
            "composer/installers": true
        }
    },
    "extra": {
        "installer-paths": {
            "wordpress/wp-content/plugins/{$name}/": [
                "type:wordpress-plugin"
            ]
        }
    }
}