# Sporting Republic — new website: how to go live

The new site is plain PHP: no WordPress, no database, no plugins. It needs PHP 8.0 or newer and Apache with `.htaccess` enabled.

## 1. Before you start
- Keep the full backup of the old site and its database (`lieperik_spr.sql`).
- Make sure the mailbox **info@sportingrepublic.com** works and you have its SMTP login (server, port, password).
- Pick a quiet moment. The switch takes about 15 minutes.

## 2. Add the e-mail settings (once)
1. In the folder `private`, copy `mail-settings.example.php` to a new file called **`mail-settings.php`**.
2. Open it in a text editor (Notepad is fine) and fill in:
   - `host` – the SMTP server
   - `port` and `encryption` – usually `465` + `'ssl'`, or `587` + `'tls'`
   - `username` / `password` – the info@sportingrepublic.com mailbox login
   - `secret` – type any long random text (just once; it protects the form against bots)
3. Save. The `private` folder is blocked from the web, so nobody can open this file in a browser.

## 3. Switch the site (FTP)
1. Connect to the server by FTP and open the site folder.
2. Create a folder **`_old-wordpress`** and **move everything that is there now into it**
   (wp-admin, wp-content, wp-includes, all `wp-*.php` files, `index.php`, `.htaccess`, `fonts`, `nc_assets`, `readme.html`, `license.txt`, `default.htm`, `parking-page.shtml` …).
   Leave the Google verification file (`googlefdb31932ada45d15.html`) and any `.well-known` folder in place.
3. Upload **everything inside this `site` folder** (including the hidden `.htaccess` files) to the site folder.
4. Make sure the folder `private/ratelimit` is writable by the web server (FTP: right-click → permissions → `775`).
5. Clear any cache in front of the site (Varnish, or LiteSpeed in the hosting panel).

## 4. Check
- Open the homepage, /about-us/, /clients/, /our-team/ and /contact-us/ — all should load.
- The old addresses keep working: /about-us/, /clients/, /our-team/ and /contact-us/ are the same as before; /events-projects/ goes to /about-us/.
- Open /sitemap.xml and /robots.txt — they should show your real domain.
- Send one test message on /contact-us/ → it should arrive at info@sportingrepublic.com, with a confirmation at the address you used.
  If you see "Sorry, your message could not be sent", the SMTP details in `mail-settings.php` are wrong (port/encryption is the usual culprit).

## 5. If something goes wrong (rollback)
Move the new files into a folder `_new-site`, move the contents of `_old-wordpress` back, clear the cache. The old site is back exactly as before.

## 6. After two weeks without problems
- Delete the `_old-wordpress` folder from the server.
- Delete the old WordPress database in the hosting panel.
- In Google Search Console, submit `https://<your domain>/sitemap.xml`.

---

# Everyday edits

| What | File |
|---|---|
| E-mail, phone, address, WhatsApp, social links, showreel video | `inc/config.php` |
| Clients, press articles, featured events, team members, services | `data/site.php` |
| All page text in English | `lang/en.php` |
| Translations (not switched on yet) | `lang/_later/ja.php`, `ko.php`, `zh.php`, `vi.php` |

- **Switching a language on:** the Japanese, Korean, Chinese and Vietnamese translations are ready in `lang/_later/`. Move the file into `lang/`, add the language to `'languages'` in `inc/config.php` (e.g. `'ja' => '日本語'`) and remove that language from the "Languages not in use yet" line in `.htaccess`. The language menu, hreflang tags and sitemap then appear automatically. Check the texts first if the English has changed since.
- **New team member:** add a line in `data/site.php` (`team`), put the photo in `assets/img` as `team-<name>-300.webp` and `-540.webp` (square), and add `team_<key>_role` / `team_<key>_bio` in `lang/en.php`.
- **New client logo:** save it as `assets/img/logo-<name>.webp` (320 × 200, white background) and add a line in `data/site.php`.
- After an edit, upload the changed file and clear the cache (or wait 10 minutes).
- The domain (www or not) is picked up automatically for canonical links and the sitemap. To force one, set `base_url` in `inc/config.php`, e.g. `'https://www.sportingrepublic.com'`.

## Speed and caching
- HTML pages: `Cache-Control: public, max-age=60, s-maxage=600` (60 s browser, 10 min server cache).
- Contact page: `no-store` (never cached, so the form always works).
- CSS/JS/fonts: 1 year; photos: 30 days.
- The YouTube showreel only loads when someone clicks play (privacy-friendly youtube-nocookie.com), so it does not slow the page down.
- Old WordPress addresses (wp-login.php, xmlrpc.php, wp-admin …) answer `410 Gone` immediately.
