Any idea why the ezpages xml file includes links only for the default language? Categories and Products xml files are OK, include links for all languages.
Printable View
Any idea why the ezpages xml file includes links only for the default language? Categories and Products xml files are OK, include links for all languages.
Good catch... don't use it myself, but it looks like it needs updating. Still based on ZC1.3.9 code for ezpages... has a typo think TABLE_EZPAGES_TEXT can't find that table anywhere... plus the old code has a sniffer that's not working with php7.4 Well have to look more at mine..
Just remove the quotes of TABLE_EZPAGES_TEXT on line 25 of \includes\modules\pages\sitemapxml\sitemapxml_ezpages.php -change toCode:if ($sitemapXML->dbTableExist('TABLE_EZPAGES_TEXT')) {
Code:if ($sitemapXML->dbTableExist(TABLE_EZPAGES_TEXT)) {
It's a bit more complicated.. TABLE_EZPAGES_TEXT is not defined anywhere and still would fail. If you are using PHP lower then 7.3, you would not get a warning for the undefined.. replacing it with 'TABLE_EZPAGES_CONTENT' would get you closer to the fix, but there are also errors in the sql. I pushed the updated template for v4 up to Github but don't have a multilingual site to test it on. It does create the expected links. What version of ZC and PHP was the error on?
I use ZC 1.5.7 and PHP 7.4. And I found the definition of TABLE_EZPAGES_TEXT in \includes\extra_datafiles\ezpages_multilanguage_database_names.php which is the same as TABLE_EZPAGES_CONTENT. Removing the quotes actually did solve the problem because now the ezpages xml file includes links for all languages and throws no errors in the log files. The code is probably outdated but still this quick-fix will get us going until a new version comes out. Can you provide link to the new version in Github?
That file should have been deleted when you upgraded to Zen Cart v1.5.6 where multi-lingual ez-pages was built-in, thus making that old plugin pointless and actually incompatible. You should go delete all the other leftovers of that plugin that aren't part of original Zen Cart code.
I just installed the github release and im getting the following error on 1.57b can anyone help me work out whats wrong please???
[04-Dec-2020 23:04:19 UTC] PHP Parse error: syntax error, unexpected end of file in /includes/templates/template_default/sitemapxml/html_header.php on line 40
[04-Dec-2020 23:04:19 UTC] Request URI: /index.php?main_page=sitemapxml&rebuild=yes, IP address: 92.236.55.221
--> PHP Parse error: syntax error, unexpected end of file in /includes/templates/template_default/sitemapxml/html_header.php on line 40.
a few google searches give me various answers but im having no joy here adding symbols ect.
heres the offending code file thats throwing the error
Code:<?php
/**
* Common Template
*
* outputs the html header. i,e, everything that comes before the \</head\> tag <br />
*
* @copyright Copyright 2003-2020 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: Zen4All 2020 May 12 Modified in v1.5.7 $
*/
/* Mobile_Detect.php old school, responsive design doesn't need scripting */
// Prevent clickjacking risks by setting X-Frame-Options:SAMEORIGIN
header('X-Frame-Options:SAMEORIGIN');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php echo HTML_PARAMS; ?>>
<head>
<title><?php echo HEADING_TITLE; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>" />
<?php if (defined('FAVICON')) { ?>
<link rel="icon" href="<?php echo FAVICON; ?>" type="image/x-icon" />
<link rel="shortcut icon" href="<?php echo FAVICON; ?>" type="image/x-icon" />
<?php } //endif FAVICON ?>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER . DIR_WS_HTTPS_CATALOG : HTTP_SERVER . DIR_WS_CATALOG ); ?>" />
<style>
body {
font-family: Verdana, Geneva, sans-serif;
font-size: small;
}
</style>
</head>
<?php
// BOF hreflang for multilingual sites
if (!isset($lng) || (isset($lng) && !is_object($lng))) {
$lng = new language;
//> </form> </body> </html> }
its complaining about a missing curly bracket. at the end of your code:
no guarantees that it does what it is supposed to do though...PHP Code:
// BOF hreflang for multilingual sites
if (!isset($lng) || (isset($lng) && !is_object($lng))) {
$lng = new language;
}
//> </form> </body> </html> }
best.
it took me a long time to spot the difference there lol thanks bud ill enter it now and report my findings back even if its a success :)
I no longer get a http 500 error and have sitemap.xml's that aren't blank. thankyou :)
i had just got errors resolved from bad setup with help of a hired hand, passes it back to me i installed google merchant feeder no problem then this and by time i asked for help had 11 log files lol. :blush:
Why can't I find "Sitemap XML" in Admin-> Configuration->?
zenzart:1.5.7
Modified admin and template folder name
Two things to help others help resolve the problems experienced, 1) identify other plugins that are installed and 2) identify issues logged in the logs folder at/around the time of experiencing the issue. Remember when posting that your admin directory will appear in myDEBUG-adm files...
It works good for 1.5.7b. thank you
I have installed this on 1.5.7b but when I try to create the sitemap.xml files from the admin the pop up window remains blank. I hav chmod the sitemap folder to 777 and the sitemap.xml file to 777
line 40 is not the EOF in the github repo...
https://github.com/davesaddle/Sitema...header.php#L40
are you sure you have the correct file? and latest version?
Version 4 had a messed up zip.. zip's are not the normal compression for Linux and some how the files got messed up.. Sent in a new zip which was approved... This post was for version 2, version 4 is here.. GitHub is good for ZC1.5.7x and php7.x only which is why it's not a continuation here...
G'day,
Google Search is giving me a warning "Indexed, not submitted in sitemap" for 800+ additional images like https://www.scubadoctor.com.au/dives...omputer_02.jpg
Since Google seems to want to insist on indexing these images, has consideration been given to including them in the sitemap output?
Best regards, Lloyd Borrett.
Lloyd, are you sure that Google's not complaining about the fact that the popup_image_additional page itself?
That page is normally present in the ROBOTS_PAGES_TO_SKIP constant, present in /includes/languages/english/meta_tags.php (or a template- or extra-language-file override)?
Got a debug log for sitemapxml.... PHP Fatal error: Uncaught Error: Call to undefined function zen_admin_demo() in /sitemapxml.php:35
Just to confirm, I had the same issue in YOUR_Admin/sitemapxml.php. The problem appears to arise when using the tickboxes under 'Select Sitemaps to Generate' .
I commented out the following like this:
Then it worked in 1.5.7cPHP Code:
/*case (zen_admin_demo()): $action = ''; $messageStack->add_session(ERROR_ADMIN_DEMO, 'caution'); zen_redirect(zen_href_link(FILENAME_SITEMAPXML)); break;*/
Sitemap XML v3.9.6, running on zc155e, PHP 7.3 and MySQL 5.5.5-10.4.10-MariaDB (ONLY_FULL_GROUP_BY, STRICT_TRANS_TABLES, NO_ZERO_IN_DATE, NO_ZERO_DATE, ERROR_FOR_DIVISION_BY_ZERO, NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION).
When products_reviews are part of the generated sitemap, I'm receiving a log similar to
I corrected this by changing line 28 of /includes/modules/pages/sitemapxml/sitemapxml_products_reviews.php, adding the highlighted element:Code:[22-Jun-2021 18:52:36 Europe/Berlin] Request URI: /mysite/index.php?main_page=sitemapxml, IP address: ::1
#1 trigger_error() called at [C:\xampp\htdocs\mysite\includes\classes\db\mysql\query_factory.php:171]
#2 queryFactory->show_error() called at [C:\xampp\htdocs\mysite\includes\classes\db\mysql\query_factory.php:143]
#3 queryFactory->set_error() called at [C:\xampp\htdocs\mysite\includes\classes\db\mysql\query_factory.php:270]
#4 queryFactory->Execute() called at [C:\xampp\htdocs\mysite\includes\modules\pages\sitemapxml\sitemapxml_products_reviews.php:30]
#5 include(C:\xampp\htdocs\mysite\includes\modules\pages\sitemapxml\sitemapxml_products_reviews.php) called at [C:\xampp\htdocs\mysite\includes\templates\template_default\sitemapxml\tpl_main_page.php:21]
#6 require(C:\xampp\htdocs\mysite\includes\templates\template_default\sitemapxml\tpl_main_page.php) called at [C:\xampp\htdocs\mysite\index.php:97]
--> PHP Fatal error: 1055:'mydatabase.rd.languages_id' isn't in GROUP BY :: SELECT r.products_id, MAX(r.date_added) AS date_added, MAX(r.last_modified) AS last_modified, GREATEST(MAX(r.date_added), IFNULL(MAX(r.last_modified), '0001-01-01 00:00:00')) AS last_date, rd.languages_id
FROM reviews r
LEFT JOIN reviews_description rd ON (r.reviews_id = rd.reviews_id),
products p
WHERE p.products_id=r.products_id
AND p.products_status=1
AND r.status = 1
AND rd.languages_id IN (1)
GROUP BY r.products_id ORDER BY last_date DESC ==> (as called by) C:\xampp\htdocs\mysite\includes\modules\pages\sitemapxml\sitemapxml_products_reviews.php on line 30 <== in C:\xampp\htdocs\mysite\includes\classes\db\mysql\query_factory.php on line 171.
Code:$sql = "SELECT r.products_id, MAX(r.date_added) AS date_added, MAX(r.last_modified) AS last_modified, GREATEST(MAX(r.date_added), IFNULL(MAX(r.last_modified), '0001-01-01 00:00:00')) AS last_date, rd.languages_id
FROM " . TABLE_REVIEWS . " r
LEFT JOIN " . TABLE_REVIEWS_DESCRIPTION . " rd ON (r.reviews_id = rd.reviews_id),
" . TABLE_PRODUCTS . " p
WHERE p.products_id=r.products_id
AND p.products_status=1
AND r.status = 1
AND rd.languages_id IN (" . $sitemapXML->getLanguagesIDs() . ")
GROUP BY r.products_id, rd.languages_id" .
(SITEMAPXML_PRODUCTS_REVIEWS_ORDERBY != '' ? " ORDER BY " . SITEMAPXML_PRODUCTS_REVIEWS_ORDERBY : '');
Is this ok to use on 1.5.7c and php7.1? I don't have a test store to try it out on currently
Sorry, I posted the below on the wrong thread :(
Running fresh zen cart install 1.5.7c on PHP 7.3.2 with the latest sitemap plugin.
Ok, as for the (Select Sitemaps to Generate), I've left what is already ticked in sitemap, not sure if it's better to tick the boxnews, news, reviews?
I had to manually add a few of my categories as they did not get added to the file.
As for the main domain, do you have to use (.../index.php?main_page=index)? Can't just just use the actual domain without the index.php part?
Also, I first went to (https://www.xml-sitemaps.com) to create a sitemap and it scanned a whole lot more pages than the zen cart plugin did. Is it better to use that instead or stick with this?
Still not sure if the robots.txt I created is good to go or if it's need further adjusting?!
I just added mywebsite/sitemap.xml link to it, I did Not add the other .xml links like categories, products etc, as the readme text did not say to do that.
I went to google and submitted my sitemap.xml url but it says couldn't fetch and Sitemap could not be read.
Any reason why?
I've just set ALL the Permissions for the .xml files and .htaccess file that came with this plugin to 777, and they are being fetched now.
Is setting them all to 777 open to getting my site hacked or injected with any code etc..?
Do I leave them to 777 always?!
Bugger, ended up with a duplicate message. See next post for content.
Every system is different. But, all files and folders on your server have one thing in common... they are all on your server for you to review, compare and make changes... so do you have all of your files and folders everywhere set to 777? Do you understand what those three numbers together mean? I'm not trying to play stump the chumpr or something... Some may say sure leave it that way if it works, others would say if you don't need to modify the files then should make them read, execute or the like only... as to whether they are writeable or not, well, sometimes security comes at a cost. Prevent changes until ready to make changes at which point make them writeable again...
Understand, on the server I use, last time I made a file 777, then I think I had to get the host to alter the permissions for me to regain access to the file. The host expects a max of 644 for files and 755 for folders... but that's one of the hosts with which I've worked. Another may require 777 for folders. I know that now or at least at one point the Zen Cart install instructions advocated 777 for folders while the development team probably will whack me across the head for saying this, but I haven't taken a hard look at those instructions for a while now... install, lock down specific folders and files, upgrade database and necessary files, move on. A lot of hard work has gone into those instructions.
Thank you as always mc.
Your reply went straight over my head though :)
But I assume since you did Not specifically warn me to change the 777 permissions back, I will just leave them that way for now.
(if Google can't fetch these files at 644 permissions, than I have no choice.)
Might even look at using (https://www.xml-sitemaps.com) as it seemed to generate way more links and it's only one sitemap file. Not sure why this map generates several different sitemap files (might be a good thing but not sure), plus it keeps creating the manufacturessitemap even though the manufacturer box is unticked.)
1) didn't say no don't do because I don't know your system. Not the first choice I would make. So for "ease". What are the folder permissions on the following folders: includes, images, zc_plugins, public?
2) as for "number" of links, that is not necessarily the right thing. What product is missing from the sitemap xml files that are in your store?
3) could have one file per product if so wanted, number of files doesn't mean anything. There is a set of "rules" to be followed to get from the root to the final location. Sitemap XML follows those. That the other file is created, if theres nothing in it, then shouldn't be a problem, though I'm sure it could be modified to eliminate generation of that (each?) file and associated data within the files.
After identifying the permissions of those folders, then can discuss further if an alternate setting should be set and/or attempted.
Thanks mc,
1) Permissions are: (Host is Hostgator)
includes: 755
images: 755
zc_plugins: 755
public_html: 750
2) There was a few categories not included in sitemap generation, had to manually add them to file (Cat where main and have products in them)
3) I get you. Just a query, why must the main page url in sitemap have the /index.php?main_page=index part? Is this what I will show on google? I would rather just the domain, can I alter that part by removing the above bit from the domain url in sitemapmainpage.xml?
1) so, the sitemap folder(s), things don't work if the folders are set to 755?
2) these "categories" that didn't show, but have product, are the product linked from another category or is their master category this "missing" category?
3) I don't claim to be an SEO expert, I do know that the main page is reachable by that address and that basically it is by server setup that the main page is reached without using all of the index references. Usually the link(s) used represent the canonical link (basically the one link that really represents the product/page even if there are multiple addresses that could be entered to get there. In this situation I would either do more research outside of this thread/forum, go with making the change, and/or go with the "majority" which has been to accept the index.php?main_page=index. I suspect it is listed that way solely from the "consistent" nature of generating an address using the zen_href_link code without possibly evaluating for use of just the domain name with any applicable subfolder.
Just changed them ALL to 755, but for some reason 2 out of the 4 .xml say (couldn't fetch) - (mainpage and products)
https://i.imgur.com/y78fKX8.png
I think they were top categories with either single or double digit products in them.
When you say "ALL" can you clarify? The discusion of what folders to change was about a specific set based off of existing values...
So I was able to get to the four sitemap files. Note I also forgot to mention one reason to split things up even if just a little is that it makes loading a specific aspect faster.
Now as far as categories that may have been missing, I don't have the code open about how they are "discovered", but there is either some characteristic about the category that is not right or there could even be an issue with it though I'm banking more on the first aspect.
Realize that one of the powers of this software is for it to get the sitemap regenerated on a periodic basis. I understand that one or more "regeneration" features could be disabled, but if the file is modified manually, then on the next regen, that change will be yet again needed...
Thinking more on the issue of sitemapmainpage... (haven't done any further homework), the only "issue" I see is that 1) sitemap.xml is intended to tell spiders the "most direct" way to get to the item referenced, that it is by that information for the site to be linked. The expectation though at that point is that the spider (perhaps a different than the first) is to go to that page using the info provided and validate that it is identified to be what was "selected" and whatever review. But... and even though I followed that link, the canonical info said that it is just the domain name and sub-folder... so in a way saying: hey spider here are two pages to get to the same info, basically leaving it to the spider to figure out what to provide.
Now, that said, I'll note that your site is accessible by either using or not using the www. prefix... general statements have been that should pick one and force the site to load to that even on first load (not just to become that way on first click...
Thank you mc,
Sorry, I meant all the .xml files associated with the sitemap plugin and the .htaccess in the sitemap folder.
The categories are new and I have set them up just like the other categories, nothing weird or different.
I've decided to remove the index part from the sitemapmainpage.xml file.
As for forcing my site to force load the www.prefix, I tried adding different codes I got online into my .htaccess but none of them worked?!
The .htaccess in my public_html already has the following in it:
Code:RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteEngine on
RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http://.*amazonaws\.com [OR]
RewriteCond %{REMOTE_HOST} ^.*\.compute-1\.amazonaws\.com$ [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "AISearchBot" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "woriobot" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "heritrix" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "NetSeer" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "Nutch" [NC]
RewriteRule ^(.*)$ - [F]
RewriteEngine on
# Use PHP5 Single php.ini as default
# Changed PHP handler from application/x-httpd-php5s to application/x-httpd-phpbetas on Thu Jan 7 15:29:29 MST 2016.
#AddHandler application/x-httpd-phpbetas .php
SetEnv TZ 'Australia/Sydney'
# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php74” package as the default “PHP” programming language.
<IfModule mime_module>
AddHandler application/x-httpd-ea-php74 .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
Just figured out how to force redirect my domain to always add www to the url via my cPanel when someone just types the domain.com.au.
The only thing I don't know what to do is force the http to redirect to https.
My site always loads https, but I tested it with just http and it did not redirect?!
Just figured it out, I think as I'm not getting any issues loading site: (I edited the .htaccess my cPanel created inside my Domain folder instead of the other one in public_html)
RewriteEngine on
RewriteCond %{HTTP_HOST} ^DOMAIN\.com\.au$
RewriteRule ^/?$ "https\:\/\/www\.DOMAIN\.com\.au\/" [R=301,L]
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
I previously had mentioned two different values when discussing files and folders. Files tend to be 644 and folders 755. I'm not sure what drove the discussion of folder permissions to then apply those same values to files especially after suggesting to identify likely values based off of comparison of similar objects.
I don't know how much of the above is still an issue. I was reading the recent history and realized that file permissions may be set wrong as they were being modified to the settings discussed for folders. For files, would suggest the same type of review though would sample files within folders. For example there is an htaccess file within at least the first level folder of the zen cart install. Then there are other files within most folders.
Sorry mc, misunderstood you.
I've changed the files back to 644 and made the folders 755 which matches other files/folders, will see how Google sees them and go from there.
Still having problems, Google now seems to only fetch 1 of the sitemaps?!
Also, Google has crawled my sire but only main page and another, no other pages show up. Very weird.
I have Google AdWords which used to help index my site quickly but something not right this time round.
Had to change all the permissions for the generated .xml and .htaccess files associated with the Sitemap plugin to 755 as that seems to be the only way Google can fetch them all?!
understanding linux permissions/security can be a bit of work. but it is wrong to say that this is the only way to do something.
why the permissions on your .htaccess file need to be changed, well that's probably not true. if you can go to:
www.yoursite.com/.htaccess
and you see your .htaccess file on your browser window, i would suggest to you that is a problem; and not how one would want their webserver configured.
and your sitemap program is NOT generating your .htaccess. if it is, there is something wrong with this picture.
if you can go to:
www.mysite.com/sitemapcategories.xml (or whatever your sitemap is called)
and you can see that xml file in your browser window, then so can google.
having to manually change your sitemap permissions every time you regenerate your sitemap is far from ideal, and something that i would bring up with your hosting company.
understanding the owner of the file, the group of the file, and which user is running apache (or whatever is serving up your web pages), is a starting point for being able to add a crontab entry for your sitemap, generating new sitemaps on a scheduled basis (based on how often your product mix changes/goes out of stock, etc.), and having those sitemaps be available to whatever spider wants to look at them, without the need to change permissions every time the crontab runs.
why they would need to be more than 644 is more about the setup than anything else.
Thanks for your assistance.
The sitemapxml plugin has a .htaccess file included in a folder called sitemap where the generated sitemap files are.
www.mysite.com.au/sitemap/.htaccess
However, when you go the the url to access the .htaccess file it doesn't load, it shows a permission error.
(It appears you don't have permission to access this page. 403 Error. Forbidden.)
Only the sitemap files load via the url, which as you advise, Google should be able to see them if I can see them, but for some reason, when I add the sitemap link to google search console and it accepts, but when I check it a day or so later, it shows some of the sitemaps as (couldn't fetch) which is so weird, and for some reason google/bing are only showing 2/3 pages as indexed.
I thought especially with AdWords it would start showing a few more pages..
you bring up numerous issues. and you tend to post things that others may read as being true which are not.
- 755 is not what i would recommend for your xml files.
- a htaccess file is not generated by this sitemap plugin. there looks to be a .htaccess file included and the author wants it placed in the directory where your sitemap files are. but very different from it being generated by a script. cpanel could generate one, but not this plugin.
- if the only files in your directory are xml files that you want to be seen by anyone browsing your site, the .htaccess file is not needed.
- i would suggest reading up on it: https://ithemes.com/what-is-the-htaccess-file/
- if you can see the sitemap xml files in your browser, so can google or any other search engine.
- why a page gets indexed (or not) is a separate issue and part of the black arts of SEO.
- what adwords has to be with anything, you got me. but marketing and SEO are not my thing. ensuring that your sitemap is in the correct format and readable is a different thing.
- if all of your sitemap files are correct, then the problem would be somewhere else.
- in general, i would guess that there is a problem with your sitemap files. and i would look at the ones that are not being indexed to ensure they look correct or at least like the other ones that are indexed.
- if they are correct and google does not index them, i would investigate with google. especially since you are paying them for adwords.
hope that helps.
Thanks for your reply :)
Yes, your are correct, the .htaccess file is included in this plugin and sits inside the sitemap folder that has the .xml files the plugin generates in admin.
As for the sitemap file, I ended up having to generate one from this link www.xml-sitemaps.com and use that instead and removed this plugin's generated .xml files.
So far Google has been able to fetch this new file correctly and not show any "couldn't fetch errors" as it did with the others.
(I've set the new sitemap.xml file to 644 permissions.)
Does your site have linked product? If so, does this "other tool" account for linked product? (basically does it only provide a single url for a product that has multiple urls available for it where they all have the same canonical url?
A program that does not account for linked product on a site that has linked product is not doing you any favors.
As to the indexing "issue(s)" to which you were referring, you need only provide the domain-name/subfolder-if-any/sitemap.xml file. That file is setup to support further reading and finding of information to occur. So not sure what was meant by only reading some of the files when there is only one file to be referenced.
Now, the content within each of those other generated files, sure that will be read/processed when/as necessary as determined by the search engine. Also, considering that those engines work more towards content than anything, if the same content is across multiple items, then the "variety" of the items is reduced and the number of indexed items may decrease over time. I too would not consider myself an SEO expert. I have seen on a rescue related site where each rescued animal has a different description but over time the number of indexed links has been seen to decrease. The point being that the search engine has its reasons and means to index and it may not match with the total number of items in the list that you see...
.htacess files are not supposed to load in the browser by direct access. They control the behavior of requests for assets within the folder. So of course going to www.mysite.com.au/sitemap/.htaccess gets you a 403 error
Those rules only allow .XML or .xml.gz files to be accessed with in that folder, that's it, its only purposeCode:# deny *everything*
<FilesMatch ".*">
Order Allow,Deny
Deny from all
</FilesMatch>
# but now allow just *certain* necessary files:
<FilesMatch ".*\.(xml|xml\.gz)$" >
Order Allow,Deny
Allow from all
</FilesMatch>
Just tried to delete this plugin but ran into some issues.
I first went to Admin -> Tools -> Sitemap XML and click "Un-Install SitemapXML SQL" and ran the script..
A few statements popped up in green, screenshot attached (https://i.imgur.com/No88EL4.png).
Tried it a few times with the same thing happening, so I went to my server and deleted all the files that came in the plugin via FTP.
But now I can still see all the SitemapXML references in my Database.
Does this come with a un-install SQL I can manually install to remove all the config references from my database?
Has someone had any luck with the above request?
Thanking you in advance.
Just bumping this up, could really use the help here.
i'm just not sure why it is important to you to delete these config values from the database.
if its really that important, backup your database, and understand sql is very powerful and you have the potential to screw things up royally, for very little gain, IMO.
that said, no warranty expressed or implied.
from phpMyadmin (or something similar) or from your tools -> install sql patch option:
be berry berry careful.Code:// replace 'prefix.' with your database table prefix if you have one. remove the period if you do not have one.
delete from prefix.configuration
WHERE configuration_key LIKE '%SITEMAPXML%';
delete from prefix.configuration_group
WHERE configuration_group_description LIKE '%SitemapXML%';
best.
Please could you clarify as Im not a coder.
I have just loaded sitemap onto a v157 site.
And am getting a ....
Call to undefined function zen_admin_demo() in zcadmin/sitemapxml.php line 35.
You say to comment it out ... so I commented out that 1 line - case (zen_admin_demo()): and the line below shows an error.
What lines do I comment out please ?
Code:
if (zen_not_null($action)) {
switch ($action) {
// demo active test
case (zen_admin_demo()):
$action = '';
$messageStack->add_session(ERROR_ADMIN_DEMO, 'caution');
zen_redirect(zen_href_link(FILENAME_SITEMAPXML));
break;
case 'upgrade':
case 'install':
woops. Have found the answer ... as there is another post
Glad you found it, it is always helpful to also include the link to where that particular post is. This way it helps you (in the future) and anyone else attempting to do the same... BTW, yes, probably too late to modify the above post, so help yourself/others as seen fit...
Running Sitemap XML v3.9.6 on zc157c with strict MySQL. Running the admin tool to create the base sitemaps results in a MySQL fatal error:
I was able to correct the issue via update to /includes/modules/pages/sitemapxml/sitemapxml_products_reviews.php, adding the highlighted change to the GROUP BY clause:Code:[03-Jan-2022 21:23:52 Europe/Berlin] Request URI: /mysite/index.php?main_page=sitemapxml&rebuild=yes, IP address: 127.0.0.1
#1 trigger_error() called at [C:\xampp\htdocs\mysite\includes\classes\db\mysql\query_factory.php:171]
#2 queryFactory->show_error() called at [C:\xampp\htdocs\mysite\includes\classes\db\mysql\query_factory.php:143]
#3 queryFactory->set_error() called at [C:\xampp\htdocs\mysite\includes\classes\db\mysql\query_factory.php:270]
#4 queryFactory->Execute() called at [C:\xampp\htdocs\mysite\includes\modules\pages\sitemapxml\sitemapxml_products_reviews.php:30]
#5 include(C:\xampp\htdocs\mysite\includes\modules\pages\sitemapxml\sitemapxml_products_reviews.php) called at [C:\xampp\htdocs\mysite\includes\templates\template_default\sitemapxml\tpl_main_page.php:21]
#6 require(C:\xampp\htdocs\mysite\includes\templates\template_default\sitemapxml\tpl_main_page.php) called at [C:\xampp\htdocs\mysite\index.php:94]
--> PHP Fatal error: 1055:'canadianllama157.rd.languages_id' isn't in GROUP BY :: SELECT r.products_id, MAX(r.date_added) AS date_added, MAX(r.last_modified) AS last_modified, GREATEST(MAX(r.date_added), IFNULL(MAX(r.last_modified), '0001-01-01 00:00:00')) AS last_date, rd.languages_id
FROM reviews r
LEFT JOIN reviews_description rd ON (r.reviews_id = rd.reviews_id),
products p
WHERE p.products_id=r.products_id
AND p.products_status=1
AND r.status = 1
AND rd.languages_id IN (1,2)
GROUP BY r.products_id ORDER BY last_date DESC ==> (as called by) C:\xampp\htdocs\mysite\includes\modules\pages\sitemapxml\sitemapxml_products_reviews.php on line 30 <== in C:\xampp\htdocs\mysite\includes\classes\db\mysql\query_factory.php on line 171.
Code:<?php
/**
* Sitemap XML
*
* @package Sitemap XML
* @copyright Copyright 2005-2015 Andrew Berezin eCommerce-Service.com
* @copyright Copyright 2003-2015 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: sitemapxml_products_reviews.php, v 1.1 31.01.2015 15:29:52 AndrewBerezin $
*/
echo '<h3>' . TEXT_HEAD_PRODUCTS_REVIEWS . '</h3>';
$last_date = $db->Execute("SELECT MAX(GREATEST(r.date_added, IFNULL(r.last_modified, '0001-01-01 00:00:00'))) AS last_date
FROM " . TABLE_REVIEWS . " r
WHERE r.status = '1'");
$table_status = $db->Execute("SHOW TABLE STATUS LIKE '" . TABLE_REVIEWS . "'");
$last_date = max($table_status->fields['Update_time'], $last_date->fields['last_date']);
if ($sitemapXML->SitemapOpen('products_reviews', $last_date)) {
//-bof-20220103-lat9-Correcting MySQL fatal error, missing rd.languages_id from GROUP BY
$sql = "SELECT r.products_id, MAX(r.date_added) AS date_added, MAX(r.last_modified) AS last_modified, GREATEST(MAX(r.date_added), IFNULL(MAX(r.last_modified), '0001-01-01 00:00:00')) AS last_date, rd.languages_id
FROM " . TABLE_REVIEWS . " r
LEFT JOIN " . TABLE_REVIEWS_DESCRIPTION . " rd ON (r.reviews_id = rd.reviews_id),
" . TABLE_PRODUCTS . " p
WHERE p.products_id=r.products_id
AND p.products_status=1
AND r.status = 1
AND rd.languages_id IN (" . $sitemapXML->getLanguagesIDs() . ")
GROUP BY r.products_id, rd.languages_id" .
(SITEMAPXML_PRODUCTS_REVIEWS_ORDERBY != '' ? " ORDER BY " . SITEMAPXML_PRODUCTS_REVIEWS_ORDERBY : '');
//-eof-20220103-lat9
$reviews = $db->Execute($sql);
/*
if (zen_not_null($result['last_modified']) ){
$lastmod = $reviews->fields['last_modified'];
} else {
$lastmod = $reviews->fields['date_added'];
}
*/
$sitemapXML->SitemapSetMaxItems($reviews->RecordCount());
while (!$reviews->EOF) {
$sitemapXML->writeItem(FILENAME_PRODUCT_REVIEWS, 'products_id=' . $reviews->fields['products_id'], $reviews->fields['languages_id'], $reviews->fields['last_date'], SITEMAPXML_PRODUCTS_REVIEWS_CHANGEFREQ);
$reviews->MoveNext();
}
$sitemapXML->SitemapClose();
unset($reviews);
}
// EOF
Can anyone tell me if this plugin will work in 1.5.7c?
Thank You
I have used this version sitemapXML3_9_6 https://www.zen-cart.com/downloads.php?do=file&id=367
Using sitemapXML 3.9.6. And also getting the Call to undefined function zen_admin_demo() in zcadmin/sitemapxml.php line 35 error log that the other user was getting in this post
https://www.zen-cart.com/showthread....74#post1384774
Would love to lean the fix. Any time i try to save any settings in sitemapxml it gives me a blank page from admin and generates another error log.
Can someone possibly tell me why I would see the following error at the end of the build process in the window that pops up:
Ping Bing
http://www.bing.com/webmaster/ping.a...temapindex.xml
cURL Error: "" reading "http://www.bing.com/webmaster/ping.aspx?siteMap=https%3A%2F%2Fwildsteedworx.com%2Fsitemapindex.xml"
The Microsoft Bing search engine has quietly stopped accepting XML Sitemap pings. https://blogs.bing.com/webmaster/may...map-submission
Is there any estimated time of update for this module for use with ZC 1.5.8 php 8.1? The reason for the question is below, I have 3 sites currently at 1.5.7c that I am preparing to update.
Currently I have a clean install Ubuntu 20.04 server with a virgin demo cart with data install with no modifications besides the sitemapXML module in question. I have confirmed the server meets the requirements (including PHP modules) posted in the docs for Zen Cart.
I have installed the latest sitemapxml version (3.9.6 also called V 2) on the zen cart site. Permissions have been set correctly on sitemap.xml and the sitemap root folder.
Clicking Tools SiteMap give the normal sitemap page with the various options
When I check Rebuild all .xml files (with everything else at the default selections) then click send I get a blank screen on the Pop up screen and the system logs the following warning:
[15-Nov-2022 14:42:36 America/Chicago] PHP Fatal error: Uncaught Error: Cannot access private property queryFactory::$count_queries in /var/www/alt1.humphreystowbars.com/public_html/includes/classes/sitemapxml.php:78
Stack trace:
#0 /var/www/alt1.humphreystowbars.com/public_html/includes/modules/pages/sitemapxml/header_php.php(66): zen_SiteMapXML->__construct()
#1 /var/www/alt1.humphreystowbars.com/public_html/index.php(35): require('...')
#2 {main}
thrown in /var/www/alt1.humphreystowbars.com/public_html/includes/classes/sitemapxml.php on line 78
[15-Nov-2022 14:42:36 America/Chicago] Request URI: /index.php?main_page=sitemapxml&rebuild=yes, IP address: 98.190.184.37
--> PHP Fatal error: Uncaught Error: Cannot access private property queryFactory::$count_queries in /var/www/alt1.humphreystowbars.com/public_html/includes/classes/sitemapxml.php:78
Stack trace:
#0 /var/www/alt1.humphreystowbars.com/public_html/includes/modules/pages/sitemapxml/header_php.php(66): zen_SiteMapXML->__construct()
#1 /var/www/alt1.humphreystowbars.com/public_html/index.php(35): require('...')
#2 {main}
thrown in /var/www/alt1.humphreystowbars.com/public_html/includes/classes/sitemapxml.php on line 78.
There are various forks on Github...confusing for anyone wishing to submit their fixes from a working ZC158 site.
So, who wishes to host/manage this from now?
Change $db->count_queries
To
$db->queryCount()
Although for backwards compatibility, would want to check if the method exists, if it does use the new, if it does not, use the code as it was.
E.g. the equal sign and what follows to be replaced by:
Code:= (method_exists($db, 'queryCount') ? $db->queryCount() : $db->count_queries);
Yes, there are several floating around. I believe the code at https://github.com/dbltoe/Sitemap-XML-4 is the most recent but I have yet to test on 1.5.8. It does just fine on 1.5.7d but, there again, it does use the plugins folder method.
Maybe later this evening.
Will run into a similar issue with $db->total_query_time
With the above equivalent replacement:
I've generated a commit to address both of these issues at: https://github.com/mc12345678/zen-ca...f72dc96261d6afCode:= (method_exists($db, 'queryTime') ? $db->queryTime() : $db->total_query_time);
Though, it looks like this method has existed throughout all of 1.5.x so, really could just replace with the method instead of trying to directly access what is now a private member.
That has been updated with this commit to use the existing data class methods instead of trying to access what are now private members:
https://github.com/mc12345678/zen-ca...0e66fc91d045f0
I didn't research if those methods existed in pre 1.5.x systems. The first of these two commits would likely support that possibility.
@mc
I downloaded the zen-cart-sitemap.xml 158 zip from your repository from GitHub and when unzipped the files I get a error Access Denied.
I install Zencart 1.57d using third party product "Inveo_Magic_SEO_URLs_for_ZenCart_6.2.00" for better URL format on PHP 7.3
Do we have a version of sitemapXML compatible with 1.57d and third party product?
This one should be working.
You can also try https://github.com/dbltoe/Sitemap-XML-4 BUT, all bets are off with the "off-brand" SEO. :(
The "Access Denied" message is a little vague. Almost so much so, I don't know of a "simple" question to ask. I've never simply unzipped a file on my local computer to get that message, I've never had a server simply unzip a file to get that message. I have gotten a similar message if I had limited access rights to a Zen Cart site and I tried to access an area to which I thought I had access but didn't.
So I'm a little confused about how simply unzipping the file would necessarily cause an access denied response, unless there is or was more to the story.
Is this a Windows-protecting-you thing...right click on it and see if there is some option to unblock it?
@torvista
Yes you were spot on. My Iobit Malware had my 7zip in the blocked folder.
Thanks for the heads up on finding the culprit.
That works for you on Zencart 1.5.8? I'm trying to upgrade from 3.9.3 on zencart 1.5.5, but running into the usual language defines problem. The 3.9.6 release, and the github repo @mc12345678 linked to, contain the old fashioned languages/english/sitemapxml.php file format, but I believe 1.5.8 requires the new lang.sitemapxml.php style with array definitions to be loaded by $languageLoader. I'm attempting a manual conversion, but some bumps in the road, e.g. SITEMAPXML_SITEMAPINDEX_HTTP_LINK is defined and then used in the same file, so you can't define it in an array and use it later in that same array, the way you could when they were define() statements.
Also the menu item seems to have dropped off my Tools menu, apparently my admin_menus database row has page_name 'BOX_TOOLS_SITEMAPXML' and this constant is no longer defined. My old version was zen-cart-sitemap-xml 3.9.3, looks like I'll have to fix up the database menu entries manually to fit the new language define names. I can see that one can invoke the admin/index.php?cmd=sitemapxml&action=install by typing it into the browser address bar to trigger it, but how is it supposed to run otherwise? The 'Install' section in README.md just talks about going to Tools->Sitemap XML which won't appear without the admin_pages / admin_menus database rows.
I've run into this broken admin menu language key problem a few times over the years. Anyone else think it would be helpful to add an else block in admin_access.php zen_get_admin_pages() where it tests "if (defined($row['main_page']) && defined($row['page_name'])) {" so it could log which one was not defined when it fails?
> Anyone else think it would be helpful to add an else block in admin_access.php ...
This has already been done.
https://github.com/zencart/zencart/pull/5412
No. It will load the old-style language defines, and there are no plans to drop that.Quote:
I believe 1.5.8 requires the new lang.sitemapxml.php style
Personally I have left all add-ons using the old language defines, to keep them all visually separate from the core files in file listings/comparisons.
>I must have missed this in my read through the new language system docs
No, maybe you are as stupid as me and just don't understand plain english either:
https://github.com/zencart/documentation/issues/988
If I understand your point, I think I agree with you, the docs seem to be quite clear that the language file format and loading system was changed, and the old way of using define statements no longer works. There's language to that effect in a few places in the docs you linked indirectly to https://github.com/zencart/documenta...guage_files.md (with use of statements such as "has changed", "will no longer work" etc) .. I don't think it's unreasonable to assume that any old `languages/<lang>/file.php` file would be completely ignored under ZC 1.5.8, that was certainly my assumption. If it's actually a hybrid system that supports the old and new ways of loading language strings, it slipped me by completely. We have a pretty complex site with many customised and custom pages plus addons, some of which have become core ZC, some of which haven't been ported to 1.5.8 yet and I've had to do a hack job on, lots to keep track of. Late here, will bash my head against it more tomorrow. Was hoping to go live tomorrow but probably slip another day with other problems raised today.
I installed this version, but the result is not correct, it don't taking care of dynamic naming. We still see the product ID not the name
<url>
<loc>https://www.pechesudv155.owally.com/...duct_info&products_id=1151</loc>
<lastmod>2022-07-26T00:07:48-05:00</lastmod>
<changefreq>weekly</changefreq>
<priority>0.98</priority>
</url>
it suppose to look like this:
<url>
<loc>https://www.pechesud.com/fr/yo-zuri-3d-inshore-popper-lures-sardine-1193</loc>
<lastmod>2022-10-13</lastmod>
<changefreq>weekly</changefreq>
<priority>0.98</priority>
</url>
The old version the SitemapXML v3.3.3 works perfectly with Zencard 1.55F, but not compatible with 1.57d
Does someone could tell to me if it change something for Google index robot, if it see the product ID products_id=1151 instead the product name yo-zuri-3d-inshore-popper-lures-sardine-1193
I'm using Magic SEO URLs for Zen Cart v1.3.x/1.5.x 6.2
Hi,
I am just installing your Sitemap to my new shop ZC 1.5.8.a, but it not works.
i see many problems by includes/classes/sitemapxml.php
like this:
[24-Apr-2023 10:13:52 UTC] Request URI: /index.php?main_page=sitemapxml&rebuild=yes, IP address: 212.96.184.184, Language id CZK
#0 /pub/amforawa/vialux.cz/web/www/includes/classes/sitemapxml.php(98): zen_debug_error_handler()
#1 /pub/amforawa/vialux.cz/web/www/includes/modules/pages/sitemapxml/header_php.php(66): zen_SiteMapXML->__construct()
#2 /pub/amforawa/vialux.cz/web/www/index.php(35): require('...')
--> PHP Deprecated: Creation of dynamic property zen_SiteMapXML::$base_url_index is deprecated in /pub/amforawa/vialux.cz/web/www/includes/classes/sitemapxml.php on line 98.
or
PHP Fatal error: Uncaught Error: Cannot access private property queryFactory::$count_queries in /pub/amforawa/vialux.cz/web/www/includes/classes/sitemapxml.php:735
and many others
Could you help me?
thank you Dalibor
You want to change
$this->statisticModuleQueries = $db->count_queries;
to
$this->statisticModuleQueries = $db->queryCount();
Alternately, you can downgrade to PHP 8.1 until someone else has fixed this whole file; there are other changes that will be required as well.
Version 3.9.9 of SitemapXML is now available for download: https://www.zen-cart.com/downloads.php?do=file&id=367
This version
- Drops support for Zen Cart versions prior to 1.5.7; tested on PHP versions 7.3 through 8.2 and Zen Cart 1.5.7 through 1.5.8a.
- Provide interoperability with PHP 8.2, defining all class variables and removing usage of the now-deprecated utf8_encode function.
- Removes the automatic Zen Cart check for plugin updates as that can have adverse performance implications for a site's admin processing.
- Corrects MySQL fatal errors when run with more strict (e.g. MySQL 8) SQL servers.
- "Refreshed" the majority of the PHP files to use now-current PHP and Zen Cart programming styles and removing code that was required for Zen Cart versions prior to 1.5.7 and/or PHP versions less than 7.3.
- Removed configuration multi-language support.
Current GitHub repository: https://github.com/lat9/sitemapxml
Thanks Cindy!
Could the other separate versions kicking around Github integrate their changes and/or disappear....? It's messy and confusing.