Giter Site home page Giter Site logo

axewp / wp-graphql-rank-math Goto Github PK

View Code? Open in Web Editor NEW
43.0 5.0 7.0 4.59 MB

Add GraphQL support for RankMath SEO

License: GNU General Public License v3.0

PHP 94.16% Shell 4.50% Dockerfile 1.34%
graphql headless-wordpress php rank-math seo wordpress wordpress-plugins wp-graphql wpgraphql wpgraphql-plugin

wp-graphql-rank-math's People

Contributors

colis avatar idflood avatar justlevine avatar lucguerraz avatar marcinkrzeminski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

wp-graphql-rank-math's Issues

Redirect queries when resolving uris.

What problem does this address?

While #52 adds the ability to query for redirections from the schema, querying for the redirected URI doesn't fetch the redirected object. This is because the Rank Math Redirector class (like most of the plugin) only operates on the global query/request.

What is your proposed solution?

We need to filter graphql_pre_resolve_uri and check if the provided URI matches any redirections.

This will either require a change in Rank Math core or a local shim of the entire Redirector class.

What alternatives have you considered?

The existing approach is to use frontend redirects (e.g. https://nextjs.org/docs/pages/api-reference/next-config-js/redirects).

Additional Context

Something that needs to be solved is how/where to send redirects that are not ContentNode types. See #2491

Data on frontend not aligning with WPGraphiQL query

Description

When different URLS are used for Wp Adress URL and site adress the data being returned no longer aligns with the WPGRAPHQL Ide

Steps to reproduce

Create a backend on a subdomain.

Wp Adress URL should be backend subdomain. ie backend.sitename.com
Site Adress should be set to a different frontend site adress.

Create a custom post type. + a custom taxonomy for that post type. Enable Rankmath and set posts to no index.

Run Queries for SEO data. Meta Robots. Notice that the data being returned is wrong. Although it shows no-index in the WPGRAPHQL ide. The frontend says index for everything.

The only thing that fixes this issue is changing both urls to the same. Although this is not an acceptable solution to the problem as the frontend URL needs to be different in my use case and other headless use cases.

The same goes for the other data such as breadcrumbs, title etc. Other page data related to the Rankmath SEO query is also missing, some is there though(graphql IDE) but when queried it will show incorrect data on the frontend.

Example

"canonicalUrl": null,
"robots": [
"follow",
"noindex"
],

The frontend data will show something different.

Additional Context

No response

Plugin Version

0.0.7 and others

WordPress Version

WordPress 6.1.1 running Twenty Twenty-One theme.

WPGraphQL Version

Version 1.13.7

RankMath SEO Version

Version 1.0.103.1 + pro Version 3.0.25

Additional enviornmental details

Running on next.js with apollo client

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have disabled ALL plugins except for RankMath SEO, WPGraphQL, and WPGraphQL for Rank Math

  • Yes
  • My issue is with a specific 3rd-party plugin.

Throw compatibility error if wp-graphql-yoast-seo is enabled.

What problem does this address?

While it may be obvious that Rank Math and Yoast SEO cannot coexist, the plugin is unfortunately slugged add-wpgraphql-seo. This can and has caused confusion about the true purpose of that plugin and whether it can be installed alongside (or if it may even be a prerequeste for) WPGraphQL for RankMath SEO.

What is your proposed solution?

Disable the plugin and add an admin_notice when wp-graphql-yoast-seo is installed.

What alternatives have you considered?

No response

Additional Context

h/t @alexkey89

Redirect Attachments breaks gatsby-source-wordpress: `GraphQL request was redirected to /`

Description

I'm able to get seo field on WordPress GraphQL IDE. But on gatsby develop giving this error.

Steps to reproduce

Getting this Error: GraphQL request was redirected to /

Additional Context

image

image

Plugin Version

WPGraphQL for Rank Math SEO Version 0.0.5

WordPress Version

6.0.3

WPGraphQL Version

1.12.0

RankMath SEO Version

1.0.100.1

Additional enviornmental details

"react": "^18.1.0",
"gatsby": "^4.19.2",
"gatsby-source-wordpress": "^6.24.0",

{
resolve: gatsby-source-wordpress,
options: {
schema: {
timeout: 100000,
},
url: https://cliniexpertsresearch.net/graphql,
}
},

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have disabled ALL plugins except for RankMath SEO, WPGraphQL, and WPGraphQL for Rank Math

  • Yes
  • My issue is with a specific 3rd-party plugin.

Robot meta data showing noindex and nofollow for all pages and posts

Description

Hi all, I am trying get robots meta data in rank math wpgraphql plugin, but seems like all results showing noindex and nofollow for all pages and posts. I check in my rank match setting, and almost all pages have index property, still wpgraphql showing noindex and nofollow

Steps to reproduce

Go to graphql IDE, and add this query:

query myQuery {
  contentNodes(first: 999) {
    edges {
      node {
        seo {
          robots
        }
      }
    }
  }
}

Additional Context

I disabled discourage search enginer in settings > reading, but still it is showing noindex and nofollow

Plugin Version

0.0.11

WordPress Version

6.1.1

WPGraphQL Version

1.14.0

RankMath SEO Version

1.0.110.2

Additional enviornmental details

No response

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have disabled ALL plugins except for RankMath SEO, WPGraphQL, and WPGraphQL for Rank Math

  • Yes
  • My issue is with a specific 3rd-party plugin.

CoreSchemaFilters.php on line 16

Description

Uncaught Error: Interface "AxeWP\GraphQL\Interfaces\Hookable" not found

Steps to reproduce

  1. download release zip
  2. plugin install wordpress
  3. enable plugin
 Fatal error: Uncaught Error: Interface "AxeWP\GraphQL\Interfaces\Hookable" not found
in /var/www/html/wp-content/plugins/wp-graphql-rank-math-develop/src/CoreSchemaFilters.php on line 16

Call stack:

include()
wp-content/plugins/ame-branding-add-on/vendor/composer/ClassLoader.php:480
Composer\A\includeFile()
wp-content/plugins/ame-branding-add-on/vendor/composer/ClassLoader.php:346
Composer\A\ClassLoader::loadClass()
wp-content/plugins/wp-graphql-rank-math-develop/src/Main.php:79
WPGraphQL\R\Main::setup()
wp-content/plugins/wp-graphql-rank-math-develop/src/Main.php:38
WPGraphQL\R\Main::instance()
wp-content/plugins/wp-graphql-rank-math-develop/wp-graphql-rank-math.php:108
graphql_seo_init()
wp-includes/class-wp-hook.php:307
WP_Hook::apply_filters()
wp-includes/class-wp-hook.php:331
WP_Hook::do_action()
wp-includes/plugin.php:476
do_action()
wp-content/plugins/wp-graphql/src/WPGraphQL.php:256
WPGraphQL::{closure}()
wp-includes/class-wp-hook.php:307
WP_Hook::apply_filters()
wp-includes/class-wp-hook.php:331
WP_Hook::do_action()
wp-includes/plugin.php:476
do_action()
wp-settings.php:576
require_once()
wp-config.php:133
require_once()
wp-load.php:50
require_once()
wp-admin/admin.php:34
require_once()
wp-admin/plugins.php:10
Query Monitor

Additional Context

No response

Plugin Version

0.0.2

WordPress Version

6.0.1

WPGraphQL Version

1.8.6

Additional enviornmental details

PHP 8.1

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have disabled ALL plugins except for RankMath SEO, WPGraphQL, and WPGraphQL for Rank Math

  • Yes
  • My issue is with a specific 3rd-party plugin.

Decode HTML Entities by default

What problem does this address?

When getting the values from the GraphQL, the titles and descriptions with HTML entities (such as – and &) are rendered as – and & respectively.

I think the plugin should display them ready-to-use by the frontend instead of the backend or frontend decoding them.

What is your proposed solution?

The obvious solution would be to decode them when passing them to the GraphQL.

What alternatives have you considered?

An alternative, is to do the decoding myself with RankMath's filters. For example, to decode the SEO title you can simply add these lines of code:

add_filter('rank_math/frontend/title', function ($title) {
  return html_entity_decode($title);
});

Nonetheless, I would still prefer that the plugin did this by default.
Let me know if you disagree and why πŸ™‚

Additional Context

No response

Add support for WooCommerce productCategories

What problem does this address?

It doesn't seem to return SEO for woocommerce products whether if is simple product or variable.

What is your proposed solution?

Add support / extend this plugin to support WooCommerce better

What alternatives have you considered?

YoastSEO already provides graphql support.

Additional Context

No response

productData inside openGraph is returning null as value

Description

https://www.zenbusiness.com/llc/

I did a console log of the openGraph props in Astro: and articleMeta & videoMeta comes with info, but productMeta doesn’t.
image

Steps to reproduce

This is the schema of one of the pages we are checking:
image

This is the part of the code always returning empty:
image

Additional context

No response

Plugin Version

0.0.14

WordPress Version

6.3.2

WPGraphQL Version

1.19.0

RankMath SEO Version

1.0.208.1

Additional enviornmental details

No response

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have disabled ALL plugins except for RankMath SEO, WPGraphQL, and WPGraphQL for Rank Math

  • Yes
  • My issue is with a specific 3rd-party plugin.

`seo` fields should resolve directly to the GraphQL object (instead of the interface) when possible.

Description

Currently ${objectType}.seo is typed as RankMathSeo instead of RankMath${ObjectType}Seo.

This requires you to unnecessarily drill down the interface, like in 53efda5

We should leave the NodeWithSeo interface to use the RankMathSeo type, but for all direct connections we should resolve straight to the object. This would reduce complexity on both the query and implementation (i.e. graphql-Codegen) side of this.

Important

This may be a breaking change to implement.

Steps to reproduce

query UserSeo( $id: ID! ) {
user( id: $id, idType: DATABASE_ID ){
	databaseId
	seo {
		fullHead
		# this should not be necessary πŸ‘‡
		... on RankMathUserSeo {
			additionalProfiles
			facebookProfileUrl
			twitterUserName
		}
	}
}

Additional context

No response

Plugin Version

0.1.0

WordPress Version

6.4.3

WPGraphQL Version

1.22.0

RankMath SEO Version

1.215.1

Additional enviornmental details

No response

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have disabled ALL plugins except for RankMath SEO, WPGraphQL, and WPGraphQL for Rank Math

  • Yes
  • My issue is with a specific 3rd-party plugin.

Get information about `post types`

What problem does this address?

You can get seo information about post types.

What is your proposed solution?

{
  posts {
    pageInfo {
      seo { // archive data
		breadcrumbTitle
        canonicalUrl
        description
        fullHead
        isPillarContent
        title
      }
    }
  }
}

What alternatives have you considered?

There is still no way to think of an alternative.

Additional Context

You can set this information in the WordPress Rank-math plugin, but it is a pity that you cannot get it from graphql.

Watermark options

What problem does this address?

I can't find a way to launch playicon in Watermark options. There is no option to be able to do that. Do you have any solution to fix this situation?
image

What is your proposed solution?

I want to find a solution that can use watermark using graphql

What alternatives have you considered?

No response

Additional Context

No response

breadcrumb produce Internal server error on ContentType

Description

When "ContentType" is returned by a nodeByUri query (for example on the page for posts e.g. "/blog" or woocommerce shop page e.g. "/shop") including "breadcrumbs" under "NodeWithRankMathSeo" produces an internal server error. The data is still returned with the breadcrumbs being null. I suspect breadcrumbs are not actually available on this type?

Steps to reproduce

Example query:

query rankMathNodeByUri {
	nodeByUri(uri: "/blog") {
		__typename
		... on NodeWithRankMathSeo {
			seo {
				__typename
				title
				description
				breadcrumbs {
					text
					isHidden
					url
				}
			}
		}
	}
}

Result:

{
	"errors": [
		{
			"message": "Internal server error",
			"extensions": {
				"category": "internal"
			},
			"locations": [
				{
					"line": 9,
					"column": 5
				}
			],
			"path": [
				"nodeByUri",
				"seo",
				"breadcrumbs"
			]
		}
	],
	"data": {
		"nodeByUri": {
			"__typename": "ContentType",
			"seo": {
				"__typename": "RankMathPostTypeSeo",
				"title": "Blog - Website Name",
				"description": "Blog page SEO description",
				"breadcrumbs": null
			}
		}
	}
}

Additional context

No response

Plugin Version

0.1.1

WordPress Version

6.4.3

WPGraphQL Version

1.22.1

RankMath SEO Version

1.0.216

Additional enviornmental details

WooGraph 0.19.0
WooCommerce 8.6.1

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have disabled ALL plugins except for RankMath SEO, WPGraphQL, and WPGraphQL for Rank Math

  • Yes
  • My issue is with a specific 3rd-party plugin.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.