• Resolved isarisar

    (@isarisar)


    Hi,

    looks like there’s two erroneous variable uses, followed by wpdb throwing notices:

    PHP Warning:  Undefined variable $frontPageId in /srv/wp-content/plugins/www-xml-sitemap-generator-org/code/providers/archiveProvider.php on line 41
    PHP Warning:  Undefined variable $offset in /srv/wp-content/plugins/www-xml-sitemap-generator-org/code/providers/archiveProvider.php on line 41
    PHP Notice:  wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. in /srv/wp-includes/functions.php on line 5768
    PHP Notice:  wpdb::prepare was called incorrectly. The query does not contain the correct number of placeholders (0) for the number of arguments passed (4). in /srv/wp-includes/functions.php on line 5768

    XSGfG 2.0.3
    WC 6.3.1
    WP 5.9.2
    PHP 8.0.17

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author xmlsitemapgenerator

    (@xmlsitemapgenerator)

    Thanks. I will investigate shortly. I’m working on 2.0.4 and will add these to the list.

    There is already a version of 2.0.4 published (not stable) but I suspect these are still issues, I’ll aim to push an updated version in the next day or two and get back to you.

    Thread Starter isarisar

    (@isarisar)

    Seems like an oversight from C&Ping the SQL (query & its) $wpdb call? The same issue is also in code/providers/authorsProvider.php.

    Not much to fix but simply omit the two faulty prepare($sql, …) altogether?

    Seems prepare has a PHP8 safeguard that currently causes it to instead just return an empty string, in so trashing the entire query.

    • This reply was modified 2 years, 11 months ago by isarisar.
    Thread Starter isarisar

    (@isarisar)

    … straight into the next warning:

    PHP Warning: Undefined variable $temp in /srv/wp-content/plugins/www-xml-sitemap-generator-org/code/providers/postsProvider.php on line 153

    also present in code/providers/ZZZ__postsProvider.php

    Doesn’t seem like $temp is ever used anywhere?

    (Minor typo in the variable name $exlcude.)

    Plugin Author xmlsitemapgenerator

    (@xmlsitemapgenerator)

    Thanks for all the info and sorry for the delay.

    I’ve worked through these and just committed updates to the 2.0.4 tag. I’m still in the process of testing the updates but if you were able to help that would be much appreciated.

    It’s not safe for production, but if you go to the advanced view and previous version you can download 2.0.4 :
    https://www.ads-software.com/plugins/www-xml-sitemap-generator-org/advanced/

    Plugin Author xmlsitemapgenerator

    (@xmlsitemapgenerator)

    I believe I have eliminated all of these warnings now.
    I have pushed version 2.0.4.
    Let me know if you have any further issues.
    Thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘PHP Warnings: Undefined variables’ is closed to new replies.