• This repository has been archived on 16/Jan/2024
  • Stars
    star
    1,024
  • Rank 43,261 (Top 0.9 %)
  • Language
    PHP
  • License
    MIT License
  • Created almost 12 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

WordPress plugin which contains a collection of modules to apply theme-agnostic front-end modifications

Soil

Packagist Packagist Downloads Build Status

A WordPress plugin which contains a collection of modules to apply theme-agnostic front-end modifications.

Soil is a commercial plugin available from https://roots.io/plugins/soil/. It's hosted on a public GitHub repository to allow for contributions from the community. It's also published on Packagist to allow easier installation with Composer.

Support

Use Roots Discourse to ask questions, get support, or report issues. Soil must be purchased in order to get support.

Requirements

Prerequisite How to check How to install
PHP >= 5.6.x php -v php.net

Installation

You can install this plugin via the command-line or the WordPress admin panel.

via Command-line

If you're using Composer to manage WordPress, add Soil to your project's dependencies.

composer require roots/soil

Then activate the plugin via wp-cli.

wp plugin activate soil

via WordPress Admin Panel

  1. Download the latest zip of this repo.
  2. In your WordPress admin panel, navigate to Plugins->Add New
  3. Click Upload Plugin
  4. Upload the zip file that you downloaded.

Modules

  • Cleaner WordPress markup
    add_theme_support('soil', 'clean-up');

  • Disable REST API
    add_theme_support('soil', 'disable-rest-api');

  • Disable asset versioning
    add_theme_support('soil', 'disable-asset-versioning');

  • Disable trackbacks
    add_theme_support('soil', 'disable-trackbacks');

  • Google Analytics
    add_theme_support('soil', ['google-analytics' => 'UA-XXXXX-Y']);

  • Move all JS to the footer
    add_theme_support('soil', 'js-to-footer');

  • Cleaner walker for navigation menus
    add_theme_support('soil', 'nav-walker');

  • Convert search results from /?s=query to /search/query/
    add_theme_support('soil', 'nice-search');

  • Root relative URLs
    add_theme_support('soil', 'relative-urls');

And in a format you can copy & paste into your theme:

/**
 * Enable features from Soil when plugin is activated
 * @link https://roots.io/plugins/soil/
 */
add_theme_support('soil', [
    'clean-up',
    'disable-rest-api',
    'disable-asset-versioning',
    'disable-trackbacks',
    'google-analytics' => 'UA-XXXXX-Y',
    'js-to-footer',
    'nav-walker',
    'nice-search',
    'relative-urls'
]);

Module options

Soil 4 introduced support for options on some modules.

Full annotated list of features and options
/**
 * Enable features from Soil when plugin is activated
 * @link https://roots.io/plugins/soil/
 */
add_theme_support('soil', [
    /**
     * Clean up WordPress
     */
    'clean-up' => [
        /**
         * Obscure and suppress WordPress information.
         */
        'wp_obscurity',

        /**
         * Disable WordPress emojis.
         */
        'disable_emojis',

        /**
         * Disable Gutenberg block library CSS.
         */
        'disable_gutenberg_block_css',

        /**
         * Disable extra RSS feeds.
         */
        'disable_extra_rss',

        /**
         * Disable recent comments CSS.
         */
        'disable_recent_comments_css',

        /**
         * Disable gallery CSS.
         */
        'disable_gallery_css',

        /**
         * Clean HTML5 markup.
         */
        'clean_html5_markup',
    ],

    /**
     * Disable WordPress REST API
     */
    'disable-rest-api',

    /**
     * Remove version query string from all styles and scripts
     */
    'disable-asset-versioning',

    /**
     * Disables trackbacks/pingbacks
     */
    'disable-trackbacks',

    /**
     * Google Analytics
     */
    'google-analytics' => [
        /**
         * This is to go live with GA.
         *
         * This should probably be false in non-production.
         */
        'should_load' => false,

        /**
         * Google Analytics ID
         *
         * This is also known as your "property ID" or "measurement ID"
         *
         * Format: UA-XXXXX-Y
         */
        'google_analytics_id' => null,

        /**
         * Optimize container ID
         *
         * Format: OPT-A1B2CD (previously: GTM-A1B2CD)
         *
         * @link https://support.google.com/optimize/answer/6262084
         */
        'optimize_id' => null,

        /**
         * Anonymize user IP addresses.
         *
         * This might be required depending on region.
         *
         * @link https://github.com/roots/soil/pull/206
         */
        'anonymize_ip',
    ],

    /**
     * Moves all scripts to wp_footer action
     */
    'js-to-footer',

    /**
     * Cleaner walker for wp_nav_menu()
     */
    'nav-walker',

    /**
     * Redirects search results from /?s=query to /search/query/, converts %20 to +
     *
     * @link http://txfx.net/wordpress-plugins/nice-search/
     */
    'nice-search',

    /**
     * Convert absolute URLs to relative URLs
     *
     * Inspired by {@link https://web.archive.org/web/20180529232418/http://www.456bereastreet.com/archive/201010/how_to_make_wordpress_urls_root_relative/}
     */
    'relative-urls',
]);

Contributing

Contributions are welcome from everyone. We have contributing guidelines to help you get started.

Community

Keep track of development and community news.

More Repositories

1

sage

WordPress starter theme with Laravel Blade components and templates, Tailwind CSS, and a modern development workflow
PHP
12,542
star
2

bedrock

WordPress boilerplate with Composer, easier configuration, and an improved folder structure
PHP
6,012
star
3

trellis

WordPress LEMP stack with PHP 8.1, Composer, WP-CLI and more
Jinja
2,462
star
4

acorn

Laravel components for WordPress plugins and themes
PHP
644
star
5

wp-password-bcrypt

WordPress plugin to implement secure bcrypt hashed passwords
PHP
612
star
6

roots-example-project.com

Example Roots stack project (Trellis, Bedrock, Sage)
Jinja
459
star
7

wp-stage-switcher

WordPress plugin that allows you to switch between different environments from the admin bar
PHP
367
star
8

bud

High-performance build system that supports SWC, esbuild, and Babel
TypeScript
313
star
9

sage-woocommerce

WooCommerce integration for Sage 9 themes
PHP
213
star
10

bedrock-capistrano

Capistrano configs/integration for Bedrock
Ruby
178
star
11

docs

📝 Documentation for Roots projects
168
star
12

trellis-cli

A CLI to manage Trellis projects
Go
163
star
13

wordpress

Automatically updated WordPress composer package
163
star
14

wp-h5bp-htaccess

WordPress plugin that adds HTML5 Boilerplate's .htaccess
PHP
153
star
15

roots-sass

Deprecated in favor of Sage
132
star
16

clover

WordPress plugin boilerplate
JavaScript
82
star
17

capistrano-grunt

Capistrano extension for Grunt tasks
Ruby
67
star
18

roots-rewrites

Unsupported: Clean URL rewrites for WordPress assets
PHP
62
star
19

multisite-url-fixer

Fixes WordPress issues with home and site URL on multisite when using Bedrock
PHP
57
star
20

sage-translations

Community translations for the Sage WordPress starter theme
Shell
52
star
21

wp-config

Bedrock's failsafe wp-config
PHP
50
star
22

wordpress-nginx

Chef cookbook to create Nginx sites for WordPress applications
Ruby
48
star
23

roots-wrapper-toolbar

WordPress plugin that displays the base and main templates selected by the Roots wrapper in the WordPress toolbar
PHP
48
star
24

palette-webpack-plugin

Generate a JSON file containing your color palette from existing Sass maps and/or Tailwind.
JavaScript
46
star
25

roots-cli

*Pre-alpha* Start a new Roots project with one command
Go
41
star
26

grunt-wp-assets

Unsupported: WordPress assets revisioning
JavaScript
40
star
27

bedrock-autoloader

Bedrock Autoloader enables standard plugins to be required just like must-use plugins
PHP
38
star
28

wordpress-packager

Helper to generate WordPress Composer packages
PHP
37
star
29

issue-closer-action

GitHub action to automatically close issues/PRs that don't match a regexp
JavaScript
34
star
30

sage-installer

Sage 9 installer
PHP
31
star
31

setup-trellis-cli

👷 Sets up Trellis CLI for GitHub Action workflows
JavaScript
27
star
32

bedrock-docker

https://roots.io/bedrock/
Dockerfile
25
star
33

sage-cli

Perform tasks with the Sage theme
TypeScript
21
star
34

acorn-prettify

Acorn Prettify contains a collection of modules to apply theme-agnostic front-end modifications to your Acorn-powered WordPress sites.
PHP
21
star
35

wp-cli-theme-activation

WP-CLI command for theme activation and setting options
PHP
19
star
36

acorn-example-package

A template for creating your own Acorn packages
PHP
18
star
37

grunt-wp-version

Unsupported: This project has been replaced with https://github.com/roots/grunt-wp-assets
JavaScript
18
star
38

wp-cookbook

Chef cookbook for WordPress sites
Ruby
17
star
39

wordpress-full

Automatically updated WordPress composer package (full version, with wp-content and themes)
16
star
40

wp-blade-check

Checks and displays an admin notice if your uncompiled Blade templates are publicly accessible
PHP
16
star
41

guidelines

Coding and contributing guidelines for Roots projects
16
star
42

wordpress-no-content

Automatically updated WordPress composer package (version without wp-content)
13
star
43

sage-lib

Library files for Sage 9
PHP
13
star
44

js-dom-router

JavaScript DOM Router
TypeScript
13
star
45

acorn-mail

Simple WordPress SMTP using Acorn.
PHP
13
star
46

bedrock-disallow-indexing

Disallow indexing of your site on non-production environments.
PHP
12
star
47

gutenberg-examples

8
star
48

.github

Default community health files for GitHub projects
TypeScript
7
star
49

vsce-blade-syntax

Roots specific syntax highlighting for blade template files
5
star
50

bud-generators

Standard generator library for @roots/bud.
HTML
5
star
51

discourse-topic-github-release-action

Post published GitHub releases from a repository to a Discourse instance.
JavaScript
4
star
52

dockerfiles

Dockerfile
4
star
53

trellis-deploy-action

GitHub Action for deploying Trellis sites
4
star
54

ansible-role-mailpit

Ansible Role - Mailpit email testing for developers
Jinja
3
star
55

homebrew-tap

Ruby
3
star
56

wordpress-generator-legacy

Legacy generator for the roots/wordpress Composer package. See https://github.com/roots/wordpress-packager for the current version.
PHP
1
star
57

support

PHP
1
star
58

acorn-fse-helper

Bootstrap FSE support in Acorn-based WordPress themes.
PHP
1
star