Plugin Directory

Changeset 1729372


Ignore:
Timestamp:
09/13/2017 02:20:25 PM (9 years ago)
Author:
adtechmedia
Message:

add stage env

Location:
adtechmedia/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • adtechmedia/trunk/adtechmedia-config.php

    r1720581 r1729372  
    7676            self::$conf['register_url_tpl'] = 'https://manage-test.adtechmedia.io/accounts/signup/%s';
    7777            self::$conf['terms_url']        = 'https://manage-test.adtechmedia.io/deep-account/terms/dialog.html';
     78        } else if ( self::is_stage() ) {
     79            self::$conf['api_end_point']    = 'https://api-stage.adtechmedia.io/v1/';
     80            self::$conf['ads_video']        = 'https://manage-stage.adtechmedia.io/atm-admin/atm-build/demo-vast.xml';
     81            self::$conf['sw_js_url']        = 'https://manage-stage.adtechmedia.io/atm-admin/atm-build/sw.min.js';
     82            self::$conf['tpl_js_url']       = 'https://manage-stage.adtechmedia.io/atm-admin/atm-build/atmTpl.js';
     83            self::$conf['br_js_url']        = 'https://manage-stage.adtechmedia.io/atm-admin/atm-build/atmBr.js';
     84            self::$conf['tpl_mgmt_js_url']  = 'https://manage-stage.adtechmedia.io/atm-admin/atm-build/atmTplManager.js';
     85            self::$conf['register_url_tpl'] = 'https://manage-stage.adtechmedia.io/accounts/signup/%s';
     86            self::$conf['terms_url']        = 'https://manage-stage.adtechmedia.io/deep-account/terms/dialog.html';
    7887        }
     88    }
     89
     90    /**
     91     * Is stage
     92     *
     93     * @return bool
     94     */
     95    public static function is_stage() {
     96        $server_name = isset( $_SERVER['SERVER_NAME'] )
     97            ? sanitize_text_field( wp_unslash( $_SERVER['SERVER_NAME'] ) )
     98            : null;
     99        return preg_match( '/dev-[^\.]+\.pantheonsite\.io/i', $server_name );
    79100    }
    80101
  • adtechmedia/trunk/adtechmedia-plugin.php

    r1722776 r1729372  
    9292        ];
    9393        if ( $api_result ) {
    94             $this->update_from_api_option( 'selector', $api_result['Config']['defaults']['content']['selector'] );
    9594            $this->update_from_api_option( 'price', $api_result['Config']['defaults']['payment']['price'] );
    9695            $this->update_from_api_option( 'support_email', $api_result['SupportEmail'] );
  • adtechmedia/trunk/adtechmedia-request.php

    r1703090 r1729372  
    1717     * @param string $property_id id of property.
    1818     * @param string $type type of decision.
    19      * @param array $data decision content.
     19     * @param array  $data decision content.
    2020     * @param string $key API key.
    2121     * @return mixed
  • adtechmedia/trunk/adtechmedia.php

    r1726151 r1729372  
    33 * Plugin Name: AdTechMedia
    44 * Plugin URI: https://wordpress.org/plugins/adtechmedia/
    5  * Version: 0.12.6
     5 * Version: 0.12.7
    66 * Author: AdTechMedia.io
    77 * Description: AdTechMedia is an advertising platform with micropayments capabilities for media content monetization. We help publishers and content providers to generate complimentary revenue streams that are immune to ad blocking software (e.g. native advertising or native micropayments). Our solutions are white labeled, data driven and realtime. To learn more, contact hello@adtechmedia.io or visit www.adtechmedia.io.
  • adtechmedia/trunk/js/main.js

    r1726151 r1729372  
    402402  if (!apiKey) { return false }
    403403
    404   const brEngine = atmBr(isLocalhost ? 'test' : 'prod');
     404  var atmEnv = 'prod';
     405
     406  if (isLocalhost) {
     407    atmEnv = 'test';
     408  } else if (isStage) {
     409    atmEnv = 'stage';
     410  }
     411
     412  const brEngine = atmBr(atmEnv);
    405413  const brRendition = brEngine.authorize(apiKey).render('#br-manager').defaultSchema();
    406414
     
    421429 
    422430  const saveTemplatesBtn = jQuery('#save-templates-config');
    423   const tplManager = atmTplManager(isLocalhost ? 'test' : 'prod');
     431  const tplManager = atmTplManager(atmEnv);
    424432  const runtime = tplManager.rendition().render('#template-editor');
    425433
    426   function applyOverallStyles(appearanceSettings) {
     434  function applyOverallStyles(appearanceSettings, showNotify = false) {
    427435    if (!appearanceSettings) { return; }
    428436    var overallHtml = '';
     
    450458        appearanceSettings: JSON.stringify(tplManager.generalSettings)
    451459      },
     460      success: function () {
     461        if (showNotify) { removeLoader(saveTemplatesBtn); }
     462      },
    452463      error: function(response) {
    453464        showError();
     
    482493          })
    483494          .then(function() {
    484             removeLoader(saveTemplatesBtn);
    485             applyOverallStyles(tplManager.generalSettings);
     495            applyOverallStyles(tplManager.generalSettings, true);
    486496          })
    487497          .catch(function(error) {
  • adtechmedia/trunk/readme.txt

    r1726151 r1729372  
    1010Requires at least: 3.6
    1111Tested up to: 4.8
    12 Stable tag: 0.12.6
     12Stable tag: 0.12.7
    1313
    1414
  • adtechmedia/trunk/views/admin.php

    r1722776 r1729372  
    4343echo 'var themeVersion = "' . addslashes( wp_get_theme()->get( 'Version' ) ) . '";' . PHP_EOL;
    4444echo 'var isLocalhost = "' . addslashes( Adtechmedia_Config::is_localhost() ) . '";' . PHP_EOL;
     45echo 'var isStage = "' . addslashes( Adtechmedia_Config::is_stage() ) . '";' . PHP_EOL;
    4546echo 'var platformId = "' . addslashes( Adtechmedia_Config::get ( 'platform_id' ) ) . '";' . PHP_EOL;
    4647echo 'var platformVersion = "' . addslashes( preg_replace( '/^(\d+)([^\d].*)?$/', '$1', get_bloginfo( 'version' ) ) ) . '";' . PHP_EOL;
Note: See TracChangeset for help on using the changeset viewer.