Plugin Directory

Changeset 1313239


Ignore:
Timestamp:
12/21/2015 08:29:45 AM (10 years ago)
Author:
baseapp
Message:

Major fixes (logging issue)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wpbase-cache/trunk/wpbase-cache.php

    r1305163 r1313239  
    44  Plugin URI: https://github.com/baseapp/wpbase-cache
    55  Description: A wordpress plugin for using all caches on varnish, nginx, php-fpm stack with php-apc. This plugin includes db-cache-reloaded-fix for dbcache.
    6   Version: 3.0
     6  Version: 4.0
    77  Author: Vikrant Datta
    88  Author URI: http://blog.wpoven.com
     
    4343}
    4444
     45function is_wpoven_site() {
     46    $file = ABSPATH . 'wp-config.php';
     47    $content = file_get_contents($file);
     48    $match = '';
     49    preg_match('/define.*DB_NAME.*\'(.*)\'/', $content, $match);
     50    $dbname = $match[1];
     51    $sitename = substr($dbname, 2);
     52    $ch = curl_init();
     53    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
     54    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
     55    curl_setopt($ch, CURLOPT_TIMEOUT, 5);
     56    curl_setopt($ch, CURLOPT_URL, "https://wpoven.com/sites/check/wpbasecachecheck/" . $sitename);
     57    $content = curl_exec($ch);
     58    curl_close($ch);
     59    return $content;
     60}
     61
    4562function check_wpoven_site() {
    46     $check_path = dirname(dirname(dirname(ABSPATH)));
    47     if (is_file($check_path . '/bamon/key')) {
     63
     64    $check_site = is_wpoven_site();
     65    if ($check_site == "1") {
    4866
    4967        function custom_button_example($wp_admin_bar) {
     
    260278$send_as = $options['send_as'];
    261279if ($send_as != NULL) {
    262     add_filter('wp_mail_from', 'mail_from');
    263     add_filter('wp_mail_from_name', 'mail_from_name');
    264 }
    265 
    266 function mail_from($email) {
     280    add_filter('wp_mail_from', 'mail_from_wpoven');
     281    add_filter('wp_mail_from_name', 'mail_from_name_wpoven');
     282}
     283
     284function mail_from_wpoven($email) {
    267285
    268286    $options = get_option('wpbase_cache_options');
     
    288306}
    289307
    290 function mail_from_name($name) {
     308function mail_from_name_wpoven($name) {
    291309    $options = get_option('wpbase_cache_options');
    292310    $send_as = $options['send_as'];
Note: See TracChangeset for help on using the changeset viewer.