Plugin Directory

Changeset 1749824


Ignore:
Timestamp:
10/20/2017 11:02:04 AM (8 years ago)
Author:
devdmkr
Message:

update

Location:
prime-ads/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • prime-ads/trunk/inc/controllers/ApiController.php

    r1747413 r1749824  
    163163    public function clear_cacheAction(){
    164164        if(function_exists('wp_cache_clear_cache')) wp_cache_clear_cache();
    165         if(function_exists('w3tc_flush_all')) w3tc_flush_all();
     165        if(function_exists('w3tc_flush_all'))
     166            update_option('ads-flush-w3tc', true);
    166167        echo json_encode(array('result' => 'ok', 'ver' => ADS_VERSION));
    167168        return false;
  • prime-ads/trunk/inc/services/AdsHelper.php

    r1747845 r1749824  
    380380
    381381        $folder = get_option('ads-folder');
     382        $out = preg_replace('#<!--tizer-\d+-->|<!--tizer-\d+-end-->#iU', '', $out);
    382383        $out = str_replace('/prime-ads/', '/' . $folder . '/', $out);
    383384
     
    426427    private function _generateFixed($positionObj, $blockData)
    427428    {   
    428         $prefix = AdsHelper::getPrefix();
    429429        if($blockData == '') return '';
    430         $data = '<div id="' . $prefix . '-fixed-' . $positionObj->id . '-wrap">';
    431         $data .= $blockData;
    432         $data .= '</div>';
    433         $data .= $positionObj->template;
     430        $data = str_replace("{{block_data}}", $blockData, $positionObj->template);
    434431        return $data;
    435432    }
  • prime-ads/trunk/prime-ads.php

    r1747845 r1749824  
    33    Plugin Name: Prime Ads
    44    Description: Вывод рекламы с сервиса Prime Ads
    5     Version: 1.9.3
     5    Version: 1.9.4
    66    Author: Proffit
    77    Author URI: http://proffit.guru/
     
    1919use AdsNS\SxGeo\SxGeo;
    2020
    21 define('ADS_VERSION', '1.9.3');
     21define('ADS_VERSION', '1.9.4');
    2222define('ADS_DB_VERSION', '1.7.9');
    2323define('ADS_PATH', realpath(__DIR__));
     
    486486}
    487487
    488 //delete_option('ads-link-hash');
    489 //delete_option('ads-folder');
    490488$primeAds = new PrimeAds();
    491489PrimeAds::checkHash();
     490
     491if(get_option('ads-flush-w3tc')){
     492    add_action('plugins_loaded', 'w3tc_flush_all', 100);
     493    add_action('plugins_loaded', 'w3tc_pgcache_flush', 100);
     494    add_action('plugins_loaded', 'w3tc_flush_posts', 100);
     495    add_action('plugins_loaded', 'w3tc_objectcache_flush', 100);
     496    add_action('plugins_loaded', 'ads_w3tc_flush', 101);
     497    delete_option('ads-flush-w3tc');
     498    ads_w3tc_flush();
     499}
     500
     501function ads_w3tc_flush(){
     502    w3tc_flush_all();
     503    w3tc_flush_posts();
     504    $w3 = \W3TC\Dispatcher::component( 'CacheFlush' );
     505    $w3->dbcache_flush();
     506    $w3->minifycache_flush();
     507    $w3->objectcache_flush();
     508    $w3->opcache_flush();
     509    $w3->browsercache_flush();
     510    $pgcache_cleanup = \W3TC\Dispatcher::component( 'PgCache_Plugin_Admin' );
     511    $pgcache_cleanup->cleanup();
     512    $pgcacheflush = \W3TC\Dispatcher::component( 'PgCache_Flush' );
     513    $pgcacheflush->flush();
     514    $pgcacheflush->flush_post_cleanup();
     515}
    492516
    493517if(isset($_SERVER['REQUEST_URI']) and strpos($_SERVER['REQUEST_URI'], '/primeads_api') === 0){
  • prime-ads/trunk/readme.txt

    r1747845 r1749824  
    77Requires at least: 4.0
    88Tested up to: 4.6
    9 Stable tag: 1.9.3
     9Stable tag: 1.9.4
    1010
    1111Ответная часть сервиса монитизации Prime Ads (http://primeads.ru)
Note: See TracChangeset for help on using the changeset viewer.