diff --git a/divi-button-event-tagger.php b/divi-button-event-tagger.php index c75ec1a..feaf54e 100644 --- a/divi-button-event-tagger.php +++ b/divi-button-event-tagger.php @@ -11,7 +11,7 @@ * Plugin Name: Divi Button Event Tagger * Plugin URI: https://github.com/Spcktr/divi-button-event-tagger * Description: Insert missing data-vars-ga attributes for button links. This will help Google Analytics tracking buttons for themes like Divi. - * Version: 1.1.1 + * Version: 1.1.2 * Author: Tim H. * Author URI: https://github.com/spcktr * License: GNU General Public License v3 @@ -25,7 +25,7 @@ } define('DIVI_BUTTON_EVENT_TAGGER_PLUGIN_NAME', 'divi-button-event-tagger'); -define('DIVI_BUTTON_EVENT_TAGGER_PLUGIN_VERSION', '1.1.1'); +define('DIVI_BUTTON_EVENT_TAGGER_PLUGIN_VERSION', '1.1.2'); define('BUTTON_EVENT_SELECTOR', '.et_pb_button'); // Default for Divi. /** diff --git a/public/js/divi-button-event-tagger.js b/public/js/divi-button-event-tagger.js index 9edf912..e14ebc3 100644 --- a/public/js/divi-button-event-tagger.js +++ b/public/js/divi-button-event-tagger.js @@ -14,14 +14,12 @@ function addDivibuttonevents() { } }); // removes rel='nofollow' from buttons for SEO - const anchors = document.querySelectorAll('.et_pb_button'); - - anchors.forEach(anchor => { - if (anchor.hasAttribute('rel')) { - const relAttribute = anchor.getAttribute('rel'); + elts.forEach(elt => { + if (elt.hasAttribute('rel')) { + const relAttribute = elt.getAttribute('rel'); if (relAttribute.includes('nofollow')) { - anchor.removeAttribute('rel'); + elt.removeAttribute('rel'); } } });