예제 #1
0
 /**
  * Flushes post cache
  *
  * @param integer $post_id
  * @return boolean
  */
 function flush_post($post_id = null)
 {
     if (!$post_id) {
         $post_id = $this->_detect_post_id();
     }
     if ($post_id) {
         $uris = array();
         $domain_url = w3_get_domain_url();
         $feeds = $this->_config->get_array('pgcache.purge.feed.types');
         if ($this->_config->get_boolean('pgcache.purge.terms') || $this->_config->get_boolean('pgcache.purge.feed.terms')) {
             $taxonomies = get_post_taxonomies($post_id);
             $terms = nxt_get_post_terms($post_id, $taxonomies);
         }
         switch (true) {
             case $this->_config->get_boolean('pgcache.purge.author'):
             case $this->_config->get_boolean('pgcache.purge.archive.daily'):
             case $this->_config->get_boolean('pgcache.purge.archive.monthly'):
             case $this->_config->get_boolean('pgcache.purge.archive.yearly'):
             case $this->_config->get_boolean('pgcache.purge.feed.author'):
                 $post = get_post($post_id);
         }
         /**
          * Home URL
          */
         if ($this->_config->get_boolean('pgcache.purge.home')) {
             $home_path = w3_get_home_path();
             $site_path = w3_get_site_path();
             $uris[] = $home_path;
             if ($site_path != $home_path) {
                 $uris[] = $site_path;
             }
         }
         /**
          * Post URL
          */
         if ($this->_config->get_boolean('pgcache.purge.post')) {
             $post_link = post_permalink($post_id);
             $post_uri = str_replace($domain_url, '', $post_link);
             $uris[] = $post_uri;
         }
         /**
          * Post comments URLs
          */
         if ($this->_config->get_boolean('pgcache.purge.comments') && function_exists('get_comments_pagenum_link')) {
             $comments_number = get_comments_number($post_id);
             $comments_per_page = get_option('comments_per_page');
             $comments_pages_number = @ceil($comments_number / $comments_per_page);
             for ($pagenum = 1; $pagenum <= $comments_pages_number; $pagenum++) {
                 $comments_pagenum_link = $this->_get_comments_pagenum_link($post_id, $pagenum);
                 $comments_pagenum_uri = str_replace($domain_url, '', $comments_pagenum_link);
                 $uris[] = $comments_pagenum_uri;
             }
         }
         /**
          * Post author URLs
          */
         if ($this->_config->get_boolean('pgcache.purge.author') && $post) {
             $posts_number = count_user_posts($post->post_author);
             $posts_per_page = get_option('posts_per_page');
             $posts_pages_number = @ceil($posts_number / $posts_per_page);
             $author_link = get_author_link(false, $post->post_author);
             $author_uri = str_replace($domain_url, '', $author_link);
             for ($pagenum = 1; $pagenum <= $posts_pages_number; $pagenum++) {
                 $author_pagenum_link = $this->_get_pagenum_link($author_uri, $pagenum);
                 $author_pagenum_uri = str_replace($domain_url, '', $author_pagenum_link);
                 $uris[] = $author_pagenum_uri;
             }
         }
         /**
          * Post terms URLs
          */
         if ($this->_config->get_boolean('pgcache.purge.terms')) {
             $posts_per_page = get_option('posts_per_page');
             foreach ($terms as $term) {
                 $term_link = get_term_link($term, $term->taxonomy);
                 $term_uri = str_replace($domain_url, '', $term_link);
                 $posts_pages_number = @ceil($term->count / $posts_per_page);
                 for ($pagenum = 1; $pagenum <= $posts_pages_number; $pagenum++) {
                     $term_pagenum_link = $this->_get_pagenum_link($term_uri, $pagenum);
                     $term_pagenum_uri = str_replace($domain_url, '', $term_pagenum_link);
                     $uris[] = $term_pagenum_uri;
                 }
             }
         }
         /**
          * Daily archive URLs
          */
         if ($this->_config->get_boolean('pgcache.purge.archive.daily') && $post) {
             $post_date = strtotime($post->post_date);
             $post_year = gmdate('Y', $post_date);
             $post_month = gmdate('m', $post_date);
             $post_day = gmdate('d', $post_date);
             $posts_per_page = get_option('posts_per_page');
             $posts_number = $this->_get_archive_posts_count($post_year, $post_month, $post_day);
             $posts_pages_number = @ceil($posts_number / $posts_per_page);
             $day_link = get_day_link($post_year, $post_month, $post_day);
             $day_uri = str_replace($domain_url, '', $day_link);
             for ($pagenum = 1; $pagenum <= $posts_pages_number; $pagenum++) {
                 $day_pagenum_link = $this->_get_pagenum_link($day_uri, $pagenum);
                 $day_pagenum_uri = str_replace($domain_url, '', $day_pagenum_link);
                 $uris[] = $day_pagenum_uri;
             }
         }
         /**
          * Monthly archive URLs
          */
         if ($this->_config->get_boolean('pgcache.purge.archive.monthly') && $post) {
             $post_date = strtotime($post->post_date);
             $post_year = gmdate('Y', $post_date);
             $post_month = gmdate('m', $post_date);
             $posts_per_page = get_option('posts_per_page');
             $posts_number = $this->_get_archive_posts_count($post_year, $post_month);
             $posts_pages_number = @ceil($posts_number / $posts_per_page);
             $month_link = get_month_link($post_year, $post_month);
             $month_uri = str_replace($domain_url, '', $month_link);
             for ($pagenum = 1; $pagenum <= $posts_pages_number; $pagenum++) {
                 $month_pagenum_link = $this->_get_pagenum_link($month_uri, $pagenum);
                 $month_pagenum_uri = str_replace($domain_url, '', $month_pagenum_link);
                 $uris[] = $month_pagenum_uri;
             }
         }
         /**
          * Yearly archive URLs
          */
         if ($this->_config->get_boolean('pgcache.purge.archive.yearly') && $post) {
             $post_date = strtotime($post->post_date);
             $post_year = gmdate('Y', $post_date);
             $posts_per_page = get_option('posts_per_page');
             $posts_number = $this->_get_archive_posts_count($post_year);
             $posts_pages_number = @ceil($posts_number / $posts_per_page);
             $year_link = get_year_link($post_year);
             $year_uri = str_replace($domain_url, '', $year_link);
             for ($pagenum = 1; $pagenum <= $posts_pages_number; $pagenum++) {
                 $year_pagenum_link = $this->_get_pagenum_link($year_uri, $pagenum);
                 $year_pagenum_uri = str_replace($domain_url, '', $year_pagenum_link);
                 $uris[] = $year_pagenum_uri;
             }
         }
         /**
          * Feed URLs
          */
         if ($this->_config->get_boolean('pgcache.purge.feed.blog')) {
             foreach ($feeds as $feed) {
                 $feed_link = get_feed_link($feed);
                 $feed_uri = str_replace($domain_url, '', $feed_link);
                 $uris[] = $feed_uri;
             }
         }
         if ($this->_config->get_boolean('pgcache.purge.feed.comments')) {
             foreach ($feeds as $feed) {
                 $post_comments_feed_link = get_post_comments_feed_link($post_id, $feed);
                 $post_comments_feed_uri = str_replace($domain_url, '', $post_comments_feed_link);
                 $uris[] = $post_comments_feed_uri;
             }
         }
         if ($this->_config->get_boolean('pgcache.purge.feed.author') && $post) {
             foreach ($feeds as $feed) {
                 $author_feed_link = get_author_feed_link($post->post_author, $feed);
                 $author_feed_uri = str_replace($domain_url, '', $author_feed_link);
                 $uris[] = $author_feed_uri;
             }
         }
         if ($this->_config->get_boolean('pgcache.purge.feed.terms')) {
             foreach ($terms as $term) {
                 foreach ($feeds as $feed) {
                     $term_feed_link = get_term_feed_link($term->term_id, $term->taxonomy, $feed);
                     $term_feed_uri = str_replace($domain_url, '', $term_feed_link);
                     $uris[] = $term_feed_uri;
                 }
             }
         }
         /**
          * Flush cache
          */
         if (count($uris)) {
             $cache =& $this->_get_cache();
             $mobile_groups = $this->_get_mobile_groups();
             $referrer_groups = $this->_get_referrer_groups();
             $encryptions = $this->_get_encryptions();
             $compressions = $this->_get_compressions();
             foreach ($uris as $uri) {
                 foreach ($mobile_groups as $mobile_group) {
                     foreach ($referrer_groups as $referrer_group) {
                         foreach ($encryptions as $encryption) {
                             foreach ($compressions as $compression) {
                                 $page_key = $this->_get_page_key($uri, $mobile_group, $referrer_group, $encryption, $compression);
                                 $cache->delete($page_key);
                             }
                         }
                     }
                 }
             }
             /**
              * Purge varnish servers
              */
             if ($this->_config->get_boolean('varnish.enabled')) {
                 $varnish =& w3_instance('W3_Varnish');
                 foreach ($uris as $uri) {
                     $varnish->purge($uri);
                 }
             }
         }
         return true;
     }
     return false;
 }
예제 #2
0
 /**
  * Support form action
  *
  * @return void
  */
 function action_support_form()
 {
     global $current_user;
     w3_require_once(W3TC_LIB_W3_DIR . '/Request.php');
     $name = '';
     $email = '';
     $request_type = W3_Request::get_string('request_type');
     if (!isset($this->_request_types[$request_type])) {
         $request_type = 'bug_report';
     }
     if (is_a($current_user, 'WP_User')) {
         if ($current_user->first_name) {
             $name = $current_user->first_name;
         }
         if ($current_user->last_name) {
             $name .= ($name != '' ? ' ' : '') . $current_user->last_name;
         }
         if ($name == 'admin') {
             $name = '';
         }
         if ($current_user->user_email) {
             $email = $current_user->user_email;
         }
     }
     $theme = w3tc_get_current_theme();
     $template_files = isset($theme['Template Files']) ? (array) $theme['Template Files'] : array();
     $ajax = W3_Request::get_boolean('ajax');
     $request_id = W3_Request::get_string('request_id', date('YmdHi'));
     $payment = W3_Request::get_boolean('payment');
     $url = W3_Request::get_string('url', w3_get_domain_url());
     $name = W3_Request::get_string('name', $name);
     $email = W3_Request::get_string('email', $email);
     $twitter = W3_Request::get_string('twitter');
     $phone = W3_Request::get_string('phone');
     $subject = W3_Request::get_string('subject');
     $description = W3_Request::get_string('description');
     $templates = W3_Request::get_array('templates');
     $forum_url = W3_Request::get_string('forum_url');
     $wp_login = W3_Request::get_string('wp_login');
     $wp_password = W3_Request::get_string('wp_password');
     $ftp_host = W3_Request::get_string('ftp_host');
     $ftp_login = W3_Request::get_string('ftp_login');
     $ftp_password = W3_Request::get_string('ftp_password');
     $subscribe_releases = W3_Request::get_string('subscribe_releases');
     $subscribe_customer = W3_Request::get_string('subscribe_customer');
     include W3TC_INC_DIR . '/options/support/form.php';
 }
예제 #3
0
/**
 * Returns domain url regexp
 *
 * @return string
 */
function w3_get_domain_url_regexp()
{
    $domain_url = w3_get_domain_url();
    $regexp = w3_get_url_regexp($domain_url);
    return $regexp;
}
예제 #4
0
 /**
  * @param null $domain_url
  * @param null $home_url
  */
 function __construct($domain_url = null, $home_url = null)
 {
     $this->domain_url = $domain_url ? $domain_url : w3_get_domain_url();
     $this->home_url = $home_url ? $home_url : w3_get_home_url();
 }
예제 #5
0
 /**
  * Takes a root relative path and converts to a full uri
  * @param $path
  * @return string
  */
 function relative_path_to_url($path)
 {
     $cdnuri = $this->docroot_filename_to_uri(ltrim($path, "/"));
     return rtrim(w3_get_domain_url(), "/") . '/' . $cdnuri;
 }
예제 #6
0
 /**
  * Purge CDN completely
  * @param $results
  * @return bool
  */
 function purge_all(&$results)
 {
     if (empty($this->_config['authorization_key'])) {
         $results = $this->_get_results(array(), W3TC_CDN_RESULT_HALT, __('Empty Authorization Key.', 'w3-total-cache'));
         return false;
     }
     if (empty($this->_config['alias']) || empty($this->_config['consumerkey']) || empty($this->_config['consumersecret'])) {
         $results = $this->_get_results(array(), W3TC_CDN_RESULT_HALT, __('Malformed Authorization Key.', 'w3-total-cache'));
         return false;
     }
     if (!class_exists('NetDNA')) {
         w3_require_once(W3TC_LIB_NETDNA_DIR . '/NetDNA.php');
     }
     $api = new NetDNA($this->_config['alias'], $this->_config['consumerkey'], $this->_config['consumersecret']);
     $results = array();
     $local_path = $remote_path = '';
     $domain_is_valid = 0;
     $found_domain = false;
     try {
         if ($this->_config['zone_id'] != 0) {
             $zone_id = $this->_config['zone_id'];
         } else {
             $zone_id = $api->get_zone_id(w3_get_home_url());
         }
         if ($zone_id == 0) {
             $zone_id = $api->get_zone_id(w3_get_domain_url());
         }
         if ($zone_id == 0) {
             $zone_id = $api->get_zone_id(str_replace('://', '://www.', w3_get_domain_url()));
         }
         if ($zone_id == 0 || is_null($zone_id)) {
             if (w3_get_domain_url() == w3_get_home_url()) {
                 $results[] = $this->_get_result($local_path, $remote_path, W3TC_CDN_RESULT_ERROR, sprintf(__('No zones match site: %s.', 'w3-total-cache'), trim(w3_get_home_url(), '/')));
             } else {
                 $results[] = $this->_get_result($local_path, $remote_path, W3TC_CDN_RESULT_ERROR, sprintf(__('No zones match site: %s or %s.', 'w3-total-cache'), trim(w3_get_home_url(), '/'), trim(w3_get_domain_url(), '/')));
             }
             return !$this->_is_error($results);
         }
         $pullzone = json_decode($api->get('/zones/pull.json/' . $zone_id));
         try {
             if (preg_match("(200|201)", $pullzone->code)) {
                 $custom_domains_full = json_decode($api->get('/zones/pull/' . $pullzone->data->pullzone->id . '/customdomains.json'));
                 $custom_domains = array();
                 foreach ($custom_domains_full->data->customdomains as $custom_domain_full) {
                     $custom_domains[] = $custom_domain_full->custom_domain;
                 }
                 $local_path = 'all';
                 $remote_path = 'all';
                 $domain_is_valid = 0;
                 $found_domain = false;
                 if ($pullzone->data->pullzone->name . '.' . $this->_config['alias'] . '.' . W3TC_CDN_NETDNA_URL === $this->get_domain($local_path) || in_array($this->get_domain($local_path), $custom_domains)) {
                     try {
                         $params = array('file' => '/' . $local_path);
                         $file_purge = json_decode($api->delete('/zones/pull.json/' . $pullzone->data->pullzone->id . '/cache'));
                         if (preg_match("(200|201)", $file_purge->code)) {
                             $results[] = $this->_get_result($local_path, $remote_path, W3TC_CDN_RESULT_OK, __('OK', 'w3-total-cache'));
                         } else {
                             if (preg_match("(401|500)", $file_purge->code)) {
                                 $results[] = $this->_get_result($local_path, $remote_path, W3TC_CDN_RESULT_ERROR, sprintf(__('Failed with error code %s. Please check your alias, consumer key, and private key.', 'w3-total-cache'), $file_purge->code));
                             } else {
                                 $results[] = $this->_get_result($local_path, $remote_path, W3TC_CDN_RESULT_ERROR, __('Failed with error code ', 'w3-total-cache') . $file_purge->code);
                             }
                         }
                         $found_domain = true;
                     } catch (CurlException $e) {
                         $results[] = $this->_get_result($local_path, $remote_path, W3TC_CDN_RESULT_HALT, sprintf(__('Unable to purge (%s).', 'w3-total-cache'), $e->getMessage()));
                     }
                 } else {
                     $results[] = $this->_get_result($local_path, $remote_path, W3TC_CDN_RESULT_ERROR, sprintf(__('No registered CNAMEs match %s.', 'w3-total-cache'), $this->get_domain($local_path)));
                     return !$this->_is_error($results);
                 }
             } else {
                 if (preg_match("(401|500)", $pullzone->code)) {
                     $results[] = $this->_get_result($local_path, $remote_path, W3TC_CDN_RESULT_ERROR, sprintf(__('Failed with error code %s. Please check your alias, consumer key, and private key.', 'w3-total-cache'), $pullzone->code));
                 } else {
                     $results[] = $this->_get_result($local_path, $remote_path, W3TC_CDN_RESULT_ERROR, __('Failed with error code ', 'w3-total-cache') . $pullzone->code);
                 }
             }
         } catch (CurlException $e) {
             $results[] = $this->_get_result($local_path, $remote_path, W3TC_CDN_RESULT_HALT, sprintf(__('Unable to purge (%s).', 'w3-total-cache'), $e->getMessage()));
         }
     } catch (CurlException $e) {
         $results[] = $this->_get_result($local_path, $remote_path, W3TC_CDN_RESULT_HALT, __('Failure to pull zone: ', 'w3-total-cache') . $e->getMessage());
     }
     if ($domain_is_valid > 0 && !$found_domain) {
         $results[] = $this->_get_result($local_path, $remote_path, W3TC_CDN_RESULT_ERROR, __('No zones match custom domain.', 'w3-total-cache'));
     } elseif (!$found_domain) {
         $results[] = $this->_get_result($local_path, $remote_path, W3TC_CDN_RESULT_ERROR, sprintf(__('No zones match site: %s.', 'w3-total-cache'), trim(w3_get_home_url(), '/')));
     }
     return !$this->_is_error($results);
 }
예제 #7
0
파일: define.php 프로젝트: alx/SBek-Arak
/**
 * Translates URL to local path
 * @param string $url
 * @return string
 */
function w3_translate_file($url)
{
    if (!w3_is_url($url)) {
        $url = w3_get_domain_url() . '/' . ltrim($url, '/\\');
    }
    $site_url_regexp = '~' . w3_get_site_url_regexp() . '~i';
    if (preg_match($site_url_regexp, $url) && strstr($url, '?') === false) {
        $url = preg_replace($site_url_regexp, '', $url);
        $url = w3_get_site_path() . ltrim($url, '/\\');
    }
    $url = ltrim($url, '/');
    return $url;
}
 /**
  * Flushes varnish post cache
  *
  * @param integer $post_id
  * @return boolean
  */
 function flush_post($post_id)
 {
     if (!$post_id) {
         $post_id = w3_detect_post_id();
     }
     if ($post_id) {
         $full_urls = array();
         $global_urls = array();
         $post = null;
         $terms = array();
         $feeds = $this->_config->get_array('pgcache.purge.feed.types');
         $limit_post_pages = $this->_config->get_integer('pgcache.purge.postpages_limit');
         if ($this->_config->get_boolean('pgcache.purge.terms') || $this->_config->get_boolean('varnish.pgcache.feed.terms')) {
             $taxonomies = get_post_taxonomies($post_id);
             $terms = wp_get_post_terms($post_id, $taxonomies);
         }
         $purge_urls = w3_instance('W3_PageUrls');
         switch (true) {
             case $this->_config->get_boolean('pgcache.purge.author'):
             case $this->_config->get_boolean('pgcache.purge.archive.daily'):
             case $this->_config->get_boolean('pgcache.purge.archive.monthly'):
             case $this->_config->get_boolean('pgcache.purge.archive.yearly'):
             case $this->_config->get_boolean('pgcache.purge.feed.author'):
                 $post = get_post($post_id);
         }
         $front_page = get_option('show_on_front');
         /**
          * Home (Frontpage) URL
          */
         if ($this->_config->get_boolean('pgcache.purge.home') && $front_page == 'posts' || $this->_config->get_boolean('pgcache.purge.front_page')) {
             $global_urls = array_merge($global_urls, $purge_urls->get_frontpage_urls($limit_post_pages));
         }
         /**
          * Home (Post page) URL
          */
         if ($this->_config->get_boolean('pgcache.purge.home') && $front_page != 'posts') {
             $global_urls = array_merge($global_urls, $purge_urls->get_postpage_urls($limit_post_pages));
         }
         /**
          * Post URL
          */
         if ($this->_config->get_boolean('pgcache.purge.post')) {
             $full_urls = array_merge($full_urls, $purge_urls->get_post_urls($post_id));
         }
         /**
          * Post comments URLs
          */
         if ($this->_config->get_boolean('pgcache.purge.comments') && function_exists('get_comments_pagenum_link')) {
             $full_urls = array_merge($full_urls, $purge_urls->get_post_comments_urls($post_id));
         }
         /**
          * Post author URLs
          */
         if ($this->_config->get_boolean('pgcache.purge.author') && $post) {
             $full_urls = array_merge($full_urls, $purge_urls->get_post_author_urls($post->post_author, $limit_post_pages));
         }
         /**
          * Post terms URLs
          */
         if ($this->_config->get_boolean('pgcache.purge.terms')) {
             $full_urls = array_merge($full_urls, $purge_urls->get_post_terms_urls($terms, $limit_post_pages));
         }
         /**
          * Daily archive URLs
          */
         if ($this->_config->get_boolean('pgcache.purge.archive.daily') && $post) {
             $full_urls = array_merge($full_urls, $purge_urls->get_daily_archive_urls($post, $limit_post_pages));
         }
         /**
          * Monthly archive URLs
          */
         if ($this->_config->get_boolean('pgcache.purge.archive.monthly') && $post) {
             $full_urls = array_merge($full_urls, $purge_urls->get_montly_archive_urls($post, $limit_post_pages));
         }
         /**
          * Yearly archive URLs
          */
         if ($this->_config->get_boolean('pgcache.purge.archive.yearly') && $post) {
             $full_urls = array_merge($full_urls, $purge_urls->get_yearly_archive_urls($post, $limit_post_pages));
         }
         /**
          * Feed URLs
          */
         if ($this->_config->get_boolean('pgcache.purge.feed.blog')) {
             $global_urls = array_merge($global_urls, $purge_urls->get_feed_urls($feeds));
         }
         if ($this->_config->get_boolean('pgcache.purge.feed.comments')) {
             $full_urls = array_merge($full_urls, $purge_urls->get_feed_comments_urls($post_id, $feeds));
         }
         if ($this->_config->get_boolean('pgcache.purge.feed.author') && $post) {
             $full_urls = array_merge($full_urls, $purge_urls->get_feed_author_urls($post->post_author, $feeds));
         }
         if ($this->_config->get_boolean('pgcache.purge.feed.terms')) {
             $full_urls = array_merge($full_urls, $purge_urls->get_feed_terms_urls($terms, $feeds));
         }
         /**
          * Purge selected pages
          */
         if ($this->_config->get_array('pgcache.purge.pages')) {
             $pages = $this->_config->get_array('pgcache.purge.pages');
             $full_urls = array_merge($full_urls, $purge_urls->get_pages_urls($pages));
         }
         if ($this->_config->get_string('pgcache.purge.sitemap_regex')) {
             $sitemap_regex = $this->_config->get_string('pgcache.purge.sitemap_regex');
             $full_urls[] = w3_get_domain_url() . '/' . trim($sitemap_regex, "^\$");
         }
         if ($this->_do_flush_global_urls()) {
             $full_urls = array_merge($global_urls, $full_urls);
         } elseif ($this->_flushes == 0) {
             $this->_repeated_urls = $global_urls;
         }
         /**
          * Flush cache
          */
         if (count($full_urls)) {
             $this->_flushes++;
             foreach ($full_urls as $url) {
                 if (!in_array($url, $this->_repeated_urls) && !in_array($url, $this->_flushed_urls)) {
                     $this->_flushed_urls[] = $url;
                     $this->flush_url($url);
                 } elseif (!in_array($url, $this->_repeated_urls)) {
                     $this->_repeated_urls[] = $url;
                 }
             }
         }
         return true;
     }
     return false;
 }
예제 #9
0
 /**
  * Returns server info
  */
 function get_server_info()
 {
     global $wp_version, $wp_db_version, $wpdb;
     $wordpress_plugins = get_plugins();
     $wordpress_plugins_active = array();
     foreach ($wordpress_plugins as $wordpress_plugin_file => $wordpress_plugin) {
         if (is_plugin_active($wordpress_plugin_file)) {
             $wordpress_plugins_active[$wordpress_plugin_file] = $wordpress_plugin;
         }
     }
     $w3tc_config = (array) @(include W3TC_CONFIG_PATH);
     $mysql_version = (array) $wpdb->get_var('SELECT VERSION()');
     $mysql_variables_result = (array) $wpdb->get_results('SHOW VARIABLES', ARRAY_N);
     $mysql_variables = array();
     foreach ($mysql_variables_result as $mysql_variables_row) {
         $mysql_variables[$mysql_variables_row[0]] = $mysql_variables_row[1];
     }
     return array('wp' => array('version' => $wp_version, 'db_version' => $wp_db_version, 'w3tc_version' => W3TC_VERSION, 'url' => w3_get_domain_url(), 'path' => ABSPATH, 'email' => get_option('admin_email'), 'upload_info' => (array) w3_upload_info(), 'theme' => get_theme(get_current_theme()), 'plugins' => $wordpress_plugins_active, 'wp_cache' => defined('WP_CACHE') ? 'true' : 'false'), 'mysql' => array('version' => $mysql_version, 'variables' => $mysql_variables));
 }
예제 #10
0
/**
 * Returns domain url regexp
 *
 * @return string
 */
function w3_get_domain_url_regexp()
{
    $domain_url = w3_get_domain_url();
    $domain = preg_replace('~https?://~i', '', $domain_url);
    $regexp = 'https?://' . w3_preg_quote($domain);
    return $regexp;
}