From 278d751c765dba031fdcbeec1ed0d425a16486be Mon Sep 17 00:00:00 2001 From: Ash Hitchcock Date: Mon, 29 May 2023 21:04:21 +0100 Subject: [PATCH] Version bump --- CHANGELOG.md | 7 +++++++ package.json | 2 +- readme.txt | 2 +- wp-graphql-yoast-seo.php | 7 +++---- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 251742c..9d570e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [4.22.4] - 2023-05-29 + +### Fixed + +- Internal server error when querying SEO fields for a user that has no posts (#157) (thanks @pascalroget) +- woocommerce product support (#158) (thanks @berryhijwegen) + ## [4.22.3] - 2023-05-29 ### Fixed diff --git a/package.json b/package.json index f026de5..fc392c1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wp-graphql-yoast-seo", - "version": "4.22.3", + "version": "4.22.4", "description": "A WPGraphQL Extension that adds support for Yoast SEO", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", diff --git a/readme.txt b/readme.txt index d6da920..3f2e9a0 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: SEO, Yoast, WPGraphQL, GraphQL, Headless WordPress, Decoupled WordPress, J Requires at least: 5.0 Tested up to: 6.1.1 Requires PHP: 7.1 -Stable tag: 4.22.3 +Stable tag: 4.22.4 License: GPLv3 License URI: https://www.gnu.org/licenses/gpl-3.0.html diff --git a/wp-graphql-yoast-seo.php b/wp-graphql-yoast-seo.php index 12d4270..c49d3c0 100755 --- a/wp-graphql-yoast-seo.php +++ b/wp-graphql-yoast-seo.php @@ -8,7 +8,7 @@ * Author URI: https://www.ashleyhitchcock.com * Text Domain: wp-graphql-yoast-seo * Domain Path: /languages - * Version: 4.22.3 + * Version: 4.22.4 * * @package WP_Graphql_YOAST_SEO */ @@ -842,7 +842,7 @@ function get_post_type_graphql_fields($post, array $args, AppContext $context) return get_post_type_graphql_fields($post, $args, $context); }, ]); - + // if woocommerce is active, add seo to product if (class_exists('WooCommerce')) { register_graphql_field('Product', 'seo', [ @@ -916,12 +916,11 @@ function get_post_type_graphql_fields($post, array $args, AppContext $context) 'type' => 'SEOUser', 'description' => __('The Yoast SEO data of a user', 'wp-graphql-yoast-seo'), 'resolve' => function ($user, array $args, AppContext $context) { - // Author has no posts if (!YoastSEO()->meta->for_author($user->userId)) { return []; } - + $robots = YoastSEO()->meta->for_author($user->userId)->robots; $schemaArray = YoastSEO()->meta->for_author($user->userId)->schema;