If this is your first visit, check our documentation. To post, register or login.
Forums / Business Issues / Search Engines / Unsupported HTML tags [description]

Unsupported HTML tags [description]

Started by lloyd_borrett on 28 Oct 2018, 7:34 PM · Views: 137

Results 1 to 14 of 14
28 Oct 2018, 7:34 PM
#1
lloyd_borrett avatar

lloyd_borrett

Zen Follower

Join Date:
Mar 2006
Location:
Rosebud, Victoria, Australia
Posts:
308
Plugin Contributions:
2

Unsupported HTML tags [description]

It seems the rules for the description field in the Google Merchant Centre Product Search Feed have been changed recently by Google. I'm suddenly getting warnings from Google that I need to remove any unsupported HTML tags from the rich text attribute values.

In my case it mostly seems I have & instead of ```
&



It might be nice if Zen Cart could check and warn about such things when creating, editing and saving descriptions.

Zen Cart 1.5.5e, PHP 5.3.29 MySQL 5.5.42

28 Oct 2018, 7:58 PM
#2
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,760
Plugin Contributions:
56

Re: Unsupported HTML tags [description]

You should be running htmlentities on your descriptions during your export.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

29 Oct 2018, 1:15 PM
#3
lloyd_borrett avatar

lloyd_borrett

Zen Follower

Join Date:
Mar 2006
Location:
Rosebud, Victoria, Australia
Posts:
308
Plugin Contributions:
2

Re: Unsupported HTML tags [description]

It would seem the Numinix Google Product Search Feeder add-on being used doesn't do that.

Zen Cart 1.5.5e, PHP 5.3.29 MySQL 5.5.42

29 Oct 2018, 2:58 PM
#4
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,760
Plugin Contributions:
56

Re: Unsupported HTML tags [description]

"Your competitor's software is buggy!"

Uh....

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

29 Oct 2018, 3:39 PM
#5
carlwhat avatar

carlwhat

zennedOut

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

Re: Unsupported HTML tags [description]

i have found ampersand to be one of the more butchered items on the web. i have seen encoded ampersands displayed (improperly obviously) in newsfeeds and articles from major news organizations, as well as in the websites frequented by millions.

looking at the php page for htmlentities and its multitude of options seems that it is fraught with the potential to not get what one wants based on the input:

http://php.net/manual/en/function.htmlentities.php

(look at some of the examples, oy!)

take the 'data cleansing' that ZC does on the way in, and then apply htmlentities on the way out when constructing a google feed and you have a situation where you no doubt can/will have bugs.

i have used any number of numinix add-ons, and found their code to be solid.

using the google product feed requires some individual specialized attention. when a product description has an ampersand in it; you are looking at potential problems. ones that i do not think ZC and a google product feed add-on will get right in every situation.

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

29 Oct 2018, 3:44 PM
#6
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,760
Plugin Contributions:
56

Re: Unsupported HTML tags [description]

carlwhat:

using the google product feed requires some individual specialized attention.

It's kind of astounding how hard they make it to use. And what I really like are these idiot "auditors" they hire who tell you your shipping costs don't match in the feed vs. your site. Boy, that's fun.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

29 Oct 2018, 6:54 PM
#7
lloyd_borrett avatar

lloyd_borrett

Zen Follower

Join Date:
Mar 2006
Location:
Rosebud, Victoria, Australia
Posts:
308
Plugin Contributions:
2

Re: Unsupported HTML tags [description]

Seems it's a bit more complicated than I first thought. Even if I've put the right HTML entity in the Zen Cart description...

<p>The Light & Motion GoBe/Sola Universal Hand Strap is just what you need if you're looking for hands free use of you Light and Motion GoBe/Sola lights.</p>

It's written by the Numinix Google Product Search Feeder add-on into the feed XML file as...

<description><![CDATA[The Light & Motion GoBe/Sola Universal Hand Strap is just what you need if you're looking for hands free use of you Light and Motion GoBe/Sola lights. ]]></description>

And now Google has decided this is wrong and is generating a warning.

Zen Cart 1.5.5e, PHP 5.3.29 MySQL 5.5.42

30 Oct 2018, 12:12 AM
#8
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

Re: Unsupported HTML tags [description]

Have you enabled/disabled the advanced sanitation in the feeder admin config?


Zen Cart and it's community are the best!!

30 Oct 2018, 12:28 AM
#9
carlwhat avatar

carlwhat

zennedOut

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

Re: Unsupported HTML tags [description]

lankeeyankee:

Have you enabled/disabled the advanced sanitation in the feeder admin config?

not a bad idea! looks like the code comments out that part of the conversion (see below):

    function google_base_xml_sanitizer($str, $products_id = '') { // products id added for debugging purposes
      $str = $this->google_base_sanita($str);
      if (GOOGLE_PRODUCTS_XML_SANITIZATION == 'true') {
        $str = $this->transcribe_cp1252_to_latin1($str); // transcribe windows characters
        $strout = null;

        for ($i = 0; $i < strlen($str); $i++) {
          $ord = ord($str[$i]);
          if (($ord > 0 && $ord < 32) || ($ord >= 127)) {
            $strout .= "&#{$ord};";
          }
          else {
            switch ($str[$i]) {
              case '<':
                $strout .= '<';
                break;
              case '>':
                $strout .= '>';
                break;
              //case '&':
                //$strout .= '&';
                //break;
              case '"':
                $strout .= '"';
                break;
              default:
                $strout .= $str[$i];
            }
          }
        }
        $str = null;
        return $strout;
      } else {
        return $str;
      }
    }
    
    function transcribe_cp1252_to_latin1($cp1252) {
      return strtr(
        $cp1252,
        array(
          "\x80" => "e",  "\x81" => " ",    "\x82" => "'", "\x83" => 'f',
          "\x84" => '"',  "\x85" => "...",  "\x86" => "+", "\x87" => "#",
          "\x88" => "^",  "\x89" => "0/00", "\x8A" => "S", "\x8B" => "<",
          "\x8C" => "OE", "\x8D" => " ",    "\x8E" => "Z", "\x8F" => " ",
          "\x90" => " ",  "\x91" => "`",    "\x92" => "'", "\x93" => '"',
          "\x94" => '"',  "\x95" => "*",    "\x96" => "-", "\x97" => "--",
          "\x98" => "~",  "\x99" => "(TM)", "\x9A" => "s", "\x9B" => ">",
          "\x9C" => "oe", "\x9D" => " ",    "\x9E" => "z", "\x9F" => "Y"
          )
      );
    }
    

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

31 Oct 2018, 5:37 PM
#11
lloyd_borrett avatar

lloyd_borrett

Zen Follower

Join Date:
Mar 2006
Location:
Rosebud, Victoria, Australia
Posts:
308
Plugin Contributions:
2

Re: Unsupported HTML tags [description]

Today all of the warnings have gone. Maybe Google has fixed their incorrect handling of ampersand.

Zen Cart 1.5.5e, PHP 5.3.29 MySQL 5.5.42

31 Oct 2018, 6:07 PM
#12
lat9 avatar

lat9

Administrator

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

Re: Unsupported HTML tags [description]

mprough:

switching it to Latin 1 in merchant center will resolve those amersands
https://support.google.com/merchants/answer/160079?hl=en

~Melanie
Wouldn't that have unwanted consequences for stores that use utf-8 encoding in the database (like any utf-8 accented characters displaying with � characters)?

31 Oct 2018, 6:57 PM
#13
mprough avatar

mprough

Totally Zenned

Join Date:
Nov 2007
Location:
Woodbine, Georgia, United States
Posts:
4,336
Plugin Contributions:
41

Re: Unsupported HTML tags [description]

Never in my experience... Google shopping has been snorting at common ampersands for 10 years plus

31 Oct 2018, 9:52 PM
#14
carlwhat avatar

carlwhat

zennedOut

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

Re: Unsupported HTML tags [description]

lloyd_borrett:

Today all of the warnings have gone. Maybe Google has fixed their incorrect handling of ampersand.

i can confirm that the warnings on one of my clients sites have also stopped....

and that the use of an unescaped ampersand within a properly formatted CDATA section is allowed per the official XML specification.

i can not confirm that changing the encoding on the XML feed to something different than the in-use encoded dataset would have resolved anything.... or made things worse... nor can i confirm any snorting over any period of time....

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.