Code Monkey home page Code Monkey logo

craft3-plugin-sitemap's People

Contributors

biggleszx avatar dolphiq-allard avatar johanzandstra avatar martijn-dolphiq avatar mrnebbi avatar nikolowry avatar robinvdvleuten avatar tam avatar willverse 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

Watchers

 avatar  avatar  avatar  avatar  avatar

craft3-plugin-sitemap's Issues

Craft 4 Support

Currently, this plugin does not support Craft 4. Is an update with Craft 4 support planned or should we start looking for a replacement?

An enabled channel gets disabled whenever code is re-deployed.

Hi, I'm encountering the following issue on admin/settings/sitemap:

  1. 'Single pages' was created.
  2. Went to admin/settings/sitemap and enabled the 'Single pages' channel.
  3. Config was save, everything looks fine.
  4. After a week, new fixes were deployed in the site.
  5. Visited admin/settings/sitemap, 'Single pages' were disabled.
  6. We've enabled it again, Config was save, everything looks fine.
  7. After a week, new fixes were deployed in the site.

Screen Shot 2023-12-05 at 3 08 25 PM

Old enable channels are still active, 'Single pages' channel is the only one that keeps reverting back to its disabled state.

I am are using version 1.3.2.

Screen Shot 2023-12-05 at 3 08 00 PM

Please advise on what actions to take. Thank you!

Generated sitemaps are invalid, loc tags needs to be absolute

Per https://www.sitemaps.org/protocol.html, the loc tag definition is as followed:

URL of the page. This URL must begin with the protocol (such as http) and end with a trailing slash, if your web server requires it. This value must be less than 2,048 characters.

However, the plugin is generating relative loc values, which results in errors in Google's Search Console:
img-2018-01-12-183654


A little off-topic, but would you happen to know why /sitemap.xml returns a 404 status on a NGINX/PHP-FPM stack even though it renders the XML? The only way I could submit a site map to Google's Search Console was by using /?p=actions/sitemap/sitemap/index
img-2018-01-12-184153

DB exception thrown

I cannot see the sitemap.xml on the site or access the settings.
How can I rectify this error?

Context

  • Craft version 3.6.12
  • XML sitemap version 1.3.2

Error thrown

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'hrjlaws.craft_dolphiq_sitemap_entries' doesn't exist
The SQL being executed was: SELECT `sections`.`id`, `sections`.`structureId`, `sections`.`name`, `sections`.`handle`, `sections`.`type`, count(DISTINCT entries.id) AS `entryCount`, count(DISTINCT elements.id) AS `elementCount`, `sitemap_entries`.`id` AS `sitemapEntryId`, `sitemap_entries`.`changefreq` AS `changefreq`, `sitemap_entries`.`priority` AS `priority`
FROM `craft_sections` `sections`
LEFT JOIN `craft_structures` `structures` ON `structures`.`id` = `sections`.`structureId`
INNER JOIN `craft_sections_sites` `sections_sites` ON `sections_sites`.`sectionId` = `sections`.`id` AND `sections_sites`.`hasUrls` = 1
LEFT JOIN `craft_entries` `entries` ON `sections`.`id` = `entries`.`sectionId`
LEFT JOIN `craft_elements` `elements` ON `entries`.`id` = `elements`.`id` AND `elements`.`enabled` = 1
LEFT JOIN `craft_dolphiq_sitemap_entries` `sitemap_entries` ON `sections`.`id` = `sitemap_entries`.`linkId` AND `sitemap_entries`.`type` = "section"
WHERE `sections`.`dateDeleted` IS NULL
GROUP BY `sections`.`id`
ORDER BY `type`
Error Info: Array
(
    [0] => 42S02
    [1] => 1146
    [2] => Table 'hrjlaws.craft_dolphiq_sitemap_entries' doesn't exist
)
↵
Caused by: PDOException
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'hrjlaws.craft_dolphiq_sitemap_entries' doesn't exist
in /media/dorothy/Data/websites/fl/deploy/vendor/yiisoft/yii2/db/Command.php at line 1299

[FR] Custom URLs

It would be nice to be able to both add custom static URLs to the sitemap (similar to how seo has it, just a table field.) as well as an event we can hook into that our own plugins can register URLs to for more dynamic rules, similar to how seomatic handles that.

Cheers

Cannot access the plugins Settings

I'm unable to navigate to the settings page for this plugin and therefore cannot manage the plugin at all. I'm on Craft Pro 3.5.7. When I go to the settings page, I get the following PHP error:

SQLSTATE[42883]: Undefined function: 7 ERROR: operator does not exist: boolean = integer
LINE 4: ...tionId" = "sections"."id" AND "sections_sites"."hasUrls" = 1
^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
The SQL being executed was: SELECT "sections"."id", "sections"."structureId", "sections"."name", "sections"."handle", "sections"."type", count(DISTINCT entries.id) AS "entryCount", count(DISTINCT elements.id) AS "elementCount", "sitemap_entries"."id" AS "sitemapEntryId", "sitemap_entries"."changefreq" AS "changefreq", "sitemap_entries"."priority" AS "priority"
FROM "sections" "sections"
LEFT JOIN "structures" "structures" ON "structures"."id" = "sections"."structureId"
INNER JOIN "sections_sites" "sections_sites" ON "sections_sites"."sectionId" = "sections"."id" AND "sections_sites"."hasUrls" = 1
LEFT JOIN "entries" "entries" ON "sections"."id" = "entries"."sectionId"
LEFT JOIN "elements" "elements" ON "entries"."id" = "elements"."id" AND "elements"."enabled" = 1
LEFT JOIN "dolphiq_sitemap_entries" "sitemap_entries" ON "sections"."id" = "sitemap_entries"."linkId" AND "sitemap_entries"."type" = "section"
WHERE "sections"."dateDeleted" IS NULL
GROUP BY "sections"."id"
ORDER BY "type"
Error Info: Array
(
[0] => 42883
[1] => 7
[2] => ERROR: operator does not exist: boolean = integer
LINE 4: ...tionId" = "sections"."id" AND "sections_sites"."hasUrls" = 1
^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
)

Caused by: PDOException

SQLSTATE[42883]: Undefined function: 7 ERROR: operator does not exist: boolean = integer
LINE 4: ...tionId" = "sections"."id" AND "sections_sites"."hasUrls" = 1
^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.

in /home/ubuntu/craft/vendor/yiisoft/yii2/db/Command.php at line 1293

Fix Composer 2 compatibility

When installing this plugin with Composer 1, the following deprecation notice is output:

Deprecation Notice: Class dolphiq\sitemap\assetbundles\Sitemap\SitemapAsset located in ./vendor/dolphiq/sitemap/src/assetbundles/sitemap/SitemapAsset.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0.

Composer 2 was released on October 24, and is now the default version that will be installed, so it’s critical that this gets resolved ASAP, or people will start getting Class not found errors.

To fix, run the following command:

> git mv src/assetbundles/sitemap src/assetbundles/Sitemap

Then commit your change and tag a new release.

(Note that you must use the git mv command, as Git tends to not notice case-sensitive file renames otherwise.)

Plugin settings page in the backend throws database exception

Hi, I installed this plugin using composer on my Craft CMS 3.0.3.1, when heading to mysite.com/admin/settings/sitemap I'm presented with a database exception seen in the image attached below:
screen shot 2018-04-18 at 11 39 46 pm
Would you please verify if It's an issue with my craft installation?

Error when enable categories

When I try to enable categories, this exception appears on save:

Argument 2 passed to craft\helpers\Db::idByUid() must be of the type string, null given, called in /Users/elfacht/htdocs/spillout/app/vendor/dolphiq/sitemap/src/services/SitemapService.php on line 127

Categories then remain disabled.

Craft 3.3.14
Plugin version: 1.2.0

Sitemap error

When visiting www.mysite.com/sitemap.xml, I receive the following error:

This page contains the following errors:
error on line 3 at column 6: XML declaration allowed only at the start of the document
Below is a rendering of the page up to the first error.

So there are 2 whitespaces/lines before the sitemap is shown...
screen shot 2018-10-26 at 14 06 56

Any idea on how to fix this?

Craft 3.2 compatibility issues

Currently this plugin does not work anymore in a Craft 3.2 installation because of the added soft deletes and new drafting and versioning feature in Craft.

The custom built SQL queries would need to have added where checks for the element joins.
But besides that, it seems this plugin is not maintained anymore.

I just want this to stand here for others to see. :)

404 when accessing sitemap.xml

Hi,

I installed the plugin following the steps in the readme and have activated it in the CP. I have configured the sitemap by adding some structures and saved my changes.

However, I get a 404 when trying to visit "URL/sitemap.xml".

I am developing locally if that could affect anything.

Is anyone else having this issue?

plugin ignores noindex

it would be great if the plugin checks if there's a noindex in the meta-tags and doesn't put the concerned sites into the sitemap. alternative: a possibility to add certain urls in the plugin that should never show up in the sitemap.

Question

I have installed and configured your plugin. But I am getting a 404 when I try to access the sitemap. Is there something I need to point in routes? I think I might be missing a step.

[Feature Request] Allow entry type / level selection for channels

For structures, not every level of the structure is something we want to show in our sitemap. It would be great to have a secondary dropdown in the UI that allows the user to select which entry types and levels of a structure should be included in the sitemap.

Also, it would be nice to have some query event hooks for more advanced tweaks.

Invalid site ID: 2

We have disabled "Enable on the front end" for a site, because it is not live whilst waiting for the translations. It is site ID 2.

But the xml sitemap plugin is still trying to generate a sitemap for it, and as such, returns an error due to the UrlHelper::siteUrl in your plugin returning an invalid site id.

I assume your code is not checking if a site is enabled on front end or not.

Is it possible this can be fixed, because we are unable to generate a sitemap now, not until we enable the other site.

Thanks

Future post dates not honored

Hi, thanks for a great plugin - it's the first thing I install on my sites.

One thing I noticed on my most recent venture is that posts that appear in the future appear in the sitemap.

I have set up and scheduled several posts to go live over the next few weeks by using the post date and they all appear in the sitemap.

Thanks again

Postgres compatibility?

When trying to access the plugins settings via the settings page, I get the following error:

LINE 4: ...tionId" = "sections"."id" AND "sections_sites"."hasUrls" = 1
^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
The SQL being executed was: SELECT "sections"."id", "sections"."structureId", "sections"."name", "sections"."handle", "sections"."type", count(DISTINCT entries.id) entryCount, count(DISTINCT elements.id) elementCount, "sitemap_entries"."id" AS "sitemapEntryId", "sitemap_entries"."changefreq" AS "changefreq", "sitemap_entries"."priority" AS "priority"
FROM "sections" "sections"
LEFT JOIN "structures" "structures" ON "structures"."id" = "sections"."structureId"
INNER JOIN "sections_sites" "sections_sites" ON "sections_sites"."sectionId" = "sections"."id" AND "sections_sites"."hasUrls" = 1
LEFT JOIN "entries" "entries" ON "sections"."id" = "entries"."sectionId"
LEFT JOIN "elements" "elements" ON "entries"."id" = "elements"."id" AND "elements"."enabled" = 1
LEFT JOIN "dolphiq_sitemap_entries" "sitemap_entries" ON "sections"."id" = "sitemap_entries"."linkId" AND "sitemap_entries"."type" = "section"
GROUP BY "sections"."id"
ORDER BY "type"
Error Info: Array
(
    [0] => 42883
    [1] => 7
    [2] => ERROR:  operator does not exist: boolean = integer
LINE 4: ...tionId" = "sections"."id" AND "sections_sites"."hasUrls" = 1
                                                                    ^
HINT:  No operator matches the given name and argument type(s). You might need to add explicit type casts.```

I believe that 1 for `true` would work in mysql, but it breaks in postgres:9.6.5

Plugin displays deleted sections

The Sitemap settings page displays sections that have been deleted. I'm guessing it should be excluding sections where dateDeleted is not NULL in the database.

Mulltilingual sites support?

Hi,

is there an idea how to support multilingual sites?

For example google suggest to treat them within the sitemap.xml like so per site (for example en as default and de as second language):

<url>
    <loc>http://www.example.com/english/</loc>
    <xhtml:link 
                 rel="alternate"
                 hreflang="de"
                 href="http://www.example.com/deutsch/"
                 />
</url>

Right now the plugin will generate it like so:

<url>
    <loc>http://www.example.com/english/</loc>
</url>
<url>
    <loc>http://www.example.com/deutsch/</loc>
</url>

Is there any support for multilingual setups planned or possible right now?

Draft URLs in sitemap

On my website, draft URL appeared in sitemap:

http://craftsnippets.com/articles/__temp_R4uxHKjiiLvmWgyYyIoTpw5G1idlFLCJgv71

Sitemap appears empty

All that is outputted is:

<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"></sitemapindex>

screen shot 2018-04-16 at 15 40 24

Craft v3.0.2
Sitemap v 1.0.9

Usable?

Hi!
I understand this is still a work in progress, but is it usable? If not, can I help?
Fixing a sitemap for our craft3 site is on my todo... Thnx!

Make multi-site compatible

The current implementation is not multi-site compatible.

You are using $app->config->general->siteUrl, which in a multisite, can be an array.

Ideally, I think you'd want to structure things so you're actually dealing with craft\elements\Element, so you can just use craft\base\Element::getUrl(). That you don't have to monkey around with building the url yourself, making exceptions for __home__, among other things.

If not that, it would at least be better to use craft\helpers\UrlHelper::url($item['uri']), rather than getting the raw config var, so this would work for multi-sites.

Settings issue

Is there any plan to make this compatible with project.yaml config files to hold the setttings?

On sites where allowAdminChanges is false there is no way to update the settings without manually editing the database at the moment as the project.yaml doesn't update with changes and the site where changes are disallowed shows an error on save attempt.

Updating a category can yield an invalid project config which errors when running a migration

Hey, just found that if I update a category, removing an existing uriFormat, the project config files will update as follows:

+++ b/craft/config/project/categoryGroups/sectors--fdd1be2c-d545-4af2-9d6a-3a1bb2082e31.yaml
@@ -291,9 +291,9 @@ handle: sectors
 name: Sectors
 siteSettings:
   146e7a6b-f0ca-4f39-ba5d-d9eb009fc426: # UDL (en-GB)
-    hasUrls: true
-    template: sectors/_category
-    uriFormat: '{% if object.level == 1 %}sectors/{slug}{% else %}{parent.uri}/{slug}{% endif %}'
+    hasUrls: false
+    template: null
+    uriFormat: null
 structure:
   maxLevels: null
   uid: 0cc96d4e-d9ac-4f49-bc9d-db9e145926de
diff --git a/craft/config/project/dolphiq_sitemap_entries/1d8dd907-afd2-411d-a45b-3e213f5ff8fe.yaml b/craft/config/project/dolphiq_sitemap_entries/1d8dd907-afd2-411d-a45b-3e213f5ff8fe.yaml
index b8d2cce2..13a98673 100644
--- a/craft/config/project/dolphiq_sitemap_entries/1d8dd907-afd2-411d-a45b-3e213f5ff8fe.yaml
+++ b/craft/config/project/dolphiq_sitemap_entries/1d8dd907-afd2-411d-a45b-3e213f5ff8fe.yaml
@@ -1,4 +1,4 @@
 changefreq: weekly
-linkId: fdd1be2c-d545-4af2-9d6a-3a1bb2082e31 # Sectors
+linkId: null
 priority: 0.5
 type: category
diff --git a/craft/config/project/dolphiq_sitemap_entries/6d47467d-1bd2-4ea1-ae48-e17d430cce42.yaml b/craft/config/project/dolphiq_sitemap_entries/6d47467d-1bd2-4ea1-ae48-e17d430cce42.yaml
index 8256fc35..30ccf941 100644
--- a/craft/config/project/dolphiq_sitemap_entries/6d47467d-1bd2-4ea1-ae48-e17d430cce42.yaml
+++ b/craft/config/project/dolphiq_sitemap_entries/6d47467d-1bd2-4ea1-ae48-e17d430cce42.yaml
@@ -1,4 +1,4 @@
 changefreq: weekly
-linkId: c22c47f9-3b49-43b0-906d-a7ae8fcf36ba # International
+linkId: cbcce34a-495a-4916-8335-8d4a3217d194
 priority: 0.5
 type: category
diff --git a/craft/config/project/dolphiq_sitemap_entries/d2bdad24-5ed1-4d5f-88cd-7cb42f7bbfbe.yaml b/craft/config/project/dolphiq_sitemap_entries/d2bdad24-5ed1-4d5f-88cd-7cb42f7bbfbe.yaml
index 22433214..13a98673 100644
--- a/craft/config/project/dolphiq_sitemap_entries/d2bdad24-5ed1-4d5f-88cd-7cb42f7bbfbe.yaml
+++ b/craft/config/project/dolphiq_sitemap_entries/d2bdad24-5ed1-4d5f-88cd-7cb42f7bbfbe.yaml
@@ -1,4 +1,4 @@
 changefreq: weekly
-linkId: 9ca9c766-0fe7-406a-aa76-ef312b1cb6c3 # Services
+linkId: null
 priority: 0.5

This unfortunately will throw an error on running a migration:

- adding dolphiq_sitemap_entries.6d47467d-1bd2-4ea1-ae48-e17d430cce42 ...
error: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'linkId' cannot be null
The SQL being executed was: INSERT INTO `craft_dolphiq_sitemap_entries` (`uid`, `linkId`, `type`, `priority`, `changefreq`, `dateCreated`, `dateUpdated`) VALUES ('6d47467d-1bd2-4ea1-ae48-e17d430cce42', NULL, 'category', 0.5, 'weekly', '2021-07-06 15:22:22', '2021-07-06 15:22:22')

I am able to rectify the issue by going into: admin/settings/sitemap and resaving the sitemap settings

Settings page redirecting to a 404 Template

When looking at the settings I am being redirected from
/admin/settings/plugins/sitemap to /admin/settings/sitemap which is not available.

image

I am assuming this is something in my setup but I honestly can't think what?!? Any chance you could shed any light on this.

Apologies if this is not the correct way to reach out to you.

Sitemap showing deleted entries

I have vacancy entries that are only live for so many weeks, but even when removed they are still showing in the sitemap and causing crawl errors with Google Search Console.

Is there a way to reset the sitemap XML when this happens? I already have the change frequency set to daily

Thank you!

PSR-4 autoloading warning upon installation

When I installed this today from the command line, I received the following notice:

Deprecation Notice: Class dolphiq\sitemap\assetbundles\Sitemap\SitemapAsset located in ./vendor/dolphiq/sitemap/src/assetbundles/sitemap/SitemapAsset.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201

It doesn't stop it from working immediately.

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.