Plugin Directory

Changeset 2555548


Ignore:
Timestamp:
06/29/2021 04:51:57 AM (5 years ago)
Author:
microsoft
Message:

Fix the error in debug mode and upgrade to 1.0.3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • microsoft-advertising-universal-event-tracking-uet/trunk/wp-uet-plugin.php

    r2531528 r2555548  
    77 * Plugin URI: https://ads.microsoft.com/
    88 * Description: The official plugin for setting up Microsoft Advertising UET.
    9  * Version: 1.0.2
     9 * Version: 1.0.3
    1010 * Author: Microsoft Corporation
    1111 * Author URI: https://www.microsoft.com/
     
    3131function UetIsTagAvailable() {
    3232    $options = get_option('UetTagSettings');
    33     return !empty($options[uet_tag_id]);
     33    return !empty($options['uet_tag_id']);
    3434}
    3535
     
    3939        <script>(function(w,d,t,r,u){var f,n,i;w[u]=w[u]||[],f=function(){var o={ti:"<?php
    4040    $options = get_option('UetTagSettings');
    41     echo "$options[uet_tag_id]"
    42 ?>",tm:"wpp_1.0.2"};o.q=w[u],w[u]=new UET(o),w[u].push("pageLoad")},n=d.createElement(t),n.src=r,n.async=1,n.onload=n.onreadystatechange=function(){var s=this.readyState;s&&s!=="loaded"&&s!=="complete"||(f(),n.onload=n.onreadystatechange=null)},i=d.getElementsByTagName(t)[0],i.parentNode.insertBefore(n,i)})(window,document,"script","//bat.bing.com/bat.js","uetq");</script>
     41    $uet_tag_id = $options['uet_tag_id'];
     42    echo "{$uet_tag_id}"
     43?>",tm:"wpp_1.0.3"};o.q=w[u],w[u]=new UET(o),w[u].push("pageLoad")},n=d.createElement(t),n.src=r,n.async=1,n.onload=n.onreadystatechange=function(){var s=this.readyState;s&&s!=="loaded"&&s!=="complete"||(f(),n.onload=n.onreadystatechange=null)},i=d.getElementsByTagName(t)[0],i.parentNode.insertBefore(n,i)})(window,document,"script","//bat.bing.com/bat.js","uetq");</script>
    4344<?php
    4445  return null;
     
    7677        $options = get_option('UetTagSettings');
    7778        include 'tagid.php';
    78         if (empty($options[uet_tag_id]) && !empty($tagid)) {
     79        if (empty($options['uet_tag_id']) && !empty($tagid)) {
    7980            if (ctype_digit($tagid)) {
    80                 $options[uet_tag_id] = $tagid;
     81                $options['uet_tag_id'] = $tagid;
    8182                update_option('UetTagSettings', $options);
    8283            }
     
    9394function UetEchoTagId() {
    9495    $options = get_option('UetTagSettings');
    95     echo "<input id='uet_tag_id' name='UetTagSettings[uet_tag_id]' type='text' value='$options[uet_tag_id]' />";
     96    $uet_tag_id = '';
     97    if(isset($options['uet_tag_id'])){
     98        $uet_tag_id = $options['uet_tag_id'];
     99    }
     100    echo "<input id='uet_tag_id' name='UetTagSettings[uet_tag_id]' type='text' value='{$uet_tag_id}' />";
    96101}
    97102
Note: See TracChangeset for help on using the changeset viewer.