Plugin Directory

Changeset 2464475


Ignore:
Timestamp:
01/28/2021 07:06:15 PM (5 years ago)
Author:
guelben
Message:

improved speed

Location:
bravo-translate/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • bravo-translate/trunk/functions.php

    r2463995 r2464475  
    163163
    164164add_action('wp_loaded', 'BRAVOTRAN_start');
    165 
     165add_action('shutdown', 'BRAVOTRAN_end');
    166166
    167167
    168168function BRAVOTRAN_begin_ob(){
    169   define("BRAVOTRAN_OB",true);
     169  error_log("sii");
     170  global $_BRAVOTRAN_OB;
     171  $_BRAVOTRAN_OB=true;
    170172  ob_start("BRAVOTRAN_Translate");
    171173}
     
    174176function BRAVOTRAN_start() {
    175177
    176   define("BRAVOTRAN_OB",false);
     178  global $_BRAVOTRAN_OB;
     179  $_BRAVOTRAN_OB=false;
    177180
    178181  $uri=$_SERVER["REQUEST_URI"];
     
    181184   return;
    182185  }
     186  if(strpos(" ".$uri,"/wp-includes/images/")!=false) {
     187    return;
     188   }
     189   if(strpos(" ".$uri,"favicon.ico")!=false) {
     190    return;
     191   }
    183192  if(strpos(" ".$uri,"/wp-admin/")!=false) {
    184193    return;
     
    186195
    187196  else{
     197    error_log("ha entrado".$uri);
    188198    BRAVOTRAN_begin_ob();
    189199  }
     
    192202
    193203function BRAVOTRAN_end() {
    194 
    195   if(BRAVOTRAN_OB){
    196 
     204 
     205  global $_BRAVOTRAN_OB;
     206  if($_BRAVOTRAN_OB){
     207error_log("nooo");
    197208    if (ob_get_length() > 0) {
    198209      ob_end_flush();
  • bravo-translate/trunk/readme.txt

    r2463995 r2464475  
    4444= 1.0 =
    4545* First release
     46= 1.1 =
     47* Improved speed
Note: See TracChangeset for help on using the changeset viewer.