Coder Social home page Coder Social logo

rankmath / seo-by-rank-math Goto Github PK

View Code? Open in Web Editor NEW
99.0 99.0 50.0 10.33 MB

Rank Math is a revolutionary WordPress SEO Plugin that combines the features of many SEO tools and lets you multiply your traffic in the easiest way possible :bulb: :chart_with_upwards_trend: →

Home Page: https://rankmath.com

CSS 0.04% JavaScript 28.99% PHP 61.12% SCSS 9.85%
seo wordpress wordpress-plugin

seo-by-rank-math's People

Contributors

dawnbirth avatar mmcachran avatar strategio avatar surajv 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

seo-by-rank-math's Issues

Add check if WC is installed or enabled.

Now i'm getting E_ERROR, because I don't use WC and my wordpress project and there is no action_schedule tables.

An error of type E_ERROR was caused in line 44 of the file /home/***/domains/****.com/public_html/wp-content/plugins/seo-by-rank-math/vendor/woocommerce/action-scheduler/classes/migration/ActionScheduler_DBStoreMigrator.php. Error message: Uncaught RuntimeException: Error saving action: Error saving action: Table '****.wp_actionscheduler_actions' doesn't exist in /home/***/domains/****.com/public_html/wp-content/plugins/seo-by-rank-math/vendor/woocommerce/action-scheduler/classes/migration/ActionScheduler_DBStoreMigrator.php:44 Stack trace: #0 /home/***/domains/****.com/public_html/wp-content/plugins/seo-by-rank-math/vendor/woocommerce/action-scheduler/classes/data-stores/ActionScheduler_HybridStore.php(242): ActionScheduler_DBStoreMigrator->save_action(Object(ActionScheduler_Action), NULL) #1 /home/***/domains/****.com/public_html/wp-content/plugins/seo-by-rank-math/vendor/woocommerce/action-scheduler/classes/ActionScheduler_ActionFactory.php(177): ActionScheduler_HybridStore->save_action(Object(ActionScheduler_Action)) #2 /home/***/domains/****.com/public_html/wp-content/plugins/seo-by-rank-math/vendor/woocommerce/action-scheduler/classes/ActionScheduler_ActionFactory.php

if ( did_action( 'plugins_loaded' ) && ! class_exists( 'ActionScheduler' ) ) {

PHP errors were triggered during an Ajax request.

How to repro?

  • Install Query Monitor
  • Make a post Sticky
  • Check console

image

`2021/01/16 18:38:55 [error] 545#545: *10323 FastCGI sent in stderr: "PHP message: PHP Warning:  count(): Parameter must be an array or an object that implements Countable in /var/www/html/wp-content/plugins/seo-by-rank-math/includes/modules/instant-indexing/class-api.php on line 84" while reading response header from upstream, client: 45.79.121.31, server: example.com, request: "POST /wp-admin/admin-ajax.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock:", host: "www.example.com", referrer: "https://www.example.com/wp-admin/edit.php`

Temporary Solution

How to not get this error?

  • disable instant indexing
  • problem solved

Please fix this issue.

I am using PHP 7.4-fpm NGINX

Breadcrumbs don't show WC categories on product pages?

Describe the bug

When I go to the product page, I only see a link back to the homepage and not a breadcrumb going to the category page. How do I include the woocommerce category? Seems to work with my blogs, but not woocomm.

So breadcrumbs are

<a ...>Homepage</a>

Instead of the preferred

<a ...>Homepage</a> >> <a ...>Category</a> [>> <a ...>Sub Category</a> >> Product Name]

To Reproduce
Steps to reproduce the behavior:

Create custom theme builder template for all woocomm product pages with Elementor -> Drag in code section ->

Expected behavior

This output for breadcrumbs:
<a ...>Homepage</a> >> <a ...>Category</a> [>> <a ...>Sub Category</a> >> Product Name]

Screenshots

Rank Math settings:
math-rank-issue

Theme builder settings:
Screen Shot 2020-11-20 at 4 13 55 PM

Desktop (please complete the following information):
n/a

Additional context
n/a

Wrongly stripped 4 digits counts on redirections management page

Bug Description
The counts on the Redirections Table views become stripped when reach a 4 digits number or more e.g "1000 becomes 1" as the shown on the attached image:
Screen Shot 2020-11-28 at 11 02 45 PM

To Reproduce

  1. Go to Redirections from Rank Math Dashboard menu
  2. Add a lot of redirections until reaching 1000 or more
  3. You will notice that the counts are wrong on the top views above the table, at the same time the correct count will appear besides the pagination links.

Expected behavior
The correct counts should appear at the top views just like the count next to the pagination links.

Encoded category URLs give 404 error when removing category base

Describe the bug
Category URLs in which category slug is not Latin characters --like Arabic--, open as 404 not found page when the encoded part of the URL --encoded slug-- is converted to uppercase and "Strip Category Base" option is turned on.

To Reproduce

Steps to reproduce the behavior:

  1. Create a new category and make its slug in Arabic charachters.
  2. Add some posts to the newly created category to avoid 404 page due to it's empty.
  3. Go to Rank Math general settings and turn on "Strip Category Base" option.
  4. Open the newly created category link in the browser, it should open without issue.
  5. Copy the category url and convert the encoded part to its uppercase form, paste it again in the browser and visit it, a 404 page appears instead of the category archive page.

Expected behavior

Encoded forms of URLs should work the same when the encoded part is in its uppercase or lowercase form.

Redirection using site URL instead of home URL.

Describe the bug
I am using Roots Bedrock alongside RankMath. With Bedrock, WordPress is put into a sub directory (/wp/) – by default, RankMath is fetching the site URL for relative URL's causing my redirects to look like site.com/wp/<destination> instead of site.com/<destination>

Additional context
Semi-related to #2

You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'IF' at line 1

Describe the bug
I installed the Rank Math V 1.0.53 plugin on a website with WordPress 5.5.3, PHP 7.3 & MariaDB 10.3.25, and when I tried to activate it gave the following error

You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'IF' at line 1

Additional context
I tried to debug the issue, where is what I found, dbDelta when tries to parse the create query it results in picking up the wrong table name. As shown in the dump of $cqueries variable in dbDelta function.

array(1)
[
"IF" => string(496) "CREATE TABLE IF NOT EXISTS wp_rank_math_404_logs (
id BIGINT(20) unsigned NOT NULL AUTO_INCREMENT,
uri VARCHAR(255) NOT NULL,
accessed DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
times_accessed BIGINT(20) unsigned NOT NULL DEFAULT 1,
ip VARCHAR(50) NOT NULL DEFAULT '',
referer VARCHAR(255) NOT NULL DEFAULT '',
user_agent VARCHAR(255) NOT NULL DEFAULT '',
PRIMARY KEY (id),
KEY uri (uri(191))
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci"
]

So when dbDelta tries to run the following line it results in the above error.

$tablefields = $wpdb->get_results( "DESCRIBE {$table};" );

basically, it tries to execute the following query
DESCRIBE IF;

Minify JSON+ld Schema Output

Is your feature request related to a problem? Please describe.
The ld+json added by the plugin is not minified

Describe the solution you'd like
Minify the JSON+ld output

Describe alternatives you've considered
N/A

Additional context
N/A

image

Publish on Packagist

Is your feature request related to a problem? Please describe.
No.

Describe the solution you'd like
I'd like to see if you guys could publish Rank Math on Packagist.org real quick – everything in the repo is already setup so it just needs someone with access to mythemeshop to add it

HowTo block paragraph container

Is your feature request related to a problem? Please describe.
Currently the HowTo block paragraphs are not wrapped in a div. This makes it increasingly difficult to style them alongside an image without resorting to floating.

Describe the solution you'd like
Wrap this in a div

Describe alternatives you've considered
N/A

Additional context
N/A

Media Library: "Exclude this image from sitemap" wording isn't contextualised

Describe the bug
When editing an image Attachment in the Media Library, Rank Math adds a checkbox with the label "Exclude this image from sitemap". However, the same wording appears when editing a non-image Attachment, such as a CSV file.

To Reproduce
Steps to reproduce the behavior:

  1. Go to WordPress Admin > Media
  2. Click on any non-image Attachment
  3. Note the incorrect wording on the label "Exclude this image from sitemap"

Expected behavior
The label's text should be contextualised based on the file type being edited, and not assume it is always an image.
Alternatively, if Rank Math cannot include/exclude certain file types from the sitemap, the option should/should not display accordingly.

Screenshots
Screenshot_2021-10-12_at_15_01_40

Wrong featured image title/alt atribute value when %title% var is used

Describe the bug

When the "Add missing TITLE attributes" or "Add missing ALT attributes" is on and the format is set to "%title%", the value of the attributes for the featured images sometimes holds a wrong value. This happens when the posts are displayed using a custom query and the loop doesn't depend on setup_postdata() to set the global $post to the current post in the custom loop.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Rank Math "General Settings" and open "Images" Tab
  2. Turn the "Add missing TITLE attributes" on and set the format to "%title%"
  3. Create a custom posts query inside another posts archive e.g 'category archive page', may be a loop like this:
$some_posts = get_posts([
    'post_type' => 'post',
    'posts_per_page' => 5,
    'no_found_rows' => true,
]);
  1. Loop through the custom query posts and print the featured image without using "setup_postdata()", Like this may be:
foreach($some_posts as $some_post) {
    echo '<div>';
    echo get_the_title($some_post) . '<br>';
    echo get_the_post_thumbnail($some_post);
    echo '</div>';
}
  1. Check the title attributes for the displayed featured images, they hold a value different from the displayed post title.

Expected behavior
The automatically generated ALT/TITLE attribute value for the featured image should be the same as the post title being displayed when the format is set to "%title%" from Rank Math image settings.

Suggested code Edit

In this file:
includes/modules/image-seo/class-add-attributes.php

I think the callback used by Rank Math on the filter "post_thumbnail_html" should use a second attribute "$post_id" to get the current displayed post instead of depending on the current global $post.

Warning: Illegal string offset '@type' in schema\class-admin.php on line 207

Describe the bug

Warning: Illegal string offset '@type' in wp-content\plugins\seo-by-rank-math\includes\modules\schema\class-admin.php on line 207

To Reproduce
Steps to reproduce the behavior:

  1. Install RankMath
  2. In Setup Guide, just skip all steps.
  3. Migrate posts from old site (which has Rank Math data) using WP All Import plugin (add all custom fields)
  4. Navigate to Posts after migrating.

Screenshots

Screenshot_2

Additional context

I believe your code check empty($schemas) is not good cover in this case. In my dump data, it loads:

'schema-177880' => string '' (length=0)
  'schema-177883' => string '' (length=0)
  'schema-177922' => string '' (length=0)
  'schema-177938' => string '' (length=0)

Product Category Make Term Primary selector is gone

Describe the bug
There used to be a radio button to select the subcategory you wanted for any given product. I have been using it no problem, even last night.
This morning my plugin updated to 1.0.48 and that radio button is gone.

I'm referring to this (borrowing this screenshot from a previous forum entry, but it's not the same issue)

Screen Shot 2019-07-03 at 14 02 49

Default Article Schema type not added to post structured data

Describe the bug
When the Global settings of Schema Type is set to "Article" and the Article type is also set to "Article" the type applied is "WebPage" and the Article type is not added to the structured data of the posts that don't have a type set from the post editing screen.

To Reproduce

  1. Go to 'Titles & Meta' settings page
  2. Click on 'Posts' Tab
  3. Set the "Schema Type" to Article and "Article Type" to "Article"
  4. Save the changes
  5. In the browser, open a post that doesn't have a Schema type set in its post meta through the post editing screen.
  6. Check the structured data set to this post, it is "WebPage" not "Article".

Expected behavior

The global Article type should be applied on posts unless a manual type is specified for the post through the editing screen of that post

The code causing the issue
We solved the issue in this file
includes/modules/schema/snippets/class-singular.php
By modifying this line
$schema = in_array( $schema, [ 'BlogPosting', 'NewsArticle' ], true ) ? 'article' : $schema;
To
$schema = in_array( $schema, [ 'Article', 'BlogPosting', 'NewsArticle' ], true ) ? 'article' : $schema;

Stop adding Cache Control of 1 year for the Sitemap pages

Currently a Cache-Control header of Cache-Control: max-age=31536000 is being added to the xml and xsl files by Rankmath, which basically tell the browser/CDN to cache the sitemaps, which is a really bad approach as sitemaps should never be cached as it contains always changing dynamic content.

If you want to keep it, don't set it by default instead give an option to the user asking if they want to add cache control to the sitemaps or not. Moreover adding this cache-control via PHP prevents users to overwrite it via server rule like nginx.conf as Nginx will add the header first and then PHP will overwrite it.

The cache-control is being added from /seo-by-rank-math/includes/modules/sitemap/abstract-xml.php line no 48 from this function:

protected function send_headers( $headers = [] ) {
  $expires  = gmdate( 'D, d M Y H:i:s', ( time() + YEAR_IN_SECONDS ) );
  $defaults = [
    'X-Robots-Tag'  => 'noindex',
    'Content-Type'  => 'text/xml; charset=' . $this->get_output_charset(),
    'Pragma'        => 'public',
    'Cache-Control' => 'maxage=' . YEAR_IN_SECONDS, // <-- THIS LINE
    'Expires'       => $expires . ' GMT',
    'Etag'          => md5( $expires . $this->type ),
  ];

  $headers = wp_parse_args( $headers, $defaults );

  header( $this->get_protocol() . ' 200 OK', true, 200 );

  foreach ( $headers as $header => $value ) {
    header( $header . ': ' . $value );
  }
}

Please stop adding cache-control by default. The plugin should never add the cache-control and if any user needs they can add the respective htaccess or nginx rules for that in the server.

Woo-commerce product section breaks after activating Rankmath SEO

Bug Name
Woo-commerce Product section breaks after activating Rank Math SEO.

To Reproduce
Steps to reproduce the behavior:

  1. Activate Woo-commerce
  2. Activate Rank Math SEO
  3. Go to /wp-admin/edit.php?post_type=product
  4. View product SEO details section

Screenshots
Rankmathproduct

Desktop :

  • OS: macOS Version 11.5.2
  • Browser : Chrome
  • Version : 94.0.4606.61 (Official Build) (x86_64)

Wrong category hierarchy in Product Schema

Describe the bug
Wrong category hierarchy in Product Schema
Actual product category structure:
Parent1 > Parent2> Parent3 > currentCategory

in schema:
[@type] Product
...
[category] => Parent3> Parent2> Parent1 > currentCategory

Expected behavior
[category] => Parent1> Parent2> Parent3 > currentCategory

Additional context
There is wrong ordering in seo-by-rank-math>includes>modules>schema>snippets>class-product.php
function get_category( $product_id, $taxonomy )

get_ancestors() of currentCategory retrieves parent categories in reverse order, then you add currentCategory at the end. Should be opposite.

Terms with different canonicals aren't excluded from sitemap

Describe the bug

When setting a different canonical url for a term "e.g a tag, or a category" it keeps showing up in the sitemap of the corresponding taxonomy.

To Reproduce
Steps to reproduce the behavior:

  1. Go to categories screen on WordPress dashboard
  2. Click on "edit" for any category
  3. Scroll down to RankMath Metabox and click "advanced" tab.
  4. Place a different canonical url in "Canonical URL" field and then click "update".
  5. Make sure to clear the Sitemap cache.
  6. Now, visit to the "category-sitemap.xml" url on the browser and search for the category link that you've changed its canonical url, it will be there on the sitemap as usual.

Expected behavior
Any Term URL that has a different canonical URL from its original permalink should be removed from the sitemap. This behaviour is applied correctly on the single posts urls, but not on terms urls.

Additional context

After searching into the code responsible for displaying terms urls, I found that the intended behaviour is to show the custom set canonical instead of the actual term link through this code line in "includes/modules/sitemap/providers/class-taxonomy.php":

$url = Helper::get_term_meta( 'canonical', $term, $term->taxonomy );

But, the previous code always fail to get the custom set canonical because the term meta key is wrongly typed, it should be "canonical_url" instead of "canonical".

Still, there is no use to show the custom canonical in the sitemap because most probably it will be another indexable internal link that is already somewhere in the sitemap.

Sitemap - relative URLs (Invalid in Google Search Console)

Describe the bug

For some reason, the URLs in the sitemap are being generated without the domain included - this resulted in GSC reporting errors.

The domain is non English: https://xn--lck0a4d.guru/

Sitemap location: https://xn--lck0a4d.guru/sitemap_index.xml

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://xn--lck0a4d.guru/sitemap_index.xml
  2. Click on any of the sitemaps
  3. All URLs are relative

Expected behavior

The expected behavior is to have absolute URLs in the sitemap.

[PHP 8] Error: Callable ["\\RankMath\\CLI\\Commands","sitemap_generate"] does not exist, and cannot be registered as `wp rankmath sitemap generate`.

It fails with a PHP fatal error when calling from wp-cli
Callable ["\\RankMath\\CLI\\Commands","sitemap_generate"] does not exist, and cannot be registered as wp rankmath sitemap generate.

To Reproduce
Steps to reproduce the behavior:

  1. Install wp-cli:
    curl https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar -s --output /usr/local/bin/wp && chmod +x /usr/local/bin/wp
  2. Execute any wp-cli command (as no root), using PHP 8.0.1, for example:
    wp cron event run --due-now --path=/home/user/whereWordpressIsInstalled

Expected behavior
The command runs with an exit code = 0 and an output similar to what in PHP 7.4.14 is gotten:

Executed the cron event 'action_scheduler_run_queue' in 0.006s.
Success: Executed a total of 1 cron event.

Additional context
WP-CLI 2.4.0
WordPress version: 5.6
PHP 8.0.1 (cli) (built: Jan 8 2021 10:09:55) ( NTS gcc x86_64 )
mysql Ver 15.1 Distrib 10.3.27-MariaDB, for Linux (x86_64) using readline 5.1
Linux ... 4.18.0-147.8.1.el7h.lve.1.x86_64 #1 SMP Mon Jun 29 09:05:02 EDT 2020 x86_64 x86_64 x86_64 GNU/Linux
Database revision: 49752
TinyMCE version: 4.9110 (49110-20201110)
Package language: es_ES

Breadcrumb post-type output singular_name, not its name.

Hi,

Quick question regarding the post-type display in breadcrumb. The code seems to output the singular_name, should this not display the name instead ?

/ Home / My PostType
/ Home / My PostType / My title

Should instead display :

/ Home / My PostTypes
/ Home / My PostTypes / My title

$this->add_crumb( $type_object->labels->singular_name, get_post_type_archive_link( $post_type ) );

Is this someting by design? I think this could be a great option to add in the Breadcrumb options. I'm glad to contribute on that feature if needed.

Thank you, best regards.

PS: We really really love your plugin, it's amazing with a stellar code structure.

Not such a big issue, but could be confusing...

Describe the bug
After re-authenticating Google account, the notification at the top is still showing. This could be confusing for those who connected to Google and are still wondering why it's saying to re-authenticate.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error
    Expected behavior
    I expected that once you re-authenticate, that the yellow warning would disappear on the top.

Screenshots
Screen Shot 2020-10-09 at 10 51 21 AM

Desktop (please complete the following information):

  • OS: Catalina 10.15.6
  • Browser: Chrome
  • Version: 85.0.4183.121

Additional context
Add any other context about the problem here.

Shortcodes not converted in rendered meta description and schema's

Describe the bug
I have a [company] shortcode that dynamically converts into the business name set on my websites. When I use the [company] shortcode within my WooCommerce product category meta descriptions it gets indexed on Google with the actual shortcode, [company], instead of my actual business name.

A matter of fact, I'm not seeing the meta description inserted throughout my website at all now for some reason; so I can't show a screenshot of that. I don't want that to distract from the problem at hand, but ideally I would like to know how to fix both issues if one of the dev's or a knowledgeable community member could assist.

Thanks guy, loving the plugin so far. It's a better approach than Yoast SEO in the Elementor context for sure.

To Reproduce
Steps to reproduce the behavior:

  1. Setup WooCommerce category
  2. Add meta description's to it using plugin
  3. Check the meta description with inspector
  4. ???
  5. Profit

Expected behavior
A clear and concise description of what you expected to happen.

I expected the shortcode to be ran through do_shortcode function to convert it to my company name.

Screenshots
Screen Shot 2020-10-24 at 8 06 07 PM

Desktop (please complete the following information):

  • OS: macOS
  • Browser: chrome
  • Version: 86.0.4240.111 (Official Build) (x86_64)

Additional context
Add any other context about the problem here.

Side Note: An additional feature I personally would like to see would be for WooCommerce categories built with Elementor's Theme Builder to have the SEO tab in the editor instead, or on top, of us having to go into the actual WooCommerce category.

Trying to access array offset on value of type bool

Describe the bug

File: seo-by-rank-math/includes/modules/schema/class-admin.php
Line: 305

private function get_schema_types( $post_id ) {
        $schemas = DB::get_schemas( $post_id );
        if ( empty( $schemas ) ) {
            return false;
        }
 
        $types = [];
        foreach ( $schemas as $schema ) {
            $types[] = Helper::sanitize_schema_title( $schema['@type'] );
        }
 
        return implode( ', ', $types );
    }

Conditional needed above when "$schema" returns false.

Desktop:

  • OS: Windows
  • Browser: Chrome
  • Version: Latest

v1.0.62 — Schema Snippet class-primaryimage.php: `Undefined offset: 0` warning

Describe the bug
After updating to v1.0.62 My homepage (only) showed the warning:

Notice: Undefined offset: 0 
in /[...]/seo-by-rank-math/includes/modules/schema/snippets/class-primaryimage.php on line 38

https://github.com/rankmath/seo-by-rank-math/blame/master/includes/modules/schema/snippets/class-primaryimage.php#L38

The variable $image at this point is an Array with only a caption key and no value:

Array ( [caption] => )

Desktop (please complete the following information):

  • OS: OSX
  • Firefox 87.0

Additional context
This is a MultiSite, Multi-Language-Press Wordpress 5.7 install.
The error only occurs on the root site.com/

Adding new Site in WPMU

when I try to make a new site in the mutli-domain, I get this error. I see you have a fix for it, but I don't know where need to change to make it work.

Describe the bug
`Fatal error: Uncaught Exception: Error saving action: Table 'db.wp_5_actionscheduler_actions' doesn't exist
in html_public/wp-content/plugins/seo-by-rank-math/vendor/woocommerce/action-scheduler/classes/data-stores/ActionScheduler_DBStore.php on line 75

Call stack:

ActionScheduler_DBStore::save_action()
wp-content/plugins/seo-by-rank-math/vendor/woocommerce/action-scheduler/classes/ActionScheduler_ActionFactory.php:177
ActionScheduler_ActionFactory::store()
wp-content/plugins/seo-by-rank-math/vendor/woocommerce/action-scheduler/classes/ActionScheduler_ActionFactory.php:105
ActionScheduler_ActionFactory::recurring()
wp-content/plugins/seo-by-rank-math/vendor/woocommerce/action-scheduler/functions.php:54
as_schedule_recurring_action()
wp-content/plugins/seo-by-rank-math/includes/modules/analytics/class-installer.php:35
RankMath\A\Installer::install()
wp-content/plugins/seo-by-rank-math/includes/class-installer.php:170
RankMath\Installer::activate()
wp-content/plugins/seo-by-rank-math/includes/class-installer.php:82
RankMath\Installer::activate_blog()
wp-includes/class-wp-hook.php:289
WP_Hook::apply_filters()
wp-includes/class-wp-hook.php:311
WP_Hook::do_action()
wp-includes/plugin.php:544
do_action_ref_array()
wp-includes/plugin.php:660
do_action_deprecated()
wp-includes/ms-site.php:139
wp_insert_site()
wp-includes/ms-functions.php:1398
wpmu_create_blog()
wp-admin/network/site-new.php:140`

Add filter for "Please keep only one SEO plugin active..."

Is your feature request related to a problem? Please describe.
I would like to request a filter be added to change the plugins detected by the plugin watcher

We use Redirection and have no intention of switching off of it. We understand the risk and have disabled things appropriately. To be honest, I'm not sure if Redirection should be included in this list to begin with.

Describe the solution you'd like
Either Redirection removed or a filter added to customize the plugins checked/watched.

Describe alternatives you've considered
N/A

Additional context
N/A

Publish RankMath Pro on WP Packagist?

@surajv - (Please excuse me for double-posting. My previous comment was in a closed topic and I'm not sure it shows up)

I am using Composer wpackagist-plugin/seo-by-rank-math to install RM (Free) but am now looking at installing Pro: I cannot find Pro on wpackagist, is this correct?

Ideally I could install both with:

"require": {
  ...
  "wpackagist-plugin/seo-by-rank-math": "^1.0",
  "wpackagist-plugin/seo-by-rank-math-pro": "^2.0",
  ...
}

I understand one does not need a License key (but connect our sites) so it seems fine to publish the Pro version on Wpackagist...

Analytics 4 included

Have you already thinked the google analytics 4 integration. When Will it come out

Need help in modifying Ping Sitemap URL

TLDR: When the deployment is triggered by static HTML output plugin, ping URL to search engine

My WordPress exists at my computer http://localhost (uses Rankmath, static html output) for daily updating blog at https://www.example.com

I am aware that when we publish post or update, Rankmath ping to Google.

Is there any function that can help in Pinging production URL https://www.example.com from the localhost server after successful deployment from 'static HTML output plugin' plugin.

Related

Thanks

CMB2 Javasript files isn't not loaded due to Rank Math

Describe the bug
We use a theme that depends on CMB2 to add metaboxes to the post edit screen. After updating Rank Math to 1.0.50 the "Add new" button of the repeatable fields and groups stopped working.

The issue is caused by the analytics module of Rank Math which dequeues "cmb2-scripts" file on every page of WordPress dashboard.

The line that causes the issue is inside the constructor method of "RankMath\Analytics\Analytics" class:

$this->action( 'admin_footer', 'dequeue_cmb2' );

I think, a check has to be made inside the "dequeue_cmb2" method to correctly dequeue "cmb2-scripts" on the intended screen only.

Helper methods for retrieving SEO title and description

We want to add support for custom SEO title and description created in Rankmath to be shared by our plugin: https://wordpress.org/plugins/tweet-old-post/

I was able to do this is Yoast using this guide: https://developer.yoast.com/blog/yoast-seo-14-0-using-yoast-seo-surfaces/

$title = YoastSEO()->meta->for_post($post_id)->title;
$description = YoastSEO()->meta->for_post($post_id)->description;

I can see that you previously answered something similar here: https://wordpress.org/support/topic/get-title-description-and-canonical-url-programmatically/ But that seems to be for frontend posts and seems to return empty when used on save_post WordPress hook.

Are there any methods available to set the post ID so this can also work from admin and via cron? These methods must also replace the variables used by the user (such as %title% %sep%) with actual data. Obviously I can't just pull the set SEO title and description from the DB because they might contain variables in them.

404 Redirections to homepage use WP_SITEURL instead of WP_HOMEURL

Describe the bug
When enabling the Redirections feature and redirecting 404 pages to homepage, the site is redirected to WP_SITEURL instead of WP_HOMEURL. In cases where these 2 urls are different (for example if you're using the Bedrock framework), it causes an infinite redirect loop or just another 404 page. The same thing happens with the default value of Local SEO URL.

To Reproduce
Steps to reproduce the behavior:

  1. Enable Redirections from Rank Math dashboard (Advanced Mode)
  2. Go to Rank Math > General Settings > Redirections
  3. Set Fallback Behavior to Redirect to Homepage
  4. Visit a 404 page
  5. Instead of redirecting to the site home url, it redirects to the wp site url (in my case domain.com/wp)

Expected behavior
Use WordPress homeurl instead of siteurl

Additional context
The same issue happens in other settings. One other example is the Local SEO URL in Rank Math > Titles & Meta > Local SEO

Sitemap - Relative URLs (Invalid in Google Search Console)

Describe the bug

For some reason, the URLs in the sitemap are being generated without the domain included - this resulted in GSC reporting errors.

The domain is non English: https://xn--lck0a4d.guru/

Sitemap location: https://xn--lck0a4d.guru/sitemap_index.xml

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://xn--lck0a4d.guru/sitemap_index.xml
  2. Click on any of the sitemaps
  3. All URLs are relative

Expected behavior

The expected behavior is to have absolute URLs in the sitemap.

Error Log

I`m new RankMath Customer and actually there are a lot of issue in my Error Log.

One of this is:

2020/12/03 09:05:51 [error] 55610#55610: *423324 FastCGI sent in stderr: "PHP message: PHP Warning: sprintf(): Too few arguments in /www/techgarageblog_551/public/wp-content/plugins/seo-by-rank-math/includes/modules/seo-analysis/seo-analysis-tests.php on line 55" while reading response header from upstream, client: 66.249.64.72, server: techgarage.blog, request: "GET /wp-admin/admin-ajax.php?action=wl_navigator&uniqid=wl-navigator-widget-5fc8a85a6dcb9&post_id=101962&limit=4&offset=0&sort=ID%20DESC HTTP/1.0", upstream: "fastcgi://unix:/var/run/php7.4-fpm-techgarageblog.sock:", host: "techgarage.blog", referrer: "https://techgarage.blog/pixelmator-photo-die-bildbearbeitungs-app-fuer-das-ipad-kann-ab-sofort-vorbestellt-werden/?trk=organization-update-content_share-video-embed_share-article_title"

 
CleanShot 2020-12-03 at 10 10 09

I wrote already with the Team from the wl_navigator (Wordlift) and they mean the error is related to you.

The other issue is this:

The next one is this
2020/12/03 07:39:06 [error] 55613#55613: *420768 FastCGI sent in stderr: "PHP message: PHP Warning: Illegal string offset 'title' in /www/techgarageblog_551/public/wp-content/plugins/seo-by-rank-math-pro/includes/modules/schema/class-admin.php on line 399PHP message: PHP Warning: Illegal string offset 'id' in /www/techgarageblog_551/public/wp-content/plugins/seo-by-rank-math-pro/includes/modules/schema/class-admin.php on line 400PHP message: PHP Warning: Illegal string offset 'title' in /www/techgarageblog_551/public/wp-content/plugins/seo-by-rank-math-pro/includes/modules/schema/class-admin.php on line 399PHP message: PHP Warning: Illegal string offset 'id' in /www/techgarageblog_551/public/wp-content/plugins/seo-by-rank-math-pro/includes/modules/schema/class-admin.php on line 400" while reading response header from upstream, client: 2001:1620:6ed:0:1df6:da7d:220e:3564, server: techgarage.blog, request: "GET /wp-admin/post-new.php HTTP/1.0", upstream: "fastcgi://unix:/var/run/php7.4-fpm-techgarageblog.sock:", host: "techgarage.blog", referrer: "https://techgarage.blog/wp-admin/edit.php"

Rank Math SEO pushes Create by Mediavine header down by 6px

Hi there! I’m a developer for the Create by Mediavine plugin and our team has recently discovered a styling issue when using Create in conjunction with Rank Math SEO.

We've found that adding max-height: 20px to #wp-admin-bar-rank-math .rank-math-icon located at seo-by-rank-math/includes/admin/class-admin-menu.php:117 fixes the problem without causing styling issues for the icon.

Including a related PR that includes the styling addition above.

Thanks for your time!

—Jess

Describe the bug
The issue is the styling on the Rank Math SEO icon in the WordPress admin bar (see attached screenshot). The top: 6px positioning of the Rank Math SEO icon in the WP adminbar is causing Create's header to be pushed down by 6 pixels—you can see this in action on the All Create Cards screen, or any of the Recipe, How-To, or List edit screens.

To Reproduce
Steps to reproduce the behavior:

  1. Download and activate Create with Rank Math SEO already active
  2. Navigate to All Create Cards
  3. Observe the Create header
  4. Create header sits 6 pixel gap between the WordPress admin bar and the Create header

Expected behavior
The Create header should sit against the WordPress admin bar even if Rank Math SEO is active

Screenshots
Currently:
Screen Shot 2021-07-29 at 11 27 01 AM

With fix applied:
Screen Shot 2021-08-05 at 2 45 23 PM

Desktop (please complete the following information):

  • OS: MacOS 10.15.7

Browsers:

  • Chrome 92.0.4515.107
  • Safari 14.1.1
  • Firefox 90.0.2

Additional context
See PR #89

Fallback redirection to home or URL deactivates WordPress default redirection to Login and Dashboard

Describe the bug

By default, WordPress redirects the following requests when no post or page found for them:

  • "/login/" is redirected to "/wp-login.php"
  • "/admin/" is redirected to "/wp-admin/"
  • "/dashboard/" is redirected to "/wp-admin/"

This behaviour becomes inactive when Rank Math Fallback redirection set to "HomePage" or "Custom URL"

To Reproduce

  1. Make sure there is no page or post with the slug "login".
  2. Visit "/login/" URL --relative to the website URL you are testing on-- it should redirect to "/wp-login.php" and the same goes for the mentioned paths before.
  3. Go to Rank Math General Settings and click on "Redirections" Tab.
  4. Set "Fallback Behavior" to "Redirect to Homepage"
  5. Save Changes.
  6. Now, visit "/login/" URL again, it will redirect to Homepage not WordPress login page.

Expected behavior

The mentioned paths should follow the default redirection set to them if no page or post was found, even if the fallback behavior is set to "Redirect to Homepage or Custom URL".

Hidden WPML languages shown in sitemaps

Describe the bug
Posts of an hidden language are shown in the sitemap

To Reproduce
Steps to reproduce the behavior:

  1. Install WPML
  2. Hide a language
  3. Create a post with that language
  4. See sitemap

Expected behavior
Hidden languages shouldn't be shown in sitemaps

Additional context
Weirdly enough, translated terms seem to already be hidden.
I currently use this snippet to go around this issue

add_filter( 'rank_math/sitemap/entry', function( $url, $type, $object ){
	if ($type !== 'post') return $url;
	$post_lang = apply_filters( 'wpml_post_language_details', NULL, $object->ID )['language_code'];
	$hidden_langs = apply_filters( 'wpml_setting', array(), 'hidden_languages' );
	if (in_array( $post_lang, $hidden_langs, true ) || $post_lang == '') return false;
	return $url;
}, 10, 3 );

Rank math database error

For days Rank Math is out and there are some problems with it. There where not tables created so I have to create it manualy I think this is not the way but I need this to get rank math to work:

For wp_rank_math_analytics_gsc
https://pastebin.com/0VB1Tqaa
For wp_rank_math_analytics_objects
https://pastebin.com/5XwUjz1T
Before running any SQL code, we strongly suggest creating a complete backup of the database. Please create a backup even if you choose to share the access details instead, as we may run the same code, and there's always some risk involved when executing direct queries like this.
Hope that helps.

but the first one gave me this error
#1709 – Index column size too large. The maximum column size is 767 bytes.

The issue when I start Site Wide Analysis this error comes up in de error log of my direct admin

And this is the error I got from Start Site Analysis:
[Wed Nov 18 12:19:46.865866 2020] [proxy_fcgi:error] [pid 15805:tid 139895523604224] [client (ip):55709] AH01071: Got error 'PHP message: WordPress databasefout You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'traffic AS (\n\t\t\t SELECT t1.page as page, COALESCE( t1.pageviews, 0 ) as pagev' at line 1 bij query WITH traffic AS (\n\t\t\t SELECT t1.page as page, COALESCE( t1.pageviews, 0 ) as pageviews, COALESCE( t1.pageviews - t2.pageviews, 0 ) as difference\n\t\t\t\tFROM\n\t\t\t \t( SELECT page, SUM(pageviews) as pageviews FROM wp_rank_math_analytics_ga WHERE 1=1 AND created BETWEEN '2020-08-10 00:00:01' AND '2020-11-15 23:59:59' GROUP BY page ) as t1\n\t\t\t\tLEFT JOIN\n\t\t\t \t( SELECT page, SUM(pageviews) as pageviews FROM wp_rank_math_analytics_ga WHERE 1=1 AND created BETWEEN '2020-05-04 00:00:01' AND '2020-08-09 23:59:59' GROUP BY page ) as t2\n\t\t\t\tON t1.page = t2.page\n\t\t\t)\n\t\t\tSELECT SQL_CALC_FOUND_ROWS o.*, COALESCE( t.pageviews, 0 ) as pageviews, COALESCE( t.difference, 0 ) as difference\n\t\t\tFROM wp_rank_math_analytics_objects as o\n\t\t\tLEFT JOIN...', referer: https://mydomain.com/wp-admin/admin.php?page=rank-math-analytics

Can somebody help me?

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.