Changeset 2425433
- Timestamp:
- 11/25/2020 08:37:39 AM (5 years ago)
- Location:
- add-wpgraphql-seo
- Files:
-
- 6 added
- 12 edited
- 1 copied
-
tags/4.9.0 (copied) (copied from add-wpgraphql-seo/trunk)
-
tags/4.9.0/.vscode (added)
-
tags/4.9.0/.vscode/settings.json (added)
-
tags/4.9.0/CHANGELOG.md (modified) (23 diffs)
-
tags/4.9.0/composer.json (modified) (1 diff)
-
tags/4.9.0/composer.lock (modified) (4 diffs)
-
tags/4.9.0/package.json (modified) (1 diff)
-
tags/4.9.0/phpcs.xml (added)
-
tags/4.9.0/readme.txt (modified) (1 diff)
-
tags/4.9.0/wp-graphql-yoast-seo.php (modified) (3 diffs)
-
trunk/.vscode (added)
-
trunk/.vscode/settings.json (added)
-
trunk/CHANGELOG.md (modified) (23 diffs)
-
trunk/composer.json (modified) (1 diff)
-
trunk/composer.lock (modified) (4 diffs)
-
trunk/package.json (modified) (1 diff)
-
trunk/phpcs.xml (added)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/wp-graphql-yoast-seo.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
add-wpgraphql-seo/tags/4.9.0/CHANGELOG.md
r2395101 r2425433 6 6 and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 7 7 8 ## [4.9.0] - 2020-11-25 9 10 ### Added 11 12 - Coding standards (thanks @henrikwirth and @oriooctopus) 13 14 ### Changes 15 16 - Fixes null images from open graph 17 8 18 ## [4.8.0] - 2020-10-07 9 19 10 20 ### Added 11 21 12 - Added support for content type config22 - Added support for content type config 13 23 14 24 ## [4.7.1] - 2020-10-04 … … 16 26 ### Changes 17 27 18 - Fix categories28 - Fix categories 19 29 20 30 ## [4.7.0] - 2020-10-03 … … 22 32 ### Added 23 33 24 - Primary Category to edge.34 - Primary Category to edge. 25 35 26 36 ## [4.6.0] - 2020-09-08 … … 28 38 ### Added 29 39 30 - New Schema fields:31 -pageType32 -articleType33 - Added cornerstone flag34 35 ### Changed 36 37 - Changed Type used on Post Types and Taxonomies from `SEO` to `PostTypeSEO` and `TaxonomySEO`40 - New Schema fields: 41 - pageType 42 - articleType 43 - Added cornerstone flag 44 45 ### Changed 46 47 - Changed Type used on Post Types and Taxonomies from `SEO` to `PostTypeSEO` and `TaxonomySEO` 38 48 39 49 ## [4.5.5] - 2020-08-20 … … 41 51 ### Changed 42 52 43 - Updated readme.txt and readme.md for consistency and display issues.53 - Updated readme.txt and readme.md for consistency and display issues. 44 54 45 55 ## [4.5.4] - 2020-08-19 … … 47 57 ### Changed 48 58 49 - Readme.md update59 - Readme.md update 50 60 51 61 ## [4.5.3] - 2020-08-19 … … 53 63 ### Changed 54 64 55 - Build65 - Build 56 66 57 67 ## [4.5.2] - 2020-08-19 … … 59 69 ### Changed 60 70 61 - Build62 63 ### Added 64 65 - Added logos for WordPress66 67 ### Changed 68 69 - Changed Plugin Name: property to comply with WordPress.org71 - Build 72 73 ### Added 74 75 - Added logos for WordPress 76 77 ### Changed 78 79 - Changed Plugin Name: property to comply with WordPress.org 70 80 71 81 ## [4.5.1] - 2020-07-28 … … 73 83 ### Added 74 84 75 - Added inLanguage to Schema76 - Added function to tidy strings before returning77 78 ### Changed 79 80 - Changed Composer to note require dependency plugins but suggest them, to fix issues with MU Plugins85 - Added inLanguage to Schema 86 - Added function to tidy strings before returning 87 88 ### Changed 89 90 - Changed Composer to note require dependency plugins but suggest them, to fix issues with MU Plugins 81 91 82 92 ## [4.5.0] - 2020-07-13 … … 84 94 ### Added 85 95 86 - Added Frontpage and default openGraph Image96 - Added Frontpage and default openGraph Image 87 97 88 98 ## [4.4.1] - 2020-07-05 … … 90 100 ### Changed 91 101 92 - Fixes MU plugin issue and HTML entities in taxonomy titles102 - Fixes MU plugin issue and HTML entities in taxonomy titles 93 103 94 104 ## [4.4.0] - 2020-07-02 … … 96 106 ### Added 97 107 98 - Adds support for Author / User Metadata99 100 ### Changed 101 102 - Missing returns added, to avoid PHP notices - Thanks @jonshipman108 - Adds support for Author / User Metadata 109 110 ### Changed 111 112 - Missing returns added, to avoid PHP notices - Thanks @jonshipman 103 113 104 114 ## [4.3.0] - 2020-06-24 … … 106 116 ### Added 107 117 108 - Adds support for redirects (Yoast Premium)118 - Adds support for redirects (Yoast Premium) 109 119 110 120 ## [4.2.0] - 2020-06-15 … … 112 122 ### Added 113 123 114 - Adds check for dependencies124 - Adds check for dependencies 115 125 116 126 ## [4.1.0] - 2020-05-06 … … 118 128 ### Added 119 129 120 - Page / Tax SEO - opengraphUrl, opengraphSiteName, opengraphPublishedTime, opengraphModifiedTime - Thanks @izzygld121 - Global SEO > Schema - siteName, wordpressSiteName, siteUrl - Thanks @izzygld122 - Contributor Images added to readme130 - Page / Tax SEO - opengraphUrl, opengraphSiteName, opengraphPublishedTime, opengraphModifiedTime - Thanks @izzygld 131 - Global SEO > Schema - siteName, wordpressSiteName, siteUrl - Thanks @izzygld 132 - Contributor Images added to readme 123 133 124 134 ## [4.0.1] - 2020-05-03 … … 126 136 ### Added 127 137 128 - Support for Yoast 14129 - Breadcrumbs for post type and taxonomies130 - canonical url for post type and taxonomies138 - Support for Yoast 14 139 - Breadcrumbs for post type and taxonomies 140 - canonical url for post type and taxonomies 131 141 132 142 ## [3.3.0] - 2020-04-01 … … 136 146 Support for Yoast configuration data including: 137 147 138 - Webmaster verification139 - Social profiles140 - Schemas141 - Breadcrumbs (global config)148 - Webmaster verification 149 - Social profiles 150 - Schemas 151 - Breadcrumbs (global config) 142 152 143 153 ## [3.2.0] - 2020-03-09 … … 157 167 ### Changed 158 168 159 - BREAKING CHANGE - image urls are now returned as `mediaItem` type.160 This applies to `twitterImage` and `opengraphImage`169 - BREAKING CHANGE - image urls are now returned as `mediaItem` type. 170 This applies to `twitterImage` and `opengraphImage` 161 171 162 172 ## [2.1.1] - 2019-12-01 … … 164 174 ### Changed 165 175 166 - Update composer176 - Update composer 167 177 168 178 ## [2.1.0] - 2019-12-01 … … 170 180 ### Changed 171 181 172 - Fixed term data182 - Fixed term data 173 183 174 184 ## [2.1.0] - 2019-11-11 … … 176 186 ### Added 177 187 178 - Ability to query taxonomies for SEO data.179 - LICENSE file added188 - Ability to query taxonomies for SEO data. 189 - LICENSE file added 180 190 181 191 ## [2.1.0] - 2019-11-01 … … 183 193 ### Added 184 194 185 - Composer.json file added.195 - Composer.json file added. 186 196 187 197 ## [2.0.0] - 2019-07-08 … … 189 199 ### Changed 190 200 191 - Generated Meta title and descriptions201 - Generated Meta title and descriptions -
add-wpgraphql-seo/tags/4.9.0/composer.json
r2365209 r2425433 13 13 "wp-graphql/wp-graphql": "Required to return data via GraphQl", 14 14 "yoast/wordpress-seo": "Required to provide SEO data to this plugin" 15 }, 16 "require-dev": { 17 "automattic/vipwpcs": "^2.2", 18 "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", 19 "squizlabs/php_codesniffer": "^3.5" 20 }, 21 "require": { 22 "phpcompatibility/phpcompatibility-wp": "^2.1" 15 23 } 16 24 } -
add-wpgraphql-seo/tags/4.9.0/composer.lock
r2365209 r2425433 2 2 "_readme": [ 3 3 "This file locks the dependencies of your project to a known state", 4 "Read more about it at https://getcomposer.org/doc/01-basic-usage.md# composer-lock-the-lock-file",4 "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", 5 5 "This file is @generated automatically" 6 6 ], 7 "content-hash": " 12879d3de27da71da541e4eef19f0445",7 "content-hash": "aa0bc8e95c40b5f41d3301f1985c9db5", 8 8 "packages": [ 9 9 { 10 "name": "composer/installers", 11 "version": "v1.9.0", 12 "source": { 13 "type": "git", 14 "url": "https://github.com/composer/installers.git", 15 "reference": "b93bcf0fa1fccb0b7d176b0967d969691cd74cca" 16 }, 17 "dist": { 18 "type": "zip", 19 "url": "https://api.github.com/repos/composer/installers/zipball/b93bcf0fa1fccb0b7d176b0967d969691cd74cca", 20 "reference": "b93bcf0fa1fccb0b7d176b0967d969691cd74cca", 21 "shasum": "" 22 }, 23 "require": { 24 "composer-plugin-api": "^1.0 || ^2.0" 25 }, 26 "replace": { 27 "roundcube/plugin-installer": "*", 28 "shama/baton": "*" 29 }, 30 "require-dev": { 31 "composer/composer": "1.6.* || 2.0.*@dev", 32 "composer/semver": "1.0.* || 2.0.*@dev", 33 "phpunit/phpunit": "^4.8.36", 34 "sebastian/comparator": "^1.2.4", 35 "symfony/process": "^2.3" 36 }, 37 "type": "composer-plugin", 38 "extra": { 39 "class": "Composer\\Installers\\Plugin", 40 "branch-alias": { 41 "dev-master": "1.0-dev" 42 } 43 }, 44 "autoload": { 45 "psr-4": { 46 "Composer\\Installers\\": "src/Composer/Installers" 47 } 48 }, 49 "notification-url": "https://packagist.org/downloads/", 50 "license": [ 51 "MIT" 52 ], 53 "authors": [ 54 { 55 "name": "Kyle Robinson Young", 56 "email": "kyle@dontkry.com", 57 "homepage": "https://github.com/shama" 58 } 59 ], 60 "description": "A multi-framework Composer library installer", 61 "homepage": "https://composer.github.io/installers/", 62 "keywords": [ 63 "Craft", 64 "Dolibarr", 65 "Eliasis", 66 "Hurad", 67 "ImageCMS", 68 "Kanboard", 69 "Lan Management System", 70 "MODX Evo", 71 "MantisBT", 72 "Mautic", 73 "Maya", 74 "OXID", 75 "Plentymarkets", 76 "Porto", 77 "RadPHP", 78 "SMF", 79 "Thelia", 80 "Whmcs", 81 "WolfCMS", 82 "agl", 83 "aimeos", 84 "annotatecms", 85 "attogram", 86 "bitrix", 87 "cakephp", 88 "chef", 89 "cockpit", 90 "codeigniter", 91 "concrete5", 92 "croogo", 93 "dokuwiki", 94 "drupal", 95 "eZ Platform", 96 "elgg", 97 "expressionengine", 98 "fuelphp", 99 "grav", 100 "installer", 101 "itop", 102 "joomla", 103 "known", 104 "kohana", 105 "laravel", 106 "lavalite", 107 "lithium", 108 "magento", 109 "majima", 110 "mako", 111 "mediawiki", 112 "modulework", 113 "modx", 114 "moodle", 115 "osclass", 116 "phpbb", 117 "piwik", 118 "ppi", 119 "puppet", 120 "pxcms", 121 "reindex", 122 "roundcube", 123 "shopware", 124 "silverstripe", 125 "sydes", 126 "sylius", 127 "symfony", 128 "typo3", 129 "wordpress", 130 "yawik", 131 "zend", 132 "zikula" 133 ], 134 "time": "2020-04-07T06:57:05+00:00" 135 }, 136 { 137 "name": "guzzlehttp/guzzle", 138 "version": "6.5.5", 139 "source": { 140 "type": "git", 141 "url": "https://github.com/guzzle/guzzle.git", 142 "reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e" 143 }, 144 "dist": { 145 "type": "zip", 146 "url": "https://api.github.com/repos/guzzle/guzzle/zipball/9d4290de1cfd701f38099ef7e183b64b4b7b0c5e", 147 "reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e", 148 "shasum": "" 149 }, 150 "require": { 151 "ext-json": "*", 152 "guzzlehttp/promises": "^1.0", 153 "guzzlehttp/psr7": "^1.6.1", 154 "php": ">=5.5", 155 "symfony/polyfill-intl-idn": "^1.17.0" 156 }, 157 "require-dev": { 158 "ext-curl": "*", 159 "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", 160 "psr/log": "^1.1" 10 "name": "phpcompatibility/php-compatibility", 11 "version": "9.3.5", 12 "source": { 13 "type": "git", 14 "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", 15 "reference": "9fb324479acf6f39452e0655d2429cc0d3914243" 16 }, 17 "dist": { 18 "type": "zip", 19 "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243", 20 "reference": "9fb324479acf6f39452e0655d2429cc0d3914243", 21 "shasum": "" 22 }, 23 "require": { 24 "php": ">=5.3", 25 "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" 26 }, 27 "conflict": { 28 "squizlabs/php_codesniffer": "2.6.2" 29 }, 30 "require-dev": { 31 "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" 161 32 }, 162 33 "suggest": { 163 "psr/log": "Required for using the Log middleware" 164 }, 34 "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.", 35 "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." 36 }, 37 "type": "phpcodesniffer-standard", 38 "notification-url": "https://packagist.org/downloads/", 39 "license": [ 40 "LGPL-3.0-or-later" 41 ], 42 "authors": [ 43 { 44 "name": "Wim Godden", 45 "homepage": "https://github.com/wimg", 46 "role": "lead" 47 }, 48 { 49 "name": "Juliette Reinders Folmer", 50 "homepage": "https://github.com/jrfnl", 51 "role": "lead" 52 }, 53 { 54 "name": "Contributors", 55 "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors" 56 } 57 ], 58 "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.", 59 "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", 60 "keywords": [ 61 "compatibility", 62 "phpcs", 63 "standards" 64 ], 65 "time": "2019-12-27T09:44:58+00:00" 66 }, 67 { 68 "name": "phpcompatibility/phpcompatibility-paragonie", 69 "version": "1.3.0", 70 "source": { 71 "type": "git", 72 "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git", 73 "reference": "b862bc32f7e860d0b164b199bd995e690b4b191c" 74 }, 75 "dist": { 76 "type": "zip", 77 "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/b862bc32f7e860d0b164b199bd995e690b4b191c", 78 "reference": "b862bc32f7e860d0b164b199bd995e690b4b191c", 79 "shasum": "" 80 }, 81 "require": { 82 "phpcompatibility/php-compatibility": "^9.0" 83 }, 84 "require-dev": { 85 "dealerdirect/phpcodesniffer-composer-installer": "^0.5", 86 "paragonie/random_compat": "dev-master", 87 "paragonie/sodium_compat": "dev-master" 88 }, 89 "suggest": { 90 "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", 91 "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." 92 }, 93 "type": "phpcodesniffer-standard", 94 "notification-url": "https://packagist.org/downloads/", 95 "license": [ 96 "LGPL-3.0-or-later" 97 ], 98 "authors": [ 99 { 100 "name": "Wim Godden", 101 "role": "lead" 102 }, 103 { 104 "name": "Juliette Reinders Folmer", 105 "role": "lead" 106 } 107 ], 108 "description": "A set of rulesets for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by the Paragonie polyfill libraries.", 109 "homepage": "http://phpcompatibility.com/", 110 "keywords": [ 111 "compatibility", 112 "paragonie", 113 "phpcs", 114 "polyfill", 115 "standards" 116 ], 117 "time": "2019-11-04T15:17:54+00:00" 118 }, 119 { 120 "name": "phpcompatibility/phpcompatibility-wp", 121 "version": "2.1.0", 122 "source": { 123 "type": "git", 124 "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git", 125 "reference": "41bef18ba688af638b7310666db28e1ea9158b2f" 126 }, 127 "dist": { 128 "type": "zip", 129 "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/41bef18ba688af638b7310666db28e1ea9158b2f", 130 "reference": "41bef18ba688af638b7310666db28e1ea9158b2f", 131 "shasum": "" 132 }, 133 "require": { 134 "phpcompatibility/php-compatibility": "^9.0", 135 "phpcompatibility/phpcompatibility-paragonie": "^1.0" 136 }, 137 "require-dev": { 138 "dealerdirect/phpcodesniffer-composer-installer": "^0.5" 139 }, 140 "suggest": { 141 "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", 142 "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." 143 }, 144 "type": "phpcodesniffer-standard", 145 "notification-url": "https://packagist.org/downloads/", 146 "license": [ 147 "LGPL-3.0-or-later" 148 ], 149 "authors": [ 150 { 151 "name": "Wim Godden", 152 "role": "lead" 153 }, 154 { 155 "name": "Juliette Reinders Folmer", 156 "role": "lead" 157 } 158 ], 159 "description": "A ruleset for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by WordPress.", 160 "homepage": "http://phpcompatibility.com/", 161 "keywords": [ 162 "compatibility", 163 "phpcs", 164 "standards", 165 "wordpress" 166 ], 167 "time": "2019-08-28T14:22:28+00:00" 168 }, 169 { 170 "name": "squizlabs/php_codesniffer", 171 "version": "3.5.8", 172 "source": { 173 "type": "git", 174 "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", 175 "reference": "9d583721a7157ee997f235f327de038e7ea6dac4" 176 }, 177 "dist": { 178 "type": "zip", 179 "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/9d583721a7157ee997f235f327de038e7ea6dac4", 180 "reference": "9d583721a7157ee997f235f327de038e7ea6dac4", 181 "shasum": "" 182 }, 183 "require": { 184 "ext-simplexml": "*", 185 "ext-tokenizer": "*", 186 "ext-xmlwriter": "*", 187 "php": ">=5.4.0" 188 }, 189 "require-dev": { 190 "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" 191 }, 192 "bin": [ 193 "bin/phpcs", 194 "bin/phpcbf" 195 ], 165 196 "type": "library", 166 197 "extra": { 167 198 "branch-alias": { 168 "dev-master": "6.5-dev" 169 } 199 "dev-master": "3.x-dev" 200 } 201 }, 202 "notification-url": "https://packagist.org/downloads/", 203 "license": [ 204 "BSD-3-Clause" 205 ], 206 "authors": [ 207 { 208 "name": "Greg Sherwood", 209 "role": "lead" 210 } 211 ], 212 "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", 213 "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", 214 "keywords": [ 215 "phpcs", 216 "standards" 217 ], 218 "time": "2020-10-23T02:01:07+00:00" 219 } 220 ], 221 "packages-dev": [ 222 { 223 "name": "automattic/vipwpcs", 224 "version": "2.2.0", 225 "source": { 226 "type": "git", 227 "url": "https://github.com/Automattic/VIP-Coding-Standards.git", 228 "reference": "4d0612461232b313d06321f1501c3989bd6aecf9" 229 }, 230 "dist": { 231 "type": "zip", 232 "url": "https://api.github.com/repos/Automattic/VIP-Coding-Standards/zipball/4d0612461232b313d06321f1501c3989bd6aecf9", 233 "reference": "4d0612461232b313d06321f1501c3989bd6aecf9", 234 "shasum": "" 235 }, 236 "require": { 237 "php": ">=5.4", 238 "sirbrillig/phpcs-variable-analysis": "^2.8.3", 239 "squizlabs/php_codesniffer": "^3.5.5", 240 "wp-coding-standards/wpcs": "^2.3" 241 }, 242 "require-dev": { 243 "dealerdirect/phpcodesniffer-composer-installer": "^0.7", 244 "phpcompatibility/php-compatibility": "^9", 245 "phpunit/phpunit": "^4 || ^5 || ^6 || ^7" 246 }, 247 "suggest": { 248 "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will manage the PHPCS 'installed_paths' automatically." 249 }, 250 "type": "phpcodesniffer-standard", 251 "notification-url": "https://packagist.org/downloads/", 252 "license": [ 253 "MIT" 254 ], 255 "authors": [ 256 { 257 "name": "Contributors", 258 "homepage": "https://github.com/Automattic/VIP-Coding-Standards/graphs/contributors" 259 } 260 ], 261 "description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress VIP minimum coding conventions", 262 "keywords": [ 263 "phpcs", 264 "standards", 265 "wordpress" 266 ], 267 "time": "2020-09-07T10:45:45+00:00" 268 }, 269 { 270 "name": "dealerdirect/phpcodesniffer-composer-installer", 271 "version": "v0.7.0", 272 "source": { 273 "type": "git", 274 "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", 275 "reference": "e8d808670b8f882188368faaf1144448c169c0b7" 276 }, 277 "dist": { 278 "type": "zip", 279 "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/e8d808670b8f882188368faaf1144448c169c0b7", 280 "reference": "e8d808670b8f882188368faaf1144448c169c0b7", 281 "shasum": "" 282 }, 283 "require": { 284 "composer-plugin-api": "^1.0 || ^2.0", 285 "php": ">=5.3", 286 "squizlabs/php_codesniffer": "^2 || ^3 || 4.0.x-dev" 287 }, 288 "require-dev": { 289 "composer/composer": "*", 290 "phpcompatibility/php-compatibility": "^9.0", 291 "sensiolabs/security-checker": "^4.1.0" 292 }, 293 "type": "composer-plugin", 294 "extra": { 295 "class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" 170 296 }, 171 297 "autoload": { 172 298 "psr-4": { 173 "GuzzleHttp\\": "src/" 174 }, 175 "files": [ 176 "src/functions_include.php" 177 ] 299 "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" 300 } 178 301 }, 179 302 "notification-url": "https://packagist.org/downloads/", … … 183 306 "authors": [ 184 307 { 185 "name": "Michael Dowling", 186 "email": "mtdowling@gmail.com", 187 "homepage": "https://github.com/mtdowling" 188 } 189 ], 190 "description": "Guzzle is a PHP HTTP client library", 191 "homepage": "http://guzzlephp.org/", 192 "keywords": [ 193 "client", 194 "curl", 195 "framework", 196 "http", 197 "http client", 198 "rest", 199 "web service" 200 ], 201 "time": "2020-06-16T21:01:06+00:00" 202 }, 203 { 204 "name": "guzzlehttp/promises", 205 "version": "v1.3.1", 206 "source": { 207 "type": "git", 208 "url": "https://github.com/guzzle/promises.git", 209 "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" 210 }, 211 "dist": { 212 "type": "zip", 213 "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", 214 "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", 215 "shasum": "" 216 }, 217 "require": { 218 "php": ">=5.5.0" 219 }, 220 "require-dev": { 221 "phpunit/phpunit": "^4.0" 222 }, 223 "type": "library", 224 "extra": { 225 "branch-alias": { 226 "dev-master": "1.4-dev" 227 } 228 }, 308 "name": "Franck Nijhof", 309 "email": "franck.nijhof@dealerdirect.com", 310 "homepage": "http://www.frenck.nl", 311 "role": "Developer / IT Manager" 312 } 313 ], 314 "description": "PHP_CodeSniffer Standards Composer Installer Plugin", 315 "homepage": "http://www.dealerdirect.com", 316 "keywords": [ 317 "PHPCodeSniffer", 318 "PHP_CodeSniffer", 319 "code quality", 320 "codesniffer", 321 "composer", 322 "installer", 323 "phpcs", 324 "plugin", 325 "qa", 326 "quality", 327 "standard", 328 "standards", 329 "style guide", 330 "stylecheck", 331 "tests" 332 ], 333 "time": "2020-06-25T14:57:39+00:00" 334 }, 335 { 336 "name": "sirbrillig/phpcs-variable-analysis", 337 "version": "v2.9.0", 338 "source": { 339 "type": "git", 340 "url": "https://github.com/sirbrillig/phpcs-variable-analysis.git", 341 "reference": "ff54d4ec7f2bd152d526fdabfeff639aa9b8be01" 342 }, 343 "dist": { 344 "type": "zip", 345 "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/ff54d4ec7f2bd152d526fdabfeff639aa9b8be01", 346 "reference": "ff54d4ec7f2bd152d526fdabfeff639aa9b8be01", 347 "shasum": "" 348 }, 349 "require": { 350 "php": ">=5.4.0", 351 "squizlabs/php_codesniffer": "^3.1" 352 }, 353 "require-dev": { 354 "dealerdirect/phpcodesniffer-composer-installer": "^0.4.4 || ^0.5 || ^0.6", 355 "limedeck/phpunit-detailed-printer": "^3.1 || ^4.0 || ^5.0", 356 "phpstan/phpstan": "^0.11.8", 357 "phpunit/phpunit": "^5.0 || ^6.5 || ^7.0 || ^8.0", 358 "sirbrillig/phpcs-import-detection": "^1.1" 359 }, 360 "type": "phpcodesniffer-standard", 229 361 "autoload": { 230 362 "psr-4": { 231 "GuzzleHttp\\Promise\\": "src/" 363 "VariableAnalysis\\": "VariableAnalysis/" 364 } 365 }, 366 "notification-url": "https://packagist.org/downloads/", 367 "license": [ 368 "BSD-2-Clause" 369 ], 370 "authors": [ 371 { 372 "name": "Sam Graham", 373 "email": "php-codesniffer-variableanalysis@illusori.co.uk" 232 374 }, 233 "files": [ 234 "src/functions_include.php" 235 ] 236 }, 375 { 376 "name": "Payton Swick", 377 "email": "payton@foolord.com" 378 } 379 ], 380 "description": "A PHPCS sniff to detect problems with variables.", 381 "time": "2020-10-07T23:32:29+00:00" 382 }, 383 { 384 "name": "wp-coding-standards/wpcs", 385 "version": "2.3.0", 386 "source": { 387 "type": "git", 388 "url": "https://github.com/WordPress/WordPress-Coding-Standards.git", 389 "reference": "7da1894633f168fe244afc6de00d141f27517b62" 390 }, 391 "dist": { 392 "type": "zip", 393 "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/7da1894633f168fe244afc6de00d141f27517b62", 394 "reference": "7da1894633f168fe244afc6de00d141f27517b62", 395 "shasum": "" 396 }, 397 "require": { 398 "php": ">=5.4", 399 "squizlabs/php_codesniffer": "^3.3.1" 400 }, 401 "require-dev": { 402 "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || ^0.6", 403 "phpcompatibility/php-compatibility": "^9.0", 404 "phpcsstandards/phpcsdevtools": "^1.0", 405 "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" 406 }, 407 "suggest": { 408 "dealerdirect/phpcodesniffer-composer-installer": "^0.6 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically." 409 }, 410 "type": "phpcodesniffer-standard", 237 411 "notification-url": "https://packagist.org/downloads/", 238 412 "license": [ … … 241 415 "authors": [ 242 416 { 243 "name": "Michael Dowling", 244 "email": "mtdowling@gmail.com", 245 "homepage": "https://github.com/mtdowling" 246 } 247 ], 248 "description": "Guzzle promises library", 249 "keywords": [ 250 "promise" 251 ], 252 "time": "2016-12-20T10:07:11+00:00" 253 }, 254 { 255 "name": "guzzlehttp/psr7", 256 "version": "1.6.1", 257 "source": { 258 "type": "git", 259 "url": "https://github.com/guzzle/psr7.git", 260 "reference": "239400de7a173fe9901b9ac7c06497751f00727a" 261 }, 262 "dist": { 263 "type": "zip", 264 "url": "https://api.github.com/repos/guzzle/psr7/zipball/239400de7a173fe9901b9ac7c06497751f00727a", 265 "reference": "239400de7a173fe9901b9ac7c06497751f00727a", 266 "shasum": "" 267 }, 268 "require": { 269 "php": ">=5.4.0", 270 "psr/http-message": "~1.0", 271 "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" 272 }, 273 "provide": { 274 "psr/http-message-implementation": "1.0" 275 }, 276 "require-dev": { 277 "ext-zlib": "*", 278 "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8" 279 }, 280 "suggest": { 281 "zendframework/zend-httphandlerrunner": "Emit PSR-7 responses" 282 }, 283 "type": "library", 284 "extra": { 285 "branch-alias": { 286 "dev-master": "1.6-dev" 287 } 288 }, 289 "autoload": { 290 "psr-4": { 291 "GuzzleHttp\\Psr7\\": "src/" 292 }, 293 "files": [ 294 "src/functions_include.php" 295 ] 296 }, 297 "notification-url": "https://packagist.org/downloads/", 298 "license": [ 299 "MIT" 300 ], 301 "authors": [ 302 { 303 "name": "Michael Dowling", 304 "email": "mtdowling@gmail.com", 305 "homepage": "https://github.com/mtdowling" 306 }, 307 { 308 "name": "Tobias Schultze", 309 "homepage": "https://github.com/Tobion" 310 } 311 ], 312 "description": "PSR-7 message implementation that also provides common utility methods", 313 "keywords": [ 314 "http", 315 "message", 316 "psr-7", 317 "request", 318 "response", 319 "stream", 320 "uri", 321 "url" 322 ], 323 "time": "2019-07-01T23:21:34+00:00" 324 }, 325 { 326 "name": "ivome/graphql-relay-php", 327 "version": "v0.3.1", 328 "source": { 329 "type": "git", 330 "url": "https://github.com/ivome/graphql-relay-php.git", 331 "reference": "bc5f8aae9fd72ca16decce3892ec4311e9742a93" 332 }, 333 "dist": { 334 "type": "zip", 335 "url": "https://api.github.com/repos/ivome/graphql-relay-php/zipball/bc5f8aae9fd72ca16decce3892ec4311e9742a93", 336 "reference": "bc5f8aae9fd72ca16decce3892ec4311e9742a93", 337 "shasum": "" 338 }, 339 "require": { 340 "php": ">=5.4,<8.0-DEV", 341 "webonyx/graphql-php": ">=0.7.0" 342 }, 343 "require-dev": { 344 "phpunit/phpunit": "^4.8", 345 "satooshi/php-coveralls": "~1.0" 346 }, 347 "type": "library", 348 "autoload": { 349 "classmap": [ 350 "src/" 351 ] 352 }, 353 "notification-url": "https://packagist.org/downloads/", 354 "license": [ 355 "BSD" 356 ], 357 "description": "A PHP port of GraphQL Relay reference implementation", 358 "homepage": "https://github.com/ivome/graphql-relay-php", 359 "keywords": [ 360 "Relay", 361 "api", 362 "graphql" 363 ], 364 "time": "2016-10-29T23:29:29+00:00" 365 }, 366 { 367 "name": "league/oauth2-client", 368 "version": "2.4.1", 369 "source": { 370 "type": "git", 371 "url": "https://github.com/thephpleague/oauth2-client.git", 372 "reference": "cc114abc622a53af969e8664722e84ca36257530" 373 }, 374 "dist": { 375 "type": "zip", 376 "url": "https://api.github.com/repos/thephpleague/oauth2-client/zipball/cc114abc622a53af969e8664722e84ca36257530", 377 "reference": "cc114abc622a53af969e8664722e84ca36257530", 378 "shasum": "" 379 }, 380 "require": { 381 "guzzlehttp/guzzle": "^6.0", 382 "paragonie/random_compat": "^1|^2|^9.99", 383 "php": "^5.6|^7.0" 384 }, 385 "require-dev": { 386 "eloquent/liberator": "^2.0", 387 "eloquent/phony-phpunit": "^1.0|^3.0", 388 "jakub-onderka/php-parallel-lint": "^0.9.2", 389 "phpunit/phpunit": "^5.7|^6.0", 390 "squizlabs/php_codesniffer": "^2.3|^3.0" 391 }, 392 "type": "library", 393 "extra": { 394 "branch-alias": { 395 "dev-2.x": "2.0.x-dev" 396 } 397 }, 398 "autoload": { 399 "psr-4": { 400 "League\\OAuth2\\Client\\": "src/" 401 } 402 }, 403 "notification-url": "https://packagist.org/downloads/", 404 "license": [ 405 "MIT" 406 ], 407 "authors": [ 408 { 409 "name": "Alex Bilbie", 410 "email": "hello@alexbilbie.com", 411 "homepage": "http://www.alexbilbie.com", 412 "role": "Developer" 413 }, 414 { 415 "name": "Woody Gilk", 416 "homepage": "https://github.com/shadowhand", 417 "role": "Contributor" 418 } 419 ], 420 "description": "OAuth 2.0 Client Library", 421 "keywords": [ 422 "Authentication", 423 "SSO", 424 "authorization", 425 "identity", 426 "idp", 427 "oauth", 428 "oauth2", 429 "single sign on" 430 ], 431 "time": "2018-11-22T18:33:57+00:00" 432 }, 433 { 434 "name": "paragonie/random_compat", 435 "version": "v9.99.99", 436 "source": { 437 "type": "git", 438 "url": "https://github.com/paragonie/random_compat.git", 439 "reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95" 440 }, 441 "dist": { 442 "type": "zip", 443 "url": "https://api.github.com/repos/paragonie/random_compat/zipball/84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95", 444 "reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95", 445 "shasum": "" 446 }, 447 "require": { 448 "php": "^7" 449 }, 450 "require-dev": { 451 "phpunit/phpunit": "4.*|5.*", 452 "vimeo/psalm": "^1" 453 }, 454 "suggest": { 455 "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." 456 }, 457 "type": "library", 458 "notification-url": "https://packagist.org/downloads/", 459 "license": [ 460 "MIT" 461 ], 462 "authors": [ 463 { 464 "name": "Paragon Initiative Enterprises", 465 "email": "security@paragonie.com", 466 "homepage": "https://paragonie.com" 467 } 468 ], 469 "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", 470 "keywords": [ 471 "csprng", 472 "polyfill", 473 "pseudorandom", 474 "random" 475 ], 476 "time": "2018-07-02T15:55:56+00:00" 477 }, 478 { 479 "name": "pimple/pimple", 480 "version": "v3.3.0", 481 "source": { 482 "type": "git", 483 "url": "https://github.com/silexphp/Pimple.git", 484 "reference": "e55d12f9d6a0e7f9c85992b73df1267f46279930" 485 }, 486 "dist": { 487 "type": "zip", 488 "url": "https://api.github.com/repos/silexphp/Pimple/zipball/e55d12f9d6a0e7f9c85992b73df1267f46279930", 489 "reference": "e55d12f9d6a0e7f9c85992b73df1267f46279930", 490 "shasum": "" 491 }, 492 "require": { 493 "php": "^7.2.5", 494 "psr/container": "^1.0" 495 }, 496 "require-dev": { 497 "symfony/phpunit-bridge": "^3.4|^4.4|^5.0" 498 }, 499 "type": "library", 500 "extra": { 501 "branch-alias": { 502 "dev-master": "3.3.x-dev" 503 } 504 }, 505 "autoload": { 506 "psr-0": { 507 "Pimple": "src/" 508 } 509 }, 510 "notification-url": "https://packagist.org/downloads/", 511 "license": [ 512 "MIT" 513 ], 514 "authors": [ 515 { 516 "name": "Fabien Potencier", 517 "email": "fabien@symfony.com" 518 } 519 ], 520 "description": "Pimple, a simple Dependency Injection Container", 521 "homepage": "https://pimple.symfony.com", 522 "keywords": [ 523 "container", 524 "dependency injection" 525 ], 526 "time": "2020-03-03T09:12:48+00:00" 527 }, 528 { 529 "name": "psr/container", 530 "version": "1.0.0", 531 "source": { 532 "type": "git", 533 "url": "https://github.com/php-fig/container.git", 534 "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" 535 }, 536 "dist": { 537 "type": "zip", 538 "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", 539 "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", 540 "shasum": "" 541 }, 542 "require": { 543 "php": ">=5.3.0" 544 }, 545 "type": "library", 546 "extra": { 547 "branch-alias": { 548 "dev-master": "1.0.x-dev" 549 } 550 }, 551 "autoload": { 552 "psr-4": { 553 "Psr\\Container\\": "src/" 554 } 555 }, 556 "notification-url": "https://packagist.org/downloads/", 557 "license": [ 558 "MIT" 559 ], 560 "authors": [ 561 { 562 "name": "PHP-FIG", 563 "homepage": "http://www.php-fig.org/" 564 } 565 ], 566 "description": "Common Container Interface (PHP FIG PSR-11)", 567 "homepage": "https://github.com/php-fig/container", 568 "keywords": [ 569 "PSR-11", 570 "container", 571 "container-interface", 572 "container-interop", 573 "psr" 574 ], 575 "time": "2017-02-14T16:28:37+00:00" 576 }, 577 { 578 "name": "psr/http-message", 579 "version": "1.0.1", 580 "source": { 581 "type": "git", 582 "url": "https://github.com/php-fig/http-message.git", 583 "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" 584 }, 585 "dist": { 586 "type": "zip", 587 "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", 588 "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", 589 "shasum": "" 590 }, 591 "require": { 592 "php": ">=5.3.0" 593 }, 594 "type": "library", 595 "extra": { 596 "branch-alias": { 597 "dev-master": "1.0.x-dev" 598 } 599 }, 600 "autoload": { 601 "psr-4": { 602 "Psr\\Http\\Message\\": "src/" 603 } 604 }, 605 "notification-url": "https://packagist.org/downloads/", 606 "license": [ 607 "MIT" 608 ], 609 "authors": [ 610 { 611 "name": "PHP-FIG", 612 "homepage": "http://www.php-fig.org/" 613 } 614 ], 615 "description": "Common interface for HTTP messages", 616 "homepage": "https://github.com/php-fig/http-message", 617 "keywords": [ 618 "http", 619 "http-message", 620 "psr", 621 "psr-7", 622 "request", 623 "response" 624 ], 625 "time": "2016-08-06T14:39:51+00:00" 626 }, 627 { 628 "name": "psr/log", 629 "version": "1.1.3", 630 "source": { 631 "type": "git", 632 "url": "https://github.com/php-fig/log.git", 633 "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" 634 }, 635 "dist": { 636 "type": "zip", 637 "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", 638 "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", 639 "shasum": "" 640 }, 641 "require": { 642 "php": ">=5.3.0" 643 }, 644 "type": "library", 645 "extra": { 646 "branch-alias": { 647 "dev-master": "1.1.x-dev" 648 } 649 }, 650 "autoload": { 651 "psr-4": { 652 "Psr\\Log\\": "Psr/Log/" 653 } 654 }, 655 "notification-url": "https://packagist.org/downloads/", 656 "license": [ 657 "MIT" 658 ], 659 "authors": [ 660 { 661 "name": "PHP-FIG", 662 "homepage": "http://www.php-fig.org/" 663 } 664 ], 665 "description": "Common interface for logging libraries", 666 "homepage": "https://github.com/php-fig/log", 667 "keywords": [ 668 "log", 669 "psr", 670 "psr-3" 671 ], 672 "time": "2020-03-23T09:12:05+00:00" 673 }, 674 { 675 "name": "ralouphie/getallheaders", 676 "version": "3.0.3", 677 "source": { 678 "type": "git", 679 "url": "https://github.com/ralouphie/getallheaders.git", 680 "reference": "120b605dfeb996808c31b6477290a714d356e822" 681 }, 682 "dist": { 683 "type": "zip", 684 "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", 685 "reference": "120b605dfeb996808c31b6477290a714d356e822", 686 "shasum": "" 687 }, 688 "require": { 689 "php": ">=5.6" 690 }, 691 "require-dev": { 692 "php-coveralls/php-coveralls": "^2.1", 693 "phpunit/phpunit": "^5 || ^6.5" 694 }, 695 "type": "library", 696 "autoload": { 697 "files": [ 698 "src/getallheaders.php" 699 ] 700 }, 701 "notification-url": "https://packagist.org/downloads/", 702 "license": [ 703 "MIT" 704 ], 705 "authors": [ 706 { 707 "name": "Ralph Khattar", 708 "email": "ralph.khattar@gmail.com" 709 } 710 ], 711 "description": "A polyfill for getallheaders.", 712 "time": "2019-03-08T08:55:37+00:00" 713 }, 714 { 715 "name": "symfony/dependency-injection", 716 "version": "v3.4.42", 717 "source": { 718 "type": "git", 719 "url": "https://github.com/symfony/dependency-injection.git", 720 "reference": "e39380b7104b0ec538a075ae919f00c7e5267bac" 721 }, 722 "dist": { 723 "type": "zip", 724 "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/e39380b7104b0ec538a075ae919f00c7e5267bac", 725 "reference": "e39380b7104b0ec538a075ae919f00c7e5267bac", 726 "shasum": "" 727 }, 728 "require": { 729 "php": "^5.5.9|>=7.0.8", 730 "psr/container": "^1.0" 731 }, 732 "conflict": { 733 "symfony/config": "<3.3.7", 734 "symfony/finder": "<3.3", 735 "symfony/proxy-manager-bridge": "<3.4", 736 "symfony/yaml": "<3.4" 737 }, 738 "provide": { 739 "psr/container-implementation": "1.0" 740 }, 741 "require-dev": { 742 "symfony/config": "~3.3|~4.0", 743 "symfony/expression-language": "~2.8|~3.0|~4.0", 744 "symfony/yaml": "~3.4|~4.0" 745 }, 746 "suggest": { 747 "symfony/config": "", 748 "symfony/expression-language": "For using expressions in service container configuration", 749 "symfony/finder": "For using double-star glob patterns or when GLOB_BRACE portability is required", 750 "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", 751 "symfony/yaml": "" 752 }, 753 "type": "library", 754 "extra": { 755 "branch-alias": { 756 "dev-master": "3.4-dev" 757 } 758 }, 759 "autoload": { 760 "psr-4": { 761 "Symfony\\Component\\DependencyInjection\\": "" 762 }, 763 "exclude-from-classmap": [ 764 "/Tests/" 765 ] 766 }, 767 "notification-url": "https://packagist.org/downloads/", 768 "license": [ 769 "MIT" 770 ], 771 "authors": [ 772 { 773 "name": "Fabien Potencier", 774 "email": "fabien@symfony.com" 775 }, 776 { 777 "name": "Symfony Community", 778 "homepage": "https://symfony.com/contributors" 779 } 780 ], 781 "description": "Symfony DependencyInjection Component", 782 "homepage": "https://symfony.com", 783 "time": "2020-05-30T21:06:01+00:00" 784 }, 785 { 786 "name": "symfony/polyfill-intl-idn", 787 "version": "v1.17.1", 788 "source": { 789 "type": "git", 790 "url": "https://github.com/symfony/polyfill-intl-idn.git", 791 "reference": "a57f8161502549a742a63c09f0a604997bf47027" 792 }, 793 "dist": { 794 "type": "zip", 795 "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/a57f8161502549a742a63c09f0a604997bf47027", 796 "reference": "a57f8161502549a742a63c09f0a604997bf47027", 797 "shasum": "" 798 }, 799 "require": { 800 "php": ">=5.3.3", 801 "symfony/polyfill-mbstring": "^1.3", 802 "symfony/polyfill-php72": "^1.10" 803 }, 804 "suggest": { 805 "ext-intl": "For best performance" 806 }, 807 "type": "library", 808 "extra": { 809 "branch-alias": { 810 "dev-master": "1.17-dev" 811 }, 812 "thanks": { 813 "name": "symfony/polyfill", 814 "url": "https://github.com/symfony/polyfill" 815 } 816 }, 817 "autoload": { 818 "psr-4": { 819 "Symfony\\Polyfill\\Intl\\Idn\\": "" 820 }, 821 "files": [ 822 "bootstrap.php" 823 ] 824 }, 825 "notification-url": "https://packagist.org/downloads/", 826 "license": [ 827 "MIT" 828 ], 829 "authors": [ 830 { 831 "name": "Laurent Bassin", 832 "email": "laurent@bassin.info" 833 }, 834 { 835 "name": "Symfony Community", 836 "homepage": "https://symfony.com/contributors" 837 } 838 ], 839 "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", 840 "homepage": "https://symfony.com", 841 "keywords": [ 842 "compatibility", 843 "idn", 844 "intl", 845 "polyfill", 846 "portable", 847 "shim" 848 ], 849 "time": "2020-06-06T08:46:27+00:00" 850 }, 851 { 852 "name": "symfony/polyfill-mbstring", 853 "version": "v1.17.1", 854 "source": { 855 "type": "git", 856 "url": "https://github.com/symfony/polyfill-mbstring.git", 857 "reference": "7110338d81ce1cbc3e273136e4574663627037a7" 858 }, 859 "dist": { 860 "type": "zip", 861 "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/7110338d81ce1cbc3e273136e4574663627037a7", 862 "reference": "7110338d81ce1cbc3e273136e4574663627037a7", 863 "shasum": "" 864 }, 865 "require": { 866 "php": ">=5.3.3" 867 }, 868 "suggest": { 869 "ext-mbstring": "For best performance" 870 }, 871 "type": "library", 872 "extra": { 873 "branch-alias": { 874 "dev-master": "1.17-dev" 875 }, 876 "thanks": { 877 "name": "symfony/polyfill", 878 "url": "https://github.com/symfony/polyfill" 879 } 880 }, 881 "autoload": { 882 "psr-4": { 883 "Symfony\\Polyfill\\Mbstring\\": "" 884 }, 885 "files": [ 886 "bootstrap.php" 887 ] 888 }, 889 "notification-url": "https://packagist.org/downloads/", 890 "license": [ 891 "MIT" 892 ], 893 "authors": [ 894 { 895 "name": "Nicolas Grekas", 896 "email": "p@tchwork.com" 897 }, 898 { 899 "name": "Symfony Community", 900 "homepage": "https://symfony.com/contributors" 901 } 902 ], 903 "description": "Symfony polyfill for the Mbstring extension", 904 "homepage": "https://symfony.com", 905 "keywords": [ 906 "compatibility", 907 "mbstring", 908 "polyfill", 909 "portable", 910 "shim" 911 ], 912 "time": "2020-06-06T08:46:27+00:00" 913 }, 914 { 915 "name": "symfony/polyfill-php72", 916 "version": "v1.17.0", 917 "source": { 918 "type": "git", 919 "url": "https://github.com/symfony/polyfill-php72.git", 920 "reference": "f048e612a3905f34931127360bdd2def19a5e582" 921 }, 922 "dist": { 923 "type": "zip", 924 "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/f048e612a3905f34931127360bdd2def19a5e582", 925 "reference": "f048e612a3905f34931127360bdd2def19a5e582", 926 "shasum": "" 927 }, 928 "require": { 929 "php": ">=5.3.3" 930 }, 931 "type": "library", 932 "extra": { 933 "branch-alias": { 934 "dev-master": "1.17-dev" 935 } 936 }, 937 "autoload": { 938 "psr-4": { 939 "Symfony\\Polyfill\\Php72\\": "" 940 }, 941 "files": [ 942 "bootstrap.php" 943 ] 944 }, 945 "notification-url": "https://packagist.org/downloads/", 946 "license": [ 947 "MIT" 948 ], 949 "authors": [ 950 { 951 "name": "Nicolas Grekas", 952 "email": "p@tchwork.com" 953 }, 954 { 955 "name": "Symfony Community", 956 "homepage": "https://symfony.com/contributors" 957 } 958 ], 959 "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", 960 "homepage": "https://symfony.com", 961 "keywords": [ 962 "compatibility", 963 "polyfill", 964 "portable", 965 "shim" 966 ], 967 "time": "2020-05-12T16:47:27+00:00" 968 }, 969 { 970 "name": "webonyx/graphql-php", 971 "version": "v0.13.8", 972 "source": { 973 "type": "git", 974 "url": "https://github.com/webonyx/graphql-php.git", 975 "reference": "6829ae58f4c59121df1f86915fb9917a2ec595e8" 976 }, 977 "dist": { 978 "type": "zip", 979 "url": "https://api.github.com/repos/webonyx/graphql-php/zipball/6829ae58f4c59121df1f86915fb9917a2ec595e8", 980 "reference": "6829ae58f4c59121df1f86915fb9917a2ec595e8", 981 "shasum": "" 982 }, 983 "require": { 984 "ext-json": "*", 985 "ext-mbstring": "*", 986 "php": "^7.1||^8.0" 987 }, 988 "require-dev": { 989 "doctrine/coding-standard": "^6.0", 990 "phpbench/phpbench": "^0.14.0", 991 "phpstan/phpstan": "^0.11.4", 992 "phpstan/phpstan-phpunit": "^0.11.0", 993 "phpstan/phpstan-strict-rules": "^0.11.0", 994 "phpunit/phpcov": "^5.0", 995 "phpunit/phpunit": "^7.2", 996 "psr/http-message": "^1.0", 997 "react/promise": "2.*" 998 }, 999 "suggest": { 1000 "psr/http-message": "To use standard GraphQL server", 1001 "react/promise": "To leverage async resolving on React PHP platform" 1002 }, 1003 "type": "library", 1004 "autoload": { 1005 "psr-4": { 1006 "GraphQL\\": "src/" 1007 } 1008 }, 1009 "notification-url": "https://packagist.org/downloads/", 1010 "license": [ 1011 "MIT" 1012 ], 1013 "description": "A PHP port of GraphQL reference implementation", 1014 "homepage": "https://github.com/webonyx/graphql-php", 1015 "keywords": [ 1016 "api", 1017 "graphql" 1018 ], 1019 "time": "2019-08-25T10:32:47+00:00" 1020 }, 1021 { 1022 "name": "wp-graphql/wp-graphql", 1023 "version": "v0.10.1", 1024 "source": { 1025 "type": "git", 1026 "url": "https://github.com/wp-graphql/wp-graphql.git", 1027 "reference": "9e3d6dc2ed1a6bc8daedc7ca4c57d135b25ef5d9" 1028 }, 1029 "dist": { 1030 "type": "zip", 1031 "url": "https://api.github.com/repos/wp-graphql/wp-graphql/zipball/9e3d6dc2ed1a6bc8daedc7ca4c57d135b25ef5d9", 1032 "reference": "9e3d6dc2ed1a6bc8daedc7ca4c57d135b25ef5d9", 1033 "shasum": "" 1034 }, 1035 "require": { 1036 "ivome/graphql-relay-php": "0.3.1", 1037 "php": "^7.1||^8.0", 1038 "webonyx/graphql-php": "0.13.8" 1039 }, 1040 "require-dev": { 1041 "codeception/module-asserts": "^1.0", 1042 "codeception/module-cli": "^1.0", 1043 "codeception/module-db": "^1.0", 1044 "codeception/module-filesystem": "^1.0", 1045 "codeception/module-phpbrowser": "^1.0", 1046 "codeception/module-rest": "^1.2", 1047 "codeception/module-webdriver": "^1.0", 1048 "codeception/util-universalframework": "^1.0", 1049 "dealerdirect/phpcodesniffer-composer-installer": "0.5.0", 1050 "lucatume/wp-browser": "^2.4", 1051 "phpcompatibility/phpcompatibility-wp": "2.1.0", 1052 "phpstan/phpstan": "^0.12.25", 1053 "squizlabs/php_codesniffer": "3.5.4", 1054 "szepeviktor/phpstan-wordpress": "^0.5.0", 1055 "wp-coding-standards/wpcs": "2.1.1" 1056 }, 1057 "type": "wordpress-plugin", 1058 "autoload": { 1059 "psr-4": { 1060 "WPGraphQL\\": "src/" 1061 }, 1062 "classmap": [ 1063 "src/" 1064 ] 1065 }, 1066 "notification-url": "https://packagist.org/downloads/", 1067 "license": [ 1068 "GPL-3.0-or-later" 1069 ], 1070 "authors": [ 1071 { 1072 "name": "Jason Bahl", 1073 "email": "jasonbahl@mac.com" 1074 }, 1075 { 1076 "name": "Edwin Cromley" 1077 }, 1078 { 1079 "name": "Ryan Kanner" 1080 }, 1081 { 1082 "name": "Hughie Devore" 1083 }, 1084 { 1085 "name": "Chris Zarate" 1086 } 1087 ], 1088 "description": "GraphQL API for WordPress", 1089 "time": "2020-07-01T04:34:21+00:00" 1090 }, 1091 { 1092 "name": "yoast/i18n-module", 1093 "version": "3.1.1", 1094 "source": { 1095 "type": "git", 1096 "url": "https://github.com/Yoast/i18n-module.git", 1097 "reference": "9d0a2f6daea6fb42376b023e7778294d19edd85d" 1098 }, 1099 "dist": { 1100 "type": "zip", 1101 "url": "https://api.github.com/repos/Yoast/i18n-module/zipball/9d0a2f6daea6fb42376b023e7778294d19edd85d", 1102 "reference": "9d0a2f6daea6fb42376b023e7778294d19edd85d", 1103 "shasum": "" 1104 }, 1105 "require": { 1106 "php": ">=5.2" 1107 }, 1108 "require-dev": { 1109 "roave/security-advisories": "dev-master", 1110 "yoast/yoastcs": "^1.2.2" 1111 }, 1112 "type": "library", 1113 "autoload": { 1114 "classmap": [ 1115 "src/" 1116 ] 1117 }, 1118 "notification-url": "https://packagist.org/downloads/", 1119 "license": [ 1120 "GPL-2.0-or-later" 1121 ], 1122 "authors": [ 1123 { 1124 "name": "Team Yoast", 1125 "email": "support@yoast.com", 1126 "homepage": "https://yoast.com" 1127 } 1128 ], 1129 "description": "Handle i18n for WordPress plugins.", 1130 "homepage": "https://github.com/Yoast/i18n-module", 1131 "keywords": [ 417 "name": "Contributors", 418 "homepage": "https://github.com/WordPress/WordPress-Coding-Standards/graphs/contributors" 419 } 420 ], 421 "description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions", 422 "keywords": [ 423 "phpcs", 424 "standards", 1132 425 "wordpress" 1133 426 ], 1134 "time": "2019-05-07T06:45:05+00:00" 1135 }, 1136 { 1137 "name": "yoast/license-manager", 1138 "version": "1.6.0", 1139 "source": { 1140 "type": "git", 1141 "url": "https://github.com/Yoast/License-Manager.git", 1142 "reference": "fbacabb06d788912fead4f32d0d1d8b9a2d883c9" 1143 }, 1144 "dist": { 1145 "type": "zip", 1146 "url": "https://api.github.com/repos/Yoast/License-Manager/zipball/fbacabb06d788912fead4f32d0d1d8b9a2d883c9", 1147 "reference": "fbacabb06d788912fead4f32d0d1d8b9a2d883c9", 1148 "shasum": "" 1149 }, 1150 "type": "library", 1151 "autoload": { 1152 "classmap": [ 1153 "class-api-request.php", 1154 "class-license-manager.php", 1155 "class-plugin-license-manager.php", 1156 "class-plugin-update-manager.php", 1157 "class-product.php", 1158 "class-theme-license-manager.php", 1159 "class-theme-update-manager.php", 1160 "class-update-manager.php" 1161 ] 1162 }, 1163 "notification-url": "https://packagist.org/downloads/", 1164 "license": [ 1165 "GPL-2.0+" 1166 ], 1167 "authors": [ 1168 { 1169 "name": "Team Yoast", 1170 "email": "support@yoast.com", 1171 "homepage": "https://yoast.com" 1172 } 1173 ], 1174 "description": "Yoast License Manager.", 1175 "homepage": "https://github.com/Yoast/License-Manager", 1176 "keywords": [ 1177 "wordpress" 1178 ], 1179 "time": "2017-08-22T07:59:16+00:00" 1180 }, 1181 { 1182 "name": "yoast/wordpress-seo", 1183 "version": "14.4.1", 1184 "source": { 1185 "type": "git", 1186 "url": "https://github.com/Yoast-dist/wordpress-seo.git", 1187 "reference": "d273b6521e5da5d34537aeaa0e07494c9c1f90cf" 1188 }, 1189 "dist": { 1190 "type": "zip", 1191 "url": "https://api.github.com/repos/Yoast-dist/wordpress-seo/zipball/d273b6521e5da5d34537aeaa0e07494c9c1f90cf", 1192 "reference": "d273b6521e5da5d34537aeaa0e07494c9c1f90cf", 1193 "shasum": "" 1194 }, 1195 "require": { 1196 "composer/installers": "~1.0", 1197 "league/oauth2-client": "^2.4", 1198 "php": "^5.6.20||^7.0", 1199 "pimple/pimple": "^3.2", 1200 "psr/log": "^1.0", 1201 "symfony/dependency-injection": "^3.4", 1202 "yoast/i18n-module": "^3.1.1", 1203 "yoast/license-manager": "1.6.0" 1204 }, 1205 "require-dev": { 1206 "atanamo/php-codeshift": "^1.0", 1207 "brain/monkey": "^2.4", 1208 "humbug/php-scoper": "^0.12.0", 1209 "phpcompatibility/phpcompatibility-wp": "^2.0.0", 1210 "phpunit/phpunit": "^5.7", 1211 "symfony/config": "^3.4", 1212 "yoast/php-development-environment": "^1.0", 1213 "yoast/yoastcs": "~0.4.3" 1214 }, 1215 "type": "wordpress-plugin", 1216 "autoload": { 1217 "classmap": [ 1218 "admin/", 1219 "frontend/", 1220 "inc/", 1221 "deprecated/", 1222 "cli/", 1223 "src/", 1224 "lib/" 1225 ] 1226 }, 1227 "notification-url": "https://packagist.org/downloads/", 1228 "license": [ 1229 "GPL-2.0-or-later" 1230 ], 1231 "authors": [ 1232 { 1233 "name": "Team Yoast", 1234 "email": "support@yoast.com", 1235 "homepage": "https://yoa.st/1--" 1236 } 1237 ], 1238 "description": "Improve your WordPress SEO: Write better content and have a fully optimized WordPress site using the Yoast SEO plugin.", 1239 "homepage": "https://yoa.st/1ui", 1240 "keywords": [ 1241 "seo", 1242 "wordpress" 1243 ], 1244 "time": "2020-06-23T13:11:11+00:00" 427 "time": "2020-05-13T23:57:56+00:00" 1245 428 } 1246 429 ], 1247 "packages-dev": [],1248 430 "aliases": [], 1249 431 "minimum-stability": "stable", … … 1252 434 "prefer-lowest": false, 1253 435 "platform": [], 1254 "platform-dev": [] 436 "platform-dev": [], 437 "plugin-api-version": "1.1.0" 1255 438 } -
add-wpgraphql-seo/tags/4.9.0/package.json
r2365209 r2425433 1 1 { 2 "name": "wp-graphql-yoast-seo", 3 "version": "4.2.0", 4 "description": "A WPGraphQL Extension that adds support for Yoast SEO", 5 "scripts": { 6 "test": "echo \"Error: no test specified\" && exit 1", 7 "prettier": "prettier wp-graphql-yoast-seo.php" 8 }, 9 "repository": { 10 "type": "git", 11 "url": "git+https://github.com/ashhitch/wp-graphql-yoast-seo.git" 12 }, 13 "author": "Ash Hitchcock", 14 "bugs": { 15 "url": "https://github.com/ashhitch/wp-graphql-yoast-seo/issues" 16 }, 17 "homepage": "https://github.com/ashhitch/wp-graphql-yoast-seo#readme", 18 "devDependencies": { 19 "@prettier/plugin-php": "^0.14.2", 20 "husky": ">=4", 21 "lint-staged": ">=10", 22 "prettier": "^2.0.5" 23 }, 24 "husky": { 25 "hooks": { 26 "pre-commit": "lint-staged" 2 "name": "wp-graphql-yoast-seo", 3 "version": "4.2.0", 4 "description": "A WPGraphQL Extension that adds support for Yoast SEO", 5 "scripts": { 6 "test": "echo \"Error: no test specified\" && exit 1", 7 "prettier": "prettier wp-graphql-yoast-seo.php --write" 8 }, 9 "repository": { 10 "type": "git", 11 "url": "git+https://github.com/ashhitch/wp-graphql-yoast-seo.git" 12 }, 13 "author": "Ash Hitchcock", 14 "bugs": { 15 "url": "https://github.com/ashhitch/wp-graphql-yoast-seo/issues" 16 }, 17 "homepage": "https://github.com/ashhitch/wp-graphql-yoast-seo#readme", 18 "devDependencies": { 19 "@prettier/plugin-php": "^0.14.2", 20 "husky": ">=4", 21 "lint-staged": ">=10", 22 "prettier": "^2.0.5" 23 }, 24 "husky": { 25 "hooks": { 26 "pre-commit": "lint-staged" 27 } 28 }, 29 "lint-staged": { 30 "*.{js,css,md,php}": "prettier wp-graphql-yoast-seo.php --write" 27 31 } 28 },29 "lint-staged": {30 "*.{js,css,md,php}": "prettier wp-graphql-yoast-seo.php"31 }32 32 } -
add-wpgraphql-seo/tags/4.9.0/readme.txt
r2395101 r2425433 5 5 Tested up to: 5.4 6 6 Requires PHP: 7.1 7 Stable tag: 4. 8.07 Stable tag: 4.9.0 8 8 License: GPLv3 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html -
add-wpgraphql-seo/tags/4.9.0/wp-graphql-yoast-seo.php
r2395101 r2425433 1 <?php 1 <?php // phpcs:ignore 2 2 3 3 /** … … 9 9 * Text Domain: wp-graphql-yoast-seo 10 10 * Domain Path: /languages 11 * Version: 4. 8.011 * Version: 4.9.0 12 12 * 13 13 * @package WP_Graphql_YOAST_SEO 14 14 */ 15 15 16 if (!defined('ABSPATH')) { 16 exit();17 exit(); 17 18 } 18 19 … … 21 22 22 23 add_action('admin_init', function () { 23 $core_dependencies = [ 24 'WPGraphQL plugin' => class_exists('WPGraphQL'), 25 'Yoast SEO' => function_exists('YoastSEO') 26 ]; 27 28 $missing_dependencies = array_keys(array_diff($core_dependencies, array_filter($core_dependencies))); 29 $display_admin_notice = static function () use ($missing_dependencies) { 30 ?> 31 <div class="notice notice-error"> 32 <p><?php esc_html_e('The WPGraphQL Yoast SEO plugin can\'t be loaded because these dependencies are missing:', 'wp-graphql-yoast-seo'); ?></p> 33 <ul> 34 <?php foreach ($missing_dependencies as $missing_dependency) : ?> 35 <li><?php echo esc_html($missing_dependency); ?></li> 36 <?php endforeach; ?> 37 </ul> 38 </div> 39 <?php 40 }; 41 42 if (!empty($missing_dependencies)) { 43 add_action('network_admin_notices', $display_admin_notice); 44 add_action('admin_notices', $display_admin_notice); 45 46 return; 47 } 24 $core_dependencies = [ 25 'WPGraphQL plugin' => class_exists('WPGraphQL'), 26 'Yoast SEO' => function_exists('YoastSEO'), 27 ]; 28 29 $missing_dependencies = array_keys( 30 array_diff($core_dependencies, array_filter($core_dependencies)) 31 ); 32 $display_admin_notice = static function () use ($missing_dependencies) { 33 ?> 34 <div class="notice notice-error"> 35 <p><?php esc_html_e( 36 'The WPGraphQL Yoast SEO plugin can\'t be loaded because these dependencies are missing:', 37 'wp-graphql-yoast-seo' 38 ); ?> 39 </p> 40 <ul> 41 <?php foreach ($missing_dependencies as $missing_dependency): ?> 42 <li><?php echo esc_html($missing_dependency); ?></li> 43 <?php endforeach; ?> 44 </ul> 45 </div> 46 <?php 47 }; 48 49 if (!empty($missing_dependencies)) { 50 add_action('network_admin_notices', $display_admin_notice); 51 add_action('admin_notices', $display_admin_notice); 52 53 return; 54 } 48 55 }); 49 56 50 57 add_action('graphql_init', function () { 51 if (!function_exists('wp_gql_seo_format_string')) { 52 function wp_gql_seo_format_string($string) 58 if (!function_exists('wp_gql_seo_format_string')) { 59 function wp_gql_seo_format_string($string) 60 { 61 return isset($string) ? trim($string) : null; 62 } 63 } 64 if (!function_exists('wp_gql_seo_get_og_image')) { 65 function wp_gql_seo_get_og_image($images) 66 { 67 if (empty($images)) { 68 return __return_empty_string(); 69 } 70 71 $image = reset($images); 72 73 if (empty($image)) { 74 return __return_empty_string(); 75 } 76 77 if (!isset($image['url'])) { 78 return __return_empty_string(); 79 } 80 // Remove image sizes from url 81 $url = preg_replace( 82 '/(.*)-\d+x\d+\.(jpg|png|gif)$/', 83 '$1.$2', 84 $image['url'] 85 ); 86 return wpcom_vip_attachment_url_to_postid($url); 87 } 88 } 89 if (!function_exists('wp_gql_seo_get_field_key')) { 90 function wp_gql_seo_get_field_key($field_key) 91 { 92 $field_key = lcfirst(preg_replace('[^a-zA-Z0-9 -]', ' ', $field_key)); 93 $field_key = lcfirst(str_replace('_', ' ', ucwords($field_key, '_'))); 94 $field_key = lcfirst(str_replace('-', ' ', ucwords($field_key, '_'))); 95 $field_key = lcfirst(str_replace(' ', '', ucwords($field_key, ' '))); 96 97 return $field_key; 98 } 99 } 100 101 if (!function_exists('wpcom_vip_attachment_url_to_postid')) { 102 function wpcom_vip_attachment_cache_key($url) 103 { 104 return 'wpcom_vip_attachment_url_post_id_' . md5($url); 105 } 106 } 107 108 if (!function_exists('wpcom_vip_attachment_url_to_postid')) { 109 function wpcom_vip_attachment_url_to_postid($url) 110 { 111 $cache_key = wpcom_vip_attachment_cache_key($url); 112 $id = wp_cache_get($cache_key); 113 if (false === $id) { 114 $id = attachment_url_to_postid($url); // phpcs:ignore 115 if (empty($id)) { 116 wp_cache_set( 117 $cache_key, 118 'not_found', 119 'default', 120 12 * HOUR_IN_SECONDS + mt_rand(0, 4 * HOUR_IN_SECONDS) // phpcs:ignore 121 ); 122 } else { 123 wp_cache_set( 124 $cache_key, 125 $id, 126 'default', 127 24 * HOUR_IN_SECONDS + mt_rand(0, 12 * HOUR_IN_SECONDS) // phpcs:ignore 128 ); 129 } 130 } elseif ('not_found' === $id) { 131 return false; 132 } 133 134 return $id; 135 } 136 } 137 138 function wp_gql_seo_build_content_types($types) 53 139 { 54 55 return isset($string) ? trim($string) : null; 140 $carry = []; 141 foreach ($types as $type) { 142 $post_type_object = get_post_type_object($type); 143 if ($post_type_object->graphql_single_name) { 144 $carry[ 145 wp_gql_seo_get_field_key($post_type_object->graphql_single_name) 146 ] = ['type' => 'SEOContentType']; 147 } 148 } 149 return $carry; 56 150 } 57 } 58 if (!function_exists('wp_gql_seo_get_og_image')) { 59 function wp_gql_seo_get_og_image($images) 151 152 function wp_gql_seo_build_content_type_data($types, $all) 60 153 { 61 62 if (empty($images)) { 63 return __return_empty_string(); 64 } 65 66 $image = reset($images); 67 68 if (empty($image)) { 69 return __return_empty_string(); 70 } 71 72 73 if (!isset($image['url'])) { 74 return __return_empty_string(); 75 } 76 77 return attachment_url_to_postid($image['url']); 154 $carry = []; 155 foreach ($types as $type) { 156 $post_type_object = get_post_type_object($type); 157 if ($post_type_object->graphql_single_name) { 158 $tag = wp_gql_seo_get_field_key( 159 $post_type_object->graphql_single_name 160 ); 161 $carry[$tag] = [ 162 'title' => $all['title-' . $tag], 163 'metaDesc' => $all['metadesc-' . $tag], 164 'metaRobotsNoindex' => $all['noindex-' . $tag], 165 'schemaType' => $all['schema-page-type-' . $tag], 166 ]; 167 } 168 } 169 return $carry; 78 170 } 79 } 80 if (!function_exists('wp_gql_seo_get_field_key')) { 81 function wp_gql_seo_get_field_key($field_key) 82 { 83 $field_key = lcfirst(preg_replace('[^a-zA-Z0-9 -]', ' ', $field_key)); 84 $field_key = lcfirst(str_replace('_', ' ', ucwords($field_key, '_'))); 85 $field_key = lcfirst(str_replace('-', ' ', ucwords($field_key, '_'))); 86 $field_key = lcfirst(str_replace(' ', '', ucwords($field_key, ' '))); 87 88 return $field_key; 89 } 90 } 91 92 function wp_gql_seo_build_content_types($types) 93 { 94 $carry = array(); 95 foreach ($types as $type) { 96 97 $post_type_object = get_post_type_object($type); 98 if ($post_type_object->graphql_single_name) { 99 100 $carry[wp_gql_seo_get_field_key($post_type_object->graphql_single_name)] = ['type' => 'SEOContentType']; 101 } 102 } 103 return $carry; 104 } 105 106 function wp_gql_seo_build_content_type_data($types, $all) 107 { 108 $carry = array(); 109 foreach ($types as $type) { 110 $post_type_object = get_post_type_object($type); 111 if ($post_type_object->graphql_single_name) { 112 113 $tag = wp_gql_seo_get_field_key($post_type_object->graphql_single_name); 114 $carry[$tag] = array( 115 'title' => $all['title-' . $tag], 116 'metaDesc' => $all['metadesc-' . $tag], 117 'metaRobotsNoindex' => $all['noindex-' . $tag], 118 'schemaType' => $all['schema-page-type-' . $tag], 119 ); 120 } 121 } 122 return $carry; 123 } 124 125 add_action('graphql_register_types', function () { 126 $post_types = \WPGraphQL::get_allowed_post_types(); 127 $taxonomies = \WPGraphQL::get_allowed_taxonomies(); 128 129 // If WooCommerce installed then add these post types and taxonomies 130 if (class_exists('\WooCommerce')) { 131 array_push($post_types, 'product'); 132 array_push($taxonomies, 'productCategory'); 133 } 134 135 register_graphql_enum_type('SEOCardType', [ 136 'description' => __('Types of cards', 'wp-graphql-yoast-seo'), 137 'values' => [ 138 'summary_large_image' => [ 139 'value' => 'summary_large_image' 140 ], 141 'summary' => [ 142 'value' => 'summary' 143 ], 144 ], 145 ]); 146 147 register_graphql_object_type('SEOPostTypeSchema', [ 148 'description' => __('The Schema types', 'wp-graphql-yoast-seo'), 149 'fields' => [ 150 'pageType' => ['type' => ['list_of' => 'String']], 151 'articleType' => ['type' => ['list_of' => 'String']], 152 ] 153 ]); 154 155 $baseSEOFields = array( 156 'title' => ['type' => 'String'], 157 'metaDesc' => ['type' => 'String'], 158 'focuskw' => ['type' => 'String'], 159 'metaKeywords' => ['type' => 'String'], 160 'metaRobotsNoindex' => ['type' => 'String'], 161 'metaRobotsNofollow' => ['type' => 'String'], 162 'opengraphTitle' => ['type' => 'String'], 163 'opengraphUrl' => ['type' => 'String'], 164 'opengraphSiteName' => ['type' => 'String'], 165 'opengraphType' => ['type' => 'String'], 166 'opengraphAuthor' => ['type' => 'String'], 167 'opengraphPublisher' => ['type' => 'String'], 168 'opengraphPublishedTime' => ['type' => 'String'], 169 'opengraphModifiedTime' => ['type' => 'String'], 170 'opengraphDescription' => ['type' => 'String'], 171 'opengraphImage' => ['type' => 'MediaItem'], 172 'twitterTitle' => ['type' => 'String'], 173 'twitterDescription' => ['type' => 'String'], 174 'twitterImage' => ['type' => 'MediaItem'], 175 'canonical' => ['type' => 'String'], 176 'breadcrumbs' => ['type' => ['list_of' => 'SEOPostTypeBreadcrumbs']], 177 'cornerstone' => ['type' => 'Boolean'], 178 ); 179 180 register_graphql_object_type('TaxonomySEO', [ 181 'fields' => $baseSEOFields 182 ]); 183 184 register_graphql_object_type('PostTypeSEO', [ 185 'fields' => array_merge($baseSEOFields, array('schema' => ['type' => 'SEOPostTypeSchema'])), 186 ]); 187 188 189 register_graphql_object_type('SEOPostTypeBreadcrumbs', [ 190 'fields' => [ 191 'url' => ['type' => 'String'], 192 'text' => ['type' => 'String'], 193 194 ] 195 ]); 196 197 198 register_graphql_object_type('SEOSchema', [ 199 'description' => __('The Yoast SEO schema data', 'wp-graphql-yoast-seo'), 200 'fields' => [ 201 'companyName' => ['type' => 'String'], 202 'personName' => ['type' => 'String'], 203 'companyOrPerson' => ['type' => 'String'], 204 'companyLogo' => ['type' => 'MediaItem'], 205 'personLogo' => ['type' => 'MediaItem'], 206 'logo' => ['type' => 'MediaItem'], 207 'siteName' => ['type' => 'String'], 208 'wordpressSiteName' => ['type' => 'String'], 209 'siteUrl' => ['type' => 'String'], 210 'inLanguage' => ['type' => 'String'], 211 ] 212 ]); 213 214 register_graphql_object_type('SEOWebmaster', [ 215 'description' => __('The Yoast SEO webmaster fields', 'wp-graphql-yoast-seo'), 216 'fields' => [ 217 'baiduVerify' => ['type' => 'String'], 218 'googleVerify' => ['type' => 'String'], 219 'msVerify' => ['type' => 'String'], 220 'yandexVerify' => ['type' => 'String'], 221 ] 222 ]); 223 224 register_graphql_object_type('SEOBreadcrumbs', [ 225 'description' => __('The Yoast SEO breadcrumb config', 'wp-graphql-yoast-seo'), 226 'fields' => [ 227 'enabled' => ['type' => 'Boolean'], 228 'boldLast' => ['type' => 'Boolean'], 229 'showBlogPage' => ['type' => 'Boolean'], 230 'notFoundText' => ['type' => 'String'], 231 'archivePrefix' => ['type' => 'String'], 232 'homeText' => ['type' => 'String'], 233 'prefix' => ['type' => 'String'], 234 'searchPrefix' => ['type' => 'String'], 235 'separator' => ['type' => 'String'], 236 ] 237 ]); 238 239 register_graphql_object_type('SEOSocialFacebook', [ 240 'fields' => [ 241 'url' => ['type' => 'String'], 242 'defaultImage' => ['type' => 'MediaItem'], 243 ] 244 ]); 245 246 register_graphql_object_type('SEOSocialTwitter', [ 247 'fields' => [ 248 'username' => ['type' => 'String'], 249 'cardType' => ['type' => 'SEOCardType'], 250 ] 251 ]); 252 253 register_graphql_object_type('SEOSocialInstagram', [ 254 'fields' => [ 255 'url' => ['type' => 'String'], 256 ] 257 ]); 258 register_graphql_object_type('SEOSocialLinkedIn', [ 259 'fields' => [ 260 'url' => ['type' => 'String'], 261 ] 262 ]); 263 register_graphql_object_type('SEOSocialMySpace', [ 264 'fields' => [ 265 'url' => ['type' => 'String'], 266 ] 267 ]); 268 269 register_graphql_object_type('SEOSocialPinterest', [ 270 'fields' => [ 271 'url' => ['type' => 'String'], 272 'metaTag' => ['type' => 'String'], 273 ] 274 ]); 275 276 register_graphql_object_type('SEOSocialYoutube', [ 277 'fields' => [ 278 'url' => ['type' => 'String'], 279 ] 280 ]); 281 register_graphql_object_type('SEOSocialWikipedia', [ 282 'fields' => [ 283 'url' => ['type' => 'String'], 284 ] 285 ]); 286 287 register_graphql_object_type('SEOSocial', [ 288 'description' => __('The Yoast SEO Social media links', 'wp-graphql-yoast-seo'), 289 'fields' => [ 290 'facebook' => ['type' => 'SEOSocialFacebook'], 291 'twitter' => ['type' => 'SEOSocialTwitter'], 292 'instagram' => ['type' => 'SEOSocialInstagram'], 293 'linkedIn' => ['type' => 'SEOSocialLinkedIn'], 294 'mySpace' => ['type' => 'SEOSocialMySpace'], 295 'pinterest' => ['type' => 'SEOSocialPinterest'], 296 'youTube' => ['type' => 'SEOSocialYoutube'], 297 'wikipedia' => ['type' => 'SEOSocialWikipedia'], 298 ] 299 ]); 300 301 register_graphql_object_type('SEORedirect', [ 302 'description' => __('The Yoast redirect data (Yoast Premium only)', 'wp-graphql-yoast-seo'), 303 'fields' => [ 304 'origin' => ['type' => 'String'], 305 'target' => ['type' => 'String'], 306 'type' => ['type' => 'Int'], 307 'format' => ['type' => 'String'], 308 309 ] 310 ]); 311 312 register_graphql_object_type('SEOOpenGraphFrontPage', [ 313 'description' => __('The Open Graph Front page data', 'wp-graphql-yoast-seo'), 314 'fields' => [ 315 'title' => ['type' => 'String'], 316 'description' => ['type' => 'String'], 317 'image' => ['type' => 'MediaItem'], 318 ] 319 ]); 320 321 register_graphql_object_type('SEOOpenGraph', [ 322 'description' => __('The Open Graph data', 'wp-graphql-yoast-seo'), 323 'fields' => [ 324 'defaultImage' => ['type' => 'MediaItem'], 325 'frontPage' => ['type' => 'SEOOpenGraphFrontPage'], 326 ] 327 ]); 328 329 register_graphql_object_type('SEOContentType', [ 330 'description' => __('he Yoast SEO search appearance content types fields', 'wp-graphql-yoast-seo'), 331 'fields' => [ 332 'title' => ['type' => 'String'], 333 'metaDesc' => ['type' => 'String'], 334 'metaRobotsNoindex' => ['type' => 'Boolean'], 335 'schemaType' => ['type' => 'String'], 336 ] 337 ]); 338 339 $allTypes = wp_gql_seo_build_content_types($post_types); 340 341 register_graphql_object_type('SEOContentTypes', [ 342 'description' => __('The Yoast SEO search appearance content types', 'wp-graphql-yoast-seo'), 343 'fields' => $allTypes, 344 ]); 345 346 register_graphql_object_type('SEOConfig', [ 347 'description' => __('The Yoast SEO site level configuration data', 'wp-graphql-yoast-seo'), 348 'fields' => [ 349 'schema' => ['type' => 'SEOSchema'], 350 'webmaster' => ['type' => 'SEOWebmaster'], 351 'social' => ['type' => 'SEOSocial'], 352 'breadcrumbs' => ['type' => 'SEOBreadcrumbs'], 353 'redirects' => ['type' => [ 354 'list_of' => 'SEORedirect', 355 ]], 356 'openGraph' => ['type' => 'SEOOpenGraph'], 357 'contentTypes' => ['type' => 'SEOContentTypes'], 358 ] 359 ]); 360 361 register_graphql_object_type('SEOUserSocial', [ 362 'fields' => [ 363 'facebook' => ['type' => 'String'], 364 'twitter' => ['type' => 'String'], 365 'instagram' => ['type' => 'String'], 366 'linkedIn' => ['type' => 'String'], 367 'mySpace' => ['type' => 'String'], 368 'pinterest' => ['type' => 'String'], 369 'youTube' => ['type' => 'String'], 370 'soundCloud' => ['type' => 'String'], 371 'wikipedia' => ['type' => 'String'], 372 ] 373 ]); 374 375 register_graphql_object_type('SEOUser', [ 376 'fields' => [ 377 'title' => ['type' => 'String'], 378 'metaDesc' => ['type' => 'String'], 379 'metaRobotsNoindex' => ['type' => 'String'], 380 'metaRobotsNofollow' => ['type' => 'String'], 381 'social' => ['type' => 'SEOUserSocial'], 382 ] 383 ]); 384 385 register_graphql_field('RootQuery', 'seo', [ 386 'type' => 'SEOConfig', 387 'description' => __('Returns seo site data', 'wp-graphql-yoast-seo'), 388 'resolve' => function ($source, array $args, AppContext $context) use ($post_types) { 389 390 $wpseo_options = WPSEO_Options::get_instance(); 391 $all = $wpseo_options->get_all(); 392 393 $redirectsObj = class_exists('WPSEO_Redirect_Option') ? new WPSEO_Redirect_Option() : false; 394 $redirects = $redirectsObj ? $redirectsObj->get_from_option() : []; 395 396 $userID = $all['company_or_person_user_id']; 397 $user = get_userdata($userID); 398 399 $mappedRedirects = function ($value) { 400 401 return array( 402 'origin' => $value['origin'], 403 'target' => $value['url'], 404 'type' => $value['type'], 405 'format' => $value['format'], 406 ); 407 }; 408 409 410 411 $contentTypes = wp_gql_seo_build_content_type_data($post_types, $all); 412 413 return array( 414 'contentTypes' => $contentTypes, 415 'webmaster' => array( 416 'baiduVerify' => wp_gql_seo_format_string($all['baiduverify']), 417 'googleVerify' => wp_gql_seo_format_string($all['googleverify']), 418 'msVerify' => wp_gql_seo_format_string($all['msverify']), 419 'yandexVerify' => wp_gql_seo_format_string($all['yandexverify']), 420 ), 421 'social' => array( 422 'facebook' => array( 423 'url' => wp_gql_seo_format_string($all['facebook_site']), 424 'defaultImage' => DataSource::resolve_post_object($all['og_default_image_id'], $context) 171 172 add_action('graphql_register_types', function () { 173 $post_types = \WPGraphQL::get_allowed_post_types(); 174 $taxonomies = \WPGraphQL::get_allowed_taxonomies(); 175 176 // If WooCommerce installed then add these post types and taxonomies 177 if (class_exists('\WooCommerce')) { 178 array_push($post_types, 'product'); 179 array_push($taxonomies, 'productCategory'); 180 } 181 182 register_graphql_enum_type('SEOCardType', [ 183 'description' => __('Types of cards', 'wp-graphql-yoast-seo'), 184 'values' => [ 185 'summary_large_image' => [ 186 'value' => 'summary_large_image', 187 ], 188 'summary' => [ 189 'value' => 'summary', 190 ], 191 ], 192 ]); 193 194 register_graphql_object_type('SEOPostTypeSchema', [ 195 'description' => __('The Schema types', 'wp-graphql-yoast-seo'), 196 'fields' => [ 197 'pageType' => ['type' => ['list_of' => 'String']], 198 'articleType' => ['type' => ['list_of' => 'String']], 199 ], 200 ]); 201 202 $baseSEOFields = [ 203 'title' => ['type' => 'String'], 204 'metaDesc' => ['type' => 'String'], 205 'focuskw' => ['type' => 'String'], 206 'metaKeywords' => ['type' => 'String'], 207 'metaRobotsNoindex' => ['type' => 'String'], 208 'metaRobotsNofollow' => ['type' => 'String'], 209 'opengraphTitle' => ['type' => 'String'], 210 'opengraphUrl' => ['type' => 'String'], 211 'opengraphSiteName' => ['type' => 'String'], 212 'opengraphType' => ['type' => 'String'], 213 'opengraphAuthor' => ['type' => 'String'], 214 'opengraphPublisher' => ['type' => 'String'], 215 'opengraphPublishedTime' => ['type' => 'String'], 216 'opengraphModifiedTime' => ['type' => 'String'], 217 'opengraphDescription' => ['type' => 'String'], 218 'opengraphImage' => ['type' => 'MediaItem'], 219 'twitterTitle' => ['type' => 'String'], 220 'twitterDescription' => ['type' => 'String'], 221 'twitterImage' => ['type' => 'MediaItem'], 222 'canonical' => ['type' => 'String'], 223 'breadcrumbs' => ['type' => ['list_of' => 'SEOPostTypeBreadcrumbs']], 224 'cornerstone' => ['type' => 'Boolean'], 225 ]; 226 227 register_graphql_object_type('TaxonomySEO', [ 228 'fields' => $baseSEOFields, 229 ]); 230 231 register_graphql_object_type('PostTypeSEO', [ 232 'fields' => array_merge($baseSEOFields, [ 233 'schema' => ['type' => 'SEOPostTypeSchema'], 234 ]), 235 ]); 236 237 register_graphql_object_type('SEOPostTypeBreadcrumbs', [ 238 'fields' => [ 239 'url' => ['type' => 'String'], 240 'text' => ['type' => 'String'], 241 ], 242 ]); 243 244 register_graphql_object_type('SEOSchema', [ 245 'description' => __('The Yoast SEO schema data', 'wp-graphql-yoast-seo'), 246 'fields' => [ 247 'companyName' => ['type' => 'String'], 248 'personName' => ['type' => 'String'], 249 'companyOrPerson' => ['type' => 'String'], 250 'companyLogo' => ['type' => 'MediaItem'], 251 'personLogo' => ['type' => 'MediaItem'], 252 'logo' => ['type' => 'MediaItem'], 253 'siteName' => ['type' => 'String'], 254 'wordpressSiteName' => ['type' => 'String'], 255 'siteUrl' => ['type' => 'String'], 256 'inLanguage' => ['type' => 'String'], 257 ], 258 ]); 259 260 register_graphql_object_type('SEOWebmaster', [ 261 'description' => __( 262 'The Yoast SEO webmaster fields', 263 'wp-graphql-yoast-seo' 425 264 ), 426 'twitter' => array( 427 'username' => wp_gql_seo_format_string($all['twitter_site']), 428 'cardType' => wp_gql_seo_format_string($all['twitter_card_type']), 265 'fields' => [ 266 'baiduVerify' => ['type' => 'String'], 267 'googleVerify' => ['type' => 'String'], 268 'msVerify' => ['type' => 'String'], 269 'yandexVerify' => ['type' => 'String'], 270 ], 271 ]); 272 273 register_graphql_object_type('SEOBreadcrumbs', [ 274 'description' => __( 275 'The Yoast SEO breadcrumb config', 276 'wp-graphql-yoast-seo' 429 277 ), 430 'instagram' => array('url' => wp_gql_seo_format_string($all['instagram_url'])), 431 'linkedIn' => array('url' => wp_gql_seo_format_string($all['linkedin_url'])), 432 'mySpace' => array('url' => wp_gql_seo_format_string($all['myspace_url'])), 433 'pinterest' => array( 434 'url' => wp_gql_seo_format_string($all['pinterest_url']), 435 'metaTag' => wp_gql_seo_format_string($all['pinterestverify']), 278 'fields' => [ 279 'enabled' => ['type' => 'Boolean'], 280 'boldLast' => ['type' => 'Boolean'], 281 'showBlogPage' => ['type' => 'Boolean'], 282 'notFoundText' => ['type' => 'String'], 283 'archivePrefix' => ['type' => 'String'], 284 'homeText' => ['type' => 'String'], 285 'prefix' => ['type' => 'String'], 286 'searchPrefix' => ['type' => 'String'], 287 'separator' => ['type' => 'String'], 288 ], 289 ]); 290 291 register_graphql_object_type('SEOSocialFacebook', [ 292 'fields' => [ 293 'url' => ['type' => 'String'], 294 'defaultImage' => ['type' => 'MediaItem'], 295 ], 296 ]); 297 298 register_graphql_object_type('SEOSocialTwitter', [ 299 'fields' => [ 300 'username' => ['type' => 'String'], 301 'cardType' => ['type' => 'SEOCardType'], 302 ], 303 ]); 304 305 register_graphql_object_type('SEOSocialInstagram', [ 306 'fields' => [ 307 'url' => ['type' => 'String'], 308 ], 309 ]); 310 register_graphql_object_type('SEOSocialLinkedIn', [ 311 'fields' => [ 312 'url' => ['type' => 'String'], 313 ], 314 ]); 315 register_graphql_object_type('SEOSocialMySpace', [ 316 'fields' => [ 317 'url' => ['type' => 'String'], 318 ], 319 ]); 320 321 register_graphql_object_type('SEOSocialPinterest', [ 322 'fields' => [ 323 'url' => ['type' => 'String'], 324 'metaTag' => ['type' => 'String'], 325 ], 326 ]); 327 328 register_graphql_object_type('SEOSocialYoutube', [ 329 'fields' => [ 330 'url' => ['type' => 'String'], 331 ], 332 ]); 333 register_graphql_object_type('SEOSocialWikipedia', [ 334 'fields' => [ 335 'url' => ['type' => 'String'], 336 ], 337 ]); 338 339 register_graphql_object_type('SEOSocial', [ 340 'description' => __( 341 'The Yoast SEO Social media links', 342 'wp-graphql-yoast-seo' 436 343 ), 437 'youTube' => array('url' => wp_gql_seo_format_string($all['youtube_url'])), 438 'wikipedia' => array('url' => wp_gql_seo_format_string($all['wikipedia_url'])), 439 ), 440 'breadcrumbs' => array( 441 'enabled' => wp_gql_seo_format_string($all['breadcrumbs-enable']), 442 'boldLast' => wp_gql_seo_format_string($all['breadcrumbs-boldlast']), 443 'showBlogPage' => wp_gql_seo_format_string($all['breadcrumbs-display-blog-page']), 444 'archivePrefix' => wp_gql_seo_format_string($all['breadcrumbs-archiveprefix']), 445 'prefix' => wp_gql_seo_format_string($all['breadcrumbs-prefix']), 446 'notFoundText' => wp_gql_seo_format_string($all['breadcrumbs-404crumb']), 447 'homeText' => wp_gql_seo_format_string($all['breadcrumbs-home']), 448 'searchPrefix' => wp_gql_seo_format_string($all['breadcrumbs-searchprefix']), 449 'separator' => wp_gql_seo_format_string($all['breadcrumbs-sep']), 450 ), 451 'schema' => array( 452 'companyName' => wp_gql_seo_format_string($all['company_name']), 453 'personName' => wp_gql_seo_format_string($user->user_nicename), 454 'companyLogo' => DataSource::resolve_post_object($all['company_logo_id'], $context), 455 'personLogo' => DataSource::resolve_post_object($all['person_logo_id'], $context), 456 'logo' => DataSource::resolve_post_object($all['company_or_person'] === 'company' ? $all['company_logo_id'] : $all['person_logo_id'], $context), 457 'companyOrPerson' => wp_gql_seo_format_string($all['company_or_person']), 458 'siteName' => wp_gql_seo_format_string(YoastSEO()->helpers->site->get_site_name()), 459 'wordpressSiteName' => wp_gql_seo_format_string(get_bloginfo('name')), 460 'siteUrl' => wp_gql_seo_format_string(get_site_url()), 461 'inLanguage' => wp_gql_seo_format_string(get_bloginfo('language')), 462 ), 463 'redirects' => array_map($mappedRedirects, $redirects), 464 'openGraph' => array( 465 'defaultImage' => DataSource::resolve_post_object($all['og_default_image_id'], $context), 466 'frontPage' => array( 467 'title' => wp_gql_seo_format_string($all['og_frontpage_title']), 468 'description' => wp_gql_seo_format_string($all['og_frontpage_desc']), 469 'image' => DataSource::resolve_post_object($all['og_frontpage_image_id'], $context), 470 ) 471 ) 472 ); 473 }, 474 ]); 475 476 if (!empty($post_types) && is_array($post_types)) { 477 foreach ($post_types as $post_type) { 478 $post_type_object = get_post_type_object($post_type); 479 480 if (isset($post_type_object->graphql_single_name)) : 481 register_graphql_field($post_type_object->graphql_single_name, 'seo', [ 482 'type' => 'PostTypeSEO', 483 'description' => __('The Yoast SEO data of the ' . $post_type_object->graphql_single_name, 'wp-graphql-yoast-seo'), 484 'resolve' => function ($post, array $args, AppContext $context) { 485 486 // Base array 487 $seo = array(); 488 489 // https://developer.yoast.com/blog/yoast-seo-14-0-using-yoast-seo-surfaces/ 490 $robots = YoastSEO()->meta->for_post($post->ID)->robots; 491 492 // Get data 493 $seo = array( 494 'title' => wp_gql_seo_format_string(YoastSEO()->meta->for_post($post->ID)->title), 495 'metaDesc' => wp_gql_seo_format_string(YoastSEO()->meta->for_post($post->ID)->description), 496 'focuskw' => wp_gql_seo_format_string(get_post_meta($post->ID, '_yoast_wpseo_focuskw', true)), 497 'metaKeywords' => wp_gql_seo_format_string(get_post_meta($post->ID, '_yoast_wpseo_metakeywords', true)), 498 'metaRobotsNoindex' => $robots['index'], 499 'metaRobotsNofollow' => $robots['follow'], 500 'opengraphTitle' => wp_gql_seo_format_string(YoastSEO()->meta->for_post($post->ID)->open_graph_title), 501 'opengraphUrl' => wp_gql_seo_format_string(YoastSEO()->meta->for_post($post->ID)->open_graph_url), 502 'opengraphSiteName' => wp_gql_seo_format_string(YoastSEO()->meta->for_post($post->ID)->open_graph_site_name), 503 'opengraphType' => wp_gql_seo_format_string(YoastSEO()->meta->for_post($post->ID)->open_graph_type), 504 'opengraphAuthor' => wp_gql_seo_format_string(YoastSEO()->meta->for_post($post->ID)->open_graph_article_author), 505 'opengraphPublisher' => wp_gql_seo_format_string(YoastSEO()->meta->for_post($post->ID)->open_graph_article_publisher), 506 'opengraphPublishedTime' => wp_gql_seo_format_string(YoastSEO()->meta->for_post($post->ID)->open_graph_article_published_time), 507 'opengraphModifiedTime' => wp_gql_seo_format_string(YoastSEO()->meta->for_post($post->ID)->open_graph_article_modified_time), 508 'opengraphDescription' => wp_gql_seo_format_string(YoastSEO()->meta->for_post($post->ID)->open_graph_description), 509 'opengraphImage' => DataSource::resolve_post_object(wp_gql_seo_get_og_image(YoastSEO()->meta->for_post($post->ID)->open_graph_images), $context), 510 'twitterCardType' => wp_gql_seo_format_string(YoastSEO()->meta->for_post($post->ID)->twitter_card), 511 'twitterTitle' => wp_gql_seo_format_string(YoastSEO()->meta->for_post($post->ID)->twitter_title), 512 'twitterDescription' => wp_gql_seo_format_string(YoastSEO()->meta->for_post($post->ID)->twitter_description), 513 'twitterImage' => DataSource::resolve_post_object(attachment_url_to_postid(YoastSEO()->meta->for_post($post->ID)->twitter_image), $context), 514 'canonical' => wp_gql_seo_format_string(YoastSEO()->meta->for_post($post->ID)->canonical), 515 'breadcrumbs' => YoastSEO()->meta->for_post($post->ID)->breadcrumbs, 516 'cornerstone' => boolval(YoastSEO()->meta->for_post($post->ID)->indexable->is_cornerstone), 517 'schema' => array( 518 'pageType' => is_array(YoastSEO()->meta->for_post($post->ID)->schema_page_type) ? YoastSEO()->meta->for_post($post->ID)->schema_page_type : [], 519 'articleType' => is_array(YoastSEO()->meta->for_post($post->ID)->schema_article_type) ? YoastSEO()->meta->for_post($post->ID)->schema_article_type : [], 520 ), 521 ); 522 523 524 return !empty($seo) ? $seo : null; 344 'fields' => [ 345 'facebook' => ['type' => 'SEOSocialFacebook'], 346 'twitter' => ['type' => 'SEOSocialTwitter'], 347 'instagram' => ['type' => 'SEOSocialInstagram'], 348 'linkedIn' => ['type' => 'SEOSocialLinkedIn'], 349 'mySpace' => ['type' => 'SEOSocialMySpace'], 350 'pinterest' => ['type' => 'SEOSocialPinterest'], 351 'youTube' => ['type' => 'SEOSocialYoutube'], 352 'wikipedia' => ['type' => 'SEOSocialWikipedia'], 353 ], 354 ]); 355 356 register_graphql_object_type('SEORedirect', [ 357 'description' => __( 358 'The Yoast redirect data (Yoast Premium only)', 359 'wp-graphql-yoast-seo' 360 ), 361 'fields' => [ 362 'origin' => ['type' => 'String'], 363 'target' => ['type' => 'String'], 364 'type' => ['type' => 'Int'], 365 'format' => ['type' => 'String'], 366 ], 367 ]); 368 369 register_graphql_object_type('SEOOpenGraphFrontPage', [ 370 'description' => __( 371 'The Open Graph Front page data', 372 'wp-graphql-yoast-seo' 373 ), 374 'fields' => [ 375 'title' => ['type' => 'String'], 376 'description' => ['type' => 'String'], 377 'image' => ['type' => 'MediaItem'], 378 ], 379 ]); 380 381 register_graphql_object_type('SEOOpenGraph', [ 382 'description' => __('The Open Graph data', 'wp-graphql-yoast-seo'), 383 'fields' => [ 384 'defaultImage' => ['type' => 'MediaItem'], 385 'frontPage' => ['type' => 'SEOOpenGraphFrontPage'], 386 ], 387 ]); 388 389 register_graphql_object_type('SEOContentType', [ 390 'description' => __( 391 'he Yoast SEO search appearance content types fields', 392 'wp-graphql-yoast-seo' 393 ), 394 'fields' => [ 395 'title' => ['type' => 'String'], 396 'metaDesc' => ['type' => 'String'], 397 'metaRobotsNoindex' => ['type' => 'Boolean'], 398 'schemaType' => ['type' => 'String'], 399 ], 400 ]); 401 402 $allTypes = wp_gql_seo_build_content_types($post_types); 403 404 register_graphql_object_type('SEOContentTypes', [ 405 'description' => __( 406 'The Yoast SEO search appearance content types', 407 'wp-graphql-yoast-seo' 408 ), 409 'fields' => $allTypes, 410 ]); 411 412 register_graphql_object_type('SEOConfig', [ 413 'description' => __( 414 'The Yoast SEO site level configuration data', 415 'wp-graphql-yoast-seo' 416 ), 417 'fields' => [ 418 'schema' => ['type' => 'SEOSchema'], 419 'webmaster' => ['type' => 'SEOWebmaster'], 420 'social' => ['type' => 'SEOSocial'], 421 'breadcrumbs' => ['type' => 'SEOBreadcrumbs'], 422 'redirects' => [ 423 'type' => [ 424 'list_of' => 'SEORedirect', 425 ], 426 ], 427 'openGraph' => ['type' => 'SEOOpenGraph'], 428 'contentTypes' => ['type' => 'SEOContentTypes'], 429 ], 430 ]); 431 432 register_graphql_object_type('SEOUserSocial', [ 433 'fields' => [ 434 'facebook' => ['type' => 'String'], 435 'twitter' => ['type' => 'String'], 436 'instagram' => ['type' => 'String'], 437 'linkedIn' => ['type' => 'String'], 438 'mySpace' => ['type' => 'String'], 439 'pinterest' => ['type' => 'String'], 440 'youTube' => ['type' => 'String'], 441 'soundCloud' => ['type' => 'String'], 442 'wikipedia' => ['type' => 'String'], 443 ], 444 ]); 445 446 register_graphql_object_type('SEOUser', [ 447 'fields' => [ 448 'title' => ['type' => 'String'], 449 'metaDesc' => ['type' => 'String'], 450 'metaRobotsNoindex' => ['type' => 'String'], 451 'metaRobotsNofollow' => ['type' => 'String'], 452 'social' => ['type' => 'SEOUserSocial'], 453 ], 454 ]); 455 456 register_graphql_field('RootQuery', 'seo', [ 457 'type' => 'SEOConfig', 458 'description' => __('Returns seo site data', 'wp-graphql-yoast-seo'), 459 'resolve' => function ($source, array $args, AppContext $context) use ( 460 $post_types 461 ) { 462 $wpseo_options = WPSEO_Options::get_instance(); 463 $all = $wpseo_options->get_all(); 464 465 $redirectsObj = class_exists('WPSEO_Redirect_Option') 466 ? new WPSEO_Redirect_Option() 467 : false; 468 $redirects = $redirectsObj ? $redirectsObj->get_from_option() : []; 469 470 $userID = $all['company_or_person_user_id']; 471 $user = get_userdata($userID); 472 473 $mappedRedirects = function ($value) { 474 return [ 475 'origin' => $value['origin'], 476 'target' => $value['url'], 477 'type' => $value['type'], 478 'format' => $value['format'], 479 ]; 480 }; 481 482 $contentTypes = wp_gql_seo_build_content_type_data( 483 $post_types, 484 $all 485 ); 486 487 return [ 488 'contentTypes' => $contentTypes, 489 'webmaster' => [ 490 'baiduVerify' => wp_gql_seo_format_string( 491 $all['baiduverify'] 492 ), 493 'googleVerify' => wp_gql_seo_format_string( 494 $all['googleverify'] 495 ), 496 'msVerify' => wp_gql_seo_format_string($all['msverify']), 497 'yandexVerify' => wp_gql_seo_format_string( 498 $all['yandexverify'] 499 ), 500 ], 501 'social' => [ 502 'facebook' => [ 503 'url' => wp_gql_seo_format_string($all['facebook_site']), 504 'defaultImage' => $context 505 ->get_loader('post') 506 ->load_deferred($all['og_default_image_id']), 507 ], 508 'twitter' => [ 509 'username' => wp_gql_seo_format_string( 510 $all['twitter_site'] 511 ), 512 'cardType' => wp_gql_seo_format_string( 513 $all['twitter_card_type'] 514 ), 515 ], 516 'instagram' => [ 517 'url' => wp_gql_seo_format_string($all['instagram_url']), 518 ], 519 'linkedIn' => [ 520 'url' => wp_gql_seo_format_string($all['linkedin_url']), 521 ], 522 'mySpace' => [ 523 'url' => wp_gql_seo_format_string($all['myspace_url']), 524 ], 525 'pinterest' => [ 526 'url' => wp_gql_seo_format_string($all['pinterest_url']), 527 'metaTag' => wp_gql_seo_format_string( 528 $all['pinterestverify'] 529 ), 530 ], 531 'youTube' => [ 532 'url' => wp_gql_seo_format_string($all['youtube_url']), 533 ], 534 'wikipedia' => [ 535 'url' => wp_gql_seo_format_string($all['wikipedia_url']), 536 ], 537 ], 538 'breadcrumbs' => [ 539 'enabled' => wp_gql_seo_format_string( 540 $all['breadcrumbs-enable'] 541 ), 542 'boldLast' => wp_gql_seo_format_string( 543 $all['breadcrumbs-boldlast'] 544 ), 545 'showBlogPage' => wp_gql_seo_format_string( 546 $all['breadcrumbs-display-blog-page'] 547 ), 548 'archivePrefix' => wp_gql_seo_format_string( 549 $all['breadcrumbs-archiveprefix'] 550 ), 551 'prefix' => wp_gql_seo_format_string( 552 $all['breadcrumbs-prefix'] 553 ), 554 'notFoundText' => wp_gql_seo_format_string( 555 $all['breadcrumbs-404crumb'] 556 ), 557 'homeText' => wp_gql_seo_format_string( 558 $all['breadcrumbs-home'] 559 ), 560 'searchPrefix' => wp_gql_seo_format_string( 561 $all['breadcrumbs-searchprefix'] 562 ), 563 'separator' => wp_gql_seo_format_string( 564 $all['breadcrumbs-sep'] 565 ), 566 ], 567 'schema' => [ 568 'companyName' => wp_gql_seo_format_string( 569 $all['company_name'] 570 ), 571 'personName' => wp_gql_seo_format_string( 572 $user->user_nicename 573 ), 574 'companyLogo' => DataSource::resolve_post_object( 575 $all['company_logo_id'], 576 $context 577 ), 578 'personLogo' => DataSource::resolve_post_object( 579 $all['person_logo_id'], 580 $context 581 ), 582 'logo' => DataSource::resolve_post_object( 583 $all['company_or_person'] === 'company' 584 ? $all['company_logo_id'] 585 : $all['person_logo_id'], 586 $context 587 ), 588 'companyOrPerson' => wp_gql_seo_format_string( 589 $all['company_or_person'] 590 ), 591 'siteName' => wp_gql_seo_format_string( 592 YoastSEO()->helpers->site->get_site_name() 593 ), 594 'wordpressSiteName' => wp_gql_seo_format_string( 595 get_bloginfo('name') 596 ), 597 'siteUrl' => wp_gql_seo_format_string(get_site_url()), 598 'inLanguage' => wp_gql_seo_format_string( 599 get_bloginfo('language') 600 ), 601 ], 602 'redirects' => array_map($mappedRedirects, $redirects), 603 'openGraph' => [ 604 'defaultImage' => DataSource::resolve_post_object( 605 $all['og_default_image_id'], 606 $context 607 ), 608 'frontPage' => [ 609 'title' => wp_gql_seo_format_string( 610 $all['og_frontpage_title'] 611 ), 612 'description' => wp_gql_seo_format_string( 613 $all['og_frontpage_desc'] 614 ), 615 'image' => DataSource::resolve_post_object( 616 $all['og_frontpage_image_id'], 617 $context 618 ), 619 ], 620 ], 621 ]; 622 }, 623 ]); 624 625 if (!empty($post_types) && is_array($post_types)) { 626 foreach ($post_types as $post_type) { 627 $post_type_object = get_post_type_object($post_type); 628 629 if (isset($post_type_object->graphql_single_name)): 630 register_graphql_field( 631 $post_type_object->graphql_single_name, 632 'seo', 633 [ 634 'type' => 'PostTypeSEO', 635 'description' => __( 636 'The Yoast SEO data of the ' . 637 $post_type_object->graphql_single_name, 638 'wp-graphql-yoast-seo' 639 ), 640 'resolve' => function ( 641 $post, 642 array $args, 643 AppContext $context 644 ) { 645 // Base array 646 $seo = []; 647 648 // https://developer.yoast.com/blog/yoast-seo-14-0-using-yoast-seo-surfaces/ 649 $robots = YoastSEO()->meta->for_post($post->ID) 650 ->robots; 651 652 // Get data 653 $seo = [ 654 'title' => wp_gql_seo_format_string( 655 YoastSEO()->meta->for_post($post->ID)->title 656 ), 657 'metaDesc' => wp_gql_seo_format_string( 658 YoastSEO()->meta->for_post($post->ID) 659 ->description 660 ), 661 'focuskw' => wp_gql_seo_format_string( 662 get_post_meta( 663 $post->ID, 664 '_yoast_wpseo_focuskw', 665 true 666 ) 667 ), 668 'metaKeywords' => wp_gql_seo_format_string( 669 get_post_meta( 670 $post->ID, 671 '_yoast_wpseo_metakeywords', 672 true 673 ) 674 ), 675 'metaRobotsNoindex' => $robots['index'], 676 'metaRobotsNofollow' => $robots['follow'], 677 'opengraphTitle' => wp_gql_seo_format_string( 678 YoastSEO()->meta->for_post($post->ID) 679 ->open_graph_title 680 ), 681 'opengraphUrl' => wp_gql_seo_format_string( 682 YoastSEO()->meta->for_post($post->ID) 683 ->open_graph_url 684 ), 685 'opengraphSiteName' => wp_gql_seo_format_string( 686 YoastSEO()->meta->for_post($post->ID) 687 ->open_graph_site_name 688 ), 689 'opengraphType' => wp_gql_seo_format_string( 690 YoastSEO()->meta->for_post($post->ID) 691 ->open_graph_type 692 ), 693 'opengraphAuthor' => wp_gql_seo_format_string( 694 YoastSEO()->meta->for_post($post->ID) 695 ->open_graph_article_author 696 ), 697 'opengraphPublisher' => wp_gql_seo_format_string( 698 YoastSEO()->meta->for_post($post->ID) 699 ->open_graph_article_publisher 700 ), 701 'opengraphPublishedTime' => wp_gql_seo_format_string( 702 YoastSEO()->meta->for_post($post->ID) 703 ->open_graph_article_published_time 704 ), 705 'opengraphModifiedTime' => wp_gql_seo_format_string( 706 YoastSEO()->meta->for_post($post->ID) 707 ->open_graph_article_modified_time 708 ), 709 'opengraphDescription' => wp_gql_seo_format_string( 710 YoastSEO()->meta->for_post($post->ID) 711 ->open_graph_description 712 ), 713 'opengraphImage' => DataSource::resolve_post_object( 714 wp_gql_seo_get_og_image( 715 YoastSEO()->meta->for_post($post->ID) 716 ->open_graph_images 717 ), 718 $context 719 ), 720 'twitterCardType' => wp_gql_seo_format_string( 721 YoastSEO()->meta->for_post($post->ID) 722 ->twitter_card 723 ), 724 'twitterTitle' => wp_gql_seo_format_string( 725 YoastSEO()->meta->for_post($post->ID) 726 ->twitter_title 727 ), 728 'twitterDescription' => wp_gql_seo_format_string( 729 YoastSEO()->meta->for_post($post->ID) 730 ->twitter_description 731 ), 732 'twitterImage' => DataSource::resolve_post_object( 733 wpcom_vip_attachment_url_to_postid( 734 YoastSEO()->meta->for_post($post->ID) 735 ->twitter_image 736 ), 737 $context 738 ), 739 'canonical' => wp_gql_seo_format_string( 740 YoastSEO()->meta->for_post($post->ID) 741 ->canonical 742 ), 743 'breadcrumbs' => YoastSEO()->meta->for_post( 744 $post->ID 745 )->breadcrumbs, 746 'cornerstone' => boolval( 747 YoastSEO()->meta->for_post($post->ID) 748 ->indexable->is_cornerstone 749 ), 750 'schema' => [ 751 'pageType' => is_array( 752 YoastSEO()->meta->for_post($post->ID) 753 ->schema_page_type 754 ) 755 ? YoastSEO()->meta->for_post($post->ID) 756 ->schema_page_type 757 : [], 758 'articleType' => is_array( 759 YoastSEO()->meta->for_post($post->ID) 760 ->schema_article_type 761 ) 762 ? YoastSEO()->meta->for_post($post->ID) 763 ->schema_article_type 764 : [], 765 ], 766 ]; 767 768 return !empty($seo) ? $seo : null; 769 }, 770 ] 771 ); 772 773 // Loop each taxonomy to register on the edge if a category is the primary one. 774 $taxonomiesPostObj = get_object_taxonomies( 775 $post_type, 776 'objects' 777 ); 778 779 $postNameKey = wp_gql_seo_get_field_key( 780 $post_type_object->graphql_single_name 781 ); 782 783 foreach ($taxonomiesPostObj as $tax) { 784 if ($tax->hierarchical && $tax->graphql_single_name) { 785 $name = 786 ucfirst($postNameKey) . 787 'To' . 788 ucfirst($tax->graphql_single_name) . 789 'ConnectionEdge'; 790 791 register_graphql_field($name, 'isPrimary', [ 792 'type' => 'Boolean', 793 'description' => __( 794 'The Yoast SEO Primary ' . $tax->name, 795 'wp-graphql-yoast-seo' 796 ), 797 'resolve' => function ( 798 $item, 799 array $args, 800 AppContext $context 801 ) use ($tax) { 802 $postId = $item['source']->ID; 803 804 $wpseo_primary_term = new WPSEO_Primary_Term( 805 $tax->name, 806 $postId 807 ); 808 $primaryTaxId = $wpseo_primary_term->get_primary_term(); 809 $termId = $item['node']->term_id; 810 811 return $primaryTaxId === $termId; 812 }, 813 ]); 814 } 815 } 816 endif; 525 817 } 526 ]); 527 528 529 // Loop each taxonomy to register on the edge if a category is the primary one. 530 $taxonomiesPostObj = get_object_taxonomies($post_type, 'objects'); 531 532 $postNameKey = wp_gql_seo_get_field_key($post_type_object->graphql_single_name); 533 534 foreach ($taxonomiesPostObj as $tax) { 535 536 537 if ($tax->hierarchical && $tax->graphql_single_name) { 538 539 $name = ucfirst($postNameKey) . 'To' . ucfirst($tax->graphql_single_name) . 'ConnectionEdge'; 540 541 register_graphql_field($name, 'isPrimary', [ 542 'type' => 'Boolean', 543 'description' => __('The Yoast SEO Primary ' . $tax->name, 'wp-graphql-yoast-seo'), 544 'resolve' => function ($item, array $args, AppContext $context) use ($tax) { 545 546 $postId = $item['source']->ID; 547 548 $wpseo_primary_term = new WPSEO_Primary_Term($tax->name, $postId); 549 $primaryTaxId = $wpseo_primary_term->get_primary_term(); 550 $termId = $item['node']->term_id; 551 552 553 return $primaryTaxId === $termId; 818 } 819 820 register_graphql_field('User', 'seo', [ 821 'type' => 'SEOUser', 822 'description' => __( 823 'The Yoast SEO data of a user', 824 'wp-graphql-yoast-seo' 825 ), 826 'resolve' => function ($user, array $args, AppContext $context) { 827 $robots = YoastSEO()->meta->for_author($user->userId)->robots; 828 829 $userSeo = [ 830 'title' => wp_gql_seo_format_string( 831 YoastSEO()->meta->for_author($user->userId)->title 832 ), 833 'metaDesc' => wp_gql_seo_format_string( 834 YoastSEO()->meta->for_author($user->userId)->description 835 ), 836 'metaRobotsNoindex' => $robots['index'], 837 'metaRobotsNofollow' => $robots['follow'], 838 839 'social' => [ 840 'facebook' => wp_gql_seo_format_string( 841 get_the_author_meta('facebook', $user->userId) 842 ), 843 'twitter' => wp_gql_seo_format_string( 844 get_the_author_meta('twitter', $user->userId) 845 ), 846 'instagram' => wp_gql_seo_format_string( 847 get_the_author_meta('instagram', $user->userId) 848 ), 849 'linkedIn' => wp_gql_seo_format_string( 850 get_the_author_meta('linkedin', $user->userId) 851 ), 852 'mySpace' => wp_gql_seo_format_string( 853 get_the_author_meta('myspace', $user->userId) 854 ), 855 'pinterest' => wp_gql_seo_format_string( 856 get_the_author_meta('pinterest', $user->userId) 857 ), 858 'youTube' => wp_gql_seo_format_string( 859 get_the_author_meta('youtube', $user->userId) 860 ), 861 'soundCloud' => wp_gql_seo_format_string( 862 get_the_author_meta('soundcloud', $user->userId) 863 ), 864 'wikipedia' => wp_gql_seo_format_string( 865 get_the_author_meta('wikipedia', $user->userId) 866 ), 867 ], 868 ]; 869 870 return !empty($userSeo) ? $userSeo : []; 871 }, 872 ]); 873 874 if (!empty($taxonomies) && is_array($taxonomies)) { 875 foreach ($taxonomies as $tax) { 876 $taxonomy = get_taxonomy($tax); 877 878 if (empty($taxonomy) || !isset($taxonomy->graphql_single_name)) { 879 return; 554 880 } 555 ]); 881 882 register_graphql_field($taxonomy->graphql_single_name, 'seo', [ 883 'type' => 'TaxonomySEO', 884 'description' => __( 885 'The Yoast SEO data of the ' . 886 $taxonomy->label . 887 ' taxonomy.', 888 'wp-graphql-yoast-seo' 889 ), 890 'resolve' => function ($term, array $args, AppContext $context) { 891 $term_obj = get_term($term->term_id); 892 893 $meta = WPSEO_Taxonomy_Meta::get_term_meta( 894 (int) $term_obj->term_id, 895 $term_obj->taxonomy 896 ); 897 $robots = YoastSEO()->meta->for_term($term->term_id)->robots; 898 899 // Get data 900 $seo = [ 901 'title' => wp_gql_seo_format_string( 902 html_entity_decode( 903 wp_strip_all_tags( 904 YoastSEO()->meta->for_term($term->term_id) 905 ->title 906 ) 907 ) 908 ), 909 'metaDesc' => wp_gql_seo_format_string( 910 YoastSEO()->meta->for_term($term->term_id) 911 ->description 912 ), 913 'focuskw' => wp_gql_seo_format_string( 914 $meta['wpseo_focuskw'] 915 ), 916 'metaKeywords' => wp_gql_seo_format_string( 917 $meta['wpseo_metakeywords'] 918 ), 919 'metaRobotsNoindex' => $robots['index'], 920 'metaRobotsNofollow' => $robots['follow'], 921 'opengraphTitle' => wp_gql_seo_format_string( 922 YoastSEO()->meta->for_term($term->term_id) 923 ->open_graph_title 924 ), 925 'opengraphUrl' => wp_gql_seo_format_string( 926 YoastSEO()->meta->for_term($term->term_id) 927 ->open_graph_url 928 ), 929 'opengraphSiteName' => wp_gql_seo_format_string( 930 YoastSEO()->meta->for_term($term->term_id) 931 ->open_graph_site_name 932 ), 933 'opengraphType' => wp_gql_seo_format_string( 934 YoastSEO()->meta->for_term($term->term_id) 935 ->open_graph_type 936 ), 937 'opengraphAuthor' => wp_gql_seo_format_string( 938 YoastSEO()->meta->for_term($term->term_id) 939 ->open_graph_article_author 940 ), 941 'opengraphPublisher' => wp_gql_seo_format_string( 942 YoastSEO()->meta->for_term($term->term_id) 943 ->open_graph_article_publisher 944 ), 945 'opengraphPublishedTime' => wp_gql_seo_format_string( 946 YoastSEO()->meta->for_term($term->term_id) 947 ->open_graph_article_published_time 948 ), 949 'opengraphModifiedTime' => wp_gql_seo_format_string( 950 YoastSEO()->meta->for_term($term->term_id) 951 ->open_graph_article_modified_time 952 ), 953 'opengraphDescription' => wp_gql_seo_format_string( 954 YoastSEO()->meta->for_term($term->term_id) 955 ->open_graph_description 956 ), 957 'opengraphImage' => DataSource::resolve_post_object( 958 $meta['wpseo_opengraph-image-id'], 959 $context 960 ), 961 'twitterCardType' => wp_gql_seo_format_string( 962 YoastSEO()->meta->for_term($term->term_id) 963 ->twitter_card 964 ), 965 'twitterTitle' => wp_gql_seo_format_string( 966 YoastSEO()->meta->for_term($term->term_id) 967 ->twitter_title 968 ), 969 'twitterDescription' => wp_gql_seo_format_string( 970 YoastSEO()->meta->for_term($term->term_id) 971 ->twitter_description 972 ), 973 'twitterImage' => DataSource::resolve_post_object( 974 $meta['wpseo_twitter-image-id'], 975 $context 976 ), 977 'canonical' => wp_gql_seo_format_string( 978 $meta['canonical'] 979 ), 980 'breadcrumbs' => YoastSEO()->meta->for_term( 981 $term->term_id 982 )->breadcrumbs, 983 'cornerstone' => boolval( 984 YoastSEO()->meta->for_term($term->term_id) 985 ->is_cornerstone 986 ), 987 ]; 988 wp_reset_query(); 989 990 return !empty($seo) ? $seo : null; 991 }, 992 ]); 556 993 } 557 }558 559 endif;560 }561 }562 563 564 565 register_graphql_field('User', 'seo', [566 'type' => 'SEOUser',567 'description' => __('The Yoast SEO data of a user', 'wp-graphql-yoast-seo'),568 'resolve' => function ($user, array $args, AppContext $context) {569 570 $robots = YoastSEO()->meta->for_author($user->userId)->robots;571 572 $userSeo = array(573 'title' => wp_gql_seo_format_string(YoastSEO()->meta->for_author($user->userId)->title),574 'metaDesc' => wp_gql_seo_format_string(YoastSEO()->meta->for_author($user->userId)->description),575 'metaRobotsNoindex' => $robots['index'],576 'metaRobotsNofollow' => $robots['follow'],577 578 'social' => array(579 'facebook' => wp_gql_seo_format_string(get_the_author_meta('facebook', $user->userId)),580 'twitter' => wp_gql_seo_format_string(get_the_author_meta('twitter', $user->userId)),581 'instagram' => wp_gql_seo_format_string(get_the_author_meta('instagram', $user->userId)),582 'linkedIn' => wp_gql_seo_format_string(get_the_author_meta('linkedin', $user->userId)),583 'mySpace' => wp_gql_seo_format_string(get_the_author_meta('myspace', $user->userId)),584 'pinterest' => wp_gql_seo_format_string(get_the_author_meta('pinterest', $user->userId)),585 'youTube' => wp_gql_seo_format_string(get_the_author_meta('youtube', $user->userId)),586 'soundCloud' => wp_gql_seo_format_string(get_the_author_meta('soundcloud', $user->userId)),587 'wikipedia' => wp_gql_seo_format_string(get_the_author_meta('wikipedia', $user->userId)),588 ),589 );590 591 return !empty($userSeo) ? $userSeo : [];592 },593 ]);594 595 if (!empty($taxonomies) && is_array($taxonomies)) {596 foreach ($taxonomies as $tax) {597 598 $taxonomy = get_taxonomy($tax);599 600 if (empty($taxonomy) || !isset($taxonomy->graphql_single_name)) {601 return;602 994 } 603 604 605 register_graphql_field($taxonomy->graphql_single_name, 'seo', [ 606 'type' => 'TaxonomySEO', 607 'description' => __('The Yoast SEO data of the ' . $taxonomy->label . ' taxonomy.', 'wp-graphql-yoast-seo'), 608 'resolve' => function ($term, array $args, AppContext $context) { 609 610 $term_obj = get_term($term->term_id); 611 612 $meta = WPSEO_Taxonomy_Meta::get_term_meta((int) $term_obj->term_id, $term_obj->taxonomy); 613 $robots = YoastSEO()->meta->for_term($term->term_id)->robots; 614 615 // Get data 616 $seo = array( 617 'title' => wp_gql_seo_format_string(html_entity_decode(strip_tags(YoastSEO()->meta->for_term($term->term_id)->title))), 618 'metaDesc' => wp_gql_seo_format_string(YoastSEO()->meta->for_term($term->term_id)->description), 619 'focuskw' => wp_gql_seo_format_string($meta['wpseo_focuskw']), 620 'metaKeywords' => wp_gql_seo_format_string($meta['wpseo_metakeywords']), 621 'metaRobotsNoindex' => $robots['index'], 622 'metaRobotsNofollow' => $robots['follow'], 623 'opengraphTitle' => wp_gql_seo_format_string(YoastSEO()->meta->for_term($term->term_id)->open_graph_title), 624 'opengraphUrl' => wp_gql_seo_format_string(YoastSEO()->meta->for_term($term->term_id)->open_graph_url), 625 'opengraphSiteName' => wp_gql_seo_format_string(YoastSEO()->meta->for_term($term->term_id)->open_graph_site_name), 626 'opengraphType' => wp_gql_seo_format_string(YoastSEO()->meta->for_term($term->term_id)->open_graph_type), 627 'opengraphAuthor' => wp_gql_seo_format_string(YoastSEO()->meta->for_term($term->term_id)->open_graph_article_author), 628 'opengraphPublisher' => wp_gql_seo_format_string(YoastSEO()->meta->for_term($term->term_id)->open_graph_article_publisher), 629 'opengraphPublishedTime' => wp_gql_seo_format_string(YoastSEO()->meta->for_term($term->term_id)->open_graph_article_published_time), 630 'opengraphModifiedTime' => wp_gql_seo_format_string(YoastSEO()->meta->for_term($term->term_id)->open_graph_article_modified_time), 631 'opengraphDescription' => wp_gql_seo_format_string(YoastSEO()->meta->for_term($term->term_id)->open_graph_description), 632 'opengraphImage' => DataSource::resolve_post_object($meta['wpseo_opengraph-image-id'], $context), 633 'twitterCardType' => wp_gql_seo_format_string(YoastSEO()->meta->for_term($term->term_id)->twitter_card), 634 'twitterTitle' => wp_gql_seo_format_string(YoastSEO()->meta->for_term($term->term_id)->twitter_title), 635 'twitterDescription' => wp_gql_seo_format_string(YoastSEO()->meta->for_term($term->term_id)->twitter_description), 636 'twitterImage' => DataSource::resolve_post_object($meta['wpseo_twitter-image-id'], $context), 637 'canonical' => wp_gql_seo_format_string($meta['canonical']), 638 'breadcrumbs' => YoastSEO()->meta->for_term($term->term_id)->breadcrumbs, 639 'cornerstone' => boolval(YoastSEO()->meta->for_term($term->term_id)->is_cornerstone), 640 ); 641 wp_reset_query(); 642 643 return !empty($seo) ? $seo : null; 644 } 645 ]); 646 } 647 } 648 }); 995 }); 649 996 }); -
add-wpgraphql-seo/trunk/CHANGELOG.md
r2395101 r2425433 6 6 and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 7 7 8 ## [4.9.0] - 2020-11-25 9 10 ### Added 11 12 - Coding standards (thanks @henrikwirth and @oriooctopus) 13 14 ### Changes 15 16 - Fixes null images from open graph 17 8 18 ## [4.8.0] - 2020-10-07 9 19 10 20 ### Added 11 21 12 - Added support for content type config22 - Added support for content type config 13 23 14 24 ## [4.7.1] - 2020-10-04 … … 16 26 ### Changes 17 27 18 - Fix categories28 - Fix categories 19 29 20 30 ## [4.7.0] - 2020-10-03 … … 22 32 ### Added 23 33 24 - Primary Category to edge.34 - Primary Category to edge. 25 35 26 36 ## [4.6.0] - 2020-09-08 … … 28 38 ### Added 29 39 30 - New Schema fields:31 -pageType32 -articleType33 - Added cornerstone flag34 35 ### Changed 36 37 - Changed Type used on Post Types and Taxonomies from `SEO` to `PostTypeSEO` and `TaxonomySEO`40 - New Schema fields: 41 - pageType 42 - articleType 43 - Added cornerstone flag 44 45 ### Changed 46 47 - Changed Type used on Post Types and Taxonomies from `SEO` to `PostTypeSEO` and `TaxonomySEO` 38 48 39 49 ## [4.5.5] - 2020-08-20 … … 41 51 ### Changed 42 52 43 - Updated readme.txt and readme.md for consistency and display issues.53 - Updated readme.txt and readme.md for consistency and display issues. 44 54 45 55 ## [4.5.4] - 2020-08-19 … … 47 57 ### Changed 48 58 49 - Readme.md update59 - Readme.md update 50 60 51 61 ## [4.5.3] - 2020-08-19 … … 53 63 ### Changed 54 64 55 - Build65 - Build 56 66 57 67 ## [4.5.2] - 2020-08-19 … … 59 69 ### Changed 60 70 61 - Build62 63 ### Added 64 65 - Added logos for WordPress66 67 ### Changed 68 69 - Changed Plugin Name: property to comply with WordPress.org71 - Build 72 73 ### Added 74 75 - Added logos for WordPress 76 77 ### Changed 78 79 - Changed Plugin Name: property to comply with WordPress.org 70 80 71 81 ## [4.5.1] - 2020-07-28 … … 73 83 ### Added 74 84 75 - Added inLanguage to Schema76 - Added function to tidy strings before returning77 78 ### Changed 79 80 - Changed Composer to note require dependency plugins but suggest them, to fix issues with MU Plugins85 - Added inLanguage to Schema 86 - Added function to tidy strings before returning 87 88 ### Changed 89 90 - Changed Composer to note require dependency plugins but suggest them, to fix issues with MU Plugins 81 91 82 92 ## [4.5.0] - 2020-07-13 … … 84 94 ### Added 85 95 86 - Added Frontpage and default openGraph Image96 - Added Frontpage and default openGraph Image 87 97 88 98 ## [4.4.1] - 2020-07-05 … … 90 100 ### Changed 91 101 92 - Fixes MU plugin issue and HTML entities in taxonomy titles102 - Fixes MU plugin issue and HTML entities in taxonomy titles 93 103 94 104 ## [4.4.0] - 2020-07-02 … … 96 106 ### Added 97 107 98 - Adds support for Author / User Metadata99 100 ### Changed 101 102 - Missing returns added, to avoid PHP notices - Thanks @jonshipman108 - Adds support for Author / User Metadata 109 110 ### Changed 111 112 - Missing returns added, to avoid PHP notices - Thanks @jonshipman 103 113 104 114 ## [4.3.0] - 2020-06-24 … … 106 116 ### Added 107 117 108 - Adds support for redirects (Yoast Premium)118 - Adds support for redirects (Yoast Premium) 109 119 110 120 ## [4.2.0] - 2020-06-15 … … 112 122 ### Added 113 123 114 - Adds check for dependencies124 - Adds check for dependencies 115 125 116 126 ## [4.1.0] - 2020-05-06 … … 118 128 ### Added 119 129 120 - Page / Tax SEO - opengraphUrl, opengraphSiteName, opengraphPublishedTime, opengraphModifiedTime - Thanks @izzygld121 - Global SEO > Schema - siteName, wordpressSiteName, siteUrl - Thanks @izzygld122 - Contributor Images added to readme130 - Page / Tax SEO - opengraphUrl, opengraphSiteName, opengraphPublishedTime, opengraphModifiedTime - Thanks @izzygld 131 - Global SEO > Schema - siteName, wordpressSiteName, siteUrl - Thanks @izzygld 132 - Contributor Images added to readme 123 133 124 134 ## [4.0.1] - 2020-05-03 … … 126 136 ### Added 127 137 128 - Support for Yoast 14129 - Breadcrumbs for post type and taxonomies130 - canonical url for post type and taxonomies138 - Support for Yoast 14 139 - Breadcrumbs for post type and taxonomies 140 - canonical url for post type and taxonomies 131 141 132 142 ## [3.3.0] - 2020-04-01 … … 136 146 Support for Yoast configuration data including: 137 147 138 - Webmaster verification139 - Social profiles140 - Schemas141 - Breadcrumbs (global config)148 - Webmaster verification 149 - Social profiles 150 - Schemas 151 - Breadcrumbs (global config) 142 152 143 153 ## [3.2.0] - 2020-03-09 … … 157 167 ### Changed 158 168 159 - BREAKING CHANGE - image urls are now returned as `mediaItem` type.160 This applies to `twitterImage` and `opengraphImage`169 - BREAKING CHANGE - image urls are now returned as `mediaItem` type. 170 This applies to `twitterImage` and `opengraphImage` 161 171 162 172 ## [2.1.1] - 2019-12-01 … … 164 174 ### Changed 165 175 166 - Update composer176 - Update composer 167 177 168 178 ## [2.1.0] - 2019-12-01 … … 170 180 ### Changed 171 181 172 - Fixed term data182 - Fixed term data 173 183 174 184 ## [2.1.0] - 2019-11-11 … … 176 186 ### Added 177 187 178 - Ability to query taxonomies for SEO data.179 - LICENSE file added188 - Ability to query taxonomies for SEO data. 189 - LICENSE file added 180 190 181 191 ## [2.1.0] - 2019-11-01 … … 183 193 ### Added 184 194 185 - Composer.json file added.195 - Composer.json file added. 186 196 187 197 ## [2.0.0] - 2019-07-08 … … 189 199 ### Changed 190 200 191 - Generated Meta title and descriptions201 - Generated Meta title and descriptions -
add-wpgraphql-seo/trunk/composer.json
r2365209 r2425433 13 13 "wp-graphql/wp-graphql": "Required to return data via GraphQl", 14 14 "yoast/wordpress-seo": "Required to provide SEO data to this plugin" 15 }, 16 "require-dev": { 17 "automattic/vipwpcs": "^2.2", 18 "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", 19 "squizlabs/php_codesniffer": "^3.5" 20 }, 21 "require": { 22 "phpcompatibility/phpcompatibility-wp": "^2.1" 15 23 } 16 24 } -
add-wpgraphql-seo/trunk/composer.lock
r2365209 r2425433 2 2 "_readme": [ 3 3 "This file locks the dependencies of your project to a known state", 4 "Read more about it at https://getcomposer.org/doc/01-basic-usage.md# composer-lock-the-lock-file",4 "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", 5 5 "This file is @generated automatically" 6 6 ], 7 "content-hash": " 12879d3de27da71da541e4eef19f0445",7 "content-hash": "aa0bc8e95c40b5f41d3301f1985c9db5", 8 8 "packages": [ 9 9 { 10 "name": "composer/installers", 11 "version": "v1.9.0", 12 "source": { 13 "type": "git", 14 "url": "https://github.com/composer/installers.git", 15 "reference": "b93bcf0fa1fccb0b7d176b0967d969691cd74cca" 16 }, 17 "dist": { 18 "type": "zip", 19 "url": "https://api.github.com/repos/composer/installers/zipball/b93bcf0fa1fccb0b7d176b0967d969691cd74cca", 20 "reference": "b93bcf0fa1fccb0b7d176b0967d969691cd74cca", 21 "shasum": "" 22 }, 23 "require": { 24 "composer-plugin-api": "^1.0 || ^2.0" 25 }, 26 "replace": { 27 "roundcube/plugin-installer": "*", 28 "shama/baton": "*" 29 }, 30 "require-dev": { 31 "composer/composer": "1.6.* || 2.0.*@dev", 32 "composer/semver": "1.0.* || 2.0.*@dev", 33 "phpunit/phpunit": "^4.8.36", 34 "sebastian/comparator": "^1.2.4", 35 "symfony/process": "^2.3" 36 }, 37 "type": "composer-plugin", 38 "extra": { 39 "class": "Composer\\Installers\\Plugin", 40 "branch-alias": { 41 "dev-master": "1.0-dev" 42 } 43 }, 44 "autoload": { 45 "psr-4": { 46 "Composer\\Installers\\": "src/Composer/Installers" 47 } 48 }, 49 "notification-url": "https://packagist.org/downloads/", 50 "license": [ 51 "MIT" 52 ], 53 "authors": [ 54 { 55 "name": "Kyle Robinson Young", 56 "email": "kyle@dontkry.com", 57 "homepage": "https://github.com/shama" 58 } 59 ], 60 "description": "A multi-framework Composer library installer", 61 "homepage": "https://composer.github.io/installers/", 62 "keywords": [ 63 "Craft", 64 "Dolibarr", 65 "Eliasis", 66 "Hurad", 67 "ImageCMS", 68 "Kanboard", 69 "Lan Management System", 70 "MODX Evo", 71 "MantisBT", 72 "Mautic", 73 "Maya", 74 "OXID", 75 "Plentymarkets", 76 "Porto", 77 "RadPHP", 78 "SMF", 79 "Thelia", 80 "Whmcs", 81 "WolfCMS", 82 "agl", 83 "aimeos", 84 "annotatecms", 85 "attogram", 86 "bitrix", 87 "cakephp", 88 "chef", 89 "cockpit", 90 "codeigniter", 91 "concrete5", 92 "croogo", 93 "dokuwiki", 94 "drupal", 95 "eZ Platform", 96 "elgg", 97 "expressionengine", 98 "fuelphp", 99 "grav", 100 "installer", 101 "itop", 102 "joomla", 103 "known", 104 "kohana", 105 "laravel", 106 "lavalite", 107 "lithium", 108 "magento", 109 "majima", 110 "mako", 111 "mediawiki", 112 "modulework", 113 "modx", 114 "moodle", 115 "osclass", 116 "phpbb", 117 "piwik", 118 "ppi", 119 "puppet", 120 "pxcms", 121 "reindex", 122 "roundcube", 123 "shopware", 124 "silverstripe", 125 "sydes", 126 "sylius", 127 "symfony", 128 "typo3", 129 "wordpress", 130 "yawik", 131 "zend", 132 "zikula" 133 ], 134 "time": "2020-04-07T06:57:05+00:00" 135 }, 136 { 137 "name": "guzzlehttp/guzzle", 138 "version": "6.5.5", 139 "source": { 140 "type": "git", 141 "url": "https://github.com/guzzle/guzzle.git", 142 "reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e" 143 }, 144 "dist": { 145 "type": "zip", 146 "url": "https://api.github.com/repos/guzzle/guzzle/zipball/9d4290de1cfd701f38099ef7e183b64b4b7b0c5e", 147 "reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e", 148 "shasum": "" 149 }, 150 "require": { 151 "ext-json": "*", 152 "guzzlehttp/promises": "^1.0", 153 "guzzlehttp/psr7": "^1.6.1", 154 "php": ">=5.5", 155 "symfony/polyfill-intl-idn": "^1.17.0" 156 }, 157 "require-dev": { 158 "ext-curl": "*", 159 "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", 160 "psr/log": "^1.1" 10 "name": "phpcompatibility/php-compatibility", 11 "version": "9.3.5", 12 "source": { 13 "type": "git", 14 "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", 15 "reference": "9fb324479acf6f39452e0655d2429cc0d3914243" 16 }, 17 "dist": { 18 "type": "zip", 19 "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243", 20 "reference": "9fb324479acf6f39452e0655d2429cc0d3914243", 21 "shasum": "" 22 }, 23 "require": { 24 "php": ">=5.3", 25 "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" 26 }, 27 "conflict": { 28 "squizlabs/php_codesniffer": "2.6.2" 29 }, 30 "require-dev": { 31 "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" 161 32 }, 162 33 "suggest": { 163 "psr/log": "Required for using the Log middleware" 164 }, 34 "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.", 35 "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." 36 }, 37 "type": "phpcodesniffer-standard", 38 "notification-url": "https://packagist.org/downloads/", 39 "license": [ 40 "LGPL-3.0-or-later" 41 ], 42 "authors": [ 43 { 44 "name": "Wim Godden", 45 "homepage": "https://github.com/wimg", 46 "role": "lead" 47 }, 48 { 49 "name": "Juliette Reinders Folmer", 50 "homepage": "https://github.com/jrfnl", 51 "role": "lead" 52 }, 53 { 54 "name": "Contributors", 55 "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors" 56 } 57 ], 58 "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.", 59 "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", 60 "keywords": [ 61 "compatibility", 62 "phpcs", 63 "standards" 64 ], 65 "time": "2019-12-27T09:44:58+00:00" 66 }, 67 { 68 "name": "phpcompatibility/phpcompatibility-paragonie", 69 "version": "1.3.0", 70 "source": { 71 "type": "git", 72 "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git", 73 "reference": "b862bc32f7e860d0b164b199bd995e690b4b191c" 74 }, 75 "dist": { 76 "type": "zip", 77 "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/b862bc32f7e860d0b164b199bd995e690b4b191c", 78 "reference": "b862bc32f7e860d0b164b199bd995e690b4b191c", 79 "shasum": "" 80 }, 81 "require": { 82 "phpcompatibility/php-compatibility": "^9.0" 83 }, 84 "require-dev": { 85 "dealerdirect/phpcodesniffer-composer-installer": "^0.5", 86 "paragonie/random_compat": "dev-master", 87 "paragonie/sodium_compat": "dev-master" 88 }, 89 "suggest": { 90 "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", 91 "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." 92 }, 93 "type": "phpcodesniffer-standard", 94 "notification-url": "https://packagist.org/downloads/", 95 "license": [ 96 "LGPL-3.0-or-later" 97 ], 98 "authors": [ 99 { 100 "name": "Wim Godden", 101 "role": "lead" 102 }, 103 { 104 "name": "Juliette Reinders Folmer", 105 "role": "lead" 106 } 107 ], 108 "description": "A set of rulesets for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by the Paragonie polyfill libraries.", 109 "homepage": "http://phpcompatibility.com/", 110 "keywords": [ 111 "compatibility", 112 "paragonie", 113 "phpcs", 114 "polyfill", 115 "standards" 116 ], 117 "time": "2019-11-04T15:17:54+00:00" 118 }, 119 { 120 "name": "phpcompatibility/phpcompatibility-wp", 121 "version": "2.1.0", 122 "source": { 123 "type": "git", 124 "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git", 125 "reference": "41bef18ba688af638b7310666db28e1ea9158b2f" 126 }, 127 "dist": { 128 "type": "zip", 129 "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/41bef18ba688af638b7310666db28e1ea9158b2f", 130 "reference": "41bef18ba688af638b7310666db28e1ea9158b2f", 131 "shasum": "" 132 }, 133 "require": { 134 "phpcompatibility/php-compatibility": "^9.0", 135 "phpcompatibility/phpcompatibility-paragonie": "^1.0" 136 }, 137 "require-dev": { 138 "dealerdirect/phpcodesniffer-composer-installer": "^0.5" 139 }, 140 "suggest": { 141 "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", 142 "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." 143 }, 144 "type": "phpcodesniffer-standard", 145 "notification-url": "https://packagist.org/downloads/", 146 "license": [ 147 "LGPL-3.0-or-later" 148 ], 149 "authors": [ 150 { 151 "name": "Wim Godden", 152 "role": "lead" 153 }, 154 { 155 "name": "Juliette Reinders Folmer", 156 "role": "lead" 157 } 158 ], 159 "description": "A ruleset for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by WordPress.", 160 "homepage": "http://phpcompatibility.com/", 161 "keywords": [ 162 "compatibility", 163 "phpcs", 164 "standards", 165 "wordpress" 166 ], 167 "time": "2019-08-28T14:22:28+00:00" 168 }, 169 { 170 "name": "squizlabs/php_codesniffer", 171 "version": "3.5.8", 172 "source": { 173 "type": "git", 174 "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", 175 "reference": "9d583721a7157ee997f235f327de038e7ea6dac4" 176 }, 177 "dist": { 178 "type": "zip", 179 "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/9d583721a7157ee997f235f327de038e7ea6dac4", 180 "reference": "9d583721a7157ee997f235f327de038e7ea6dac4", 181 "shasum": "" 182 }, 183 "require": { 184 "ext-simplexml": "*", 185 "ext-tokenizer": "*", 186 "ext-xmlwriter": "*", 187 "php": ">=5.4.0" 188 }, 189 "require-dev": { 190 "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" 191 }, 192 "bin": [ 193 "bin/phpcs", 194 "bin/phpcbf" 195 ], 165 196 "type": "library", 166 197 "extra": { 167 198 "branch-alias": { 168 "dev-master": "6.5-dev" 169 } 199 "dev-master": "3.x-dev" 200 } 201 }, 202 "notification-url": "https://packagist.org/downloads/", 203 "license": [ 204 "BSD-3-Clause" 205 ], 206 "authors": [ 207 { 208 "name": "Greg Sherwood", 209 "role": "lead" 210 } 211 ], 212 "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", 213 "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", 214 "keywords": [ 215 "phpcs", 216 "standards" 217 ], 218 "time": "2020-10-23T02:01:07+00:00" 219 } 220 ], 221 "packages-dev": [ 222 { 223 "name": "automattic/vipwpcs", 224 "version": "2.2.0", 225 "source": { 226 "type": "git", 227 "url": "https://github.com/Automattic/VIP-Coding-Standards.git", 228 "reference": "4d0612461232b313d06321f1501c3989bd6aecf9" 229 }, 230 "dist": { 231 "type": "zip", 232 "url": "https://api.github.com/repos/Automattic/VIP-Coding-Standards/zipball/4d0612461232b313d06321f1501c3989bd6aecf9", 233 "reference": "4d0612461232b313d06321f1501c3989bd6aecf9", 234 "shasum": "" 235 }, 236 "require": { 237 "php": ">=5.4", 238 "sirbrillig/phpcs-variable-analysis": "^2.8.3", 239 "squizlabs/php_codesniffer": "^3.5.5", 240 "wp-coding-standards/wpcs": "^2.3" 241 }, 242 "require-dev": { 243 "dealerdirect/phpcodesniffer-composer-installer": "^0.7", 244 "phpcompatibility/php-compatibility": "^9", 245 "phpunit/phpunit": "^4 || ^5 || ^6 || ^7" 246 }, 247 "suggest": { 248 "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will manage the PHPCS 'installed_paths' automatically." 249 }, 250 "type": "phpcodesniffer-standard", 251 "notification-url": "https://packagist.org/downloads/", 252 "license": [ 253 "MIT" 254 ], 255 "authors": [ 256 { 257 "name": "Contributors", 258 "homepage": "https://github.com/Automattic/VIP-Coding-Standards/graphs/contributors" 259 } 260 ], 261 "description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress VIP minimum coding conventions", 262 "keywords": [ 263 "phpcs", 264 "standards", 265 "wordpress" 266 ], 267 "time": "2020-09-07T10:45:45+00:00" 268 }, 269 { 270 "name": "dealerdirect/phpcodesniffer-composer-installer", 271 "version": "v0.7.0", 272 "source": { 273 "type": "git", 274 "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", 275 "reference": "e8d808670b8f882188368faaf1144448c169c0b7" 276 }, 277 "dist": { 278 "type": "zip", 279 "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/e8d808670b8f882188368faaf1144448c169c0b7", 280 "reference": "e8d808670b8f882188368faaf1144448c169c0b7", 281 "shasum": "" 282 }, 283 "require": { 284 "composer-plugin-api": "^1.0 || ^2.0", 285 "php": ">=5.3", 286 "squizlabs/php_codesniffer": "^2 || ^3 || 4.0.x-dev" 287 }, 288 "require-dev": { 289 "composer/composer": "*", 290 "phpcompatibility/php-compatibility": "^9.0", 291 "sensiolabs/security-checker": "^4.1.0" 292 }, 293 "type": "composer-plugin", 294 "extra": { 295 "class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" 170 296 }, 171 297 "autoload": { 172 298 "psr-4": { 173 "GuzzleHttp\\": "src/" 174 }, 175 "files": [ 176 "src/functions_include.php" 177 ] 299 "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" 300 } 178 301 }, 179 302 "notification-url": "https://packagist.org/downloads/", … … 183 306 "authors": [ 184 307 { 185 "name": "Michael Dowling", 186 "email": "mtdowling@gmail.com", 187 "homepage": "https://github.com/mtdowling" 188 } 189 ], 190 "description": "Guzzle is a PHP HTTP client library", 191 "homepage": "http://guzzlephp.org/", 192 "keywords": [ 193 "client", 194 "curl", 195 "framework", 196 "http", 197 "http client", 198 "rest", 199 "web service" 200 ], 201 "time": "2020-06-16T21:01:06+00:00" 202 }, 203 { 204 "name": "guzzlehttp/promises", 205 "version": "v1.3.1", 206 "source": { 207 "type": "git", 208 "url": "https://github.com/guzzle/promises.git", 209 "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" 210 }, 211 "dist": { 212 "type": "zip", 213 "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", 214 "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", 215 "shasum": "" 216 }, 217 "require": { 218 "php": ">=5.5.0" 219 }, 220 "require-dev": { 221 "phpunit/phpunit": "^4.0" 222 }, 223 "type": "library", 224 "extra": { 225 "branch-alias": { 226 "dev-master": "1.4-dev" 227 } 228 }, 308 "name": "Franck Nijhof", 309 "email": "franck.nijhof@dealerdirect.com", 310 "homepage": "http://www.frenck.nl", 311 "role": "Developer / IT Manager" 312 } 313 ], 314 "description": "PHP_CodeSniffer Standards Composer Installer Plugin", 315 "homepage": "http://www.dealerdirect.com", 316 "keywords": [ 317 "PHPCodeSniffer", 318 "PHP_CodeSniffer", 319 "code quality", 320 "codesniffer", 321 "composer", 322 "installer", 323 "phpcs", 324 "plugin", 325 "qa", 326 "quality", 327 "standard", 328 "standards", 329 "style guide", 330 "stylecheck", 331 "tests" 332 ], 333 "time": "2020-06-25T14:57:39+00:00" 334 }, 335 { 336 "name": "sirbrillig/phpcs-variable-analysis", 337 "version": "v2.9.0", 338 "source": { 339 "type": "git", 340 "url": "https://github.com/sirbrillig/phpcs-variable-analysis.git", 341 "reference": "ff54d4ec7f2bd152d526fdabfeff639aa9b8be01" 342 }, 343 "dist": { 344 "type": "zip", 345 "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/ff54d4ec7f2bd152d526fdabfeff639aa9b8be01", 346 "reference": "ff54d4ec7f2bd152d526fdabfeff639aa9b8be01", 347 "shasum": "" 348 }, 349 "require": { 350 "php": ">=5.4.0", 351 "squizlabs/php_codesniffer": "^3.1" 352 }, 353 "require-dev": { 354 "dealerdirect/phpcodesniffer-composer-installer": "^0.4.4 || ^0.5 || ^0.6", 355 "limedeck/phpunit-detailed-printer": "^3.1 || ^4.0 || ^5.0", 356 "phpstan/phpstan": "^0.11.8", 357 "phpunit/phpunit": "^5.0 || ^6.5 || ^7.0 || ^8.0", 358 "sirbrillig/phpcs-import-detection": "^1.1" 359 }, 360 "type": "phpcodesniffer-standard", 229 361 "autoload": { 230 362 "psr-4": { 231 "GuzzleHttp\\Promise\\": "src/" 363 "VariableAnalysis\\": "VariableAnalysis/" 364 } 365 }, 366 "notification-url": "https://packagist.org/downloads/", 367 "license": [ 368 "BSD-2-Clause" 369 ], 370 "authors": [ 371 { 372 "name": "Sam Graham", 373 "email": "php-codesniffer-variableanalysis@illusori.co.uk" 232 374 }, 233 "files": [ 234 "src/functions_include.php" 235 ] 236 }, 375 { 376 "name": "Payton Swick", 377 "email": "payton@foolord.com" 378 } 379 ], 380 "description": "A PHPCS sniff to detect problems with variables.", 381 "time": "2020-10-07T23:32:29+00:00" 382 }, 383 { 384 "name": "wp-coding-standards/wpcs", 385 "version": "2.3.0", 386 "source": { 387 "type": "git", 388 "url": "https://github.com/WordPress/WordPress-Coding-Standards.git", 389 "reference": "7da1894633f168fe244afc6de00d141f27517b62" 390 }, 391 "dist": { 392 "type": "zip", 393 "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/7da1894633f168fe244afc6de00d141f27517b62", 394 "reference": "7da1894633f168fe244afc6de00d141f27517b62", 395 "shasum": "" 396 }, 397 "require": { 398 "php": ">=5.4", 399 "squizlabs/php_codesniffer": "^3.3.1" 400 }, 401 "require-dev": { 402 "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || ^0.6", 403 "phpcompatibility/php-compatibility": "^9.0", 404 "phpcsstandards/phpcsdevtools": "^1.0", 405 "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" 406 }, 407 "suggest": { 408 "dealerdirect/phpcodesniffer-composer-installer": "^0.6 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically." 409 }, 410 "type": "phpcodesniffer-standard", 237 411 "notification-url": "https://packagist.org/downloads/", 238 412 "license": [ … … 241 415 "authors": [ 242 416 { 243 "name": "Michael Dowling", 244 "email": "mtdowling@gmail.com", 245 "homepage": "https://github.com/mtdowling" 246 } 247 ], 248 "description": "Guzzle promises library", 249 "keywords": [ 250 "promise" 251 ], 252 "time": "2016-12-20T10:07:11+00:00" 253 }, 254 { 255 "name": "guzzlehttp/psr7", 256 "version": "1.6.1", 257 "source": { 258 "type": "git", 259 "url": "https://github.com/guzzle/psr7.git", 260 "reference": "239400de7a173fe9901b9ac7c06497751f00727a" 261 }, 262 "dist": { 263 "type": "zip", 264 "url": "https://api.github.com/repos/guzzle/psr7/zipball/239400de7a173fe9901b9ac7c06497751f00727a", 265 "reference": "239400de7a173fe9901b9ac7c06497751f00727a", 266 "shasum": "" 267 }, 268 "require": { 269 "php": ">=5.4.0", 270 "psr/http-message": "~1.0", 271 "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" 272 }, 273 "provide": { 274 "psr/http-message-implementation": "1.0" 275 }, 276 "require-dev": { 277 "ext-zlib": "*", 278 "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8" 279 }, 280 "suggest": { 281 "zendframework/zend-httphandlerrunner": "Emit PSR-7 responses" 282 }, 283 "type": "library", 284 "extra": { 285 "branch-alias": { 286 "dev-master": "1.6-dev" 287 } 288 }, 289 "autoload": { 290 "psr-4": { 291 "GuzzleHttp\\Psr7\\": "src/" 292 }, 293 "files": [ 294 "src/functions_include.php" 295 ] 296 }, 297 "notification-url": "https://packagist.org/downloads/", 298 "license": [ 299 "MIT" 300 ], 301 "authors": [ 302 { 303 "name": "Michael Dowling", 304 "email": "mtdowling@gmail.com", 305 "homepage": "https://github.com/mtdowling" 306 }, 307 { 308 "name": "Tobias Schultze", 309 "homepage": "https://github.com/Tobion" 310 } 311 ], 312 "description": "PSR-7 message implementation that also provides common utility methods", 313 "keywords": [ 314 "http", 315 "message", 316 "psr-7", 317 "request", 318 "response", 319 "stream", 320 "uri", 321 "url" 322 ], 323 "time": "2019-07-01T23:21:34+00:00" 324 }, 325 { 326 "name": "ivome/graphql-relay-php", 327 "version": "v0.3.1", 328 "source": { 329 "type": "git", 330 "url": "https://github.com/ivome/graphql-relay-php.git", 331 "reference": "bc5f8aae9fd72ca16decce3892ec4311e9742a93" 332 }, 333 "dist": { 334 "type": "zip", 335 "url": "https://api.github.com/repos/ivome/graphql-relay-php/zipball/bc5f8aae9fd72ca16decce3892ec4311e9742a93", 336 "reference": "bc5f8aae9fd72ca16decce3892ec4311e9742a93", 337 "shasum": "" 338 }, 339 "require": { 340 "php": ">=5.4,<8.0-DEV", 341 "webonyx/graphql-php": ">=0.7.0" 342 }, 343 "require-dev": { 344 "phpunit/phpunit": "^4.8", 345 "satooshi/php-coveralls": "~1.0" 346 }, 347 "type": "library", 348 "autoload": { 349 "classmap": [ 350 "src/" 351 ] 352 }, 353 "notification-url": "https://packagist.org/downloads/", 354 "license": [ 355 "BSD" 356 ], 357 "description": "A PHP port of GraphQL Relay reference implementation", 358 "homepage": "https://github.com/ivome/graphql-relay-php", 359 "keywords": [ 360 "Relay", 361 "api", 362 "graphql" 363 ], 364 "time": "2016-10-29T23:29:29+00:00" 365 }, 366 { 367 "name": "league/oauth2-client", 368 "version": "2.4.1", 369 "source": { 370 "type": "git", 371 "url": "https://github.com/thephpleague/oauth2-client.git", 372 "reference": "cc114abc622a53af969e8664722e84ca36257530" 373 }, 374 "dist": { 375 "type": "zip", 376 "url": "https://api.github.com/repos/thephpleague/oauth2-client/zipball/cc114abc622a53af969e8664722e84ca36257530", 377 "reference": "cc114abc622a53af969e8664722e84ca36257530", 378 "shasum": "" 379 }, 380 "require": { 381 "guzzlehttp/guzzle": "^6.0", 382 "paragonie/random_compat": "^1|^2|^9.99", 383 "php": "^5.6|^7.0" 384 }, 385 "require-dev": { 386 "eloquent/liberator": "^2.0", 387 "eloquent/phony-phpunit": "^1.0|^3.0", 388 "jakub-onderka/php-parallel-lint": "^0.9.2", 389 "phpunit/phpunit": "^5.7|^6.0", 390 "squizlabs/php_codesniffer": "^2.3|^3.0" 391 }, 392 "type": "library", 393 "extra": { 394 "branch-alias": { 395 "dev-2.x": "2.0.x-dev" 396 } 397 }, 398 "autoload": { 399 "psr-4": { 400 "League\\OAuth2\\Client\\": "src/" 401 } 402 }, 403 "notification-url": "https://packagist.org/downloads/", 404 "license": [ 405 "MIT" 406 ], 407 "authors": [ 408 { 409 "name": "Alex Bilbie", 410 "email": "hello@alexbilbie.com", 411 "homepage": "http://www.alexbilbie.com", 412 "role": "Developer" 413 }, 414 { 415 "name": "Woody Gilk", 416 "homepage": "https://github.com/shadowhand", 417 "role": "Contributor" 418 } 419 ], 420 "description": "OAuth 2.0 Client Library", 421 "keywords": [ 422 "Authentication", 423 "SSO", 424 "authorization", 425 "identity", 426 "idp", 427 "oauth", 428 "oauth2", 429 "single sign on" 430 ], 431 "time": "2018-11-22T18:33:57+00:00" 432 }, 433 { 434 "name": "paragonie/random_compat", 435 "version": "v9.99.99", 436 "source": { 437 "type": "git", 438 "url": "https://github.com/paragonie/random_compat.git", 439 "reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95" 440 }, 441 "dist": { 442 "type": "zip", 443 "url": "https://api.github.com/repos/paragonie/random_compat/zipball/84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95", 444 "reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95", 445 "shasum": "" 446 }, 447 "require": { 448 "php": "^7" 449 }, 450 "require-dev": { 451 "phpunit/phpunit": "4.*|5.*", 452 "vimeo/psalm": "^1" 453 }, 454 "suggest": { 455 "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." 456 }, 457 "type": "library", 458 "notification-url": "https://packagist.org/downloads/", 459 "license": [ 460 "MIT" 461 ], 462 "authors": [ 463 { 464 "name": "Paragon Initiative Enterprises", 465 "email": "security@paragonie.com", 466 "homepage": "https://paragonie.com" 467 } 468 ], 469 "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", 470 "keywords": [ 471 "csprng", 472 "polyfill", 473 "pseudorandom", 474 "random" 475 ], 476 "time": "2018-07-02T15:55:56+00:00" 477 }, 478 { 479 "name": "pimple/pimple", 480 "version": "v3.3.0", 481 "source": { 482 "type": "git", 483 "url": "https://github.com/silexphp/Pimple.git", 484 "reference": "e55d12f9d6a0e7f9c85992b73df1267f46279930" 485 }, 486 "dist": { 487 "type": "zip", 488 "url": "https://api.github.com/repos/silexphp/Pimple/zipball/e55d12f9d6a0e7f9c85992b73df1267f46279930", 489 "reference": "e55d12f9d6a0e7f9c85992b73df1267f46279930", 490 "shasum": "" 491 }, 492 "require": { 493 "php": "^7.2.5", 494 "psr/container": "^1.0" 495 }, 496 "require-dev": { 497 "symfony/phpunit-bridge": "^3.4|^4.4|^5.0" 498 }, 499 "type": "library", 500 "extra": { 501 "branch-alias": { 502 "dev-master": "3.3.x-dev" 503 } 504 }, 505 "autoload": { 506 "psr-0": { 507 "Pimple": "src/" 508 } 509 }, 510 "notification-url": "https://packagist.org/downloads/", 511 "license": [ 512 "MIT" 513 ], 514 "authors": [ 515 { 516 "name": "Fabien Potencier", 517 "email": "fabien@symfony.com" 518 } 519 ], 520 "description": "Pimple, a simple Dependency Injection Container", 521 "homepage": "https://pimple.symfony.com", 522 "keywords": [ 523 "container", 524 "dependency injection" 525 ], 526 "time": "2020-03-03T09:12:48+00:00" 527 }, 528 { 529 "name": "psr/container", 530 "version": "1.0.0", 531 "source": { 532 "type": "git", 533 "url": "https://github.com/php-fig/container.git", 534 "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" 535 }, 536 "dist": { 537 "type": "zip", 538 "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", 539 "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", 540 "shasum": "" 541 }, 542 "require": { 543 "php": ">=5.3.0" 544 }, 545 "type": "library", 546 "extra": { 547 "branch-alias": { 548 "dev-master": "1.0.x-dev" 549 } 550 }, 551 "autoload": { 552 "psr-4": { 553 "Psr\\Container\\": "src/" 554 } 555 }, 556 "notification-url": "https://packagist.org/downloads/", 557 "license": [ 558 "MIT" 559 ], 560 "authors": [ 561 { 562 "name": "PHP-FIG", 563 "homepage": "http://www.php-fig.org/" 564 } 565 ], 566 "description": "Common Container Interface (PHP FIG PSR-11)", 567 "homepage": "https://github.com/php-fig/container", 568 "keywords": [ 569 "PSR-11", 570 "container", 571 "container-interface", 572 "container-interop", 573 "psr" 574 ], 575 "time": "2017-02-14T16:28:37+00:00" 576 }, 577 { 578 "name": "psr/http-message", 579 "version": "1.0.1", 580 "source": { 581 "type": "git", 582 "url": "https://github.com/php-fig/http-message.git", 583 "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" 584 }, 585 "dist": { 586 "type": "zip", 587 "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", 588 "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", 589 "shasum": "" 590 }, 591 "require": { 592 "php": ">=5.3.0" 593 }, 594 "type": "library", 595 "extra": { 596 "branch-alias": { 597 "dev-master": "1.0.x-dev" 598 } 599 }, 600 "autoload": { 601 "psr-4": { 602 "Psr\\Http\\Message\\": "src/" 603 } 604 }, 605 "notification-url": "https://packagist.org/downloads/", 606 "license": [ 607 "MIT" 608 ], 609 "authors": [ 610 { 611 "name": "PHP-FIG", 612 "homepage": "http://www.php-fig.org/" 613 } 614 ], 615 "description": "Common interface for HTTP messages", 616 "homepage": "https://github.com/php-fig/http-message", 617 "keywords": [ 618 "http", 619 "http-message", 620 "psr", 621 "psr-7", 622 "request", 623 "response" 624 ], 625 "time": "2016-08-06T14:39:51+00:00" 626 }, 627 { 628 "name": "psr/log", 629 "version": "1.1.3", 630 "source": { 631 "type": "git", 632 "url": "https://github.com/php-fig/log.git", 633 "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" 634 }, 635 "dist": { 636 "type": "zip", 637 "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", 638 "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", 639 "shasum": "" 640 }, 641 "require": { 642 "php": ">=5.3.0" 643 }, 644 "type": "library", 645 "extra": { 646 "branch-alias": { 647 "dev-master": "1.1.x-dev" 648 } 649 }, 650 "autoload": { 651 "psr-4": { 652 "Psr\\Log\\": "Psr/Log/" 653 } 654 }, 655 "notification-url": "https://packagist.org/downloads/", 656 "license": [ 657 "MIT" 658 ], 659 "authors": [ 660 { 661 "name": "PHP-FIG", 662 "homepage": "http://www.php-fig.org/" 663 } 664 ], 665 "description": "Common interface for logging libraries", 666 "homepage": "https://github.com/php-fig/log", 667 "keywords": [ 668 "log", 669 "psr", 670 "psr-3" 671 ], 672 "time": "2020-03-23T09:12:05+00:00" 673 }, 674 { 675 "name": "ralouphie/getallheaders", 676 "version": "3.0.3", 677 "source": { 678 "type": "git", 679 "url": "https://github.com/ralouphie/getallheaders.git", 680 "reference": "120b605dfeb996808c31b6477290a714d356e822" 681 }, 682 "dist": { 683 "type": "zip", 684 "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", 685 "reference": "120b605dfeb996808c31b6477290a714d356e822", 686 "shasum": "" 687 }, 688 "require": { 689 "php": ">=5.6" 690 }, 691 "require-dev": { 692 "php-coveralls/php-coveralls": "^2.1", 693 "phpunit/phpunit": "^5 || ^6.5" 694 }, 695 "type": "library", 696 "autoload": { 697 "files": [ 698 "src/getallheaders.php" 699 ] 700 }, 701 "notification-url": "https://packagist.org/downloads/", 702 "license": [ 703 "MIT" 704 ], 705 "authors": [ 706 { 707 "name": "Ralph Khattar", 708 "email": "ralph.khattar@gmail.com" 709 } 710 ], 711 "description": "A polyfill for getallheaders.", 712 "time": "2019-03-08T08:55:37+00:00" 713 }, 714 { 715 "name": "symfony/dependency-injection", 716 "version": "v3.4.42", 717 "source": { 718 "type": "git", 719 "url": "https://github.com/symfony/dependency-injection.git", 720 "reference": "e39380b7104b0ec538a075ae919f00c7e5267bac" 721 }, 722 "dist": { 723 "type": "zip", 724 "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/e39380b7104b0ec538a075ae919f00c7e5267bac", 725 "reference": "e39380b7104b0ec538a075ae919f00c7e5267bac", 726 "shasum": "" 727 }, 728 "require": { 729 "php": "^5.5.9|>=7.0.8", 730 "psr/container": "^1.0" 731 }, 732 "conflict": { 733 "symfony/config": "<3.3.7", 734 "symfony/finder": "<3.3", 735 "symfony/proxy-manager-bridge": "<3.4", 736 "symfony/yaml": "<3.4" 737 }, 738 "provide": { 739 "psr/container-implementation": "1.0" 740 }, 741 "require-dev": { 742 "symfony/config": "~3.3|~4.0", 743 "symfony/expression-language": "~2.8|~3.0|~4.0", 744 "symfony/yaml": "~3.4|~4.0" 745 }, 746 "suggest": { 747 "symfony/config": "", 748 "symfony/expression-language": "For using expressions in service container configuration", 749 "symfony/finder": "For using double-star glob patterns or when GLOB_BRACE portability is required", 750 "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", 751 "symfony/yaml": "" 752 }, 753 "type": "library", 754 "extra": { 755 "branch-alias": { 756 "dev-master": "3.4-dev" 757 } 758 }, 759 "autoload": { 760 "psr-4": { 761 "Symfony\\Component\\DependencyInjection\\": "" 762 }, 763 "exclude-from-classmap": [ 764 "/Tests/" 765 ] 766 }, 767 "notification-url": "https://packagist.org/downloads/", 768 "license": [ 769 "MIT" 770 ], 771 "authors": [ 772 { 773 "name": "Fabien Potencier", 774 "email": "fabien@symfony.com" 775 }, 776 { 777 "name": "Symfony Community", 778 "homepage": "https://symfony.com/contributors" 779 } 780 ], 781 "description": "Symfony DependencyInjection Component", 782 "homepage": "https://symfony.com", 783 "time": "2020-05-30T21:06:01+00:00" 784 }, 785 { 786 "name": "symfony/polyfill-intl-idn", 787 "version": "v1.17.1", 788 "source": { 789 "type": "git", 790 "url": "https://github.com/symfony/polyfill-intl-idn.git", 791 "reference": "a57f8161502549a742a63c09f0a604997bf47027" 792 }, 793 "dist": { 794 "type": "zip", 795 "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/a57f8161502549a742a63c09f0a604997bf47027", 796 "reference": "a57f8161502549a742a63c09f0a604997bf47027", 797 "shasum": "" 798 }, 799 "require": { 800 "php": ">=5.3.3", 801 "symfony/polyfill-mbstring": "^1.3", 802 "symfony/polyfill-php72": "^1.10" 803 }, 804 "suggest": { 805 "ext-intl": "For best performance" 806 }, 807 "type": "library", 808 "extra": { 809 "branch-alias": { 810 "dev-master": "1.17-dev" 811 }, 812 "thanks": { 813 "name": "symfony/polyfill", 814 "url": "https://github.com/symfony/polyfill" 815 } 816 }, 817 "autoload": { 818 "psr-4": { 819 "Symfony\\Polyfill\\Intl\\Idn\\": "" 820 }, 821 "files": [ 822 "bootstrap.php" 823 ] 824 }, 825 "notification-url": "https://packagist.org/downloads/", 826 "license": [ 827 "MIT" 828 ], 829 "authors": [ 830 { 831 "name": "Laurent Bassin", 832 "email": "laurent@bassin.info" 833 }, 834 { 835 "name": "Symfony Community", 836 "homepage": "https://symfony.com/contributors" 837 } 838 ], 839 "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", 840 "homepage": "https://symfony.com", 841 "keywords": [ 842 "compatibility", 843 "idn", 844 "intl", 845 "polyfill", 846 "portable", 847 "shim" 848 ], 849 "time": "2020-06-06T08:46:27+00:00" 850 }, 851 { 852 "name": "symfony/polyfill-mbstring", 853 "version": "v1.17.1", 854 "source": { 855 "type": "git", 856 "url": "https://github.com/symfony/polyfill-mbstring.git", 857 "reference": "7110338d81ce1cbc3e273136e4574663627037a7" 858 }, 859 "dist": { 860 "type": "zip", 861 "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/7110338d81ce1cbc3e273136e4574663627037a7", 862 "reference": "7110338d81ce1cbc3e273136e4574663627037a7", 863 "shasum": "" 864 }, 865 "require": { 866 "php": ">=5.3.3" 867 }, 868 "suggest": { 869 "ext-mbstring": "For best performance" 870 }, 871 "type": "library", 872 "extra": { 873 "branch-alias": { 874 "dev-master": "1.17-dev" 875 }, 876 "thanks": { 877 "name": "symfony/polyfill", 878 "url": "https://github.com/symfony/polyfill" 879 } 880 }, 881 "autoload": { 882 "psr-4": { 883 "Symfony\\Polyfill\\Mbstring\\": "" 884 }, 885 "files": [ 886 "bootstrap.php" 887 ] 888 }, 889 "notification-url": "https://packagist.org/downloads/", 890 "license": [ 891 "MIT" 892 ], 893 "authors": [ 894 { 895 "name": "Nicolas Grekas", 896 "email": "p@tchwork.com" 897 }, 898 { 899 "name": "Symfony Community", 900 "homepage": "https://symfony.com/contributors" 901 } 902 ], 903 "description": "Symfony polyfill for the Mbstring extension", 904 "homepage": "https://symfony.com", 905 "keywords": [ 906 "compatibility", 907 "mbstring", 908 "polyfill", 909 "portable", 910 "shim" 911 ], 912 "time": "2020-06-06T08:46:27+00:00" 913 }, 914 { 915 "name": "symfony/polyfill-php72", 916 "version": "v1.17.0", 917 "source": { 918 "type": "git", 919 "url": "https://github.com/symfony/polyfill-php72.git", 920 "reference": "f048e612a3905f34931127360bdd2def19a5e582" 921 }, 922 "dist": { 923 "type": "zip", 924 "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/f048e612a3905f34931127360bdd2def19a5e582", 925 "reference": "f048e612a3905f34931127360bdd2def19a5e582", 926 "shasum": "" 927 }, 928 "require": { 929 "php": ">=5.3.3" 930 }, 931 "type": "library", 932 "extra": { 933 "branch-alias": { 934 "dev-master": "1.17-dev" 935 } 936 }, 937 "autoload": { 938 "psr-4": { 939 "Symfony\\Polyfill\\Php72\\": "" 940 }, 941 "files": [ 942 "bootstrap.php" 943 ] 944 }, 945 "notification-url": "https://packagist.org/downloads/", 946 "license": [ 947 "MIT" 948 ], 949 "authors": [ 950 { 951 "name": "Nicolas Grekas", 952 "email": "p@tchwork.com" 953 }, 954 { 955 "name": "Symfony Community", 956 "homepage": "https://symfony.com/contributors" 957 } 958 ], 959 "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", 960 "homepage": "https://symfony.com", 961 "keywords": [ 962 "compatibility", 963 "polyfill", 964 "portable", 965 "shim" 966 ], 967 "time": "2020-05-12T16:47:27+00:00" 968 }, 969 { 970 "name": "webonyx/graphql-php", 971 "version": "v0.13.8", 972 "source": { 973 "type": "git", 974 "url": "https://github.com/webonyx/graphql-php.git", 975 "reference": "6829ae58f4c59121df1f86915fb9917a2ec595e8" 976 }, 977 "dist": { 978 "type": "zip", 979 "url": "https://api.github.com/repos/webonyx/graphql-php/zipball/6829ae58f4c59121df1f86915fb9917a2ec595e8", 980 "reference": "6829ae58f4c59121df1f86915fb9917a2ec595e8", 981 "shasum": "" 982 }, 983 "require": { 984 "ext-json": "*", 985 "ext-mbstring": "*", 986 "php": "^7.1||^8.0" 987 }, 988 "require-dev": { 989 "doctrine/coding-standard": "^6.0", 990 "phpbench/phpbench": "^0.14.0", 991 "phpstan/phpstan": "^0.11.4", 992 "phpstan/phpstan-phpunit": "^0.11.0", 993 "phpstan/phpstan-strict-rules": "^0.11.0", 994 "phpunit/phpcov": "^5.0", 995 "phpunit/phpunit": "^7.2", 996 "psr/http-message": "^1.0", 997 "react/promise": "2.*" 998 }, 999 "suggest": { 1000 "psr/http-message": "To use standard GraphQL server", 1001 "react/promise": "To leverage async resolving on React PHP platform" 1002 }, 1003 "type": "library", 1004 "autoload": { 1005 "psr-4": { 1006 "GraphQL\\": "src/" 1007 } 1008 }, 1009 "notification-url": "https://packagist.org/downloads/", 1010 "license": [ 1011 "MIT" 1012 ], 1013 "description": "A PHP port of GraphQL reference implementation", 1014 "homepage": "https://github.com/webonyx/graphql-php", 1015 "keywords": [ 1016 "api", 1017 "graphql" 1018 ], 1019 "time": "2019-08-25T10:32:47+00:00" 1020 }, 1021 { 1022 "name": "wp-graphql/wp-graphql", 1023 "version": "v0.10.1", 1024 "source": { 1025 "type": "git", 1026 "url": "https://github.com/wp-graphql/wp-graphql.git", 1027 "reference": "9e3d6dc2ed1a6bc8daedc7ca4c57d135b25ef5d9" 1028 }, 1029 "dist": { 1030 "type": "zip", 1031 "url": "https://api.github.com/repos/wp-graphql/wp-graphql/zipball/9e3d6dc2ed1a6bc8daedc7ca4c57d135b25ef5d9", 1032 "reference": "9e3d6dc2ed1a6bc8daedc7ca4c57d135b25ef5d9", 1033 "shasum": "" 1034 }, 1035 "require": { 1036 "ivome/graphql-relay-php": "0.3.1", 1037 "php": "^7.1||^8.0", 1038 "webonyx/graphql-php": "0.13.8" 1039 }, 1040 "require-dev": { 1041 "codeception/module-asserts": "^1.0", 1042 "codeception/module-cli": "^1.0", 1043 "codeception/module-db": "^1.0", 1044 "codeception/module-filesystem": "^1.0", 1045 "codeception/module-phpbrowser": "^1.0", 1046 "codeception/module-rest": "^1.2", 1047 "codeception/module-webdriver": "^1.0", 1048 "codeception/util-universalframework": "^1.0", 1049 "dealerdirect/phpcodesniffer-composer-installer": "0.5.0", 1050 "lucatume/wp-browser": "^2.4", 1051 "phpcompatibility/phpcompatibility-wp": "2.1.0", 1052 "phpstan/phpstan": "^0.12.25", 1053 "squizlabs/php_codesniffer": "3.5.4", 1054 "szepeviktor/phpstan-wordpress": "^0.5.0", 1055 "wp-coding-standards/wpcs": "2.1.1" 1056 }, 1057 "type": "wordpress-plugin", 1058 "autoload": { 1059 "psr-4": { 1060 "WPGraphQL\\": "src/" 1061 }, 1062 "classmap": [ 1063 "src/" 1064 ] 1065 }, 1066 "notification-url": "https://packagist.org/downloads/", 1067 "license": [ 1068 "GPL-3.0-or-later" 1069 ], 1070 "authors": [ 1071 { 1072 "name": "Jason Bahl", 1073 "email": "jasonbahl@mac.com" 1074 }, 1075 { 1076 "name": "Edwin Cromley" 1077 }, 1078 { 1079 "name": "Ryan Kanner" 1080 }, 1081 { 1082 "name": "Hughie Devore" 1083 }, 1084 { 1085 "name": "Chris Zarate" 1086 } 1087 ], 1088 "description": "GraphQL API for WordPress", 1089 "time": "2020-07-01T04:34:21+00:00" 1090 }, 1091 { 1092 "name": "yoast/i18n-module", 1093 "version": "3.1.1", 1094 "source": { 1095 "type": "git", 1096 "url": "https://github.com/Yoast/i18n-module.git", 1097 "reference": "9d0a2f6daea6fb42376b023e7778294d19edd85d" 1098 }, 1099 "dist": { 1100 "type": "zip", 1101 "url": "https://api.github.com/repos/Yoast/i18n-module/zipball/9d0a2f6daea6fb42376b023e7778294d19edd85d", 1102 "reference": "9d0a2f6daea6fb42376b023e7778294d19edd85d", 1103 "shasum": "" 1104 }, 1105 "require": { 1106 "php": ">=5.2" 1107 }, 1108 "require-dev": { 1109 "roave/security-advisories": "dev-master", 1110 "yoast/yoastcs": "^1.2.2" 1111 }, 1112 "type": "library", 1113 "autoload": { 1114 "classmap": [ 1115 "src/" 1116 ] 1117 }, 1118 "notification-url": "https://packagist.org/downloads/", 1119 "license": [ 1120 "GPL-2.0-or-later" 1121 ], 1122 "authors": [ 1123 { 1124 "name": "Team Yoast", 1125 "email": "support@yoast.com", 1126 "homepage": "https://yoast.com" 1127 } 1128 ], 1129 "description": "Handle i18n for WordPress plugins.", 1130 "homepage": "https://github.com/Yoast/i18n-module", 1131 "keywords": [ 417 "name": "Contributors", 418 "homepage": "https://github.com/WordPress/WordPress-Coding-Standards/graphs/contributors" 419 } 420 ], 421 "description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions", 422 "keywords": [ 423 "phpcs", 424 "standards", 1132 425 "wordpress" 1133 426 ], 1134 "time": "2019-05-07T06:45:05+00:00" 1135 }, 1136 { 1137 "name": "yoast/license-manager", 1138 "version": "1.6.0", 1139 "source": { 1140 "type": "git", 1141 "url": "https://github.com/Yoast/License-Manager.git", 1142 "reference": "fbacabb06d788912fead4f32d0d1d8b9a2d883c9" 1143 }, 1144 "dist": { 1145 "type": "zip", 1146 "url": "https://api.github.com/repos/Yoast/License-Manager/zipball/fbacabb06d788912fead4f32d0d1d8b9a2d883c9", 1147 "reference": "fbacabb06d788912fead4f32d0d1d8b9a2d883c9", 1148 "shasum": "" 1149 }, 1150 "type": "library", 1151 "autoload": { 1152 "classmap": [ 1153 "class-api-request.php", 1154 "class-license-manager.php", 1155 "class-plugin-license-manager.php", 1156 "class-plugin-update-manager.php", 1157 "class-product.php", 1158 "class-theme-license-manager.php", 1159 "class-theme-update-manager.php", 1160 "class-update-manager.php" 1161 ] 1162 }, 1163 "notification-url": "https://packagist.org/downloads/", 1164 "license": [ 1165 "GPL-2.0+" 1166 ], 1167 "authors": [ 1168 { 1169 "name": "Team Yoast", 1170 "email": "support@yoast.com", 1171 "homepage": "https://yoast.com" 1172 } 1173 ], 1174 "description": "Yoast License Manager.", 1175 "homepage": "https://github.com/Yoast/License-Manager", 1176 "keywords": [ 1177 "wordpress" 1178 ], 1179 "time": "2017-08-22T07:59:16+00:00" 1180 }, 1181 { 1182 "name": "yoast/wordpress-seo", 1183 "version": "14.4.1", 1184 "source": { 1185 "type": "git", 1186 "url": "https://github.com/Yoast-dist/wordpress-seo.git", 1187 "reference": "d273b6521e5da5d34537aeaa0e07494c9c1f90cf" 1188 }, 1189 "dist": { 1190 "type": "zip", 1191 "url": "https://api.github.com/repos/Yoast-dist/wordpress-seo/zipball/d273b6521e5da5d34537aeaa0e07494c9c1f90cf", 1192 "reference": "d273b6521e5da5d34537aeaa0e07494c9c1f90cf", 1193 "shasum": "" 1194 }, 1195 "require": { 1196 "composer/installers": "~1.0", 1197 "league/oauth2-client": "^2.4", 1198 "php": "^5.6.20||^7.0", 1199 "pimple/pimple": "^3.2", 1200 "psr/log": "^1.0", 1201 "symfony/dependency-injection": "^3.4", 1202 "yoast/i18n-module": "^3.1.1", 1203 "yoast/license-manager": "1.6.0" 1204 }, 1205 "require-dev": { 1206 "atanamo/php-codeshift": "^1.0", 1207 "brain/monkey": "^2.4", 1208 "humbug/php-scoper": "^0.12.0", 1209 "phpcompatibility/phpcompatibility-wp": "^2.0.0", 1210 "phpunit/phpunit": "^5.7", 1211 "symfony/config": "^3.4", 1212 "yoast/php-development-environment": "^1.0", 1213 "yoast/yoastcs": "~0.4.3" 1214 }, 1215 "type": "wordpress-plugin", 1216 "autoload": { 1217 "classmap": [ 1218 "admin/", 1219 "frontend/", 1220 "inc/", 1221 "deprecated/", 1222 "cli/", 1223 "src/", 1224 "lib/" 1225 ] 1226 }, 1227 "notification-url": "https://packagist.org/downloads/", 1228 "license": [ 1229 "GPL-2.0-or-later" 1230 ], 1231 "authors": [ 1232 { 1233 "name": "Team Yoast", 1234 "email": "support@yoast.com", 1235 "homepage": "https://yoa.st/1--" 1236 } 1237 ], 1238 "description": "Improve your WordPress SEO: Write better content and have a fully optimized WordPress site using the Yoast SEO plugin.", 1239 "homepage": "https://yoa.st/1ui", 1240 "keywords": [ 1241 "seo", 1242 "wordpress" 1243 ], 1244 "time": "2020-06-23T13:11:11+00:00" 427 "time": "2020-05-13T23:57:56+00:00" 1245 428 } 1246 429 ], 1247 "packages-dev": [],1248 430 "aliases": [], 1249 431 "minimum-stability": "stable", … … 1252 434 "prefer-lowest": false, 1253 435 "platform": [], 1254 "platform-dev": [] 436 "platform-dev": [], 437 "plugin-api-version": "1.1.0" 1255 438 } -
add-wpgraphql-seo/trunk/package.json
r2365209 r2425433 1 1 { 2 "name": "wp-graphql-yoast-seo", 3 "version": "4.2.0", 4 "description": "A WPGraphQL Extension that adds support for Yoast SEO", 5 "scripts": { 6 "test": "echo \"Error: no test specified\" && exit 1", 7 "prettier": "prettier wp-graphql-yoast-seo.php" 8 }, 9 "repository": { 10 "type": "git", 11 "url": "git+https://github.com/ashhitch/wp-graphql-yoast-seo.git" 12 }, 13 "author": "Ash Hitchcock", 14 "bugs": { 15 "url": "https://github.com/ashhitch/wp-graphql-yoast-seo/issues" 16 }, 17 "homepage": "https://github.com/ashhitch/wp-graphql-yoast-seo#readme", 18 "devDependencies": { 19 "@prettier/plugin-php": "^0.14.2", 20 "husky": ">=4", 21 "lint-staged": ">=10", 22 "prettier": "^2.0.5" 23 }, 24 "husky": { 25 "hooks": { 26 "pre-commit": "lint-staged" 2 "name": "wp-graphql-yoast-seo", 3 "version": "4.2.0", 4 "description": "A WPGraphQL Extension that adds support for Yoast SEO", 5 "scripts": { 6 "test": "echo \"Error: no test specified\" && exit 1", 7 "prettier": "prettier wp-graphql-yoast-seo.php --write" 8 }, 9 "repository": { 10 "type": "git", 11 "url": "git+https://github.com/ashhitch/wp-graphql-yoast-seo.git" 12 }, 13 "author": "Ash Hitchcock", 14 "bugs": { 15 "url": "https://github.com/ashhitch/wp-graphql-yoast-seo/issues" 16 }, 17 "homepage": "https://github.com/ashhitch/wp-graphql-yoast-seo#readme", 18 "devDependencies": { 19 "@prettier/plugin-php": "^0.14.2", 20 "husky": ">=4", 21 "lint-staged": ">=10", 22 "prettier": "^2.0.5" 23 }, 24 "husky": { 25 "hooks": { 26 "pre-commit": "lint-staged" 27 } 28 }, 29 "lint-staged": { 30 "*.{js,css,md,php}": "prettier wp-graphql-yoast-seo.php --write" 27 31 } 28 },29 "lint-staged": {30 "*.{js,css,md,php}": "prettier wp-graphql-yoast-seo.php"31 }32 32 } -
add-wpgraphql-seo/trunk/readme.txt
r2395101 r2425433 5 5 Tested up to: 5.4 6 6 Requires PHP: 7.1 7 Stable tag: 4. 8.07 Stable tag: 4.9.0 8 8 License: GPLv3 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html -
add-wpgraphql-seo/trunk/wp-graphql-yoast-seo.php
r2395101 r2425433 1 <?php 1 <?php // phpcs:ignore 2 2 3 3 /** … … 9 9 * Text Domain: wp-graphql-yoast-seo 10 10 * Domain Path: /languages 11 * Version: 4. 8.011 * Version: 4.9.0 12 12 * 13 13 * @package WP_Graphql_YOAST_SEO 14 14 */ 15 15 16 if (!defined('ABSPATH')) { 16 exit();17 exit(); 17 18 } 18 19 … … 21 22 22 23 add_action('admin_init', function () { 23 $core_dependencies = [ 24 'WPGraphQL plugin' => class_exists('WPGraphQL'), 25 'Yoast SEO' => function_exists('YoastSEO') 26 ]; 27 28 $missing_dependencies = array_keys(array_diff($core_dependencies, array_filter($core_dependencies))); 29 $display_admin_notice = static function () use ($missing_dependencies) { 30 ?> 31 <div class="notice notice-error"> 32 <p><?php esc_html_e('The WPGraphQL Yoast SEO plugin can\'t be loaded because these dependencies are missing:', 'wp-graphql-yoast-seo'); ?></p> 33 <ul> 34 <?php foreach ($missing_dependencies as $missing_dependency) : ?> 35 <li><?php echo esc_html($missing_dependency); ?></li> 36 <?php endforeach; ?> 37 </ul> 38 </div> 39 <?php 40 }; 41 42 if (!empty($missing_dependencies)) { 43 add_action('network_admin_notices', $display_admin_notice); 44 add_action('admin_notices', $display_admin_notice); 45 46 return; 47 } 24 $core_dependencies = [ 25 'WPGraphQL plugin' => class_exists('WPGraphQL'), 26 'Yoast SEO' => function_exists('YoastSEO'), 27 ]; 28 29 $missing_dependencies = array_keys( 30 array_diff($core_dependencies, array_filter($core_dependencies)) 31 ); 32 $display_admin_notice = static function () use ($missing_dependencies) { 33 ?> 34 <div class="notice notice-error"> 35 <p><?php esc_html_e( 36 'The WPGraphQL Yoast SEO plugin can\'t be loaded because these dependencies are missing:', 37 'wp-graphql-yoast-seo' 38 ); ?> 39 </p> 40 <ul> 41 <?php foreach ($missing_dependencies as $missing_dependency): ?> 42 <li><?php echo esc_html($missing_dependency); ?></li> 43 <?php endforeach; ?> 44 </ul> 45 </div> 46 <?php 47 }; 48 49 if (!empty($missing_dependencies)) { 50 add_action('network_admin_notices', $display_admin_notice); 51 add_action('admin_notices', $display_admin_notice); 52 53 return; 54 } 48 55 }); 49 56 50 57 add_action('graphql_init', function () { 51 if (!function_exists('wp_gql_seo_format_string')) { 52 function wp_gql_seo_format_string($string) 58 if (!function_exists('wp_gql_seo_format_string')) { 59 function wp_gql_seo_format_string($string) 60 { 61 return isset($string) ? trim($string) : null; 62 } 63 } 64 if (!function_exists('wp_gql_seo_get_og_image')) { 65 function wp_gql_seo_get_og_image($images) 66 { 67 if (empty($images)) { 68 return __return_empty_string(); 69 } 70 71 $image = reset($images); 72 73 if (empty($image)) { 74 return __return_empty_string(); 75 } 76 77 if (!isset($image['url'])) { 78 return __return_empty_string(); 79 } 80 // Remove image sizes from url 81 $url = preg_replace( 82 '/(.*)-\d+x\d+\.(jpg|png|gif)$/', 83 '$1.$2', 84 $image['url'] 85 ); 86 return wpcom_vip_attachment_url_to_postid($url); 87 } 88 } 89 if (!function_exists('wp_gql_seo_get_field_key')) { 90 function wp_gql_seo_get_field_key($field_key) 91 { 92 $field_key = lcfirst(preg_replace('[^a-zA-Z0-9 -]', ' ', $field_key)); 93 $field_key = lcfirst(str_replace('_', ' ', ucwords($field_key, '_'))); 94 $field_key = lcfirst(str_replace('-', ' ', ucwords($field_key, '_'))); 95 $field_key = lcfirst(str_replace(' ', '', ucwords($field_key, ' '))); 96 97 return $field_key; 98 } 99 } 100 101 if (!function_exists('wpcom_vip_attachment_url_to_postid')) { 102 function wpcom_vip_attachment_cache_key($url) 103 { 104 return 'wpcom_vip_attachment_url_post_id_' . md5($url); 105 } 106 } 107 108 if (!function_exists('wpcom_vip_attachment_url_to_postid')) { 109 function wpcom_vip_attachment_url_to_postid($url) 110 { 111 $cache_key = wpcom_vip_attachment_cache_key($url); 112 $id = wp_cache_get($cache_key); 113 if (false === $id) { 114 $id = attachment_url_to_postid($url); // phpcs:ignore 115 if (empty($id)) { 116 wp_cache_set( 117 $cache_key, 118 'not_found', 119 'default', 120 12 * HOUR_IN_SECONDS + mt_rand(0, 4 * HOUR_IN_SECONDS) // phpcs:ignore 121 ); 122 } else { 123 wp_cache_set( 124 $cache_key, 125 $id, 126 'default', 127 24 * HOUR_IN_SECONDS + mt_rand(0, 12 * HOUR_IN_SECONDS) // phpcs:ignore 128 ); 129 } 130 } elseif ('not_found' === $id) { 131 return false; 132 } 133 134 return $id; 135 } 136 } 137 138 function wp_gql_seo_build_content_types($types) 53 139 { 54 55 return isset($string) ? trim($string) : null; 140 $carry = []; 141 foreach ($types as $type) { 142 $post_type_object = get_post_type_object($type); 143 if ($post_type_object->graphql_single_name) { 144 $carry[ 145 wp_gql_seo_get_field_key($post_type_object->graphql_single_name) 146 ] = ['type' => 'SEOContentType']; 147 } 148 } 149 return $carry; 56 150 } 57 } 58 if (!function_exists('wp_gql_seo_get_og_image')) { 59 function wp_gql_seo_get_og_image($images) 151 152 function wp_gql_seo_build_content_type_data($types, $all) 60 153 { 61 62 if (empty($images)) { 63 return __return_empty_string(); 64 } 65 66 $image = reset($images); 67 68 if (empty($image)) { 69 return __return_empty_string(); 70 } 71 72 73 if (!isset($image['url'])) { 74 return __return_empty_string(); 75 } 76 77 return attachment_url_to_postid($image['url']); 154 $carry = []; 155 foreach ($types as $type) { 156 $post_type_object = get_post_type_object($type); 157 if ($post_type_object->graphql_single_name) { 158 $tag = wp_gql_seo_get_field_key( 159 $post_type_object->graphql_single_name 160 ); 161 $carry[$tag] = [ 162 'title' => $all['title-' . $tag], 163 'metaDesc' => $all['metadesc-' . $tag], 164 'metaRobotsNoindex' => $all['noindex-' . $tag], 165 'schemaType' => $all['schema-page-type-' . $tag], 166 ]; 167 } 168 } 169 return $carry; 78 170 } 79 } 80 if (!function_exists('wp_gql_seo_get_field_key')) { 81 function wp_gql_seo_get_field_key($field_key) 82 { 83 $field_key = lcfirst(preg_replace('[^a-zA-Z0-9 -]', ' ', $field_key)); 84 $field_key = lcfirst(str_replace('_', ' ', ucwords($field_key, '_'))); 85 $field_key = lcfirst(str_replace('-', ' ', ucwords($field_key, '_'))); 86 $field_key = lcfirst(str_replace(' ', '', ucwords($field_key, ' '))); 87 88 return $field_key; 89 } 90 } 91 92 function wp_gql_seo_build_content_types($types) 93 { 94 $carry = array(); 95 foreach ($types as $type) { 96 97 $post_type_object = get_post_type_object($type); 98 if ($post_type_object->graphql_single_name) { 99 100 $carry[wp_gql_seo_get_field_key($post_type_object->graphql_single_name)] = ['type' => 'SEOContentType']; 101 } 102 } 103 return $carry; 104 } 105 106 function wp_gql_seo_build_content_type_data($types, $all) 107 { 108 $carry = array(); 109 foreach ($types as $type) { 110 $post_type_object = get_post_type_object($type); 111 if ($post_type_object->graphql_single_name) { 112 113 $tag = wp_gql_seo_get_field_key($post_type_object->graphql_single_name); 114 $carry[$tag] = array( 115 'title' => $all['title-' . $tag], 116 'metaDesc' => $all['metadesc-' . $tag], 117 'metaRobotsNoindex' => $all['noindex-' . $tag], 118 'schemaType' => $all['schema-page-type-' . $tag], 119 ); 120 } 121 } 122 return $carry; 123 } 124 125 add_action('graphql_register_types', function () { 126 $post_types = \WPGraphQL::get_allowed_post_types(); 127 $taxonomies = \WPGraphQL::get_allowed_taxonomies(); 128 129 // If WooCommerce installed then add these post types and taxonomies 130 if (class_exists('\WooCommerce')) { 131 array_push($post_types, 'product'); 132 array_push($taxonomies, 'productCategory'); 133 } 134 135 register_graphql_enum_type('SEOCardType', [ 136 'description' => __('Types of cards', 'wp-graphql-yoast-seo'), 137 'values' => [ 138 'summary_large_image' => [ 139 'value' => 'summary_large_image' 140 ], 141 'summary' => [ 142 'value' => 'summary' 143 ], 144 ], 145 ]); 146 147 register_graphql_object_type('SEOPostTypeSchema', [ 148 'description' => __('The Schema types', 'wp-graphql-yoast-seo'), 149 'fields' => [ 150 'pageType' => ['type' => ['list_of' => 'String']], 151 'articleType' => ['type' => ['list_of' => 'String']], 152 ] 153 ]); 154 155 $baseSEOFields = array( 156 'title' => ['type' => 'String'], 157 'metaDesc' => ['type' => 'String'], 158 'focuskw' => ['type' => 'String'], 159 'metaKeywords' => ['type' => 'String'], 160 'metaRobotsNoindex' => ['type' => 'String'], 161 'metaRobotsNofollow' => ['type' => 'String'], 162 'opengraphTitle' => ['type' => 'String'], 163 'opengraphUrl' => ['type' => 'String'], 164 'opengraphSiteName' => ['type' => 'String'], 165 'opengraphType' => ['type' => 'String'], 166 'opengraphAuthor' => ['type' => 'String'], 167 'opengraphPublisher' => ['type' => 'String'], 168 'opengraphPublishedTime' => ['type' => 'String'], 169 'opengraphModifiedTime' => ['type' => 'String'], 170 'opengraphDescription' => ['type' => 'String'], 171 'opengraphImage' => ['type' => 'MediaItem'], 172 'twitterTitle' => ['type' => 'String'], 173 'twitterDescription' => ['type' => 'String'], 174 'twitterImage' => ['type' => 'MediaItem'], 175 'canonical' => ['type' => 'String'], 176 'breadcrumbs' => ['type' => ['list_of' => 'SEOPostTypeBreadcrumbs']], 177 'cornerstone' => ['type' => 'Boolean'], 178 ); 179 180 register_graphql_object_type('TaxonomySEO', [ 181 'fields' => $baseSEOFields 182 ]); 183 184 register_graphql_object_type('PostTypeSEO', [ 185 'fields' => array_merge($baseSEOFields, array('schema' => ['type' => 'SEOPostTypeSchema'])), 186 ]); 187 188 189 register_graphql_object_type('SEOPostTypeBreadcrumbs', [ 190 'fields' => [ 191 'url' => ['type' => 'String'], 192 'text' => ['type' => 'String'], 193 194 ] 195 ]); 196 197 198 register_graphql_object_type('SEOSchema', [ 199 'description' => __('The Yoast SEO schema data', 'wp-graphql-yoast-seo'), 200 'fields' => [ 201 'companyName' => ['type' => 'String'], 202 'personName' => ['type' => 'String'], 203 'companyOrPerson' => ['type' => 'String'], 204 'companyLogo' => ['type' => 'MediaItem'], 205 'personLogo' => ['type' => 'MediaItem'], 206 'logo' => ['type' => 'MediaItem'], 207 'siteName' => ['type' => 'String'], 208 'wordpressSiteName' => ['type' => 'String'], 209 'siteUrl' => ['type' => 'String'], 210 'inLanguage' => ['type' => 'String'], 211 ] 212 ]); 213 214 register_graphql_object_type('SEOWebmaster', [ 215 'description' => __('The Yoast SEO webmaster fields', 'wp-graphql-yoast-seo'), 216 'fields' => [ 217 'baiduVerify' => ['type' => 'String'], 218 'googleVerify' => ['type' => 'String'], 219 'msVerify' => ['type' => 'String'], 220 'yandexVerify' => ['type' => 'String'], 221 ] 222 ]); 223 224 register_graphql_object_type('SEOBreadcrumbs', [ 225 'description' => __('The Yoast SEO breadcrumb config', 'wp-graphql-yoast-seo'), 226 'fields' => [ 227 'enabled' => ['type' => 'Boolean'], 228 'boldLast' => ['type' => 'Boolean'], 229 'showBlogPage' => ['type' => 'Boolean'], 230 'notFoundText' => ['type' => 'String'], 231 'archivePrefix' => ['type' => 'String'], 232 'homeText' => ['type' => 'String'], 233 'prefix' => ['type' => 'String'], 234 'searchPrefix' => ['type' => 'String'], 235 'separator' => ['type' => 'String'], 236 ] 237 ]); 238 239 register_graphql_object_type('SEOSocialFacebook', [ 240 'fields' => [ 241 'url' => ['type' => 'String'], 242 'defaultImage' => ['type' => 'MediaItem'], 243 ] 244 ]); 245 246 register_graphql_object_type('SEOSocialTwitter', [ 247 'fields' => [ 248 'username' => ['type' => 'String'], 249 'cardType' => ['type' => 'SEOCardType'], 250 ] 251 ]); 252 253 register_graphql_object_type('SEOSocialInstagram', [ 254 'fields' => [ 255 'url' => ['type' => 'String'], 256 ] 257 ]); 258 register_graphql_object_type('SEOSocialLinkedIn', [ 259 'fields' => [ 260 'url' => ['type' => 'String'], 261 ] 262 ]); 263 register_graphql_object_type('SEOSocialMySpace', [ 264 'fields' => [ 265 'url' => ['type' => 'String'], 266 ] 267 ]); 268 269 register_graphql_object_type('SEOSocialPinterest', [ 270 'fields' => [ 271 'url' => ['type' => 'String'], 272 'metaTag' => ['type' => 'String'], 273 ] 274 ]); 275 276 register_graphql_object_type('SEOSocialYoutube', [ 277 'fields' => [ 278 'url' => ['type' => 'String'], 279 ] 280 ]); 281 register_graphql_object_type('SEOSocialWikipedia', [ 282 'fields' => [ 283 'url' => ['type' => 'String'], 284 ] 285 ]); 286 287 register_graphql_object_type('SEOSocial', [ 288 'description' => __('The Yoast SEO Social media links', 'wp-graphql-yoast-seo'), 289 'fields' => [ 290 'facebook' => ['type' => 'SEOSocialFacebook'], 291 'twitter' => ['type' => 'SEOSocialTwitter'], 292 'instagram' => ['type' => 'SEOSocialInstagram'], 293 'linkedIn' => ['type' => 'SEOSocialLinkedIn'], 294 'mySpace' => ['type' => 'SEOSocialMySpace'], 295 'pinterest' => ['type' => 'SEOSocialPinterest'], 296 'youTube' => ['type' => 'SEOSocialYoutube'], 297 'wikipedia' => ['type' => 'SEOSocialWikipedia'], 298 ] 299 ]); 300 301 register_graphql_object_type('SEORedirect', [ 302 'description' => __('The Yoast redirect data (Yoast Premium only)', 'wp-graphql-yoast-seo'), 303 'fields' => [ 304 'origin' => ['type' => 'String'], 305 'target' => ['type' => 'String'], 306 'type' => ['type' => 'Int'], 307 'format' => ['type' => 'String'], 308 309 ] 310 ]); 311 312 register_graphql_object_type('SEOOpenGraphFrontPage', [ 313 'description' => __('The Open Graph Front page data', 'wp-graphql-yoast-seo'), 314 'fields' => [ 315 'title' => ['type' => 'String'], 316 'description' => ['type' => 'String'], 317 'image' => ['type' => 'MediaItem'], 318 ] 319 ]); 320 321 register_graphql_object_type('SEOOpenGraph', [ 322 'description' => __('The Open Graph data', 'wp-graphql-yoast-seo'), 323 'fields' => [ 324 'defaultImage' => ['type' => 'MediaItem'], 325 'frontPage' => ['type' => 'SEOOpenGraphFrontPage'], 326 ] 327 ]); 328 329 register_graphql_object_type('SEOContentType', [ 330 'description' => __('he Yoast SEO search appearance content types fields', 'wp-graphql-yoast-seo'), 331 'fields' => [ 332 'title' => ['type' => 'String'], 333 'metaDesc' => ['type' => 'String'], 334 'metaRobotsNoindex' => ['type' => 'Boolean'], 335 'schemaType' => ['type' => 'String'], 336 ] 337 ]); 338 339 $allTypes = wp_gql_seo_build_content_types($post_types); 340 341 register_graphql_object_type('SEOContentTypes', [ 342 'description' => __('The Yoast SEO search appearance content types', 'wp-graphql-yoast-seo'), 343 'fields' => $allTypes, 344 ]); 345 346 register_graphql_object_type('SEOConfig', [ 347 'description' => __('The Yoast SEO site level configuration data', 'wp-graphql-yoast-seo'), 348 'fields' => [ 349 'schema' => ['type' => 'SEOSchema'], 350 'webmaster' => ['type' => 'SEOWebmaster'], 351 'social' => ['type' => 'SEOSocial'], 352 'breadcrumbs' => ['type' => 'SEOBreadcrumbs'], 353 'redirects' => ['type' => [ 354 'list_of' => 'SEORedirect', 355 ]], 356 'openGraph' => ['type' => 'SEOOpenGraph'], 357 'contentTypes' => ['type' => 'SEOContentTypes'], 358 ] 359 ]); 360 361 register_graphql_object_type('SEOUserSocial', [ 362 'fields' => [ 363 'facebook' => ['type' => 'String'], 364 'twitter' => ['type' => 'String'], 365 'instagram' => ['type' => 'String'], 366 'linkedIn' => ['type' => 'String'], 367 'mySpace' => ['type' => 'String'], 368 'pinterest' => ['type' => 'String'], 369 'youTube' => ['type' => 'String'], 370 'soundCloud' => ['type' => 'String'], 371 'wikipedia' => ['type' => 'String'], 372 ] 373 ]); 374 375 register_graphql_object_type('SEOUser', [ 376 'fields' => [ 377 'title' => ['type' => 'String'], 378 'metaDesc' => ['type' => 'String'], 379 'metaRobotsNoindex' => ['type' => 'String'], 380 'metaRobotsNofollow' => ['type' => 'String'], 381 'social' => ['type' => 'SEOUserSocial'], 382 ] 383 ]); 384 385 register_graphql_field('RootQuery', 'seo', [ 386 'type' => 'SEOConfig', 387 'description' => __('Returns seo site data', 'wp-graphql-yoast-seo'), 388 'resolve' => function ($source, array $args, AppContext $context) use ($post_types) { 389 390 $wpseo_options = WPSEO_Options::get_instance(); 391 $all = $wpseo_options->get_all(); 392 393 $redirectsObj = class_exists('WPSEO_Redirect_Option') ? new WPSEO_Redirect_Option() : false; 394 $redirects = $redirectsObj ? $redirectsObj->get_from_option() : []; 395 396 $userID = $all['company_or_person_user_id']; 397 $user = get_userdata($userID); 398 399 $mappedRedirects = function ($value) { 400 401 return array( 402 'origin' => $value['origin'], 403 'target' => $value['url'], 404 'type' => $value['type'], 405 'format' => $value['format'], 406 ); 407 }; 408 409 410 411 $contentTypes = wp_gql_seo_build_content_type_data($post_types, $all); 412 413 return array( 414 'contentTypes' => $contentTypes, 415 'webmaster' => array( 416 'baiduVerify' => wp_gql_seo_format_string($all['baiduverify']), 417 'googleVerify' => wp_gql_seo_format_string($all['googleverify']), 418 'msVerify' => wp_gql_seo_format_string($all['msverify']), 419 'yandexVerify' => wp_gql_seo_format_string($all['yandexverify']), 420 ), 421 'social' => array( 422 'facebook' => array( 423 'url' => wp_gql_seo_format_string($all['facebook_site']), 424 'defaultImage' => DataSource::resolve_post_object($all['og_default_image_id'], $context) 171 172 add_action('graphql_register_types', function () { 173 $post_types = \WPGraphQL::get_allowed_post_types(); 174 $taxonomies = \WPGraphQL::get_allowed_taxonomies(); 175 176 // If WooCommerce installed then add these post types and taxonomies 177 if (class_exists('\WooCommerce')) { 178 array_push($post_types, 'product'); 179 array_push($taxonomies, 'productCategory'); 180 } 181 182 register_graphql_enum_type('SEOCardType', [ 183 'description' => __('Types of cards', 'wp-graphql-yoast-seo'), 184 'values' => [ 185 'summary_large_image' => [ 186 'value' => 'summary_large_image', 187 ], 188 'summary' => [ 189 'value' => 'summary', 190 ], 191 ], 192 ]); 193 194 register_graphql_object_type('SEOPostTypeSchema', [ 195 'description' => __('The Schema types', 'wp-graphql-yoast-seo'), 196 'fields' => [ 197 'pageType' => ['type' => ['list_of' => 'String']], 198 'articleType' => ['type' => ['list_of' => 'String']], 199 ], 200 ]); 201 202 $baseSEOFields = [ 203 'title' => ['type' => 'String'], 204 'metaDesc' => ['type' => 'String'], 205 'focuskw' => ['type' => 'String'], 206 'metaKeywords' => ['type' => 'String'], 207 'metaRobotsNoindex' => ['type' => 'String'], 208 'metaRobotsNofollow' => ['type' => 'String'], 209 'opengraphTitle' => ['type' => 'String'], 210 'opengraphUrl' => ['type' => 'String'], 211 'opengraphSiteName' => ['type' => 'String'], 212 'opengraphType' => ['type' => 'String'], 213 'opengraphAuthor' => ['type' => 'String'], 214 'opengraphPublisher' => ['type' => 'String'], 215 'opengraphPublishedTime' => ['type' => 'String'], 216 'opengraphModifiedTime' => ['type' => 'String'], 217 'opengraphDescription' => ['type' => 'String'], 218 'opengraphImage' => ['type' => 'MediaItem'], 219 'twitterTitle' => ['type' => 'String'], 220 'twitterDescription' => ['type' => 'String'], 221 'twitterImage' => ['type' => 'MediaItem'], 222 'canonical' => ['type' => 'String'], 223 'breadcrumbs' => ['type' => ['list_of' => 'SEOPostTypeBreadcrumbs']], 224 'cornerstone' => ['type' => 'Boolean'], 225 ]; 226 227 register_graphql_object_type('TaxonomySEO', [ 228 'fields' => $baseSEOFields, 229 ]); 230 231 register_graphql_object_type('PostTypeSEO', [ 232 'fields' => array_merge($baseSEOFields, [ 233 'schema' => ['type' => 'SEOPostTypeSchema'], 234 ]), 235 ]); 236 237 register_graphql_object_type('SEOPostTypeBreadcrumbs', [ 238 'fields' => [ 239 'url' => ['type' => 'String'], 240 'text' => ['type' => 'String'], 241 ], 242 ]); 243 244 register_graphql_object_type('SEOSchema', [ 245 'description' => __('The Yoast SEO schema data', 'wp-graphql-yoast-seo'), 246 'fields' => [ 247 'companyName' => ['type' => 'String'], 248 'personName' => ['type' => 'String'], 249 'companyOrPerson' => ['type' => 'String'], 250 'companyLogo' => ['type' => 'MediaItem'], 251 'personLogo' => ['type' => 'MediaItem'], 252 'logo' => ['type' => 'MediaItem'], 253 'siteName' => ['type' => 'String'], 254 'wordpressSiteName' => ['type' => 'String'], 255 'siteUrl' => ['type' => 'String'], 256 'inLanguage' => ['type' => 'String'], 257 ], 258 ]); 259 260 register_graphql_object_type('SEOWebmaster', [ 261 'description' => __( 262 'The Yoast SEO webmaster fields', 263 'wp-graphql-yoast-seo' 425 264 ), 426 'twitter' => array( 427 'username' => wp_gql_seo_format_string($all['twitter_site']), 428 'cardType' => wp_gql_seo_format_string($all['twitter_card_type']), 265 'fields' => [ 266 'baiduVerify' => ['type' => 'String'], 267 'googleVerify' => ['type' => 'String'], 268 'msVerify' => ['type' => 'String'], 269 'yandexVerify' => ['type' => 'String'], 270 ], 271 ]); 272 273 register_graphql_object_type('SEOBreadcrumbs', [ 274 'description' => __( 275 'The Yoast SEO breadcrumb config', 276 'wp-graphql-yoast-seo' 429 277 ), 430 'instagram' => array('url' => wp_gql_seo_format_string($all['instagram_url'])), 431 'linkedIn' => array('url' => wp_gql_seo_format_string($all['linkedin_url'])), 432 'mySpace' => array('url' => wp_gql_seo_format_string($all['myspace_url'])), 433 'pinterest' => array( 434 'url' => wp_gql_seo_format_string($all['pinterest_url']), 435 'metaTag' => wp_gql_seo_format_string($all['pinterestverify']), 278 'fields' => [ 279 'enabled' => ['type' => 'Boolean'], 280 'boldLast' => ['type' => 'Boolean'], 281 'showBlogPage' => ['type' => 'Boolean'], 282 'notFoundText' => ['type' => 'String'], 283 'archivePrefix' => ['type' => 'String'], 284 'homeText' => ['type' => 'String'], 285 'prefix' => ['type' => 'String'], 286 'searchPrefix' => ['type' => 'String'], 287 'separator' => ['type' => 'String'], 288 ], 289 ]); 290 291 register_graphql_object_type('SEOSocialFacebook', [ 292 'fields' => [ 293 'url' => ['type' => 'String'], 294 'defaultImage' => ['type' => 'MediaItem'], 295 ], 296 ]); 297 298 register_graphql_object_type('SEOSocialTwitter', [ 299 'fields' => [ 300 'username' => ['type' => 'String'], 301 'cardType' => ['type' => 'SEOCardType'], 302 ], 303 ]); 304 305 register_graphql_object_type('SEOSocialInstagram', [ 306 'fields' => [ 307 'url' => ['type' => 'String'], 308 ], 309 ]); 310 register_graphql_object_type('SEOSocialLinkedIn', [ 311 'fields' => [ 312 'url' => ['type' => 'String'], 313 ], 314 ]); 315 register_graphql_object_type('SEOSocialMySpace', [ 316 'fields' => [ 317 'url' => ['type' => 'String'], 318 ], 319 ]); 320 321 register_graphql_object_type('SEOSocialPinterest', [ 322 'fields' => [ 323 'url' => ['type' => 'String'], 324 'metaTag' => ['type' => 'String'], 325 ], 326 ]); 327 328 register_graphql_object_type('SEOSocialYoutube', [ 329 'fields' => [ 330 'url' => ['type' => 'String'], 331 ], 332 ]); 333 register_graphql_object_type('SEOSocialWikipedia', [ 334 'fields' => [ 335 'url' => ['type' => 'String'], 336 ], 337 ]); 338 339 register_graphql_object_type('SEOSocial', [ 340 'description' => __( 341 'The Yoast SEO Social media links', 342 'wp-graphql-yoast-seo' 436 343 ), 437 'youTube' => array('url' => wp_gql_seo_format_string($all['youtube_url'])), 438 'wikipedia' => array('url' => wp_gql_seo_format_string($all['wikipedia_url'])), 439 ), 440 'breadcrumbs' => array( 441 'enabled' => wp_gql_seo_format_string($all['breadcrumbs-enable']), 442 'boldLast' => wp_gql_seo_format_string($all['breadcrumbs-boldlast']), 443 'showBlogPage' => wp_gql_seo_format_string($all['breadcrumbs-display-blog-page']), 444 'archivePrefix' => wp_gql_seo_format_string($all['breadcrumbs-archiveprefix']), 445 'prefix' => wp_gql_seo_format_string($all['breadcrumbs-prefix']), 446 'notFoundText' => wp_gql_seo_format_string($all['breadcrumbs-404crumb']), 447 'homeText' => wp_gql_seo_format_string($all['breadcrumbs-home']), 448 'searchPrefix' => wp_gql_seo_format_string($all['breadcrumbs-searchprefix']), 449 'separator' => wp_gql_seo_format_string($all['breadcrumbs-sep']), 450 ), 451 'schema' => array( 452 'companyName' => wp_gql_seo_format_string($all['company_name']), 453 'personName' => wp_gql_seo_format_string($user->user_nicename), 454 'companyLogo' => DataSource::resolve_post_object($all['company_logo_id'], $context), 455 'personLogo' => DataSource::resolve_post_object($all['person_logo_id'], $context), 456 'logo' => DataSource::resolve_post_object($all['company_or_person'] === 'company' ? $all['company_logo_id'] : $all['person_logo_id'], $context), 457 'companyOrPerson' => wp_gql_seo_format_string($all['company_or_person']), 458 'siteName' => wp_gql_seo_format_string(YoastSEO()->helpers->site->get_site_name()), 459 'wordpressSiteName' => wp_gql_seo_format_string(get_bloginfo('name')), 460 'siteUrl' => wp_gql_seo_format_string(get_site_url()), 461 'inLanguage' => wp_gql_seo_format_string(get_bloginfo('language')), 462 ), 463 'redirects' => array_map($mappedRedirects, $redirects), 464 'openGraph' => array( 465 'defaultImage' => DataSource::resolve_post_object($all['og_default_image_id'], $context), 466 'frontPage' => array( 467 'title' => wp_gql_seo_format_string($all['og_frontpage_title']), 468 'description' => wp_gql_seo_format_string($all['og_frontpage_desc']), 469 'image' => DataSource::resolve_post_object($all['og_frontpage_image_id'], $context), 470 ) 471 ) 472 ); 473 }, 474 ]); 475 476 if (!empty($post_types) && is_array($post_types)) { 477 foreach ($post_types as $post_type) { 478 $post_type_object = get_post_type_object($post_type); 479 480 if (isset($post_type_object->graphql_single_name)) : 481 register_graphql_field($post_type_object->graphql_single_name, 'seo', [ 482 'type' => 'PostTypeSEO', 483 'description' => __('The Yoast SEO data of the ' . $post_type_object->graphql_single_name, 'wp-graphql-yoast-seo'), 484 'resolve' => function ($post, array $args, AppContext $context) { 485 486 // Base array 487 $seo = array(); 488 489 // https://developer.yoast.com/blog/yoast-seo-14-0-using-yoast-seo-surfaces/ 490 $robots = YoastSEO()->meta->for_post($post->ID)->robots; 491 492 // Get data 493 $seo = array( 494 'title' => wp_gql_seo_format_string(YoastSEO()->meta->for_post($post->ID)->title), 495 'metaDesc' => wp_gql_seo_format_string(YoastSEO()->meta->for_post($post->ID)->description), 496 'focuskw' => wp_gql_seo_format_string(get_post_meta($post->ID, '_yoast_wpseo_focuskw', true)), 497 'metaKeywords' => wp_gql_seo_format_string(get_post_meta($post->ID, '_yoast_wpseo_metakeywords', true)), 498 'metaRobotsNoindex' => $robots['index'], 499 'metaRobotsNofollow' => $robots['follow'], 500 'opengraphTitle' => wp_gql_seo_format_string(YoastSEO()->meta->for_post($post->ID)->open_graph_title), 501 'opengraphUrl' => wp_gql_seo_format_string(YoastSEO()->meta->for_post($post->ID)->open_graph_url), 502 'opengraphSiteName' => wp_gql_seo_format_string(YoastSEO()->meta->for_post($post->ID)->open_graph_site_name), 503 'opengraphType' => wp_gql_seo_format_string(YoastSEO()->meta->for_post($post->ID)->open_graph_type), 504 'opengraphAuthor' => wp_gql_seo_format_string(YoastSEO()->meta->for_post($post->ID)->open_graph_article_author), 505 'opengraphPublisher' => wp_gql_seo_format_string(YoastSEO()->meta->for_post($post->ID)->open_graph_article_publisher), 506 'opengraphPublishedTime' => wp_gql_seo_format_string(YoastSEO()->meta->for_post($post->ID)->open_graph_article_published_time), 507 'opengraphModifiedTime' => wp_gql_seo_format_string(YoastSEO()->meta->for_post($post->ID)->open_graph_article_modified_time), 508 'opengraphDescription' => wp_gql_seo_format_string(YoastSEO()->meta->for_post($post->ID)->open_graph_description), 509 'opengraphImage' => DataSource::resolve_post_object(wp_gql_seo_get_og_image(YoastSEO()->meta->for_post($post->ID)->open_graph_images), $context), 510 'twitterCardType' => wp_gql_seo_format_string(YoastSEO()->meta->for_post($post->ID)->twitter_card), 511 'twitterTitle' => wp_gql_seo_format_string(YoastSEO()->meta->for_post($post->ID)->twitter_title), 512 'twitterDescription' => wp_gql_seo_format_string(YoastSEO()->meta->for_post($post->ID)->twitter_description), 513 'twitterImage' => DataSource::resolve_post_object(attachment_url_to_postid(YoastSEO()->meta->for_post($post->ID)->twitter_image), $context), 514 'canonical' => wp_gql_seo_format_string(YoastSEO()->meta->for_post($post->ID)->canonical), 515 'breadcrumbs' => YoastSEO()->meta->for_post($post->ID)->breadcrumbs, 516 'cornerstone' => boolval(YoastSEO()->meta->for_post($post->ID)->indexable->is_cornerstone), 517 'schema' => array( 518 'pageType' => is_array(YoastSEO()->meta->for_post($post->ID)->schema_page_type) ? YoastSEO()->meta->for_post($post->ID)->schema_page_type : [], 519 'articleType' => is_array(YoastSEO()->meta->for_post($post->ID)->schema_article_type) ? YoastSEO()->meta->for_post($post->ID)->schema_article_type : [], 520 ), 521 ); 522 523 524 return !empty($seo) ? $seo : null; 344 'fields' => [ 345 'facebook' => ['type' => 'SEOSocialFacebook'], 346 'twitter' => ['type' => 'SEOSocialTwitter'], 347 'instagram' => ['type' => 'SEOSocialInstagram'], 348 'linkedIn' => ['type' => 'SEOSocialLinkedIn'], 349 'mySpace' => ['type' => 'SEOSocialMySpace'], 350 'pinterest' => ['type' => 'SEOSocialPinterest'], 351 'youTube' => ['type' => 'SEOSocialYoutube'], 352 'wikipedia' => ['type' => 'SEOSocialWikipedia'], 353 ], 354 ]); 355 356 register_graphql_object_type('SEORedirect', [ 357 'description' => __( 358 'The Yoast redirect data (Yoast Premium only)', 359 'wp-graphql-yoast-seo' 360 ), 361 'fields' => [ 362 'origin' => ['type' => 'String'], 363 'target' => ['type' => 'String'], 364 'type' => ['type' => 'Int'], 365 'format' => ['type' => 'String'], 366 ], 367 ]); 368 369 register_graphql_object_type('SEOOpenGraphFrontPage', [ 370 'description' => __( 371 'The Open Graph Front page data', 372 'wp-graphql-yoast-seo' 373 ), 374 'fields' => [ 375 'title' => ['type' => 'String'], 376 'description' => ['type' => 'String'], 377 'image' => ['type' => 'MediaItem'], 378 ], 379 ]); 380 381 register_graphql_object_type('SEOOpenGraph', [ 382 'description' => __('The Open Graph data', 'wp-graphql-yoast-seo'), 383 'fields' => [ 384 'defaultImage' => ['type' => 'MediaItem'], 385 'frontPage' => ['type' => 'SEOOpenGraphFrontPage'], 386 ], 387 ]); 388 389 register_graphql_object_type('SEOContentType', [ 390 'description' => __( 391 'he Yoast SEO search appearance content types fields', 392 'wp-graphql-yoast-seo' 393 ), 394 'fields' => [ 395 'title' => ['type' => 'String'], 396 'metaDesc' => ['type' => 'String'], 397 'metaRobotsNoindex' => ['type' => 'Boolean'], 398 'schemaType' => ['type' => 'String'], 399 ], 400 ]); 401 402 $allTypes = wp_gql_seo_build_content_types($post_types); 403 404 register_graphql_object_type('SEOContentTypes', [ 405 'description' => __( 406 'The Yoast SEO search appearance content types', 407 'wp-graphql-yoast-seo' 408 ), 409 'fields' => $allTypes, 410 ]); 411 412 register_graphql_object_type('SEOConfig', [ 413 'description' => __( 414 'The Yoast SEO site level configuration data', 415 'wp-graphql-yoast-seo' 416 ), 417 'fields' => [ 418 'schema' => ['type' => 'SEOSchema'], 419 'webmaster' => ['type' => 'SEOWebmaster'], 420 'social' => ['type' => 'SEOSocial'], 421 'breadcrumbs' => ['type' => 'SEOBreadcrumbs'], 422 'redirects' => [ 423 'type' => [ 424 'list_of' => 'SEORedirect', 425 ], 426 ], 427 'openGraph' => ['type' => 'SEOOpenGraph'], 428 'contentTypes' => ['type' => 'SEOContentTypes'], 429 ], 430 ]); 431 432 register_graphql_object_type('SEOUserSocial', [ 433 'fields' => [ 434 'facebook' => ['type' => 'String'], 435 'twitter' => ['type' => 'String'], 436 'instagram' => ['type' => 'String'], 437 'linkedIn' => ['type' => 'String'], 438 'mySpace' => ['type' => 'String'], 439 'pinterest' => ['type' => 'String'], 440 'youTube' => ['type' => 'String'], 441 'soundCloud' => ['type' => 'String'], 442 'wikipedia' => ['type' => 'String'], 443 ], 444 ]); 445 446 register_graphql_object_type('SEOUser', [ 447 'fields' => [ 448 'title' => ['type' => 'String'], 449 'metaDesc' => ['type' => 'String'], 450 'metaRobotsNoindex' => ['type' => 'String'], 451 'metaRobotsNofollow' => ['type' => 'String'], 452 'social' => ['type' => 'SEOUserSocial'], 453 ], 454 ]); 455 456 register_graphql_field('RootQuery', 'seo', [ 457 'type' => 'SEOConfig', 458 'description' => __('Returns seo site data', 'wp-graphql-yoast-seo'), 459 'resolve' => function ($source, array $args, AppContext $context) use ( 460 $post_types 461 ) { 462 $wpseo_options = WPSEO_Options::get_instance(); 463 $all = $wpseo_options->get_all(); 464 465 $redirectsObj = class_exists('WPSEO_Redirect_Option') 466 ? new WPSEO_Redirect_Option() 467 : false; 468 $redirects = $redirectsObj ? $redirectsObj->get_from_option() : []; 469 470 $userID = $all['company_or_person_user_id']; 471 $user = get_userdata($userID); 472 473 $mappedRedirects = function ($value) { 474 return [ 475 'origin' => $value['origin'], 476 'target' => $value['url'], 477 'type' => $value['type'], 478 'format' => $value['format'], 479 ]; 480 }; 481 482 $contentTypes = wp_gql_seo_build_content_type_data( 483 $post_types, 484 $all 485 ); 486 487 return [ 488 'contentTypes' => $contentTypes, 489 'webmaster' => [ 490 'baiduVerify' => wp_gql_seo_format_string( 491 $all['baiduverify'] 492 ), 493 'googleVerify' => wp_gql_seo_format_string( 494 $all['googleverify'] 495 ), 496 'msVerify' => wp_gql_seo_format_string($all['msverify']), 497 'yandexVerify' => wp_gql_seo_format_string( 498 $all['yandexverify'] 499 ), 500 ], 501 'social' => [ 502 'facebook' => [ 503 'url' => wp_gql_seo_format_string($all['facebook_site']), 504 'defaultImage' => $context 505 ->get_loader('post') 506 ->load_deferred($all['og_default_image_id']), 507 ], 508 'twitter' => [ 509 'username' => wp_gql_seo_format_string( 510 $all['twitter_site'] 511 ), 512 'cardType' => wp_gql_seo_format_string( 513 $all['twitter_card_type'] 514 ), 515 ], 516 'instagram' => [ 517 'url' => wp_gql_seo_format_string($all['instagram_url']), 518 ], 519 'linkedIn' => [ 520 'url' => wp_gql_seo_format_string($all['linkedin_url']), 521 ], 522 'mySpace' => [ 523 'url' => wp_gql_seo_format_string($all['myspace_url']), 524 ], 525 'pinterest' => [ 526 'url' => wp_gql_seo_format_string($all['pinterest_url']), 527 'metaTag' => wp_gql_seo_format_string( 528 $all['pinterestverify'] 529 ), 530 ], 531 'youTube' => [ 532 'url' => wp_gql_seo_format_string($all['youtube_url']), 533 ], 534 'wikipedia' => [ 535 'url' => wp_gql_seo_format_string($all['wikipedia_url']), 536 ], 537 ], 538 'breadcrumbs' => [ 539 'enabled' => wp_gql_seo_format_string( 540 $all['breadcrumbs-enable'] 541 ), 542 'boldLast' => wp_gql_seo_format_string( 543 $all['breadcrumbs-boldlast'] 544 ), 545 'showBlogPage' => wp_gql_seo_format_string( 546 $all['breadcrumbs-display-blog-page'] 547 ), 548 'archivePrefix' => wp_gql_seo_format_string( 549 $all['breadcrumbs-archiveprefix'] 550 ), 551 'prefix' => wp_gql_seo_format_string( 552 $all['breadcrumbs-prefix'] 553 ), 554 'notFoundText' => wp_gql_seo_format_string( 555 $all['breadcrumbs-404crumb'] 556 ), 557 'homeText' => wp_gql_seo_format_string( 558 $all['breadcrumbs-home'] 559 ), 560 'searchPrefix' => wp_gql_seo_format_string( 561 $all['breadcrumbs-searchprefix'] 562 ), 563 'separator' => wp_gql_seo_format_string( 564 $all['breadcrumbs-sep'] 565 ), 566 ], 567 'schema' => [ 568 'companyName' => wp_gql_seo_format_string( 569 $all['company_name'] 570 ), 571 'personName' => wp_gql_seo_format_string( 572 $user->user_nicename 573 ), 574 'companyLogo' => DataSource::resolve_post_object( 575 $all['company_logo_id'], 576 $context 577 ), 578 'personLogo' => DataSource::resolve_post_object( 579 $all['person_logo_id'], 580 $context 581 ), 582 'logo' => DataSource::resolve_post_object( 583 $all['company_or_person'] === 'company' 584 ? $all['company_logo_id'] 585 : $all['person_logo_id'], 586 $context 587 ), 588 'companyOrPerson' => wp_gql_seo_format_string( 589 $all['company_or_person'] 590 ), 591 'siteName' => wp_gql_seo_format_string( 592 YoastSEO()->helpers->site->get_site_name() 593 ), 594 'wordpressSiteName' => wp_gql_seo_format_string( 595 get_bloginfo('name') 596 ), 597 'siteUrl' => wp_gql_seo_format_string(get_site_url()), 598 'inLanguage' => wp_gql_seo_format_string( 599 get_bloginfo('language') 600 ), 601 ], 602 'redirects' => array_map($mappedRedirects, $redirects), 603 'openGraph' => [ 604 'defaultImage' => DataSource::resolve_post_object( 605 $all['og_default_image_id'], 606 $context 607 ), 608 'frontPage' => [ 609 'title' => wp_gql_seo_format_string( 610 $all['og_frontpage_title'] 611 ), 612 'description' => wp_gql_seo_format_string( 613 $all['og_frontpage_desc'] 614 ), 615 'image' => DataSource::resolve_post_object( 616 $all['og_frontpage_image_id'], 617 $context 618 ), 619 ], 620 ], 621 ]; 622 }, 623 ]); 624 625 if (!empty($post_types) && is_array($post_types)) { 626 foreach ($post_types as $post_type) { 627 $post_type_object = get_post_type_object($post_type); 628 629 if (isset($post_type_object->graphql_single_name)): 630 register_graphql_field( 631 $post_type_object->graphql_single_name, 632 'seo', 633 [ 634 'type' => 'PostTypeSEO', 635 'description' => __( 636 'The Yoast SEO data of the ' . 637 $post_type_object->graphql_single_name, 638 'wp-graphql-yoast-seo' 639 ), 640 'resolve' => function ( 641 $post, 642 array $args, 643 AppContext $context 644 ) { 645 // Base array 646 $seo = []; 647 648 // https://developer.yoast.com/blog/yoast-seo-14-0-using-yoast-seo-surfaces/ 649 $robots = YoastSEO()->meta->for_post($post->ID) 650 ->robots; 651 652 // Get data 653 $seo = [ 654 'title' => wp_gql_seo_format_string( 655 YoastSEO()->meta->for_post($post->ID)->title 656 ), 657 'metaDesc' => wp_gql_seo_format_string( 658 YoastSEO()->meta->for_post($post->ID) 659 ->description 660 ), 661 'focuskw' => wp_gql_seo_format_string( 662 get_post_meta( 663 $post->ID, 664 '_yoast_wpseo_focuskw', 665 true 666 ) 667 ), 668 'metaKeywords' => wp_gql_seo_format_string( 669 get_post_meta( 670 $post->ID, 671 '_yoast_wpseo_metakeywords', 672 true 673 ) 674 ), 675 'metaRobotsNoindex' => $robots['index'], 676 'metaRobotsNofollow' => $robots['follow'], 677 'opengraphTitle' => wp_gql_seo_format_string( 678 YoastSEO()->meta->for_post($post->ID) 679 ->open_graph_title 680 ), 681 'opengraphUrl' => wp_gql_seo_format_string( 682 YoastSEO()->meta->for_post($post->ID) 683 ->open_graph_url 684 ), 685 'opengraphSiteName' => wp_gql_seo_format_string( 686 YoastSEO()->meta->for_post($post->ID) 687 ->open_graph_site_name 688 ), 689 'opengraphType' => wp_gql_seo_format_string( 690 YoastSEO()->meta->for_post($post->ID) 691 ->open_graph_type 692 ), 693 'opengraphAuthor' => wp_gql_seo_format_string( 694 YoastSEO()->meta->for_post($post->ID) 695 ->open_graph_article_author 696 ), 697 'opengraphPublisher' => wp_gql_seo_format_string( 698 YoastSEO()->meta->for_post($post->ID) 699 ->open_graph_article_publisher 700 ), 701 'opengraphPublishedTime' => wp_gql_seo_format_string( 702 YoastSEO()->meta->for_post($post->ID) 703 ->open_graph_article_published_time 704 ), 705 'opengraphModifiedTime' => wp_gql_seo_format_string( 706 YoastSEO()->meta->for_post($post->ID) 707 ->open_graph_article_modified_time 708 ), 709 'opengraphDescription' => wp_gql_seo_format_string( 710 YoastSEO()->meta->for_post($post->ID) 711 ->open_graph_description 712 ), 713 'opengraphImage' => DataSource::resolve_post_object( 714 wp_gql_seo_get_og_image( 715 YoastSEO()->meta->for_post($post->ID) 716 ->open_graph_images 717 ), 718 $context 719 ), 720 'twitterCardType' => wp_gql_seo_format_string( 721 YoastSEO()->meta->for_post($post->ID) 722 ->twitter_card 723 ), 724 'twitterTitle' => wp_gql_seo_format_string( 725 YoastSEO()->meta->for_post($post->ID) 726 ->twitter_title 727 ), 728 'twitterDescription' => wp_gql_seo_format_string( 729 YoastSEO()->meta->for_post($post->ID) 730 ->twitter_description 731 ), 732 'twitterImage' => DataSource::resolve_post_object( 733 wpcom_vip_attachment_url_to_postid( 734 YoastSEO()->meta->for_post($post->ID) 735 ->twitter_image 736 ), 737 $context 738 ), 739 'canonical' => wp_gql_seo_format_string( 740 YoastSEO()->meta->for_post($post->ID) 741 ->canonical 742 ), 743 'breadcrumbs' => YoastSEO()->meta->for_post( 744 $post->ID 745 )->breadcrumbs, 746 'cornerstone' => boolval( 747 YoastSEO()->meta->for_post($post->ID) 748 ->indexable->is_cornerstone 749 ), 750 'schema' => [ 751 'pageType' => is_array( 752 YoastSEO()->meta->for_post($post->ID) 753 ->schema_page_type 754 ) 755 ? YoastSEO()->meta->for_post($post->ID) 756 ->schema_page_type 757 : [], 758 'articleType' => is_array( 759 YoastSEO()->meta->for_post($post->ID) 760 ->schema_article_type 761 ) 762 ? YoastSEO()->meta->for_post($post->ID) 763 ->schema_article_type 764 : [], 765 ], 766 ]; 767 768 return !empty($seo) ? $seo : null; 769 }, 770 ] 771 ); 772 773 // Loop each taxonomy to register on the edge if a category is the primary one. 774 $taxonomiesPostObj = get_object_taxonomies( 775 $post_type, 776 'objects' 777 ); 778 779 $postNameKey = wp_gql_seo_get_field_key( 780 $post_type_object->graphql_single_name 781 ); 782 783 foreach ($taxonomiesPostObj as $tax) { 784 if ($tax->hierarchical && $tax->graphql_single_name) { 785 $name = 786 ucfirst($postNameKey) . 787 'To' . 788 ucfirst($tax->graphql_single_name) . 789 'ConnectionEdge'; 790 791 register_graphql_field($name, 'isPrimary', [ 792 'type' => 'Boolean', 793 'description' => __( 794 'The Yoast SEO Primary ' . $tax->name, 795 'wp-graphql-yoast-seo' 796 ), 797 'resolve' => function ( 798 $item, 799 array $args, 800 AppContext $context 801 ) use ($tax) { 802 $postId = $item['source']->ID; 803 804 $wpseo_primary_term = new WPSEO_Primary_Term( 805 $tax->name, 806 $postId 807 ); 808 $primaryTaxId = $wpseo_primary_term->get_primary_term(); 809 $termId = $item['node']->term_id; 810 811 return $primaryTaxId === $termId; 812 }, 813 ]); 814 } 815 } 816 endif; 525 817 } 526 ]); 527 528 529 // Loop each taxonomy to register on the edge if a category is the primary one. 530 $taxonomiesPostObj = get_object_taxonomies($post_type, 'objects'); 531 532 $postNameKey = wp_gql_seo_get_field_key($post_type_object->graphql_single_name); 533 534 foreach ($taxonomiesPostObj as $tax) { 535 536 537 if ($tax->hierarchical && $tax->graphql_single_name) { 538 539 $name = ucfirst($postNameKey) . 'To' . ucfirst($tax->graphql_single_name) . 'ConnectionEdge'; 540 541 register_graphql_field($name, 'isPrimary', [ 542 'type' => 'Boolean', 543 'description' => __('The Yoast SEO Primary ' . $tax->name, 'wp-graphql-yoast-seo'), 544 'resolve' => function ($item, array $args, AppContext $context) use ($tax) { 545 546 $postId = $item['source']->ID; 547 548 $wpseo_primary_term = new WPSEO_Primary_Term($tax->name, $postId); 549 $primaryTaxId = $wpseo_primary_term->get_primary_term(); 550 $termId = $item['node']->term_id; 551 552 553 return $primaryTaxId === $termId; 818 } 819 820 register_graphql_field('User', 'seo', [ 821 'type' => 'SEOUser', 822 'description' => __( 823 'The Yoast SEO data of a user', 824 'wp-graphql-yoast-seo' 825 ), 826 'resolve' => function ($user, array $args, AppContext $context) { 827 $robots = YoastSEO()->meta->for_author($user->userId)->robots; 828 829 $userSeo = [ 830 'title' => wp_gql_seo_format_string( 831 YoastSEO()->meta->for_author($user->userId)->title 832 ), 833 'metaDesc' => wp_gql_seo_format_string( 834 YoastSEO()->meta->for_author($user->userId)->description 835 ), 836 'metaRobotsNoindex' => $robots['index'], 837 'metaRobotsNofollow' => $robots['follow'], 838 839 'social' => [ 840 'facebook' => wp_gql_seo_format_string( 841 get_the_author_meta('facebook', $user->userId) 842 ), 843 'twitter' => wp_gql_seo_format_string( 844 get_the_author_meta('twitter', $user->userId) 845 ), 846 'instagram' => wp_gql_seo_format_string( 847 get_the_author_meta('instagram', $user->userId) 848 ), 849 'linkedIn' => wp_gql_seo_format_string( 850 get_the_author_meta('linkedin', $user->userId) 851 ), 852 'mySpace' => wp_gql_seo_format_string( 853 get_the_author_meta('myspace', $user->userId) 854 ), 855 'pinterest' => wp_gql_seo_format_string( 856 get_the_author_meta('pinterest', $user->userId) 857 ), 858 'youTube' => wp_gql_seo_format_string( 859 get_the_author_meta('youtube', $user->userId) 860 ), 861 'soundCloud' => wp_gql_seo_format_string( 862 get_the_author_meta('soundcloud', $user->userId) 863 ), 864 'wikipedia' => wp_gql_seo_format_string( 865 get_the_author_meta('wikipedia', $user->userId) 866 ), 867 ], 868 ]; 869 870 return !empty($userSeo) ? $userSeo : []; 871 }, 872 ]); 873 874 if (!empty($taxonomies) && is_array($taxonomies)) { 875 foreach ($taxonomies as $tax) { 876 $taxonomy = get_taxonomy($tax); 877 878 if (empty($taxonomy) || !isset($taxonomy->graphql_single_name)) { 879 return; 554 880 } 555 ]); 881 882 register_graphql_field($taxonomy->graphql_single_name, 'seo', [ 883 'type' => 'TaxonomySEO', 884 'description' => __( 885 'The Yoast SEO data of the ' . 886 $taxonomy->label . 887 ' taxonomy.', 888 'wp-graphql-yoast-seo' 889 ), 890 'resolve' => function ($term, array $args, AppContext $context) { 891 $term_obj = get_term($term->term_id); 892 893 $meta = WPSEO_Taxonomy_Meta::get_term_meta( 894 (int) $term_obj->term_id, 895 $term_obj->taxonomy 896 ); 897 $robots = YoastSEO()->meta->for_term($term->term_id)->robots; 898 899 // Get data 900 $seo = [ 901 'title' => wp_gql_seo_format_string( 902 html_entity_decode( 903 wp_strip_all_tags( 904 YoastSEO()->meta->for_term($term->term_id) 905 ->title 906 ) 907 ) 908 ), 909 'metaDesc' => wp_gql_seo_format_string( 910 YoastSEO()->meta->for_term($term->term_id) 911 ->description 912 ), 913 'focuskw' => wp_gql_seo_format_string( 914 $meta['wpseo_focuskw'] 915 ), 916 'metaKeywords' => wp_gql_seo_format_string( 917 $meta['wpseo_metakeywords'] 918 ), 919 'metaRobotsNoindex' => $robots['index'], 920 'metaRobotsNofollow' => $robots['follow'], 921 'opengraphTitle' => wp_gql_seo_format_string( 922 YoastSEO()->meta->for_term($term->term_id) 923 ->open_graph_title 924 ), 925 'opengraphUrl' => wp_gql_seo_format_string( 926 YoastSEO()->meta->for_term($term->term_id) 927 ->open_graph_url 928 ), 929 'opengraphSiteName' => wp_gql_seo_format_string( 930 YoastSEO()->meta->for_term($term->term_id) 931 ->open_graph_site_name 932 ), 933 'opengraphType' => wp_gql_seo_format_string( 934 YoastSEO()->meta->for_term($term->term_id) 935 ->open_graph_type 936 ), 937 'opengraphAuthor' => wp_gql_seo_format_string( 938 YoastSEO()->meta->for_term($term->term_id) 939 ->open_graph_article_author 940 ), 941 'opengraphPublisher' => wp_gql_seo_format_string( 942 YoastSEO()->meta->for_term($term->term_id) 943 ->open_graph_article_publisher 944 ), 945 'opengraphPublishedTime' => wp_gql_seo_format_string( 946 YoastSEO()->meta->for_term($term->term_id) 947 ->open_graph_article_published_time 948 ), 949 'opengraphModifiedTime' => wp_gql_seo_format_string( 950 YoastSEO()->meta->for_term($term->term_id) 951 ->open_graph_article_modified_time 952 ), 953 'opengraphDescription' => wp_gql_seo_format_string( 954 YoastSEO()->meta->for_term($term->term_id) 955 ->open_graph_description 956 ), 957 'opengraphImage' => DataSource::resolve_post_object( 958 $meta['wpseo_opengraph-image-id'], 959 $context 960 ), 961 'twitterCardType' => wp_gql_seo_format_string( 962 YoastSEO()->meta->for_term($term->term_id) 963 ->twitter_card 964 ), 965 'twitterTitle' => wp_gql_seo_format_string( 966 YoastSEO()->meta->for_term($term->term_id) 967 ->twitter_title 968 ), 969 'twitterDescription' => wp_gql_seo_format_string( 970 YoastSEO()->meta->for_term($term->term_id) 971 ->twitter_description 972 ), 973 'twitterImage' => DataSource::resolve_post_object( 974 $meta['wpseo_twitter-image-id'], 975 $context 976 ), 977 'canonical' => wp_gql_seo_format_string( 978 $meta['canonical'] 979 ), 980 'breadcrumbs' => YoastSEO()->meta->for_term( 981 $term->term_id 982 )->breadcrumbs, 983 'cornerstone' => boolval( 984 YoastSEO()->meta->for_term($term->term_id) 985 ->is_cornerstone 986 ), 987 ]; 988 wp_reset_query(); 989 990 return !empty($seo) ? $seo : null; 991 }, 992 ]); 556 993 } 557 }558 559 endif;560 }561 }562 563 564 565 register_graphql_field('User', 'seo', [566 'type' => 'SEOUser',567 'description' => __('The Yoast SEO data of a user', 'wp-graphql-yoast-seo'),568 'resolve' => function ($user, array $args, AppContext $context) {569 570 $robots = YoastSEO()->meta->for_author($user->userId)->robots;571 572 $userSeo = array(573 'title' => wp_gql_seo_format_string(YoastSEO()->meta->for_author($user->userId)->title),574 'metaDesc' => wp_gql_seo_format_string(YoastSEO()->meta->for_author($user->userId)->description),575 'metaRobotsNoindex' => $robots['index'],576 'metaRobotsNofollow' => $robots['follow'],577 578 'social' => array(579 'facebook' => wp_gql_seo_format_string(get_the_author_meta('facebook', $user->userId)),580 'twitter' => wp_gql_seo_format_string(get_the_author_meta('twitter', $user->userId)),581 'instagram' => wp_gql_seo_format_string(get_the_author_meta('instagram', $user->userId)),582 'linkedIn' => wp_gql_seo_format_string(get_the_author_meta('linkedin', $user->userId)),583 'mySpace' => wp_gql_seo_format_string(get_the_author_meta('myspace', $user->userId)),584 'pinterest' => wp_gql_seo_format_string(get_the_author_meta('pinterest', $user->userId)),585 'youTube' => wp_gql_seo_format_string(get_the_author_meta('youtube', $user->userId)),586 'soundCloud' => wp_gql_seo_format_string(get_the_author_meta('soundcloud', $user->userId)),587 'wikipedia' => wp_gql_seo_format_string(get_the_author_meta('wikipedia', $user->userId)),588 ),589 );590 591 return !empty($userSeo) ? $userSeo : [];592 },593 ]);594 595 if (!empty($taxonomies) && is_array($taxonomies)) {596 foreach ($taxonomies as $tax) {597 598 $taxonomy = get_taxonomy($tax);599 600 if (empty($taxonomy) || !isset($taxonomy->graphql_single_name)) {601 return;602 994 } 603 604 605 register_graphql_field($taxonomy->graphql_single_name, 'seo', [ 606 'type' => 'TaxonomySEO', 607 'description' => __('The Yoast SEO data of the ' . $taxonomy->label . ' taxonomy.', 'wp-graphql-yoast-seo'), 608 'resolve' => function ($term, array $args, AppContext $context) { 609 610 $term_obj = get_term($term->term_id); 611 612 $meta = WPSEO_Taxonomy_Meta::get_term_meta((int) $term_obj->term_id, $term_obj->taxonomy); 613 $robots = YoastSEO()->meta->for_term($term->term_id)->robots; 614 615 // Get data 616 $seo = array( 617 'title' => wp_gql_seo_format_string(html_entity_decode(strip_tags(YoastSEO()->meta->for_term($term->term_id)->title))), 618 'metaDesc' => wp_gql_seo_format_string(YoastSEO()->meta->for_term($term->term_id)->description), 619 'focuskw' => wp_gql_seo_format_string($meta['wpseo_focuskw']), 620 'metaKeywords' => wp_gql_seo_format_string($meta['wpseo_metakeywords']), 621 'metaRobotsNoindex' => $robots['index'], 622 'metaRobotsNofollow' => $robots['follow'], 623 'opengraphTitle' => wp_gql_seo_format_string(YoastSEO()->meta->for_term($term->term_id)->open_graph_title), 624 'opengraphUrl' => wp_gql_seo_format_string(YoastSEO()->meta->for_term($term->term_id)->open_graph_url), 625 'opengraphSiteName' => wp_gql_seo_format_string(YoastSEO()->meta->for_term($term->term_id)->open_graph_site_name), 626 'opengraphType' => wp_gql_seo_format_string(YoastSEO()->meta->for_term($term->term_id)->open_graph_type), 627 'opengraphAuthor' => wp_gql_seo_format_string(YoastSEO()->meta->for_term($term->term_id)->open_graph_article_author), 628 'opengraphPublisher' => wp_gql_seo_format_string(YoastSEO()->meta->for_term($term->term_id)->open_graph_article_publisher), 629 'opengraphPublishedTime' => wp_gql_seo_format_string(YoastSEO()->meta->for_term($term->term_id)->open_graph_article_published_time), 630 'opengraphModifiedTime' => wp_gql_seo_format_string(YoastSEO()->meta->for_term($term->term_id)->open_graph_article_modified_time), 631 'opengraphDescription' => wp_gql_seo_format_string(YoastSEO()->meta->for_term($term->term_id)->open_graph_description), 632 'opengraphImage' => DataSource::resolve_post_object($meta['wpseo_opengraph-image-id'], $context), 633 'twitterCardType' => wp_gql_seo_format_string(YoastSEO()->meta->for_term($term->term_id)->twitter_card), 634 'twitterTitle' => wp_gql_seo_format_string(YoastSEO()->meta->for_term($term->term_id)->twitter_title), 635 'twitterDescription' => wp_gql_seo_format_string(YoastSEO()->meta->for_term($term->term_id)->twitter_description), 636 'twitterImage' => DataSource::resolve_post_object($meta['wpseo_twitter-image-id'], $context), 637 'canonical' => wp_gql_seo_format_string($meta['canonical']), 638 'breadcrumbs' => YoastSEO()->meta->for_term($term->term_id)->breadcrumbs, 639 'cornerstone' => boolval(YoastSEO()->meta->for_term($term->term_id)->is_cornerstone), 640 ); 641 wp_reset_query(); 642 643 return !empty($seo) ? $seo : null; 644 } 645 ]); 646 } 647 } 648 }); 995 }); 649 996 });
Note: See TracChangeset
for help on using the changeset viewer.