Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Commit

Permalink
Merge pull request #252 from roots/next
Browse files Browse the repository at this point in the history
Soil 4
  • Loading branch information
retlehs authored Aug 30, 2020
2 parents 63dcd6e + 8fea81d commit 98582d6
Show file tree
Hide file tree
Showing 54 changed files with 3,032 additions and 941 deletions.
5 changes: 4 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ root = true

[*]
indent_style = space
indent_size = 2
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[resources/**]
indent_size = 2
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
vendor
composer.lock
phpunit.xml
phpcs.xml
10 changes: 6 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
sudo: false
language: php
php:
- nightly
- 7.0
- 5.6
- 7.0
- 7.1
- 7.2
- 7.3
- 7.4

matrix:
fast_finish: true
allow_failures:
- php: nightly

cache:
directories:
Expand All @@ -23,4 +24,5 @@ install:
- composer install -o --prefer-dist --no-interaction

script:
- composer lint
- composer test
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
### 4.0.0: August 29th, 2020
* BREAKING CHANGE - Refactor entire code base
* Add options support for modules
* Remove oEmbed wrapper due to incompatibility with Gutenberg

### 3.9.0: December 7th, 2019
* Enable beacon tracking for Google Analytics ([#243](https://github.com/roots/soil/pull/243))
* Add support for GitHub Updater plugin ([#241](https://github.com/roots/soil/pull/241))
Expand Down
182 changes: 162 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Soil is a commercial plugin available from [https://roots.io/plugins/soil/](http
</thead>
<tbody>
<tr>
<td>PHP &gt;= 5.4.x</td>
<td>PHP &gt;= 5.6.x</td>
<td><code>php -v</code></td>
<td>
<a href="http://php.net/manual/en/install.php">php.net</a>
Expand Down Expand Up @@ -56,49 +56,191 @@ wp plugin activate soil
## Modules

* **Cleaner WordPress markup**<br>
`add_theme_support('soil-clean-up');`
`add_theme_support('soil', 'clean-up');`

* **Disable REST API**<br>
`add_theme_support('soil-disable-rest-api');`
`add_theme_support('soil', 'disable-rest-api');`

* **Disable asset versioning**<br>
`add_theme_support('soil-disable-asset-versioning');`
`add_theme_support('soil', 'disable-asset-versioning');`

* **Disable trackbacks**<br>
`add_theme_support('soil-disable-trackbacks');`
`add_theme_support('soil', 'disable-trackbacks');`

* **Google Analytics** ([more info](https://github.com/roots/soil/wiki/Google-Analytics))<br>
`add_theme_support('soil-google-analytics', 'UA-XXXXX-Y');`
* **Google Analytics**<br>
`add_theme_support('soil', 'google-analytics');`

* **Move all JS to the footer**<br>
`add_theme_support('soil-js-to-footer');`
`add_theme_support('soil, 'js-to-footer');`

* **Cleaner walker for navigation menus**<br>
`add_theme_support('soil-nav-walker');`
`add_theme_support('soil', 'nav-walker');`

* **Convert search results from `/?s=query` to `/search/query/`**<br>
`add_theme_support('soil-nice-search');`
`add_theme_support('soil', 'nice-search');`

* **Root relative URLs**<br>
`add_theme_support('soil-relative-urls');`
`add_theme_support('soil', 'relative-urls');`

And in a format you can copy & paste into your theme:
```php
/**
* Enable features from Soil when plugin is activated
* @link https://roots.io/plugins/soil/
*/
add_theme_support('soil-clean-up');
add_theme_support('soil-disable-rest-api');
add_theme_support('soil-disable-asset-versioning');
add_theme_support('soil-disable-trackbacks');
add_theme_support('soil-google-analytics', 'UA-XXXXX-Y');
add_theme_support('soil-js-to-footer');
add_theme_support('soil-nav-walker');
add_theme_support('soil-nice-search');
add_theme_support('soil-relative-urls');
add_theme_support('soil', [
'clean-up',
'disable-rest-api',
'disable-asset-versioning',
'disable-trackbacks',
'google-analytics', => [
'should_load' => WP_ENV === 'production', // Only load on production
'google_analytics_id' => 'UA-XXXYYY',
'anonymize_ip' => true,
],
'js-to-footer',
'nav-walker',
'nice-search',
'relative-urls'
]);
```

### Module options

Soil 4 introduced support for options on some modules.

<details>
<summary>Full annotated list of features and options</summary>

```php

/**
* 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_rececent_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 http://www.456bereastreet.com/archive/201010/how_to_make_wordpress_urls_root_relative/}
*/
'relative-urls',
]);
```
</details>


## Support

Use the [Roots Discourse](https://discourse.roots.io/) to ask questions and get support. License is required.
Expand Down
34 changes: 28 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
"name": "Scott Walkinshaw",
"email": "[email protected]",
"homepage": "https://github.com/swalkinshaw"
},
{
"name": "QWp6t",
"email": "[email protected]",
"homepage": "https://github.com/qwp6t"
}
],
"keywords": [
Expand All @@ -23,16 +28,33 @@
"issues": "https://github.com/roots/soil/issues",
"forum": "https://discourse.roots.io/"
},
"autoload": {
"psr-4": {
"Roots\\Soil\\": "src/"
},
"files": [
"src/helpers.php"
]
},
"autoload-dev": {
"psr-4": {
"Roots\\Soil\\Tests\\": "tests/",
"Roots\\Soil\\Tests\\Fixtures\\Modules\\": "tests/__fixtures__/modules/"
}
},
"require": {
"php": ">=5.4.0",
"composer/installers": "~1.0"
"php": ">=5.6.0"
},
"require-dev": {
"squizlabs/php_codesniffer": "^2.5.1"
"squizlabs/php_codesniffer": "^3.5",
"brain/monkey": "^2.4",
"phpunit/phpunit": "<= 9.3",
"mockery/mockery": "^1.3 | ^1.4",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
"phpcompatibility/php-compatibility": "^9.3"
},
"scripts": {
"test": [
"vendor/bin/phpcs --extensions=php --ignore=vendor/ -n -s ."
]
"test": "vendor/bin/phpunit",
"lint": "vendor/bin/phpcs"
}
}
Loading

0 comments on commit 98582d6

Please sign in to comment.