GithubHelp home page GithubHelp logo

codeconut-ltd / wordpress-web-setup-boilerplate Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 51 KB

Security-focused structural boilerplate for any WordPress webs. Opinionated features that might not work with any hosting. Only use if you know what you are doing and are comfortable editing server files.

License: MIT License

PHP 100.00%
wordpress wordpress-development wordpress-site wordpress-boilerplate php php7 composer phpcs phpcs-wordpress security

wordpress-web-setup-boilerplate's Introduction

WordPress Web Setup Boilerplate

WordPress Web Setup Boilerplate

Security-focused template





About

Security-focused structural boilerplate for any WordPress webs. Opinionated features that might not work with any hosting. Only use if experienced with WordPress setup and feel comfortable editing server files.

Intended for developers โ€“ Not end users

Current state

The suggested changes in this boilerplate are still up-to-date in 2020 and for current WordPress releases. Despite some of these issues being known for several years, they have never been improved upon, and some of these are out of WordPress.



Features

General

  • Generic config suited for multiple WordPress installations in one hosting environment.
  • Subfolder setup allows deploying multiple versions and quickly switch between them to reduce outage or fallback in case of application errors.
    • Here: The folder name '/live/' is an arbitrary decision for the most-recent version to reduce edit-needs within the file. One could also work with versions or dates.
  • Default robots.txt blocks 'wp-' path indexing
    • Also contains example sitemap file definition

Performance

  • Block image hotlinking (requires manual whitelisting of domains).

Security

Secrets

  • Optional: Secure /wp-admin/ path with password from .htpasswd
  • wp-config secrets moved out of web scope

.htaccess

  • Block critical file access
  • Block admin path and files access
  • Block author scans from frontend
  • DEV-environment specific changes, e.g. disable caching (Needs manual definition of environment)
  • Secure default folders with additional files (some need manual adjustment)



How to use

Copy the folder content in the WordPress installation.



Breaking features

Features that potentially might cause issues depending on your own needs. Feel free to disable these manually.

  • /public_html/wordpress-example/live/.htaccess
    • 'Prevent image hotlinking' - If you are using any of these platforms and want to link images from your server, change or disable this. Examples: You're sharing content on Social media or within your own shop that includes images from your domain.

Changes

Most files require manual adjustments to fit hosting and website needs. Manually check the suggested features and test with your hosting environment capabilities. Some features might not work everywhere!

Config

  1. Check global defaults for all websites:
    • /public_html/config/global.php
  2. Check domain-specific defaults and replace 'XXX' placeholders:
    • /public_html/config/domains/*.php
  3. Adjust file + folder names - Suggestions
    • Match /config/domains/* config file with web folder name.
    • Add a random hash after it to prevent guessing other web config filenames.

.htaccess files

  1. Check the web root and /live/ folder files:
    • Replace any 'XXX' placeholders
    • Update domains, paths and needed features



Todo

  • Add list of unneeded default files to be removed
  • Simplify .htaccess redirections for WordPress

wordpress-web-setup-boilerplate's People

Contributors

christianoellers avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.