WordPress hosting
Codebase management

Codebase management

Manage your environment code in better way

SiteBox seamlessly integrates with multiple codebase sources, offering a flexible and efficient code deployment process.

During deployment, SiteBox fetches the latest version of your application from the selected source and creates a new instance of your environment. This applies to deployments using GitHub or ZIP files, where SiteBox actively retrieves and unpacks the codebase during each deployment.

For FTP-based environments, the codebase is linked directly to your FTP server and remains continuously accessible. Changes made via FTP are immediately reflected in the environment without the need for redeployment, allowing for real-time updates and iterative development.

Flexible codebase management

SiteBox supports multiple sources for your application’s codebase, giving you the flexibility to choose the most suitable workflow for your team. You can configure environments using:

  • GitHub branch – connect your GitHub repository and select a specific branch to deploy your application. This method supports branch-based environment isolation and integration with your delivery pipeline.
  • ZIP file – upload a ZIP archive containing your application’s source code to quickly deploy static or packaged projects.
  • FTP upload – use SiteBox managed FTP server. The environment continuously reflects the current state of files on the server, enabling immediate updates without triggering a deployment process.

Each method enables you to maintain full control over how code is delivered to your environments. GitHub and ZIP-based deployments involve packaging and instantiating the application at deployment time. FTP-based environments, on the other hand, remain permanently connected to the file server and reflect changes in real time.

To maintain optimal performance, it is recommended to keep the codebase separate from dynamic content such as media or database files. For those, consider using the Snapshot import feature, which is specifically designed to support reliable environment configuration.

Codebase structure

In the Git and FTP representation of your environment, the directory structure should adhere to the following format:

root/
├── root_dir_files
├── plugins
├── themes
└── ...
  • root_dir_files – files from this directory will be installed in the root directory of your web application. For example, you can place files like robots.txt in this directory, and they will be placed at the root of your web application.
  • plugins – this directory is equivalent to the /wp-content/plugins directory in WordPress.
  • themes – this directory corresponds to the /wp-content/themes directory in WordPress.

Keep in mind the uploads directory should not be tracked on the Git repository.

During the deployment process, all files from the codebase repository will be copied to their respective WordPress directories, ensuring that your WordPress environment is correctly configured and up-to-date.

Root directory files

Using the root_dir_files directory, you can add any files that will be available from the root directory of your website. By adding the file root_dir_files/favicon.ico for example, the file will be available at the link https://acme-website.com/favicon.ico.

The root_dir_files directory has several rules and limits:

  • files and folders in the directory, for security reasons, cannot overwrite any existing file on the server, so for example the file root_dir_files/wp-config.php will be ignored,
  • files and folders with names preceded by a dot like .config are ignored, the exception is the .well-known directory,
  • files contained in the directory cannot overwrite any server configuration, so files like .htaccess will not work.