Skip to content
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.

Missing information in generated index sitemap #3

Closed
oseg opened this issue Jul 25, 2017 · 5 comments
Closed

Missing information in generated index sitemap #3

oseg opened this issue Jul 25, 2017 · 5 comments

Comments

@oseg
Copy link
Contributor

oseg commented Jul 25, 2017

Title: Missing information in generated index sitemap

Context:

  • Clean install of elgg v2.3.3 at location: localhost/elgg-2.3.3/
  • Install of hypeseo plugin v1.0.2 from released package
  • In hypeseo settings, "enable inline rewrites" set to "No" and "Enable redirects" set to "No"

Scenario:

  • Go in admin seo sitemap page (localhost/elgg-2.3.3/admin/seo/sitemap), add click on "Generate sitemap" button
  • Have a look at the generated sitemap index: localhost/elgg-2.3.3/sitemap.xml
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <sitemap>
    <lastmod>2017-07-25</lastmod>
  </sitemap>
  <sitemap>
    <lastmod>2017-07-25</lastmod>
  </sitemap>
  <sitemap>
    <lastmod>2017-07-25</lastmod>
  </sitemap>
</sitemapindex>

I had a quick look in the hypeo/view/default/seo/sitemap/sitemapindex.php view, and I think there is a small bug at line 14
$tags = elgg_format_element($tag, [], htmlentities($value, ENT_QUOTES, 'UTF-8')) . PHP_EOL;
Suggested fix:
$tags .= elgg_format_element($tag, [], htmlentities($value, ENT_QUOTES, 'UTF-8')) . PHP_EOL;

With the above sugested fix, the new generated sitemap index looks better:

<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <sitemap>
    <loc>
      http://localhost/elgg-2.3.3/seo/sitemaps/static.xml
    </loc>
    <lastmod>2017-07-25</lastmod>
  </sitemap>
  <sitemap>
    <loc>
      http://localhost/elgg-2.3.3/seo/sitemaps/group1.xml
    </loc>
    <lastmod>2017-07-25</lastmod>
  </sitemap>
  <sitemap>
    <loc>http://localhost/elgg-2.3.3/seo/sitemaps/user1.xml</loc>
    <lastmod>2017-07-25</lastmod>
  </sitemap>
</sitemapindex>

What do you think?

@hypeJunction
Copy link
Owner

Indeed, should be extending the string and not replacing it. Can you make a pull request?

oseg added a commit to oseg/hypeSeo that referenced this issue Jul 25, 2017
@oseg
Copy link
Contributor Author

oseg commented Jul 25, 2017

Pull request done

@hypeJunction
Copy link
Owner

Thanks

@oseg
Copy link
Contributor Author

oseg commented Jul 25, 2017

You're welcome and thank you for sharing this plugin with the community. I am looking for a good seo plugin for elgg and this one looks very promising.

@hypeJunction
Copy link
Owner

Feel free to provide feedback or adopt it. I don't have much time for it

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants