WPAU : Fungsi exec()

WordPress Automatic Plugin Sangat diminati karena memudahkan untuk melakukan update plugin Upgrade ke wordpress terbaru secara otomatis dengan mudah.

Namun, plugin ini menggunakan exec() agar bisa bekerja dengan baik, dan ketika menggunaka Shared hosting fungsi ini termasuk disable_function php, sehingga plugin tersebut tidak dapat berjalan semestinya.

Apabila fungsi exec() di-disable pada server yang Anda gunakan, silahkan melakukan perubahan pada plugin WPAU tersebut. Berikut langkah-langkah nya :

    • Edit variabel $permission (function runFTPPrelimChecks) pada file wpau_prelimcheck.class.php

Sebelum dilakukan pengubahan :
[php]
$permission = exec(“ls -l $theFile |awk ‘{print $1}’”, $output, $error);
if($error == 0) {
//get the perms
$thePerms = $this->chmodnum(substr($permission, 1));
//if its 644 or 744 we cannot run man
//tell our wpau guy out there we need to change perms
//we only can write files when they are 766 or 666 lets see
$this->userPermission = $thePerms[0];
if($thePerms[2] < 6) {
$canRun = false;
}
}
else {
$canRun = false;
}
[/php]

Diubah menjadi :
[php]
$permission = is_writable($theFile);
if($permission == false){
$canRun = false;
} else {
$canRun = true;
}
[/php]

  • Edit fungsi zip_backup (perintah pengubahan permission), pada file wpau_db_backup.class.php
    Sebelum dilakukan pengubahan :
    [php]
    exec(“chmod 755 $archiveName”);
    [/php]
    Diubah menjadi :
    [php]
    chmod($archiveName, 0755);
    [/php]Pengubahan seperti diatas telah kami coba untuk melakukan upgrade otomatis dari WordPress versi 2.3.3 ke WordPress versi 2.5.1.

Comments

comments

Tags:
13 Comments

Add a Comment

Alamat email Anda tidak akan dipublikasikan. Ruas yang wajib ditandai *

*