Problem/Motivation

The Simple XML Sitemap setting form lists the status for all XML sitemap variants. This information is useful to display on the Status report, since it can indicate a problem with sitemap generation that requires action by a site administrator.

Proposed resolution

Display the status for XML sitemaps on the Status report page.

Remaining tasks

  1. Write a patch
  2. Review
  3. Submit

User interface changes

The status for XML sitemaps is displayed on the Status report page.

API changes

None.

Data model changes

None.

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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

idebr created an issue. See original summary.

idebr’s picture

Attached patch displays the status for XML sitemaps on the Status report page.

Status report checked:

Status report error:

anneke_vde’s picture

Status: Needs review » Reviewed & tested by the community

I tested the patch, the status report page now displays te status of the configured XML sitemaps.

kleiton_rodrigues’s picture

FileSize
15.79 KB

Patch successfully applied and Displayed the status for XML sitemaps on the Status report page.
RTBC + 1

DamienMcKenna’s picture

I was just saying to a coworker "it'd be really great if Simple Sitemap had a report on the status page..", this would be a good start.

gbyte’s picture

Category: Task » Feature request
Status: Reviewed & tested by the community » Needs review

Thanks for the patch. A couple of things:

  • If we want a status page showing similar info to what the table at admin/config/search/simplesitemap does, we should use the same methods for getting the results including the newly added link count for each variant.
  • The code is long and not too readable and should be split into several methods (again, probably the same (static?) methods used by the admin/config/search/simplesitemap page).
  • I don't know how I feel about the inclusion of cron_error_threshold and cron_warning_threshold. I think we should warn about empty sitemaps or no sitemap set. I'd need some more convincing regarding the former two.
  • If possible, all SQL queries should be replaced by the use of the module's API, that will increase maintainability of the code.
gbyte’s picture

Status: Needs review » Needs work

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

dpi’s picture

Assigned: Unassigned » dpi
Status: Needs work » Active

Working on something generalised to support this issue and #3215975: Add a Simple Sitemap plugin for Monitoring

dpi’s picture

Not sure if I'll have time to pick this up again, but this works, and passes tests.

  • New service for dealing with sitemap table
  • Domain object for each variant.
  • Needs more test coverage, particularly for new APIs
  • Constants for sitemap status
  • Status page display reworked. See screenshots below
  • Major clean up of SimplesitemapSitemapsForm, utilizing new service/domain object

Screens

1.

screenshot

2.

screenshot

Other notes

  • Its not clear what the minimum version of PHP and Drupal 8 this project requires. I'd like to see something concrete added, especially as new syntax makes DX significantly nicer.
  • Future (not this issue): I'd like to see \Drupal\simple_sitemap\Controller\SimplesitemapController::getSitemap use the new service, and for \Drupal\simple_sitemap\Simplesitemap::getSitemap and \Drupal\simple_sitemap\Simplesitemap::fetchSitemapVariantInfo to be deprecated in the future.
dpi’s picture

Assigned: dpi » Unassigned
Status: Active » Needs review
dpi’s picture

People following this issue may also be interested in integration with Monitoring at #3215975: Add a Simple Sitemap plugin for Monitoring , which uses the common parts introduced with the MR above.

gbyte’s picture

Version: 8.x-3.x-dev » 4.x-dev
Status: Needs review » Needs work

Can we make it work with 4.x? :)

dpi’s picture

Status: Needs work » Needs review

@gbyte can you provide a review? I don’t think it’s reasonable to ask for a major version rebase yet, considering there could be fundamental changes required or a wholesale rejection. Especially when the work has been Needs review for over a year.

Please feel free to provide notes and pointers for reworks in 4.x