Plugin Directory

Changeset 1413012


Ignore:
Timestamp:
05/09/2016 01:49:14 PM (10 years ago)
Author:
Ali.Dbg
Message:

Update to v4.2.2

Location:
wp-farsi/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wp-farsi/trunk/readme.txt

    r1406785 r1413012  
    4444
    4545== Changelog ==
     46
     47= 4.2.2 =
     48* رفع مشکل با زمانبند انتشار پست
     49* رفع اشکال در زمان غیرفعال سازی پلاگین
     50* تست با پی اچ پی ورژن 7
     51* تست با وردپرس 4.5.2
    4652
    4753= 4.1.1 =
  • wp-farsi/trunk/wp-farsi.php

    r1406786 r1413012  
    66Author: Ali.Dbg 😉
    77Author URI: https://github.com/alidbg/wp-farsi
    8 Version: 4.1.1
     8Version: 4.2.2
    99License: GPLv3 (http://www.gnu.org/licenses/gpl-3.0.html)
    1010*/
     
    3333
    3434function wpfa_file_put_contents($file = '', $str = '') {
    35     $fp = fopen($file, "w");
    36     if (!$fp || !flock($fp, LOCK_EX | LOCK_NB, $e) || $e)
    37         return false;
    38     fwrite($fp, $str);
    39     sleep(2);
     35    $r=0;$m=300;
     36    if (($fp = fopen($file, "w")) === FALSE) return false;
     37    do {
     38        if ($r > 0) usleep(mt_rand(1, 50000));
     39        $r += 1;
     40    } while (!flock($fp, LOCK_EX | LOCK_NB, $e) || $e);
     41    if ($r == $m) return false;
     42    $fw = fwrite($fp, $str);
     43    usleep(1000);
    4044    flock($fp, LOCK_UN);
    4145    fclose($fp);
     46    if ($fw === FALSE)
     47        return false;
     48    else
     49        return true;
    4250}
    4351
    4452function wpfa_file_get_contents($file = '') {
    45     $content = '';
    46     $fp = fopen($file, "r");
    47     if (!$fp || !flock($fp, LOCK_EX | LOCK_NB, $e) || $e)
    48         return false;
    49     $content = fread($fp, filesize($file));
    50     usleep(100000);
     53    $c='';$r=0;$m=300;
     54    if (($fp = fopen($file, "r")) === FALSE) return false; 
     55    do {
     56        if ($r > 0) usleep(mt_rand(1, 50000));
     57        $r += 1;
     58    } while (!flock($fp, LOCK_EX | LOCK_NB, $e) || $e);
     59    if ($r == $m) return false;
     60    $c = fread($fp, filesize($file));
     61    usleep(1000);
    5162    flock($fp, LOCK_UN);
    5263    fclose($fp);
    53     return $content;
     64    return $c;
    5465}
    5566
     
    104115
    105116function exception_date() {
    106     if (iss_uri('/feed') or iss_uri('feed=') or defined('WXR_VERSION') or isset($autosave) or isset($lasttime) or isset($signup))
     117    if (iss_uri('/feed') or iss_uri('feed=') or defined('WXR_VERSION') or class_exists('wp_xmlrpc_server') or isset($valid_date))
    107118        return true;
    108119    return false;
Note: See TracChangeset for help on using the changeset viewer.