Plugin Directory

Changeset 2044052


Ignore:
Timestamp:
03/04/2019 05:12:56 PM (7 years ago)
Author:
sparklit
Message:

Add Async Beta 1.1 tags. Bump supported WordPress version

Location:
adbutler/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • adbutler/trunk/adbutler.php

    r2012423 r2044052  
    55Plugin URI: https://wordpress.org/plugins/adbutler
    66Description: AdButler ad management system integration plugin. Simplify deployment of your ad zones with this highly effective manner of deploying your publishing needs
    7 Version: 1.21
     7Version: 1.22
    88Author: AdButler
    99Author URI: http://www.adbutler.com
     
    2323define( 'ADBUTLER_CACHEURL', ADBUTLER_URLPATH . 'cache/' );
    2424define( 'ADBUTLER_ADSERVE_URL','https://adbutler.com/external_request.spark');
    25 define( 'ADBUTLER_PLUGIN_VERSION', '1.21');
     25define( 'ADBUTLER_PLUGIN_VERSION', '1.22');
    2626
    2727
  • adbutler/trunk/includes/adbutler_admin_settings.class

    r1948203 r2044052  
    9696        $fixed_type_list = array(
    9797            'asyncjs' => 'Asynchronous JavaScript (Recommended)',
     98            'asyncbeta' => 'Asynchronous JavaScript (1.1 Beta)',
    9899            'js' => 'JavaScript',
    99100            'iframe' => 'Iframe',
     
    104105        $responsive_type_list = array(
    105106            'asyncjs' => 'Asynchronous JavaScript (Recommended)',
     107            'asyncbeta' => 'Asynchronous JavaScript (1.1 Beta)',
    106108            'js' => 'JavaScript',
    107109            'img' => 'Image (Basic)',
  • adbutler/trunk/includes/adbutler_plugin.class

    r2012423 r2044052  
    591591        switch ($type) //Javascript, 'Iframe', 'Image','Popup'
    592592        {
     593            case 'asyncbeta':
     594                $output[] = adbutler_tag_builder::buildAsyncBetaTags($def);
     595                break;
    593596            case 'asyncjs': {
    594597                $output[] = adbutler_tag_builder::buildAsyncTags($def);
  • adbutler/trunk/includes/adbutler_tag_builder.class

    r1915946 r2044052  
    6060    }
    6161
     62    static function buildAsyncBetaTags($def)
     63    {
     64        $size = explode('x', $def['size']);
     65        $zone_id = $def['zone_id'];
     66        $MID = $def['adbutler_id'];
     67        if ($def['secure']) {
     68            $protocol = "https://" . $def['ssl_host_name'];
     69        } else {
     70            $protocol = "http://" . $def['host_name'];
     71        }
     72        if (isset($def['extra_data']) && !empty($def['extra_data'])) {
     73            $extra = ",extraData:'" . $def['extra_data'] . "'";
     74        }
     75        ob_start();
     76        ?>
     77        <script type="text/javascript">
     78            if (!window.AdButler) {
     79                (function () {
     80                    var s = document.createElement("script");
     81                    s.async = true;
     82                    s.type = "text/javascript";
     83                    s.src = '<?php echo $protocol?>/app.js';
     84                    var n = document.getElementsByTagName("script")[0];
     85                    n.parentNode.insertBefore(s, n);
     86                }());
     87            }
     88        </script>
     89        <div class="plc<?=$zone_id?>"></div>
     90        <script type="text/javascript">
     91            var AdButler = AdButler || {};
     92            AdButler.ads = AdButler.ads || [];
     93            var abkw = window.abkw || '';
     94            var plc<?php echo $zone_id?> = window.plc<?=$zone_id?> || 0;
     95            (function(){
     96                var divs = document.querySelectorAll(".plc<?=$zone_id?>:not([id])");
     97                var div = divs[divs.length-1];
     98                div.id = "placement_<?=$zone_id?>_"+plc<?=$zone_id?>;
     99                AdButler.ads.push({
     100                    handler: function (opt) {
     101                        AdButler.register(<?php echo $MID?>,<?php echo $zone_id?>, [<?php echo $size[0]?>,<?php echo $size[1]?>], 'placement_<?php echo $zone_id?>_' + opt.place, opt);
     102                    },
     103                    opt: {
     104                        place: plc<?php echo $zone_id?>++,
     105                        keywords: abkw <?php echo empty($extra) ? '' : $extra?>,
     106                        domain: '<?php echo $def['secure'] ? $def['ssl_host_name'] : $def['host_name']?>'
     107                    }
     108                });
     109            })()
     110        </script>
     111        <?php
     112        return ob_get_clean();
     113    }
     114
    62115    /**
    63116     * @param $def Array of variables required to build HTML/Iframe tags
  • adbutler/trunk/includes/adbutler_widget.class

    r1947600 r2044052  
    3434
    3535        switch ($new_instance['type']) {
     36            case 'asyncbeta':
    3637            case 'asyncjs':
    3738            case 'js':
     
    114115        $responsive_type_list = array(
    115116            'asyncjs' => 'Asynchronous JavaScript (Recommended)',
     117            'asyncbeta' => 'Asynchronous JavaScript (1.1 Beta)',
    116118            'js' => 'JavaScript',
    117119            'iframe' => 'Iframe',
     
    122124        $fixed_type_list = array(
    123125            'asyncjs' => 'Asynchronous JavaScript (Recommended)',
     126            'asyncbeta' => 'Asynchronous JavaScript (1.1 Beta)',
    124127            'js' => 'JavaScript',
    125128            'img' => 'Image (Basic)',
  • adbutler/trunk/readme.txt

    r2012423 r2044052  
    44Tags: Ad serving, AdButler, Ad Server,Ad Management,Ad Rotation
    55Requires at least: 3.3
    6 Tested up to: 4.9
     6Tested up to: 5.1
    77Stable tag: trunk
    88License: GPLv2 or later
     
    6868
    6969== Changelog ==
     70*1.22 Added Async Beta 1.1 tags. Bumped supported WordPress version.
    7071*1.21 Fixed resources not loading with https on some configurations.
    7172*1.20 Removed AdButler key config from dashboard. The key must be configured in the admin settings.
     
    9091== Upgrade notice ==
    9192
    92 Added support for header bidding ads. Interval ads can now be targeted at specific pages.
     93Async Beta 1.1 tags are now supported.
    9394 
    9495
Note: See TracChangeset for help on using the changeset viewer.