Compare commits

...

15 Commits

14 changed files with 16855 additions and 15434 deletions

10
.gitignore vendored
View File

@ -6,8 +6,8 @@ phpunit.xml
.phpunit.result.cache
# Directories
/vendor/
node_modules/
/vendor
/node_modules
cache/
### Editor Specific
@ -16,13 +16,17 @@ cache/
/*.sublime-workspace
# Directories
/.fleet
/.idea
/.vscode
### System Specific
# Files
.*.sw?
._*
.DS_Store
.DS_Store?
Thumbs.db
# Directories
__MACOSX
__MACOSX/

View File

@ -1,5 +1,8 @@
(function($) {
console.log('Your plugin just got loaded on the admin page!');
console.log('This is what you get as jQuery:', $);
console.log('Here is what you set for nmspPluginAdminApi:', window.nmspPluginAdminApi);
}(window.jQuery));
(() => {
// resources/admin/js/nmsp-plugin-name-admin.js
(function($) {
console.log("Your plugin just got loaded on the admin page!");
console.log("This is what you get as jQuery:", $);
console.log("Here is what you set for nmspPluginAdminApi:", window.nmspPluginAdminApi);
})(window.jQuery);
})();

View File

@ -1,5 +1,8 @@
(function($) {
console.log('Your plugin just got loaded!');
console.log('This is what you get as jQuery:', $);
console.log('Here is what you set for nmspPluginApi:', window.nmspPluginApi);
}(window.jQuery));
(() => {
// resources/front/js/nmsp-plugin-name.js
(function($) {
console.log("Your plugin just got loaded!");
console.log("This is what you get as jQuery:", $);
console.log("Here is what you set for nmspPluginApi:", window.nmspPluginApi);
})(window.jQuery);
})();

View File

@ -1,7 +1,7 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
exit;
}
/**

View File

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

760
composer.lock generated
View File

@ -4,35 +4,36 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "5612e2dbb336863b2ff9b5006ccbd7b2",
"content-hash": "0b26c4e20271547455a448cb02bf6c48",
"packages": [
{
"name": "eftec/bladeone",
"version": "3.52",
"version": "4.9",
"source": {
"type": "git",
"url": "https://github.com/EFTEC/BladeOne.git",
"reference": "a19bf66917de0b29836983db87a455a4f6e32148"
"reference": "019036c226086fbe7591360d260067c5d82400ca"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/EFTEC/BladeOne/zipball/a19bf66917de0b29836983db87a455a4f6e32148",
"reference": "a19bf66917de0b29836983db87a455a4f6e32148",
"url": "https://api.github.com/repos/EFTEC/BladeOne/zipball/019036c226086fbe7591360d260067c5d82400ca",
"reference": "019036c226086fbe7591360d260067c5d82400ca",
"shasum": ""
},
"require": {
"ext-json": "*",
"php": ">=5.6"
"php": ">=7.2.5"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.16.1",
"phpunit/phpunit": "^5.7",
"squizlabs/php_codesniffer": "^3.5.4"
"phpunit/phpunit": "^8.5.23"
},
"suggest": {
"eftec/bladeonehtml": "Extension to create forms",
"ext-mbstring": "This extension is used if it's active"
},
"bin": [
"lib/bladeonecli"
],
"type": "library",
"autoload": {
"psr-4": {
@ -60,267 +61,12 @@
],
"support": {
"issues": "https://github.com/EFTEC/BladeOne/issues",
"source": "https://github.com/EFTEC/BladeOne/tree/3.52"
"source": "https://github.com/EFTEC/BladeOne/tree/4.9"
},
"time": "2021-04-17T13:49:01+00:00"
"time": "2023-05-01T12:48:42+00:00"
}
],
"packages-dev": [
{
"name": "gettext/gettext",
"version": "v4.8.7",
"source": {
"type": "git",
"url": "https://github.com/php-gettext/Gettext.git",
"reference": "3f7bc5ef23302a9059e64934f3d59e454516bec0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-gettext/Gettext/zipball/3f7bc5ef23302a9059e64934f3d59e454516bec0",
"reference": "3f7bc5ef23302a9059e64934f3d59e454516bec0",
"shasum": ""
},
"require": {
"gettext/languages": "^2.3",
"php": ">=5.4.0"
},
"require-dev": {
"illuminate/view": "^5.0.x-dev",
"phpunit/phpunit": "^4.8|^5.7|^6.5",
"squizlabs/php_codesniffer": "^3.0",
"symfony/yaml": "~2",
"twig/extensions": "*",
"twig/twig": "^1.31|^2.0"
},
"suggest": {
"illuminate/view": "Is necessary if you want to use the Blade extractor",
"symfony/yaml": "Is necessary if you want to use the Yaml extractor/generator",
"twig/extensions": "Is necessary if you want to use the Twig extractor",
"twig/twig": "Is necessary if you want to use the Twig extractor"
},
"type": "library",
"autoload": {
"psr-4": {
"Gettext\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Oscar Otero",
"email": "oom@oscarotero.com",
"homepage": "http://oscarotero.com",
"role": "Developer"
}
],
"description": "PHP gettext manager",
"homepage": "https://github.com/oscarotero/Gettext",
"keywords": [
"JS",
"gettext",
"i18n",
"mo",
"po",
"translation"
],
"support": {
"email": "oom@oscarotero.com",
"issues": "https://github.com/oscarotero/Gettext/issues",
"source": "https://github.com/php-gettext/Gettext/tree/v4.8.7"
},
"funding": [
{
"url": "https://paypal.me/oscarotero",
"type": "custom"
},
{
"url": "https://github.com/oscarotero",
"type": "github"
},
{
"url": "https://www.patreon.com/misteroom",
"type": "patreon"
}
],
"time": "2022-08-02T09:42:10+00:00"
},
{
"name": "gettext/languages",
"version": "2.9.0",
"source": {
"type": "git",
"url": "https://github.com/php-gettext/Languages.git",
"reference": "ed56dd2c7f4024cc953ed180d25f02f2640e3ffa"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-gettext/Languages/zipball/ed56dd2c7f4024cc953ed180d25f02f2640e3ffa",
"reference": "ed56dd2c7f4024cc953ed180d25f02f2640e3ffa",
"shasum": ""
},
"require": {
"php": ">=5.3"
},
"require-dev": {
"phpunit/phpunit": "^4.8 || ^5.7 || ^6.5 || ^7.5 || ^8.4"
},
"bin": [
"bin/export-plural-rules"
],
"type": "library",
"autoload": {
"psr-4": {
"Gettext\\Languages\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Michele Locati",
"email": "mlocati@gmail.com",
"role": "Developer"
}
],
"description": "gettext languages with plural rules",
"homepage": "https://github.com/php-gettext/Languages",
"keywords": [
"cldr",
"i18n",
"internationalization",
"l10n",
"language",
"languages",
"localization",
"php",
"plural",
"plural rules",
"plurals",
"translate",
"translations",
"unicode"
],
"support": {
"issues": "https://github.com/php-gettext/Languages/issues",
"source": "https://github.com/php-gettext/Languages/tree/2.9.0"
},
"funding": [
{
"url": "https://paypal.me/mlocati",
"type": "custom"
},
{
"url": "https://github.com/mlocati",
"type": "github"
}
],
"time": "2021-11-11T17:30:39+00:00"
},
{
"name": "mck89/peast",
"version": "v1.15.0",
"source": {
"type": "git",
"url": "https://github.com/mck89/peast.git",
"reference": "733cd8f62dcb8239094688063a92766bbfcbf523"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/mck89/peast/zipball/733cd8f62dcb8239094688063a92766bbfcbf523",
"reference": "733cd8f62dcb8239094688063a92766bbfcbf523",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
"php": ">=5.4.0"
},
"require-dev": {
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.15.0-dev"
}
},
"autoload": {
"psr-4": {
"Peast\\": "lib/Peast/",
"Peast\\test\\": "test/Peast/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Marco Marchiò",
"email": "marco.mm89@gmail.com"
}
],
"description": "Peast is PHP library that generates AST for JavaScript code",
"support": {
"issues": "https://github.com/mck89/peast/issues",
"source": "https://github.com/mck89/peast/tree/v1.15.0"
},
"time": "2022-09-13T15:56:53+00:00"
},
{
"name": "mustache/mustache",
"version": "v2.14.2",
"source": {
"type": "git",
"url": "https://github.com/bobthecow/mustache.php.git",
"reference": "e62b7c3849d22ec55f3ec425507bf7968193a6cb"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/bobthecow/mustache.php/zipball/e62b7c3849d22ec55f3ec425507bf7968193a6cb",
"reference": "e62b7c3849d22ec55f3ec425507bf7968193a6cb",
"shasum": ""
},
"require": {
"php": ">=5.2.4"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "~1.11",
"phpunit/phpunit": "~3.7|~4.0|~5.0"
},
"type": "library",
"autoload": {
"psr-0": {
"Mustache": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Justin Hileman",
"email": "justin@justinhileman.info",
"homepage": "http://justinhileman.com"
}
],
"description": "A Mustache implementation in PHP.",
"homepage": "https://github.com/bobthecow/mustache.php",
"keywords": [
"mustache",
"templating"
],
"support": {
"issues": "https://github.com/bobthecow/mustache.php/issues",
"source": "https://github.com/bobthecow/mustache.php/tree/v2.14.2"
},
"time": "2022-08-23T13:07:01+00:00"
},
{
"name": "php-parallel-lint/php-parallel-lint",
"version": "v1.3.2",
@ -380,27 +126,25 @@
},
{
"name": "php-stubs/wordpress-stubs",
"version": "v6.0.2",
"version": "v6.2.1",
"source": {
"type": "git",
"url": "https://github.com/php-stubs/wordpress-stubs.git",
"reference": "8f696e429e375ef40a841ecf5ac686ff7437b4dc"
"reference": "0009429e639b748eef1c955200ea0d4e5ad5627d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/8f696e429e375ef40a841ecf5ac686ff7437b4dc",
"reference": "8f696e429e375ef40a841ecf5ac686ff7437b4dc",
"url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/0009429e639b748eef1c955200ea0d4e5ad5627d",
"reference": "0009429e639b748eef1c955200ea0d4e5ad5627d",
"shasum": ""
},
"replace": {
"giacocorsiglia/wordpress-stubs": "*"
},
"require-dev": {
"nikic/php-parser": "< 4.12.0",
"php": "~7.3 || ~8.0",
"php-stubs/generator": "^0.8.1",
"php-stubs/generator": "^0.8.3",
"phpdocumentor/reflection-docblock": "^5.3",
"phpstan/phpstan": "^1.2"
"phpstan/phpstan": "^1.10.12",
"phpunit/phpunit": "^9.5"
},
"suggest": {
"paragonie/sodium_compat": "Pure PHP implementation of libsodium",
@ -421,34 +165,33 @@
],
"support": {
"issues": "https://github.com/php-stubs/wordpress-stubs/issues",
"source": "https://github.com/php-stubs/wordpress-stubs/tree/v6.0.2"
"source": "https://github.com/php-stubs/wordpress-stubs/tree/v6.2.1"
},
"time": "2022-09-30T17:24:55+00:00"
"time": "2023-05-18T04:35:23+00:00"
},
{
"name": "phpstan/extension-installer",
"version": "1.1.0",
"version": "1.3.1",
"source": {
"type": "git",
"url": "https://github.com/phpstan/extension-installer.git",
"reference": "66c7adc9dfa38b6b5838a9fb728b68a7d8348051"
"reference": "f45734bfb9984c6c56c4486b71230355f066a58a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/extension-installer/zipball/66c7adc9dfa38b6b5838a9fb728b68a7d8348051",
"reference": "66c7adc9dfa38b6b5838a9fb728b68a7d8348051",
"url": "https://api.github.com/repos/phpstan/extension-installer/zipball/f45734bfb9984c6c56c4486b71230355f066a58a",
"reference": "f45734bfb9984c6c56c4486b71230355f066a58a",
"shasum": ""
},
"require": {
"composer-plugin-api": "^1.1 || ^2.0",
"php": "^7.1 || ^8.0",
"phpstan/phpstan": ">=0.11.6"
"composer-plugin-api": "^2.0",
"php": "^7.2 || ^8.0",
"phpstan/phpstan": "^1.9.0"
},
"require-dev": {
"composer/composer": "^1.8",
"phing/phing": "^2.16.3",
"composer/composer": "^2.0",
"php-parallel-lint/php-parallel-lint": "^1.2.0",
"phpstan/phpstan-strict-rules": "^0.11 || ^0.12"
"phpstan/phpstan-strict-rules": "^0.11 || ^0.12 || ^1.0"
},
"type": "composer-plugin",
"extra": {
@ -466,22 +209,22 @@
"description": "Composer plugin for automatic installation of PHPStan extensions",
"support": {
"issues": "https://github.com/phpstan/extension-installer/issues",
"source": "https://github.com/phpstan/extension-installer/tree/1.1.0"
"source": "https://github.com/phpstan/extension-installer/tree/1.3.1"
},
"time": "2020-12-13T13:06:13+00:00"
"time": "2023-05-24T08:59:17+00:00"
},
{
"name": "phpstan/phpstan",
"version": "1.8.6",
"version": "1.10.26",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan.git",
"reference": "c386ab2741e64cc9e21729f891b28b2b10fe6618"
"reference": "5d660cbb7e1b89253a47147ae44044f49832351f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/c386ab2741e64cc9e21729f891b28b2b10fe6618",
"reference": "c386ab2741e64cc9e21729f891b28b2b10fe6618",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/5d660cbb7e1b89253a47147ae44044f49832351f",
"reference": "5d660cbb7e1b89253a47147ae44044f49832351f",
"shasum": ""
},
"require": {
@ -510,8 +253,11 @@
"static analysis"
],
"support": {
"docs": "https://phpstan.org/user-guide/getting-started",
"forum": "https://github.com/phpstan/phpstan/discussions",
"issues": "https://github.com/phpstan/phpstan/issues",
"source": "https://github.com/phpstan/phpstan/tree/1.8.6"
"security": "https://github.com/phpstan/phpstan/security/policy",
"source": "https://github.com/phpstan/phpstan-src"
},
"funding": [
{
@ -527,80 +273,20 @@
"type": "tidelift"
}
],
"time": "2022-09-23T09:54:39+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"
"time": "2023-07-19T12:44:37+00:00"
},
{
"name": "squizlabs/php_codesniffer",
"version": "3.7.1",
"version": "3.7.2",
"source": {
"type": "git",
"url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
"reference": "1359e176e9307e906dc3d890bcc9603ff6d90619"
"reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/1359e176e9307e906dc3d890bcc9603ff6d90619",
"reference": "1359e176e9307e906dc3d890bcc9603ff6d90619",
"url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ed8e00df0a83aa96acf703f8c2979ff33341f879",
"reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879",
"shasum": ""
},
"require": {
@ -636,88 +322,28 @@
"homepage": "https://github.com/squizlabs/PHP_CodeSniffer",
"keywords": [
"phpcs",
"standards"
"standards",
"static analysis"
],
"support": {
"issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues",
"source": "https://github.com/squizlabs/PHP_CodeSniffer",
"wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki"
},
"time": "2022-06-18T07:21:10+00:00"
},
{
"name": "symfony/finder",
"version": "v6.0.11",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
"reference": "09cb683ba5720385ea6966e5e06be2a34f2568b1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/finder/zipball/09cb683ba5720385ea6966e5e06be2a34f2568b1",
"reference": "09cb683ba5720385ea6966e5e06be2a34f2568b1",
"shasum": ""
},
"require": {
"php": ">=8.0.2"
},
"type": "library",
"autoload": {
"psr-4": {
"Symfony\\Component\\Finder\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Finds files and directories via an intuitive fluent interface",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/finder/tree/v6.0.11"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2022-07-29T07:39:48+00:00"
"time": "2023-02-22T23:07:41+00:00"
},
{
"name": "symfony/polyfill-php73",
"version": "v1.26.0",
"version": "v1.27.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php73.git",
"reference": "e440d35fa0286f77fb45b79a03fedbeda9307e85"
"reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/e440d35fa0286f77fb45b79a03fedbeda9307e85",
"reference": "e440d35fa0286f77fb45b79a03fedbeda9307e85",
"url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/9e8ecb5f92152187c4799efd3c96b78ccab18ff9",
"reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9",
"shasum": ""
},
"require": {
@ -726,7 +352,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "1.26-dev"
"dev-main": "1.27-dev"
},
"thanks": {
"name": "symfony/polyfill",
@ -767,7 +393,7 @@
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-php73/tree/v1.26.0"
"source": "https://github.com/symfony/polyfill-php73/tree/v1.27.0"
},
"funding": [
{
@ -783,35 +409,35 @@
"type": "tidelift"
}
],
"time": "2022-05-24T11:49:31+00:00"
"time": "2022-11-03T14:55:06+00:00"
},
{
"name": "szepeviktor/phpstan-wordpress",
"version": "v1.1.3",
"version": "v1.3.0",
"source": {
"type": "git",
"url": "https://github.com/szepeviktor/phpstan-wordpress.git",
"reference": "e644df734e1bbe95810e0f617d17df091048a94e"
"reference": "5b5cc77ed51fdaf64efe3f00b5aae4b709d2cfa9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/szepeviktor/phpstan-wordpress/zipball/e644df734e1bbe95810e0f617d17df091048a94e",
"reference": "e644df734e1bbe95810e0f617d17df091048a94e",
"url": "https://api.github.com/repos/szepeviktor/phpstan-wordpress/zipball/5b5cc77ed51fdaf64efe3f00b5aae4b709d2cfa9",
"reference": "5b5cc77ed51fdaf64efe3f00b5aae4b709d2cfa9",
"shasum": ""
},
"require": {
"php": "^7.2 || ^8.0",
"php-stubs/wordpress-stubs": "^4.7 || ^5.0 || ^6.0",
"phpstan/phpstan": "^1.6",
"phpstan/phpstan": "^1.10.0",
"symfony/polyfill-php73": "^1.12.0"
},
"require-dev": {
"composer/composer": "^2.1.14",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7",
"dealerdirect/phpcodesniffer-composer-installer": "^1.0",
"php-parallel-lint/php-parallel-lint": "^1.1",
"phpstan/phpstan-strict-rules": "^1.2",
"phpunit/phpunit": "^8 || ^9",
"szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset": "^0.6"
"phpunit/phpunit": "^8.0 || ^9.0",
"szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset": "^0.8"
},
"type": "phpstan-extension",
"extra": {
@ -840,263 +466,9 @@
],
"support": {
"issues": "https://github.com/szepeviktor/phpstan-wordpress/issues",
"source": "https://github.com/szepeviktor/phpstan-wordpress/tree/v1.1.3"
"source": "https://github.com/szepeviktor/phpstan-wordpress/tree/v1.3.0"
},
"funding": [
{
"url": "https://www.paypal.me/szepeviktor",
"type": "custom"
},
{
"url": "https://github.com/szepeviktor",
"type": "github"
}
],
"time": "2022-09-22T13:14:50+00:00"
},
{
"name": "wp-cli/i18n-command",
"version": "v2.4.0",
"source": {
"type": "git",
"url": "https://github.com/wp-cli/i18n-command.git",
"reference": "45bc2b47a4ed103b871cd2ec5b483ab55ad12d99"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/wp-cli/i18n-command/zipball/45bc2b47a4ed103b871cd2ec5b483ab55ad12d99",
"reference": "45bc2b47a4ed103b871cd2ec5b483ab55ad12d99",
"shasum": ""
},
"require": {
"eftec/bladeone": "3.52",
"gettext/gettext": "^4.8",
"mck89/peast": "^1.13.11",
"wp-cli/wp-cli": "^2.5"
},
"require-dev": {
"wp-cli/scaffold-command": "^1.2 || ^2",
"wp-cli/wp-cli-tests": "^3.1"
},
"suggest": {
"ext-json": "Used for reading and generating JSON translation files",
"ext-mbstring": "Used for calculating include/exclude matches in code extraction"
},
"type": "wp-cli-package",
"extra": {
"branch-alias": {
"dev-main": "2.x-dev"
},
"bundled": true,
"commands": [
"i18n",
"i18n make-pot",
"i18n make-json",
"i18n make-mo",
"i18n update-po"
]
},
"autoload": {
"files": [
"i18n-command.php"
],
"psr-4": {
"WP_CLI\\I18n\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Pascal Birchler",
"homepage": "https://pascalbirchler.com/"
}
],
"description": "Provides internationalization tools for WordPress projects.",
"homepage": "https://github.com/wp-cli/i18n-command",
"support": {
"issues": "https://github.com/wp-cli/i18n-command/issues",
"source": "https://github.com/wp-cli/i18n-command/tree/v2.4.0"
},
"time": "2022-07-04T21:43:20+00:00"
},
{
"name": "wp-cli/mustangostang-spyc",
"version": "0.6.3",
"source": {
"type": "git",
"url": "https://github.com/wp-cli/spyc.git",
"reference": "6aa0b4da69ce9e9a2c8402dab8d43cf32c581cc7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/wp-cli/spyc/zipball/6aa0b4da69ce9e9a2c8402dab8d43cf32c581cc7",
"reference": "6aa0b4da69ce9e9a2c8402dab8d43cf32c581cc7",
"shasum": ""
},
"require": {
"php": ">=5.3.1"
},
"require-dev": {
"phpunit/phpunit": "4.3.*@dev"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "0.5.x-dev"
}
},
"autoload": {
"files": [
"includes/functions.php"
],
"psr-4": {
"Mustangostang\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "mustangostang",
"email": "vlad.andersen@gmail.com"
}
],
"description": "A simple YAML loader/dumper class for PHP (WP-CLI fork)",
"homepage": "https://github.com/mustangostang/spyc/",
"support": {
"source": "https://github.com/wp-cli/spyc/tree/autoload"
},
"time": "2017-04-25T11:26:20+00:00"
},
{
"name": "wp-cli/php-cli-tools",
"version": "v0.11.15",
"source": {
"type": "git",
"url": "https://github.com/wp-cli/php-cli-tools.git",
"reference": "b6edd35988892ea1451392eb7a26d9dbe98c836d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/wp-cli/php-cli-tools/zipball/b6edd35988892ea1451392eb7a26d9dbe98c836d",
"reference": "b6edd35988892ea1451392eb7a26d9dbe98c836d",
"shasum": ""
},
"require": {
"php": ">= 5.3.0"
},
"type": "library",
"autoload": {
"files": [
"lib/cli/cli.php"
],
"psr-0": {
"cli": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Daniel Bachhuber",
"email": "daniel@handbuilt.co",
"role": "Maintainer"
},
{
"name": "James Logsdon",
"email": "jlogsdon@php.net",
"role": "Developer"
}
],
"description": "Console utilities for PHP",
"homepage": "http://github.com/wp-cli/php-cli-tools",
"keywords": [
"cli",
"console"
],
"support": {
"issues": "https://github.com/wp-cli/php-cli-tools/issues",
"source": "https://github.com/wp-cli/php-cli-tools/tree/v0.11.15"
},
"time": "2022-08-15T10:15:55+00:00"
},
{
"name": "wp-cli/wp-cli",
"version": "v2.6.0",
"source": {
"type": "git",
"url": "https://github.com/wp-cli/wp-cli.git",
"reference": "dee13c2baf6bf972484a63f8b8dab48f7220f095"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/wp-cli/wp-cli/zipball/dee13c2baf6bf972484a63f8b8dab48f7220f095",
"reference": "dee13c2baf6bf972484a63f8b8dab48f7220f095",
"shasum": ""
},
"require": {
"ext-curl": "*",
"mustache/mustache": "^2.14.1",
"php": "^5.6 || ^7.0 || ^8.0",
"rmccue/requests": "^1.8",
"symfony/finder": ">2.7",
"wp-cli/mustangostang-spyc": "^0.6.3",
"wp-cli/php-cli-tools": "~0.11.2"
},
"require-dev": {
"roave/security-advisories": "dev-latest",
"wp-cli/db-command": "^1.3 || ^2",
"wp-cli/entity-command": "^1.2 || ^2",
"wp-cli/extension-command": "^1.1 || ^2",
"wp-cli/package-command": "^1 || ^2",
"wp-cli/wp-cli-tests": "^3.1.3"
},
"suggest": {
"ext-readline": "Include for a better --prompt implementation",
"ext-zip": "Needed to support extraction of ZIP archives when doing downloads or updates"
},
"bin": [
"bin/wp",
"bin/wp.bat"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.6.x-dev"
}
},
"autoload": {
"psr-0": {
"WP_CLI\\": "php/"
},
"classmap": [
"php/class-wp-cli.php",
"php/class-wp-cli-command.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "WP-CLI framework",
"homepage": "https://wp-cli.org",
"keywords": [
"cli",
"wordpress"
],
"support": {
"docs": "https://make.wordpress.org/cli/handbook/",
"issues": "https://github.com/wp-cli/wp-cli/issues",
"source": "https://github.com/wp-cli/wp-cli"
},
"time": "2022-01-25T16:31:27+00:00"
"time": "2023-04-23T06:15:06+00:00"
},
{
"name": "wp-coding-standards/wpcs",
@ -1156,7 +528,7 @@
"prefer-stable": true,
"prefer-lowest": false,
"platform": {
"php": "^8.0.2"
"php": "~8.1"
},
"platform-dev": [],
"plugin-api-version": "2.3.0"

View File

@ -20,6 +20,7 @@ class App {
/**
* Any logic that needs executed when the plugin is activated.
*
* @package PluginNamespace\App
* @since 1.0.0
*
* @return void
@ -37,18 +38,21 @@ class App {
/**
* Any logic that needs executed when the plugin is deactivated.
*
* @package PluginNamespace\App
* @since 1.0.0
*
* @return void
*/
public static function plugin_deactivation(): void {
//
// phpcs:disable
// phpcs:enable
}
/**
* Check that the cache directory for Blade exists and
* if not then attempt to create it.
*
* @package PluginNamespace\App
* @since 1.0.0
*
* @throws \Exception
@ -59,13 +63,13 @@ class App {
if ( ! file_exists( NMSP_PLUGIN_BASE_DIR . '/cache/blade/.gitignore' ) ) {
try {
mkdir( NMSP_PLUGIN_BASE_DIR . '/cache/blade', 0755, true );
} catch ( Exception $e ) {
} catch ( Exception $exp ) {
$error_payload = array(
'level' => 'critical',
'message' => $e->getMessage(),
'message' => $exp->getMessage(),
'context' => array(
'file' => $e->getFile(),
'line' => $e->getLine(),
'file' => $exp->getFile(),
'line' => $exp->getLine(),
),
);
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
* not been initialized, do so then return it.
*
* @package PluginNamespace\App
* @since 1.0.0
*
* @return \PluginNamespace\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->load_plugin_textdomain();
@ -96,6 +101,7 @@ class App {
/**
* Load your translation files for this plugin.
*
* @package PluginNamespace\App
* @since 1.0.0
*
* @return void
@ -107,16 +113,21 @@ class App {
/**
* Steps to take when initializing this plugin??
*
* @package PluginNamespace\App
* @since 1.0.0
*
* @return void
*/
public function scaffold_plugin(): void {
// phpcs:disable
if ( is_admin() ) {
// admin only logic here
// admin only logic here, remove phpcs calls around this
}
// phpcs:enable
// other logic here
add_filter( 'network_admin_plugin_action_links_nmsp-plugin-name/nmsp-plugin-name.php', array( $this, 'filter_plugin_action_links' ) );
add_filter( 'plugin_action_links_nmsp-plugin-name/nmsp-plugin-name.php', array( $this, 'filter_plugin_action_links' ) );
}
/**
@ -126,6 +137,7 @@ class App {
*
* @codeCoverageIgnore
*
* @package PluginNamespace\App
* @since 1.0.0
*
* @return void
@ -145,9 +157,30 @@ class App {
require_once __DIR__ . '/front/class-custompage.php';
}
/**
* Description.
*
* @package PluginNamespace\App
* @since 1.0.0
*
* @param array<string, string> $actions
*
* @return array<string, string>
*/
public function filter_plugin_action_links( array $actions = array() ): array {
$plugin_settings_url = admin_url( 'admin.php?page=nmsp-plugin-name-menu-slug' );
return array_merge(
array(
'settings' => '<a href="' . $plugin_settings_url . '">' . esc_html__( 'Settings', 'nmsp-plugin-name-text-domain' ) . '</a>',
),
$actions
);
}
/**
* Load BladeOne as the templating engine for the plugin.
*
* @package PluginNamespace\App
* @since 1.0.0
*
* @param \eftec\bladeone\BladeOne $blade

View File

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

View File

@ -11,6 +11,7 @@ class CustomPage {
/**
* Class constructor.
*
* @package PluginNamespace\Front\CustomPage
* @since 1.0.0
*
* @return void
@ -22,6 +23,7 @@ class CustomPage {
/**
* Register and enqueue stylesheets and javascript files.
*
* @package PluginNamespace\Front\CustomPage
* @since 1.0.0
*
* @return void
@ -42,14 +44,15 @@ class CustomPage {
/**
* Display a page in place of a shortcode.
*
* @package PluginNamespace\Front\CustomPage
* @since 1.0.0
*
* @param array $attributes Array of attributes on the shortcode string in the post body.
* @param string $content (optional) Text content that is between opening and closing shortcodes.
* @param array<string, string> $attributes Array of attributes on the shortcode string in the post body.
* @param string|null $content (optional) Text content that is between opening and closing shortcodes.
*
* @return string
*/
public function display_custom_page( array $attributes = array(), $content = null ) {
public function display_custom_page( array $attributes = array(), ?string $content = null ): string {
$data = array(
'shortcode' => array(
'attributes' => $attributes,
@ -58,7 +61,9 @@ class CustomPage {
);
ob_start();
// phpcs:disable
echo nmsp_plugin_app()->blade->run( 'front.custom-page', $data );
// phpcs:enable
$output = ob_get_clean();
return wp_kses_post( $output );
}

View File

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

View File

@ -6,13 +6,13 @@ use eftec\bladeone\BladeOne;
/**
* Boilerplate Plugin v2
*
* @package BoilerplatePluginv2
* @package BoilerplatePlugin
* @author Plugin Author
* @copyright GPLv3
* @license https://www.gnu.org/licenses/gpl-3.0.en.html
*
* @wordpress-plugin
* Plugin Name: Boilerplate Plugin v2
* Plugin Name: Boilerplate Plugin
* Description: Your plugin description.
* License: GPLv3
* 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/
* Version: 1.0.0
* Requires at least: 5.2
* Requires PHP: 8.0.2
* Requires PHP: 8.1
* Author: Plugin Author
* Author URI: https://plugin-author.com
* 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_deactivation_hook( __FILE__, array( App::class, 'plugin_deactivation' ) );
App::get_instance()->load_blade( $blade );
nmsp_plugin_app()->load_blade( $blade );

31376
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -13,26 +13,31 @@
"url": "https://github.com/namespace/plugin-name/issues"
},
"scripts": {
"watch": "node-sass resources/front/sass/nmsp-plugin-name.scss -o ./assets/css/ --source-map true --output-style expanded --indent-type tab --indent-width 1 -w",
"watch:css": "node-sass resources/front/sass/nmsp-plugin-name.scss -o ./assets/css/ --source-map true --output-style expanded --indent-type tab --indent-width 1 -w",
"watch:css-admin": "node-sass resources/admin/sass/nmsp-plugin-name-admin.scss -o ./assets/css/ --source-map true --output-style expanded --indent-type tab --indent-width 1 -w",
"watch:js": "esbuild --format=iife resources/front/js/nmsp-plugin-name.js --outfile=assets/js/nmsp-plugin-name.js --bundle --watch",
"watch:js-admin": "esbuild --format=iife resources/admin/js/nmsp-plugin-name-admin.js --outfile=assets/js/nmsp-plugin-name-admin.js --bundle --watch",
"watch-admin": "node-sass resources/admin/sass/nmsp-plugin-name-admin.scss -o ./assets/css/ --source-map true --output-style expanded --indent-type tab --indent-width 1 -w",
"watch": "concurrently --kill-others \"npm run watch:css\" \"npm run watch:css-admin\" \"npm run watch:js\" \"npm run watch:js-admin\"",
"compile:css": "node-sass resources/front/sass/nmsp-plugin-name.scss -o ./assets/css/ && stylelint 'assets/css/nmsp-plugin-name.css' --fix || true && stylelint 'assets/css/nmsp-plugin-name.css' --fix",
"compile:css-admin": "node-sass resources/admin/sass/nmsp-plugin-name-admin.scss -o ./assets/css/ && stylelint 'assets/css/nmsp-plugin-name-admin.css' --fix || true && stylelint 'assets/css/nmsp-plugin-name-admin.css' --fix",
"compile:rtl": "rtlcss assets/css/nmsp-plugin-name.css assets/css/nmsp-plugin-name-rtl.css && rtlcss assets/css/nmsp-plugin-name.css assets/css/nmsp-plugin-name-rtl.css",
"compile:rtl-admin": "rtlcss assets/css/nmsp-plugin-name-admin.css assets/css/nmsp-plugin-name-admin-rtl.css && rtlcss assets/css/nmsp-plugin-name-admin-admin.css assets/css/nmsp-plugin-name-admin-rtl.css",
"compile:js": "cp resources/front/js/nmsp-plugin-name.js assets/js/nmsp-plugin-name.js",
"compile:js-admin": "cp resources/admin/js/nmsp-plugin-name-admin.js assets/js/nmsp-plugin-name-admin.js",
"compile": "npm run compile:css && npm run compile:css-admin && npm run compile:rtl && npm run compile:rtl-admin && npm run compile:js && npm run compile:js-admin",
"compile": "concurrently --kill-others \"npm run compile:css\" \"npm run compile:css-admin\" \"npm run compile:rtl\" \"npm run compile:rtl-admin\" \"npm run compile:js\" \"npm run compile:js-admin\"",
"lint:js": "wp-scripts lint-js 'resources/**/js/*.js'",
"lint:scss": "wp-scripts lint-style 'resources/**/sass/**/*.scss'",
"bundle": "dir-archiver --src . --dest ../nmsp-plugin-name.zip --exclude .DS_Store .stylelintrc.json .eslintrc .git .gitattributes .github .gitignore README.md CHANGELOG.md composer.lock node_modules vendor package-lock.json package.json .travis.yml phpcs.xml.dist resources assets/css/nmsp-plugin-name.css.map assets/css/nmsp-plugin-name-admin.css.map"
},
"dependencies": {},
"devDependencies": {
"@wordpress/scripts": "^16.1.1",
"@wordpress/stylelint-config": "19.0.5",
"dir-archiver": "^1.2.0",
"node-sass": "^6.0.0",
"rtlcss": "^3.2.0"
"@wordpress/scripts": "^26.9.0",
"@wordpress/stylelint-config": "21.21.0",
"concurrently": "^8.2.0",
"dir-archiver": "^2.1.0",
"esbuild": "^0.18.17",
"node-sass": "^9.0.0",
"rtlcss": "^4.1.0"
},
"rtlcssConfig": {
"options": {

View File

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