diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a356f3f..c0ebbfb 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -65,5 +65,5 @@ jobs: - name: Lint against parse errors run: composer lint -- --checkstyle | cs2pr - #- name: Lint blueprint file - # run: composer lint-blueprint + - name: Lint blueprint file + run: composer lint-blueprint diff --git a/.wordpress-org/blueprints/blueprint.json b/.wordpress-org/blueprints/blueprint.json new file mode 100644 index 0000000..44a4fc6 --- /dev/null +++ b/.wordpress-org/blueprints/blueprint.json @@ -0,0 +1,16 @@ +{ + "landingPage": "\/?robots=1", + "steps": [ + { + "step": "login", + "username": "admin", + "password": "password" + }, + { + "step": "defineWpConfigConsts", + "consts": { + "IS_PLAYGROUND_PREVIEW": true + } + } + ] +} diff --git a/README.md b/README.md index d113d2a..2ea1524 100644 --- a/README.md +++ b/README.md @@ -14,3 +14,39 @@ If you're developing on this plugin, you will probably want to run tests and lin * PHP Autofixer for code style: `composer fix-cs` * PHP Lint: `composer lint` * PHP Unit tests: `composer test` + +The default output of this plugin is as follows: + +```txt +# This site is very specific about who it allows crawling from. Our default is you're not allowed to crawl: +User-agent: * +Disallow: / + +# Below are the crawlers that are allowed to crawl this site. +# Below that list, you'll find paths that are blocked, even for them, and then paths within those blocked paths that are allowed. +User-agent: Googlebot +User-agent: AdsBot-Google +User-agent: MediaPartners-Google +User-agent: Applebot +User-agent: Yandex +User-agent: Baiduspider +User-agent: Bingbot +User-agent: Slurp +User-agent: DuckDuckBot +User-agent: ia_archiver +User-agent: FacebookExternalHit +User-agent: Twitterbot +User-agent: LinkedInBot +Disallow: /wp-json/ +Disallow: /?rest_route= +Disallow: /wp-admin/ +Disallow: /wp-content/cache/ +Disallow: /wp-content/plugins/ +Disallow: /xmlrpc.php +Disallow: /wp-includes/ +Allow: /wp-includes/css/ +Allow: /wp-includes/js/ + +# XML Sitemap: +Sitemap: https://example.com/sitemap_index.xml +``` diff --git a/composer.json b/composer.json index 0fd3223..158df44 100644 --- a/composer.json +++ b/composer.json @@ -29,6 +29,9 @@ "lint": [ "@php ./vendor/php-parallel-lint/php-parallel-lint/parallel-lint . -e php --show-deprecated --exclude vendor --exclude node_modules --exclude .git" ], + "lint-blueprint": [ + "@php -r \"exit( intval( is_null( json_decode( file_get_contents( './.wordpress-org/blueprints/blueprint.json' ) ) ) ) );\"" + ], "test": [ "@php ./vendor/phpunit/phpunit/phpunit" ]