Bing just stopped accepting requests to bing.com/ping?sitemap=[sitemap], so search engine integration now only works for google. We should look into implementing IndexNow, which Bing apparently will now be working with. Apparently there is not official documentation on that, but they now throw a 410 error when using the usual method, which is pretty indicative of their intentions. See this unofficial post.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

gbyte created an issue. See original summary.

gbyte’s picture

Issue summary: View changes
noda’s picture

Hi. I wrote the referenced “unofficial post” about the Bing deprecation, and advocated for the adoption of IndexNow. I’d just like to add one comment regarding implementing the IndexNow in Drupal.

Please don’t hardcode a search engine to use with IndexNow. As stated on the IndexNow website, if you submit to URLs to one IndexNow-compatible search engines then that search engine will immediate forward it to other IndexNow-compatible search engines. So, Drupal can help maintain competition in the search engine market by not favoring any one search engine over another. If everyone submit their URLs to just Yandex or Bing it can skew the market, which is easily solved by picking a random provider from a list. E.g.

 $indexnow_endpoints = [
  'www.bing.com/indexnow',
  'yandex.com/indexnow',
  // 'www.google.com/indexnow' and others in the future
];

array_rand ( $indexnow_endpoints ); 

Ideally and to also future-proof things a bit, failed submission requests can be reattempted using a different entry from the list.

Oh, another implementation note that I jut ran into: Yandex’s API returns HTTP 202 Accepted instead of HTTP 200 OK as stated in its documentation.

gbyte’s picture

Hey @noda, thanks for your concerns. I just started working on integrating indexNow into simple_sitemap and in true Drupal fashion, we will be avoiding any hardcoding. Instead, we will be providing existing engines as configuration and a way to add new engines by the user. We will be also adding new engines for new module installations ourselves as soon as they start participating. I intend to add functionality where the user can choose the engine to submit to, but your idea to use randomness could be a good fallback!

Thanks for the illuminating blog post.

gbyte’s picture

Assigned: Unassigned » gbyte
gbyte’s picture

Assigned: gbyte » walkingdexter
Status: Active » Needs work

Hey, I need a second pair of eyes and hands on the indexNow functionality I implemented. Would you mind taking a look?

Aside from code and functionality checks, would you have time to add some JS to simple_sitemap_engines.fieldsetSummaries.js, so the Simple XML Sitemap tabs show the summary of indexNow in addition to the variant info?

Also I know it's a big ask, but in case you find the time (and motivation), we need test coverage for the engines module.

Note for the future me:
Apart from that we need a summary of settings set on the EntitiesForm and we need a status page showing the IndexNow compatible engines similar to the one showing regular engines (Drupal\simple_sitemap_engines\Controller\SearchEngineListBuilder).

WalkingDexter made their first commit to this issue’s fork.

walkingdexter’s picture

Assigned: walkingdexter » gbyte
Status: Needs work » Needs review

Hi @gbyte, I added two commits to the issue fork, please review. Changes include code cleanup and handling of summary of IndexNow setting.

Also pay attention to the following points:

  1. Perhaps a separate entity for IndexNow is redundant. Maybe it would be better to implement new functionality inside the simple_sitemap_engine entity?
  2. I don't fully understand why the IndexNow key can be stored in both config and state. Can we choose only one location?
  3. "indexNow" should be changed to "IndexNow" in all descriptions to avoid confusion.
gbyte’s picture

@WalkingDexter Thanks!

Perhaps a separate entity for IndexNow is redundant. Maybe it would be better to implement new functionality inside the simple_sitemap_engine entity?

I originally decided against it because of the confusion when loading specific entities for specific functionality. But you are right, there might be an engine supporting both (pinging and IndexNow) in which case we would have some redundancy. I changed it to a single entity type with two different fields and a couple of convenience methods.

I don't fully understand why the IndexNow key can be stored in both config and state. Can we choose only one location?

The key can't go into vcs and the best way to store it is in production's settings file. But for the sake of accessibility, we need a facility to generate the key, so why not make the module instantly usable after generation. A power user can still change the key's storage by adding it to the settings.php file.

"indexNow" should be changed to "IndexNow" in all descriptions to avoid confusion.

Agreed and changed.

I'm going to merge this tomorrow, feel free to review whenever.

walkingdexter’s picture

@gbyte Just a note for code simplicity :)

->condition('index_now_url', NULL, 'IS NOT NULL')

can be replaced by

->exists('index_now_url')

  • gbyte committed 4e5777f on 4.x
    Issue #3256453 by gbyte, WalkingDexter, noda: Add IndexNow capability to...
gbyte’s picture

Assigned: gbyte » walkingdexter
Status: Needs review » Fixed

@WalkingDexter

Would creating 4.1.0 add a new release next to 4.0.1 on the release page? If so, I would prefer to create 4.0.2 after some testing of dev.

devad’s picture

If the backwards compatibility is preserved and there are no changes related to core_version_requirement - the best is to go with 4.0.2. imho.

For example... when you drop the D8 support then 4.1.0 release makes sense.

gbyte’s picture

@devad

AFAIK compatibility/API breakage is indicated by the first number '4'. The 1 indicates arbitrary big changes in functionality. Also I wouldn't signify dropping D8 support with a release, as it is not supported anymore anyway.

The question remains how drupal.org lists 4.1.x on the release page in relation to 4.0.x

devad’s picture

The question remains how drupal.org lists 4.1.x on the release page in relation to 4.0.x

Disclaimer: I have a little maintainer's experience.... so I might be wrong. :)

In our case we have the the 4.x branch. And both 4.0.1 and 4.1.0 releases are releases of the same 4.x branch. So, I expect the 4.1.0 to replace 4.0.1 at the project page automatically. The similar example for this is the Admin Toolbar module.

If we would have 4.0.x and 4.1.x branches created separately... then both these branches and their releases would be displayed at the project page one above the other. The example for this is the Webform module.

walkingdexter’s picture

I agree with @devad. Releases are related to branches, so the new release should replace the current one.

https://www.drupal.org/node/1015226
https://semver.org

Based on the documentation, the release should be version 4.1.0.

Given a version number MAJOR.MINOR.PATCH, increment the:

MAJOR version when you make incompatible API changes,
MINOR version when you add functionality in a backwards compatible manner, and
PATCH version when you make backwards compatible bug fixes.

gbyte’s picture

Assigned: walkingdexter » Unassigned

I agree with @devad.

@WalkingDexter You agree with me. That's what I wanted to do, just wanted to know how drupal.org would display the new release.

Thanks guys, make sure to test dev thoroughly.

walkingdexter’s picture

@gbyte I think tests can be implemented within this issue #3105922: Fix tests for simple_sitemap_engines

gbyte’s picture

@WalkingDexter Yep, feel free to grab it anytime. ;)

gbyte’s picture

@devad

In our case we have the the 4.x branch. And both 4.0.1 and 4.1.0 releases are releases of the same 4.x branch. So, I expect the 4.1.0 to replace 4.0.1 at the project page automatically. The similar example for this is the Admin Toolbar module.

Well apparently that's not the case - minor releases create new entries on the project page. Only marking the previous release as unsupported hides it.

devad’s picture

Well apparently that's not the case - minor releases create new entries on the project page. Only marking the previous release as unsupported hides it.

Thanks for the reply. It's good to know. It gives more flexibility to maintainers to hide or show the previous minor release which is good.

glardup’s picture

Thank you so much for implementing this so quickly!

I'm not sure I understand the procedure though. Is this how it's done?:
1. generate tag (through bing or throug the ui of the module)
2. ideally add the tag to settings.php
3. add a file called .txt containing the tag to the root folder (web) -> this one is unclear

Is the last step necessary? Does the file really have to go in the web folder, and not in the private one or so? If so, it would perhaps be a good idea to add this to the explanation in the message on the UI?

gbyte’s picture

@GlarDup You are very welcome.

add a file called .txt containing the tag to the root folder (web) -> this one is unclear

No need to add any files - a dynamic route is added as soon as a verification key is generated (or optionally added to settings.php). Basically if there are no warnings on the status page or on the module settings page, you are good. I'll see about adding even more instructions soon, but feel free to contribute documentation to the module.

glardup’s picture

Oh, even better! It seemed too easy to be true.
In that case perhaps a simple 'you're all set!' after the instructions would already suffice :-)
Thanks!

gbyte’s picture

Oh, even better! It seemed too easy to be true.

It's supposed to be "simple" sitemap after all.

In that case perhaps a simple 'you're all set!' after the instructions would already suffice :-)

Which instructions are you referring to though?

glardup’s picture

It's supposed to be "simple" sitemap after all.

Mission accomplished I'd say. :-)

Which instructions are you referring to though?

The system message you get when generating a key. The one saying the key is now saved in Drupal State, but you should consider saving it in settings.php.

gbyte’s picture

For more info see the blog post about this feature.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.