Zen Cart Logo

SitemapXML v.2

Views: 613,390

Results 2,161 to 2,180 of 2,226
2 Dec 2024, 2:13 PM
#2161
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

SitemapXML v.2

v4.0.3 is now available for download: https://www.zen-cart.com/downloads.php?do=file&id=367

This release contains changes associated with GitHub issue #49 (Product-reviews/reviews/manufacturers) sitemaps throw deprecation log if a last-updated date is null).

3 Dec 2024, 3:26 AM
#2162
nicksab avatar

nicksab

Totally Zenned

Join Date:
Apr 2011
Posts:
592
Plugin Contributions:
0

Re: SitemapXML v.2

lat9:

Similar change for /includes/modules/pages/sitemapxml/sitemapxml_reviews.php, line 34, adding the highlighted bits

    $sitemapXML->writeItem(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $next_review['products_id'] . '&reviews_id=' . $next_review['reviews_id'], $next_review['language_id'], $next_review['last_date'][B] ?? $last_date[/B], SITEMAPXML_REVIEWS_CHANGEFREQ);

Noted. Thank you
5 Dec 2024, 10:27 AM
#2163
dml73 avatar

dml73

Zen Follower

Join Date:
Oct 2007
Posts:
413
Plugin Contributions:
0

Re: SitemapXML v.2

There seems to be an issue with v3.9.9 of this plugin, when creating EZ pages.
The plugin page states that v3.9.9 is the last version supporting zen cart v1.5.7. Does this mean that v4.0.3 does not work with zen cart v1.5.7b, or does it mean that v1.5.7 just isn't supported anymore. What I'm trying to find out is if it would work if I install v4.0.3 in zencart 1.5.7.

5 Dec 2024, 12:21 PM
#2164
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: SitemapXML v.2

DML73:

There seems to be an issue with v3.9.9 of this plugin, when creating EZ pages.
The plugin page states that v3.9.9 is the last version supporting zen cart v1.5.7. Does this mean that v4.0.3 does not work with zen cart v1.5.7b, or does it mean that v1.5.7 just isn't supported anymore. What I'm trying to find out is if it would work if I install v4.0.3 in zencart 1.5.7.
Since the readme for v4.0.0 and later indicate that support's dropped for Zen Cart versions prior to 1.5.8, I'm guessing that SitemapXML will be throwing PHP errors/warnings if you try to use it with 1.5.7.

For the plugins that I support, like this one, I tend to keep support for the most recent 2 or 3 Zen Cart versions. I just don't have the time to test (and support) their usage on the older Zen Cart versions.

5 Dec 2024, 12:53 PM
#2165
dml73 avatar

dml73

Zen Follower

Join Date:
Oct 2007
Posts:
413
Plugin Contributions:
0

Re: SitemapXML v.2

Thanks, that makes sense.

22 Feb 2025, 10:56 PM
#2166
wsworx avatar

wsworx

Zen Follower

Join Date:
Jun 2012
Location:
California
Posts:
260
Plugin Contributions:
0

Re: SitemapXML v.2

Hi Lat9. yes its me again :D

ZC2.1
PHP 8.3
authorizenet_merchant_seal_2.0
customer_tax_exempt_2.0.2
edit_orders-5.0.0
sitemapxml-master-4.0.3
usps-USPS_2024_08_25_K11l
zen_TyPackageTracker-5.0.0

I installed the latest github release of sitemapxml yesterday and got this debug log overnight:

[22-Feb-2025 05:00:06 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id not set
#0 [internal function]: zen_debug_error_handler()
#1 //public_html/includes/init_includes/init_sessions.php(36): dirname()
#2 //public_html/includes/autoload_func.php(40): require_once('/...')
#3 //public_html/includes/application_top.php(329): require('/...')
#4 //public_html/index.php(25): require('/...')
#5 //public_html/cgi-bin/sitemapxml.php(74): require('/...')
--> PHP Deprecated: dirname(): Passing null to parameter #1 ($path) of type string is deprecated in //public_html/includes/init_includes/init_sessions.php on line 36.

[22-Feb-2025 05:00:06 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id 1
#0 [internal function]: zen_debug_error_handler()
#1 //public_html/includes/classes/navigation_history.php(38): preg_match()
#2 //public_html/includes/autoload_func.php(62): navigationHistory->add_current_page()
#3 //public_html/includes/application_top.php(329): require('/...')
#4 //public_html/index.php(25): require('/...')
#5 //public_html/cgi-bin/sitemapxml.php(74): require('/...')
--> PHP Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in //public_html/includes/classes/navigation_history.php on line 38.

[22-Feb-2025 05:00:06 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id 1
#0 [internal function]: zen_debug_error_handler()
#1 //public_html/includes/init_includes/init_customer_auth.php(83): preg_match()
#2 //public_html/includes/autoload_func.php(40): require_once('/...')
#3 //public_html/includes/application_top.php(329): require('/...')
#4 //public_html/index.php(25): require('/...')
#5 //public_html/cgi-bin/sitemapxml.php(74): require('/...')
--> PHP Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in //public_html/includes/init_includes/init_customer_auth.php on line 83.

[22-Feb-2025 05:00:06 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id 1
#0 [internal function]: zen_debug_error_handler()
#1 //public_html/includes/init_includes/init_customer_auth.php(84): preg_match()
#2 //public_html/includes/autoload_func.php(40): require_once('/...')
#3 //public_html/includes/application_top.php(329): require('/...')
#4 //public_html/index.php(25): require('/...')
#5 //public_html/cgi-bin/sitemapxml.php(74): require('/...')
--> PHP Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in //public_html/includes/init_includes/init_customer_auth.php on line 84.

[22-Feb-2025 05:00:06 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id 1
#0 [internal function]: zen_debug_error_handler()
#1 //public_html/includes/init_includes/init_customer_auth.php(139): preg_match()
#2 //public_html/includes/autoload_func.php(40): require_once('/...')
#3 //public_html/includes/application_top.php(329): require('/...')
#4 //public_html/index.php(25): require('/...')
#5 //public_html/cgi-bin/sitemapxml.php(74): require('/...')
--> PHP Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in //public_html/includes/init_includes/init_customer_auth.php on line 139.

[22-Feb-2025 05:00:06 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id 1
#0 [internal function]: zen_debug_error_handler()
#1 //public_html/includes/init_includes/init_customer_auth.php(140): preg_match()
#2 //public_html/includes/autoload_func.php(40): require_once('/...')
#3 //public_html/includes/application_top.php(329): require('/...')
#4 //public_html/index.php(25): require('/...')
#5 //public_html/cgi-bin/sitemapxml.php(74): require('/...')
--> PHP Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in //public_html/includes/init_includes/init_customer_auth.php on line 140.

[22-Feb-2025 05:00:06 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id 1
#0 [internal function]: zen_debug_error_handler()
#1 //public_html/includes/functions/whos_online.php(13): preg_match()
#2 //public_html/includes/init_includes/init_special_funcs.php(18): zen_update_whos_online()
#3 //public_html/includes/autoload_func.php(40): require_once('/...')
#4 //public_html/includes/application_top.php(329): require('/...')
#5 //public_html/index.php(25): require('/...')
#6 //public_html/cgi-bin/sitemapxml.php(74): require('/...')
--> PHP Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in //public_html/includes/functions/whos_online.php on line 13.
  1. Usually I see my true ip address on the first line of each paragraph:
    "[22-Feb-2025 05:00:06 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id 1"

    Does this indicate that I have something setup wrong and that is what is causing this issue?

    OR
  2. While it appears that sitemapxml is involved in each of these issues it appears that the issue is within files outside of sitemapxml.
    It appears to be an issue with coding in each of the files pertaining to the passing of null to a parameter.
    Can I just implement the following solution, courtesy of https://www.php.cn, to each incident to correct this issue:

"The null coalescing operator (??) can be employed to provide a default value when null is encountered. For example, htmlspecialchars($something) can be modified to htmlspecialchars($something ?? ''). This ensures that an empty string is returned when null is passed."

For example:

$path = str_replace('\\', '/', dirname($_SERVER['SCRIPT_NAME']));

Could I just change this to the following in each incident?

$path = str_replace('\\', '/', dirname($_SERVER ?? ''['SCRIPT_NAME']));
25 Feb 2025, 3:47 PM
#2167
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,954
Plugin Contributions:
8

Re: SitemapXML v.2

wsworx:

...

For example:

$path = str_replace('\', '/', dirname($_SERVER['SCRIPT_NAME']));

> 
> Could I just change this to the following in each incident?
> 
> ```
$path = str_replace('\\', '/', dirname($_SERVER ?? ''['SCRIPT_NAME']));

you can do whatever you want. BUT, your code change will NOT address your issue, and you are mis-understanding the $_SERVER['SCRIPT_NAME'] var and potentially the use of the null coalescing operator.

i would look to understand why $_SERVER['SCRIPT_NAME'] is not getting set.

overriding core code, especially in the init_includes directory, is never a good idea.

best.

25 Feb 2025, 4:21 PM
#2168
neekfenwick avatar

neekfenwick

New Zenner

Join Date:
Feb 2009
Posts:
101
Plugin Contributions:
0

Re: SitemapXML v.2

wsworx:

Hi Lat9. yes its me again :D

Excuse me for sticking my oar in, I'm not even in my work environment so can't really investigate, but I note the timestamp of your logs is 6 seconds after 5am, which leads me to guess it's a cron job that's running the sitemapxml script at 5am, so your $_SERVER variables may be impacted by the environment the script was run in, differently to the usual browser invocation. I agree with @cartwhat, editing core files is unlikely to be a good idea, unless you've uncovered a genuine bug. From a cursory read of the documentation at https://www.php.net/manual/en/reserved.variables.server.php I can't see why SCRIPT_NAME would be null. Can you give us any details of the exact command line that invoked PHP to run the cgi-bin/sitemapxml.php script? Is there something funky going on with the environment? (try crontab -l | grep sitemap to see if any cron commands invoke sitemapxml, your environment may vary)

Personally, I might experiment with logging variables to a file to figure out why your variables are null, though Zen Cart has never had a decent logging framework that I've seen. I built Monolog into mine, with file and Graylog handlers.

By the way, you suggested replacing dirname($_SERVER['SCRIPT_NAME']) with dirname($_SERVER ?? ''['SCRIPT_NAME']), which would imply that $_SERVER may undefined, which is unlikely. I'd suggest dirname($_SERVER['SCRIPT_NAME'] ?? '') at the very least, as a more sensible use of the null coalescing operator ??, but still a bad idea as @cartwhat said, find the root cause of the error rather than modifying core files.

2 Mar 2025, 10:10 PM
#2169
wsworx avatar

wsworx

Zen Follower

Join Date:
Jun 2012
Location:
California
Posts:
260
Plugin Contributions:
0

Re: SitemapXML v.2

neekfenwick:

Excuse me for sticking my oar in, I'm not even in my work environment so can't really investigate, but I note the timestamp of your logs is 6 seconds after 5am, which leads me to guess it's a cron job that's running the sitemapxml script at 5am, so your $_SERVER variables may be impacted by the environment the script was run in, differently to the usual browser invocation. I agree with @cartwhat, editing core files is unlikely to be a good idea, unless you've uncovered a genuine bug. From a cursory read of the documentation at https://www.php.net/manual/en/reserved.variables.server.php I can't see why SCRIPT_NAME would be null. Can you give us any details of the exact command line that invoked PHP to run the cgi-bin/sitemapxml.php script? Is there something funky going on with the environment? (try crontab -l | grep sitemap to see if any cron commands invoke sitemapxml, your environment may vary)

Personally, I might experiment with logging variables to a file to figure out why your variables are null, though Zen Cart has never had a decent logging framework that I've seen. I built Monolog into mine, with file and Graylog handlers.

By the way, you suggested replacing dirname($_SERVER['SCRIPT_NAME']) with dirname($_SERVER ?? ''['SCRIPT_NAME']), which would imply that $_SERVER may undefined, which is unlikely. I'd suggest dirname($_SERVER['SCRIPT_NAME'] ?? '') at the very least, as a more sensible use of the null coalescing operator ??, but still a bad idea as @cartwhat said, find the root cause of the error rather than modifying core files.

Thank you both for your responses. I am not a programmer, so I am just spit balling trying to come up with a solution.
The cron job that currently runs on the BlueHost server is the same one that has been running for at least five years now without issue.
I have edited out two of the names for security, but they are correct for the site location.

php -f /******/******/public_html/cgi-bin/sitemapxml.php rebuild=yes ping=yes

I recently upgraded to ZC 2.1 which required updating several plugins e.t.c.
It was about two weeks of frustration and a lot of help from lat9 and a few others, but it got done and I was getting no debug logs finally.
The only item left on the list was the sitemapxml plugin.
After loading the 2.1 compatible version I began getting the debug and warning logs I noted earlier.
My assumption was something is wrong with the core code as I have had that same plugin running for a long time without issue in previous versions of ZC.

4 Mar 2025, 4:25 PM
#2170
yesaul avatar

yesaul

New Zenner

Join Date:
Apr 2011
Location:
Espoo, Finland
Posts:
71
Plugin Contributions:
0

Re: SitemapXML v.2

Good day,

May I make some code upgrade suggestion?

If do not want manufacturers with no active products to be listed in "sitemap/sitemapmanufacturers.xml" file, please add the following code:

// to exclude manufacturers with no active products
$products = $db->Execute("SELECT products_id 
                               FROM " . TABLE_PRODUCTS . " 
                               WHERE manufacturers_id='" . (int)$next_manufacturer['manufacturers_id'] . "' 
                               AND products_status=1");
if (sizeof($products) < 1) continue;
// 

to "includes\modules\pages\sitemapxml\sitemapxml_manufacturers.php" before line #43 ("$sitemapXML->writeItem(...")

Regards,

4 Mar 2025, 4:57 PM
#2171
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: SitemapXML v.2

yesaul:

Good day,

May I make some code upgrade suggestion?

If do not want manufacturers with no active products to be listed in "sitemap/sitemapmanufacturers.xml" file, please add the following code:

// to exclude manufacturers with no active products
$products = $db->Execute("SELECT products_id
FROM " . TABLE_PRODUCTS . "
WHERE manufacturers_id='" . (int)$next_manufacturer['manufacturers_id'] . "'
AND products_status=1");
if (sizeof($products) < 1) continue;
//

> 
> to "*includes\modules\pages\sitemapxml\sitemapxml_manufacturers.php*" before line #43 ("$sitemapXML->writeItem(...")
> 
> Regards,
Good idea.  I've created a GitHub issue to track the requested change: <https://github.com/lat9/sitemapxml/issues/51>
4 Mar 2025, 7:07 PM
#2172
yesaul avatar

yesaul

New Zenner

Join Date:
Apr 2011
Location:
Espoo, Finland
Posts:
71
Plugin Contributions:
0

Re: SitemapXML v.2

File "includes\modules\pages\sitemapxml\sitemapxml_boxnews.php", line #13:

if ($sitemapXML->dbTableExist('TABLE_BOX_NEWS') === false || $sitemapXML->dbTableExist('TABLE_BOX_NEWS_CONTENT') === false)

Why table names are put in quotes ?? This will always be returned as False, if I am not mistaken? :-)

(also the same in all another calls of dbTableExist method)

4 Mar 2025, 7:35 PM
#2173
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: SitemapXML v.2

yesaul:

File "includes\modules\pages\sitemapxml\sitemapxml_boxnews.php", line #13:

if ($sitemapXML->dbTableExist('TABLE_BOX_NEWS') === false || $sitemapXML->dbTableExist('TABLE_BOX_NEWS_CONTENT') === false)

> 
> Why table names are put in quotes ?? This will always be returned as *False*, if I am not mistaken? :-)
> 
> (also the same in all another calls of *dbTableExist* method)
Another good find!  I'll get that noted in GitHub as well.

GitHub issue: <https://github.com/lat9/sitemapxml/issues/52>
4 Mar 2025, 7:58 PM
#2174
yesaul avatar

yesaul

New Zenner

Join Date:
Apr 2011
Location:
Espoo, Finland
Posts:
71
Plugin Contributions:
0

Re: SitemapXML v.2

Do TABLE_HIDE_CATEGORIES and TABLE_TESTIMONIALS_MANAGER probably are coming from some another addon module?

They are not defined here (and no error occurs only as they are in the quotes by calling dbTableExist method (which obediently returns False))

4 Mar 2025, 8:01 PM
#2175
wsworx avatar

wsworx

Zen Follower

Join Date:
Jun 2012
Location:
California
Posts:
260
Plugin Contributions:
0

Re: SitemapXML v.2

ZC 2.1
PHP 8.3
customer_tax_exempt_2.0.2
edit_orders-5.0.0
sitemapxml-4.0.3
usps-USPS_2024_08_25_K11l
zen_Image-Handler-5.3.5
zen_TyPackageTracker-5.0.0

I have completely deleted sitemapxml-4.0.3 and installed it again but I cannot figure out these two debug logs.
It is the cron job on the Bluehost server for the sitemapxml that is initiating these logs.
This same cron job has run for years without issue prior to the ZC 2.1 and plugin upgrades that were just recently done.
I am assuming it is the issue with the Request URI not being set and the I.P. address being wrong, but I have no idea why this is occurring.

Any assistance would be greatly appreciated.

[04-Mar-2025 05:00:05 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id not set
#0 [internal function]: zen_debug_error_handler()
#1 ///public_html/includes/init_includes/init_sessions.php(36): dirname()
#2 ///public_html/includes/autoload_func.php(40): require_once('//...')
#3 ///public_html/includes/application_top.php(329): require('//...')
#4 ///public_html/index.php(25): require('//...')
#5 ///public_html/cgi-bin/sitemapxml.php(74): require('//...')
--> PHP Deprecated: dirname(): Passing null to parameter #1 ($path) of type string is deprecated in ///public_html/includes/init_includes/init_sessions.php on line 36.

[04-Mar-2025 05:00:05 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id 1
#0 [internal function]: zen_debug_error_handler()
#1 ///public_html/includes/classes/navigation_history.php(38): preg_match()
#2 ///public_html/includes/autoload_func.php(62): navigationHistory->add_current_page()
#3 ///public_html/includes/application_top.php(329): require('//...')
#4 ///public_html/index.php(25): require('//...')
#5 ///public_html/cgi-bin/sitemapxml.php(74): require('//...')
--> PHP Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in ///public_html/includes/classes/navigation_history.php on line 38.

[04-Mar-2025 05:00:05 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id 1
#0 [internal function]: zen_debug_error_handler()
#1 ///public_html/includes/init_includes/init_customer_auth.php(83): preg_match()
#2 ///public_html/includes/autoload_func.php(40): require_once('//...')
#3 ///public_html/includes/application_top.php(329): require('//...')
#4 ///public_html/index.php(25): require('//...')
#5 ///public_html/cgi-bin/sitemapxml.php(74): require('//...')
--> PHP Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in ///public_html/includes/init_includes/init_customer_auth.php on line 83.

[04-Mar-2025 05:00:05 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id 1
#0 [internal function]: zen_debug_error_handler()
#1 ///public_html/includes/init_includes/init_customer_auth.php(84): preg_match()
#2 ///public_html/includes/autoload_func.php(40): require_once('//...')
#3 ///public_html/includes/application_top.php(329): require('//...')
#4 ///public_html/index.php(25): require('//...')
#5 ///public_html/cgi-bin/sitemapxml.php(74): require('//...')
--> PHP Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in ///public_html/includes/init_includes/init_customer_auth.php on line 84.

[04-Mar-2025 05:00:05 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id 1
#0 [internal function]: zen_debug_error_handler()
#1 ///public_html/includes/init_includes/init_customer_auth.php(139): preg_match()
#2 ///public_html/includes/autoload_func.php(40): require_once('//...')
#3 ///public_html/includes/application_top.php(329): require('//...')
#4 ///public_html/index.php(25): require('//...')
#5 ///public_html/cgi-bin/sitemapxml.php(74): require('//...')
--> PHP Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in ///public_html/includes/init_includes/init_customer_auth.php on line 139.

[04-Mar-2025 05:00:05 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id 1
#0 [internal function]: zen_debug_error_handler()
#1 ///public_html/includes/init_includes/init_customer_auth.php(140): preg_match()
#2 ///public_html/includes/autoload_func.php(40): require_once('//...')
#3 ///public_html/includes/application_top.php(329): require('//...')
#4 ///public_html/index.php(25): require('//...')
#5 ///public_html/cgi-bin/sitemapxml.php(74): require('//...')
--> PHP Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in ///public_html/includes/init_includes/init_customer_auth.php on line 140.

[04-Mar-2025 05:00:05 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id 1
#0 [internal function]: zen_debug_error_handler()
#1 ///public_html/includes/functions/whos_online.php(13): preg_match()
#2 ///public_html/includes/init_includes/init_special_funcs.php(18): zen_update_whos_online()
#3 ///public_html/includes/autoload_func.php(40): require_once('//...')
#4 ///public_html/includes/application_top.php(329): require('//...')
#5 ///public_html/index.php(25): require('//...')
#6 ///public_html/cgi-bin/sitemapxml.php(74): require('//...')
--> PHP Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in ///public_html/includes/functions/whos_online.php on line 13.
[04-Mar-2025 05:00:05 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id not set
#0 ///public_html/includes/init_includes/init_file_db_names.php(32): zen_debug_error_handler()
#1 ///public_html/includes/application_top.php(292): require('//...')
#2 ///public_html/index.php(25): require('//...')
#3 ///public_html/cgi-bin/sitemapxml.php(74): require('//...')
--> PHP Warning: Undefined array key "SCRIPT_NAME" in ///public_html/includes/init_includes/init_file_db_names.php on line 32.

[04-Mar-2025 05:00:05 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id not set
#0 [internal function]: zen_debug_error_handler()
#1 ///public_html/includes/functions/sessions.php(35): session_set_save_handler()
#2 ///public_html/includes/init_includes/init_sessions.php(25): require('//...')
#3 ///public_html/includes/autoload_func.php(40): require_once('//...')
#4 ///public_html/includes/application_top.php(329): require('//...')
#5 ///public_html/index.php(25): require('//...')
#6 ///public_html/cgi-bin/sitemapxml.php(74): require('//...')
--> PHP Warning: session_set_save_handler(): Session save handler cannot be changed after headers have already been sent in ///public_html/includes/functions/sessions.php on line 35.

[04-Mar-2025 05:00:05 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id not set
#0 [internal function]: zen_debug_error_handler()
#1 ///public_html/includes/functions/sessions.php(74): session_name()
#2 ///public_html/includes/init_includes/init_sessions.php(30): zen_session_name()
#3 ///public_html/includes/autoload_func.php(40): require_once('//...')
#4 ///public_html/includes/application_top.php(329): require('//...')
#5 ///public_html/index.php(25): require('//...')
#6 ///public_html/cgi-bin/sitemapxml.php(74): require('//...')
--> PHP Warning: session_name(): Session name cannot be changed after headers have already been sent in ///public_html/includes/functions/sessions.php on line 74.

[04-Mar-2025 05:00:05 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id not set
#0 [internal function]: zen_debug_error_handler()
#1 ///public_html/includes/functions/sessions.php(95): session_save_path()
#2 ///public_html/includes/init_includes/init_sessions.php(31): zen_session_save_path()
#3 ///public_html/includes/autoload_func.php(40): require_once('//...')
#4 ///public_html/includes/application_top.php(329): require('//...')
#5 ///public_html/index.php(25): require('//...')
#6 ///public_html/cgi-bin/sitemapxml.php(74): require('//...')
--> PHP Warning: session_save_path(): Session save path cannot be changed after headers have already been sent in ///public_html/includes/functions/sessions.php on line 95.

[04-Mar-2025 05:00:05 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id not set
#0 ///public_html/includes/init_includes/init_sessions.php(36): zen_debug_error_handler()
#1 ///public_html/includes/autoload_func.php(40): require_once('//...')
#2 ///public_html/includes/application_top.php(329): require('//...')
#3 ///public_html/index.php(25): require('//...')
#4 ///public_html/cgi-bin/sitemapxml.php(74): require('//...')
--> PHP Warning: Undefined array key "SCRIPT_NAME" in ///public_html/includes/init_includes/init_sessions.php on line 36.

[04-Mar-2025 05:00:05 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id not set
#0 [internal function]: zen_debug_error_handler()
#1 ///public_html/includes/init_includes/init_sessions.php(51): session_set_cookie_params()
#2 ///public_html/includes/autoload_func.php(40): require_once('//...')
#3 ///public_html/includes/application_top.php(329): require('//...')
#4 ///public_html/index.php(25): require('//...')
#5 ///public_html/cgi-bin/sitemapxml.php(74): require('//...')
--> PHP Warning: session_set_cookie_params(): Session cookie parameters cannot be changed after headers have already been sent in ///public_html/includes/init_includes/init_sessions.php on line 51.

[04-Mar-2025 05:00:05 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id not set
#0 [internal function]: zen_debug_error_handler()
#1 ///public_html/includes/functions/sessions.php(48): session_start()
#2 ///public_html/includes/init_includes/init_sessions.php(106): zen_session_start()
#3 ///public_html/includes/autoload_func.php(40): require_once('//...')
#4 ///public_html/includes/application_top.php(329): require('//...')
#5 ///public_html/index.php(25): require('//...')
#6 ///public_html/cgi-bin/sitemapxml.php(74): require('//...')
--> PHP Warning: session_start(): Session cannot be started after headers have already been sent in ///public_html/includes/functions/sessions.php on line 48.

[04-Mar-2025 05:00:05 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id 1
#0 ///public_html/includes/classes/navigation_history.php(38): zen_debug_error_handler()
#1 ///public_html/includes/autoload_func.php(62): navigationHistory->add_current_page()
#2 ///public_html/includes/application_top.php(329): require('//...')
#3 ///public_html/index.php(25): require('//...')
#4 ///public_html/cgi-bin/sitemapxml.php(74): require('//...')
--> PHP Warning: Undefined array key "SCRIPT_NAME" in ///public_html/includes/classes/navigation_history.php on line 38.

[04-Mar-2025 05:00:05 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id 1
#0 ///public_html/includes/init_includes/init_customer_auth.php(83): zen_debug_error_handler()
#1 ///public_html/includes/autoload_func.php(40): require_once('//...')
#2 ///public_html/includes/application_top.php(329): require('//...')
#3 ///public_html/index.php(25): require('//...')
#4 ///public_html/cgi-bin/sitemapxml.php(74): require('//...')
--> PHP Warning: Undefined array key "SCRIPT_NAME" in ///public_html/includes/init_includes/init_customer_auth.php on line 83.

[04-Mar-2025 05:00:05 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id 1
#0 ///public_html/includes/init_includes/init_customer_auth.php(84): zen_debug_error_handler()
#1 ///public_html/includes/autoload_func.php(40): require_once('//...')
#2 ///public_html/includes/application_top.php(329): require('//...')
#3 ///public_html/index.php(25): require('//...')
#4 ///public_html/cgi-bin/sitemapxml.php(74): require('//...')
--> PHP Warning: Undefined array key "SCRIPT_NAME" in ///public_html/includes/init_includes/init_customer_auth.php on line 84.

[04-Mar-2025 05:00:05 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id 1
#0 ///public_html/includes/init_includes/init_customer_auth.php(139): zen_debug_error_handler()
#1 ///public_html/includes/autoload_func.php(40): require_once('//...')
#2 ///public_html/includes/application_top.php(329): require('//...')
#3 ///public_html/index.php(25): require('//...')
#4 ///public_html/cgi-bin/sitemapxml.php(74): require('//...')
--> PHP Warning: Undefined array key "SCRIPT_NAME" in ///public_html/includes/init_includes/init_customer_auth.php on line 139.

[04-Mar-2025 05:00:05 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id 1
#0 ///public_html/includes/init_includes/init_customer_auth.php(140): zen_debug_error_handler()
#1 ///public_html/includes/autoload_func.php(40): require_once('//...')
#2 ///public_html/includes/application_top.php(329): require('//...')
#3 ///public_html/index.php(25): require('//...')
#4 ///public_html/cgi-bin/sitemapxml.php(74): require('//...')
--> PHP Warning: Undefined array key "SCRIPT_NAME" in ///public_html/includes/init_includes/init_customer_auth.php on line 140.

[04-Mar-2025 05:00:05 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id 1
#0 ///public_html/includes/functions/whos_online.php(13): zen_debug_error_handler()
#1 ///public_html/includes/init_includes/init_special_funcs.php(18): zen_update_whos_online()
#2 ///public_html/includes/autoload_func.php(40): require_once('//...')
#3 ///public_html/includes/application_top.php(329): require('//...')
#4 ///public_html/index.php(25): require('//...')
#5 ///public_html/cgi-bin/sitemapxml.php(74): require('//...')
--> PHP Warning: Undefined array key "SCRIPT_NAME" in ///public_html/includes/functions/whos_online.php on line 13.

[04-Mar-2025 05:00:05 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id 1
#0 ///public_html/includes/functions/whos_online.php(41): zen_debug_error_handler()
#1 ///public_html/includes/init_includes/init_special_funcs.php(18): zen_update_whos_online()
#2 ///public_html/includes/autoload_func.php(40): require_once('//...')
#3 ///public_html/includes/application_top.php(329): require('//...')
#4 ///public_html/index.php(25): require('//...')
#5 ///public_html/cgi-bin/sitemapxml.php(74): require('//...')
--> PHP Warning: Undefined array key "SCRIPT_NAME" in ///public_html/includes/functions/whos_online.php on line 41.
4 Mar 2025, 10:12 PM
#2176
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: SitemapXML v.2

yesaul:

Do TABLE_HIDE_CATEGORIES and TABLE_TESTIMONIALS_MANAGER probably are coming from some another addon module?

They are not defined here (and no error occurs only as they are in the quotes by calling dbTableExist method (which obediently returns False))
In a word: Yes!

4 Mar 2025, 10:15 PM
#2177
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: SitemapXML v.2

wsworx:

ZC 2.1
PHP 8.3
customer_tax_exempt_2.0.2
edit_orders-5.0.0
sitemapxml-4.0.3
usps-USPS_2024_08_25_K11l
zen_Image-Handler-5.3.5
zen_TyPackageTracker-5.0.0

I have completely deleted sitemapxml-4.0.3 and installed it again but I cannot figure out these two debug logs.
It is the cron job on the Bluehost server for the sitemapxml that is initiating these logs.
This same cron job has run for years without issue prior to the ZC 2.1 and plugin upgrades that were just recently done.
I am assuming it is the issue with the Request URI not being set and the I.P. address being wrong, but I have no idea why this is occurring.

Any assistance would be greatly appreciated.

[04-Mar-2025 05:00:05 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id not set
#0 [internal function]: zen_debug_error_handler()
#1 ///public_html/includes/init_includes/init_sessions.php(36): dirname()
#2 ///public_html/includes/autoload_func.php(40): require_once('//...')
#3 ///public_html/includes/application_top.php(329): require('//...')
#4 ///public_html/index.php(25): require('//...')
#5 ///public_html/cgi-bin/sitemapxml.php(74): require('//...')
--> PHP Deprecated: dirname(): Passing null to parameter #1 ($path) of type string is deprecated in ///public_html/includes/init_includes/init_sessions.php on line 36.

[04-Mar-2025 05:00:05 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id 1
#0 [internal function]: zen_debug_error_handler()
#1 ///public_html/includes/classes/navigation_history.php(38): preg_match()
#2 ///public_html/includes/autoload_func.php(62): navigationHistory->add_current_page()
#3 ///public_html/includes/application_top.php(329): require('//...')
#4 ///public_html/index.php(25): require('//...')
#5 ///public_html/cgi-bin/sitemapxml.php(74): require('//...')
--> PHP Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in ///public_html/includes/classes/navigation_history.php on line 38.

[04-Mar-2025 05:00:05 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id 1
#0 [internal function]: zen_debug_error_handler()
#1 ///public_html/includes/init_includes/init_customer_auth.php(83): preg_match()
#2 ///public_html/includes/autoload_func.php(40): require_once('//...')
#3 ///public_html/includes/application_top.php(329): require('//...')
#4 ///public_html/index.php(25): require('//...')
#5 ///public_html/cgi-bin/sitemapxml.php(74): require('//...')
--> PHP Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in ///public_html/includes/init_includes/init_customer_auth.php on line 83.

[04-Mar-2025 05:00:05 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id 1
#0 [internal function]: zen_debug_error_handler()
#1 ///public_html/includes/init_includes/init_customer_auth.php(84): preg_match()
#2 ///public_html/includes/autoload_func.php(40): require_once('//...')
#3 ///public_html/includes/application_top.php(329): require('//...')
#4 ///public_html/index.php(25): require('//...')
#5 ///public_html/cgi-bin/sitemapxml.php(74): require('//...')
--> PHP Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in ///public_html/includes/init_includes/init_customer_auth.php on line 84.

[04-Mar-2025 05:00:05 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id 1
#0 [internal function]: zen_debug_error_handler()
#1 ///public_html/includes/init_includes/init_customer_auth.php(139): preg_match()
#2 ///public_html/includes/autoload_func.php(40): require_once('//...')
#3 ///public_html/includes/application_top.php(329): require('//...')
#4 ///public_html/index.php(25): require('//...')
#5 ///public_html/cgi-bin/sitemapxml.php(74): require('//...')
--> PHP Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in ///public_html/includes/init_includes/init_customer_auth.php on line 139.

[04-Mar-2025 05:00:05 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id 1
#0 [internal function]: zen_debug_error_handler()
#1 ///public_html/includes/init_includes/init_customer_auth.php(140): preg_match()
#2 ///public_html/includes/autoload_func.php(40): require_once('//...')
#3 ///public_html/includes/application_top.php(329): require('//...')
#4 ///public_html/index.php(25): require('//...')
#5 ///public_html/cgi-bin/sitemapxml.php(74): require('//...')
--> PHP Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in ///public_html/includes/init_includes/init_customer_auth.php on line 140.

[04-Mar-2025 05:00:05 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id 1
#0 [internal function]: zen_debug_error_handler()
#1 ///public_html/includes/functions/whos_online.php(13): preg_match()
#2 ///public_html/includes/init_includes/init_special_funcs.php(18): zen_update_whos_online()
#3 ///public_html/includes/autoload_func.php(40): require_once('//...')
#4 ///public_html/includes/application_top.php(329): require('//...')
#5 ///public_html/index.php(25): require('//...')
#6 ///public_html/cgi-bin/sitemapxml.php(74): require('//...')
--> PHP Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in ///public_html/includes/functions/whos_online.php on line 13.

> 
> ```
[04-Mar-2025 05:00:05 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id not set
#0 ///public_html/includes/init_includes/init_file_db_names.php(32): zen_debug_error_handler()
#1 ///public_html/includes/application_top.php(292): require('//...')
#2 ///public_html/index.php(25): require('//...')
#3 ///public_html/cgi-bin/sitemapxml.php(74): require('//...')
--> PHP Warning: Undefined array key "SCRIPT_NAME" in ///public_html/includes/init_includes/init_file_db_names.php on line 32.

[04-Mar-2025 05:00:05 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id not set
#0 [internal function]: zen_debug_error_handler()
#1 ///public_html/includes/functions/sessions.php(35): session_set_save_handler()
#2 ///public_html/includes/init_includes/init_sessions.php(25): require('//...')
#3 ///public_html/includes/autoload_func.php(40): require_once('//...')
#4 ///public_html/includes/application_top.php(329): require('//...')
#5 ///public_html/index.php(25): require('//...')
#6 ///public_html/cgi-bin/sitemapxml.php(74): require('//...')
--> PHP Warning: session_set_save_handler(): Session save handler cannot be changed after headers have already been sent in ///public_html/includes/functions/sessions.php on line 35.

[04-Mar-2025 05:00:05 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id not set
#0 [internal function]: zen_debug_error_handler()
#1 ///public_html/includes/functions/sessions.php(74): session_name()
#2 ///public_html/includes/init_includes/init_sessions.php(30): zen_session_name()
#3 ///public_html/includes/autoload_func.php(40): require_once('//...')
#4 ///public_html/includes/application_top.php(329): require('//...')
#5 ///public_html/index.php(25): require('//...')
#6 ///public_html/cgi-bin/sitemapxml.php(74): require('//...')
--> PHP Warning: session_name(): Session name cannot be changed after headers have already been sent in ///public_html/includes/functions/sessions.php on line 74.

[04-Mar-2025 05:00:05 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id not set
#0 [internal function]: zen_debug_error_handler()
#1 ///public_html/includes/functions/sessions.php(95): session_save_path()
#2 ///public_html/includes/init_includes/init_sessions.php(31): zen_session_save_path()
#3 ///public_html/includes/autoload_func.php(40): require_once('//...')
#4 ///public_html/includes/application_top.php(329): require('//...')
#5 ///public_html/index.php(25): require('//...')
#6 ///public_html/cgi-bin/sitemapxml.php(74): require('//...')
--> PHP Warning: session_save_path(): Session save path cannot be changed after headers have already been sent in ///public_html/includes/functions/sessions.php on line 95.

[04-Mar-2025 05:00:05 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id not set
#0 ///public_html/includes/init_includes/init_sessions.php(36): zen_debug_error_handler()
#1 ///public_html/includes/autoload_func.php(40): require_once('//...')
#2 ///public_html/includes/application_top.php(329): require('//...')
#3 ///public_html/index.php(25): require('//...')
#4 ///public_html/cgi-bin/sitemapxml.php(74): require('//...')
--> PHP Warning: Undefined array key "SCRIPT_NAME" in ///public_html/includes/init_includes/init_sessions.php on line 36.

[04-Mar-2025 05:00:05 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id not set
#0 [internal function]: zen_debug_error_handler()
#1 ///public_html/includes/init_includes/init_sessions.php(51): session_set_cookie_params()
#2 ///public_html/includes/autoload_func.php(40): require_once('//...')
#3 ///public_html/includes/application_top.php(329): require('//...')
#4 ///public_html/index.php(25): require('//...')
#5 ///public_html/cgi-bin/sitemapxml.php(74): require('//...')
--> PHP Warning: session_set_cookie_params(): Session cookie parameters cannot be changed after headers have already been sent in ///public_html/includes/init_includes/init_sessions.php on line 51.

[04-Mar-2025 05:00:05 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id not set
#0 [internal function]: zen_debug_error_handler()
#1 ///public_html/includes/functions/sessions.php(48): session_start()
#2 ///public_html/includes/init_includes/init_sessions.php(106): zen_session_start()
#3 ///public_html/includes/autoload_func.php(40): require_once('//...')
#4 ///public_html/includes/application_top.php(329): require('//...')
#5 ///public_html/index.php(25): require('//...')
#6 ///public_html/cgi-bin/sitemapxml.php(74): require('//...')
--> PHP Warning: session_start(): Session cannot be started after headers have already been sent in ///public_html/includes/functions/sessions.php on line 48.

[04-Mar-2025 05:00:05 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id 1
#0 ///public_html/includes/classes/navigation_history.php(38): zen_debug_error_handler()
#1 ///public_html/includes/autoload_func.php(62): navigationHistory->add_current_page()
#2 ///public_html/includes/application_top.php(329): require('//...')
#3 ///public_html/index.php(25): require('//...')
#4 ///public_html/cgi-bin/sitemapxml.php(74): require('//...')
--> PHP Warning: Undefined array key "SCRIPT_NAME" in ///public_html/includes/classes/navigation_history.php on line 38.

[04-Mar-2025 05:00:05 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id 1
#0 ///public_html/includes/init_includes/init_customer_auth.php(83): zen_debug_error_handler()
#1 ///public_html/includes/autoload_func.php(40): require_once('//...')
#2 ///public_html/includes/application_top.php(329): require('//...')
#3 ///public_html/index.php(25): require('//...')
#4 ///public_html/cgi-bin/sitemapxml.php(74): require('//...')
--> PHP Warning: Undefined array key "SCRIPT_NAME" in ///public_html/includes/init_includes/init_customer_auth.php on line 83.

[04-Mar-2025 05:00:05 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id 1
#0 ///public_html/includes/init_includes/init_customer_auth.php(84): zen_debug_error_handler()
#1 ///public_html/includes/autoload_func.php(40): require_once('//...')
#2 ///public_html/includes/application_top.php(329): require('//...')
#3 ///public_html/index.php(25): require('//...')
#4 ///public_html/cgi-bin/sitemapxml.php(74): require('//...')
--> PHP Warning: Undefined array key "SCRIPT_NAME" in ///public_html/includes/init_includes/init_customer_auth.php on line 84.

[04-Mar-2025 05:00:05 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id 1
#0 ///public_html/includes/init_includes/init_customer_auth.php(139): zen_debug_error_handler()
#1 ///public_html/includes/autoload_func.php(40): require_once('//...')
#2 ///public_html/includes/application_top.php(329): require('//...')
#3 ///public_html/index.php(25): require('//...')
#4 ///public_html/cgi-bin/sitemapxml.php(74): require('//...')
--> PHP Warning: Undefined array key "SCRIPT_NAME" in ///public_html/includes/init_includes/init_customer_auth.php on line 139.

[04-Mar-2025 05:00:05 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id 1
#0 ///public_html/includes/init_includes/init_customer_auth.php(140): zen_debug_error_handler()
#1 ///public_html/includes/autoload_func.php(40): require_once('//...')
#2 ///public_html/includes/application_top.php(329): require('//...')
#3 ///public_html/index.php(25): require('//...')
#4 ///public_html/cgi-bin/sitemapxml.php(74): require('//...')
--> PHP Warning: Undefined array key "SCRIPT_NAME" in ///public_html/includes/init_includes/init_customer_auth.php on line 140.

[04-Mar-2025 05:00:05 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id 1
#0 ///public_html/includes/functions/whos_online.php(13): zen_debug_error_handler()
#1 ///public_html/includes/init_includes/init_special_funcs.php(18): zen_update_whos_online()
#2 ///public_html/includes/autoload_func.php(40): require_once('//...')
#3 ///public_html/includes/application_top.php(329): require('//...')
#4 ///public_html/index.php(25): require('//...')
#5 ///public_html/cgi-bin/sitemapxml.php(74): require('//...')
--> PHP Warning: Undefined array key "SCRIPT_NAME" in ///public_html/includes/functions/whos_online.php on line 13.

[04-Mar-2025 05:00:05 America/Boise] Request URI: not set, IP address: 127.0.0.1, Language id 1
#0 ///public_html/includes/functions/whos_online.php(41): zen_debug_error_handler()
#1 ///public_html/includes/init_includes/init_special_funcs.php(18): zen_update_whos_online()
#2 ///public_html/includes/autoload_func.php(40): require_once('//...')
#3 ///public_html/includes/application_top.php(329): require('//...')
#4 ///public_html/index.php(25): require('//...')
#5 ///public_html/cgi-bin/sitemapxml.php(74): require('//...')
--> PHP Warning: Undefined array key "SCRIPT_NAME" in ///public_html/includes/functions/whos_online.php on line 41.

Are there other cron-jobs configured that don't throw these errors?

4 Mar 2025, 11:57 PM
#2178
wsworx avatar

wsworx

Zen Follower

Join Date:
Jun 2012
Location:
California
Posts:
260
Plugin Contributions:
0

Re: SitemapXML v.2

lat9:

Are there other cron-jobs configured that don't throw these errors?

Hi lat9

No, I only have the one cron job running.
The only difference I see now between the previous cron job setup and the way the new landing page for Sitemap XML indicates wording is listed below:

Current Cron job:

0 5 * * * php -f <path to shop>/cgi-bin/sitemapxml.php rebuild=yes ping=yes

New sitemap example:

0 5 * * * php -f <path to shop>/cgi-bin/sitemapxml.php rebuild=yes

I will correct that, but it doesn't seem like just removing the "ping" statement is going to help this situation.

5 Mar 2025, 1:28 PM
#2179
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: SitemapXML v.2

wsworx:

Hi lat9

No, I only have the one cron job running.
The only difference I see now between the previous cron job setup and the way the new landing page for Sitemap XML indicates wording is listed below:

Current Cron job:

0 5 * * * php -f <path to shop>/cgi-bin/sitemapxml.php rebuild=yes ping=yes

> 
> New sitemap example:
> ```
0 5 * * * php -f <path to shop>/cgi-bin/sitemapxml.php rebuild=yes

I will correct that, but it doesn't seem like just removing the "ping" statement is going to help this situation.
I agree; it's something to do with using the php form of invocation for the cron-job. Try the following instead:

GET 'https://your_domain/index.php?main_page=sitemapxml&rebuild=yes'

5 Mar 2025, 2:54 PM
#2180
yesaul avatar

yesaul

New Zenner

Join Date:
Apr 2011
Location:
Espoo, Finland
Posts:
71
Plugin Contributions:
0

Re: SitemapXML v.2

Hello, another one short notice...

As in "box_news" table all datetime columns (not only 'news_modified_date') can be NULL, it would be wise to use IFNULL function also for checking 'news_published_date' column in sql-queries in includes\modules\pages\sitemapxml\sitemapxml_boxnews.php file:

echo '<h3>' . TEXT_HEAD_BOXNEWS . '</h3>';
$last_date = $db->Execute(
    "SELECT MAX(GREATEST(n.news_added_date, IFNULL(n.news_modified_date, '0001-01-01 00:00:00'), IFNULL(n.news_published_date, '0001-01-01 00:00:00'))) AS last_date
       FROM " . TABLE_BOX_NEWS . " n
      WHERE n.news_status = 1
        AND NOW() BETWEEN n.news_start_date AND n.news_end_date"
);
$table_status = $db->Execute("SHOW TABLE STATUS LIKE '" . TABLE_BOX_NEWS . "'");
$last_date = max($table_status->fields['Update_time'], $last_date->fields['last_date']);
if ($sitemapXML->SitemapOpen('boxnews', $last_date)) {
    $news = $db->Execute(
        "SELECT n.box_news_id, GREATEST(n.news_added_date, IFNULL(n.news_modified_date, '0001-01-01 00:00:00'), IFNULL(n.news_published_date, '0001-01-01 00:00:00')) AS last_date, nc.languages_id AS language_id
           FROM " . TABLE_BOX_NEWS . " n
                INNER JOIN " . TABLE_BOX_NEWS_CONTENT . " nc
                    ON n.box_news_id = nc.box_news_id
                   AND nc.languages_id IN (" . $sitemapXML->getLanguagesIDs() . ")
                   AND nc.news_title != ''
          WHERE n.news_status = 1
            AND NOW() BETWEEN n.news_start_date AND n.news_end_date" .
          (SITEMAPXML_BOXNEWS_ORDERBY !== '' ? ' ORDER BY ' . SITEMAPXML_BOXNEWS_ORDERBY : '')
    );
    $sitemapXML->SitemapSetMaxItems($news->RecordCount());
    foreach ($news as $next_item) { 
        $sitemapXML->writeItem(FILENAME_MORE_NEWS, 'news_id=' . $next_item['box_news_id'], $next_item['language_id'], $next_item['last_date'], SITEMAPXML_BOXNEWS_CHANGEFREQ);
    }

    $sitemapXML->SitemapClose();
    unset($news);
}

This will help to avoid PHP-warnings by passing NULL as parameter

As "box_news" table is an 'external' table for this addon (created in another module), no additional verification can be excessive, I think