woocommerce / pinterest-for-woocommerce

A native Pinterest integration for WooCommerce. Development is managed by Ventures.
https://woo.com/products/pinterest-for-woocommerce/
GNU General Public License v3.0
22 stars 9 forks source link

pinit.js script import is different from Pinterest documentation #983

Closed ecgan closed 2 months ago

ecgan commented 3 months ago

Describe the bug:

In Pinterest's documentation https://developers.pinterest.com/docs/add-ons/save-button/, the pinit.js script should be imported in the page like this:

<script
    type="text/javascript"
    async defer
    src="//assets.pinterest.com/js/pinit.js"
></script>

However, in our extension, we are importing the script differently like this:

<script src="https://assets.pinterest.com/js/pinit.js?ver=1.4.0" defer="defer"></script>

The code for the script import comes from the following:

https://github.com/woocommerce/pinterest-for-woocommerce/blob/c2753be8283b966f24c394a7ffcdf3d3ec976593/includes/class-pinterest-for-woocommerce-frontend-assets.php#L95

In practice / in reality, the difference does not cause any issue in the extension functionality. We can still save or pin an image just fine. However, it seems to be causing confusions for our users and support teams.

In this issue, ideally we should update our code to match with the code snippet provided in Pinterest documentation, so that there are no differences and thus eliminate confusions for users and support teams.

Steps to reproduce:

  1. Go to a product page and view the page source.

Expected behavior:

The script import markup should match with the markup provided by Pinterest documentation.

Actual behavior:

The script import markup does not match with the markup provided by Pinterest documentation.

Additional details:

Related links: