diff --git a/.travis.yml b/.travis.yml index b4daf62..795bc7c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,6 +31,7 @@ before_install: - until curl --silent -XGET --fail http://localhost:9200; do printf '.'; sleep 1; done install: + - composer self-update 1.10.6 - composer config -g http-basic.my.yoast.com token $YOAST_TOKEN - composer install diff --git a/bin/install-tests b/bin/install-tests index 7ca7c87..200148f 100755 --- a/bin/install-tests +++ b/bin/install-tests @@ -6,6 +6,8 @@ source '.env.test'; version=latest +mysql -u $DB_USER -e "DROP DATABASE $DB_NAME;" + # when you are installing test suite for first time if you want to create the # database remove the last argument "true" -bin/install-wp-tests.sh "$DB_NAME" "$DB_USER" "$DB_PASSWORD" "$DB_HOST" "$version" "true" +bin/install-wp-tests.sh "$DB_NAME" "$DB_USER" "$DB_PASSWORD" "$DB_HOST" "$version" diff --git a/composer.json b/composer.json index ecdf631..9d51d09 100644 --- a/composer.json +++ b/composer.json @@ -41,7 +41,9 @@ "advanced-custom-fields/advanced-custom-fields-pro": "*", "flyntwp/acf-field-group-composer": "dev-flattenNestedFilters", "elasticsearch/elasticsearch": "^6.1", - "yoast/wordpress-seo-premium": "*" + "yoast/wordpress-seo-premium": "^15.5", + "jsq/amazon-es-php": "^0.3.0", + "aws/aws-sdk-php": "^3.161" }, "require-dev": { "phpunit/phpunit": "^7.5", @@ -50,12 +52,14 @@ "dealerdirect/phpcodesniffer-composer-installer": "^0.6", "wp-coding-standards/wpcs": "*", "vlucas/phpdotenv": "^2.2.0", - "oscarotero/env": "^1.1.0" + "oscarotero/env": "^1.1.0", + "yoast/phpunit-polyfills": "^1.0" }, "extra": { "installer-paths": { "vendor/mu-plugins/{$name}/": [ "type:wordpress-muplugin", + "aws/aws-sdk-php", "flyntwp/acf-field-group-composer", "advanced-custom-fields/advanced-custom-fields-pro", "elasticsearch/elasticsearch", diff --git a/composer.lock b/composer.lock index 420cbb8..14bb8fe 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "fba1bd0310bee7a195ede4ab044294f7", + "content-hash": "ae34f8ee667398c4e9a62d61ebf6c6da", "packages": [ { "name": "advanced-custom-fields/advanced-custom-fields-pro", @@ -19,18 +19,150 @@ }, "type": "wordpress-plugin" }, + { + "name": "aws/aws-crt-php", + "version": "v1.0.2", + "source": { + "type": "git", + "url": "https://github.com/awslabs/aws-crt-php.git", + "reference": "3942776a8c99209908ee0b287746263725685732" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/awslabs/aws-crt-php/zipball/3942776a8c99209908ee0b287746263725685732", + "reference": "3942776a8c99209908ee0b287746263725685732", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35|^5.4.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "AWS SDK Common Runtime Team", + "email": "aws-sdk-common-runtime@amazon.com" + } + ], + "description": "AWS Common Runtime for PHP", + "homepage": "http://aws.amazon.com/sdkforphp", + "keywords": [ + "amazon", + "aws", + "crt", + "sdk" + ], + "time": "2021-09-03T22:57:30+00:00" + }, + { + "name": "aws/aws-sdk-php", + "version": "3.195.0", + "source": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-php.git", + "reference": "e2ce251ca94661ee3d4b0b5e8cc67e964b2e5f8e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/e2ce251ca94661ee3d4b0b5e8cc67e964b2e5f8e", + "reference": "e2ce251ca94661ee3d4b0b5e8cc67e964b2e5f8e", + "shasum": "" + }, + "require": { + "aws/aws-crt-php": "^1.0.2", + "ext-json": "*", + "ext-pcre": "*", + "ext-simplexml": "*", + "guzzlehttp/guzzle": "^5.3.3|^6.2.1|^7.0", + "guzzlehttp/promises": "^1.4.0", + "guzzlehttp/psr7": "^1.7.0", + "mtdowling/jmespath.php": "^2.6", + "php": ">=5.5" + }, + "require-dev": { + "andrewsville/php-token-reflection": "^1.4", + "aws/aws-php-sns-message-validator": "~1.0", + "behat/behat": "~3.0", + "doctrine/cache": "~1.4", + "ext-dom": "*", + "ext-openssl": "*", + "ext-pcntl": "*", + "ext-sockets": "*", + "nette/neon": "^2.3", + "paragonie/random_compat": ">= 2", + "phpunit/phpunit": "^4.8.35|^5.4.3", + "psr/cache": "^1.0", + "psr/simple-cache": "^1.0", + "sebastian/comparator": "^1.2.3" + }, + "suggest": { + "aws/aws-php-sns-message-validator": "To validate incoming SNS notifications", + "doctrine/cache": "To use the DoctrineCacheAdapter", + "ext-curl": "To send requests using cURL", + "ext-openssl": "Allows working with CloudFront private distributions and verifying received SNS messages", + "ext-sockets": "To use client-side monitoring" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "psr-4": { + "Aws\\": "src/" + }, + "files": [ + "src/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Amazon Web Services", + "homepage": "http://aws.amazon.com" + } + ], + "description": "AWS SDK for PHP - Use Amazon Web Services in your PHP project", + "homepage": "http://aws.amazon.com/sdkforphp", + "keywords": [ + "amazon", + "aws", + "cloud", + "dynamodb", + "ec2", + "glacier", + "s3", + "sdk" + ], + "time": "2021-09-27T18:14:14+00:00" + }, { "name": "composer/installers", - "version": "v1.9.0", + "version": "v1.12.0", "source": { "type": "git", "url": "https://github.com/composer/installers.git", - "reference": "b93bcf0fa1fccb0b7d176b0967d969691cd74cca" + "reference": "d20a64ed3c94748397ff5973488761b22f6d3f19" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/installers/zipball/b93bcf0fa1fccb0b7d176b0967d969691cd74cca", - "reference": "b93bcf0fa1fccb0b7d176b0967d969691cd74cca", + "url": "https://api.github.com/repos/composer/installers/zipball/d20a64ed3c94748397ff5973488761b22f6d3f19", + "reference": "d20a64ed3c94748397ff5973488761b22f6d3f19", "shasum": "" }, "require": { @@ -41,17 +173,18 @@ "shama/baton": "*" }, "require-dev": { - "composer/composer": "1.6.* || 2.0.*@dev", - "composer/semver": "1.0.* || 2.0.*@dev", - "phpunit/phpunit": "^4.8.36", - "sebastian/comparator": "^1.2.4", + "composer/composer": "1.6.* || ^2.0", + "composer/semver": "^1 || ^3", + "phpstan/phpstan": "^0.12.55", + "phpstan/phpstan-phpunit": "^0.12.16", + "symfony/phpunit-bridge": "^4.2 || ^5", "symfony/process": "^2.3" }, "type": "composer-plugin", "extra": { "class": "Composer\\Installers\\Plugin", "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "1.x-dev" } }, "autoload": { @@ -89,6 +222,7 @@ "Porto", "RadPHP", "SMF", + "Starbug", "Thelia", "Whmcs", "WolfCMS", @@ -122,13 +256,16 @@ "majima", "mako", "mediawiki", + "miaoxing", "modulework", "modx", "moodle", "osclass", + "pantheon", "phpbb", "piwik", "ppi", + "processwire", "puppet", "pxcms", "reindex", @@ -138,13 +275,28 @@ "sydes", "sylius", "symfony", + "tastyigniter", "typo3", "wordpress", "yawik", "zend", "zikula" ], - "time": "2020-04-07T06:57:05+00:00" + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2021-09-13T08:19:44+00:00" }, { "name": "elasticsearch/elasticsearch", @@ -212,12 +364,12 @@ "source": { "type": "git", "url": "https://github.com/jGRUBBS/acf-field-group-composer.git", - "reference": "908d34676b95e8a86a560c4f98bf2dc99601c66f" + "reference": "997282e55fe99300bcaaa5a82b8d5f2479e21679" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/jGRUBBS/acf-field-group-composer/zipball/908d34676b95e8a86a560c4f98bf2dc99601c66f", - "reference": "908d34676b95e8a86a560c4f98bf2dc99601c66f", + "url": "https://api.github.com/repos/jGRUBBS/acf-field-group-composer/zipball/997282e55fe99300bcaaa5a82b8d5f2479e21679", + "reference": "997282e55fe99300bcaaa5a82b8d5f2479e21679", "shasum": "" }, "require": { @@ -229,6 +381,11 @@ "squizlabs/php_codesniffer": "~2.0" }, "type": "wordpress-plugin", + "autoload": { + "psr-4": { + "ACFComposer\\": "lib/ACFComposer" + } + }, "authors": [ { "name": "bleech", @@ -238,48 +395,41 @@ "support": { "source": "https://github.com/jGRUBBS/acf-field-group-composer/tree/flattenNestedFilters" }, - "time": "2019-02-06T20:42:04+00:00" + "time": "2020-09-10T10:58:50+00:00" }, { "name": "guzzlehttp/guzzle", - "version": "7.0.1", + "version": "6.5.5", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "2d9d3c186a6637a43193e66b097c50e4451eaab2" + "reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/2d9d3c186a6637a43193e66b097c50e4451eaab2", - "reference": "2d9d3c186a6637a43193e66b097c50e4451eaab2", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/9d4290de1cfd701f38099ef7e183b64b4b7b0c5e", + "reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e", "shasum": "" }, "require": { "ext-json": "*", "guzzlehttp/promises": "^1.0", "guzzlehttp/psr7": "^1.6.1", - "php": "^7.2.5", - "psr/http-client": "^1.0" - }, - "provide": { - "psr/http-client-implementation": "1.0" + "php": ">=5.5", + "symfony/polyfill-intl-idn": "^1.17.0" }, "require-dev": { - "ergebnis/composer-normalize": "^2.0", "ext-curl": "*", - "php-http/client-integration-tests": "dev-phpunit8", - "phpunit/phpunit": "^8.5.5", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", "psr/log": "^1.1" }, "suggest": { - "ext-curl": "Required for CURL handler support", - "ext-intl": "Required for Internationalized Domain Name (IDN) support", "psr/log": "Required for using the Log middleware" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "7.0-dev" + "dev-master": "6.5-dev" } }, "autoload": { @@ -299,11 +449,6 @@ "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com", - "homepage": "https://sagikazarmark.hu" } ], "description": "Guzzle is a PHP HTTP client library", @@ -314,32 +459,30 @@ "framework", "http", "http client", - "psr-18", - "psr-7", "rest", "web service" ], - "time": "2020-06-27T10:33:25+00:00" + "time": "2020-06-16T21:01:06+00:00" }, { "name": "guzzlehttp/promises", - "version": "v1.3.1", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" + "reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", - "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "url": "https://api.github.com/repos/guzzle/promises/zipball/8e7d04f1f6450fef59366c399cfad4b9383aa30d", + "reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d", "shasum": "" }, "require": { - "php": ">=5.5.0" + "php": ">=5.5" }, "require-dev": { - "phpunit/phpunit": "^4.0" + "symfony/phpunit-bridge": "^4.4 || ^5.1" }, "type": "library", "extra": { @@ -370,20 +513,20 @@ "keywords": [ "promise" ], - "time": "2016-12-20T10:07:11+00:00" + "time": "2021-03-07T09:25:29+00:00" }, { "name": "guzzlehttp/psr7", - "version": "1.6.1", + "version": "1.8.2", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "239400de7a173fe9901b9ac7c06497751f00727a" + "reference": "dc960a912984efb74d0a90222870c72c87f10c91" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/239400de7a173fe9901b9ac7c06497751f00727a", - "reference": "239400de7a173fe9901b9ac7c06497751f00727a", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/dc960a912984efb74d0a90222870c72c87f10c91", + "reference": "dc960a912984efb74d0a90222870c72c87f10c91", "shasum": "" }, "require": { @@ -396,15 +539,15 @@ }, "require-dev": { "ext-zlib": "*", - "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8" + "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10" }, "suggest": { - "zendframework/zend-httphandlerrunner": "Emit PSR-7 responses" + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.6-dev" + "dev-master": "1.7-dev" } }, "autoload": { @@ -441,7 +584,7 @@ "uri", "url" ], - "time": "2019-07-01T23:21:34+00:00" + "time": "2021-04-26T09:17:50+00:00" }, { "name": "guzzlehttp/ringphp", @@ -546,22 +689,69 @@ "abandoned": true, "time": "2014-10-12T19:18:40+00:00" }, + { + "name": "jsq/amazon-es-php", + "version": "0.3.0", + "source": { + "type": "git", + "url": "https://github.com/jeskew/amazon-es-php.git", + "reference": "6f1ae9044c25c69b9c706ecb0906b45574cae589" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/jeskew/amazon-es-php/zipball/6f1ae9044c25c69b9c706ecb0906b45574cae589", + "reference": "6f1ae9044c25c69b9c706ecb0906b45574cae589", + "shasum": "" + }, + "require": { + "aws/aws-sdk-php": "^3.0", + "elasticsearch/elasticsearch": "^2.1|^5.0|^6.0|^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35|^5.4.0|^6.0.0|^7.0.0|^8.0.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Aws\\ElasticsearchService\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Jonathan Eskew", + "email": "jonathan@jeskew.net" + } + ], + "description": "Support for using IAM authentication with the official Elasticsearch PHP client", + "keywords": [ + "aws", + "client", + "elasticsearch", + "iam", + "search" + ], + "time": "2019-07-20T01:13:04+00:00" + }, { "name": "league/oauth2-client", - "version": "2.5.0", + "version": "2.4.1", "source": { "type": "git", "url": "https://github.com/thephpleague/oauth2-client.git", - "reference": "d9f2a1e000dc14eb3c02e15d15759385ec7ff0fb" + "reference": "cc114abc622a53af969e8664722e84ca36257530" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/oauth2-client/zipball/d9f2a1e000dc14eb3c02e15d15759385ec7ff0fb", - "reference": "d9f2a1e000dc14eb3c02e15d15759385ec7ff0fb", + "url": "https://api.github.com/repos/thephpleague/oauth2-client/zipball/cc114abc622a53af969e8664722e84ca36257530", + "reference": "cc114abc622a53af969e8664722e84ca36257530", "shasum": "" }, "require": { - "guzzlehttp/guzzle": "^6.0 || ^7.0", + "guzzlehttp/guzzle": "^6.0", "paragonie/random_compat": "^1|^2|^9.99", "php": "^5.6|^7.0" }, @@ -611,24 +801,81 @@ "oauth2", "single sign on" ], - "time": "2020-07-18T17:54:32+00:00" + "time": "2018-11-22T18:33:57+00:00" + }, + { + "name": "mtdowling/jmespath.php", + "version": "2.6.1", + "source": { + "type": "git", + "url": "https://github.com/jmespath/jmespath.php.git", + "reference": "9b87907a81b87bc76d19a7fb2d61e61486ee9edb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/jmespath/jmespath.php/zipball/9b87907a81b87bc76d19a7fb2d61e61486ee9edb", + "reference": "9b87907a81b87bc76d19a7fb2d61e61486ee9edb", + "shasum": "" + }, + "require": { + "php": "^5.4 || ^7.0 || ^8.0", + "symfony/polyfill-mbstring": "^1.17" + }, + "require-dev": { + "composer/xdebug-handler": "^1.4 || ^2.0", + "phpunit/phpunit": "^4.8.36 || ^7.5.15" + }, + "bin": [ + "bin/jp.php" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6-dev" + } + }, + "autoload": { + "psr-4": { + "JmesPath\\": "src/" + }, + "files": [ + "src/JmesPath.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Declaratively specify how to extract elements from a JSON document", + "keywords": [ + "json", + "jsonpath" + ], + "time": "2021-06-14T00:11:39+00:00" }, { "name": "paragonie/random_compat", - "version": "v9.99.99", + "version": "v9.99.100", "source": { "type": "git", "url": "https://github.com/paragonie/random_compat.git", - "reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95" + "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/random_compat/zipball/84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95", - "reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/996434e5492cb4c3edcb9168db6fbb1359ef965a", + "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a", "shasum": "" }, "require": { - "php": "^7" + "php": ">= 7" }, "require-dev": { "phpunit/phpunit": "4.*|5.*", @@ -656,7 +903,7 @@ "pseudorandom", "random" ], - "time": "2018-07-02T15:55:56+00:00" + "time": "2020-10-15T08:29:30+00:00" }, { "name": "philippbaschke/acf-pro-installer", @@ -716,29 +963,29 @@ }, { "name": "pimple/pimple", - "version": "v3.3.0", + "version": "v3.4.0", "source": { "type": "git", "url": "https://github.com/silexphp/Pimple.git", - "reference": "e55d12f9d6a0e7f9c85992b73df1267f46279930" + "reference": "86406047271859ffc13424a048541f4531f53601" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/silexphp/Pimple/zipball/e55d12f9d6a0e7f9c85992b73df1267f46279930", - "reference": "e55d12f9d6a0e7f9c85992b73df1267f46279930", + "url": "https://api.github.com/repos/silexphp/Pimple/zipball/86406047271859ffc13424a048541f4531f53601", + "reference": "86406047271859ffc13424a048541f4531f53601", "shasum": "" }, "require": { - "php": "^7.2.5", - "psr/container": "^1.0" + "php": ">=7.2.5", + "psr/container": "^1.1" }, "require-dev": { - "symfony/phpunit-bridge": "^3.4|^4.4|^5.0" + "symfony/phpunit-bridge": "^5.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3.x-dev" + "dev-master": "3.4.x-dev" } }, "autoload": { @@ -762,31 +1009,26 @@ "container", "dependency injection" ], - "time": "2020-03-03T09:12:48+00:00" + "time": "2021-03-06T08:28:00+00:00" }, { "name": "psr/container", - "version": "1.0.0", + "version": "1.1.1", "source": { "type": "git", "url": "https://github.com/php-fig/container.git", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf", + "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=7.2.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, "autoload": { "psr-4": { "Psr\\Container\\": "src/" @@ -799,7 +1041,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common Container Interface (PHP FIG PSR-11)", @@ -811,56 +1053,7 @@ "container-interop", "psr" ], - "time": "2017-02-14T16:28:37+00:00" - }, - { - "name": "psr/http-client", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-client.git", - "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", - "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", - "shasum": "" - }, - "require": { - "php": "^7.0 || ^8.0", - "psr/http-message": "^1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Client\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP clients", - "homepage": "https://github.com/php-fig/http-client", - "keywords": [ - "http", - "http-client", - "psr", - "psr-18" - ], - "time": "2020-06-29T06:28:15+00:00" + "time": "2021-03-05T17:36:06+00:00" }, { "name": "psr/http-message", @@ -914,16 +1107,16 @@ }, { "name": "psr/log", - "version": "1.1.3", + "version": "1.1.4", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" + "reference": "d49695b909c3b7628b6289db5479a1c204601f11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", + "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11", "shasum": "" }, "require": { @@ -947,7 +1140,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for logging libraries", @@ -957,7 +1150,7 @@ "psr", "psr-3" ], - "time": "2020-03-23T09:12:05+00:00" + "time": "2021-05-03T11:20:27+00:00" }, { "name": "ralouphie/getallheaders", @@ -1047,16 +1240,16 @@ }, { "name": "symfony/dependency-injection", - "version": "v3.4.43", + "version": "v3.4.47", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "3a14abc01c36e81fc1c4c48b42c103b9dd892ed3" + "reference": "51d2a2708c6ceadad84393f8581df1dcf9e5e84b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/3a14abc01c36e81fc1c4c48b42c103b9dd892ed3", - "reference": "3a14abc01c36e81fc1c4c48b42c103b9dd892ed3", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/51d2a2708c6ceadad84393f8581df1dcf9e5e84b", + "reference": "51d2a2708c6ceadad84393f8581df1dcf9e5e84b", "shasum": "" }, "require": { @@ -1085,17 +1278,323 @@ "symfony/yaml": "" }, "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\DependencyInjection\\": "" + }, + "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": "Symfony DependencyInjection Component", + "homepage": "https://symfony.com", + "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": "2020-10-24T10:57:07+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.23.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "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": "2021-02-19T12:13:01+00:00" + }, + { + "name": "symfony/polyfill-intl-idn", + "version": "v1.23.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-idn.git", + "reference": "65bd267525e82759e7d8c4e8ceea44f398838e65" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/65bd267525e82759e7d8c4e8ceea44f398838e65", + "reference": "65bd267525e82759e7d8c4e8ceea44f398838e65", + "shasum": "" + }, + "require": { + "php": ">=7.1", + "symfony/polyfill-intl-normalizer": "^1.10", + "symfony/polyfill-php72": "^1.10" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Intl\\Idn\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Laurent Bassin", + "email": "laurent@bassin.info" + }, + { + "name": "Trevor Rowbotham", + "email": "trevor.rowbotham@pm.me" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "idn", + "intl", + "polyfill", + "portable", + "shim" + ], + "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": "2021-05-27T09:27:20+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.23.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8", + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "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": "2021-02-19T12:13:01+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.23.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6", + "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { "psr-4": { - "Symfony\\Component\\DependencyInjection\\": "" + "Symfony\\Polyfill\\Mbstring\\": "" }, - "exclude-from-classmap": [ - "/Tests/" + "files": [ + "bootstrap.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -1104,16 +1603,23 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony DependencyInjection Component", + "description": "Symfony polyfill for the Mbstring extension", "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], "funding": [ { "url": "https://symfony.com/sponsor", @@ -1128,32 +1634,29 @@ "type": "tidelift" } ], - "time": "2020-07-23T09:37:51+00:00" + "time": "2021-05-27T12:26:48+00:00" }, { - "name": "symfony/polyfill-ctype", - "version": "v1.18.1", + "name": "symfony/polyfill-php72", + "version": "v1.23.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "1c302646f6efc070cd46856e600e5e0684d6b454" + "url": "https://github.com/symfony/polyfill-php72.git", + "reference": "9a142215a36a3888e30d0a9eeea9766764e96976" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/1c302646f6efc070cd46856e600e5e0684d6b454", - "reference": "1c302646f6efc070cd46856e600e5e0684d6b454", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/9a142215a36a3888e30d0a9eeea9766764e96976", + "reference": "9a142215a36a3888e30d0a9eeea9766764e96976", "shasum": "" }, "require": { - "php": ">=5.3.3" - }, - "suggest": { - "ext-ctype": "For best performance" + "php": ">=7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.18-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1162,7 +1665,7 @@ }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" + "Symfony\\Polyfill\\Php72\\": "" }, "files": [ "bootstrap.php" @@ -1174,21 +1677,21 @@ ], "authors": [ { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for ctype functions", + "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", "homepage": "https://symfony.com", "keywords": [ "compatibility", - "ctype", "polyfill", - "portable" + "portable", + "shim" ], "funding": [ { @@ -1204,20 +1707,20 @@ "type": "tidelift" } ], - "time": "2020-07-14T12:35:20+00:00" + "time": "2021-05-27T09:17:38+00:00" }, { "name": "vlucas/phpdotenv", - "version": "v2.6.6", + "version": "v2.6.7", "source": { "type": "git", "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "e1d57f62db3db00d9139078cbedf262280701479" + "reference": "b786088918a884258c9e3e27405c6a4cf2ee246e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/e1d57f62db3db00d9139078cbedf262280701479", - "reference": "e1d57f62db3db00d9139078cbedf262280701479", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/b786088918a884258c9e3e27405c6a4cf2ee246e", + "reference": "b786088918a884258c9e3e27405c6a4cf2ee246e", "shasum": "" }, "require": { @@ -1227,7 +1730,7 @@ "require-dev": { "ext-filter": "*", "ext-pcre": "*", - "phpunit/phpunit": "^4.8.35 || ^5.7.27" + "phpunit/phpunit": "^4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20" }, "suggest": { "ext-filter": "Required to use the boolean validator.", @@ -1276,7 +1779,7 @@ "type": "tidelift" } ], - "time": "2020-07-14T17:54:18+00:00" + "time": "2021-01-20T14:39:13+00:00" }, { "name": "yoast/i18n-module", @@ -1338,110 +1841,63 @@ }, "time": "2019-05-07T06:45:05+00:00" }, - { - "name": "yoast/license-manager", - "version": "1.6.0", - "source": { - "type": "git", - "url": "https://github.com/Yoast/License-Manager.git", - "reference": "fbacabb06d788912fead4f32d0d1d8b9a2d883c9" - }, - "dist": { - "type": "zip", - "url": "https://my.yoast.com/packages/dist/yoast/license-manager/yoast-license-manager-fbacabb06d788912fead4f32d0d1d8b9a2d883c9-zip-5d9715.zip", - "reference": "fbacabb06d788912fead4f32d0d1d8b9a2d883c9", - "shasum": "043ccf138562098d0055fc47f3feefc503567936" - }, - "type": "library", - "autoload": { - "classmap": [ - "class-api-request.php", - "class-license-manager.php", - "class-plugin-license-manager.php", - "class-plugin-update-manager.php", - "class-product.php", - "class-theme-license-manager.php", - "class-theme-update-manager.php", - "class-update-manager.php" - ] - }, - "license": [ - "GPL-2.0+" - ], - "authors": [ - { - "name": "Team Yoast", - "email": "support@yoast.com", - "homepage": "https://yoast.com" - } - ], - "description": "Yoast License Manager.", - "homepage": "https://github.com/Yoast/License-Manager", - "keywords": [ - "wordpress" - ], - "support": { - "issues": "https://github.com/Yoast/License-Manager/issues", - "source": "https://github.com/Yoast/License-Manager/tree/1.6.0" - }, - "time": "2017-08-22T07:59:16+00:00" - }, { "name": "yoast/wordpress-seo-premium", - "version": "14.8", + "version": "15.9.2", "source": { "type": "git", "url": "git@github.com:Yoast-dist/wordpress-seo-premium.git", - "reference": "112dbfbfc73224af1f304b5a502db0edbd5e3bd0" + "reference": "4552f9a6b687f827f55be784932d1dc7baf22236" }, "dist": { "type": "zip", - "url": "https://my.yoast.com/packages/dist/yoast/wordpress-seo-premium/yoast-wordpress-seo-premium-112dbfbfc73224af1f304b5a502db0edbd5e3bd0-zip-bd5c6c.zip", - "reference": "112dbfbfc73224af1f304b5a502db0edbd5e3bd0", - "shasum": "178994bac05a1c12674138aa63c7da8f8e54d5ff" + "url": "https://my.yoast.com/packages/dist/yoast/wordpress-seo-premium/yoast-wordpress-seo-premium-4552f9a6b687f827f55be784932d1dc7baf22236-zip-622f38.zip", + "reference": "4552f9a6b687f827f55be784932d1dc7baf22236", + "shasum": "6ec61bf642a6a6ceacf8c8dcf87a81d3b9cb363e" }, "require": { - "composer/installers": "~1.0", - "league/oauth2-client": "^2.4", + "composer/installers": "^1.9.0", + "league/oauth2-client": "2.4.1", "php": "^5.6.20||^7.0", "pimple/pimple": "^3.2", "psr/log": "^1.0", "symfony/dependency-injection": "^3.4", - "yoast/i18n-module": "^3.1.1", - "yoast/license-manager": "1.6.0" + "yoast/i18n-module": "^3.1.1" }, "require-dev": { - "atanamo/php-codeshift": "^1.0", - "brain/monkey": "^2.4", - "humbug/php-scoper": "^0.12.0", "php-parallel-lint/php-console-highlighter": "^0.5", "php-parallel-lint/php-parallel-lint": "^1.2.0", - "phpcompatibility/phpcompatibility-wp": "^2.0.0", + "phpunit/phpcov": "^3.1", "phpunit/phpunit": "^5.7", - "symfony/config": "^3.4", - "yoast/php-development-environment": "^1.0", - "yoast/yoastcs": "~0.4.3" + "yoast/wordpress-seo": "15.9.2", + "yoast/wp-test-utils": "^0.2.1", + "yoast/yoastcs": "^2.1.0" }, "type": "wordpress-plugin", + "extra": { + "installer-paths": { + "vendor/{$vendor}/{$name}": [ + "type:wordpress-plugin" + ] + } + }, "autoload": { "classmap": [ - "admin/", - "frontend/", - "inc/", - "deprecated/", + "classes/", "cli/", - "premium", "src/", - "lib/" + "premium.php" ], "exclude-from-classmap": [ - "/**/node_modules/" + "/**/node_modules/", + "vendor/yoast/wordpress-seo", + "vendor/yoast/i18n-module" ] }, "autoload-dev": { "classmap": [ - "tests/", - "config/" + "config/", + "tests/" ] }, "scripts": { @@ -1451,27 +1907,20 @@ "integration-test": [ "@php ./vendor/phpunit/phpunit/phpunit -c phpunit-integration.xml.dist" ], - "lint": [ - "@php ./vendor/php-parallel-lint/php-parallel-lint/parallel-lint . -e php --exclude vendor --exclude vendor_prefixed --exclude node_modules --exclude .git" - ], - "lint-files": [ - "@php ./vendor/php-parallel-lint/php-parallel-lint/parallel-lint" - ], - "lint-branch": [ - "Yoast\\WP\\SEO\\Composer\\Actions::lint_branch" - ], - "lint-staged": [ - "Yoast\\WP\\SEO\\Composer\\Actions::lint_staged" + "compile-di": [ + "rm -f ./src/generated/container.php", + "rm -f ./src/generated/container.php.meta", + "composer du --no-scripts", + "Yoast\\WP\\SEO\\Premium\\Config\\Composer\\Actions::compile_dependency_injection_container" ], - "premium-lint": [ - "@php ./vendor/php-parallel-lint/php-parallel-lint/parallel-lint ./wp-seo-premium.php ./tests/unit/load/wp-seo-premium.php ./premium/ ./tests/integration/premium/ ./tests/unit/premium/ -e php" + "cs": [ + "Yoast\\WP\\SEO\\Premium\\Config\\Composer\\Actions::check_coding_standards" ], - "config-yoastcs": [ - "@php ./vendor/squizlabs/php_codesniffer/scripts/phpcs --config-set installed_paths ../../../vendor/wp-coding-standards/wpcs,../../../vendor/yoast/yoastcs,../../../vendor/phpcompatibility/php-compatibility,../../../vendor/phpcompatibility/phpcompatibility-paragonie,../../../vendor/phpcompatibility/phpcompatibility-wp", - "@php ./vendor/squizlabs/php_codesniffer/scripts/phpcs --config-set default_standard Yoast" + "lint": [ + "@php ./vendor/php-parallel-lint/php-parallel-lint/parallel-lint --exclude vendor ./ -e php" ], - "cs": [ - "Yoast\\WP\\SEO\\Composer\\Actions::check_coding_standards" + "check-cs-summary": [ + "@check-cs-warnings --report=summary" ], "check-cs": [ "@check-cs-warnings -n" @@ -1481,72 +1930,34 @@ "composer check-cs" ], "check-cs-warnings": [ - "@php ./vendor/squizlabs/php_codesniffer/scripts/phpcs" - ], - "premium-check-cs": [ - "@before-premium-cs", - "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs --runtime-set ignore_warnings_on_exit 1", - "@after-premium-cs" + "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs" ], "check-staged-cs": [ - "Yoast\\WP\\SEO\\Composer\\Actions::check_staged_cs" - ], - "check-branch-cs": [ - "Yoast\\WP\\SEO\\Composer\\Actions::check_branch_cs" + "@check-cs-warnings --filter=GitStaged" ], "fix-cs": [ - "@php ./vendor/squizlabs/php_codesniffer/scripts/phpcbf" - ], - "premium-fix-cs": [ - "@before-premium-cs", - "@php ./vendor/squizlabs/php_codesniffer/bin/phpcbf || true", - "@after-premium-cs" - ], - "before-premium-cs": [ - "composer require --dev yoast/yoastcs:~2.0.0 --update-with-dependencies --no-suggest --no-interaction --no-scripts", - "composer config-yoastcs-premium" - ], - "config-yoastcs-premium": [ - "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin::run" - ], - "after-premium-cs": [ - "composer require --dev yoast/yoastcs:~0.4.3 --update-with-dependencies --no-suggest --no-interaction --no-scripts", - "@php ./config/composer/scripts/maybe-restore-composer-lock.php", - "composer config-yoastcs" - ], - "prefix-dependencies": [ - "composer prefix-oauth2-client", - "composer prefix-symfony" - ], - "prefix-oauth2-client": [ - "@php ./vendor/humbug/php-scoper/bin/php-scoper add-prefix --prefix=YoastSEO_Vendor --output-dir=./vendor_prefixed/league/oauth2-client --config=config/php-scoper/oauth2-client.inc.php --force --quiet", - "@php ./vendor/humbug/php-scoper/bin/php-scoper add-prefix --prefix=YoastSEO_Vendor --output-dir=./vendor_prefixed/guzzlehttp --config=config/php-scoper/guzzlehttp.inc.php --force --quiet", - "@php ./vendor/humbug/php-scoper/bin/php-scoper add-prefix --prefix=YoastSEO_Vendor --output-dir=./vendor_prefixed/psr --config=config/php-scoper/psr.inc.php --force --quiet" + "@php ./vendor/squizlabs/php_codesniffer/bin/phpcbf" ], - "prefix-symfony": [ - "@php ./vendor/humbug/php-scoper/bin/php-scoper add-prefix --prefix=YoastSEO_Vendor --output-dir=./vendor_prefixed/symfony/dependency-injection --config=config/php-scoper/dependency-injection.inc.php --force --quiet" + "lint-files": [ + "@php ./vendor/php-parallel-lint/php-parallel-lint/parallel-lint" ], - "remove-vendor-prefixed-uses": [ - "@php ./vendor/atanamo/php-codeshift/bin/codeshift --mod=config/php-codeshift/remove-vendor-prefixing-codemod.php --src=artifact-composer/src", - "@php ./vendor/atanamo/php-codeshift/bin/codeshift --mod=config/php-codeshift/remove-vendor-prefixing-codemod.php --src=artifact-composer/src/config/migrations", - "@php ./vendor/atanamo/php-codeshift/bin/codeshift --mod=config/php-codeshift/remove-vendor-prefixing-codemod.php --src=artifact-composer/lib" + "lint-branch": [ + "Yoast\\WP\\SEO\\Premium\\Config\\Composer\\Actions::lint_branch" ], - "remove-premium-vendor-prefixed-uses": [ - "@php ./vendor/atanamo/php-codeshift/bin/codeshift --mod=config/php-codeshift/remove-vendor-prefixing-codemod.php --src=artifact-composer/premium/src", - "@php ./vendor/atanamo/php-codeshift/bin/codeshift --mod=config/php-codeshift/remove-vendor-prefixing-codemod.php --src=artifact-composer/premium/migrations" + "lint-staged": [ + "Yoast\\WP\\SEO\\Premium\\Config\\Composer\\Actions::lint_staged" ], - "compile-di": [ - "rm -f ./src/generated/container.php", - "rm -f ./src/generated/container.php.meta", - "composer du --no-scripts", - "Yoast\\WP\\SEO\\Composer\\Actions::compile_dependency_injection_container" + "check-branch-cs": [ + "Yoast\\WP\\SEO\\Premium\\Config\\Composer\\Actions::check_branch_cs" ], - "post-autoload-dump": [ - "Yoast\\WP\\SEO\\Composer\\Actions::prefix_dependencies", + "post-install-cmd": [ + "cd vendor/yoast/wordpress-seo && composer install --ignore-platform-reqs && cd ../..", "composer compile-di" ], - "generate-migration": [ - "Yoast\\WP\\SEO\\Composer\\Actions::generate_migration" + "remove-vendor-prefixed-uses": [ + "@php ./vendor/yoast/wordpress-seo/vendor/atanamo/php-codeshift/bin/codeshift --mod=vendor/yoast/wordpress-seo/config/php-codeshift/remove-vendor-prefixing-codemod.php --src=artifact-composer/src", + "@php ./vendor/yoast/wordpress-seo/vendor/atanamo/php-codeshift/bin/codeshift --mod=vendor/yoast/wordpress-seo/config/php-codeshift/remove-vendor-prefixing-codemod.php --src=artifact-composer/vendor/yoast/wordpress-seo/src", + "@php ./vendor/yoast/wordpress-seo/vendor/atanamo/php-codeshift/bin/codeshift --mod=vendor/yoast/wordpress-seo/config/php-codeshift/remove-vendor-prefixing-codemod.php --src=artifact-composer/vendor/yoast/wordpress-seo/lib" ] }, "license": [ @@ -1566,12 +1977,10 @@ "wordpress" ], "support": { - "issues": "https://github.com/Yoast/wordpress-seo/issues", - "forum": "https://wordpress.org/support/plugin/wordpress-seo", - "wiki": "https://github.com/Yoast/wordpress-seo/wiki", - "source": "https://github.com/Yoast/wordpress-seo" + "issues": "https://github.com/Yoast/wordpress-seo-premium/issues", + "source": "https://github.com/Yoast/wordpress-seo-premium" }, - "time": "2020-08-18T09:36:59+00:00" + "time": "2021-03-11T09:59:43+00:00" } ], "packages-dev": [ @@ -1643,36 +2052,31 @@ }, { "name": "doctrine/instantiator", - "version": "1.3.1", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "f350df0268e904597e3bd9c4685c53e0e333feea" + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/f350df0268e904597e3bd9c4685c53e0e333feea", - "reference": "f350df0268e904597e3bd9c4685c53e0e333feea", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b", + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^6.0", + "doctrine/coding-standard": "^8.0", "ext-pdo": "*", "ext-phar": "*", - "phpbench/phpbench": "^0.13", - "phpstan/phpstan-phpunit": "^0.11", - "phpstan/phpstan-shim": "^0.11", - "phpunit/phpunit": "^7.0" + "phpbench/phpbench": "^0.13 || 1.0.0-alpha2", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, "autoload": { "psr-4": { "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" @@ -1686,7 +2090,7 @@ { "name": "Marco Pivetta", "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" + "homepage": "https://ocramius.github.io/" } ], "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", @@ -1709,20 +2113,20 @@ "type": "tidelift" } ], - "time": "2020-05-29T17:27:14+00:00" + "time": "2020-11-10T18:47:58+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.10.1", + "version": "1.10.2", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "969b211f9a51aa1f6c01d1d2aef56d3bd91598e5" + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/969b211f9a51aa1f6c01d1d2aef56d3bd91598e5", - "reference": "969b211f9a51aa1f6c01d1d2aef56d3bd91598e5", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220", + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220", "shasum": "" }, "require": { @@ -1763,7 +2167,7 @@ "type": "tidelift" } ], - "time": "2020-06-29T13:22:24+00:00" + "time": "2020-11-13T09:40:50+00:00" }, { "name": "oscarotero/env", @@ -1970,28 +2374,28 @@ }, { "name": "phpcompatibility/phpcompatibility-paragonie", - "version": "1.3.0", + "version": "1.3.1", "source": { "type": "git", "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git", - "reference": "b862bc32f7e860d0b164b199bd995e690b4b191c" + "reference": "ddabec839cc003651f2ce695c938686d1086cf43" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/b862bc32f7e860d0b164b199bd995e690b4b191c", - "reference": "b862bc32f7e860d0b164b199bd995e690b4b191c", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/ddabec839cc003651f2ce695c938686d1086cf43", + "reference": "ddabec839cc003651f2ce695c938686d1086cf43", "shasum": "" }, "require": { "phpcompatibility/php-compatibility": "^9.0" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.5", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7", "paragonie/random_compat": "dev-master", "paragonie/sodium_compat": "dev-master" }, "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." }, "type": "phpcodesniffer-standard", @@ -2018,20 +2422,20 @@ "polyfill", "standards" ], - "time": "2019-11-04T15:17:54+00:00" + "time": "2021-02-15T10:24:51+00:00" }, { "name": "phpcompatibility/phpcompatibility-wp", - "version": "2.1.0", + "version": "2.1.2", "source": { "type": "git", "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git", - "reference": "41bef18ba688af638b7310666db28e1ea9158b2f" + "reference": "a792ab623069f0ce971b2417edef8d9632e32f75" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/41bef18ba688af638b7310666db28e1ea9158b2f", - "reference": "41bef18ba688af638b7310666db28e1ea9158b2f", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/a792ab623069f0ce971b2417edef8d9632e32f75", + "reference": "a792ab623069f0ce971b2417edef8d9632e32f75", "shasum": "" }, "require": { @@ -2039,10 +2443,10 @@ "phpcompatibility/phpcompatibility-paragonie": "^1.0" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.5" + "dealerdirect/phpcodesniffer-composer-installer": "^0.7" }, "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." }, "type": "phpcodesniffer-standard", @@ -2068,7 +2472,7 @@ "standards", "wordpress" ], - "time": "2019-08-28T14:22:28+00:00" + "time": "2021-07-21T11:09:57+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -2121,16 +2525,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "5.2.1", + "version": "5.2.2", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "d870572532cd70bc3fab58f2e23ad423c8404c44" + "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d870572532cd70bc3fab58f2e23ad423c8404c44", - "reference": "d870572532cd70bc3fab58f2e23ad423c8404c44", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/069a785b2141f5bcf49f3e353548dc1cce6df556", + "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556", "shasum": "" }, "require": { @@ -2169,20 +2573,20 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2020-08-15T11:14:08+00:00" + "time": "2020-09-03T19:13:55+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "1.3.0", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "e878a14a65245fbe78f8080eba03b47c3b705651" + "reference": "30f38bffc6f24293dadd1823936372dfa9e86e2f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/e878a14a65245fbe78f8080eba03b47c3b705651", - "reference": "e878a14a65245fbe78f8080eba03b47c3b705651", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/30f38bffc6f24293dadd1823936372dfa9e86e2f", + "reference": "30f38bffc6f24293dadd1823936372dfa9e86e2f", "shasum": "" }, "require": { @@ -2190,7 +2594,8 @@ "phpdocumentor/reflection-common": "^2.0" }, "require-dev": { - "ext-tokenizer": "*" + "ext-tokenizer": "*", + "psalm/phar": "^4.8" }, "type": "library", "extra": { @@ -2214,37 +2619,37 @@ } ], "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", - "time": "2020-06-27T10:12:23+00:00" + "time": "2021-09-17T15:28:14+00:00" }, { "name": "phpspec/prophecy", - "version": "1.11.1", + "version": "1.14.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "b20034be5efcdab4fb60ca3a29cba2949aead160" + "reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/b20034be5efcdab4fb60ca3a29cba2949aead160", - "reference": "b20034be5efcdab4fb60ca3a29cba2949aead160", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e", + "reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e", "shasum": "" }, "require": { "doctrine/instantiator": "^1.2", - "php": "^7.2", - "phpdocumentor/reflection-docblock": "^5.0", + "php": "^7.2 || ~8.0, <8.2", + "phpdocumentor/reflection-docblock": "^5.2", "sebastian/comparator": "^3.0 || ^4.0", "sebastian/recursion-context": "^3.0 || ^4.0" }, "require-dev": { - "phpspec/phpspec": "^6.0", - "phpunit/phpunit": "^8.0" + "phpspec/phpspec": "^6.0 || ^7.0", + "phpunit/phpunit": "^8.0 || ^9.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.11.x-dev" + "dev-master": "1.x-dev" } }, "autoload": { @@ -2277,7 +2682,7 @@ "spy", "stub" ], - "time": "2020-07-08T12:44:21+00:00" + "time": "2021-09-10T09:02:12+00:00" }, { "name": "phpunit/php-code-coverage", @@ -2344,23 +2749,23 @@ }, { "name": "phpunit/php-file-iterator", - "version": "2.0.2", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "050bedf145a257b1ff02746c31894800e5122946" + "reference": "28af674ff175d0768a5a978e6de83f697d4a7f05" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/050bedf145a257b1ff02746c31894800e5122946", - "reference": "050bedf145a257b1ff02746c31894800e5122946", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/28af674ff175d0768a5a978e6de83f697d4a7f05", + "reference": "28af674ff175d0768a5a978e6de83f697d4a7f05", "shasum": "" }, "require": { - "php": "^7.1" + "php": ">=7.1" }, "require-dev": { - "phpunit/phpunit": "^7.1" + "phpunit/phpunit": "^8.5" }, "type": "library", "extra": { @@ -2390,7 +2795,13 @@ "filesystem", "iterator" ], - "time": "2018-09-13T20:33:42+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-07-19T06:46:01+00:00" }, { "name": "phpunit/php-text-template", @@ -2435,23 +2846,23 @@ }, { "name": "phpunit/php-timer", - "version": "2.1.2", + "version": "2.1.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "1038454804406b0b5f5f520358e78c1c2f71501e" + "reference": "2454ae1765516d20c4ffe103d85a58a9a3bd5662" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/1038454804406b0b5f5f520358e78c1c2f71501e", - "reference": "1038454804406b0b5f5f520358e78c1c2f71501e", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/2454ae1765516d20c4ffe103d85a58a9a3bd5662", + "reference": "2454ae1765516d20c4ffe103d85a58a9a3bd5662", "shasum": "" }, "require": { - "php": "^7.1" + "php": ">=7.1" }, "require-dev": { - "phpunit/phpunit": "^7.0" + "phpunit/phpunit": "^8.5" }, "type": "library", "extra": { @@ -2480,25 +2891,31 @@ "keywords": [ "timer" ], - "time": "2019-06-07T04:22:29+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-30T08:20:02+00:00" }, { "name": "phpunit/php-token-stream", - "version": "3.1.1", + "version": "3.1.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "995192df77f63a59e47f025390d2d1fdf8f425ff" + "reference": "9c1da83261628cb24b6a6df371b6e312b3954768" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/995192df77f63a59e47f025390d2d1fdf8f425ff", - "reference": "995192df77f63a59e47f025390d2d1fdf8f425ff", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/9c1da83261628cb24b6a6df371b6e312b3954768", + "reference": "9c1da83261628cb24b6a6df371b6e312b3954768", "shasum": "" }, "require": { "ext-tokenizer": "*", - "php": "^7.1" + "php": ">=7.1" }, "require-dev": { "phpunit/phpunit": "^7.0" @@ -2529,8 +2946,14 @@ "keywords": [ "tokenizer" ], + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], "abandoned": true, - "time": "2019-09-17T06:23:10+00:00" + "time": "2021-07-26T12:15:06+00:00" }, { "name": "phpunit/phpunit", @@ -2618,23 +3041,23 @@ }, { "name": "sebastian/code-unit-reverse-lookup", - "version": "1.0.1", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" + "reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", - "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/1de8cd5c010cb153fcd68b8d0f64606f523f7619", + "reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": ">=5.6" }, "require-dev": { - "phpunit/phpunit": "^5.7 || ^6.0" + "phpunit/phpunit": "^8.5" }, "type": "library", "extra": { @@ -2659,29 +3082,35 @@ ], "description": "Looks up which function or method a line of code belongs to", "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "time": "2017-03-04T06:30:41+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-30T08:15:22+00:00" }, { "name": "sebastian/comparator", - "version": "3.0.2", + "version": "3.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da" + "reference": "1071dfcef776a57013124ff35e1fc41ccd294758" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/5de4fc177adf9bce8df98d8d141a7559d7ccf6da", - "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1071dfcef776a57013124ff35e1fc41ccd294758", + "reference": "1071dfcef776a57013124ff35e1fc41ccd294758", "shasum": "" }, "require": { - "php": "^7.1", + "php": ">=7.1", "sebastian/diff": "^3.0", "sebastian/exporter": "^3.1" }, "require-dev": { - "phpunit/phpunit": "^7.1" + "phpunit/phpunit": "^8.5" }, "type": "library", "extra": { @@ -2699,6 +3128,10 @@ "BSD-3-Clause" ], "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, { "name": "Jeff Welch", "email": "whatthejeff@gmail.com" @@ -2710,10 +3143,6 @@ { "name": "Bernhard Schussek", "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" } ], "description": "Provides the functionality to compare PHP values for equality", @@ -2723,24 +3152,30 @@ "compare", "equality" ], - "time": "2018-07-12T15:12:46+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-30T08:04:30+00:00" }, { "name": "sebastian/diff", - "version": "3.0.2", + "version": "3.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "720fcc7e9b5cf384ea68d9d930d480907a0c1a29" + "reference": "14f72dd46eaf2f2293cbe79c93cc0bc43161a211" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/720fcc7e9b5cf384ea68d9d930d480907a0c1a29", - "reference": "720fcc7e9b5cf384ea68d9d930d480907a0c1a29", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/14f72dd46eaf2f2293cbe79c93cc0bc43161a211", + "reference": "14f72dd46eaf2f2293cbe79c93cc0bc43161a211", "shasum": "" }, "require": { - "php": "^7.1" + "php": ">=7.1" }, "require-dev": { "phpunit/phpunit": "^7.5 || ^8.0", @@ -2762,13 +3197,13 @@ "BSD-3-Clause" ], "authors": [ - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" } ], "description": "Diff implementation", @@ -2779,24 +3214,30 @@ "unidiff", "unified diff" ], - "time": "2019-02-04T06:01:07+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-30T07:59:04+00:00" }, { "name": "sebastian/environment", - "version": "4.2.3", + "version": "4.2.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368" + "reference": "d47bbbad83711771f167c72d4e3f25f7fcc1f8b0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/464c90d7bdf5ad4e8a6aea15c091fec0603d4368", - "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/d47bbbad83711771f167c72d4e3f25f7fcc1f8b0", + "reference": "d47bbbad83711771f167c72d4e3f25f7fcc1f8b0", "shasum": "" }, "require": { - "php": "^7.1" + "php": ">=7.1" }, "require-dev": { "phpunit/phpunit": "^7.5" @@ -2832,24 +3273,30 @@ "environment", "hhvm" ], - "time": "2019-11-20T08:46:58+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-30T07:53:42+00:00" }, { "name": "sebastian/exporter", - "version": "3.1.2", + "version": "3.1.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e" + "reference": "6b853149eab67d4da22291d36f5b0631c0fd856e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/68609e1261d215ea5b21b7987539cbfbe156ec3e", - "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/6b853149eab67d4da22291d36f5b0631c0fd856e", + "reference": "6b853149eab67d4da22291d36f5b0631c0fd856e", "shasum": "" }, "require": { - "php": "^7.0", + "php": ">=7.0", "sebastian/recursion-context": "^3.0" }, "require-dev": { @@ -2899,7 +3346,13 @@ "export", "exporter" ], - "time": "2019-09-14T09:02:43+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-30T07:47:53+00:00" }, { "name": "sebastian/global-state", @@ -2954,20 +3407,20 @@ }, { "name": "sebastian/object-enumerator", - "version": "3.0.3", + "version": "3.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" + "reference": "e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", - "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2", + "reference": "e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2", "shasum": "" }, "require": { - "php": "^7.0", + "php": ">=7.0", "sebastian/object-reflector": "^1.1.1", "sebastian/recursion-context": "^3.0" }, @@ -2997,24 +3450,30 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2017-08-03T12:35:26+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-30T07:40:27+00:00" }, { "name": "sebastian/object-reflector", - "version": "1.1.1", + "version": "1.1.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "773f97c67f28de00d397be301821b06708fca0be" + "reference": "9b8772b9cbd456ab45d4a598d2dd1a1bced6363d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", - "reference": "773f97c67f28de00d397be301821b06708fca0be", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/9b8772b9cbd456ab45d4a598d2dd1a1bced6363d", + "reference": "9b8772b9cbd456ab45d4a598d2dd1a1bced6363d", "shasum": "" }, "require": { - "php": "^7.0" + "php": ">=7.0" }, "require-dev": { "phpunit/phpunit": "^6.0" @@ -3042,24 +3501,30 @@ ], "description": "Allows reflection of object attributes, including inherited and non-public ones", "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "time": "2017-03-29T09:07:27+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-30T07:37:18+00:00" }, { "name": "sebastian/recursion-context", - "version": "3.0.0", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" + "reference": "367dcba38d6e1977be014dc4b22f47a484dac7fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", - "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/367dcba38d6e1977be014dc4b22f47a484dac7fb", + "reference": "367dcba38d6e1977be014dc4b22f47a484dac7fb", "shasum": "" }, "require": { - "php": "^7.0" + "php": ">=7.0" }, "require-dev": { "phpunit/phpunit": "^6.0" @@ -3080,14 +3545,14 @@ "BSD-3-Clause" ], "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, { "name": "Adam Harvey", "email": "aharvey@php.net" @@ -3095,24 +3560,30 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2017-03-03T06:23:57+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-30T07:34:24+00:00" }, { "name": "sebastian/resource-operations", - "version": "2.0.1", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9" + "reference": "31d35ca87926450c44eae7e2611d45a7a65ea8b3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/4d7a795d35b889bf80a0cc04e08d77cedfa917a9", - "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/31d35ca87926450c44eae7e2611d45a7a65ea8b3", + "reference": "31d35ca87926450c44eae7e2611d45a7a65ea8b3", "shasum": "" }, "require": { - "php": "^7.1" + "php": ">=7.1" }, "type": "library", "extra": { @@ -3137,7 +3608,13 @@ ], "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2018-10-04T04:07:39+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-30T07:30:19+00:00" }, { "name": "sebastian/version", @@ -3184,16 +3661,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.5.6", + "version": "3.6.0", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "e97627871a7eab2f70e59166072a6b767d5834e0" + "reference": "ffced0d2c8fa8e6cdc4d695a743271fab6c38625" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/e97627871a7eab2f70e59166072a6b767d5834e0", - "reference": "e97627871a7eab2f70e59166072a6b767d5834e0", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ffced0d2c8fa8e6cdc4d695a743271fab6c38625", + "reference": "ffced0d2c8fa8e6cdc4d695a743271fab6c38625", "shasum": "" }, "require": { @@ -3231,20 +3708,20 @@ "phpcs", "standards" ], - "time": "2020-08-10T04:50:15+00:00" + "time": "2021-04-09T00:54:41+00:00" }, { "name": "theseer/tokenizer", - "version": "1.2.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "75a63c33a8577608444246075ea0af0d052e452a" + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/75a63c33a8577608444246075ea0af0d052e452a", - "reference": "75a63c33a8577608444246075ea0af0d052e452a", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", "shasum": "" }, "require": { @@ -3277,34 +3754,39 @@ "type": "github" } ], - "time": "2020-07-12T23:59:07+00:00" + "time": "2021-07-28T10:34:58+00:00" }, { "name": "webmozart/assert", - "version": "1.9.1", + "version": "1.10.0", "source": { "type": "git", - "url": "https://github.com/webmozart/assert.git", - "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389" + "url": "https://github.com/webmozarts/assert.git", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389", - "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0 || ^8.0", + "php": "^7.2 || ^8.0", "symfony/polyfill-ctype": "^1.8" }, "conflict": { "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<3.9.1" + "vimeo/psalm": "<4.6.1 || 4.6.2" }, "require-dev": { - "phpunit/phpunit": "^4.8.36 || ^7.5.13" + "phpunit/phpunit": "^8.5.13" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10-dev" + } + }, "autoload": { "psr-4": { "Webmozart\\Assert\\": "src/" @@ -3326,7 +3808,7 @@ "check", "validate" ], - "time": "2020-07-08T17:02:28+00:00" + "time": "2021-03-09T10:59:23+00:00" }, { "name": "wp-coding-standards/wpcs", @@ -3373,6 +3855,65 @@ "wordpress" ], "time": "2020-05-13T23:57:56+00:00" + }, + { + "name": "yoast/phpunit-polyfills", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/Yoast/PHPUnit-Polyfills.git", + "reference": "f014fb21c2b0038fd329515d59025af42fb98715" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Yoast/PHPUnit-Polyfills/zipball/f014fb21c2b0038fd329515d59025af42fb98715", + "reference": "f014fb21c2b0038fd329515d59025af42fb98715", + "shasum": "" + }, + "require": { + "php": ">=5.4", + "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.0 || ^7.0 || ^8.0 || ^9.0" + }, + "require-dev": { + "php-parallel-lint/php-console-highlighter": "^0.5", + "php-parallel-lint/php-parallel-lint": "^1.3.0", + "yoast/yoastcs": "^2.1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev", + "dev-develop": "1.x-dev" + } + }, + "autoload": { + "files": [ + "phpunitpolyfills-autoload.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Team Yoast", + "email": "support@yoast.com", + "homepage": "https://yoast.com" + }, + { + "name": "Contributors", + "homepage": "https://github.com/Yoast/PHPUnit-Polyfills/graphs/contributors" + } + ], + "description": "Set of polyfills for changed PHPUnit functionality to allow for creating PHPUnit cross-version compatible tests", + "homepage": "https://github.com/Yoast/PHPUnit-Polyfills", + "keywords": [ + "phpunit", + "polyfill", + "testing" + ], + "time": "2021-08-09T16:28:08+00:00" } ], "aliases": [], diff --git a/includes/acf.php b/includes/acf.php index 928c048..04b5cfc 100644 --- a/includes/acf.php +++ b/includes/acf.php @@ -11,6 +11,7 @@ use ElasticPress\Utils\InlineSVG; use function ElasticPress\Serializers\post_data; use function ElasticPress\Serializers\get_image_array; +use function ElasticPress\Serializers\term_data; /** * Convert raw ACF data into nested fields @@ -26,7 +27,12 @@ function parse_acf_field( $field, $value, $data = array(), $base_prefix = '' ) { // The default `image` metadata is just the attachment id // the image array is much more useful. case 'image': - $value = get_acf_image( $value ); + $value = ( ! empty( $value ) ) ? get_acf_image( $value ) : $value; + break; + case 'oembed': + if ( empty( $value ) ) { + $value = ''; + } break; case 'file': if ( ! is_array( $value ) ) { @@ -39,6 +45,19 @@ function parse_acf_field( $field, $value, $data = array(), $base_prefix = '' ) { case 'repeater': if ( ! is_array( $value ) ) { $value = parse_repeater_field( $field, $value, $data, $base_prefix ); + } else { + // pre-parsed repeater fields do not have images parsed so we + // check for all images and parse them. + foreach ( $value as $index => $repeater_field ) { + $new_value = array(); + foreach ( $repeater_field as $key => $repeater_value ) { + if ( is_array( $repeater_value ) && isset( $repeater_value['type'] ) && 'image' === $repeater_value['type'] ) { + $repeater_value = get_acf_image( $repeater_value ); + } + $new_value[ $key ] = $repeater_value; + } + $value[ $index ] = $new_value; + } } break; case 'post_object': @@ -53,6 +72,40 @@ function parse_acf_field( $field, $value, $data = array(), $base_prefix = '' ) { $value = array(); } break; + case 'flexible_content': + if (!getenv('ES_SKIP_ACF_PARSING')) { + $data = array(); + foreach ( $value as $index => $m ) { + $layout_idx = array_search( $m['acf_fc_layout'], array_column( $field['layouts'], 'name' ) ); + $layout = $field['layouts'][ $layout_idx ]; + $idx = 0; + foreach ( $m as $k => $mod ) { + if ( 'acf_fc_layout' === $k ) { + continue; + } + $f = false; + $keys = array( + $layout['key'] . "_$k", + str_replace( 'layout', 'field', $layout['name'] . "_$k" ), + $layout['key'] . '_' . $layout['name'], + ); + foreach ( $keys as $key ) { + if ( false !== $f ) { + break; + } + $f = acf_get_field( $key ); + } + if ( 'clone' === $f['type'] ) { + $f = $f['sub_fields'][ $idx ]; + } + $data[ $index ][ $k ] = parse_acf_field( $f, $mod, $data, $base_prefix ); + $idx++; + } + $data[ $index ]['acf_fc_layout'] = $m['acf_fc_layout']; + } + $value = $data; + } + break; } if ( is_array( $value ) ) { @@ -69,14 +122,13 @@ function parse_acf_field( $field, $value, $data = array(), $base_prefix = '' ) { * @return Array */ function get_acf_image( $value ) { - if ( is_array( $value ) ) { - if ( isset( $value['mime_type'] ) && 'image/svg+xml' === $value['mime_type'] ) { - $value['raw'] = InlineSVG::remote( $value['url'] ); - } - return $value; - } else { - return get_image_array( $value ); + if ( ! is_array( $value ) ) { + $value = get_image_array( $value ); + } + if ( isset( $value['mime_type'] ) && 'image/svg+xml' === $value['mime_type'] ) { + $value['raw'] = InlineSVG::remote( $value['url'] ); } + return $value; } /** @@ -146,20 +198,15 @@ function parse_group_field( $field, $value, $data, $base_prefix ) { foreach ( $sub_fields as $sub_field ) { $sub_field_key = $sub_field['name']; + $prefix = field_prefix( $base_prefix, $field['name'], $sub_field_key ); + $val = $value; - // FIXME: Why are we using $value? (repeater doesn't). - if ( isset( $value[ $sub_field_key ] ) ) { - $val = $value[ $sub_field_key ]; - if ( isset( $val['mime_type'] ) && 'image/svg+xml' === $val['mime_type'] ) { - $val['raw'] = InlineSVG::remote( $val['url'] ); - } - } else { - $prefix = field_prefix( $base_prefix, $field['name'], $sub_field_key ); - if ( isset( $data[ $prefix ] ) ) { - $val = parse_acf_field( $sub_field, $data[ $prefix ], $data, $prefix ); - } else { - $val = $value; - } + if ( is_array( $value ) && array_key_exists( $sub_field_key, $value ) ) { + // For non-gutenberge serialization. + $val = parse_acf_field( $sub_field, $value[ $sub_field_key ], $data, $prefix ); + } elseif ( isset( $data[ $prefix ] ) ) { + // For gutenberg serialization. + $val = parse_acf_field( $sub_field, $data[ $prefix ], $data, $prefix ); } $value_array[ $sub_field_key ] = $val; } diff --git a/includes/elasticsearch/class-client.php b/includes/elasticsearch/class-client.php index dd42cec..2bee701 100644 --- a/includes/elasticsearch/class-client.php +++ b/includes/elasticsearch/class-client.php @@ -9,6 +9,10 @@ use ElasticPress\Utils\CustomPostTypes; use ElasticPress\Utils\Taxonomy; +use Aws\Credentials\CredentialProvider; +use Aws\Credentials\Credentials; +use Aws\ElasticsearchService\ElasticsearchPhpHandler; +use Elasticsearch\ClientBuilder; /** * Client class for interfacing with ElasticSearch @@ -43,9 +47,20 @@ class Client { */ public static function client(): \Elasticsearch\Client { if ( null === static::$instance ) { - static::$instance = \Elasticsearch\ClientBuilder::create() - ->setHosts( array( ELASTICSEARCH_URL ) ) - ->build(); + if ( defined( 'EP_AWS_REGION' ) ) { + $provider = CredentialProvider::fromCredentials( + new Credentials( EP_AWS_ACCESS_KEY_ID, EP_AWS_SECRET_ACCESS_KEY ) + ); + $handler = new ElasticsearchPhpHandler( EP_AWS_REGION, $provider ); + static::$instance = ClientBuilder::create() + ->setHandler( $handler ) + ->setHosts( array( ELASTICSEARCH_URL ) ) + ->build(); + } else { + static::$instance = ClientBuilder::create() + ->setHosts( array( ELASTICSEARCH_URL ) ) + ->build(); + } } return static::$instance; } @@ -77,6 +92,14 @@ public static function set( $id, $index, $value ) { $index_name = self::write_index_alias( $index ); try { + do_action( + 'ep_elasticsearch_before_set', + array( + 'index' => $index, + 'id' => $id, + 'value' => $value, + ) + ); self::client()->index( array( 'index' => $index_name, @@ -125,6 +148,130 @@ public static function find( $id, $index ) { } } + /** + * Gets all published documents with a url, a.k.a. pages + * + * @param array $body The query body. + */ + public static function search( $body ) { + $params = array( + 'body' => $body, + 'index' => self::read_index_alias( '*' ), + 'size' => 10000, + ); + $results = self::client()->search( $params ); + if ( empty( $results['hits']['hits'] ) ) { + $records = array(); + } else { + $records = array_map( + function( $record ) { + return $record['_source']; + }, + $results['hits']['hits'] + ); + } + return $records; + } + + /** + * Gets all published documents with a url, a.k.a. pages + */ + public static function get_pages() { + $index_name = self::read_index_alias( '*' ); + $public_types = array_keys( get_post_types( array( 'public' => true ) ) ); + $response = self::client()->search( + array( + 'index' => $index_name, + 'size' => 10000, + 'body' => array( + 'query' => array( + 'bool' => array( + 'must' => array( + array( + 'exists' => array( + 'field' => 'url', + ), + ), + array( + 'term' => array( + 'post_status.keyword' => 'publish', + ), + ), + array( + 'terms' => array( + 'post_type.keyword' => $public_types, + ), + ), + ), + 'must_not' => array( + 'exists' => array( + 'field' => 'taxonomy', + ), + ), + ), + ), + ), + ) + ); + $results = $response['hits']['hits']; + return $results; + } + + /** + * Gets all documents of a given index - all indicies by default + * + * @param string $index (optional) The index for lookup. + */ + public static function all( $index = '*' ) { + $index_name = self::read_index_alias( $index ); + $response = self::client()->search( + array( + 'index' => $index_name, + 'size' => 10000, + 'body' => array(), + ) + ); + $results = $response['hits']['hits']; + return $results; + } + + /** + * Finds a document by url + * + * @param string $input The url for lookup. + */ + public static function find_by_url( $input ) { + $index_name = self::read_index_alias( '*' ); + + $record = null; + $urls = array( + "$input/", + $input, + ); + foreach ( $urls as $url ) { + $results = self::client()->search( + array( + 'index' => $index_name, + 'body' => array( + 'query' => array( + 'term' => array( + 'url.keyword' => $url, + ), + ), + ), + 'size' => 1, + ) + ); + + $record = $results['hits']['hits'][0]; + + if ( $record ) { + break; + } + } + return $record; + } + /** * Builds a where query for Elasticsearch * @@ -147,6 +294,11 @@ public static function where_query( $index, $params ) { // Scope queries by published status. $status = isset( $params['post_status'] ) ? $params['post_status'] : 'publish'; $params = array_merge( $params, array( 'post_status' => $status ) ); + $sort = isset( $params['sort'] ) ? $params['sort'] : null; + $range = isset( $params['range'] ) ? $params['range'] : null; + $from = isset( $params['from'] ) ? $params['from'] : 0; + $size = isset( $params['size'] ) ? $params['size'] : 10000; + unset( $params['sort'], $params['range'], $params['from'], $params['size'] ); // Convert `id` fields into integers. array_walk( @@ -180,13 +332,6 @@ function( $v, $k ) { ARRAY_FILTER_USE_BOTH ); - $sort_param = null; - foreach ( $id_params as $key => $val ) { - if ( is_array( $val ) ) { - $sort_param = array( $key, $val ); - } - } - $query = array( 'bool' => array() ); if ( ! empty( $or_params ) ) { @@ -203,6 +348,7 @@ function( &$v, $k ) { ); } + $must_params = array(); if ( ! empty( $and_params ) ) { array_walk( $and_params, @@ -210,17 +356,33 @@ function( &$v, $k ) { $v = self::map_param( $k, $v ); } ); + $must_params = $and_params; + } + + if ( ! empty( $range ) ) { + array_push( $must_params, array( 'range' => $range ) ); + } + + if ( ! empty( $must_params ) ) { $query['bool'] = array_merge( $query['bool'], array( - 'must' => array_values( $and_params ), + 'must' => array_values( $must_params ), ) ); } $body = array( 'query' => $query ); - if ( ! empty( $sort_param ) ) { + $sort_param = null; + foreach ( $id_params as $key => $val ) { + if ( is_array( $val ) ) { + $sort_param = array( $key, $val ); + } + } + if ( ! empty( $sort ) ) { + $body['sort'] = $sort; + } elseif ( ! empty( $sort_param ) ) { list( $key, $ids ) = $sort_param; $script = self::painless_script( $key ); $body['sort'] = array( @@ -241,7 +403,8 @@ function( &$v, $k ) { return array( 'index' => $index_name, 'body' => $body, - 'size' => 10000, + 'size' => $size, + 'from' => $from, ); } @@ -294,6 +457,7 @@ function( $record ) { public static function delete_where( $index, $params ) { $index_name = self::read_index_alias( $index ); $query_params = self::where_query( $index, $params ); + unset( $query_params['from'] ); self::client()->deleteByQuery( $query_params ); } @@ -313,7 +477,42 @@ public static function update_write_aliases() { self::client()->indices()->delete( array( 'index' => $old_index ) ); } } - $params = array( + $mappings = array( + 'date_detection' => false, + 'properties' => array( + 'content' => array( + 'type' => 'text', + ), + 'taxonomies' => array( + 'type' => 'nested', + ), + 'unit_id' => array( + 'type' => 'keyword', + ), + 'ID' => array( + 'type' => 'keyword', + ), + 'id' => array( + 'type' => 'keyword', + ), + 'post_id' => array( + 'type' => 'keyword', + ), + 'term_id' => array( + 'type' => 'keyword', + ), + 'post_date' => array( + 'type' => 'date', + 'format' => 'yyyy-MM-dd HH:mm:ss', + ), + 'post_modified' => array( + 'type' => 'date', + 'format' => 'yyyy-MM-dd HH:mm:ss', + ), + ), + ); + $mappings = apply_filters( 'ep_mappings', $mappings, $index_type ); + $params = array( 'index' => $new_index, 'body' => array( 'settings' => array( @@ -324,29 +523,7 @@ public static function update_write_aliases() { ), ), 'mappings' => array( - 'jsondata' => array( - 'date_detection' => false, - 'properties' => array( - 'content' => array( - 'type' => 'text', - ), - 'taxonomies' => array( - 'type' => 'nested', - ), - 'unit_id' => array( - 'type' => 'keyword', - ), - 'ID' => array( - 'type' => 'keyword', - ), - 'id' => array( - 'type' => 'keyword', - ), - 'post_id' => array( - 'type' => 'keyword', - ), - ), - ), + 'jsondata' => $mappings, ), ), ); diff --git a/includes/elasticsearch/functions.php b/includes/elasticsearch/functions.php index 15ce0bb..a5d75da 100644 --- a/includes/elasticsearch/functions.php +++ b/includes/elasticsearch/functions.php @@ -42,6 +42,15 @@ function elasticsearch_where( $index_name, $params = array() ) { return Client::where( $index_name, $params ); } +/** + * Retrieve values from Elasticsearch by query params + * + * @param string $index_name The index identifier. + */ +function elasticsearch_all( $index_name = '*' ) { + return Client::all( $index_name ); +} + /** * Delete values from Elasticsearch by query params * @@ -51,3 +60,19 @@ function elasticsearch_where( $index_name, $params = array() ) { function elasticsearch_delete_where( $index_name, $params = array() ) { return Client::delete_where( $index_name, $params ); } + +/** + * Delete values from Elasticsearch by query params + * + * @param string $url The url identifier. + */ +function elasticsearch_find_by_url( $url ) { + return Client::find_by_url( $url ); +} + +/** + * Delete values from Elasticsearch by query params + */ +function elasticsearch_get_pages() { + return Client::get_pages(); +} diff --git a/includes/seo.php b/includes/seo.php index b1a5d3c..fa26eb8 100644 --- a/includes/seo.php +++ b/includes/seo.php @@ -25,10 +25,45 @@ function get_yoast_head( $id, $type ) { } else { $context = $action->for_post( $id ); } - $head = $context->head; + // v15 of Yoast uses "head" and v16+ uses "html" + // in order to keep both versions working simultaneously we use the + // Null Coalescing Operator (??). + $head = $context->head ?? $context->html; return $head; } +/** + * Get Yoast title + * + * @param String $id The id for the data. + * @param String $type The type of post. + * @return String $title + */ +function get_yoast_title( $id, $type ) { + if ( 'term' === $type ) { + $context = YoastSEO()->meta->for_term( $id ); + } else { + $context = YoastSEO()->meta->for_post( $id ); + } + return $context->title; +} + +/** + * Get Yoast description + * + * @param String $id The id for the data. + * @param String $type The type of post. + * @return String $description + */ +function get_yoast_description( $id, $type ) { + if ( 'term' === $type ) { + $context = YoastSEO()->meta->for_term( $id ); + } else { + $context = YoastSEO()->meta->for_post( $id ); + } + return $context->description; +} + /** * Serialize SEO data from Yoast * @@ -41,32 +76,49 @@ function get_seo_data( $id, $type ) { $head = get_yoast_head( $id, $type ); $doc = new \DOMDocument(); $doc->loadHTML( $head ); - $tags = $doc->getElementsByTagName( 'meta' ); - $scripts = $doc->getElementsByTagName( 'script' ); - $title = null; - $meta = array(); + $tags = $doc->getElementsByTagName( 'meta' ); + $scripts = $doc->getElementsByTagName( 'script' ); + $title = get_yoast_title( $id, $type ); + $description = get_yoast_description( $id, $type ); + $meta = array(); foreach ( $tags as $tag ) { $piece = array(); foreach ( $keys as $key ) { if ( $tag->hasAttribute( $key ) ) { - $attribute = $tag->getAttribute( $key ); - if ( 'property' === $key && 'og:title' === $attribute ) { - $title = $tag->getAttribute( 'content' ); - } + $attribute = $tag->getAttribute( $key ); $piece[ $key ] = $attribute; } } + if ( isset( $piece['property'] ) && preg_match( '/title/', $piece['property'] ) ) { + $piece['content'] = $title; + } + if ( isset( $piece['property'] ) && preg_match( '/description/', $piece['property'] ) ) { + $piece['content'] = $description; + } + + $piece = apply_filters( 'ep_seo_meta_piece', $piece ); + if ( isset( $piece['name'] ) ) { + $piece['content'] = utf8_decode($piece['content']); + $piece = apply_filters( 'ep_seo_meta_piece_' . $piece['name'], $piece ); + } array_push( $meta, $piece ); } + $meta = apply_filters( 'ep_seo_meta', $meta ); + $output = array( 'meta' => $meta ); if ( $title ) { $output['title'] = $title; } + if ( $description ) { + $output['description'] = $description; + } + if ( $scripts[0] ) { - $output['schema'] = $scripts[0]->nodeValue; + $schema = json_decode($scripts[0]->nodeValue); + $output['schema'] = json_encode($schema, JSON_UNESCAPED_UNICODE); } return $output; diff --git a/includes/storage.php b/includes/storage.php index 26a35ae..fd23b62 100644 --- a/includes/storage.php +++ b/includes/storage.php @@ -39,11 +39,12 @@ function store_post( $post ) { * @param WP_Term $menu The menu (term) object. */ function store_menu( $menu ) { - $key = $menu->slug . '_nav'; - $items = wp_get_nav_menu_items( $menu->name ); - $data = array_map( 'ElasticPress\Serializers\nav_map', $items ); - $type = $menu->taxonomy; - ElasticSearch\elasticsearch_store( $key, $type, array( 'menu_items' => $data ) ); + $key = $menu->slug . '_nav'; + $items = wp_get_nav_menu_items( $menu->name ); + $data = term_data( $menu ); + $data['menu_items'] = array_map( 'ElasticPress\Serializers\nav_map', $items ); + $type = $menu->taxonomy; + ElasticSearch\elasticsearch_store( $key, $type, $data ); } /** @@ -56,6 +57,15 @@ function store_term( $term ) { ElasticSearch\elasticsearch_store( $term->term_id, $data['taxonomy'], $data ); } +/** + * Serializes and stores a revision into elasticsearch + * + * @param $revision + */ +function store_revision($revision) { + // Still need to figure out how to use this +} + /** * Serializes and stores all terms of a taxonomy type * @@ -79,8 +89,9 @@ function store_terms_data( $type ) { * Serializes and stores an options page into elasticsearch * * @param string $id The prefix for values in the options table. + * @param string $page The specific option page name. */ -function store_options( $id ) { +function store_options( $id, $page = null ) { $data = acf_data( $id ); $clean_data = array(); foreach ( $data as $key => $value ) { @@ -92,6 +103,10 @@ function store_options( $id ) { } foreach ( $clean_data as $key => $value ) { + $value['ID'] = $key; + if ( $page && $page !== $key ) { + continue; + } ElasticSearch\elasticsearch_store( $key, 'options', $value ); } } diff --git a/includes/sweepers.php b/includes/sweepers.php index b3fcf53..9d5263a 100644 --- a/includes/sweepers.php +++ b/includes/sweepers.php @@ -53,13 +53,23 @@ function sweep_posts() { $post_types = array_keys( get_post_types( array( - 'public' => true, '_builtin' => false, ) ) ); array_unshift( $post_types, 'post' ); + $ignore_post_types = array( + 'acf-field-group', + 'acf-field', + ); + foreach ( $ignore_post_types as $post_type ) { + $key = array_search( $post_type, $post_types ); + if ( false !== $key ) { + unset( $post_types[ $key ] ); + } + } + foreach ( $post_types as $post_type ) { sweep_post_type( $post_type ); } @@ -90,7 +100,6 @@ function sweep_menu_cache() { function sweep_taxonomy() { $taxonomies = get_taxonomies( array( - 'public' => true, '_builtin' => false, ) ); diff --git a/includes/utils/class-arrayhelpers.php b/includes/utils/class-arrayhelpers.php index 782f9e8..95272ed 100644 --- a/includes/utils/class-arrayhelpers.php +++ b/includes/utils/class-arrayhelpers.php @@ -68,12 +68,11 @@ public static function convert_false_to_null( array $array ) { array_walk_recursive( $array, function( &$value, $key ) { - $ignore_keys = array( - 'enable' + 'enable', ); - if ( !in_array( $key, $ignore_keys ) && false === $value ) { + if ( ! in_array( $key, $ignore_keys ) && false === $value ) { $value = null; } diff --git a/includes/utils/class-inlinesvg.php b/includes/utils/class-inlinesvg.php index 982b4b9..a4248d5 100644 --- a/includes/utils/class-inlinesvg.php +++ b/includes/utils/class-inlinesvg.php @@ -23,7 +23,7 @@ class InlineSVG { public static function remote( $remote_url ) { $file_contents = file_get_contents( $remote_url ); $headers = FileHelpers::parse_headers( $http_response_header ); - if ( 'gzip' === $headers['Content-Encoding'] ) { + if ( isset( $headers['Content-Encoding'] ) && 'gzip' === $headers['Content-Encoding'] ) { $file_contents = gzinflate( substr( $file_contents, 10, -8 ) ); } return $file_contents; diff --git a/includes/utils/fields.php b/includes/utils/fields.php index 5a10633..3f4159f 100644 --- a/includes/utils/fields.php +++ b/includes/utils/fields.php @@ -70,19 +70,27 @@ function register_layout( $type, $layout ) { * * @since 0.1.0 * @param string $type The type of layout (component or feature). - * @param Array $group The top-level group config. - * @param Array $fields The fields config. - * @param Array $location The location config. + * @param Array $config The top-level group config. */ -function register_group( $type, $group, $fields, $location ) { - $config = array( - 'name' => $group['name'], - 'title' => $group['title'], - 'fields' => $fields, +function register_group( $type, $config ) { + if ( isset( $config['location'] ) ) { + $location = $config['location']; + } else { + $location = array(); + } + + $new_config = array( + 'name' => $config['group']['name'], + 'title' => $config['group']['title'], + 'fields' => $config['fields'], 'location' => $location, ); - ACFComposer::registerFieldGroup( $config ); + if ( isset( $config['position'] ) ) { + $new_config['position'] = $config['position']; + } + + ACFComposer::registerFieldGroup( $new_config ); } /** @@ -110,9 +118,7 @@ function register_fields() { if ( isset( $config['config']['group'] ) ) { register_group( $type, - $config['config']['group'], - $config['config']['fields'], - $config['config']['location'] + $config['config'] ); } diff --git a/includes/wp-save-hooks.php b/includes/wp-save-hooks.php index 4566d06..62283b9 100644 --- a/includes/wp-save-hooks.php +++ b/includes/wp-save-hooks.php @@ -25,8 +25,10 @@ * @param boolean $update Whether the post updated or not. */ function wp_insert_post( $id, $obj, $update ) { + $filtered_object = apply_filters( 'ep_insert_post_object_filter', $obj ); + // Skip ACF internals. - if ( ! $update || strpos( $obj->post_type, 'acf-' ) === 0 ) { + if ( $filtered_object->skip_indexing || ! $update || strpos( $obj->post_type, 'acf-' ) === 0 ) { return; } @@ -60,7 +62,8 @@ function acf_save_post( $id = null ) { if ( strpos( $id, 'term_' ) === 0 ) { return; } - Storage\store_options( $id ); + $page = ( isset( $_GET['page'] ) ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : null; + Storage\store_options( $id, $page ); } /** diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 85dee57..e25976a 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -22,6 +22,9 @@ // Give access to test support functions. require_once 'support/nav-menus/functions.php'; +// Yoast has some phpunit-polyfills. +require_once 'vendor/yoast/phpunit-polyfills/phpunitpolyfills-autoload.php'; + /** * Manually load the plugin being tested. */ diff --git a/tests/test-elasticsearch.php b/tests/test-elasticsearch.php index 1cfe158..0909635 100644 --- a/tests/test-elasticsearch.php +++ b/tests/test-elasticsearch.php @@ -149,7 +149,13 @@ public function test_store_options() { Storage\store_options( 'options' ); ElasticSearch\Client::update_read_aliases(); $found = elasticsearch_find( 'globalOptionsComponentSomePage', 'options' ); - $this->assertEquals( $found, array( 'some_data' => 'test' ) ); + $this->assertEquals( + $found, + array( + 'some_data' => 'test', + 'ID' => 'globalOptionsComponentSomePage', + ) + ); } /** diff --git a/tests/test-flexible-content.php b/tests/test-flexible-content.php new file mode 100644 index 0000000..62c2ffb --- /dev/null +++ b/tests/test-flexible-content.php @@ -0,0 +1,99 @@ + 'flex_components', + 'title' => 'Flex Components', + 'fields' => array( + array( + 'name' => 'components', + 'label' => 'Components', + 'type' => 'flexible_content', + 'layouts' => array( + array( + 'name' => 'callout', + 'label' => 'Callout', + 'type' => 'group', + 'layout' => 'block', + 'sub_fields' => array( + array( + 'name' => 'title', + 'label' => 'Title', + 'type' => 'text', + ), + array( + 'name' => 'cta', + 'label' => 'CTA', + 'type' => 'link', + ), + ), + ), + ), + ), + ), + 'location' => array( + array( + array( + 'param' => 'template', + 'operator' => '==', + 'value' => 'flex_components', + ), + ), + ), + ) + ); + } + + /** + * Runs after each test + */ + public function tearDown() { + $uploads_dir = rtrim( sys_get_temp_dir(), '/\\' ) . '/wordpress/wp-content/uploads'; + // Clears uploads so they don't increment. + exec( "rm -rf $uploads_dir/*" ); + } + + /** + * Test default page serialization + */ + public function test_flexible_content_serialization() { + $content = array( + 'post_title' => 'Title', + 'meta_input' => array( + '_wp_page_template' => 'flex_components', + ), + ); + $components = array( + array( + 'title' => 'Test Title', + 'cta' => null, + 'acf_fc_layout' => 'callout', + ), + ); + $page = $this->factory->post->create_and_get( $content ); + update_field( 'field_flex_components_components', $components, $page->ID ); + $result = Serializers\page_data( $page ); + + $this->assertEquals( $result['post_title'], 'Title' ); + $this->assertEquals( $result['components'][0]['title'], 'Test Title' ); + $this->assertEquals( $result['components'][0]['cta'], array() ); + } + +} diff --git a/tests/test-wp-save-hooks.php b/tests/test-wp-save-hooks.php index b08100e..dc5c87e 100644 --- a/tests/test-wp-save-hooks.php +++ b/tests/test-wp-save-hooks.php @@ -62,6 +62,7 @@ public function test_acf_save_post() { $found, array( 'test_option' => 'test', + 'ID' => 'globalOptionsComponentSomeOptionsPage', ) ); } @@ -96,4 +97,47 @@ public function test_wp_update_nav_menu() { $this->assertEquals( $found['menu_items'][0]['url'], 'http://test.com' ); } + /** + * Test ep_skip_indexing filter + */ + public function test_ep_skip_indexing_filter() { + $post_content = array( + 'post_title' => 'This will be indexed', + 'post_type' => 'post', + ); + $skip_post_content = array( + 'post_title' => 'This will not be indexed', + 'post_type' => 'skip_post', + ); + + add_filter( + 'ep_insert_post_object_filter', + function( $object ) { + $skip_indexing = array( + 'skip_post', + ); + if ( in_array( $object->post_type, $skip_indexing ) ) { + $object->skip_indexing = true; + } + return $object; + }, + 10, + 2 + ); + + $post = $this->factory->post->create_and_get( $post_content ); + do_action( 'wp_insert_post', $post->ID, $post, true ); + + $skip_post = $this->factory->post->create_and_get( $skip_post_content ); + do_action( 'wp_insert_post', $skip_post->ID, $skip_post, true ); + + ElasticSearch\Client::update_read_aliases(); + $found_post = elasticsearch_find( $post->ID, 'post' ); + $this->assertEquals( $found_post['post_title'], 'This will be indexed' ); + + $skip_post_exists = get_post( $skip_post->ID ); + // $skip_post_is_not_indexed = elasticsearch_find( $skip_post->ID, 'do_not_index' ); + $this->assertEquals( $skip_post_exists->post_title, 'This will not be indexed' ); + // $this->assertEquals( $skip_is_not_indexed, 'This will not be indexed' ); + } }