Compare commits

...

5 Commits

7 changed files with 103 additions and 150 deletions

View File

@ -11,15 +11,15 @@
} }
], ],
"require": { "require": {
"php": ">=8.0.2", "php": "~8.1",
"eftec/bladeone": "^3.52" "eftec/bladeone": "^3.52"
}, },
"require-dev": { "require-dev": {
"php-parallel-lint/php-parallel-lint": "^1.3.2", "php-parallel-lint/php-parallel-lint": "^1.3.2",
"phpstan/extension-installer": "^1.1", "phpstan/extension-installer": "^1.3.1",
"phpstan/phpstan": "^1.8", "phpstan/phpstan": "^1.10.26",
"szepeviktor/phpstan-wordpress": "^1.1", "szepeviktor/phpstan-wordpress": "^1.3.0",
"wp-cli/i18n-command": "^2.4.0", "wp-cli/i18n-command": "^2.4.3",
"wp-coding-standards/wpcs": "^2.3.0" "wp-coding-standards/wpcs": "^2.3.0"
}, },
"config": { "config": {

195
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "6fa6e29e5c44798ae9959277f4a2a98a", "content-hash": "c26471e5df77f5b3c095f9afae81388f",
"packages": [ "packages": [
{ {
"name": "eftec/bladeone", "name": "eftec/bladeone",
@ -223,16 +223,16 @@
}, },
{ {
"name": "mck89/peast", "name": "mck89/peast",
"version": "v1.15.1", "version": "v1.15.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/mck89/peast.git", "url": "https://github.com/mck89/peast.git",
"reference": "cf06286910b7efc9dce7503553ebee314df3d3d3" "reference": "07d82a271d372c6f37897a70b0381ca2ec2e364a"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/mck89/peast/zipball/cf06286910b7efc9dce7503553ebee314df3d3d3", "url": "https://api.github.com/repos/mck89/peast/zipball/07d82a271d372c6f37897a70b0381ca2ec2e364a",
"reference": "cf06286910b7efc9dce7503553ebee314df3d3d3", "reference": "07d82a271d372c6f37897a70b0381ca2ec2e364a",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -245,7 +245,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.15.1-dev" "dev-master": "1.15.2-dev"
} }
}, },
"autoload": { "autoload": {
@ -267,9 +267,9 @@
"description": "Peast is PHP library that generates AST for JavaScript code", "description": "Peast is PHP library that generates AST for JavaScript code",
"support": { "support": {
"issues": "https://github.com/mck89/peast/issues", "issues": "https://github.com/mck89/peast/issues",
"source": "https://github.com/mck89/peast/tree/v1.15.1" "source": "https://github.com/mck89/peast/tree/v1.15.2"
}, },
"time": "2023-01-21T13:18:17+00:00" "time": "2023-07-15T12:25:27+00:00"
}, },
{ {
"name": "mustache/mustache", "name": "mustache/mustache",
@ -380,16 +380,16 @@
}, },
{ {
"name": "php-stubs/wordpress-stubs", "name": "php-stubs/wordpress-stubs",
"version": "v6.1.1", "version": "v6.2.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/php-stubs/wordpress-stubs.git", "url": "https://github.com/php-stubs/wordpress-stubs.git",
"reference": "601c429ba8d91ef50a2a1bec05a7cd38b88064ff" "reference": "0009429e639b748eef1c955200ea0d4e5ad5627d"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/601c429ba8d91ef50a2a1bec05a7cd38b88064ff", "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/0009429e639b748eef1c955200ea0d4e5ad5627d",
"reference": "601c429ba8d91ef50a2a1bec05a7cd38b88064ff", "reference": "0009429e639b748eef1c955200ea0d4e5ad5627d",
"shasum": "" "shasum": ""
}, },
"require-dev": { "require-dev": {
@ -397,7 +397,8 @@
"php": "~7.3 || ~8.0", "php": "~7.3 || ~8.0",
"php-stubs/generator": "^0.8.3", "php-stubs/generator": "^0.8.3",
"phpdocumentor/reflection-docblock": "^5.3", "phpdocumentor/reflection-docblock": "^5.3",
"phpstan/phpstan": "^1.2" "phpstan/phpstan": "^1.10.12",
"phpunit/phpunit": "^9.5"
}, },
"suggest": { "suggest": {
"paragonie/sodium_compat": "Pure PHP implementation of libsodium", "paragonie/sodium_compat": "Pure PHP implementation of libsodium",
@ -418,28 +419,28 @@
], ],
"support": { "support": {
"issues": "https://github.com/php-stubs/wordpress-stubs/issues", "issues": "https://github.com/php-stubs/wordpress-stubs/issues",
"source": "https://github.com/php-stubs/wordpress-stubs/tree/v6.1.1" "source": "https://github.com/php-stubs/wordpress-stubs/tree/v6.2.1"
}, },
"time": "2023-02-09T11:10:35+00:00" "time": "2023-05-18T04:35:23+00:00"
}, },
{ {
"name": "phpstan/extension-installer", "name": "phpstan/extension-installer",
"version": "1.2.0", "version": "1.3.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpstan/extension-installer.git", "url": "https://github.com/phpstan/extension-installer.git",
"reference": "f06dbb052ddc394e7896fcd1cfcd533f9f6ace40" "reference": "f45734bfb9984c6c56c4486b71230355f066a58a"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpstan/extension-installer/zipball/f06dbb052ddc394e7896fcd1cfcd533f9f6ace40", "url": "https://api.github.com/repos/phpstan/extension-installer/zipball/f45734bfb9984c6c56c4486b71230355f066a58a",
"reference": "f06dbb052ddc394e7896fcd1cfcd533f9f6ace40", "reference": "f45734bfb9984c6c56c4486b71230355f066a58a",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"composer-plugin-api": "^2.0", "composer-plugin-api": "^2.0",
"php": "^7.2 || ^8.0", "php": "^7.2 || ^8.0",
"phpstan/phpstan": "^1.8.0" "phpstan/phpstan": "^1.9.0"
}, },
"require-dev": { "require-dev": {
"composer/composer": "^2.0", "composer/composer": "^2.0",
@ -462,22 +463,22 @@
"description": "Composer plugin for automatic installation of PHPStan extensions", "description": "Composer plugin for automatic installation of PHPStan extensions",
"support": { "support": {
"issues": "https://github.com/phpstan/extension-installer/issues", "issues": "https://github.com/phpstan/extension-installer/issues",
"source": "https://github.com/phpstan/extension-installer/tree/1.2.0" "source": "https://github.com/phpstan/extension-installer/tree/1.3.1"
}, },
"time": "2022-10-17T12:59:16+00:00" "time": "2023-05-24T08:59:17+00:00"
}, },
{ {
"name": "phpstan/phpstan", "name": "phpstan/phpstan",
"version": "1.10.6", "version": "1.10.26",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpstan/phpstan.git", "url": "https://github.com/phpstan/phpstan.git",
"reference": "50d089a3e0904b0fe7e2cf2d4fd37d427d64235a" "reference": "5d660cbb7e1b89253a47147ae44044f49832351f"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/50d089a3e0904b0fe7e2cf2d4fd37d427d64235a", "url": "https://api.github.com/repos/phpstan/phpstan/zipball/5d660cbb7e1b89253a47147ae44044f49832351f",
"reference": "50d089a3e0904b0fe7e2cf2d4fd37d427d64235a", "reference": "5d660cbb7e1b89253a47147ae44044f49832351f",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -506,8 +507,11 @@
"static analysis" "static analysis"
], ],
"support": { "support": {
"docs": "https://phpstan.org/user-guide/getting-started",
"forum": "https://github.com/phpstan/phpstan/discussions",
"issues": "https://github.com/phpstan/phpstan/issues", "issues": "https://github.com/phpstan/phpstan/issues",
"source": "https://github.com/phpstan/phpstan/tree/1.10.6" "security": "https://github.com/phpstan/phpstan/security/policy",
"source": "https://github.com/phpstan/phpstan-src"
}, },
"funding": [ "funding": [
{ {
@ -523,67 +527,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-03-09T16:55:12+00:00" "time": "2023-07-19T12:44:37+00:00"
},
{
"name": "rmccue/requests",
"version": "v1.8.1",
"source": {
"type": "git",
"url": "https://github.com/WordPress/Requests.git",
"reference": "82e6936366eac3af4d836c18b9d8c31028fe4cd5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/WordPress/Requests/zipball/82e6936366eac3af4d836c18b9d8c31028fe4cd5",
"reference": "82e6936366eac3af4d836c18b9d8c31028fe4cd5",
"shasum": ""
},
"require": {
"php": ">=5.2"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.7",
"php-parallel-lint/php-console-highlighter": "^0.5.0",
"php-parallel-lint/php-parallel-lint": "^1.3",
"phpcompatibility/php-compatibility": "^9.0",
"phpunit/phpunit": "^4.8 || ^5.7 || ^6.5 || ^7.5",
"requests/test-server": "dev-master",
"squizlabs/php_codesniffer": "^3.5",
"wp-coding-standards/wpcs": "^2.0"
},
"type": "library",
"autoload": {
"psr-0": {
"Requests": "library/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"ISC"
],
"authors": [
{
"name": "Ryan McCue",
"homepage": "http://ryanmccue.info"
}
],
"description": "A HTTP library written in PHP, for human beings.",
"homepage": "http://github.com/WordPress/Requests",
"keywords": [
"curl",
"fsockopen",
"http",
"idna",
"ipv6",
"iri",
"sockets"
],
"support": {
"issues": "https://github.com/WordPress/Requests/issues",
"source": "https://github.com/WordPress/Requests/tree/v1.8.1"
},
"time": "2021-06-04T09:56:25+00:00"
}, },
{ {
"name": "squizlabs/php_codesniffer", "name": "squizlabs/php_codesniffer",
@ -644,16 +588,16 @@
}, },
{ {
"name": "symfony/finder", "name": "symfony/finder",
"version": "v6.2.7", "version": "v6.3.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/finder.git", "url": "https://github.com/symfony/finder.git",
"reference": "20808dc6631aecafbe67c186af5dcb370be3a0eb" "reference": "d9b01ba073c44cef617c7907ce2419f8d00d75e2"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/finder/zipball/20808dc6631aecafbe67c186af5dcb370be3a0eb", "url": "https://api.github.com/repos/symfony/finder/zipball/d9b01ba073c44cef617c7907ce2419f8d00d75e2",
"reference": "20808dc6631aecafbe67c186af5dcb370be3a0eb", "reference": "d9b01ba073c44cef617c7907ce2419f8d00d75e2",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -688,7 +632,7 @@
"description": "Finds files and directories via an intuitive fluent interface", "description": "Finds files and directories via an intuitive fluent interface",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"support": { "support": {
"source": "https://github.com/symfony/finder/tree/v6.2.7" "source": "https://github.com/symfony/finder/tree/v6.3.0"
}, },
"funding": [ "funding": [
{ {
@ -704,7 +648,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-02-16T09:57:23+00:00" "time": "2023-04-02T01:25:41+00:00"
}, },
{ {
"name": "symfony/polyfill-php73", "name": "symfony/polyfill-php73",
@ -787,22 +731,22 @@
}, },
{ {
"name": "szepeviktor/phpstan-wordpress", "name": "szepeviktor/phpstan-wordpress",
"version": "v1.1.7", "version": "v1.3.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/szepeviktor/phpstan-wordpress.git", "url": "https://github.com/szepeviktor/phpstan-wordpress.git",
"reference": "979dcb81a01942b576b9fbf72dcb9515c57a4aa8" "reference": "5b5cc77ed51fdaf64efe3f00b5aae4b709d2cfa9"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/szepeviktor/phpstan-wordpress/zipball/979dcb81a01942b576b9fbf72dcb9515c57a4aa8", "url": "https://api.github.com/repos/szepeviktor/phpstan-wordpress/zipball/5b5cc77ed51fdaf64efe3f00b5aae4b709d2cfa9",
"reference": "979dcb81a01942b576b9fbf72dcb9515c57a4aa8", "reference": "5b5cc77ed51fdaf64efe3f00b5aae4b709d2cfa9",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^7.2 || ^8.0", "php": "^7.2 || ^8.0",
"php-stubs/wordpress-stubs": "^4.7 || ^5.0 || ^6.0", "php-stubs/wordpress-stubs": "^4.7 || ^5.0 || ^6.0",
"phpstan/phpstan": "^1.8.7", "phpstan/phpstan": "^1.10.0",
"symfony/polyfill-php73": "^1.12.0" "symfony/polyfill-php73": "^1.12.0"
}, },
"require-dev": { "require-dev": {
@ -840,32 +784,22 @@
], ],
"support": { "support": {
"issues": "https://github.com/szepeviktor/phpstan-wordpress/issues", "issues": "https://github.com/szepeviktor/phpstan-wordpress/issues",
"source": "https://github.com/szepeviktor/phpstan-wordpress/tree/v1.1.7" "source": "https://github.com/szepeviktor/phpstan-wordpress/tree/v1.3.0"
}, },
"funding": [ "time": "2023-04-23T06:15:06+00:00"
{
"url": "https://www.paypal.me/szepeviktor",
"type": "custom"
},
{
"url": "https://github.com/szepeviktor",
"type": "github"
}
],
"time": "2023-02-04T13:10:27+00:00"
}, },
{ {
"name": "wp-cli/i18n-command", "name": "wp-cli/i18n-command",
"version": "v2.4.2", "version": "v2.4.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/wp-cli/i18n-command.git", "url": "https://github.com/wp-cli/i18n-command.git",
"reference": "43d5cf8968dbddf90907083ad048f12be5ca3d43" "reference": "203b020318fe2596a218bf52db25adc6b187f42d"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/wp-cli/i18n-command/zipball/43d5cf8968dbddf90907083ad048f12be5ca3d43", "url": "https://api.github.com/repos/wp-cli/i18n-command/zipball/203b020318fe2596a218bf52db25adc6b187f42d",
"reference": "43d5cf8968dbddf90907083ad048f12be5ca3d43", "reference": "203b020318fe2596a218bf52db25adc6b187f42d",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -918,9 +852,9 @@
"homepage": "https://github.com/wp-cli/i18n-command", "homepage": "https://github.com/wp-cli/i18n-command",
"support": { "support": {
"issues": "https://github.com/wp-cli/i18n-command/issues", "issues": "https://github.com/wp-cli/i18n-command/issues",
"source": "https://github.com/wp-cli/i18n-command/tree/v2.4.2" "source": "https://github.com/wp-cli/i18n-command/tree/v2.4.3"
}, },
"time": "2023-02-17T18:14:41+00:00" "time": "2023-03-24T18:15:59+00:00"
}, },
{ {
"name": "wp-cli/mustangostang-spyc", "name": "wp-cli/mustangostang-spyc",
@ -975,16 +909,16 @@
}, },
{ {
"name": "wp-cli/php-cli-tools", "name": "wp-cli/php-cli-tools",
"version": "v0.11.17", "version": "v0.11.19",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/wp-cli/php-cli-tools.git", "url": "https://github.com/wp-cli/php-cli-tools.git",
"reference": "f6be76b7c4ee2ef93c9531b8a37bdb7ce42c3728" "reference": "2d27f0db5c36f5aa0064abecddd6d05f28c4d001"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/wp-cli/php-cli-tools/zipball/f6be76b7c4ee2ef93c9531b8a37bdb7ce42c3728", "url": "https://api.github.com/repos/wp-cli/php-cli-tools/zipball/2d27f0db5c36f5aa0064abecddd6d05f28c4d001",
"reference": "f6be76b7c4ee2ef93c9531b8a37bdb7ce42c3728", "reference": "2d27f0db5c36f5aa0064abecddd6d05f28c4d001",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1032,29 +966,28 @@
], ],
"support": { "support": {
"issues": "https://github.com/wp-cli/php-cli-tools/issues", "issues": "https://github.com/wp-cli/php-cli-tools/issues",
"source": "https://github.com/wp-cli/php-cli-tools/tree/v0.11.17" "source": "https://github.com/wp-cli/php-cli-tools/tree/v0.11.19"
}, },
"time": "2023-01-12T01:18:21+00:00" "time": "2023-07-21T11:37:15+00:00"
}, },
{ {
"name": "wp-cli/wp-cli", "name": "wp-cli/wp-cli",
"version": "v2.7.1", "version": "v2.8.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/wp-cli/wp-cli.git", "url": "https://github.com/wp-cli/wp-cli.git",
"reference": "1ddc754f1c15e56fb2cdd1a4e82bd0ec6ca32a76" "reference": "5dd2340b9a01c3cfdbaf5e93a140759fdd190eee"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/wp-cli/wp-cli/zipball/1ddc754f1c15e56fb2cdd1a4e82bd0ec6ca32a76", "url": "https://api.github.com/repos/wp-cli/wp-cli/zipball/5dd2340b9a01c3cfdbaf5e93a140759fdd190eee",
"reference": "1ddc754f1c15e56fb2cdd1a4e82bd0ec6ca32a76", "reference": "5dd2340b9a01c3cfdbaf5e93a140759fdd190eee",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"ext-curl": "*", "ext-curl": "*",
"mustache/mustache": "^2.14.1", "mustache/mustache": "^2.14.1",
"php": "^5.6 || ^7.0 || ^8.0", "php": "^5.6 || ^7.0 || ^8.0",
"rmccue/requests": "^1.8",
"symfony/finder": ">2.7", "symfony/finder": ">2.7",
"wp-cli/mustangostang-spyc": "^0.6.3", "wp-cli/mustangostang-spyc": "^0.6.3",
"wp-cli/php-cli-tools": "~0.11.2" "wp-cli/php-cli-tools": "~0.11.2"
@ -1078,7 +1011,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "2.8.x-dev" "dev-main": "2.9.x-dev"
} }
}, },
"autoload": { "autoload": {
@ -1105,7 +1038,7 @@
"issues": "https://github.com/wp-cli/wp-cli/issues", "issues": "https://github.com/wp-cli/wp-cli/issues",
"source": "https://github.com/wp-cli/wp-cli" "source": "https://github.com/wp-cli/wp-cli"
}, },
"time": "2022-10-17T23:10:42+00:00" "time": "2023-06-05T06:55:55+00:00"
}, },
{ {
"name": "wp-coding-standards/wpcs", "name": "wp-coding-standards/wpcs",
@ -1165,7 +1098,7 @@
"prefer-stable": true, "prefer-stable": true,
"prefer-lowest": false, "prefer-lowest": false,
"platform": { "platform": {
"php": ">=8.0.2" "php": "~8.1"
}, },
"platform-dev": [], "platform-dev": [],
"plugin-api-version": "2.3.0" "plugin-api-version": "2.3.0"

View File

@ -20,6 +20,7 @@ class App {
/** /**
* Any logic that needs executed when the plugin is activated. * Any logic that needs executed when the plugin is activated.
* *
* @package PluginNamespace\App
* @since 1.0.0 * @since 1.0.0
* *
* @return void * @return void
@ -37,18 +38,21 @@ class App {
/** /**
* Any logic that needs executed when the plugin is deactivated. * Any logic that needs executed when the plugin is deactivated.
* *
* @package PluginNamespace\App
* @since 1.0.0 * @since 1.0.0
* *
* @return void * @return void
*/ */
public static function plugin_deactivation(): void { public static function plugin_deactivation(): void {
// // phpcs:disable
// phpcs:enable
} }
/** /**
* Check that the cache directory for Blade exists and * Check that the cache directory for Blade exists and
* if not then attempt to create it. * if not then attempt to create it.
* *
* @package PluginNamespace\App
* @since 1.0.0 * @since 1.0.0
* *
* @throws \Exception * @throws \Exception
@ -59,13 +63,13 @@ class App {
if ( ! file_exists( NMSP_PLUGIN_BASE_DIR . '/cache/blade/.gitignore' ) ) { if ( ! file_exists( NMSP_PLUGIN_BASE_DIR . '/cache/blade/.gitignore' ) ) {
try { try {
mkdir( NMSP_PLUGIN_BASE_DIR . '/cache/blade', 0755, true ); mkdir( NMSP_PLUGIN_BASE_DIR . '/cache/blade', 0755, true );
} catch ( Exception $e ) { } catch ( Exception $exp ) {
$error_payload = array( $error_payload = array(
'level' => 'critical', 'level' => 'critical',
'message' => $e->getMessage(), 'message' => $exp->getMessage(),
'context' => array( 'context' => array(
'file' => $e->getFile(), 'file' => $exp->getFile(),
'line' => $e->getLine(), 'line' => $exp->getLine(),
), ),
); );
error_log( json_encode( $error_payload, JSON_PRETTY_PRINT ) ); error_log( json_encode( $error_payload, JSON_PRETTY_PRINT ) );
@ -77,12 +81,13 @@ class App {
* Return an instance of this plugin class. If it has * Return an instance of this plugin class. If it has
* not been initialized, do so then return it. * not been initialized, do so then return it.
* *
* @package PluginNamespace\App
* @since 1.0.0 * @since 1.0.0
* *
* @return \PluginNamespace\App * @return \PluginNamespace\App
*/ */
public static function get_instance(): App { public static function get_instance(): App {
if ( ! isset( self::$instance ) && ! ( self::$instance instanceof App ) ) { if ( ! ( self::$instance instanceof App ) ) {
self::$instance = new App(); self::$instance = new App();
self::$instance->load_plugin_textdomain(); self::$instance->load_plugin_textdomain();
@ -96,6 +101,7 @@ class App {
/** /**
* Load your translation files for this plugin. * Load your translation files for this plugin.
* *
* @package PluginNamespace\App
* @since 1.0.0 * @since 1.0.0
* *
* @return void * @return void
@ -107,14 +113,17 @@ class App {
/** /**
* Steps to take when initializing this plugin?? * Steps to take when initializing this plugin??
* *
* @package PluginNamespace\App
* @since 1.0.0 * @since 1.0.0
* *
* @return void * @return void
*/ */
public function scaffold_plugin(): void { public function scaffold_plugin(): void {
// phpcs:disable
if ( is_admin() ) { if ( is_admin() ) {
// admin only logic here // admin only logic here, remove phpcs calls around this
} }
// phpcs:enable
// other logic here // other logic here
} }
@ -126,6 +135,7 @@ class App {
* *
* @codeCoverageIgnore * @codeCoverageIgnore
* *
* @package PluginNamespace\App
* @since 1.0.0 * @since 1.0.0
* *
* @return void * @return void
@ -148,6 +158,7 @@ class App {
/** /**
* Load BladeOne as the templating engine for the plugin. * Load BladeOne as the templating engine for the plugin.
* *
* @package PluginNamespace\App
* @since 1.0.0 * @since 1.0.0
* *
* @param \eftec\bladeone\BladeOne $blade * @param \eftec\bladeone\BladeOne $blade

View File

@ -13,6 +13,7 @@ class NmspCli {
/** /**
* Class constructor. Can add commands here. * Class constructor. Can add commands here.
* *
* @package PluginNamespace\NmspCli
* @since 1.0.0 * @since 1.0.0
* *
* @return void * @return void
@ -31,6 +32,7 @@ class NmspCli {
/** /**
* A sample method where something is done by being invoked from WP CLI. * A sample method where something is done by being invoked from WP CLI.
* *
* @package PluginNamespace\NmspCli
* @since 1.0.0 * @since 1.0.0
* *
* @return void * @return void

View File

@ -11,6 +11,7 @@ class Rewrites {
/** /**
* Class constructor. * Class constructor.
* *
* @package PluginNamespace\Front\Rewrites
* @since 1.0.0 * @since 1.0.0
* *
* @return void * @return void
@ -25,6 +26,7 @@ class Rewrites {
/** /**
* Generate new rewrite rules and flush the cached values. * Generate new rewrite rules and flush the cached values.
* *
* @package PluginNamespace\Front\Rewrites
* @since 1.0.0 * @since 1.0.0
* *
* @return void * @return void
@ -50,9 +52,10 @@ class Rewrites {
* Build the array of post IDs that have a slug for the URL * Build the array of post IDs that have a slug for the URL
* along with what custom query variable to use. * along with what custom query variable to use.
* *
* @package PluginNamespace\Front\Rewrites
* @since 1.0.0 * @since 1.0.0
* *
* @return array * @return array<int, array<string, string>>
*/ */
public function build_rewrite_urls(): array { public function build_rewrite_urls(): array {
$pages = array(); $pages = array();
@ -82,11 +85,12 @@ class Rewrites {
* Append custom query variables to the list WordPress maintinas * Append custom query variables to the list WordPress maintinas
* with each request. * with each request.
* *
* @package PluginNamespace\Front\Rewrites
* @since 1.0.0 * @since 1.0.0
* *
* @param array $variable * @param array<int, string> $vars
* *
* @return array * @return array<int, string>
*/ */
public function custom_query_vars( array $vars ): array { public function custom_query_vars( array $vars ): array {
$vars[] = 'foo'; $vars[] = 'foo';

View File

@ -6,13 +6,13 @@ use eftec\bladeone\BladeOne;
/** /**
* Boilerplate Plugin v2 * Boilerplate Plugin v2
* *
* @package BoilerplatePluginv2 * @package BoilerplatePlugin
* @author Plugin Author * @author Plugin Author
* @copyright GPLv3 * @copyright GPLv3
* @license https://www.gnu.org/licenses/gpl-3.0.en.html * @license https://www.gnu.org/licenses/gpl-3.0.en.html
* *
* @wordpress-plugin * @wordpress-plugin
* Plugin Name: Boilerplate Plugin v2 * Plugin Name: Boilerplate Plugin
* Description: Your plugin description. * Description: Your plugin description.
* License: GPLv3 * License: GPLv3
* License URI: https://www.gnu.org/licenses/gpl-3.0.en.html * License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
@ -20,7 +20,7 @@ use eftec\bladeone\BladeOne;
* Update URI: https://example.com/my-plugin/ * Update URI: https://example.com/my-plugin/
* Version: 1.0.0 * Version: 1.0.0
* Requires at least: 5.2 * Requires at least: 5.2
* Requires PHP: 8.0.2 * Requires PHP: 8.1
* Author: Plugin Author * Author: Plugin Author
* Author URI: https://plugin-author.com * Author URI: https://plugin-author.com
* Text Domain: nmsp-plugin-name-text-domain * Text Domain: nmsp-plugin-name-text-domain
@ -65,4 +65,4 @@ $blade = new BladeOne( __DIR__ . '/templates', __DIR__ . '/cache/blade' );
register_activation_hook( __FILE__, array( App::class, 'plugin_activation' ) ); register_activation_hook( __FILE__, array( App::class, 'plugin_activation' ) );
register_deactivation_hook( __FILE__, array( App::class, 'plugin_deactivation' ) ); register_deactivation_hook( __FILE__, array( App::class, 'plugin_deactivation' ) );
App::get_instance()->load_blade( $blade ); nmsp_plugin_app()->load_blade( $blade );

View File

@ -1,5 +1,8 @@
parameters: parameters:
level: 6 level: 6
bootstrapFiles:
- bootstrap.php
- nmsp-plugin-name.php
paths: paths:
- admin - admin
- constants - constants