First commit

This commit is contained in:
Thang Hoang Van 2014-03-19 23:58:52 +07:00
parent 6ebafb4262
commit 5106760db7
29 changed files with 11394 additions and 0 deletions

View file

@ -0,0 +1,640 @@
<?php
class MainWPBackup
{
protected static $instance = null;
protected $zip;
protected $zipArchiveFileCount;
protected $zipArchiveSizeCount;
protected $zipArchiveFileName;
protected $file_descriptors;
protected function __construct()
{
}
public static function get()
{
if (self::$instance == null)
{
self::$instance = new MainWPBackup();
}
return self::$instance;
}
/**
* Create full backup
*
* @return array Array consisting of timestamp and the created file path
*/
public function createFullBackup($excludes, $filePrefix = '', $addConfig = false, $includeCoreFiles = false, $file_descriptors = 0)
{
$this->file_descriptors = $file_descriptors;
$dirs = MainWPHelper::getMainWPDir('backup');
$backupdir = $dirs[0];
if (!defined('PCLZIP_TEMPORARY_DIR')) define('PCLZIP_TEMPORARY_DIR', $backupdir);
$timestamp = time();
if ($filePrefix != '') $filePrefix .= '-';
$filepath = $backupdir . 'backup-' . $filePrefix . $timestamp . '.zip';
$fileurl = $dirs[1] . 'backup-' . $filePrefix . $timestamp . '.zip';
if ($dh = opendir($backupdir))
{
while (($file = readdir($dh)) !== false)
{
if ($file != '.' && $file != '..' && preg_match('/^backup-(.*).zip/', $file))
{
@unlink($backupdir . $file);
}
}
closedir($dh);
}
if (!$addConfig)
{
if (!in_array(str_replace(ABSPATH, '', WP_CONTENT_DIR), $excludes) && !in_array('wp-admin', $excludes) && !in_array(WPINC, $excludes))
{
$addConfig = true;
$includeCoreFiles = true;
}
}
$time = 300; /*300 seconds = 5 minutes*/
$mem = '512M';
@ini_set('memory_limit', $mem);
@ini_set('max_execution_time', $time);
$success = false;
if ($this->checkZipSupport() && $this->createZipFullBackup($filepath, $excludes, $addConfig, $includeCoreFiles))
{
$success = true;
}
else if ($this->checkZipConsole() && $this->createZipConsoleFullBackup($filepath, $excludes, $addConfig, $includeCoreFiles))
{
$success = true;
}
else if ($this->createZipPclFullBackup2($filepath, $excludes, $addConfig, $includeCoreFiles))
{
$success = true;
}
return ($success) ? array(
'timestamp' => $timestamp,
'file' => $fileurl,
'filesize' => filesize($filepath)
) : false;
}
/**
* Check for default PHP zip support
*
* @return bool
*/
public function checkZipSupport()
{
return class_exists('ZipArchive');
}
/**
* Check if we could run zip on console
*
* @return bool
*/
public function checkZipConsole()
{
return false;
// return function_exists('system');
}
/**
* Create full backup using default PHP zip library
*
* @param string $filepath File path to create
* @return bool
*/
public function createZipFullBackup($filepath, $excludes, $addConfig = false, $includeCoreFiles = false)
{
$this->zip = new ZipArchive();
$this->zipArchiveFileCount = 0;
$this->zipArchiveSizeCount = 0;
$this->zipArchiveFileName = $filepath;
$zipRes = $this->zip->open($filepath, ZipArchive::CREATE);
if ($zipRes)
{
$nodes = glob(ABSPATH . '*');
if (!$includeCoreFiles)
{
$coreFiles = array('favicon.ico', 'index.php', 'license.txt', 'readme.html', 'wp-activate.php', 'wp-app.php', 'wp-blog-header.php', 'wp-comments-post.php', 'wp-config.php', 'wp-config-sample.php', 'wp-cron.php', 'wp-links-opml.php', 'wp-load.php', 'wp-login.php', 'wp-mail.php', 'wp-pass.php', 'wp-register.php', 'wp-settings.php', 'wp-signup.php', 'wp-trackback.php', 'xmlrpc.php');
foreach ($nodes as $key => $node)
{
if (MainWPHelper::startsWith($node, ABSPATH . WPINC))
{
unset($nodes[$key]);
}
else if (MainWPHelper::startsWith($node, ABSPATH . basename(admin_url(''))))
{
unset($nodes[$key]);
}
else
{
foreach ($coreFiles as $coreFile)
{
if ($node == ABSPATH . $coreFile) unset($nodes[$key]);
}
}
}
unset($coreFiles);
}
$this->createBackupDB(dirname($filepath) . DIRECTORY_SEPARATOR . 'dbBackup.sql');
$this->addFileToZip(dirname($filepath) . DIRECTORY_SEPARATOR . 'dbBackup.sql', basename(WP_CONTENT_DIR) . '/' . 'dbBackup.sql');
if (file_exists(ABSPATH . '.htaccess')) $this->addFileToZip(ABSPATH . '.htaccess', 'mainwp-htaccess');
foreach ($nodes as $node)
{
if ($excludes == null || !in_array(str_replace(ABSPATH, '', $node), $excludes))
{
if (is_dir($node))
{
$this->zipAddDir($node, $excludes);
}
else if (is_file($node))
{
$this->addFileToZip($node, str_replace(ABSPATH, '', $node));
}
}
}
if ($addConfig)
{
global $wpdb;
$plugins = array();
$dir = WP_CONTENT_DIR . '/plugins/';
$fh = @opendir($dir);
while ($entry = @readdir($fh))
{
if (!@is_dir($dir . $entry)) continue;
if (($entry == '.') || ($entry == '..')) continue;
$plugins[] = $entry;
}
@closedir($fh);
$themes = array();
$dir = WP_CONTENT_DIR . '/themes/';
$fh = @opendir($dir);
while ($entry = @readdir($fh))
{
if (!@is_dir($dir . $entry)) continue;
if (($entry == '.') || ($entry == '..')) continue;
$themes[] = $entry;
}
@closedir($fh);
$string = base64_encode(serialize(array('siteurl' => get_option('siteurl'),
'home' => get_option('home'),
'abspath' => ABSPATH,
'prefix' => $wpdb->prefix,
'lang' => WPLANG,
'plugins' => $plugins,
'themes' => $themes)));
$this->addFileFromStringToZip('clone/config.txt', $string);
}
$return = $this->zip->close();
@unlink(dirname($filepath) . DIRECTORY_SEPARATOR . 'dbBackup.sql');
return $return;
}
return false;
}
/**
* Create full backup using pclZip library
*
* @param string $filepath File path to create
* @return bool
*/
public function createZipPclFullBackup($filepath, $excludes, $addConfig, $includeCoreFiles)
{
require_once ( ABSPATH . 'wp-admin/includes/class-pclzip.php');
$this->zip = new PclZip($filepath);
$nodes = glob(ABSPATH . '*');
if (!$includeCoreFiles)
{
$coreFiles = array('favicon.ico', 'index.php', 'license.txt', 'readme.html', 'wp-activate.php', 'wp-app.php', 'wp-blog-header.php', 'wp-comments-post.php', 'wp-config.php', 'wp-config-sample.php', 'wp-cron.php', 'wp-links-opml.php', 'wp-load.php', 'wp-login.php', 'wp-mail.php', 'wp-pass.php', 'wp-register.php', 'wp-settings.php', 'wp-signup.php', 'wp-trackback.php', 'xmlrpc.php');
foreach ($nodes as $key => $node)
{
if (MainWPHelper::startsWith($node, ABSPATH . WPINC))
{
unset($nodes[$key]);
}
else if (MainWPHelper::startsWith($node, ABSPATH . basename(admin_url(''))))
{
unset($nodes[$key]);
}
else
{
foreach ($coreFiles as $coreFile)
{
if ($node == ABSPATH . $coreFile) unset($nodes[$key]);
}
}
}
unset($coreFiles);
}
$this->createBackupDB(dirname($filepath) . DIRECTORY_SEPARATOR . 'dbBackup.sql');
$error = false;
if (($rslt = $this->zip->add(dirname($filepath) . DIRECTORY_SEPARATOR . 'dbBackup.sql', PCLZIP_OPT_REMOVE_PATH, dirname($filepath), PCLZIP_OPT_ADD_PATH, basename(WP_CONTENT_DIR))) == 0) $error = true;
@unlink(dirname($filepath) . DIRECTORY_SEPARATOR . 'dbBackup.sql');
if (!$error)
{
foreach ($nodes as $node)
{
if ($excludes == null || !in_array(str_replace(ABSPATH, '', $node), $excludes))
{
if (is_dir($node))
{
if (!$this->pclZipAddDir($node, $excludes))
{
$error = true;
break;
}
}
else if (is_file($node))
{
if (($rslt = $this->zip->add($node, PCLZIP_OPT_REMOVE_PATH, ABSPATH)) == 0)
{
$error = true;
break;
}
}
}
}
}
if ($addConfig)
{
global $wpdb;
$string = base64_encode(serialize(array('siteurl' => get_option('siteurl'),
'home' => get_option('home'), 'abspath' => ABSPATH, 'prefix' => $wpdb->prefix, 'lang' => WPLANG)));
$this->addFileFromStringToPCLZip('clone/config.txt', $string, $filepath);
}
if ($error)
{
@unlink($filepath);
return false;
}
return true;
}
function copy_dir( $nodes, $excludes, $backupfolder ) {
if (!is_array($nodes)) return;
foreach ($nodes as $node)
{
if ($excludes == null || !in_array(str_replace(ABSPATH, '', $node), $excludes))
{
if (is_dir($node))
{
if( !file_exists( str_replace(ABSPATH, $backupfolder, $node) ) )
@mkdir ( str_replace(ABSPATH, $backupfolder, $node) );
$newnodes = glob($node . DIRECTORY_SEPARATOR . '*');
$this->copy_dir($newnodes, $excludes, $backupfolder);
unset($newnodes);
}
else if (is_file($node))
{
@copy($node, str_replace(ABSPATH, $backupfolder, $node));
}
}
}
}
public function createZipPclFullBackup2($filepath, $excludes, $addConfig, $includeCoreFiles)
{
global $classDir;
//Create backup folder
$backupFolder = dirname($filepath) . DIRECTORY_SEPARATOR . 'backup' . DIRECTORY_SEPARATOR;
@mkdir($backupFolder);
//Create DB backup
$this->createBackupDB($backupFolder . 'dbBackup.sql');
//Copy installation to backup folder
$nodes = glob(ABSPATH . '*');
if (!$includeCoreFiles)
{
$coreFiles = array('favicon.ico', 'index.php', 'license.txt', 'readme.html', 'wp-activate.php', 'wp-app.php', 'wp-blog-header.php', 'wp-comments-post.php', 'wp-config.php', 'wp-config-sample.php', 'wp-cron.php', 'wp-links-opml.php', 'wp-load.php', 'wp-login.php', 'wp-mail.php', 'wp-pass.php', 'wp-register.php', 'wp-settings.php', 'wp-signup.php', 'wp-trackback.php', 'xmlrpc.php');
foreach ($nodes as $key => $node)
{
if (MainWPHelper::startsWith($node, ABSPATH . WPINC))
{
unset($nodes[$key]);
}
else if (MainWPHelper::startsWith($node, ABSPATH . basename(admin_url(''))))
{
unset($nodes[$key]);
}
else
{
foreach ($coreFiles as $coreFile)
{
if ($node == ABSPATH . $coreFile) unset($nodes[$key]);
}
}
}
unset($coreFiles);
}
$this->copy_dir($nodes, $excludes, $backupFolder);
unset($nodes);
//Zip this backup folder..
require_once ( ABSPATH . 'wp-admin/includes/class-pclzip.php');
$this->zip = new PclZip($filepath);
$this->zip->create($backupFolder, PCLZIP_OPT_REMOVE_PATH, $backupFolder);
if ($addConfig)
{
global $wpdb;
$string = base64_encode(serialize(array('siteurl' => get_option('siteurl'),
'home' => get_option('home'), 'abspath' => ABSPATH, 'prefix' => $wpdb->prefix, 'lang' => WPLANG)));
$this->addFileFromStringToPCLZip('clone/config.txt', $string, $filepath);
}
//Remove backup folder
MainWPHelper::delete_dir($backupFolder);
return true;
}
/**
* Recursive add directory for default PHP zip library
*/
public function zipAddDir($path, $excludes)
{
$this->zip->addEmptyDir(str_replace(ABSPATH, '', $path));
if (file_exists(rtrim($path, '/') . '/.htaccess')) $this->addFileToZip(rtrim($path, '/') . '/.htaccess', rtrim(str_replace(ABSPATH, '', $path), '/') . '/mainwp-htaccess');
$nodes = glob(rtrim($path, '/') . '/*');
if (empty($nodes)) return true;
foreach ($nodes as $node)
{
if ($excludes == null || !in_array(str_replace(ABSPATH, '', $node), $excludes))
{
if (is_dir($node))
{
$this->zipAddDir($node, $excludes);
}
else if (is_file($node))
{
$this->addFileToZip($node, str_replace(ABSPATH, '', $node));
}
}
}
}
public function pclZipAddDir($path, $excludes)
{
$error = false;
$nodes = glob(rtrim($path, '/') . '/*');
if (empty($nodes)) return true;
foreach ($nodes as $node)
{
if ($excludes == null || !in_array(str_replace(ABSPATH, '', $node), $excludes))
{
if (is_dir($node))
{
if (!$this->pclZipAddDir($node, $excludes))
{
$error = true;
break;
}
}
else if (is_file($node))
{
if (($rslt = $this->zip->add($node, PCLZIP_OPT_REMOVE_PATH, ABSPATH)) == 0)
{
$error = true;
break;
}
}
}
}
return !$error;
}
function addFileFromStringToZip($file, $string)
{
return $this->zip->addFromString($file, $string);
}
public function addFileFromStringToPCLZip($file, $string, $filepath)
{
$file = preg_replace("/(?:\.|\/)*(.*)/", "$1", $file);
$localpath = dirname($file);
$tmpfilename = dirname($filepath). '/' . basename($file);
if (false !== file_put_contents($tmpfilename, $string)) {
$this->zip->delete(PCLZIP_OPT_BY_NAME, $file);
$add = $this->zip->add($tmpfilename,
PCLZIP_OPT_REMOVE_PATH, dirname($filepath),
PCLZIP_OPT_ADD_PATH, $localpath);
unlink($tmpfilename);
if (!empty($add)) {
return true;
}
}
return false;
}
function addFileToZip($path, $zipEntryName)
{
// this would fail with status ZIPARCHIVE::ER_OPEN
// after certain number of files is added since
// ZipArchive internally stores the file descriptors of all the
// added files and only on close writes the contents to the ZIP file
// see: http://bugs.php.net/bug.php?id=40494
// and: http://pecl.php.net/bugs/bug.php?id=9443
// return $zip->addFile( $path, $zipEntryName );
$this->zipArchiveFileCount++;
$this->zipArchiveSizeCount += filesize($path);
$added = $this->zip->addFile($path, $zipEntryName);
// if (true || filesize($path) > 10485760)
// {
// echo 'addFile ' . $path . ' : ' . $added . '<br />';
// }
// else
// {
// $contents = file_get_contents($path);
// if ($contents === false)
// {
// return false;
// }
// $added = $this->zip->addFromString($zipEntryName, $contents);
// }
//Over limits? 30 files or 30MB of files added
// if (($this->zipArchiveFileCount >= 254) || ($this->zipArchiveSizeCount >= 31457280))
if ((($this->file_descriptors > 0) && ($this->zipArchiveFileCount > $this->file_descriptors)) || $this->zipArchiveSizeCount >= (31457280 * 2))
{
$this->zip->close();
$this->zip->open($this->zipArchiveFileName);
$this->zipArchiveFileCount = 0;
$this->zipArchiveSizeCount = 0;
}
return $added;
}
/**
* Create full backup using zip on console
*
* @param string $filepath File path to create
* @return bool
*/
public function createZipConsoleFullBackup($filepath, $excludes, $addConfig)
{
// @TODO to work with 'zip' from system if PHP Zip library not available
//system('zip');
return false;
}
/**
* Create full SQL backup
*
* @return string The SQL string
*/
public function createBackupDB($filepath)
{
$fh = fopen($filepath, 'w'); //or error;
global $wpdb;
//Get all the tables
$tables_db = $wpdb->get_results('SHOW TABLES FROM `' . DB_NAME . '`', ARRAY_N);
foreach ($tables_db as $curr_table)
{
$table = $curr_table[0];
fwrite($fh, "\n\n" . 'DROP TABLE IF EXISTS ' . $table . ';');
$table_create = $wpdb->get_row('SHOW CREATE TABLE ' . $table, ARRAY_N);
fwrite($fh, "\n" . $table_create[1] . ";\n\n");
$rows = @MainWPChildDB::_query('SELECT * FROM ' . $table, $wpdb->dbh);
if ($rows)
{
$table_insert = 'INSERT INTO `' . $table . '` VALUES (';
while ($row = @MainWPChildDB::fetch_array($rows))
{
$query = $table_insert;
foreach ($row as $value)
{
$query.= '"'.MainWPChildDB::real_escape_string($value).'", ' ;
}
$query = trim($query, ', ') . ");";
fwrite($fh, "\n" . $query);
}
}
}
fclose($fh);
return true;
}
public function createBackupDB_legacy($filepath)
{
$fh = fopen($filepath, 'w'); //or error;
global $wpdb;
$maxchars = 50000;
//Get all the tables
$tables_db = $wpdb->get_results('SHOW TABLES FROM `' . DB_NAME . '`', ARRAY_N);
foreach ($tables_db as $curr_table)
{
$table = $curr_table[0];
fwrite($fh, "\n" . 'DROP TABLE IF EXISTS ' . $table . ';');
$table_create = $wpdb->get_row('SHOW CREATE TABLE ' . $table, ARRAY_N);
fwrite($fh, "\n" . $table_create[1] . ';');
//$rows = $wpdb->get_results('SELECT * FROM ' . $table, ARRAY_N);
$rows = @MainWPChildDB::_query('SELECT * FROM ' . $table, $wpdb->dbh);
if ($rows)
{
$table_columns = $wpdb->get_results('SHOW COLUMNS FROM ' . $table);
$table_columns_insert = '';
foreach ($table_columns as $table_column)
{
if ($table_columns_insert != '')
$table_columns_insert .= ', ';
$table_columns_insert .= '`' . $table_column->Field . '`';
}
$table_insert = 'INSERT INTO `' . $table . '` (';
$table_insert .= $table_columns_insert;
$table_insert .= ') VALUES ' . "\n";
$current_insert = $table_insert;
$inserted = false;
$add_insert = '';
while ($row = @MainWPChildDB::fetch_array($rows))
{
//Create new insert!
$add_insert = '(';
$add_insert_each = '';
foreach ($row as $value)
{
//$add_insert_each .= "'" . str_replace(array("\n", "\r", "'"), array('\n', '\r', "\'"), $value) . "',";
$value = addslashes($value);
$value = str_replace("\n","\\n",$value);
$value = str_replace("\r","\\r",$value);
$add_insert_each.= '"'.$value.'",' ;
}
$add_insert .= trim($add_insert_each, ',') . ')';
//If we already inserted something & the total is too long - commit previous!
if ($inserted && strlen($add_insert) + strlen($current_insert) >= $maxchars)
{
fwrite($fh, "\n" . $current_insert . ';');
$current_insert = $table_insert;
$current_insert .= $add_insert;
$inserted = false;
}
else
{
if ($inserted)
{
$current_insert .= ', ' . "\n";
}
$current_insert .= $add_insert;
}
$inserted = true;
}
if ($inserted)
{
fwrite($fh, "\n" . $current_insert . ';');
}
}
}
fclose($fh);
return true;
}
}
?>

3092
class/MainWPChild.class.php Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,119 @@
<?php
class MainWPChildDB
{
//Support old & new versions of wordpress (3.9+)
public static function use_mysqli()
{
/** @var $wpdb wpdb */
if (!function_exists( 'mysqli_connect' ) ) return false;
global $wpdb;
return ($wpdb->dbh instanceof mysqli);
}
public static function _query($query, $link)
{
if (self::use_mysqli())
{
return mysqli_query($link, $query);
}
else
{
return mysql_query($query, $link);
}
}
public static function fetch_array($result)
{
if (self::use_mysqli())
{
return mysqli_fetch_array($result, MYSQLI_ASSOC);
}
else
{
return mysql_fetch_array($result, MYSQL_ASSOC);
}
}
public static function num_rows($result)
{
if (self::use_mysqli())
{
return mysqli_num_rows($result);
}
else
{
return mysql_num_rows($result);
}
}
public static function connect($host, $user, $pass)
{
if (self::use_mysqli())
{
return mysqli_connect($host, $user, $pass);
}
else
{
return mysql_connect($host, $user, $pass);
}
}
public static function select_db($db)
{
if (self::use_mysqli())
{
/** @var $wpdb wpdb */
global $wpdb;
return mysqli_select_db($wpdb->dbh, $db);
}
else
{
return mysql_select_db($db);
}
}
public static function error()
{
if (self::use_mysqli())
{
/** @var $wpdb wpdb */
global $wpdb;
return mysqli_error($wpdb->dbh);
}
else
{
return mysql_error();
}
}
public static function real_escape_string($value)
{
/** @var $wpdb wpdb */
global $wpdb;
if (self::use_mysqli())
{
return mysqli_real_escape_string($wpdb->dbh, $value);
}
else
{
return mysql_real_escape_string($value, $wpdb->dbh);
}
}
public static function is_result($result)
{
if (self::use_mysqli())
{
return ($result instanceof mysqli_result);
}
else
{
return is_resource($result);
}
}
}

View file

@ -0,0 +1,450 @@
<?php
class MainWPChildServerInformation
{
public static function render()
{
?>
<br />
<table id="mainwp-table" class="wp-list-table widefat" cellspacing="0">
<thead>
<tr>
<th scope="col" class="manage-column sorted" style=""><span><?php _e('Server Configuration','mainwp'); ?></span></th>
<th scope="col" class="manage-column column-posts" style=""><?php _e('Suggested Value','mainwp'); ?></th>
<th scope="col" class="manage-column column-posts" style=""><?php _e('Value','mainwp'); ?></th>
<th scope="col" class="manage-column column-posts" style=""><?php _e('Status','mainwp'); ?></th>
</tr>
</thead>
<tbody id="the-sites-list" class="list:sites">
<?php
self::renderRow('WordPress Version', '>=', '3.4', 'getWordpressVersion');
self::renderRow('PHP Version', '>=', '5.2.4', 'getPHPVersion');
self::renderRow('MySQL Version', '>=', '5.0', 'getMySQLVersion');
self::renderRow('PHP Max Execution Time', '>=', '30', 'getMaxExecutionTime', 'seconds', '=', '0');
self::renderRow('PHP Upload Max Filesize', '>=', '2M', 'getUploadMaxFilesize', '(2MB+ best for upload of big plugins)');
self::renderRow('PHP Post Max Size', '>=', '2M', 'getPostMaxSize', '(2MB+ best for upload of big plugins)');
// self::renderRow('PHP Memory Limit', '>=', '128M', 'getPHPMemoryLimit', '(256M+ best for big backups)');
self::renderRow('PCRE Backtracking Limit', '>=', '10000', 'getOutputBufferSize');
self::renderRow('SSL Extension Enabled', '=', true, 'getSSLSupport');
?>
</tbody>
</table>
<br />
<table id="mainwp-table" class="wp-list-table widefat" cellspacing="0">
<thead>
<tr>
<th scope="col" class="manage-column sorted" style=""><span><?php _e('Directory name','mainwp'); ?></span></th>
<th scope="col" class="manage-column sorted" style=""><span><?php _e('Path','mainwp'); ?></span></th>
<th scope="col" class="manage-column column-posts" style=""><?php _e('Check','mainwp'); ?></th>
<th scope="col" class="manage-column column-posts" style=""><?php _e('Result','mainwp'); ?></th>
<th scope="col" class="manage-column column-posts" style=""><?php _e('Status','mainwp'); ?></th>
</tr>
</thead>
<tbody id="the-sites-list" class="list:sites">
<?php
self::checkDirectoryMainWPDirectory();
?>
</tbody>
</table>
<br/>
<table id="mainwp-table" class="wp-list-table widefat" cellspacing="0">
<thead>
<tr>
<th scope="col" class="manage-column sorted" style=""><span><?php _e('Server Info','mainwp'); ?></span></th>
<th scope="col" class="manage-column column-posts" style=""><span><?php _e('Value','mainwp'); ?></span></th>
</tr>
</thead>
<tbody id="the-sites-list" class="list:sites">
<tr><td><?php _e('WordPress Root Directory','mainwp'); ?></td><td><?php self::getWPRoot(); ?></td></tr>
<tr><td><?php _e('Server Name','mainwp'); ?></td><td><?php self::getSeverName(); ?></td></tr>
<tr><td><?php _e('Server Sofware','mainwp'); ?></td><td><?php self::getServerSoftware(); ?></td></tr>
<tr><td><?php _e('Operating System','mainwp'); ?></td><td><?php self::getOS(); ?></td></tr>
<tr><td><?php _e('Architecture','mainwp'); ?></td><td><?php self::getArchitecture(); ?></td></tr>
<tr><td><?php _e('Server IP','mainwp'); ?></td><td><?php self::getServerIP(); ?></td></tr>
<tr><td><?php _e('Server Protocol','mainwp'); ?></td><td><?php self::getServerProtocol(); ?></td></tr>
<tr><td><?php _e('HTTP Host','mainwp'); ?></td><td><?php self::getHTTPHost(); ?></td></tr>
<tr><td><?php _e('Server Admin','mainwp'); ?></td><td><?php self::getServerAdmin(); ?></td></tr>
<tr><td><?php _e('Server Port','mainwp'); ?></td><td><?php self::getServerPort(); ?></td></tr>
<tr><td><?php _e('Getaway Interface','mainwp'); ?></td><td><?php self::getServerGetawayInterface(); ?></td></tr>
<tr><td><?php _e('Memory Usage','mainwp'); ?></td><td><?php self::memoryUsage(); ?></td></tr>
<tr><td><?php _e('HTTPS','mainwp'); ?></td><td><?php self::getHTTPS(); ?></td></tr>
<tr><td><?php _e('User Agent','mainwp'); ?></td><td><?php self::getUserAgent(); ?></td></tr>
<tr><td><?php _e('Complete URL','mainwp'); ?></td><td><?php self::getCompleteURL(); ?></td></tr>
<tr><td><?php _e('Request Method','mainwp'); ?></td><td><?php self::getServerRequestMethod(); ?></td></tr>
<tr><td><?php _e('Request Time','mainwp'); ?></td><td><?php self::getServerRequestTime(); ?></td></tr>
<tr><td><?php _e('Query String','mainwp'); ?></td><td><?php self::getServerQueryString(); ?></td></tr>
<tr><td><?php _e('Accept Content','mainwp'); ?></td><td><?php self::getServerHTTPAccept(); ?></td></tr>
<tr><td><?php _e('Accept-Charset Content','mainwp'); ?></td><td><?php self::getServerAcceptCharset(); ?></td></tr>
<tr><td><?php _e('Currently Executing Script Pathname','mainwp'); ?></td><td><?php self::getScriptFileName(); ?></td></tr>
<tr><td><?php _e('Server Signature','mainwp'); ?></td><td><?php self::getServerSignature(); ?></td></tr>
<tr><td><?php _e('Currently Executing Script','mainwp'); ?></td><td><?php self::getCurrentlyExecutingScript(); ?></td></tr>
<tr><td><?php _e('Path Translated','mainwp'); ?></td><td><?php self::getServerPathTranslated(); ?></td></tr>
<tr><td><?php _e('Current Script Path','mainwp'); ?></td><td><?php self::getScriptName(); ?></td></tr>
<tr><td><?php _e('Current Page URI','mainwp'); ?></td><td><?php self::getCurrentPageURI(); ?></td></tr>
<tr><td><?php _e('Remote Address','mainwp'); ?></td><td><?php self::getRemoteAddress(); ?></td></tr>
<tr><td><?php _e('Remote Host','mainwp'); ?></td><td><?php self::getRemoteHost(); ?></td></tr>
<tr><td><?php _e('Remote Port','mainwp'); ?></td><td><?php self::getRemotePort(); ?></td></tr>
<tr><td><?php _e('PHP Safe Mode','mainwp'); ?></td><td><?php self::getPHPSafeMode(); ?></td></tr>
<tr><td><?php _e('PHP Allow URL fopen','mainwp'); ?></td><td><?php self::getPHPAllowUrlFopen(); ?></td></tr>
<tr><td><?php _e('PHP Exif Support','mainwp'); ?></td><td><?php self::getPHPExif(); ?></td></tr>
<tr><td><?php _e('PHP IPTC Support','mainwp'); ?></td><td><?php self::getPHPIPTC(); ?></td></tr>
<tr><td><?php _e('PHP XML Support','mainwp'); ?></td><td><?php self::getPHPXML(); ?></td></tr>
<tr><td><?php _e('SQL Mode','mainwp'); ?></td><td><?php self::getSQLMode(); ?></td></tr>
</tbody>
</table>
<br />
<?php
}
public static function renderCron()
{
$cron_array = _get_cron_array();
$schedules = wp_get_schedules();
?>
<table id="mainwp-table" class="wp-list-table widefat" cellspacing="0">
<thead>
<tr>
<th scope="col" class="manage-column sorted" style=""><span><?php _e('Next due','mainwp'); ?></span></th>
<th scope="col" class="manage-column column-posts" style=""><span><?php _e('Schedule','mainwp'); ?></span></th>
<th scope="col" class="manage-column column-posts" style=""><span><?php _e('Hook','mainwp'); ?></span></th>
</tr>
</thead>
<tbody id="the-sites-list" class="list:sites">
<?php
foreach ($cron_array as $time => $cron)
{
foreach ($cron as $hook => $cron_info)
{
foreach ($cron_info as $key => $schedule )
{
?>
<tr><td><?php echo MainWPHelper::formatTimestamp(MainWPHelper::getTimestamp($time)); ?></td><td><?php echo $schedules[$schedule['schedule']]['display'];?> </td><td><?php echo $hook; ?></td></tr>
<?php
}
}
}
?>
</tbody>
</table>
<?php
}
protected static function checkDirectoryMainWPDirectory()
{
$dirs = MainWPHelper::getMainWPDir();
$path = $dirs[0];
if (!is_dir(dirname($path)))
{
return self::renderDirectoryRow('MainWP upload directory', $path, 'Writable', 'Directory not found', false);
}
$hasWPFileSystem = MainWPHelper::getWPFilesystem();
global $wp_filesystem;
if ($hasWPFileSystem && !empty($wp_filesystem))
{
if (!$wp_filesystem->is_writable($path))
{
return self::renderDirectoryRow('MainWP upload directory', $path, 'Writable', 'Directory not writable', false);
}
}
else
{
if (!is_writable($path))
{
return self::renderDirectoryRow('MainWP upload directory', $path, 'Writable', 'Directory not writable', false);
}
}
return self::renderDirectoryRow('MainWP upload directory', $path, 'Writable', '/', true);
}
protected static function renderDirectoryRow($pName, $pDirectory, $pCheck, $pResult, $pPassed)
{
?>
<tr>
<td><?php echo $pName; ?></td>
<td><?php echo $pDirectory; ?></td>
<td><?php echo $pCheck; ?></td>
<td><?php echo $pResult; ?></td>
<td><?php echo ($pPassed ? '<span class="mainwp-pass">Pass</span>' : '<span class="mainwp-warning">Warning</span>'); ?></td>
</tr>
<?php
return true;
}
protected static function renderRow($pConfig, $pCompare, $pVersion, $pGetter, $pExtraText = '', $pExtraCompare = null, $pExtraVersion = null)
{
$currentVersion = call_user_func(array('MainWPChildServerInformation', $pGetter));
?>
<tr>
<td><?php echo $pConfig; ?></td>
<td><?php echo $pCompare; ?> <?php echo ($pVersion === true ? 'true' : $pVersion) . ' ' . $pExtraText; ?></td>
<td><?php echo ($currentVersion === true ? 'true' : $currentVersion); ?></td>
<td><?php echo (version_compare($currentVersion, $pVersion, $pCompare) || (($pExtraCompare != null) && version_compare($currentVersion, $pExtraVersion, $pExtraCompare)) ? '<span class="mainwp-pass">Pass</span>' : '<span class="mainwp-warning">Warning</span>'); ?></td>
</tr>
<?php
}
protected static function getWordpressVersion()
{
global $wp_version;
return $wp_version;
}
protected static function getSSLSupport()
{
return extension_loaded('openssl');
}
protected static function getPHPVersion()
{
return phpversion();
}
protected static function getMaxExecutionTime()
{
return ini_get('max_execution_time');
}
protected static function getUploadMaxFilesize()
{
return ini_get('upload_max_filesize');
}
protected static function getPostMaxSize()
{
return ini_get('post_max_size');
}
protected static function getMySQLVersion()
{
/** @var $wpdb wpdb */
global $wpdb;
return $wpdb->get_var('SHOW VARIABLES LIKE "version"', 1);
}
protected static function getPHPMemoryLimit()
{
return ini_get('memory_limit');
}
protected static function getOS()
{
echo PHP_OS;
}
protected static function getArchitecture()
{
echo (PHP_INT_SIZE * 8)?>&nbsp;bit <?php
}
protected static function memoryUsage()
{
if (function_exists('memory_get_usage')) $memory_usage = round(memory_get_usage() / 1024 / 1024, 2) . __(' MB');
else $memory_usage = __('N/A');
echo $memory_usage;
}
protected static function getOutputBufferSize()
{
return ini_get('pcre.backtrack_limit');
}
protected static function getPHPSafeMode()
{
if(ini_get('safe_mode')) $safe_mode = __('ON');
else $safe_mode = __('OFF');
echo $safe_mode;
}
protected static function getSQLMode()
{
global $wpdb;
$mysqlinfo = $wpdb->get_results("SHOW VARIABLES LIKE 'sql_mode'");
if (is_array($mysqlinfo)) $sql_mode = $mysqlinfo[0]->Value;
if (empty($sql_mode)) $sql_mode = __('NOT SET');
echo $sql_mode;
}
protected static function getPHPAllowUrlFopen()
{
if(ini_get('allow_url_fopen')) $allow_url_fopen = __('ON');
else $allow_url_fopen = __('OFF');
echo $allow_url_fopen;
}
protected static function getPHPExif()
{
if (is_callable('exif_read_data')) $exif = __('YES'). " ( V" . substr(phpversion('exif'),0,4) . ")" ;
else $exif = __('NO');
echo $exif;
}
protected static function getPHPIPTC()
{
if (is_callable('iptcparse')) $iptc = __('YES');
else $iptc = __('NO');
echo $iptc;
}
protected static function getPHPXML()
{
if (is_callable('xml_parser_create')) $xml = __('YES');
else $xml = __('NO');
echo $xml;
}
// new
protected static function getCurrentlyExecutingScript() {
echo $_SERVER['PHP_SELF'];
}
protected static function getServerGetawayInterface() {
echo $_SERVER['GATEWAY_INTERFACE'];
}
protected static function getServerIP() {
echo $_SERVER['SERVER_ADDR'];
}
protected static function getSeverName() {
echo $_SERVER['SERVER_NAME'];
}
protected static function getServerSoftware() {
echo $_SERVER['SERVER_SOFTWARE'];
}
protected static function getServerProtocol() {
echo $_SERVER['SERVER_PROTOCOL'];
}
protected static function getServerRequestMethod() {
echo $_SERVER['REQUEST_METHOD'];
}
protected static function getServerRequestTime(){
echo $_SERVER['REQUEST_TIME'];
}
protected static function getServerQueryString() {
echo $_SERVER['QUERY_STRING'];
}
protected static function getServerHTTPAccept() {
echo $_SERVER['HTTP_ACCEPT'];
}
protected static function getServerAcceptCharset() {
if (!isset($_SERVER['HTTP_ACCEPT_CHARSET']) || ($_SERVER['HTTP_ACCEPT_CHARSET'] == '')) {
echo __('N/A','mainwp');
}
else
{
echo $_SERVER['HTTP_ACCEPT_CHARSET'];
}
}
protected static function getHTTPHost() {
echo $_SERVER['HTTP_HOST'];
}
protected static function getCompleteURL() {
echo $_SERVER['HTTP_REFERER'];
}
protected static function getUserAgent() {
echo $_SERVER['HTTP_USER_AGENT'];
}
protected static function getHTTPS() {
if ( isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != '' ) {
echo __('ON','mainwp') . ' - ' . $_SERVER['HTTPS'] ;
}
else {
echo __('OFF','mainwp') ;
}
}
protected static function getRemoteAddress() {
echo $_SERVER['REMOTE_ADDR'];
}
protected static function getRemoteHost() {
if (!isset($_SERVER['REMOTE_HOST']) || ($_SERVER['REMOTE_HOST'] == '')) {
echo __('N/A','mainwp');
}
else {
echo $_SERVER['REMOTE_HOST'] ;
}
}
protected static function getRemotePort() {
echo $_SERVER['REMOTE_PORT'];
}
protected static function getScriptFileName() {
echo $_SERVER['SCRIPT_FILENAME'];
}
protected static function getServerAdmin() {
echo $_SERVER['SERVER_ADMIN'];
}
protected static function getServerPort() {
echo $_SERVER['SERVER_PORT'];
}
protected static function getServerSignature() {
echo $_SERVER['SERVER_SIGNATURE'];
}
protected static function getServerPathTranslated() {
if (!isset($_SERVER['PATH_TRANSLATED']) || ($_SERVER['PATH_TRANSLATED'] == '')) {
echo __('N/A','mainwp') ;
}
else {
echo $_SERVER['PATH_TRANSLATED'] ;
}
}
protected static function getScriptName() {
echo $_SERVER['SCRIPT_NAME'];
}
protected static function getCurrentPageURI() {
echo $_SERVER['REQUEST_URI'];
}
protected static function getWPRoot() {
echo ABSPATH ;
}
function formatSizeUnits($bytes)
{
if ($bytes >= 1073741824)
{
$bytes = number_format($bytes / 1073741824, 2) . ' GB';
}
elseif ($bytes >= 1048576)
{
$bytes = number_format($bytes / 1048576, 2) . ' MB';
}
elseif ($bytes >= 1024)
{
$bytes = number_format($bytes / 1024, 2) . ' KB';
}
elseif ($bytes > 1)
{
$bytes = $bytes . ' bytes';
}
elseif ($bytes == 1)
{
$bytes = $bytes . ' byte';
}
else
{
$bytes = '0 bytes';
}
return $bytes;
}
}

1174
class/MainWPClone.class.php Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,776 @@
<?php
class MainWPCloneInstall
{
protected $file;
public $config;
/**
* Class constructor
*
* @param string $file The zip backup file path
*/
public function __construct($file)
{
require_once ( ABSPATH . 'wp-admin/includes/class-pclzip.php');
$this->file = $file;
}
/**
* Check for default PHP zip support
*
* @return bool
*/
public function checkZipSupport()
{
return class_exists('ZipArchive');
}
/**
* Check if we could run zip on console
*
* @return bool
*/
public function checkZipConsole()
{
//todo: implement
// return function_exists('system');
return false;
}
public function checkWPZip()
{
return function_exists('unzip_file');
}
public function removeConfigFile()
{
if (!$this->file || !file_exists($this->file))
return false;
if ($this->checkZipConsole())
{
//todo: implement
}
else if ($this->checkZipSupport())
{
$zip = new ZipArchive();
$zipRes = $zip->open($this->file);
if ($zipRes)
{
$zip->deleteName('wp-config.php');
$zip->deleteName('clone');
$zip->close();
return true;
}
return false;
}
else
{
//use pclzip
$zip = new PclZip($this->file);
$list = $zip->delete(PCLZIP_OPT_BY_NAME, 'wp-config.php');
$list2 = $zip->delete(PCLZIP_OPT_BY_NAME, 'clone');
if ($list == 0) return false;
return true;
}
return false;
}
public function testDownload()
{
if (!$this->file_exists('wp-content/')) throw new Exception(__('Not a full backup.','mainwp-child'));
if (!$this->file_exists('wp-admin/')) throw new Exception(__('Not a full backup.','mainwp-child'));
if (!$this->file_exists('wp-content/dbBackup.sql')) throw new Exception(__('Database backup not found.','mainwp-child'));
}
private function file_exists($file)
{
if ($this->file == 'extracted') return file_get_contents('../clone/config.txt');
if (!$this->file || !file_exists($this->file))
return false;
if ($this->checkZipConsole())
{
//todo: implement
}
else if ($this->checkZipSupport())
{
$zip = new ZipArchive();
$zipRes = $zip->open($this->file);
if ($zipRes)
{
$content = $zip->locateName($file);
$zip->close();
return $content !== false;
}
return false;
}
else
{
return true;
}
return false;
}
public function readConfigurationFile()
{
$configContents = $this->getConfigContents();
if ($configContents === FALSE) throw new Exception(__('Cant read configuration file from backup','mainwp-child'));
$this->config = unserialize(base64_decode($configContents));
if (isset($this->config['plugins'])) update_option('mainwp_temp_clone_plugins', $this->config['plugins']);
if (isset($this->config['themes'])) update_option('mainwp_temp_clone_themes', $this->config['themes']);
}
public function setConfig($key, $val)
{
$this->config[$key] = $val;
}
public function testDatabase()
{
$link = @MainWPChildDB::connect($this->config['dbHost'], $this->config['dbUser'], $this->config['dbPass']);
if (!$link) throw new Exception(__('Invalid database host or user/password.','mainwp-child'));
$db_selected = @MainWPChildDB::select_db($this->config['dbName'], $link);
if (!$db_selected) throw new Exception(__('Invalid database name','mainwp-child'));
}
public function clean()
{
if (file_exists(WP_CONTENT_DIR . '/dbBackup.sql')) @unlink(WP_CONTENT_DIR . '/dbBackup.sql');
if (file_exists(ABSPATH . 'clone/config.txt')) @unlink(ABSPATH . 'clone/config.txt');
if (MainWPHelper::is_dir_empty(ABSPATH . 'clone')) @rmdir(ABSPATH . 'clone');
try
{
$dirs = MainWPHelper::getMainWPDir('backup', false);
$backupdir = $dirs[0];
$files = glob($backupdir . '*.zip');
foreach ($files as $file)
{
@unlink($file);
}
}
catch (Exception $e)
{
}
}
public function updateWPConfig()
{
$wpConfig = file_get_contents(ABSPATH . 'wp-config.php');
$wpConfig = $this->replaceVar('table_prefix', $this->config['prefix'], $wpConfig);
if (isset($this->config['lang']))
{
$wpConfig = $this->replaceDefine('WPLANG', $this->config['lang'], $wpConfig);
}
file_put_contents(ABSPATH . 'wp-config.php', $wpConfig);
}
public function update_option($name, $value)
{
global $wpdb;
$var = $wpdb->get_var('SELECT option_value FROM '.$this->config['prefix'].'options WHERE option_name = "'.$name.'"');
if ($var == NULL)
{
$wpdb->query('INSERT INTO '.$this->config['prefix'].'options (`option_name`, `option_value`) VALUES ("'.$name.'", "'.MainWPChildDB::real_escape_string(maybe_serialize($value)).'")');
}
else
{
$wpdb->query('UPDATE '.$this->config['prefix'].'options SET option_value = "'.MainWPChildDB::real_escape_string(maybe_serialize($value)).'" WHERE option_name = "'.$name.'"');
}
}
/**
* Run the installation
*
* @return bool
*/
public function install()
{
global $wpdb;
$table_prefix = $this->config['prefix'];
$home = get_option('home');
$site_url = get_option('siteurl');
// Install database
define('WP_INSTALLING', true);
define('WP_DEBUG', false);
$query = '';
$tableName = '';
$wpdb->query('SET foreign_key_checks = 0');
$handle = @fopen(WP_CONTENT_DIR . '/dbBackup.sql', 'r');
if ($handle)
{
$readline = '';
while (($line = fgets($handle, 81920)) !== false)
{
$readline .= $line;
if (!stristr($line, ";\n") && !feof($handle)) continue;
$splitLine = explode(";\n", $readline);
for ($i = 0; $i < count($splitLine) - 1; $i++)
{
$wpdb->query($splitLine[$i]);
}
$readline = $splitLine[count($splitLine) - 1];
// if (preg_match('/^(DROP +TABLE +IF +EXISTS|CREATE +TABLE|INSERT +INTO) +(\S+)/is', $readline, $match))
// {
// if (trim($query) != '')
// {
// $queryTable = $tableName;
// $query = preg_replace('/^(DROP +TABLE +IF +EXISTS|CREATE +TABLE|INSERT +INTO) +(\S+)/is', '$1 `' . $queryTable . '`', $query);
//
// $query = str_replace($this->config['home'], $home, $query);
// $query = str_replace($this->config['siteurl'], $site_url, $query);
// $query = str_replace($this->config['abspath'], ABSPATH, $query);
//// $query = str_replace('\"', '\\\"', $query);
//// $query = str_replace("\\\\'", "\\'", $query);
//// $query = str_replace('\r\n', '\\\r\\\n', $query);
//
// if ($wpdb->query($query) === false) throw new Exception('Error importing database');
// }
//
// $query = $readline;
// $readline = '';
// $tableName = trim($match[2], '`; ');
// }
// else
// {
// $query .= $readline;
// $readline = '';
// }
}
if (trim($readline) != '')
{
$wpdb->query($readline);
}
//
// if (trim($query) != '')
// {
// $queryTable = $tableName;
// $query = preg_replace('/^(DROP +TABLE +IF +EXISTS|CREATE +TABLE|INSERT +INTO) +(\S+)/is', '$1 `' . $queryTable . '`', $query);
//
// $query = str_replace($this->config['home'], $home, $query);
// $query = str_replace($this->config['siteurl'], $site_url, $query);
//// $query = str_replace('\"', '\\\"', $query);
//// $query = str_replace("\\\\'", "\\'", $query);
//// $query = str_replace('\r\n', '\\\r\\\n', $query);
// if ($wpdb->query($query) === false) throw new Exception(__('Error importing database','mainwp-child'));
// }
//
if (!feof($handle))
{
throw new Exception(__('Error: unexpected end of file for database','mainwp-child'));
}
fclose($handle);
$tables = array();
$tables_db = $wpdb->get_results('SHOW TABLES FROM `' . DB_NAME . '`', ARRAY_N);
foreach ($tables_db as $curr_table)
{
$tables[] = $curr_table[0];
}
$this->icit_srdb_replacer($wpdb->dbh, $this->config['home'], $home, $tables);
$this->icit_srdb_replacer($wpdb->dbh, $this->config['siteurl'], $site_url, $tables);
}
// Update site url
// $wpdb->query('UPDATE '.$table_prefix.'options SET option_value = "'.$site_url.'" WHERE option_name = "siteurl"');
// $wpdb->query('UPDATE '.$table_prefix.'options SET option_value = "'.$home.'" WHERE option_name = "home"');
// $rows = $wpdb->get_results( 'SELECT * FROM ' . $table_prefix.'options', ARRAY_A);
// foreach ($rows as $row)
// {
// $option_val = $row['option_value'];
// if (!$this->is_serialized($option_val)) continue;
//
// $option_val = $this->recalculateSerializedLengths($option_val);
// $option_id = $row['option_id'];
// $wpdb->query('UPDATE '.$table_prefix.'options SET option_value = "'.MainWPChildDB::real_escape_string($option_val).'" WHERE option_id = '.$option_id);
// }
$wpdb->query('SET foreign_key_checks = 1');
return true;
}
public function install_legacy()
{
global $wpdb;
$table_prefix = $this->config['prefix'];
$home = get_option('home');
$site_url = get_option('siteurl');
// Install database
define('WP_INSTALLING', true);
define('WP_DEBUG', false);
$query = '';
$tableName = '';
$wpdb->query('SET foreign_key_checks = 0');
$handle = @fopen(WP_CONTENT_DIR . '/dbBackup.sql', 'r');
if ($handle)
{
$readline = '';
while (($line = fgets($handle, 81920)) !== false)
{
$readline .= $line;
if (!stristr($line, "\n") && !feof($handle)) continue;
if (preg_match('/^(DROP +TABLE +IF +EXISTS|CREATE +TABLE|INSERT +INTO) +(\S+)/is', $readline, $match))
{
if (trim($query) != '')
{
$queryTable = $tableName;
$query = preg_replace('/^(DROP +TABLE +IF +EXISTS|CREATE +TABLE|INSERT +INTO) +(\S+)/is', '$1 `' . $queryTable . '`', $query);
$query = str_replace($this->config['home'], $home, $query);
$query = str_replace($this->config['siteurl'], $site_url, $query);
$query = str_replace($this->config['abspath'], ABSPATH, $query);
// $query = str_replace('\"', '\\\"', $query);
// $query = str_replace("\\\\'", "\\'", $query);
// $query = str_replace('\r\n', '\\\r\\\n', $query);
if ($wpdb->query($query) === false) throw new Exception('Error importing database');
}
$query = $readline;
$readline = '';
$tableName = trim($match[2], '`; ');
}
else
{
$query .= $readline;
$readline = '';
}
}
if (trim($query) != '')
{
$queryTable = $tableName;
$query = preg_replace('/^(DROP +TABLE +IF +EXISTS|CREATE +TABLE|INSERT +INTO) +(\S+)/is', '$1 `' . $queryTable . '`', $query);
$query = str_replace($this->config['home'], $home, $query);
$query = str_replace($this->config['siteurl'], $site_url, $query);
// $query = str_replace('\"', '\\\"', $query);
// $query = str_replace("\\\\'", "\\'", $query);
// $query = str_replace('\r\n', '\\\r\\\n', $query);
if ($wpdb->query($query) === false) throw new Exception(__('Error importing database','mainwp-child'));
}
if (!feof($handle))
{
throw new Exception(__('Error: unexpected end of file for database','mainwp-child'));
}
fclose($handle);
}
// Update site url
$wpdb->query('UPDATE '.$table_prefix.'options SET option_value = "'.$site_url.'" WHERE option_name = "siteurl"');
$wpdb->query('UPDATE '.$table_prefix.'options SET option_value = "'.$home.'" WHERE option_name = "home"');
$rows = $wpdb->get_results( 'SELECT * FROM ' . $table_prefix.'options', ARRAY_A);
foreach ($rows as $row)
{
$option_val = $row['option_value'];
if (!$this->is_serialized($option_val)) continue;
$option_val = $this->recalculateSerializedLengths($option_val);
$option_id = $row['option_id'];
$wpdb->query('UPDATE '.$table_prefix.'options SET option_value = "'.MainWPChildDB::real_escape_string($option_val).'" WHERE option_id = '.$option_id);
}
$wpdb->query('SET foreign_key_checks = 1');
return true;
}
protected function recalculateSerializedLengths($pObject)
{
return preg_replace_callback('|s:(\d+):"(.*?)";|', array($this, 'recalculateSerializedLengths_callback'), $pObject);
}
protected function recalculateSerializedLengths_callback($matches)
{
return 's:'.strlen($matches[2]).':"'.$matches[2].'";';
}
/**
* Check value to find if it was serialized.
*
* If $data is not an string, then returned value will always be false.
* Serialized data is always a string.
*
* @since 2.0.5
*
* @param mixed $data Value to check to see if was serialized.
* @return bool False if not serialized and true if it was.
*/
function is_serialized( $data ) {
// if it isn't a string, it isn't serialized
if ( ! is_string( $data ) )
return false;
$data = trim( $data );
if ( 'N;' == $data )
return true;
$length = strlen( $data );
if ( $length < 4 )
return false;
if ( ':' !== $data[1] )
return false;
$lastc = $data[$length-1];
if ( ';' !== $lastc && '}' !== $lastc )
return false;
$token = $data[0];
switch ( $token ) {
case 's' :
if ( '"' !== $data[$length-2] )
return false;
case 'a' :
case 'O' :
return (bool) preg_match( "/^{$token}:[0-9]+:/s", $data );
case 'b' :
case 'i' :
case 'd' :
return (bool) preg_match( "/^{$token}:[0-9.E-]+;\$/", $data );
}
return false;
}
public function cleanUp()
{
// Clean up!
@unlink('../dbBackup.sql');
}
public function getConfigContents()
{
if ($this->file == 'extracted') return file_get_contents('../clone/config.txt');
if (!$this->file || !file_exists($this->file))
return false;
if ($this->checkZipConsole())
{
//todo: implement
}
else if ($this->checkZipSupport())
{
$zip = new ZipArchive();
$zipRes = $zip->open($this->file);
if ($zipRes)
{
$content = $zip->getFromName('clone/config.txt');
// $zip->deleteName('clone/config.txt');
// $zip->deleteName('clone/');
$zip->close();
return $content;
}
return false;
}
else
{
//use pclzip
$zip = new PclZip($this->file);
$content = $zip->extract(PCLZIP_OPT_BY_NAME, 'clone/config.txt',
PCLZIP_OPT_EXTRACT_AS_STRING);
if (!is_array($content) || !isset($content[0]['content'])) return false;
return $content[0]['content'];
}
return false;
}
/**
* Extract backup
*
* @return bool
*/
public function extractBackup()
{
if (!$this->file || !file_exists($this->file))
return false;
if ($this->checkWPZip())
return $this->extractWPZipBackup();
else if ($this->checkZipConsole())
return $this->extractZipConsoleBackup();
else if ($this->checkZipSupport())
return $this->extractZipBackup();
else
return $this->extractZipPclBackup();
return false;
}
/**
* Extract backup using default PHP zip library
*
* @return bool
*/
public function extractZipBackup()
{
$zip = new ZipArchive();
$zipRes = $zip->open($this->file);
if ($zipRes)
{
@$zip->extractTo(ABSPATH);
$zip->close();
return true;
}
return false;
}
public function extractWPZipBackup()
{
MainWPHelper::getWPFilesystem();
global $wp_filesystem;
$tmpdir = ABSPATH;
if (($wp_filesystem->method == 'ftpext') && defined('FTP_BASE'))
{
$ftpBase = FTP_BASE;
$ftpBase = trailingslashit($ftpBase);
$tmpdir = str_replace(ABSPATH, $ftpBase, $tmpdir);
}
unzip_file($this->file, $tmpdir);
return true;
}
/**
* Extract backup using pclZip library
*
* @return bool
*/
public function extractZipPclBackup()
{
$zip = new PclZip($this->file);
if ($zip->extract(PCLZIP_OPT_PATH, ABSPATH, PCLZIP_OPT_REPLACE_NEWER) == 0)
{
return false;
}
if ($zip->error_code != PCLZIP_ERR_NO_ERROR) throw new Exception($zip->errorInfo(true));
return true;
}
/**
* Extract backup using zip on console
*
* @return bool
*/
public function extractZipConsoleBackup()
{
//todo implement
//system('zip');
return false;
}
/**
* Replace define statement to work with wp-config.php
*
* @param string $constant The constant name
* @param string $value The new value
* @param string $content The PHP file content
* @return string Replaced define statement with new value
*/
protected function replaceDefine($constant, $value, $content)
{
return preg_replace('/(define *\( *[\'"]' . $constant . '[\'"] *, *[\'"])(.*?)([\'"] *\))/is', '${1}' . $value . '${3}', $content);
}
/**
* Replace variable value to work with wp-config.php
*
* @param string $varname The variable name
* @param string $value The new value
* @param string $content The PHP file content
* @return string Replaced variable value with new value
*/
protected function replaceVar($varname, $value, $content)
{
return preg_replace('/(\$' . $varname . ' *= *[\'"])(.*?)([\'"] *;)/is', '${1}' . $value . '${3}', $content);
}
function recurse_chmod($mypath, $arg)
{
$d = opendir($mypath);
while (($file = readdir($d)) !== false)
{
if ($file != "." && $file != "..")
{
$typepath = $mypath . "/" . $file;
if (filetype($typepath) == 'dir')
{
recurse_chmod($typepath, $arg);
}
chmod($typepath, $arg);
}
}
}
/**
* The main loop triggered in step 5. Up here to keep it out of the way of the
* HTML. This walks every table in the db that was selected in step 3 and then
* walks every row and column replacing all occurences of a string with another.
* We split large tables into 50,000 row blocks when dealing with them to save
* on memmory consumption.
*
* @param mysql $connection The db connection object
* @param string $search What we want to replace
* @param string $replace What we want to replace it with.
* @param array $tables The tables we want to look at.
*
* @return array Collection of information gathered during the run.
*/
function icit_srdb_replacer( $connection, $search = '', $replace = '', $tables = array( ) ) {
global $guid, $exclude_cols;
$report = array( 'tables' => 0,
'rows' => 0,
'change' => 0,
'updates' => 0,
'start' => microtime( ),
'end' => microtime( ),
'errors' => array( ),
);
if ( is_array( $tables ) && ! empty( $tables ) ) {
foreach( $tables as $table ) {
$report[ 'tables' ]++;
$columns = array( );
// Get a list of columns in this table
$fields = MainWPChildDB::_query( 'DESCRIBE ' . $table, $connection );
while( $column = MainWPChildDB::fetch_array( $fields ) )
$columns[ $column[ 'Field' ] ] = $column[ 'Key' ] == 'PRI' ? true : false;
// Count the number of rows we have in the table if large we'll split into blocks, This is a mod from Simon Wheatley
$row_count = MainWPChildDB::_query( 'SELECT COUNT(*) FROM ' . $table, $connection );
$rows_result = MainWPChildDB::fetch_array( $row_count );
$row_count = $rows_result[ 0 ];
if ( $row_count == 0 )
continue;
$page_size = 50000;
$pages = ceil( $row_count / $page_size );
for( $page = 0; $page < $pages; $page++ ) {
$current_row = 0;
$start = $page * $page_size;
$end = $start + $page_size;
// Grab the content of the table
$data = MainWPChildDB::_query( sprintf( 'SELECT * FROM %s LIMIT %d, %d', $table, $start, $end ), $connection );
if ( ! $data )
$report[ 'errors' ][] = MainWPChildDB::error( );
while ( $row = MainWPChildDB::fetch_array( $data ) ) {
$report[ 'rows' ]++; // Increment the row counter
$current_row++;
$update_sql = array( );
$where_sql = array( );
$upd = false;
foreach( $columns as $column => $primary_key ) {
if ( $guid == 1 && in_array( $column, $exclude_cols ) )
continue;
$edited_data = $data_to_fix = $row[ $column ];
// Run a search replace on the data that'll respect the serialisation.
$edited_data = $this->recursive_unserialize_replace( $search, $replace, $data_to_fix );
// Something was changed
if ( $edited_data != $data_to_fix ) {
$report[ 'change' ]++;
$update_sql[] = $column . ' = "' . MainWPChildDB::real_escape_string( $edited_data ) . '"';
$upd = true;
}
if ( $primary_key )
$where_sql[] = $column . ' = "' . MainWPChildDB::real_escape_string( $data_to_fix ) . '"';
}
if ( $upd && ! empty( $where_sql ) ) {
$sql = 'UPDATE ' . $table . ' SET ' . implode( ', ', $update_sql ) . ' WHERE ' . implode( ' AND ', array_filter( $where_sql ) );
$result = MainWPChildDB::_query( $sql, $connection );
if ( ! $result )
$report[ 'errors' ][] = MainWPChildDB::error( );
else
$report[ 'updates' ]++;
} elseif ( $upd ) {
$report[ 'errors' ][] = sprintf( '"%s" has no primary key, manual change needed on row %s.', $table, $current_row );
}
}
}
}
}
$report[ 'end' ] = microtime( );
return $report;
}
/**
* Take a serialised array and unserialise it replacing elements as needed and
* unserialising any subordinate arrays and performing the replace on those too.
*
* @param string $from String we're looking to replace.
* @param string $to What we want it to be replaced with
* @param array $data Used to pass any subordinate arrays back to in.
* @param bool $serialised Does the array passed via $data need serialising.
*
* @return array The original array with all elements replaced as needed.
*/
function recursive_unserialize_replace( $from = '', $to = '', $data = '', $serialised = false ) {
// some unseriliased data cannot be re-serialised eg. SimpleXMLElements
try {
if ( is_string( $data ) && ( $unserialized = @unserialize( $data ) ) !== false ) {
$data = $this->recursive_unserialize_replace( $from, $to, $unserialized, true );
}
elseif ( is_array( $data ) ) {
$_tmp = array( );
foreach ( $data as $key => $value ) {
$_tmp[ $key ] = $this->recursive_unserialize_replace( $from, $to, $value, false );
}
$data = $_tmp;
unset( $_tmp );
}
else {
if ( is_string( $data ) )
$data = str_replace( $from, $to, $data );
}
if ( $serialised )
return serialize( $data );
} catch( Exception $error ) {
}
return $data;
}
}

View file

@ -0,0 +1,399 @@
<?php
/**
* Class for tracking click heatmap
*
* Uses $wpdb object
*
* @version 1.0
* @author Jeffri Hong
*/
class MainWPHeatmapTracker
{
protected static $instance;
protected $server;
protected $dbVersion = 1000;
/**
* Class constructor
*
* @param boolean $checkDb Do checking the database if set to true
*/
public function __construct( $checkDb = false )
{
self::$instance = $this;
$this->server = get_option('mainwp_child_server');
add_action('template_redirect', array($this, 'trackerJs'));
add_action('wp_ajax_heatmapSaveClick', array($this, 'saveClickCallback'));
add_action('wp_ajax_nopriv_heatmapSaveClick', array($this, 'saveClickCallback'));
}
/**
* Get Instance
*/
public static function getInstance()
{
if ( self::$instance instanceof HeatmapTracker )
return self::$instance;
self::$instance = new HeatmapTracker(true);
return self::$instance;
}
/**
* Parse which page we are on using URL
*/
public function getPageObject( $pageUrl )
{
global $wp_rewrite;
// If post type, we are using url_to_postid function
$postId = url_to_postid($pageUrl);
if ( $postId )
{
$postType = get_post_type_object(get_post($postId)->post_type);
return array(
'value' => $postId,
'title' => get_the_title($postId),
'type' => get_post($postId)->post_type,
'label' => ( is_array($postType->labels) ? $postType->labels['name'] : $postType->labels->name )
);
}
$path = str_replace(get_site_url(), '', $pageUrl);
$path = trim($path, '/');
// If path is empty, then it is front page
if ( empty($path) )
return array(
'value' => get_option('page_on_front') ? get_option('page_on_front') : '',
'title' => '',
'type' => 'front_page',
'label' => __('Home Page')
);
// Otherwise, we will try to match through rewrite or by query
$rewrite = $wp_rewrite->wp_rewrite_rules();
if ( is_array($rewrite) && count($rewrite) > 0 )
{
foreach ( $rewrite as $match => $query )
{
if ( preg_match("#^$match#", $path, $matches) || preg_match("#^$match#", urldecode($path), $matches) )
{
$query = preg_replace("!^.*\?!", '', $query);
$query = addslashes(WP_MatchesMapRegex::apply($query, $matches));
parse_str($query, $query_vars);
break;
}
}
}
else
{
$query = preg_replace("!^.*\?!", '', $path);
parse_str($query, $query_vars);
}
// Workaround for fail pagename rewrite match
if ( isset($query_vars['pagename']) && strpos($query_vars['pagename'], '?') !== false )
{
$query = preg_replace("!^.*\?!", '', $query_vars['pagename']);
parse_str($query, $query_vars);
}
$querypost = new WP_Query($query_vars);
if ( $querypost->is_date() )
{
if ( $querypost->query_vars['m'] )
$date = $querypost->query_vars['m'];
else if ( $querypost->is_day() )
$date = $querypost->query_vars['year'].zeroise($querypost->query_vars['monthnum'], 2).zeroise($querypost->query_vars['day'], 2);
else if ( $querypost->is_month() )
$date = $querypost->query_vars['year'].zeroise($querypost->query_vars['monthnum'], 2);
else if ( $querypost->is_year() )
$date = $querypost->query_vars['year'];
return array(
'value' => $date,
'title' => '',
'type' => 'archive',
'label' => __("Archive")
);
}
else if ( $querypost->is_category() || $querypost->is_tag() || $querypost->is_tax() )
{
$tax_query = $querypost->tax_query->queries;
$taxonomy = get_taxonomy($tax_query[0]['taxonomy']);
if ( $tax_query[0]['field'] == 'term_id' )
$term_id = $tax_query[0]['terms'][0];
else if ( $tax_query[0]['field'] == 'slug' )
$term_id = get_term_by('slug', $tax_query[0]['terms'][0], $taxonomy->name)->term_id;
return array(
'value' => $term_id,
'title' => get_term($term_id, $taxonomy->name)->name,
'type' => $taxonomy->name,
'label' => ( is_array($taxonomy->labels->name) ? $taxonomy->labels['name'] : $taxonomy->labels->name )
);
}
else if ( $querypost->is_search() )
{
return array(
'value' => $querypost->query_vars['s'],
'title' => '',
'type' => 'search',
'label' => __("Search")
);
}
else if ( $querypost->is_home() )
{
return array(
'value' => '',
'title' => '',
'type' => 'home',
'label' => __("Blog Home Page")
);
}
}
/**
* Save click callback for AJAX processing
*/
public function saveClickCallback()
{
if ( ! wp_verify_nonce($_POST['nonce'], 'heatmapSaveClick') )
return false;
$data = isset($_POST['data']) && is_array($_POST['data']) ? $_POST['data'] : array();
$storeData = get_option('mainwp_child_click_data');
if ( ! is_array($storeData) )
$storeData = array();
foreach ( $data as $d )
{
$coord = isset($d['coord']) && preg_match('/^\d+,\d+$/', $d['coord']) ? explode(',', $d['coord']) : null;
$type = isset($d['type']) && preg_match('/^(left|right|middle)$/', $d['type']) ? $d['type'] : 'left';
$viewport = isset($d['viewport']) && preg_match('/^\d+,\d+$/', $d['viewport']) ? explode(',', $d['viewport']) : null;
$element = isset($d['element']) && preg_match('/^[A-Za-z0-9#:().>_-]+$/is', $d['element']) ? $d['element'] : null;
$attr = array();
if ( isset($d['url']) && $d['url'] )
$attr['url'] = esc_url_raw($d['url']);
if ( isset($d['title']) && $d['title'] )
$attr['title'] = sanitize_text_field($d['title']);
if ( isset($d['alt']) && $d['alt'] )
$attr['alt'] = sanitize_text_field($d['alt']);
if ( isset($d['text']) && $d['text'] )
$attr['text'] = sanitize_text_field($d['text']);
$useragent = $_SERVER['HTTP_USER_AGENT'];
$object = $this->getPageObject($_SERVER['HTTP_REFERER']);
if ( ! is_null($coord) && ! is_null($viewport) && ! is_null($element) )
{
$storeData[] = array(
'url' => $_SERVER['HTTP_REFERER'],
'object' => $object,
'coord' => $coord,
'viewport' => $viewport,
'type' => $type,
'element' => $element,
'attr' => $attr,
'useragent' => $useragent,
'date' => current_time('mysql')
);
}
}
update_option('mainwp_child_click_data', $storeData);
// Customize when we need to send the data
$this->sendClick();
exit;
}
public function sendClick()
{
$url = $this->server.'admin-ajax.php';
$clickData = get_option('mainwp_child_click_data');
$key = get_option('mainwp_child_pubkey');
if ( ! is_array($clickData) )
return false;
$timestamp = time();
$signature = $this->createSignature($key, $timestamp, $clickData);
$request = wp_remote_post($url, array(
'headers' => array(
'Referer' => site_url()
),
'body' => array(
'timestamp' => $timestamp,
'signature' => $signature,
'data' => base64_encode(serialize($clickData)),
'action' => 'heatmapSendClick'
)
));
if ( is_array($request) && intval($request['body']) > 0 )
delete_option('mainwp_child_click_data');
}
public function checkSignature( $signature, $timestamp, $data )
{
$key = get_option('mainwp_child_pubkey');
if ( ! $key )
return false;
$createSign = $this->createSignature($key, $timestamp, $data);
return ( $signature == $createSign );
}
public function createSignature( $key, $timestamp, $data )
{
$datamd5 = md5($timestamp.base64_encode(serialize($data)));
$signature = md5($key.$datamd5);
return $signature;
}
/**
* Whether the heatmap is requested to display or not
*/
public function displayHeatmap()
{
return ( isset($_REQUEST['heatmap']) && $_REQUEST['heatmap'] == '1' );
/*return ( ( isset($_REQUEST['heatmap']) && $_REQUEST['heatmap'] == '1' ) &&
( isset($_REQUEST['signature']) && isset($_REQUEST['timestamp']) && isset($_REQUEST['data']) &&
$this->checkSignature($_REQUEST['signature'], $_REQUEST['timestamp'], $_REQUEST['data']) )
);*/
}
/**
* Add tracker Javascript
*/
public function trackerJs()
{
if ( ! is_admin() )
{
wp_enqueue_script('jquery');
wp_enqueue_script('heatmapTracker', plugins_url('/js/tracker.js', dirname(__FILE__)));
if ( $this->displayHeatmap() )
{
wp_enqueue_script('heatmapJs', plugins_url('/js/heatmap.js', dirname(__FILE__)));
wp_enqueue_script('heatmapInit', plugins_url('/js/heatmapinit.js', dirname(__FILE__)));
}
add_action('wp_head', array($this, 'trackerJsInline'), 1);
}
}
/**
* Add necessary inline tracker Javascript
*/
public function trackerJsInline()
{
echo '<script type="text/javascript">';
echo 'var trackerAjaxUrl="'. admin_url('admin-ajax.php') .'";'.
'var trackerNonce="'. wp_create_nonce('heatmapSaveClick') .'";';
if ( $this->displayHeatmap() )
{
wp_deregister_script('admin-bar');
wp_deregister_style('admin-bar');
remove_action('wp_footer','wp_admin_bar_render',1000);
remove_action('wp_head', '_admin_bar_bump_cb');
$pageUrl = sprintf('%s%s', preg_replace('#^((http|https)://([^/]+)).*#is', '$1', site_url()), $_SERVER['REQUEST_URI']);
$pageUrl = preg_replace('#(&|\?)heatmap(|_start|_end|_browser|_browser_version|_platform|_width)=([^&]*)#is', '', $pageUrl);
$page = $this->getPageObject($pageUrl);
$start = isset( $_GET['heatmap_start'] ) && preg_match('/^[0123][0-9]\/[01][0-9]\/[2][01][0-9]{2}$/is', $_GET['heatmap_start']) ? $_GET['heatmap_start'] : null;
$end = isset( $_GET['heatmap_end'] ) && preg_match('/^[0123][0-9]\/[01][0-9]\/[2][01][0-9]{2}$/is', $_GET['heatmap_end']) ? $_GET['heatmap_end'] : null;
$browser = isset($_GET['heatmap_browser']) ? strtolower($_GET['heatmap_browser']) : '';
$browserVersion = isset($_GET['heatmap_browser_version']) ? $_GET['heatmap_browser_version'] : '';
$platform = isset($_GET['heatmap_platform']) ? strtolower($_GET['heatmap_platform']) : '';
$width = isset($_GET['heatmap_width']) && is_numeric($_GET['heatmap_width']) ? $_GET['heatmap_width'] : '';
$args = array();
if ( $start )
$args['start'] = $start;
if ( $end )
$args['end'] = $end;
if ( $browser )
$args['browser'] = $browser;
if ( $browser && $browserVersion )
$args['browserVersion'] = $browserVersion;
if ( $platform )
$args['platform'] = $platform;
if ( $width )
$args['width'] = $width;
$this->generateHeatmap($page['type'], $page['value'], $args);
}
echo '</script>';
}
/**
* Generate heatmap, print click data variable (wrap it on <script></script>)
*
* Available args:
* string $start Start date (d/m/Y)
* string $end End date (d/m/Y)
* string $browser Filter to only click by specified browser, see getBrowser method for list of supported browser name
* string $browserVersion The specific browser version to target at, could use some wildcard (for example: 7.*)
* string $platform Filter to only click by specified platform, see getBrowser method for list of supported platform name
* int $width Filter to width
*
* @param string $object_type Object type
* @param int|string $object_value Object value
* @param array $args Additional arguments
*
*/
public function generateHeatmap( $object_type, $object_value, $args )
{
global $wpdb;
$defaults = array(
'start' => '',
'end' => '',
'browser' => 'all',
'browserVersion' => 'all',
'platform' => 'all',
'width' => 0
);
$args = wp_parse_args($args, $defaults);
extract($args);
$data = array();
$data['object_type'] = $object_type;
$data['object_value'] = $object_value;
$data['start_date'] = $start;
$data['end_date'] = $end;
$data['browser'] = $browser;
$data['platform'] = $platform;
$data['width'] = $width;
$url = $this->server.'admin-ajax.php';
$key = get_option('mainwp_child_pubkey');
$timestamp = time();
$signature = $this->createSignature($key, $timestamp, $data);
$request = wp_remote_post($url, array(
'headers' => array(
'Referer' => site_url()
),
'body' => array(
'timestamp' => $timestamp,
'signature' => $signature,
'data' => base64_encode(serialize($data)),
'action' => 'heatmapGetClickData'
),
'timeout' => 60
));
if ( is_array($request) )
{
$clicks = ( ! empty($request['body']) ) ? json_decode($request['body']) : array();
$clickData = array();
foreach ( $clicks as $click )
{
$clickData[] = array(
'x' => $click->x,
'y' => $click->y,
'w' => $click->w,
'h' => $click->h
);
}
?>
var heatmapClick = <?php echo json_encode($clickData) ?>;
var heatmapError = 0;
<?php
}
else
{
?>
var heatmapError = 1;
<?php
}
}
}
?>

View file

@ -0,0 +1,536 @@
<?php
class MainWPHelper
{
static function write($val)
{
die('<mainwp>' . base64_encode(serialize($val)) . '</mainwp>');
}
static function error($error)
{
$information['error'] = $error;
MainWPHelper::write($information);
}
static function uploadImage($img_url)
{
include_once(ABSPATH . 'wp-admin/includes/file.php'); //Contains download_url
//Download $img_url
$temporary_file = download_url($img_url);
if (is_wp_error($temporary_file))
{
throw new Exception('Error: ' . $temporary_file->get_error_message());
}
else
{
$upload_dir = wp_upload_dir();
$local_img_path = $upload_dir['path'] . DIRECTORY_SEPARATOR . basename($img_url); //Local name
$local_img_url = $upload_dir['url'] . '/' . basename($img_url);
$moved = @rename($temporary_file, $local_img_path);
if ($moved)
{
$wp_filetype = wp_check_filetype(basename($img_url), null); //Get the filetype to set the mimetype
$attachment = array(
'post_mime_type' => $wp_filetype['type'],
'post_title' => preg_replace('/\.[^.]+$/', '', basename($img_url)),
'post_content' => '',
'post_status' => 'inherit'
);
$attach_id = wp_insert_attachment($attachment, $local_img_path); //Insert the image in the database
require_once(ABSPATH . 'wp-admin/includes/image.php');
$attach_data = wp_generate_attachment_metadata($attach_id, $local_img_path);
wp_update_attachment_metadata($attach_id, $attach_data); //Update generated metadata
return array('id' => $attach_id, 'url' => $local_img_url);
}
}
if (file_exists($temporary_file))
{
unlink($temporary_file);
}
return null;
}
static function createPost($new_post, $post_custom, $post_category, $post_featured_image, $upload_dir, $post_tags)
{
global $current_user;
//Set up a new post (adding addition information)
$usr = get_user_by('login', $_POST['user']);
//$new_post['post_author'] = $current_user->ID;
$new_post['post_author'] = $usr->ID; // to fix missing post author
$ezine_post = !empty($post_custom['_ezine_post_article_source']) ? true : false;
$terms = $new_post['_ezin_post_category'];
unset($new_post['_ezin_post_category']);
$wp_error = null;
//Search for all the images added to the new post
//some images have a href tag to click to navigate to the image.. we need to replace this too
if (!$ezine_post) {
$foundMatches = preg_match_all('/(<a[^>]+href=\"(.*?)\"[^>]*>)?(<img[^>\/]*src=\"((.*?)(png|gif|jpg|jpeg))\")/ix', $new_post['post_content'], $matches, PREG_SET_ORDER);
}
else
{
if (isset($new_post['post_date_gmt']) && !empty($new_post['post_date_gmt'])) {
$post_date_timestamp = strtotime($new_post['post_date_gmt']) + get_option('gmt_offset') * 60 * 60;
$new_post['post_date'] = date('Y-m-d H:i:s', $post_date_timestamp);
$new_post['post_status'] = ($post_date_timestamp <= current_time('timestamp')) ? 'publish' : 'future';
} else {
$new_post['post_status'] = 'publish';
}
$foundMatches = 0;
}
if ($foundMatches > 0)
{
//We found images, now to download them so we can start balbal
foreach ($matches as $match)
{
$hrefLink = $match[2];
$imgUrl = $match[4];
if (!isset($upload_dir['baseurl']) || (strripos($imgUrl, $upload_dir['baseurl']) != 0)) continue;
if (preg_match('/-\d{3}x\d{3}\.[a-zA-Z0-9]{3,4}$/', $imgUrl, $imgMatches)) {
$search = $imgMatches[0];
$replace = '.'.$match[6];
$originalImgUrl = str_replace($search, $replace, $imgUrl);
} else {
$originalImgUrl = $imgUrl;
}
$downloadfile = MainWPHelper::uploadImage($originalImgUrl);
$localUrl = $downloadfile['url'];
$linkToReplaceWith = dirname($localUrl);
if ($hrefLink != '')
{
$lnkToReplace = dirname($hrefLink);
if ($lnkToReplace != 'http:' && $lnkToReplace != 'https:') $new_post['post_content'] = str_replace($lnkToReplace, $linkToReplaceWith, $new_post['post_content']);
}
$lnkToReplace = dirname($imgUrl);
if ($lnkToReplace != 'http:' && $lnkToReplace != 'https:') $new_post['post_content'] = str_replace($lnkToReplace, $linkToReplaceWith, $new_post['post_content']);
}
}
if (isset($post_tags) && $post_tags != '') $new_post['tags_input'] = $post_tags;
//Save the post to the wp
remove_filter('content_save_pre', 'wp_filter_post_kses'); // to fix brake scripts or html
$new_post_id = wp_insert_post($new_post, $wp_error);
//Show errors if something went wrong
if (is_wp_error($wp_error))
{
return $wp_error->get_error_message();
}
if ($new_post_id == 0)
{
return 'Undefined error';
}
if (!empty($terms)) {
wp_set_object_terms($new_post_id, array_map( intval, $terms), 'category');
}
$permalink = get_permalink( $new_post_id );
//Set custom fields
$not_allowed = array('_slug', '_tags', '_edit_lock', '_selected_sites', '_selected_groups', '_selected_by', '_categories', '_edit_last', '_sticky');
$not_allowed[] = '_mainwp_boilerplate_sites_posts';
$not_allowed[] = '_ezine_post_keyword';
$not_allowed[] = '_ezine_post_display_sig';
$not_allowed[] = '_ezine_post_remove_link';
$not_allowed[] = '_ezine_post_grab_image';
$not_allowed[] = '_ezine_post_grab_image_placement';
$not_allowed[] = '_ezine_post_template_id';
foreach ($post_custom as $meta_key => $meta_values)
{
if (!in_array($meta_key, $not_allowed))
{
foreach ($meta_values as $meta_value)
{
add_post_meta($new_post_id, $meta_key, $meta_value);
}
}
else if ($meta_key == '_sticky')
{
foreach ($meta_values as $meta_value)
{
if (base64_decode($meta_value) == 'sticky')
{
stick_post($new_post_id);
}
}
}
}
//If categories exist, create them (second parameter of wp_create_categories adds the categories to the post)
include_once(ABSPATH . 'wp-admin/includes/taxonomy.php'); //Contains wp_create_categories
if (isset($post_category) && $post_category != '')
{
$categories = explode(',', $post_category);
if (count($categories) > 0)
{
$post_category = wp_create_categories($categories, $new_post_id);
}
}
//If featured image exists - set it
if ($post_featured_image != null)
{
try
{
$upload = MainWPHelper::uploadImage($post_featured_image); //Upload image to WP
if ($upload != null)
{
update_post_meta($new_post_id, '_thumbnail_id', $upload['id']); //Add the thumbnail to the post!
}
}
catch (Exception $e)
{
}
}
$ret['success'] = true;
$ret['link'] = $permalink;
$ret['added_id'] = $new_post_id;
return $ret;
}
static function getMainWPDir($what = null, $dieOnError = true)
{
$upload_dir = wp_upload_dir();
$dir = $upload_dir['basedir'] . DIRECTORY_SEPARATOR . 'mainwp' . DIRECTORY_SEPARATOR;
self::checkDir($dir, $dieOnError);
if (!file_exists($dir . 'index.php'))
{
@touch($dir . 'index.php');
}
$url = $upload_dir['baseurl'] . '/mainwp/';
if ($what == 'backup')
{
$dir .= 'backup' . DIRECTORY_SEPARATOR;
self::checkDir($dir, $dieOnError);
if (!file_exists($dir . 'index.php'))
{
@touch($dir . 'index.php');
}
$url .= 'backup/';
}
return array($dir, $url);
}
static function checkDir($dir, $dieOnError)
{
MainWPHelper::getWPFilesystem();
global $wp_filesystem;
if (!file_exists($dir))
{
if (empty($wp_filesystem))
{
@mkdir($dir, 0777, true);
}
else
{
if (($wp_filesystem->method == 'ftpext') && defined('FTP_BASE'))
{
$ftpBase = FTP_BASE;
$ftpBase = trailingslashit($ftpBase);
$tmpdir = str_replace(ABSPATH, $ftpBase, $dir);
}
else
{
$tmpdir = $dir;
}
$wp_filesystem->mkdir($tmpdir, 0777);
}
if (!file_exists($dir))
{
$error = __('Unable to create directory ', 'mainwp-child') . str_replace(ABSPATH, '', $dir) . '.' . __(' Is its parent directory writable by the server?', 'mainwp-child');
if ($dieOnError)
self::error($error);
else
throw new Exception($error);
}
}
}
public static function validateMainWPDir()
{
$done = false;
$dir = MainWPHelper::getMainWPDir();
$dir = $dir[0];
if (MainWPHelper::getWPFilesystem())
{
global $wp_filesystem;
try
{
MainWPHelper::checkDir($dir, false);
}
catch (Exception $e)
{
}
if (!empty($wp_filesystem))
{
if ($wp_filesystem->is_writable($dir)) $done = true;
}
}
if (!$done)
{
if (!file_exists($dir)) @mkdirs($dir);
if (is_writable($dir)) $done = true;
}
return $done;
}
static function search($array, $key)
{
if (is_object($array)) $array = (array)$array;
if (is_array($array) || is_object($array))
{
if (isset($array[$key])) return $array[$key];
foreach ($array as $subarray)
{
$result = self::search($subarray, $key);
if ($result != null) return $result;
}
}
return null;
}
/**
* @return WP_Filesystem_Base
*/
public static function getWPFilesystem()
{
global $wp_filesystem;
if (empty($wp_filesystem))
{
ob_start();
if (file_exists(ABSPATH . '/wp-admin/includes/screen.php')) include_once(ABSPATH . '/wp-admin/includes/screen.php');
if (file_exists(ABSPATH . '/wp-admin/includes/template.php')) include_once(ABSPATH . '/wp-admin/includes/template.php');
$creds = request_filesystem_credentials('test');
ob_end_clean();
if (empty($creds))
{
define('FS_METHOD', 'direct');
}
$init = WP_Filesystem($creds);
}
else
{
$init = true;
}
return $init;
}
public static function startsWith($haystack, $needle)
{
return !strncmp($haystack, $needle, strlen($needle));
}
function endsWith($haystack, $needle)
{
$length = strlen($needle);
if ($length == 0) {
return true;
}
return (substr($haystack, -$length) === $needle);
}
public static function getNiceURL($pUrl, $showHttp = false)
{
$url = $pUrl;
if (self::startsWith($url, 'http://'))
{
if (!$showHttp) $url = substr($url, 7);
}
else if (self::startsWith($pUrl, 'https://'))
{
if (!$showHttp) $url = substr($url, 8);
}
else
{
if ($showHttp) $url = 'http://'.$url;
}
if (self::endsWith($url, '/'))
{
if (!$showHttp) $url = substr($url, 0, strlen($url) - 1);
}
else
{
$url = $url . '/';
}
return $url;
}
public static function endSession()
{
session_write_close();
ob_end_flush();
}
static function fetchUrl($url, $postdata)
{
try
{
$tmpUrl = $url;
if (substr($tmpUrl, -1) != '/') { $tmpUrl .= '/'; }
return self::_fetchUrl($tmpUrl . 'wp-admin/', $postdata);
}
catch (Exception $e)
{
try
{
return self::_fetchUrl($url, $postdata);
}
catch (Exception $ex)
{
throw $e;
}
}
}
public static function _fetchUrl($url, $postdata)
{
$agent= 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
$data = curl_exec($ch);
$http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$err = curl_error($ch);
curl_close($ch);
if (($data === false) && ($http_status == 0)) {
throw new Exception('Http Error: ' . $err);
}
else if (preg_match('/<mainwp>(.*)<\/mainwp>/', $data, $results) > 0) {
$result = $results[1];
$information = unserialize(base64_decode($result));
return $information;
}
else if ($data == '')
{
throw new Exception(__('Something went wrong while contacting the child site. Please check if there is an error on the child site. This error could also be caused by trying to clone or restore a site to large for your server settings.','mainwp-child'));
}
else
{
throw new Exception(__('Child plugin is disabled or the security key is incorrect. Please resync with your main installation.','mainwp-child'));
}
}
public static function randString($length, $charset = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789')
{
$str = '';
$count = strlen($charset);
while ($length--)
{
$str .= $charset[mt_rand(0, $count - 1)];
}
return $str;
}
public static function return_bytes($val) {
$val = trim($val);
$last = strtolower($val[strlen($val)-1]);
switch($last) {
// The 'G' modifier is available since PHP 5.1.0
case 'g':
$val *= 1024;
case 'm':
$val *= 1024;
case 'k':
$val *= 1024;
}
return $val;
}
public static function human_filesize($bytes, $decimals = 2) {
$size = array('B','kB','MB','GB','TB','PB','EB','ZB','YB');
$factor = floor((strlen($bytes) - 1) / 3);
return sprintf("%.{$decimals}f", $bytes / pow(1024, $factor)) . @$size[$factor];
}
public static function is_dir_empty($dir)
{
if (!is_readable($dir)) return null;
return (count(scandir($dir)) == 2);
}
public static function delete_dir( $dir ) {
$nodes = glob($dir . '*');
if (is_array($nodes))
{
foreach ($nodes as $node)
{
if (is_dir($node))
{
self::delete_dir($node . DIRECTORY_SEPARATOR);
}
else
{
@unlink($node);
}
}
}
@rmdir($dir);
}
public static function function_exists($func) {
if (!function_exists($func)) return false;
if (extension_loaded('suhosin')) {
$suhosin = @ini_get("suhosin.executor.func.blacklist");
if (empty($suhosin) == false) {
$suhosin = explode(',', $suhosin);
$suhosin = array_map('trim', $suhosin);
$suhosin = array_map('strtolower', $suhosin);
return (function_exists($func) == true && array_search($func, $suhosin) === false);
}
}
return true;
}
public static function getTimestamp($timestamp)
{
$gmtOffset = get_option('gmt_offset');
return ($gmtOffset ? ($gmtOffset * HOUR_IN_SECONDS) + $timestamp : $timestamp);
}
public static function formatTimestamp($timestamp)
{
return date_i18n(get_option('date_format') . ' ' . get_option('time_format'), $timestamp);
}
}
?>

View file

@ -0,0 +1,775 @@
<?php
class MainWPKeywordLinks
{
public static $instance = null;
protected $config;
protected $keyword_links;
protected $server;
protected $siteurl;
protected $link_temp;
protected $link_count_temp;
protected $link_count_each_temp;
static function Instance() {
if (MainWPKeywordLinks::$instance == null) {
MainWPKeywordLinks::$instance = new MainWPKeywordLinks();
}
return MainWPKeywordLinks::$instance;
}
public function __construct() {
global $wpdb;
$this->server = get_option('mainwp_child_server');
add_action('wp_ajax_keywordLinksSaveClick', array($this, 'saveClickCallback'));
add_action('wp_ajax_nopriv_keywordLinksSaveClick', array($this, 'saveClickCallback'));
add_action('template_redirect', array($this, 'keywordLinksJS'));
$this->config = get_option('mainwp_kwl_options', array());
$this->keyword_links = get_option('mainwp_kwl_keyword_links', array());
if (empty($this->keyword_links))
$this->keyword_links = array();
$this->siteurl = get_option('siteurl');
add_action('permalink_structure_changed', array(&$this, 'permalinkChanged'), 10, 2);
}
public function keywordLinksJS()
{
if (!is_admin() && get_option('mainwp_kwl_enable_statistic'))
{
wp_enqueue_script('jquery');
wp_enqueue_script('keywordLinks', plugins_url('/js/keywordlinks.js', dirname(__FILE__)));
add_action('wp_head', array($this, 'head_loading'), 1);
}
}
public function head_loading()
{
?>
<script type="text/javascript">
var kwlAjaxUrl="<?php echo admin_url('admin-ajax.php'); ?>";
var kwlNonce="<?php echo wp_create_nonce('keywordLinksSaveClick'); ?>";
var kwlIp ="<?php echo $_SERVER['REMOTE_ADDR']; ?>";
var kwlReferer ="<?php echo $_SERVER['HTTP_REFERER']; ?>";
</script>
<?php
}
public function permalinkChanged($old_struct, $new_struct)
{
if (get_option('mainwpKeywordLinks') != 1) {
if (get_option('mainwp_keyword_links_htaccess_set') == 'yes') {
$this->update_htaccess(false, true); // force clear
}
} else {
$this->update_htaccess(true); // force update
}
}
function mod_rewrite_rules($pRules)
{
$home_root = parse_url(home_url());
if (isset($home_root['path']))
$home_root = trailingslashit($home_root['path']);
else
$home_root = '/';
$rules = "<IfModule mod_rewrite.c>\n";
$rules .= "RewriteEngine On\n";
$rules .= "RewriteBase $home_root\n";
//add in the rules that don't redirect to WP's index.php (and thus shouldn't be handled by WP at all)
foreach ($pRules as $match => $query)
{
// Apache 1.3 does not support the reluctant (non-greedy) modifier.
$match = str_replace('.+?', '.+', $match);
$rules .= 'RewriteRule ^' . $match . ' ' . $home_root . $query . " [QSA,L]\n";
}
$rules .= "</IfModule>\n";
return $rules;
}
function update_htaccess($force_update = false, $force_clear = false)
{
if ($force_clear)
$this->do_update_htaccess(true);
else if ($force_update) {
return $this->do_update_htaccess();
} else {
if ('' == get_option( 'permalink_structure') && get_option('mainwp_keyword_links_htaccess_set') != 'yes')
$this->do_update_htaccess(); // need to update
else if ('' != get_option( 'permalink_structure') && get_option('mainwp_keyword_links_htaccess_set') == 'yes')
$this->do_update_htaccess(); // need to update
}
return true;
}
public static function clear_htaccess() {
include_once(ABSPATH . '/wp-admin/includes/misc.php');
$home_path = ABSPATH;
$htaccess_file = $home_path . '.htaccess';
if (function_exists('save_mod_rewrite_rules'))
{
$rules = explode("\n", '');
insert_with_markers($htaccess_file, 'MainWP Keyword Links Extension', $rules);
}
update_option('mainwp_keyword_links_htaccess_set', '');
}
public function do_update_htaccess($force_clear = false) {
if ($force_clear) {
self::clear_htaccess();
return true;
} else if ('' == get_option( 'permalink_structure')) {
include_once(ABSPATH . '/wp-admin/includes/misc.php');
$redirection_folder = $this->get_option('redirection_folder', 'goto');
if (empty($redirection_folder))
$redirection_folder = "goto";
//Create rewrite ruler
$rules = $this->mod_rewrite_rules(array($redirection_folder.'/' => 'index.php'));
$home_path = ABSPATH;
$htaccess_file = $home_path . '.htaccess';
if (function_exists('save_mod_rewrite_rules'))
{
$rules = explode("\n", $rules);
insert_with_markers($htaccess_file, 'MainWP Keyword Links Extension', $rules);
}
update_option('mainwp_keyword_links_htaccess_set', 'yes');
return true;
} else {
self::clear_htaccess();
return true;
}
return false;
}
public function saveClickCallback()
{
if ( ! wp_verify_nonce($_POST['nonce'], 'keywordLinksSaveClick') )
return false;
$link_id = intval($_POST['link_id']);
if ($link_id) {
$this->add_statistic($link_id, $_POST['ip'], $_POST['referer']);
}
exit;
}
public function sendClick()
{
$url = $this->server.'admin-ajax.php';
$clickData = get_option('mainwp_kwl_click_statistic_data');
$key = get_option('mainwp_child_pubkey');
if ( ! is_array($clickData) )
return false;
$timestamp = time();
$signature = $this->createSignature($key, $timestamp, $clickData);
$request = wp_remote_post($url, array(
'headers' => array(
'Referer' => site_url()
),
'body' => array(
'timestamp' => $timestamp,
'signature' => $signature,
'data' => base64_encode(serialize($clickData)),
'action' => 'keywordLinksSendClick'
)
));
if ( is_array($request) && intval($request['body']) > 0 )
delete_option('mainwp_kwl_click_statistic_data');
}
public function createSignature( $key, $timestamp, $data )
{
$datamd5 = md5($timestamp.base64_encode(serialize($data)));
$signature = md5($key.$datamd5);
return $signature;
}
public function checkSignature( $signature, $timestamp, $data )
{
$key = get_option('mainwp_child_pubkey');
if ( ! $key )
return false;
$createSign = $this->createSignature($key, $timestamp, $data);
return ( $signature == $createSign );
}
public function get_option($key, $default = '') {
if (isset($this->config[$key]))
return $this->config[$key];
return $default;
}
public function set_option($key, $value) {
$this->config[$key] = $value;
return update_option('mainwp_kwl_options', $this->config);
}
public function get_link($link_id, $default = '') {
if (isset($this->keyword_links[$link_id]))
return $this->keyword_links[$link_id];
return $default;
}
public function set_link($link_id, $link) {
if (empty($link))
unset($this->keyword_links[$link_id]);
else
$this->keyword_links[$link_id] = $link;
return update_option('mainwp_kwl_keyword_links', $this->keyword_links);
}
// This function is to generate links for keywords in post content
public function filter_content($content) {
global $post, $wpdb;
if ($this->get_option('mainwp_kwl_do_not_link_site_blocked', false))
return $content;
// get allow post typies, if it isn't belong that => avoid
$allow_post_type = (array) $this->get_option('enable_post_type');
if (!in_array($post->post_type, $allow_post_type))
return $content;
if ($post) {
// Check if this post was disabled with this function, come back
$disable = get_post_meta($post->ID, '_mainwp_kl_disable', true);
if ($disable == 1)
return $content;
$paths_blocked = $this->get_option('mainwp_kwl_do_not_link_paths_blocked', array());
if (is_array($paths_blocked)) {
$permalink = get_permalink($post->ID);
$url_paths = str_replace($this->siteurl,'', $permalink);
$url_paths = trim($url_paths, '/');
// check full path blocked
if (in_array($url_paths, $paths_blocked))
return $content;
$url_paths = explode('/', $url_paths);
foreach($url_paths as $path) {
// check partial paths blocked
if (!empty($path) && in_array($path, $paths_blocked)) {
return $content;
}
}
}
}
// save specific link
if ($post) {
$specific_link = get_post_meta($post->ID, '_mainwp_kwl_specific_link', true);
$specific_link = unserialize($specific_link);
if (is_array($specific_link) && count($specific_link) > 0) {
$specific_link = current($specific_link);
$specific_link->post_id = $post->ID;
//update_post_meta($post->ID, '_mainwp_kwl_specific_link_save', array($specific_link->id => $specific_link));
update_post_meta($post->ID, '_mainwp_kwl_specific_link_id', $specific_link->id);
if ($this->set_link($specific_link->id, $specific_link))
delete_post_meta($post->ID, '_mainwp_kwl_specific_link'); // delete the source meta
}
}
if ($post && $post->ID)
$links = $this->get_available_links($post->ID);
else
$links = $this->get_available_links();
// print_r($this->keyword_links);
// echo "======";
// print_r($links);
if (empty($links))
return $content;
$replace_max = intval($this->get_option('replace_max', -1));
$replace_max_keyword = intval($this->get_option('replace_max_keyword', -1));
// start create links for keywords (terms) in post content
$this->link_count_temp = $replace_max;
$not_allow_keywords = get_post_meta($post->ID, 'mainwp_kl_not_allowed_keywords_on_this_post', true);
$not_allow_keywords = unserialize($not_allow_keywords);
foreach ($links as $link) {
if (!$link)
continue;
global $current_user;
$this->link_temp = $link;
$this->link_count_each_temp = $replace_max_keyword;
//$keywords = explode(',', $link->keyword);
$keywords = $this->explode_multi($link->keyword);
usort($keywords, create_function('$a,$b', 'return strlen($a)<strlen($b);'));
foreach ($keywords as $keyword) {
$keyword = trim($keyword);
if (empty($keyword))
continue;
if (in_array(array("keyword" => $keyword, "link" => $link->destination_url), (array) $not_allow_keywords)) {
continue;
}
$keyword = preg_replace('/([$^\/?+.*\]\[)(}{])/is', '\\\\\1', $keyword);
if (strpos($content, $keyword) !== false) {
//Replace keyword in H tag
if ($this->get_option('replace_keyword_in_h_tag')) {
//$content = preg_replace_callback('/(<a[^>]*>.*?'.$keyword.'.*?<\/a>|<[^>]*'.$keyword.'[^>]*>|\{[^}]*'.$keyword.'[^}]*\}|\w*('.$keyword.')\w*)/is', array(&$this, 'keyword_mark'), $content);
$content = preg_replace_callback("/(<a[^>]*>[^<]*?" . $keyword . "[^<]*?<\/a>|<[^>]*" . $keyword . "[^>]*>|\{[^\}]*" . $keyword . "[^\}]*\}|\w*(" . $keyword . ")\w*)/is", array(&$this, 'keyword_mark'), $content);
} else {
//$content = preg_replace_callback('/(<h[123456][^>]*>.*?'.$keyword.'.*?<\/h[123456]>|<a[^>]*>.*?'.$keyword.'.*?<\/a>|<[^>]*'.$keyword.'[^>]*>|\{[^}]*'.$keyword.'[^}]*\}|\w*('.$keyword.')\w*)/is', array(&$this, 'keyword_mark'), $content);
$content = preg_replace_callback("/(<h[123456][^>]*>[^<]*?" . $keyword . "[^<]*?<\/h[123456]>|<a[^>]*>[^<]*?" . $keyword . "[^<]*?<\/a>|<[^>]*" . $keyword . "[^>]*>|\{[^\}]*" . $keyword . "[^\}]*\}|\w*(" . $keyword . ")\w*)/is", array(&$this, 'keyword_mark'), $content);
}
}
}
}
$content = preg_replace_callback('/\{MAINWP_LINK +HREF="(.*?)" +TARGET="(.*?)" +REL="(.*?)" +LINK-ID="(.*?)" +CLASS="(.*?)" +TEXT="(.*?)" *\}/is', array(&$this, 'keyword_replace'), $content);
return $content;
}
public function keyword_mark($matches) {
if (preg_match('/^[<{].*?[>}]$/is', $matches[1]))
return $matches[1];
if ($this->link_count_temp === 0 || $this->link_count_each_temp === 0)
return $matches[1];
if ($matches[1] != $matches[2])
return $matches[1];
if ($this->link_count_temp != -1)
$this->link_count_temp--;
if ($this->link_count_temp != -1)
$this->link_count_each_temp--;
// if (isset($this->link_temp->type) && $this->link_temp->type == 'post_type') {
//// $post = get_post($this->link_temp->id);
//// if ($post) {
//// $disable_linking = $this->get_option('disable_linking_automatically', array());
//// if (in_array($post->post_name, $disable_linking[$post->post_type]))
//// return $matches[1]; // do not link to this post
//// }
// $link_target = get_post_meta($this->link_temp->id, '_mainwp_kl_link_newtab', true);
// $this->link_temp->link_target = ( $link_target != -1 && $link_target == 1 ? '_blank' : '' );
// $link_rel = get_post_meta($this->link_temp->id, '_mainwp_kl_link_nofollow', true);
// $this->link_temp->link_rel = ( $link_rel != -1 && $link_rel == 1 ? 'nofollow' : '' );
// $this->link_temp->link_class = get_post_meta($this->link_temp->id, '_mainwp_kl_link_class', true);
// }
if ($this->link_temp->link_target != '-1') {
$target = $this->link_temp->link_target;
} else
$target = $this->get_option('default_link_newtab') ? '_blank' : '';
if ($this->link_temp->link_rel != '-1')
$rel = $this->link_temp->link_rel;
else
$rel = $this->get_option('default_link_nofollow') ? 'nofollow' : '';
if ($this->link_temp->link_class != '')
$class = $this->link_temp->link_class;
else
$class = $this->get_option('default_link_class');
$redirection_folder = $this->get_option('redirection_folder', 'goto');
if (empty($redirection_folder))
$redirection_folder = "goto";
if (!empty($redirection_folder))
$redirection_folder = "/" . $redirection_folder;
// if (empty($redirection_folder))
// $redirection_folder = 'goto';
$regular_link = false;
if (empty($this->link_temp->cloak_path)) {
$regular_link = true;
$class .= " kwl-regular-link";
}
return '{MAINWP_LINK HREF="' . ( $this->link_temp->cloak_path ? $this->siteurl . $redirection_folder . '/' . $this->link_temp->cloak_path : $this->link_temp->destination_url) . '" TARGET="' . $target . '" REL="' . $rel . '" LINK-ID="' . $this->link_temp->id . '" CLASS="' . $class . '" TEXT="' . $matches[1] . '"}';
}
public function keyword_replace( $matches )
{
$a = '<a href="'.$matches[1].'"';
$a .= ( $matches[2] ) ? ' target="'.$matches[2].'"' : '';
$a .= ( $matches[3] ) ? ' rel="'.$matches[3].'"' : '';
$a .= ( $matches[4] ) ? ' link-id="'.$matches[4].'"' : '';
$a .= ( $matches[5] ) ? ' class="'.$matches[5].'"' : '';
$a .= '>'.$matches[6].'</a>';
return $a;
}
public function get_available_links($post_id = null) {
global $post, $wpdb;
if ($post_id !== null)
$post = get_post($post_id);
$links = array();
// $disable_add_links = $this->get_option('disable_add_links_automatically');
// // if disabled add links automatically in this post, avoid
// if (in_array($post->post_name, (array) $disable_add_links[$post->post_type])) {
// return $links;
// }
// Check if this post was disabled with this function, come back
// $disable = get_post_meta($post->ID, '_mainwp_kl_disable', true);
// if ($disable == 1)
// return $links;
// count replace max and max keyword allowed.
$replace_max = intval($this->get_option('replace_max'));
$replace_max_keyword = intval($this->get_option('replace_max_keyword'));
if ($replace_max === 0 || $replace_max_keyword === 0)
return $links;
// Post types enabled to create links
$post_types = (array) $this->get_option('enable_post_type_link');
foreach ($post_types as $post_type) {
if ($post_type == $post->post_type) {
$categories = get_the_terms($post->ID, 'category');
$cats = array();
if (is_array($categories)) {
foreach ($categories as $category)
$cats[] = $category->term_id;
}
$links_post_type = (array) $this->get_post_keywords($post_type, $cats);
} else {
$links_post_type = (array) $this->get_post_keywords($post_type);
}
//print_r($links_post_type);
if (count($links_post_type) > 0)
$links = array_merge($links, $links_post_type);
}
if ($post && $post->ID > 0)
$spec_link_id = get_post_meta($post->ID, '_mainwp_kwl_specific_link_id', true);
foreach($this->keyword_links as $link) {
if ($link->type == 1 || $link->type == 3)
$links[] = $link;
else if ($spec_link_id && $spec_link_id == $link->id){
$links[] = $link;
}
}
return $links;
}
public function get_post_keywords($post_type, $cats = null) {
global $wpdb, $post;
$join = '';
$where = '';
if (is_array($cats) && count($cats) > 0) {
$join = "JOIN $wpdb->term_relationships tr ON tr.object_id = p.ID";
$where = " AND (tr.term_taxonomy_id = '" . implode("' OR tr.term_taxonomy_id = '", $cats) . "')";
}
//$results = $wpdb->get_results(sprintf("SELECT * FROM $wpdb->posts as p LEFT JOIN $wpdb->postmeta as pm ON p.ID=pm.post_id $join WHERE p.post_status='publish' AND p.post_type='%s' AND pm.meta_key='_mainwp_kl_post_keyword' $where", $post_type));
$results = $wpdb->get_results(sprintf("SELECT * FROM $wpdb->posts as p $join WHERE p.post_status='publish' AND p.post_type='%s' $where", $post_type));
$links = array();
if (!is_array($results))
return array();
$paths_blocked = $this->get_option('mainwp_kwl_do_not_link_paths_blocked', array());
foreach ($results as $result) {
if ($result->ID == $post->ID)
continue; // do not link to myself
if (in_array($result->post_name, (array) $paths_blocked))
continue;
$link = new stdClass;
// This is on-fly link so have not ID
//$link->id = $result->ID;
$link->name = $result->post_title;
//if ($result->post_type == 'page')
// $link->destination_url = get_permalink($result->ID);
//else
// $link->destination_url = $result->guid;
$link->destination_url = get_permalink($result->ID);
$link->cloak_path = '';
$link->keyword = ( $this->get_option('post_match_title') == 1 ? $result->post_title . ',' : '' ) . $result->meta_value;
$link->link_target = '';
$link->link_rel = '';
$link->link_class = '';
$link->type = 1;
$links[] = $link;
}
return $links;
}
public function explode_multi($str) {
$delimiters = array(",", ";", "|");
$str = str_replace($delimiters, ",", $str);
return explode(',', $str);
}
public function redirect_cloak() {
global $wpdb;
if ($this->get_option('mainwp_kwl_do_not_link_site_blocked', false))
return;
$request = $_SERVER['REQUEST_URI'];
// Check if the request is correct
if (!preg_match('|^[a-z0-9-~+_.?#=!&;,/:%@$\|*\'()\\x80-\\xff]+$|i', $request))
return;
// Check to see if Wordpress is installed in sub folder
$siteurl = parse_url($this->siteurl);
$sitepath = ( isset($siteurl['path']) ) ? $siteurl['path'] : '';
$filter_request = preg_replace('|^' . $sitepath . '/?|i', '', $request);
$filter_request = preg_replace('|/?$|i', '', $filter_request);
$redirection_folder = $this->get_option('redirection_folder', 'goto');
$redirection_folder = empty($redirection_folder) ? "goto" : $redirection_folder;
//user use redirection_folder (or not set it - we use by default)
if ($redirection_folder != '') {
//if the request doesn't' containt the redirection folder we will return immediately
if (strpos($filter_request, $redirection_folder . '/') === false) {
return;
}
$filter_request = str_replace($redirection_folder . '/', '', $filter_request);
}
if (empty($filter_request))
return;
if (substr($filter_request, -1) == "/") {
$filter_request = substr($filter_request, 0, -1);
}
$link_id = 0;
foreach($this->keyword_links as $link) {
if ($link->cloak_path == $filter_request) {
$destination_url = $link->destination_url;
$link_id = $link->id;
break;
}
}
if (!empty($destination_url)){
if (get_option('mainwp_kwl_enable_statistic'))
$this->add_statistic($link_id, $_SERVER['REMOTE_ADDR'], $_SERVER['HTTP_REFERER']);
wp_redirect($destination_url);
die();
}
}
public function add_statistic($link_id, $addr, $referer, $type = 'click') {
if ($link_id > 0) {
$storeData = get_option('mainwp_kwl_click_statistic_data');
if ( ! is_array($storeData) )
$storeData = array();
$storeData[] = array(
'timestamp' => time(),
'link_id' => $link_id,
'ip' => $addr,
'referer' => $referer
);
update_option('mainwp_kwl_click_statistic_data', $storeData);
// Customize when we need to send the data
$this->sendClick();
}
}
// public function get_statistic() {
// global $wpdb;
// $link_id = $_POST['link_id'];
// if ($link_id) {
// $stat_data = get_option('mainwp_kwl_statistic_data_' . $link_id, array());
// if ($stat_data) {
// $return['stat_data'] = $stat_data;
// //$wpdb->query("UPDATE {$wpdb->prefix}options SET option_name = 'mainwp_kwl_statistic_data_done_" . $link_id . "' WHERE option_name = 'mainwp_kwl_statistic_data_" . $link_id . "'");
// update_option('mainwp_kwl_statistic_data_' . $link_id, '');
// } else
// $return['stat_data'] = 'EMPTY';
// $return['status'] = 'SUCCESS';
// }
// return $return;
// }
public function action() {
$result = array();
switch ($_POST['action']) {
case 'enable_stats':
$result = $this->enable_stats();
break;
case 'refresh_data':
$result = $this->refresh_data();
break;
case 'import_link':
case 'add_link':
$result = $this->edit_link();
break;
case 'delete_link':
$result = $this->delete_link();
break;
case 'clear_link':
$result = $this->clear_link();
break;
case 'update_config':
$result = $this->update_config();
break;
case 'donotlink_site_blocks':
$result = $this->donotlink_site_blocks();
break;
case 'donotlink_path_blocks':
$result = $this->donotlink_path_blocks();
break;
case 'donotlink_clear':
$result = $this->donotlink_clear();
break;
}
MainWPHelper::write($result);
}
public function enable_stats()
{
$result = array();
$enable_stats = intval($_POST['enablestats']);
if (update_option('mainwp_kwl_enable_statistic', $enable_stats))
$return['status'] = 'SUCCESS';
return $return;
}
public function refresh_data()
{
$result = array();
if (isset($_POST['clear_all'])) {
$cleared1 = update_option('mainwp_kwl_keyword_links', '');
$cleared2 = update_option('mainwp_kwl_options', '');
if ($cleared1 || $cleared2)
$return['status'] = 'SUCCESS';
}
return $return;
}
public function delete_link() {
$result = array();
if (!empty($_POST['link_id'])) {
$del_link = $this->get_link($_POST['link_id'], false);
if ($del_link) {
if ($del_link->type == 2 || $del_link->type == 3)
$deleted = delete_post_meta($del_link->post_id, '_mainwp_kwl_specific_link_id');
if ($this->set_link($del_link->id, ''))
$return['status'] = 'SUCCESS';
}
else
$return['status'] = 'SUCCESS';
}
return $return;
}
public function clear_link() {
$return = array();
$cleared = false;
if (!empty($_POST['link_id'])) {
$clear_link = $this->get_link($_POST['link_id'], false);
if ($clear_link) {
if ($clear_link->type == 3) {
$clear_link->type = 2;
$cleared = $this->set_link($clear_link->id, $clear_link);
} else if ($clear_link->type == 1) {
$cleared = $this->set_link($clear_link->id, ''); // delete link
}
}
else
$cleared = true;
}
if ($cleared)
$return['status'] = 'SUCCESS';
return $return;
}
public function edit_link() {
$return = array();
$link_id = $_POST['id'];
if (!empty($link_id)) {
$old = $this->get_link($link_id);
$link = new stdClass;
$link->id = intval($link_id);
$link->name = sanitize_text_field($_POST['name']);
$link->destination_url = sanitize_text_field($_POST['destination_url']);
$link->cloak_path = sanitize_text_field($_POST['cloak_path']);
$link->keyword = sanitize_text_field($_POST['keyword']);
$link->link_target = $_POST['link_target']; // number or text
$link->link_rel = $_POST['link_rel']; // number or text
$link->link_class = sanitize_text_field($_POST['link_class']);
$link->type = intval($_POST['type']);
if ($link->type == 2 || $link->type == 3) {
if (intval($_POST['post_id'])) {
$link->post_id = intval($_POST['post_id']);
} else if ($old && $old->post_id) {
$link->post_id = $old->post_id;
}
if ($link->post_id) {
update_post_meta($link->post_id, '_mainwp_kwl_specific_link_id', $link_id);
}
}
if ($this->set_link($link->id, $link))
$return['status'] = 'SUCCESS';
}
update_option('mainwpKeywordLinks', 1); // enable extension functions
return $return;
}
public function update_config() {
$return = array();
$this->config = array(
'replace_max' => intval($_POST['replace_max']),
'replace_max_keyword' => intval($_POST['replace_max_keyword']),
'default_link_nofollow' => intval($_POST['default_link_nofollow']),
'default_link_newtab' => intval($_POST['default_link_newtab']),
'replace_keyword_in_h_tag' => intval($_POST['replace_keyword_in_h_tag']),
'default_link_class' => sanitize_text_field($_POST['default_link_class']),
'post_match_title' => intval($_POST['post_match_title']),
'redirection_folder' => sanitize_text_field($_POST['redirection_folder']),
'enable_post_type' => $_POST['enable_post_type'],
'enable_post_type_link' => $_POST['enable_post_type_link']
);
update_option('mainwpKeywordLinks', 1); // enable extension functions
if (update_option('mainwp_kwl_options', $this->config)) {
$return['status'] = 'SUCCESS';
}
// force update
$this->update_htaccess(true);
return $return;
}
public function donotlink_site_blocks()
{
$return = array();
if ($this->set_option('mainwp_kwl_do_not_link_site_blocked', true))
$return['status'] = 'SUCCESS';
return $return;
}
public function donotlink_path_blocks()
{
$return = array();
if ($path = $_POST['path']) {
$paths = $this->get_option('mainwp_kwl_do_not_link_paths_blocked', array());
$paths[] = $path;
if ($this->set_option('mainwp_kwl_do_not_link_paths_blocked', $paths))
$return['status'] = 'SUCCESS';
}
return $return;
}
public function donotlink_clear()
{
$return = array();
if ($this->set_option('mainwp_kwl_do_not_link_site_blocked', ''))
$return['status'] = 'SUCCESS';
if ($this->set_option('mainwp_kwl_do_not_link_paths_blocked', ''))
$return['status'] = 'SUCCESS';
return $return;
}
}

View file

@ -0,0 +1,375 @@
<?php
class MainWPSecurity
{
public static function fixAll()
{
MainWPSecurity::remove_wp_version();
MainWPSecurity::remove_rsd();
MainWPSecurity::remove_wlw();
// MainWPSecurity::remove_core_update();
// MainWPSecurity::remove_plugin_update();
// MainWPSecurity::remove_theme_update();
MainWPSecurity::remove_php_reporting();
MainWPSecurity::remove_scripts_version();
MainWPSecurity::remove_styles_version();
MainWPSecurity::remove_readme();
add_filter('style_loader_src', array('MainWPSecurity', 'remove_script_versions'), 999 );
add_filter('style_loader_src', array('MainWPSecurity', 'remove_theme_versions'), 999 );
add_filter('script_loader_src', array('MainWPSecurity', 'remove_script_versions'), 999 );
add_filter('script_loader_src', array('MainWPSecurity', 'remove_theme_versions'), 999 );
}
//Prevent listing wp-content, wp-content/plugins, wp-content/themes, wp-content/uploads
private static $listingDirectories = null;
private static function init_listingDirectories()
{
if (MainWPSecurity::$listingDirectories == null)
{
$wp_upload_dir = wp_upload_dir();
MainWPSecurity::$listingDirectories = array(WP_CONTENT_DIR, WP_PLUGIN_DIR, get_theme_root(), $wp_upload_dir['basedir']);
}
}
public static function prevent_listing_ok()
{
MainWPSecurity::init_listingDirectories();
foreach (MainWPSecurity::$listingDirectories as $directory)
{
$file = $directory . DIRECTORY_SEPARATOR . 'index.php';
if (!file_exists($file))
{
return false;
}
}
return true;
}
public static function prevent_listing()
{
MainWPSecurity::init_listingDirectories();
foreach (MainWPSecurity::$listingDirectories as $directory)
{
$file = $directory . DIRECTORY_SEPARATOR . 'index.php';
if (!file_exists($file))
{
$h = fopen($file, 'w');
fwrite($h, '<?php die(); ?>');
fclose($h);
}
}
}
//Removed wp-version
public static function remove_wp_version_ok()
{
return !(has_action('wp_head', 'wp_generator') || has_filter('wp_head', 'wp_generator'));
}
public static function remove_wp_version()
{
if (get_option('mainwp_child_remove_wp_version') == 'T')
{
remove_action('wp_head', 'wp_generator');
remove_filter('wp_head', 'wp_generator');
}
}
//Removed Really Simple Discovery meta tag
public static function remove_rsd_ok()
{
return (!has_action('wp_head', 'rsd_link'));
}
public static function remove_rsd()
{
if (get_option('mainwp_child_remove_rsd') == 'T')
{
remove_action('wp_head', 'rsd_link');
}
}
//Removed Windows Live Writer meta tag
public static function remove_wlw_ok()
{
return (!has_action('wp_head', 'wlwmanifest_link'));
}
public static function remove_wlw()
{
if (get_option('mainwp_child_remove_wlw') == 'T')
{
remove_action('wp_head', 'wlwmanifest_link');
}
}
//Removed core update information for non-admins
// public static function remove_core_update_ok()
// {
// return (get_option('mainwp_child_remove_core_updates') == 'T');
// }
// public static function remove_core_update()
// {
// if (get_option('mainwp_child_remove_core_updates') == 'T')
// {
// if (!current_user_can('update_plugins'))
// {
// add_action('admin_init', create_function('$a', "remove_action( 'admin_notices', 'maintenance_nag' );"));
// add_action('admin_init', create_function('$a', "remove_action( 'admin_notices', 'update_nag', 3 );"));
// add_action('admin_init', create_function('$a', "remove_action( 'admin_init', '_maybe_update_core' );"));
// add_action('init', create_function('$a', "remove_action( 'init', 'wp_version_check' );"));
// add_filter('pre_option_update_core', create_function('$a', "return null;"));
// remove_action('wp_version_check', 'wp_version_check');
// remove_action('admin_init', '_maybe_update_core');
// add_filter('pre_transient_update_core', create_function('$a', "return null;"));
// add_filter('pre_site_transient_update_core', create_function('$a', "return null;"));
// }
// }
// }
//Removed plugin-update information for non-admins
// public static function remove_plugin_update_ok()
// {
// return (get_option('mainwp_child_remove_plugin_updates') == 'T');
// }
// public static function remove_plugin_update()
// {
// if (get_option('mainwp_child_remove_plugin_updates') == 'T')
// {
// if (!current_user_can('update_plugins'))
// {
// add_action('admin_init', create_function('$a', "remove_action( 'admin_init', 'wp_plugin_update_rows' );"), 2);
// add_action('admin_init', create_function('$a', "remove_action( 'admin_init', '_maybe_update_plugins' );"), 2);
// add_action('admin_menu', create_function('$a', "remove_action( 'load-plugins.php', 'wp_update_plugins' );"));
// add_action('admin_init', create_function('$a', "remove_action( 'admin_init', 'wp_update_plugins' );"), 2);
// add_action('init', create_function('$a', "remove_action( 'init', 'wp_update_plugins' );"), 2);
// add_filter('pre_option_update_plugins', create_function('$a', "return null;"));
// remove_action('load-plugins.php', 'wp_update_plugins');
// remove_action('load-update.php', 'wp_update_plugins');
// remove_action('admin_init', '_maybe_update_plugins');
// remove_action('wp_update_plugins', 'wp_update_plugins');
// remove_action('load-update-core.php', 'wp_update_plugins');
// add_filter('pre_transient_update_plugins', create_function('$a', "return null;"));
// }
// }
// }
//Removed theme-update information for non-admins
// public static function remove_theme_update_ok()
// {
// return (get_option('mainwp_child_remove_theme_updates') == 'T');
// }
// public static function remove_theme_update()
// {
// if (get_option('mainwp_child_remove_theme_updates') == 'T')
// {
// if (!current_user_can('edit_themes'))
// {
// remove_action('load-themes.php', 'wp_update_themes');
// remove_action('load-update.php', 'wp_update_themes');
// remove_action('admin_init', '_maybe_update_themes');
// remove_action('wp_update_themes', 'wp_update_themes');
// remove_action('load-update-core.php', 'wp_update_themes');
// add_filter('pre_transient_update_themes', create_function('$a', "return null;"));
// }
// }
// }
//File permissions not secure
private static $permission_checks = null;
private static function init_permission_checks()
{
if (MainWPSecurity::$permission_checks == null)
{
MainWPSecurity::$permission_checks = array(WP_CONTENT_DIR . DIRECTORY_SEPARATOR . '../' => '0755',
WP_CONTENT_DIR . DIRECTORY_SEPARATOR . '../wp-includes' => '0755',
WP_CONTENT_DIR . DIRECTORY_SEPARATOR . '../.htaccess' => '0644',
WP_CONTENT_DIR . DIRECTORY_SEPARATOR . 'index.php' => '0644',
WP_CONTENT_DIR . DIRECTORY_SEPARATOR . 'js/' => '0755',
WP_CONTENT_DIR . DIRECTORY_SEPARATOR . 'themes' => '0755',
WP_CONTENT_DIR . DIRECTORY_SEPARATOR . 'plugins' => '0755',
WP_CONTENT_DIR . DIRECTORY_SEPARATOR . '../wp-admin' => '0755',
WP_CONTENT_DIR => '0755');
}
}
// public static function fix_file_permissions_ok()
// {
// MainWPSecurity::init_permission_checks();
//
// $perms_issues = 0;
//
// foreach (MainWPSecurity::$permission_checks as $dir => $needed_perms)
// {
// if (!file_exists($dir)) continue;
//
// $perms = substr(sprintf('%o', fileperms($dir)), -4);
// if ($perms != $needed_perms)
// {
// $perms_issues++;
// }
// }
// return ($perms_issues == 0);
// }
// public static function fix_file_permissions()
// {
// MainWPSecurity::init_permission_checks();
// $success = true;
// foreach (MainWPSecurity::$permission_checks as $dir => $needed_perms)
// {
// if (!file_exists($dir)) continue;
// $success == $success && chmod($dir, $needed_perms);
// }
// return $success;
// }
//Database error reporting turned on/off
public static function remove_database_reporting_ok()
{
global $wpdb;
return ($wpdb->show_errors == false);
}
public static function remove_database_reporting()
{
global $wpdb;
$wpdb->hide_errors();
$wpdb->suppress_errors();
}
//PHP error reporting turned on/off
public static function remove_php_reporting_ok()
{
return !(((ini_get('display_errors') != 0) && (ini_get('display_errors') != 'off')) || ((ini_get('display_startup_errors') != 0) && (ini_get('display_startup_errors') != 'off')));
}
public static function remove_php_reporting()
{
if (get_option('mainwp_child_remove_php_reporting') == 'T')
{
@error_reporting(0);
@ini_set('display_errors', 'off');
@ini_set('display_startup_errors', 0);
}
}
//Removed version information for scripts/stylesheets
public static function remove_scripts_version_ok()
{
return (get_option('mainwp_child_remove_scripts_version') == 'T');
// global $wp_scripts;
// if (!is_a($wp_scripts, 'WP_Scripts'))
// {
// return true;
// }
// foreach ($wp_scripts->registered as $handle => $script)
// {
// if ($wp_scripts->registered[$handle]->ver != null)
// {
// return false;
// }
// }
// return true;
}
public static function remove_script_versions($src)
{
if (get_option('mainwp_child_remove_scripts_version') == 'T')
{
if (strpos($src, '?ver='))
$src = remove_query_arg('ver', $src);
return $src;
}
return $src;
}
public static function remove_theme_versions($src)
{
if (get_option('mainwp_child_remove_styles_version') == 'T')
{
if (strpos($src, '?ver='))
$src = remove_query_arg('ver', $src);
return $src;
}
return $src;
}
public static function remove_scripts_version()
{
if (get_option('mainwp_child_remove_scripts_version') == 'T')
{
global $wp_scripts;
if (!is_a($wp_scripts, 'WP_Scripts'))
return;
foreach ($wp_scripts->registered as $handle => $script)
$wp_scripts->registered[$handle]->ver = null;
}
}
public static function remove_readme()
{
if (get_option('mainwp_child_remove_readme') == 'T')
{
if (file_exists(ABSPATH . 'readme.html')) @unlink(ABSPATH . 'readme.html');
}
}
public static function remove_readme_ok()
{
return !file_exists(ABSPATH . 'readme.html');
}
public static function remove_styles_version_ok()
{
return (get_option('mainwp_child_remove_styles_version') == 'T');
// global $wp_styles;
// if (!is_a($wp_styles, 'WP_Styles'))
// {
// return true;
// }
//
// foreach ($wp_styles->registered as $handle => $style)
// {
// if ($wp_styles->registered[$handle]->ver != null)
// {
// return false;
// }
// }
// return true;
}
public static function remove_styles_version()
{
if (get_option('mainwp_child_remove_styles_version') == 'T')
{
global $wp_styles;
if (!is_a($wp_styles, 'WP_Styles'))
return;
foreach ($wp_styles->registered as $handle => $style)
$wp_styles->registered[$handle]->ver = null;
}
}
//Admin user name is not admin
public static function admin_user_ok()
{
$user = get_user_by('login', 'admin');
return !($user && ($user->wp_user_level == 10 || (isset($user->user_level) && $user->user_level == 10)));
}
}
?>

0
class/index.html Normal file
View file

0
index.html Normal file
View file

362
js/heatmap.js Normal file
View file

@ -0,0 +1,362 @@
/*
* heatmap.js 1.0 - JavaScript Heatmap Library
*
* Copyright (c) 2011, Patrick Wied (http://www.patrick-wied.at)
* Dual-licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
* and the Beerware (http://en.wikipedia.org/wiki/Beerware) license.
*/
(function(w){
// the heatmapFactory creates heatmap instances
var heatmapFactory = (function(){
// store object constructor
// a heatmap contains a store
// the store has to know about the heatmap in order to trigger heatmap updates when datapoints get added
function store(hmap){
var _ = {
// data is a two dimensional array
// a datapoint gets saved as data[point-x-value][point-y-value]
// the value at [point-x-value][point-y-value] is the occurrence of the datapoint
data: [],
// tight coupling of the heatmap object
heatmap: hmap
};
// the max occurrence - the heatmaps radial gradient alpha transition is based on it
this.max = 0;
this.get = function(key){
return _[key];
},
this.set = function(key, value){
_[key] = value;
};
};
store.prototype = {
// function for adding datapoints to the store
// datapoints are usually defined by x and y but could also contain a third parameter which represents the occurrence
addDataPoint: function(x, y){
if(x < 0 || y < 0)
return;
var heatmap = this.get("heatmap"),
data = this.get("data");
if(!data[x]) data[x] = [];
if(!data[x][y]) data[x][y] = 1;
// if count parameter is set increment by count otherwise by 1
data[x][y]+=(arguments.length<3)?1:arguments[2];
// do we have a new maximum?
if(this.max < data[x][y]){
this.max = data[x][y];
// max changed, we need to redraw all existing(lower) datapoints
heatmap.get("actx").clearRect(0,0,heatmap.get("width"),heatmap.get("height"));
for(var one in data)
for(var two in data[one])
heatmap.drawAlpha(one, two, data[one][two]);
// @TODO
// implement feature
// heatmap.drawLegend(); ?
return;
}
heatmap.drawAlpha(x, y, data[x][y]);
},
setDataSet: function(obj){
this.max = obj.max;
var heatmap = this.get("heatmap"),
data = this.get("data"),
d = obj.data,
dlen = d.length;
// clear the heatmap before the data set gets drawn
heatmap.clear();
while(dlen--){
var point = d[dlen];
heatmap.drawAlpha(point.x, point.y, point.count);
if(!data[point.x]) data[point.x] = [];
if(!data[point.x][point.y]) data[point.x][point.y] = 1;
data[point.x][point.y]+=point.count;
}
// Add event after all done
// 10-22-2011 by Jeffri Hong
if ( typeof(obj.callback) == 'function' )
obj.callback();
},
exportDataSet: function(){
var data = this.get("data");
var exportData = [];
for(var one in data){
// jump over undefined indexes
if(one === undefined)
continue;
for(var two in data[one]){
if(two === undefined)
continue;
// if both indexes are defined, push the values into the array
exportData.push({x: parseInt(one, 10), y: parseInt(two, 10), count: data[one][two]});
}
}
return exportData;
},
generateRandomDataSet: function(points){
var heatmap = this.get("heatmap"),
w = heatmap.get("width"),
h = heatmap.get("height");
var randomset = {},
max = Math.floor(Math.random()*1000+1);
randomset.max = max;
var data = [];
while(points--){
data.push({x: Math.floor(Math.random()*w+1), y: Math.floor(Math.random()*h+1), count: Math.floor(Math.random()*max+1)});
}
randomset.data = data;
this.setDataSet(randomset);
}
};
// heatmap object constructor
function heatmap(config){
// private variables
var _ = {
radiusIn : 20,
radiusOut : 40,
element : {},
canvas : {},
acanvas: {},
ctx : {},
actx : {},
visible : true,
width : 0,
height : 0,
max : false,
gradient : false,
opacity: 180
};
// heatmap store containing the datapoints and information about the maximum
// accessible via instance.store
this.store = new store(this);
this.get = function(key){
return _[key];
},
this.set = function(key, value){
_[key] = value;
};
// configure the heatmap when an instance gets created
this.configure(config);
// and initialize it
this.init();
};
// public functions
heatmap.prototype = {
configure: function(config){
if(config.radius){
var rout = config.radius,
rin = parseInt(rout/2);
}
this.set("radiusIn", rin || 15),
this.set("radiusOut", rout || 40),
this.set("element", (config.element instanceof Object)?config.element:document.getElementById(config.element));
this.set("visible", config.visible);
this.set("max", config.max || false);
this.set("gradient", config.gradient || { 0.45: "rgb(0,0,255)", 0.55: "rgb(0,255,255)", 0.65: "rgb(0,255,0)", 0.95: "yellow", 1.0: "rgb(255,0,0)"}); // default is the common blue to red gradient
this.set("opacity", parseInt(255/(100/config.opacity), 10) || 180);
this.set("width", config.width || 0);
this.set("height", config.height || 0);
},
init: function(){
this.initColorPalette();
var canvas = document.createElement("canvas"),
acanvas = document.createElement("canvas"),
element = this.get("element");
this.set("canvas", canvas);
this.set("acanvas", acanvas);
canvas.width = acanvas.width = element.style.width.replace(/px/,"") || this.getWidth(element);
this.set("width", canvas.width);
canvas.height = acanvas.height = element.style.height.replace(/px/,"") || this.getHeight(element);
this.set("height", canvas.height);
canvas.style.position = acanvas.style.position = "absolute";
canvas.style.top = acanvas.style.top = "0";
canvas.style.left = acanvas.style.left = "0";
canvas.style.zIndex = 1000000;
if(!this.get("visible"))
canvas.style.display = "none";
this.get("element").appendChild(canvas);
this.set("ctx", canvas.getContext("2d"));
this.set("actx", acanvas.getContext("2d"));
},
initColorPalette: function(){
var canvas = document.createElement("canvas");
canvas.width = "1";
canvas.height = "256";
var ctx = canvas.getContext("2d");
var grad = ctx.createLinearGradient(0,0,1,256),
gradient = this.get("gradient");
for(var x in gradient){
grad.addColorStop(x, gradient[x]);
}
ctx.fillStyle = grad;
ctx.fillRect(0,0,1,256);
this.set("gradient", ctx.getImageData(0,0,1,256).data);
delete canvas;
delete grad;
delete ctx;
},
getWidth: function(element){
var width = element.offsetWidth;
if(element.style.paddingLeft)
width+=element.style.paddingLeft;
if(element.style.paddingRight)
width+=element.style.paddingRight;
return width;
},
getHeight: function(element){
var height = element.offsetHeight;
if(element.style.paddingTop)
height+=element.style.paddingTop;
if(element.style.paddingBottom)
height+=element.style.paddingBottom;
return height;
},
colorize: function(x, y){
// get the private variables
var width = this.get("width"),
radiusOut = this.get("radiusOut"),
height = this.get("height"),
actx = this.get("actx"),
ctx = this.get("ctx");
var x2 = radiusOut*2;
if(x+x2>width)
x=width-x2;
if(x<0)
x=0;
if(y<0)
y=0;
if(y+x2>height)
y=height-x2;
// get the image data for the mouse movement area
var image = actx.getImageData(x,y,x2,x2),
// some performance tweaks
imageData = image.data,
length = imageData.length,
palette = this.get("gradient"),
opacity = this.get("opacity");
// loop thru the area
for(var i=3; i < length; i+=4){
// [0] -> r, [1] -> g, [2] -> b, [3] -> alpha
var alpha = imageData[i],
offset = alpha*4;
if(!offset)
continue;
// we ve started with i=3
// set the new r, g and b values
imageData[i-3]=palette[offset];
imageData[i-2]=palette[offset+1];
imageData[i-1]=palette[offset+2];
// we want the heatmap to have a gradient from transparent to the colors
// as long as alpha is lower than the defined opacity (maximum), we'll use the alpha value
imageData[i] = (alpha < opacity)?alpha:opacity;
}
// the rgb data manipulation didn't affect the ImageData object(defined on the top)
// after the manipulation process we have to set the manipulated data to the ImageData object
image.data = imageData;
ctx.putImageData(image,x,y);
},
drawAlpha: function(x, y, count){
// storing the variables because they will be often used
var r1 = this.get("radiusIn"),
r2 = this.get("radiusOut"),
ctx = this.get("actx"),
max = this.get("max"),
// create a radial gradient with the defined parameters. we want to draw an alphamap
rgr = ctx.createRadialGradient(x,y,r1,x,y,r2),
xb = x-r2, yb = y-r2, mul = 2*r2;
// the center of the radial gradient has .1 alpha value
rgr.addColorStop(0, 'rgba(0,0,0,'+((count)?(count/this.store.max):'0.1')+')');
// and it fades out to 0
rgr.addColorStop(1, 'rgba(0,0,0,0)');
// drawing the gradient
ctx.fillStyle = rgr;
ctx.fillRect(xb,yb,mul,mul);
// finally colorize the area
this.colorize(xb,yb);
},
toggleDisplay: function(){
var visible = this.get("visible"),
canvas = this.get("canvas");
if(!visible)
canvas.style.display = "block";
else
canvas.style.display = "none";
this.set("visible", !visible);
},
// dataURL export
getImageData: function(){
return this.get("canvas").toDataURL();
},
clear: function(){
var w = this.get("width"),
h = this.get("height");
this.store.set("data",[]);
// @TODO: reset stores max to 1
//this.store.max = 1;
this.get("ctx").clearRect(0,0,w,h);
this.get("actx").clearRect(0,0,w,h);
}
};
return {
create: function(config){
return new heatmap(config);
},
util: {
mousePosition: function(ev){
// this doesn't work right
// rather use
/*
// this = element to observe
var x = ev.pageX - this.offsetLeft;
var y = ev.pageY - this.offsetTop;
*/
var x, y;
if (ev.layerX) { // Firefox
x = ev.layerX;
y = ev.layerY;
} else if (ev.offsetX) { // Opera
x = ev.offsetX;
y = ev.offsetY;
}
if(typeof(x)=='undefined')
return;
return [x,y];
}
}
};
})();
w.h337 = w.heatmapFactory = heatmapFactory;
})(window);

41
js/heatmapinit.js Normal file
View file

@ -0,0 +1,41 @@
/**
* Initiate heatmap object
*/
jQuery(window).load(function(){
if ( heatmapError == 0 )
{
jQuery('body').append( '<div id="hmap_loading" style="position:fixed;top:0;left:50%;margin-left:-200px;width:400px;height:30px;line-height:30px;background:#ffd;border:1px solid #bb9;border-top:none;text-align:center;font-weight:bold;border-bottom-left-radius:8px;border-bottom-right-radius:8px;">Loading...</div>' );
setTimeout(generate_heatmap, 1000);
}
else
{
jQuery('body').append( '<div id="hmap_error" style="position:fixed;top:0;left:50%;margin-left:-200px;width:400px;height:30px;line-height:30px;background:#fee;border:1px solid #b99;border-top:none;text-align:center;font-weight:bold;border-bottom-left-radius:8px;border-bottom-right-radius:8px;">An error occured.</div>' );
}
});
function generate_heatmap()
{
var hmap = h337.create({"element":document.body, "radius":15, "visible":true});
var width = jQuery(document).width();
var data = [];
for ( i in heatmapClick )
{
data.push({
x: ( heatmapClick[i].w-width > 0 ? heatmapClick[i].x - ( Math.floor(heatmapClick[i].w-width)/2 ) : heatmapClick[i].x ),
y: heatmapClick[i].y,
count: 1
});
}
var max = Math.floor(data.length/10);
hmap.store.setDataSet({
max: ( max > 5 ? Math.floor(data.length/max) : 5 ),
data: data,
callback: function(){
jQuery('#hmap_loading').fadeOut(500);
}
});
}

0
js/index.html Normal file
View file

22
js/keywordlinks.js Normal file
View file

@ -0,0 +1,22 @@
/**
* Mouse click tracking
*/
jQuery(document).ready(function($){
$('.kwl-regular-link').click(function(){
var link_id = $(this).attr('link-id');
if (link_id) {
$.ajax({
data : {
link_id: link_id,
ip: kwlIp,
referer: kwlReferer,
action: 'keywordLinksSaveClick',
nonce: kwlNonce
},
type: 'POST',
url: kwlAjaxUrl
});
}
});
});

62
js/tracker.js Normal file
View file

@ -0,0 +1,62 @@
/**
* Mouse click tracking
*/
var trackerData = [];
jQuery(document).ready(function($){
$(document).click(function(e){
var element = $(e.target).parents().map(getSelector).get().reverse().join(">");
element += '>'+$(e.target).map(getSelector).get();
var url = ( $(e.target).attr('href') ) ? $(e.target).attr('href') : $(e.target).attr('src');
var title = $(e.target).attr('title');
var alt = $(e.target).attr('alt');
var text = ( $(e.target).text().length == $(e.target).html().length ) ? $(e.target).text().substring(0, 511) : '';
trackerData.push({
coord: e.pageX+','+e.pageY,
type: 'left',
viewport: $(window).width()+','+$(window).height(),
element: element,
url: url,
title: title,
alt: alt,
text: text
});
});
$(window).unload(function(){
sendTrackData(true); // Make sure to send track data before going off from page, set it synchronious
});
function getSelector()
{
var el_class = $(this).attr('class');
var el_id = $(this).attr('id');
var el_index = $(this).index();
return this.tagName + ( el_id ? '#'+el_id : '' ) +
( el_class ? '.'+el_class.match(/^\S+/) : '' ) +
( el_index > 0 ? ':eq('+(el_index)+')' : '' );
}
function sendTrackData( sync )
{
if ( trackerData.length < 1 )
return;
$.ajax({
data : {
data: trackerData,
action: 'heatmapSaveClick',
nonce: trackerNonce
},
complete: function(){
trackerData = [];
},
async: ( sync ) ? false : true,
type: 'POST',
url: trackerAjaxUrl
});
}
setInterval(function(){ sendTrackData(false); }, 10000);
});

Binary file not shown.

View file

@ -0,0 +1,411 @@
msgid ""
msgstr ""
"Project-Id-Version: MainWP Child v0.11\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: 2013-11-15 14:06:16+0000\n"
"Last-Translator: admin <support@mainwp.com>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: CSL v1.x\n"
"X-Poedit-Language: Bosnian\n"
"X-Poedit-Country: BOSNIA AND HERZEGOWINA\n"
"X-Poedit-SourceCharset: utf-8\n"
"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;\n"
"X-Poedit-Basepath: ../\n"
"X-Poedit-Bookmarks: \n"
"X-Poedit-SearchPath-0: .\n"
"X-Textdomain-Support: yes"
#: class/MainWPChild.class.php:132
#: class/MainWPChild.class.php:154
#@ mainwp-child
msgid "MainWP Settings"
msgstr "MainWP Podešavanje"
#: class/MainWPChild.class.php:158
#@ mainwp-child
msgid "Connection Settings"
msgstr "Podešavanje konekcije"
#: class/MainWPChild.class.php:166
#@ mainwp-child
msgid "Require Unique Security ID"
msgstr "Zahtev za jedinstveni sigurnosni ključ"
#: class/MainWPChild.class.php:169
#@ mainwp-child
msgid "Your Unique Security ID is:"
msgstr "Vaš jedinstveni sigurnosni ključ je:"
#: class/MainWPChild.class.php:173
#@ mainwp-child
msgid "The Unique Security ID adds additional protection between the Child plugin and your<br/>Main Dashboard. The Unique Security ID will need to match when being added to <br/>the Main Dashboard. This is additional security and should not be needed in most situations."
msgstr "Jedinstveni sigurnosni ključ obezbeđuje dodatnu zaštitu između sajta i kontrolne table.<br/> Jedinstveni sigurnosni ključ se mora poklapati prilikom dodavanja sajta u kontrolnu tablu. <br/> Ova dodatna sigrnosna opcija, u većini slučajeva nije potrebna."
#: class/MainWPChild.class.php:179
#@ mainwp-child
msgid "Save Changes"
msgstr "Sačuvaj Promene"
#: class/MainWPChild.class.php:424
#@ mainwp-child
msgid "Authentication failed. Reinstall MainWP plugin please"
msgstr "Autentifikacija neuspešna. Molimo, reinstalirajte MainWP."
#: class/MainWPChild.class.php:433
#: class/MainWPChild.class.php:787
#@ mainwp-child
msgid "No such user"
msgstr "Nepostojeći korisnik"
#: class/MainWPChild.class.php:438
#: class/MainWPChild.class.php:791
#@ mainwp-child
msgid "User is not an administrator"
msgstr "Korisnik nema administratorske privilegije."
#: class/MainWPChild.class.php:528
#@ mainwp-child
msgid "Bad request."
msgstr "Loš zahtev."
#: class/MainWPChild.class.php:699
#: class/MainWPChild.class.php:704
#: class/MainWPChild.class.php:736
#: class/MainWPChild.class.php:741
#: class/MainWPChild.class.php:746
#@ mainwp-child
msgid "Bad request"
msgstr "Loš zahtev."
#: class/MainWPChild.class.php:761
#@ mainwp-child
msgid "Invalid request"
msgstr "Nevažeći zahtev."
#: class/MainWPChild.class.php:767
#@ mainwp-child
msgid "Public key already set, reset the MainWP plugin on your site and try again."
msgstr "Javni ključ je već podešen, resetujte MainWP na sajtu i pokušajte ponovo."
#: class/MainWPChild.class.php:774
#@ mainwp-child
msgid "This Child Site is set to require a Unique Security ID - Please Enter It before connection can be established."
msgstr "Jedinstveni sigurnosni ključ je potreban za ovaj sajt - Molimo, unesite ključ kako bi konekcija mogla biti uspostavljena."
#: class/MainWPChild.class.php:778
#@ mainwp-child
msgid "The Unique Security ID you have entered does not match Child Security ID - Please Correct It before connection can be established."
msgstr "Jedinstveni sigurnosni ključ koji ste uneli se ne poklapa sa ključem na sajtu - Molimo, ispravite ključ kako bi konekcija mogla biti uspostavljena."
#: class/MainWPChild.class.php:1036
#@ mainwp-child
msgid "Could not change the admin password."
msgstr "Administratorska šifra nije mogla biti promenjena."
#: class/MainWPChild.class.php:1058
#@ mainwp-child
msgid "Undefined error"
msgstr "Nedefinisana greška"
#: class/MainWPChild.class.php:1072
#, php-format
#@ default
msgid "Username: %s"
msgstr "Korisnično ime: %s"
#: class/MainWPChild.class.php:1073
#, php-format
#@ default
msgid "Password: %s"
msgstr "Lozinka: %s"
#: class/MainWPChild.class.php:1076
#, php-format
#@ default
msgid "[%s] Your username and password"
msgstr "[%s] Vaše korisničko ime i lozinka"
#: class/MainWPChild.class.php:2326
#@ mainwp-child
msgid "This site already contains a link - please disable and enable the MainWP plugin."
msgstr "Saj već poseduje link - Molimo, deaktivirajte, pa ponovo aktivirajte MainWP"
#: class/MainWPChild.class.php:2433
#@ mainwp-child
msgid "Wordpress Filesystem error: "
msgstr "WordPress sistemska greška: "
#: class/MainWPClone.class.php:70
#@ mainwp-child
msgid "File could not be uploaded."
msgstr "Datoteka nije mogla biti uploadovana."
#: class/MainWPClone.class.php:75
#@ mainwp-child
msgid "File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini or by post_max_size being defined as smaller than upload_max_filesize in php.ini."
msgstr "Datoteka je prazna. Molimo, uplodujte validnu datoteku. Do ove greške moglo je doći ako je upload zabranjen u Vašoj php.ini datoteci ili ako je post_max_size definisan kao manji od upload_max_filesize u php.ini datoteci."
#: class/MainWPClone.class.php:84
#@ mainwp-child
msgid "Clone or Restore"
msgstr "Kloniranje ili Vratite prethodno stanje"
#: class/MainWPClone.class.php:88
#@ mainwp-child
msgid "Cloning is currently off - To turn on return to your main dashboard and turn cloning on on the Migrate/Clone page."
msgstr "Kloniranje je trenutno isključeno - da biste omogućili kloniranje, vratite se na Kontrolni sajt i uključite kloniranje na stranici Kloniranje."
#: class/MainWPClone.class.php:94
#@ mainwp-child
msgid "Your content directory is not writable. Please set 0755 permission to "
msgstr "Direktorium u kome se nalazi Vaš sadržaj nije upisiv. Molimo, podesite ovlašćenja na 0755. "
#: class/MainWPClone.class.php:98
#@ mainwp-child
msgid "Cloning process completed successfully! You will now need to click "
msgstr "Proces kloniranja uspešno završen! Potrebno je da kliknete "
#: class/MainWPClone.class.php:98
#: class/MainWPClone.class.php:956
#@ mainwp-child
msgid "here"
msgstr "ovde"
#: class/MainWPClone.class.php:98
#@ mainwp-child
msgid " to re-login to the admin and re-save permalinks."
msgstr "da biste se logovali i opet podesili linkove."
#: class/MainWPClone.class.php:103
#@ mainwp-child
msgid "Upload successful."
msgstr "Upload uspešan."
#: class/MainWPClone.class.php:103
#: class/MainWPClone.class.php:153
#@ mainwp-child
msgid "Clone/Restore Website"
msgstr "Klonira/Vrati Sajt"
#: class/MainWPClone.class.php:114
#@ mainwp-child
msgid "Cloning is currently on but no sites have been allowed, to allow sites return to your main dashboard and turn cloning on on the Migrate/Clone page."
msgstr "Kloniranje je trenutno uključeno, ali nema sajtova sa ovlašćenjem za kloniranje. Da biste omogućili sajtu da bude kloniran, vratite se na Kontrolni sajt i odaberite selktujte sajtove na stranici Kloniranje."
#: class/MainWPClone.class.php:122
#@ mainwp-child
msgid "Display by:"
msgstr "Prikaži po:"
#: class/MainWPClone.class.php:122
#@ mainwp-child
msgid "Site Name"
msgstr "Naziv Sajta"
#: class/MainWPClone.class.php:122
#@ mainwp-child
msgid "URL"
msgstr "URL"
#: class/MainWPClone.class.php:122
#@ mainwp-child
msgid "Clone Options"
msgstr "Opcije za kloniranje"
#: class/MainWPClone.class.php:139
#@ mainwp-child
msgid "Clone Website"
msgstr "Kloniraj sajt"
#: class/MainWPClone.class.php:148
#@ mainwp-child
msgid "Restore/Clone From Backup"
msgstr "Vrati/Kloniraj sa Backup datotekom"
#: class/MainWPClone.class.php:150
#@ mainwp-child
msgid "Upload backup in .zip format (Maximum filesize for your server settings: "
msgstr "Uploadujte backup datoteku u .zip formatu. (Maksimalna veličina datoteke za Vaš server je: "
#: class/MainWPClone.class.php:151
#@ mainwp-child
msgid "If you have a FULL backup created by your Network dashboard you may restore it by uploading here."
msgstr "Ako image Kompletan Backup kreiran uz pomoć MainWP plugina, možete ga uploadovati ovde."
#: class/MainWPClone.class.php:152
#@ mainwp-child
msgid "A database only backup will not work."
msgstr "Backup samo baze podataka neće raditi."
#: class/MainWPClone.class.php:662
#: class/MainWPClone.class.php:699
#@ mainwp-child
msgid "No site given"
msgstr "Nema datog sajta"
#: class/MainWPClone.class.php:667
#: class/MainWPClone.class.php:704
#@ mainwp-child
msgid "Site not found"
msgstr "Sajt nije pronađen"
#: class/MainWPClone.class.php:679
#@ mainwp-child
msgid "Could not create backupfile on child"
msgstr "Kreiranje backup datoteke na sajtu neuspešan"
#: class/MainWPClone.class.php:715
#@ mainwp-child
msgid "Invalid response"
msgstr "Nevažeći odgovor"
#: class/MainWPClone.class.php:731
#@ mainwp-child
msgid "No download link given"
msgstr "Link za preuzimanje nije dat"
#: class/MainWPClone.class.php:803
#: class/MainWPClone.class.php:832
#@ mainwp-child
msgid "No download file found"
msgstr "Datoteka za preuzimanje nije pronađena"
#: class/MainWPClone.class.php:838
#@ mainwp-child
msgid "Backup file not found"
msgstr "Backup datoteka nije pronađena"
#: class/MainWPClone.class.php:956
#@ mainwp-child
msgid "Cloning process completed successfully! Check and re-save permalinks "
msgstr "Process kloniranja uspešno završen! Proverite i ponovo sačuvajte perma-linkove "
#: class/MainWPCloneInstall.class.php:79
#: class/MainWPCloneInstall.class.php:80
#@ mainwp-child
msgid "Not a full backup."
msgstr "Nije kompletan backup."
#: class/MainWPCloneInstall.class.php:81
#@ mainwp-child
msgid "Database backup not found."
msgstr "Backup baze podataka nije pronađen."
#: class/MainWPCloneInstall.class.php:118
#@ mainwp-child
msgid "Cant read configuration file from backup"
msgstr "Nije moguće prošitati konfiguracionu datoteku iz backup-a"
#: class/MainWPCloneInstall.class.php:130
#@ mainwp-child
msgid "Invalid database host or user/password."
msgstr "Nevažeći host baze podataka ili korisničko ime i lozinka."
#: class/MainWPCloneInstall.class.php:133
#@ mainwp-child
msgid "Invalid database name"
msgstr "Pogrešan naziv baze podataka"
#: class/MainWPCloneInstall.class.php:239
#@ mainwp-child
msgid "Error importing database"
msgstr "Greška pri unosu baze podataka"
#: class/MainWPCloneInstall.class.php:244
#@ mainwp-child
msgid "Error: unexpected end of file for database"
msgstr "Greška: neočekivan kraj baze podataka"
#: class/MainWPHeatmapTracker.class.php:68
#@ default
msgid "Home Page"
msgstr "Glavna strana"
#: class/MainWPHeatmapTracker.class.php:111
#@ default
msgid "Archive"
msgstr "Arhiva"
#: class/MainWPHeatmapTracker.class.php:135
#@ default
msgid "Search"
msgstr "Pretraži"
#: class/MainWPHeatmapTracker.class.php:144
#@ default
msgid "Blog Home Page"
msgstr "Glavan strana bloga"
#: class/MainWPHelper.class.php:233
#@ mainwp-child
msgid "Unable to create directory "
msgstr "Kreiranje direktorijuma nemoguće "
#: class/MainWPHelper.class.php:233
#@ mainwp-child
msgid " Is its parent directory writable by the server?"
msgstr "Da li je direktorijum upisiv od strane servera?"
#: class/MainWPHelper.class.php:376
#@ mainwp-child
msgid "Something went wrong while contacting the child site. Please check if there is an error on the child site. This error could also be caused by trying to clone or restore a site to large for your server settings."
msgstr "Nešto nije u redu u komunikaciji za sajtom. Molimo proverite da li ima grešaka na sajtu. Do ove greške moglo je doći ako ste pokušali klonirati sajt veći nego što je dozvoljeno u podešavanjima servera."
#: class/MainWPHelper.class.php:380
#@ mainwp-child
msgid "Child plugin is disabled or the security key is incorrect. Please resync with your main installation."
msgstr "Child Plugin je isključen ili je sigurnosni ključ pogrešan. Molimo, sinhronizujte sa Vašnom glavnom instalacijom."
#: class/MainWPClone.class.php:15
#@ mainwp-child
msgid "MainWP Clone"
msgstr "MainWP Kloniranje"
#: class/MainWPClone.class.php:221
#, php-format
#@ mainwp-child
msgid "This is a large site (%dMB), the clone process will more than likely fail."
msgstr "Ovo je veliki sajt (%dMB), kloniranje verovatno neće uspeti."
#: class/MainWPClone.class.php:222
#@ mainwp-child
msgid "Continue Anyway?"
msgstr "Nastavi u svakom slučaju?"
#: class/MainWPClone.class.php:223
#, php-format
#@ mainwp-child
msgid "Creating backup on %s expected size: %dMB (estimated time: %d seconds)"
msgstr "Kreiranje backupa na %s očekivana veličina %dMB (očekivano vreme trajanja %d sekundi)"
#: class/MainWPClone.class.php:224
#, php-format
#@ mainwp-child
msgid "Backup created on %s total size to download: %dMB"
msgstr "Backup kreiran na %s puna veličina za download: %dMB"
#: class/MainWPClone.class.php:225
#@ mainwp-child
msgid "Downloading backup"
msgstr "Preuzimanje backupa"
#: class/MainWPClone.class.php:226
#@ mainwp-child
msgid "Backup downloaded"
msgstr "Backup preuzet"
#: class/MainWPClone.class.php:227
#@ mainwp-child
msgid "Extracting backup and updating your database, this might take a while. Please be patient."
msgstr "Raspakivanje backupa i ažuriranje baze podataka u toku, ovo može potrajati. Molimo, budite strpljivi."
#: class/MainWPClone.class.php:228
#@ mainwp-child
msgid "Cloning process completed successfully!"
msgstr "Kloniranje uspešno završeno!"

Binary file not shown.

View file

@ -0,0 +1,735 @@
msgid ""
msgstr ""
"Project-Id-Version: MainWP Child v0.19\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: 2014-01-22 18:14:51+0000\n"
"Last-Translator: JayJay <info@w-d-a.de>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: CSL v1.x\n"
"X-Poedit-Language: German\n"
"X-Poedit-Country: GERMANY\n"
"X-Poedit-SourceCharset: utf-8\n"
"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;\n"
"X-Poedit-Basepath: ../\n"
"X-Poedit-Bookmarks: \n"
"X-Poedit-SearchPath-0: .\n"
"X-Textdomain-Support: yes"
#: class/MainWPChild.class.php:137
#: class/MainWPChild.class.php:163
#@ mainwp-child
msgid "MainWP Settings"
msgstr "MainWP Einstellungen"
#: class/MainWPChild.class.php:167
#@ mainwp-child
msgid "Connection Settings"
msgstr "Verbindungseinstellungen"
#: class/MainWPChild.class.php:175
#@ mainwp-child
msgid "Require Unique Security ID"
msgstr "Eine eindeutige Sicherheits-ID"
#: class/MainWPChild.class.php:178
#@ mainwp-child
msgid "Your Unique Security ID is:"
msgstr "Ihre eindeutige Sicherheits-ID ist:"
#: class/MainWPChild.class.php:182
#@ mainwp-child
msgid "The Unique Security ID adds additional protection between the Child plugin and your<br/>Main Dashboard. The Unique Security ID will need to match when being added to <br/>the Main Dashboard. This is additional security and should not be needed in most situations."
msgstr "Die eindeutige Sicherheits-ID bringt zusätzlichen Schutz zwischen dem Client und Ihrem<br/>MainWP Dashboard. Die eindeutige Sicherheits-ID muß übereinstimmen, wenn sie im MainWP Dashboard aufgenommen wird.<br/> Dies ist eine zusätzliche Sicherheit und ist in den meisten Fällen nicht erforderlich."
#: class/MainWPChild.class.php:188
#@ mainwp-child
msgid "Save Changes"
msgstr "Änderungen speichern"
#: class/MainWPChild.class.php:446
#@ mainwp-child
msgid "Authentication failed. Reinstall MainWP plugin please"
msgstr "Authentifizierung fehlgeschlagen. Installieren Sie bitte das MainWP Plugin erneut."
#: class/MainWPChild.class.php:455
#: class/MainWPChild.class.php:846
#@ mainwp-child
msgid "No such user"
msgstr "Keine solche Benutzer"
#: class/MainWPChild.class.php:460
#: class/MainWPChild.class.php:850
#@ mainwp-child
msgid "User is not an administrator"
msgstr "Benutzer ist kein Administrator"
#: class/MainWPChild.class.php:550
#@ mainwp-child
msgid "Bad request."
msgstr "Fehlerhafte Anforderung."
#: class/MainWPChild.class.php:757
#: class/MainWPChild.class.php:762
#: class/MainWPChild.class.php:795
#: class/MainWPChild.class.php:800
#: class/MainWPChild.class.php:805
#@ mainwp-child
msgid "Bad request"
msgstr "Fehlerhafte Anforderung"
#: class/MainWPChild.class.php:820
#@ mainwp-child
msgid "Invalid request"
msgstr "Ungültige Anforderung"
#: class/MainWPChild.class.php:826
#@ mainwp-child
msgid "Public key already set, reset the MainWP plugin on your site and try again."
msgstr "Öffentlicher Schlüssel bereits festgelegt, setzen Sie die MainWP Plugin auf Ihrer Website erneut auf und versuchen Sie es noch einmal"
#: class/MainWPChild.class.php:833
#@ mainwp-child
msgid "This Child Site is set to require a Unique Security ID - Please Enter It before connection can be established."
msgstr "Dieser Client erfordert eine eindeutige Sicherheits-ID. Bitte geben Sie diese ein bevor eine Verbindung hergestellt werden kann."
#: class/MainWPChild.class.php:837
#@ mainwp-child
msgid "The Unique Security ID you have entered does not match Child Security ID - Please Correct It before connection can be established."
msgstr "Die eindeutige Sicherheits-ID die Sie eingegeben haben, entspricht nicht der Client Security ID. Bitte verbessern Sie dies bevor eine Verbindung hergestellt werden kann."
#: class/MainWPChild.class.php:1102
#@ mainwp-child
msgid "Could not change the admin password."
msgstr "Das Admin-Passwort kann nicht geändern werden."
#: class/MainWPChild.class.php:1124
#@ mainwp-child
msgid "Undefined error"
msgstr "Undefinierter Fehler"
#: class/MainWPChild.class.php:1138
#, php-format
#@ default
msgid "Username: %s"
msgstr ""
#: class/MainWPChild.class.php:1139
#, php-format
#@ default
msgid "Password: %s"
msgstr ""
#: class/MainWPChild.class.php:1142
#, php-format
#@ default
msgid "[%s] Your username and password"
msgstr ""
#: class/MainWPChild.class.php:2446
#@ mainwp-child
msgid "This site already contains a link - please disable and enable the MainWP plugin."
msgstr "Diese Website enthält bereits diesen Link"
#: class/MainWPChild.class.php:2557
#@ mainwp-child
msgid "Wordpress Filesystem error: "
msgstr "Wordpress-Dateisystem-Fehler:"
#: class/MainWPChildServerInformation.class.php:12
#@ mainwp
msgid "Server Configuration"
msgstr ""
#: class/MainWPChildServerInformation.class.php:13
#@ mainwp
msgid "Suggested Value"
msgstr ""
#: class/MainWPChildServerInformation.class.php:14
#: class/MainWPChildServerInformation.class.php:56
#@ mainwp
msgid "Value"
msgstr ""
#: class/MainWPChildServerInformation.class.php:15
#: class/MainWPChildServerInformation.class.php:41
#@ mainwp
msgid "Status"
msgstr ""
#: class/MainWPChildServerInformation.class.php:37
#@ mainwp
msgid "Directory name"
msgstr ""
#: class/MainWPChildServerInformation.class.php:38
#@ mainwp
msgid "Path"
msgstr ""
#: class/MainWPChildServerInformation.class.php:39
#@ mainwp
msgid "Check"
msgstr ""
#: class/MainWPChildServerInformation.class.php:40
#@ mainwp
msgid "Result"
msgstr ""
#: class/MainWPChildServerInformation.class.php:55
#@ mainwp
msgid "Server Info"
msgstr ""
#: class/MainWPChildServerInformation.class.php:60
#@ mainwp
msgid "WordPress Root Directory"
msgstr ""
#: class/MainWPChildServerInformation.class.php:61
#@ mainwp
msgid "Server Name"
msgstr ""
#: class/MainWPChildServerInformation.class.php:62
#@ mainwp
msgid "Server Sofware"
msgstr ""
#: class/MainWPChildServerInformation.class.php:63
#@ mainwp
msgid "Operating System"
msgstr ""
#: class/MainWPChildServerInformation.class.php:64
#@ mainwp
msgid "Architecture"
msgstr ""
#: class/MainWPChildServerInformation.class.php:65
#@ mainwp
msgid "Server IP"
msgstr ""
#: class/MainWPChildServerInformation.class.php:66
#@ mainwp
msgid "Server Protocol"
msgstr ""
#: class/MainWPChildServerInformation.class.php:67
#@ mainwp
msgid "HTTP Host"
msgstr ""
#: class/MainWPChildServerInformation.class.php:68
#@ mainwp
msgid "Server Admin"
msgstr ""
#: class/MainWPChildServerInformation.class.php:69
#@ mainwp
msgid "Server Port"
msgstr ""
#: class/MainWPChildServerInformation.class.php:70
#@ mainwp
msgid "Getaway Interface"
msgstr ""
#: class/MainWPChildServerInformation.class.php:71
#@ mainwp
msgid "Memory Usage"
msgstr ""
#: class/MainWPChildServerInformation.class.php:72
#@ mainwp
msgid "HTTPS"
msgstr ""
#: class/MainWPChildServerInformation.class.php:73
#@ mainwp
msgid "User Agent"
msgstr ""
#: class/MainWPChildServerInformation.class.php:74
#@ mainwp
msgid "Complete URL"
msgstr ""
#: class/MainWPChildServerInformation.class.php:75
#@ mainwp
msgid "Request Method"
msgstr ""
#: class/MainWPChildServerInformation.class.php:76
#@ mainwp
msgid "Request Time"
msgstr ""
#: class/MainWPChildServerInformation.class.php:77
#@ mainwp
msgid "Query String"
msgstr ""
#: class/MainWPChildServerInformation.class.php:78
#@ mainwp
msgid "Accept Content"
msgstr ""
#: class/MainWPChildServerInformation.class.php:79
#@ mainwp
msgid "Accept-Charset Content"
msgstr ""
#: class/MainWPChildServerInformation.class.php:80
#@ mainwp
msgid "Currently Executing Script Pathname"
msgstr ""
#: class/MainWPChildServerInformation.class.php:81
#@ mainwp
msgid "Server Signature"
msgstr ""
#: class/MainWPChildServerInformation.class.php:82
#@ mainwp
msgid "Currently Executing Script"
msgstr ""
#: class/MainWPChildServerInformation.class.php:83
#@ mainwp
msgid "Path Translated"
msgstr ""
#: class/MainWPChildServerInformation.class.php:84
#@ mainwp
msgid "Current Script Path"
msgstr ""
#: class/MainWPChildServerInformation.class.php:85
#@ mainwp
msgid "Current Page URI"
msgstr ""
#: class/MainWPChildServerInformation.class.php:86
#@ mainwp
msgid "Remote Address"
msgstr ""
#: class/MainWPChildServerInformation.class.php:87
#@ mainwp
msgid "Remote Host"
msgstr ""
#: class/MainWPChildServerInformation.class.php:88
#@ mainwp
msgid "Remote Port"
msgstr ""
#: class/MainWPChildServerInformation.class.php:89
#@ mainwp
msgid "PHP Safe Mode"
msgstr ""
#: class/MainWPChildServerInformation.class.php:90
#@ mainwp
msgid "PHP Allow URL fopen"
msgstr ""
#: class/MainWPChildServerInformation.class.php:91
#@ mainwp
msgid "PHP Exif Support"
msgstr ""
#: class/MainWPChildServerInformation.class.php:92
#@ mainwp
msgid "PHP IPTC Support"
msgstr ""
#: class/MainWPChildServerInformation.class.php:93
#@ mainwp
msgid "PHP XML Support"
msgstr ""
#: class/MainWPChildServerInformation.class.php:94
#@ mainwp
msgid "SQL Mode"
msgstr ""
#: class/MainWPChildServerInformation.class.php:109
#@ mainwp
msgid "Next due"
msgstr ""
#: class/MainWPChildServerInformation.class.php:110
#@ mainwp
msgid "Schedule"
msgstr ""
#: class/MainWPChildServerInformation.class.php:111
#@ mainwp
msgid "Hook"
msgstr ""
#: class/MainWPChildServerInformation.class.php:245
#@ default
msgid " MB"
msgstr ""
#: class/MainWPChildServerInformation.class.php:246
#: class/MainWPChildServerInformation.class.php:336
#: class/MainWPChildServerInformation.class.php:371
#: class/MainWPChildServerInformation.class.php:400
#@ default
#@ mainwp
msgid "N/A"
msgstr ""
#: class/MainWPChildServerInformation.class.php:255
#: class/MainWPChildServerInformation.class.php:269
#: class/MainWPChildServerInformation.class.php:358
#@ default
#@ mainwp
msgid "ON"
msgstr ""
#: class/MainWPChildServerInformation.class.php:256
#: class/MainWPChildServerInformation.class.php:270
#: class/MainWPChildServerInformation.class.php:361
#@ default
#@ mainwp
msgid "OFF"
msgstr ""
#: class/MainWPChildServerInformation.class.php:264
#@ default
msgid "NOT SET"
msgstr ""
#: class/MainWPChildServerInformation.class.php:275
#: class/MainWPChildServerInformation.class.php:281
#: class/MainWPChildServerInformation.class.php:287
#@ default
msgid "YES"
msgstr ""
#: class/MainWPChildServerInformation.class.php:276
#: class/MainWPChildServerInformation.class.php:282
#: class/MainWPChildServerInformation.class.php:288
#@ default
msgid "NO"
msgstr ""
#: class/MainWPClone.class.php:15
#@ mainwp-child
msgid "MainWP Clone"
msgstr "MainWP Klon"
#: class/MainWPClone.class.php:70
#@ mainwp-child
msgid "File could not be uploaded."
msgstr "Datei konnte nicht hochgeladen werden."
#: class/MainWPClone.class.php:75
#@ mainwp-child
msgid "File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini or by post_max_size being defined as smaller than upload_max_filesize in php.ini."
msgstr "Die Datei ist leer. Bitte laden Sie etwas mit Inhalt. Dieser Upload-Fehler könnte auch verursacht werden durhc eine Einstellung in der php.ini oder durch einstellung von post_max_size als kleiner als upload_max_filesize in der php.ini."
#: class/MainWPClone.class.php:84
#@ mainwp-child
msgid "Clone or Restore"
msgstr "Klonen oder wiederherstellen"
#: class/MainWPClone.class.php:88
#@ mainwp-child
msgid "Cloning is currently off - To turn on return to your main dashboard and turn cloning on on the Migrate/Clone page."
msgstr "Klonen ist derzeit aus - Zum aktivieren des Klones, auf der MainWP Dashboards auf Klonen gehen"
#: class/MainWPClone.class.php:94
#@ mainwp-child
msgid "Your content directory is not writable. Please set 0755 permission to "
msgstr "Das Inhalte Verzeichnis ist nicht beschreibbar. Bitte die Berechtigung setzen auf 0755."
#: class/MainWPClone.class.php:98
#@ mainwp-child
msgid "Cloning process completed successfully! You will now need to click "
msgstr "Klonen erfolgreich abgeschlossen! Sie müssen nun Klicken"
#: class/MainWPClone.class.php:98
#: class/MainWPClone.class.php:1069
#: class/MainWPClone.class.php:1098
#@ mainwp-child
msgid "here"
msgstr "hier"
#: class/MainWPClone.class.php:98
#: class/MainWPClone.class.php:1098
#@ mainwp-child
msgid " to re-login to the admin and re-save permalinks."
msgstr "sich erneut anmelden, um den Admin und erneut speichern des Permalinks."
#: class/MainWPClone.class.php:103
#@ mainwp-child
msgid "Upload successful."
msgstr "Hochladen erfolgreich."
#: class/MainWPClone.class.php:103
#: class/MainWPClone.class.php:153
#@ mainwp-child
msgid "Clone/Restore Website"
msgstr "Klonen / Wiederherstellen Webseite"
#: class/MainWPClone.class.php:114
#@ mainwp-child
msgid "Cloning is currently on but no sites have been allowed, to allow sites return to your main dashboard and turn cloning on on the Migrate/Clone page."
msgstr "Klonen ist derzeit erlaubt, aber keine Seite hat es erlaubt. "
#: class/MainWPClone.class.php:122
#@ mainwp-child
msgid "Display by:"
msgstr "Anzeige von:"
#: class/MainWPClone.class.php:122
#@ mainwp-child
msgid "Site Name"
msgstr "Seitenname"
#: class/MainWPClone.class.php:122
#@ mainwp-child
msgid "URL"
msgstr "URL"
#: class/MainWPClone.class.php:122
#@ mainwp-child
msgid "Clone Options"
msgstr "Einstellung Klonen"
#: class/MainWPClone.class.php:139
#@ mainwp-child
msgid "Clone Website"
msgstr "Webseite Klonen"
#: class/MainWPClone.class.php:148
#@ mainwp-child
msgid "Restore/Clone From Backup"
msgstr "Wiederherstellen/Klonen von Datensicherung"
#: class/MainWPClone.class.php:150
#@ mainwp-child
msgid "Upload backup in .zip format (Maximum filesize for your server settings: "
msgstr "Hochladen der Datensicherungsdatei im .zip Format (Maximale Dateigröße Server-Einstellungen:"
#: class/MainWPClone.class.php:151
#@ mainwp-child
msgid "If you have a FULL backup created by your Network dashboard you may restore it by uploading here."
msgstr "Wenn Sie eine vollständige Sicherung von Ihrem Netzwerk-Dashboard erstellt haben, können Sie es von hier Hochladen um es wiederherzustellen."
#: class/MainWPClone.class.php:152
#@ mainwp-child
msgid "A database only backup will not work."
msgstr "Eine einziges Datenbank-Backup wird nicht funktionieren."
#: class/MainWPClone.class.php:229
#, php-format
#@ mainwp-child
msgid "This is a large site (%dMB), the clone process will more than likely fail."
msgstr "Dies ist eine große Seite (%dMB), der Klon-Prozess wird mehr als wahrscheinlich scheitern."
#: class/MainWPClone.class.php:230
#@ mainwp-child
msgid "Continue Anyway?"
msgstr "Trotzdem fortfahren?"
#: class/MainWPClone.class.php:231
#, php-format
#@ mainwp-child
msgid "Creating backup on %s expected size: %dMB (estimated time: %d seconds)"
msgstr "Erstellen von Backup auf %s erwarteten Größe: %dMB (geschätzte Zeit: %d in Sekunden)"
#: class/MainWPClone.class.php:232
#, php-format
#@ mainwp-child
msgid "Backup created on %s total size to download: %dMB"
msgstr "Backup erstellt auf %s Gesamtgröße zum Download: %dMB"
#: class/MainWPClone.class.php:233
#@ mainwp-child
msgid "Downloading backup"
msgstr "Herunterladen der Datensicherung"
#: class/MainWPClone.class.php:234
#@ mainwp-child
msgid "Backup downloaded"
msgstr "Datensicherung heruntergeladen"
#: class/MainWPClone.class.php:235
#@ mainwp-child
msgid "Extracting backup and updating your database, this might take a while. Please be patient."
msgstr "Auspacken der Datensicherung und Aktualisierung Ihre Datenbank. Dies könnte eine Weile dauern. Bitte haben Sie Geduld."
#: class/MainWPClone.class.php:236
#@ mainwp-child
msgid "Cloning process completed successfully!"
msgstr "Klonen erfolgreich abgeschlossen!"
#: class/MainWPClone.class.php:755
#: class/MainWPClone.class.php:792
#@ mainwp-child
msgid "No site given"
msgstr "Kein Seite angegeben"
#: class/MainWPClone.class.php:760
#: class/MainWPClone.class.php:797
#@ mainwp-child
msgid "Site not found"
msgstr "Seite nicht gefunden"
#: class/MainWPClone.class.php:772
#@ mainwp-child
msgid "Could not create backupfile on child"
msgstr "Konnte Datensicherungsdatei nicht auf dem Client erstellen"
#: class/MainWPClone.class.php:808
#@ mainwp-child
msgid "Invalid response"
msgstr "Ungültige Antwort"
#: class/MainWPClone.class.php:824
#@ mainwp-child
msgid "No download link given"
msgstr "Keinen Download-Link angegeben"
#: class/MainWPClone.class.php:899
#: class/MainWPClone.class.php:925
#@ mainwp-child
msgid "No download file found"
msgstr "Keine Download-Datei gefunden"
#: class/MainWPClone.class.php:931
#@ mainwp-child
msgid "Backup file not found"
msgstr "Datensicherungsdatei nicht gefunden"
#: class/MainWPClone.class.php:1069
#@ mainwp-child
msgid "Restore process completed successfully! Check and re-save permalinks "
msgstr "Wiederherstellungs-Vorgang erfolgreich abgeschlossen! Überprüfen und Permalinks erneut speichern"
#: class/MainWPClone.class.php:1069
#@ mainwp-child
msgid "Cloning process completed successfully! Check and re-save permalinks "
msgstr "Klonen erfolgreich abgeschlossen! Überprüfen und Permalinks erneut speichern"
#: class/MainWPClone.class.php:1093
#@ mainwp-child
msgid "Restore"
msgstr "Wiederherstellen"
#: class/MainWPClone.class.php:1095
#@ mainwp-child
msgid "Be sure to use a FULL backup created by your Network dashboard, if critical folders are excluded it may result in a not working installation."
msgstr "Achten Sie darauf, eine vollständige Sicherung von Ihrem MainWP Dashboard zu erstellen."
#: class/MainWPClone.class.php:1096
#@ mainwp-child
msgid "Start Restore"
msgstr "Wiederherstellung starten"
#: class/MainWPClone.class.php:1096
#@ mainwp-child
msgid "CAUTION: this will overwrite your existing site."
msgstr "ACHTUNG: dies wird Ihre bestehende Seite überschreiben."
#: class/MainWPClone.class.php:1098
#@ mainwp-child
msgid "Restore process completed successfully! You will now need to click "
msgstr "Wiederherstellungsvorgang erfolgreich abgeschlossen! Sie müssen nun klicken"
#: class/MainWPClone.class.php:1102
#@ mainwp-child
msgid "Restore process completed successfully!"
msgstr "Wiederherstellungsvorgang erfolgreich abgeschlossen!"
#: class/MainWPCloneInstall.class.php:79
#: class/MainWPCloneInstall.class.php:80
#@ mainwp-child
msgid "Not a full backup."
msgstr "Keine gesamte Datensicherung."
#: class/MainWPCloneInstall.class.php:81
#@ mainwp-child
msgid "Database backup not found."
msgstr "Datenbank-Sicherung nicht gefunden."
#: class/MainWPCloneInstall.class.php:118
#@ mainwp-child
msgid "Cant read configuration file from backup"
msgstr "Kann Konfigurationsdatei nicht lesen aus der Datensicherung"
#: class/MainWPCloneInstall.class.php:133
#@ mainwp-child
msgid "Invalid database host or user/password."
msgstr "Ungültige Datenbank-Host oder Benutzer / Passwort."
#: class/MainWPCloneInstall.class.php:136
#@ mainwp-child
msgid "Invalid database name"
msgstr "Ungültiger Datenbanknamen"
#: class/MainWPCloneInstall.class.php:271
#: class/MainWPCloneInstall.class.php:370
#@ mainwp-child
msgid "Error: unexpected end of file for database"
msgstr "Fehler: unerwartetes Ende der Datei für die Datenbank"
#: class/MainWPCloneInstall.class.php:365
#@ mainwp-child
msgid "Error importing database"
msgstr "Fehler beim Importieren der Datenbank"
#: class/MainWPHeatmapTracker.class.php:68
#@ default
msgid "Home Page"
msgstr ""
#: class/MainWPHeatmapTracker.class.php:111
#@ default
msgid "Archive"
msgstr ""
#: class/MainWPHeatmapTracker.class.php:135
#@ default
msgid "Search"
msgstr ""
#: class/MainWPHeatmapTracker.class.php:144
#@ default
msgid "Blog Home Page"
msgstr ""
#: class/MainWPHelper.class.php:233
#@ mainwp-child
msgid "Unable to create directory "
msgstr "Verzeichnis kann nicht erstellt"
#: class/MainWPHelper.class.php:233
#@ mainwp-child
msgid " Is its parent directory writable by the server?"
msgstr "Ist das übergeordnete Verzeichnis durch den Server beschreibbar?"
#: class/MainWPHelper.class.php:380
#@ mainwp-child
msgid "Something went wrong while contacting the child site. Please check if there is an error on the child site. This error could also be caused by trying to clone or restore a site to large for your server settings."
msgstr "Etwas ist schiefgelaufen, während der Verbindung zum Client. Bitte überprüfen Sie, ob es einen Fehler von der Client Webseite ist."
#: class/MainWPHelper.class.php:384
#@ mainwp-child
msgid "Child plugin is disabled or the security key is incorrect. Please resync with your main installation."
msgstr "MainWP Clhild Plugin ist deaktiviert oder der Sicherheitsschlüssel ist falsch."

Binary file not shown.

View file

@ -0,0 +1,411 @@
msgid ""
msgstr ""
"Project-Id-Version: MainWP Child v0.11\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: 2013-11-15 14:04:59+0000\n"
"Last-Translator: admin <support@mainwp.com>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=n%100/10==1 ? 2 : n%10==1 ? 0 : (n+9)%10>3 ? 2 : 1;\n"
"X-Generator: CSL v1.x\n"
"X-Poedit-Language: Croatian\n"
"X-Poedit-Country: CROATIA\n"
"X-Poedit-SourceCharset: utf-8\n"
"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;\n"
"X-Poedit-Basepath: ../\n"
"X-Poedit-Bookmarks: \n"
"X-Poedit-SearchPath-0: .\n"
"X-Textdomain-Support: yes"
#: class/MainWPChild.class.php:132
#: class/MainWPChild.class.php:154
#@ mainwp-child
msgid "MainWP Settings"
msgstr "MainWP Podešavanje"
#: class/MainWPChild.class.php:158
#@ mainwp-child
msgid "Connection Settings"
msgstr "Podešavanje konekcije"
#: class/MainWPChild.class.php:166
#@ mainwp-child
msgid "Require Unique Security ID"
msgstr "Zahtev za jedinstveni sigurnosni ključ"
#: class/MainWPChild.class.php:169
#@ mainwp-child
msgid "Your Unique Security ID is:"
msgstr "Vaš jedinstveni sigurnosni ključ je:"
#: class/MainWPChild.class.php:173
#@ mainwp-child
msgid "The Unique Security ID adds additional protection between the Child plugin and your<br/>Main Dashboard. The Unique Security ID will need to match when being added to <br/>the Main Dashboard. This is additional security and should not be needed in most situations."
msgstr "Jedinstveni sigurnosni ključ obezbeđuje dodatnu zaštitu između sajta i kontrolne table.<br/> Jedinstveni sigurnosni ključ se mora poklapati prilikom dodavanja sajta u kontrolnu tablu. <br/> Ova dodatna sigrnosna opcija, u većini slučajeva nije potrebna."
#: class/MainWPChild.class.php:179
#@ mainwp-child
msgid "Save Changes"
msgstr "Sačuvaj Promene"
#: class/MainWPChild.class.php:424
#@ mainwp-child
msgid "Authentication failed. Reinstall MainWP plugin please"
msgstr "Autentifikacija neuspešna. Molimo, reinstalirajte MainWP."
#: class/MainWPChild.class.php:433
#: class/MainWPChild.class.php:787
#@ mainwp-child
msgid "No such user"
msgstr "Nepostojeći korisnik"
#: class/MainWPChild.class.php:438
#: class/MainWPChild.class.php:791
#@ mainwp-child
msgid "User is not an administrator"
msgstr "Korisnik nema administratorske privilegije."
#: class/MainWPChild.class.php:528
#@ mainwp-child
msgid "Bad request."
msgstr "Loš zahtev."
#: class/MainWPChild.class.php:699
#: class/MainWPChild.class.php:704
#: class/MainWPChild.class.php:736
#: class/MainWPChild.class.php:741
#: class/MainWPChild.class.php:746
#@ mainwp-child
msgid "Bad request"
msgstr "Loš zahtev."
#: class/MainWPChild.class.php:761
#@ mainwp-child
msgid "Invalid request"
msgstr "Nevažeći zahtev."
#: class/MainWPChild.class.php:767
#@ mainwp-child
msgid "Public key already set, reset the MainWP plugin on your site and try again."
msgstr "Javni ključ je već podešen, resetujte MainWP na sajtu i pokušajte ponovo."
#: class/MainWPChild.class.php:774
#@ mainwp-child
msgid "This Child Site is set to require a Unique Security ID - Please Enter It before connection can be established."
msgstr "Jedinstveni sigurnosni ključ je potreban za ovaj sajt - Molimo, unesite ključ kako bi konekcija mogla biti uspostavljena."
#: class/MainWPChild.class.php:778
#@ mainwp-child
msgid "The Unique Security ID you have entered does not match Child Security ID - Please Correct It before connection can be established."
msgstr "Jedinstveni sigurnosni ključ koji ste uneli se ne poklapa sa ključem na sajtu - Molimo, ispravite ključ kako bi konekcija mogla biti uspostavljena."
#: class/MainWPChild.class.php:1036
#@ mainwp-child
msgid "Could not change the admin password."
msgstr "Administratorska šifra nije mogla biti promenjena."
#: class/MainWPChild.class.php:1058
#@ mainwp-child
msgid "Undefined error"
msgstr "Nedefinisana greška"
#: class/MainWPChild.class.php:1072
#, php-format
#@ default
msgid "Username: %s"
msgstr "Korisnično ime: %s"
#: class/MainWPChild.class.php:1073
#, php-format
#@ default
msgid "Password: %s"
msgstr "Lozinka: %s"
#: class/MainWPChild.class.php:1076
#, php-format
#@ default
msgid "[%s] Your username and password"
msgstr "[%s] Vaše korisničko ime i lozinka"
#: class/MainWPChild.class.php:2326
#@ mainwp-child
msgid "This site already contains a link - please disable and enable the MainWP plugin."
msgstr "Saj već poseduje link - Molimo, deaktivirajte, pa ponovo aktivirajte MainWP"
#: class/MainWPChild.class.php:2433
#@ mainwp-child
msgid "Wordpress Filesystem error: "
msgstr "WordPress sistemska greška: "
#: class/MainWPClone.class.php:70
#@ mainwp-child
msgid "File could not be uploaded."
msgstr "Datoteka nije mogla biti uploadovana."
#: class/MainWPClone.class.php:75
#@ mainwp-child
msgid "File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini or by post_max_size being defined as smaller than upload_max_filesize in php.ini."
msgstr "Datoteka je prazna. Molimo, uplodujte validnu datoteku. Do ove greške moglo je doći ako je upload zabranjen u Vašoj php.ini datoteci ili ako je post_max_size definisan kao manji od upload_max_filesize u php.ini datoteci."
#: class/MainWPClone.class.php:84
#@ mainwp-child
msgid "Clone or Restore"
msgstr "Kloniranje ili Vratite prethodno stanje"
#: class/MainWPClone.class.php:88
#@ mainwp-child
msgid "Cloning is currently off - To turn on return to your main dashboard and turn cloning on on the Migrate/Clone page."
msgstr "Kloniranje je trenutno isključeno - da biste omogućili kloniranje, vratite se na Kontrolni sajt i uključite kloniranje na stranici Kloniranje."
#: class/MainWPClone.class.php:94
#@ mainwp-child
msgid "Your content directory is not writable. Please set 0755 permission to "
msgstr "Direktorium u kome se nalazi Vaš sadržaj nije upisiv. Molimo, podesite ovlašćenja na 0755. "
#: class/MainWPClone.class.php:98
#@ mainwp-child
msgid "Cloning process completed successfully! You will now need to click "
msgstr "Proces kloniranja uspešno završen! Potrebno je da kliknete "
#: class/MainWPClone.class.php:98
#: class/MainWPClone.class.php:956
#@ mainwp-child
msgid "here"
msgstr "ovde"
#: class/MainWPClone.class.php:98
#@ mainwp-child
msgid " to re-login to the admin and re-save permalinks."
msgstr "da biste se logovali i opet podesili linkove."
#: class/MainWPClone.class.php:103
#@ mainwp-child
msgid "Upload successful."
msgstr "Upload uspešan."
#: class/MainWPClone.class.php:103
#: class/MainWPClone.class.php:153
#@ mainwp-child
msgid "Clone/Restore Website"
msgstr "Klonira/Vrati Sajt"
#: class/MainWPClone.class.php:114
#@ mainwp-child
msgid "Cloning is currently on but no sites have been allowed, to allow sites return to your main dashboard and turn cloning on on the Migrate/Clone page."
msgstr "Kloniranje je trenutno uključeno, ali nema sajtova sa ovlašćenjem za kloniranje. Da biste omogućili sajtu da bude kloniran, vratite se na Kontrolni sajt i odaberite selktujte sajtove na stranici Kloniranje."
#: class/MainWPClone.class.php:122
#@ mainwp-child
msgid "Display by:"
msgstr "Prikaži po:"
#: class/MainWPClone.class.php:122
#@ mainwp-child
msgid "Site Name"
msgstr "Naziv Sajta"
#: class/MainWPClone.class.php:122
#@ mainwp-child
msgid "URL"
msgstr "URL"
#: class/MainWPClone.class.php:122
#@ mainwp-child
msgid "Clone Options"
msgstr "Opcije za kloniranje"
#: class/MainWPClone.class.php:139
#@ mainwp-child
msgid "Clone Website"
msgstr "Kloniraj sajt"
#: class/MainWPClone.class.php:148
#@ mainwp-child
msgid "Restore/Clone From Backup"
msgstr "Vrati/Kloniraj sa Backup datotekom"
#: class/MainWPClone.class.php:150
#@ mainwp-child
msgid "Upload backup in .zip format (Maximum filesize for your server settings: "
msgstr "Uploadujte backup datoteku u .zip formatu. (Maksimalna veličina datoteke za Vaš server je: "
#: class/MainWPClone.class.php:151
#@ mainwp-child
msgid "If you have a FULL backup created by your Network dashboard you may restore it by uploading here."
msgstr "Ako image Kompletan Backup kreiran uz pomoć MainWP plugina, možete ga uploadovati ovde."
#: class/MainWPClone.class.php:152
#@ mainwp-child
msgid "A database only backup will not work."
msgstr "Backup samo baze podataka neće raditi."
#: class/MainWPClone.class.php:662
#: class/MainWPClone.class.php:699
#@ mainwp-child
msgid "No site given"
msgstr "Nema datog sajta"
#: class/MainWPClone.class.php:667
#: class/MainWPClone.class.php:704
#@ mainwp-child
msgid "Site not found"
msgstr "Sajt nije pronađen"
#: class/MainWPClone.class.php:679
#@ mainwp-child
msgid "Could not create backupfile on child"
msgstr "Kreiranje backup datoteke na sajtu neuspešan"
#: class/MainWPClone.class.php:715
#@ mainwp-child
msgid "Invalid response"
msgstr "Nevažeći odgovor"
#: class/MainWPClone.class.php:731
#@ mainwp-child
msgid "No download link given"
msgstr "Link za preuzimanje nije dat"
#: class/MainWPClone.class.php:803
#: class/MainWPClone.class.php:832
#@ mainwp-child
msgid "No download file found"
msgstr "Datoteka za preuzimanje nije pronađena"
#: class/MainWPClone.class.php:838
#@ mainwp-child
msgid "Backup file not found"
msgstr "Backup datoteka nije pronađena"
#: class/MainWPClone.class.php:956
#@ mainwp-child
msgid "Cloning process completed successfully! Check and re-save permalinks "
msgstr "Process kloniranja uspešno završen! Proverite i ponovo sačuvajte perma-linkove "
#: class/MainWPCloneInstall.class.php:79
#: class/MainWPCloneInstall.class.php:80
#@ mainwp-child
msgid "Not a full backup."
msgstr "Nije kompletan backup."
#: class/MainWPCloneInstall.class.php:81
#@ mainwp-child
msgid "Database backup not found."
msgstr "Backup baze podataka nije pronađen."
#: class/MainWPCloneInstall.class.php:118
#@ mainwp-child
msgid "Cant read configuration file from backup"
msgstr "Nije moguće prošitati konfiguracionu datoteku iz backup-a"
#: class/MainWPCloneInstall.class.php:130
#@ mainwp-child
msgid "Invalid database host or user/password."
msgstr "Nevažeći host baze podataka ili korisničko ime i lozinka."
#: class/MainWPCloneInstall.class.php:133
#@ mainwp-child
msgid "Invalid database name"
msgstr "Pogrešan naziv baze podataka"
#: class/MainWPCloneInstall.class.php:239
#@ mainwp-child
msgid "Error importing database"
msgstr "Greška pri unosu baze podataka"
#: class/MainWPCloneInstall.class.php:244
#@ mainwp-child
msgid "Error: unexpected end of file for database"
msgstr "Greška: neočekivan kraj baze podataka"
#: class/MainWPHeatmapTracker.class.php:68
#@ default
msgid "Home Page"
msgstr "Glavna strana"
#: class/MainWPHeatmapTracker.class.php:111
#@ default
msgid "Archive"
msgstr "Arhiva"
#: class/MainWPHeatmapTracker.class.php:135
#@ default
msgid "Search"
msgstr "Pretraži"
#: class/MainWPHeatmapTracker.class.php:144
#@ default
msgid "Blog Home Page"
msgstr "Glavan strana bloga"
#: class/MainWPHelper.class.php:233
#@ mainwp-child
msgid "Unable to create directory "
msgstr "Kreiranje direktorijuma nemoguće "
#: class/MainWPHelper.class.php:233
#@ mainwp-child
msgid " Is its parent directory writable by the server?"
msgstr "Da li je direktorijum upisiv od strane servera?"
#: class/MainWPHelper.class.php:376
#@ mainwp-child
msgid "Something went wrong while contacting the child site. Please check if there is an error on the child site. This error could also be caused by trying to clone or restore a site to large for your server settings."
msgstr "Nešto nije u redu u komunikaciji za sajtom. Molimo proverite da li ima grešaka na sajtu. Do ove greške moglo je doći ako ste pokušali klonirati sajt veći nego što je dozvoljeno u podešavanjima servera."
#: class/MainWPHelper.class.php:380
#@ mainwp-child
msgid "Child plugin is disabled or the security key is incorrect. Please resync with your main installation."
msgstr "Child Plugin je isključen ili je sigurnosni ključ pogrešan. Molimo, sinhronizujte sa Vašnom glavnom instalacijom."
#: class/MainWPClone.class.php:15
#@ mainwp-child
msgid "MainWP Clone"
msgstr "MainWP Kloniranje"
#: class/MainWPClone.class.php:221
#, php-format
#@ mainwp-child
msgid "This is a large site (%dMB), the clone process will more than likely fail."
msgstr "Ovo je veliki sajt (%dMB), kloniranje verovatno neće uspeti."
#: class/MainWPClone.class.php:222
#@ mainwp-child
msgid "Continue Anyway?"
msgstr "Nastavi u svakom slučaju?"
#: class/MainWPClone.class.php:223
#, php-format
#@ mainwp-child
msgid "Creating backup on %s expected size: %dMB (estimated time: %d seconds)"
msgstr "Kreiranje backupa na %s očekivana veličina %dMB (očekivano vreme trajanja %d sekundi)"
#: class/MainWPClone.class.php:224
#, php-format
#@ mainwp-child
msgid "Backup created on %s total size to download: %dMB"
msgstr "Backup kreiran na %s puna veličina za download: %dMB"
#: class/MainWPClone.class.php:225
#@ mainwp-child
msgid "Downloading backup"
msgstr "Preuzimanje backupa"
#: class/MainWPClone.class.php:226
#@ mainwp-child
msgid "Backup downloaded"
msgstr "Backup preuzet"
#: class/MainWPClone.class.php:227
#@ mainwp-child
msgid "Extracting backup and updating your database, this might take a while. Please be patient."
msgstr "Raspakivanje backupa i ažuriranje baze podataka u toku, ovo može potrajati. Molimo, budite strpljivi."
#: class/MainWPClone.class.php:228
#@ mainwp-child
msgid "Cloning process completed successfully!"
msgstr "Kloniranje uspešno završeno!"

Binary file not shown.

View file

@ -0,0 +1,411 @@
msgid ""
msgstr ""
"Project-Id-Version: MainWP Child v0.11\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: 2013-11-15 14:03:35+0000\n"
"Last-Translator: admin <support@mainwp.com>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: CSL v1.x\n"
"X-Poedit-Language: Serbian (Cyrillic)\n"
"X-Poedit-Country: SERBIA AND MONTENEGRO\n"
"X-Poedit-SourceCharset: utf-8\n"
"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;\n"
"X-Poedit-Basepath: ../\n"
"X-Poedit-Bookmarks: \n"
"X-Poedit-SearchPath-0: .\n"
"X-Textdomain-Support: yes"
#: class/MainWPChild.class.php:132
#: class/MainWPChild.class.php:154
#@ mainwp-child
msgid "MainWP Settings"
msgstr "MainWP Podešavanje"
#: class/MainWPChild.class.php:158
#@ mainwp-child
msgid "Connection Settings"
msgstr "Podešavanje konekcije"
#: class/MainWPChild.class.php:166
#@ mainwp-child
msgid "Require Unique Security ID"
msgstr "Zahtev za jedinstveni sigurnosni ključ"
#: class/MainWPChild.class.php:169
#@ mainwp-child
msgid "Your Unique Security ID is:"
msgstr "Vaš jedinstveni sigurnosni ključ je:"
#: class/MainWPChild.class.php:173
#@ mainwp-child
msgid "The Unique Security ID adds additional protection between the Child plugin and your<br/>Main Dashboard. The Unique Security ID will need to match when being added to <br/>the Main Dashboard. This is additional security and should not be needed in most situations."
msgstr "Jedinstveni sigurnosni ključ obezbeđuje dodatnu zaštitu između sajta i kontrolne table.<br/> Jedinstveni sigurnosni ključ se mora poklapati prilikom dodavanja sajta u kontrolnu tablu. <br/> Ova dodatna sigrnosna opcija, u većini slučajeva nije potrebna."
#: class/MainWPChild.class.php:179
#@ mainwp-child
msgid "Save Changes"
msgstr "Sačuvaj Promene"
#: class/MainWPChild.class.php:424
#@ mainwp-child
msgid "Authentication failed. Reinstall MainWP plugin please"
msgstr "Autentifikacija neuspešna. Molimo, reinstalirajte MainWP."
#: class/MainWPChild.class.php:433
#: class/MainWPChild.class.php:787
#@ mainwp-child
msgid "No such user"
msgstr "Nepostojeći korisnik"
#: class/MainWPChild.class.php:438
#: class/MainWPChild.class.php:791
#@ mainwp-child
msgid "User is not an administrator"
msgstr "Korisnik nema administratorske privilegije."
#: class/MainWPChild.class.php:528
#@ mainwp-child
msgid "Bad request."
msgstr "Loš zahtev."
#: class/MainWPChild.class.php:699
#: class/MainWPChild.class.php:704
#: class/MainWPChild.class.php:736
#: class/MainWPChild.class.php:741
#: class/MainWPChild.class.php:746
#@ mainwp-child
msgid "Bad request"
msgstr "Loš zahtev."
#: class/MainWPChild.class.php:761
#@ mainwp-child
msgid "Invalid request"
msgstr "Nevažeći zahtev."
#: class/MainWPChild.class.php:767
#@ mainwp-child
msgid "Public key already set, reset the MainWP plugin on your site and try again."
msgstr "Javni ključ je već podešen, resetujte MainWP na sajtu i pokušajte ponovo."
#: class/MainWPChild.class.php:774
#@ mainwp-child
msgid "This Child Site is set to require a Unique Security ID - Please Enter It before connection can be established."
msgstr "Jedinstveni sigurnosni ključ je potreban za ovaj sajt - Molimo, unesite ključ kako bi konekcija mogla biti uspostavljena."
#: class/MainWPChild.class.php:778
#@ mainwp-child
msgid "The Unique Security ID you have entered does not match Child Security ID - Please Correct It before connection can be established."
msgstr "Jedinstveni sigurnosni ključ koji ste uneli se ne poklapa sa ključem na sajtu - Molimo, ispravite ključ kako bi konekcija mogla biti uspostavljena."
#: class/MainWPChild.class.php:1036
#@ mainwp-child
msgid "Could not change the admin password."
msgstr "Administratorska šifra nije mogla biti promenjena."
#: class/MainWPChild.class.php:1058
#@ mainwp-child
msgid "Undefined error"
msgstr "Nedefinisana greška"
#: class/MainWPChild.class.php:1072
#, php-format
#@ default
msgid "Username: %s"
msgstr "Korisnično ime: %s"
#: class/MainWPChild.class.php:1073
#, php-format
#@ default
msgid "Password: %s"
msgstr "Lozinka: %s"
#: class/MainWPChild.class.php:1076
#, php-format
#@ default
msgid "[%s] Your username and password"
msgstr "[%s] Vaše korisničko ime i lozinka"
#: class/MainWPChild.class.php:2326
#@ mainwp-child
msgid "This site already contains a link - please disable and enable the MainWP plugin."
msgstr "Saj već poseduje link - Molimo, deaktivirajte, pa ponovo aktivirajte MainWP"
#: class/MainWPChild.class.php:2433
#@ mainwp-child
msgid "Wordpress Filesystem error: "
msgstr "WordPress sistemska greška: "
#: class/MainWPClone.class.php:70
#@ mainwp-child
msgid "File could not be uploaded."
msgstr "Datoteka nije mogla biti uploadovana."
#: class/MainWPClone.class.php:75
#@ mainwp-child
msgid "File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini or by post_max_size being defined as smaller than upload_max_filesize in php.ini."
msgstr "Datoteka je prazna. Molimo, uplodujte validnu datoteku. Do ove greške moglo je doći ako je upload zabranjen u Vašoj php.ini datoteci ili ako je post_max_size definisan kao manji od upload_max_filesize u php.ini datoteci."
#: class/MainWPClone.class.php:84
#@ mainwp-child
msgid "Clone or Restore"
msgstr "Kloniranje ili Vratite prethodno stanje"
#: class/MainWPClone.class.php:88
#@ mainwp-child
msgid "Cloning is currently off - To turn on return to your main dashboard and turn cloning on on the Migrate/Clone page."
msgstr "Kloniranje je trenutno isključeno - da biste omogućili kloniranje, vratite se na Kontrolni sajt i uključite kloniranje na stranici Kloniranje."
#: class/MainWPClone.class.php:94
#@ mainwp-child
msgid "Your content directory is not writable. Please set 0755 permission to "
msgstr "Direktorium u kome se nalazi Vaš sadržaj nije upisiv. Molimo, podesite ovlašćenja na 0755. "
#: class/MainWPClone.class.php:98
#@ mainwp-child
msgid "Cloning process completed successfully! You will now need to click"
msgstr "Proces kloniranja uspešno završen! Potrebno je da kliknete"
#: class/MainWPClone.class.php:98
#: class/MainWPClone.class.php:956
#@ mainwp-child
msgid "here"
msgstr "ovde"
#: class/MainWPClone.class.php:98
#@ mainwp-child
msgid " to re-login to the admin and re-save permalinks."
msgstr "da biste se logovali i opet podesili linkove."
#: class/MainWPClone.class.php:103
#@ mainwp-child
msgid "Upload successful."
msgstr "Upload uspešan."
#: class/MainWPClone.class.php:103
#: class/MainWPClone.class.php:153
#@ mainwp-child
msgid "Clone/Restore Website"
msgstr "Klonira/Vrati Sajt"
#: class/MainWPClone.class.php:114
#@ mainwp-child
msgid "Cloning is currently on but no sites have been allowed, to allow sites return to your main dashboard and turn cloning on on the Migrate/Clone page."
msgstr "Kloniranje je trenutno uključeno, ali nema sajtova sa ovlašćenjem za kloniranje. Da biste omogućili sajtu da bude kloniran, vratite se na Kontrolni sajt i odaberite selktujte sajtove na stranici Kloniranje."
#: class/MainWPClone.class.php:122
#@ mainwp-child
msgid "Display by:"
msgstr "Prikaži po:"
#: class/MainWPClone.class.php:122
#@ mainwp-child
msgid "Site Name"
msgstr "Naziv Sajta"
#: class/MainWPClone.class.php:122
#@ mainwp-child
msgid "URL"
msgstr "URL"
#: class/MainWPClone.class.php:122
#@ mainwp-child
msgid "Clone Options"
msgstr "Opcije za kloniranje"
#: class/MainWPClone.class.php:139
#@ mainwp-child
msgid "Clone Website"
msgstr "Kloniraj sajt"
#: class/MainWPClone.class.php:148
#@ mainwp-child
msgid "Restore/Clone From Backup"
msgstr "Vrati/Kloniraj sa Backup datotekom"
#: class/MainWPClone.class.php:150
#@ mainwp-child
msgid "Upload backup in .zip format (Maximum filesize for your server settings: "
msgstr "Uploadujte backup datoteku u .zip formatu. (Maksimalna veličina datoteke za Vaš server je: "
#: class/MainWPClone.class.php:151
#@ mainwp-child
msgid "If you have a FULL backup created by your Network dashboard you may restore it by uploading here."
msgstr "Ako image Kompletan Backup kreiran uz pomoć MainWP plugina, možete ga uploadovati ovde."
#: class/MainWPClone.class.php:152
#@ mainwp-child
msgid "A database only backup will not work."
msgstr "Backup samo baze podataka neće raditi."
#: class/MainWPClone.class.php:662
#: class/MainWPClone.class.php:699
#@ mainwp-child
msgid "No site given"
msgstr "Nema datog sajta"
#: class/MainWPClone.class.php:667
#: class/MainWPClone.class.php:704
#@ mainwp-child
msgid "Site not found"
msgstr "Sajt nije pronađen"
#: class/MainWPClone.class.php:679
#@ mainwp-child
msgid "Could not create backupfile on child"
msgstr "Kreiranje backup datoteke na sajtu neuspešan"
#: class/MainWPClone.class.php:715
#@ mainwp-child
msgid "Invalid response"
msgstr "Nevažeći odgovor"
#: class/MainWPClone.class.php:731
#@ mainwp-child
msgid "No download link given"
msgstr "Link za preuzimanje nije dat"
#: class/MainWPClone.class.php:803
#: class/MainWPClone.class.php:832
#@ mainwp-child
msgid "No download file found"
msgstr "Datoteka za preuzimanje nije pronađena"
#: class/MainWPClone.class.php:838
#@ mainwp-child
msgid "Backup file not found"
msgstr "Backup datoteka nije pronađena"
#: class/MainWPClone.class.php:956
#@ mainwp-child
msgid "Cloning process completed successfully! Check and re-save permalinks "
msgstr "Process kloniranja uspešno završen! Proverite i ponovo sačuvajte perma-linkove "
#: class/MainWPCloneInstall.class.php:79
#: class/MainWPCloneInstall.class.php:80
#@ mainwp-child
msgid "Not a full backup."
msgstr "Nije kompletan backup."
#: class/MainWPCloneInstall.class.php:81
#@ mainwp-child
msgid "Database backup not found."
msgstr "Backup baze podataka nije pronađen."
#: class/MainWPCloneInstall.class.php:118
#@ mainwp-child
msgid "Cant read configuration file from backup"
msgstr "Nije moguće prošitati konfiguracionu datoteku iz backup-a"
#: class/MainWPCloneInstall.class.php:130
#@ mainwp-child
msgid "Invalid database host or user/password."
msgstr "Nevažeći host baze podataka ili korisničko ime i lozinka."
#: class/MainWPCloneInstall.class.php:133
#@ mainwp-child
msgid "Invalid database name"
msgstr "Pogrešan naziv baze podataka"
#: class/MainWPCloneInstall.class.php:239
#@ mainwp-child
msgid "Error importing database"
msgstr "Greška pri unosu baze podataka"
#: class/MainWPCloneInstall.class.php:244
#@ mainwp-child
msgid "Error: unexpected end of file for database"
msgstr "Greška: neočekivan kraj baze podataka"
#: class/MainWPHeatmapTracker.class.php:68
#@ default
msgid "Home Page"
msgstr "Glavna strana"
#: class/MainWPHeatmapTracker.class.php:111
#@ default
msgid "Archive"
msgstr "Arhiva"
#: class/MainWPHeatmapTracker.class.php:135
#@ default
msgid "Search"
msgstr "Pretraži"
#: class/MainWPHeatmapTracker.class.php:144
#@ default
msgid "Blog Home Page"
msgstr "Glavan strana bloga"
#: class/MainWPHelper.class.php:233
#@ mainwp-child
msgid "Unable to create directory "
msgstr "Kreiranje direktorijuma nemoguće "
#: class/MainWPHelper.class.php:233
#@ mainwp-child
msgid " Is its parent directory writable by the server?"
msgstr "Da li je direktorijum upisiv od strane servera?"
#: class/MainWPHelper.class.php:376
#@ mainwp-child
msgid "Something went wrong while contacting the child site. Please check if there is an error on the child site. This error could also be caused by trying to clone or restore a site to large for your server settings."
msgstr "Nešto nije u redu u komunikaciji za sajtom. Molimo proverite da li ima grešaka na sajtu. Do ove greške moglo je doći ako ste pokušali klonirati sajt veći nego što je dozvoljeno u podešavanjima servera."
#: class/MainWPHelper.class.php:380
#@ mainwp-child
msgid "Child plugin is disabled or the security key is incorrect. Please resync with your main installation."
msgstr "Child Plugin je isključen ili je sigurnosni ključ pogrešan. Molimo, sinhronizujte sa Vašnom glavnom instalacijom."
#: class/MainWPClone.class.php:15
#@ mainwp-child
msgid "MainWP Clone"
msgstr "MainWP Kloniranje"
#: class/MainWPClone.class.php:221
#, php-format
#@ mainwp-child
msgid "This is a large site (%dMB), the clone process will more than likely fail."
msgstr "Ovo je veliki sajt (%dMB), kloniranje verovatno neće uspeti."
#: class/MainWPClone.class.php:222
#@ mainwp-child
msgid "Continue Anyway?"
msgstr "Nastavi u svakom slučaju?"
#: class/MainWPClone.class.php:223
#, php-format
#@ mainwp-child
msgid "Creating backup on %s expected size: %dMB (estimated time: %d seconds)"
msgstr "Kreiranje backupa na %s očekivana veličina %dMB (očekivano vreme trajanja %d sekundi)"
#: class/MainWPClone.class.php:224
#, php-format
#@ mainwp-child
msgid "Backup created on %s total size to download: %dMB"
msgstr "Backup kreiran na %s puna veličina za download: %dMB"
#: class/MainWPClone.class.php:225
#@ mainwp-child
msgid "Downloading backup"
msgstr "Preuzimanje backupa"
#: class/MainWPClone.class.php:226
#@ mainwp-child
msgid "Backup downloaded"
msgstr "Backup preuzet"
#: class/MainWPClone.class.php:227
#@ mainwp-child
msgid "Extracting backup and updating your database, this might take a while. Please be patient."
msgstr "Raspakivanje backupa i ažuriranje baze podataka u toku, ovo može potrajati. Molimo, budite strpljivi."
#: class/MainWPClone.class.php:228
#@ mainwp-child
msgid "Cloning process completed successfully!"
msgstr "Kloniranje uspešno završeno!"

Binary file not shown.

View file

@ -0,0 +1,411 @@
msgid ""
msgstr ""
"Project-Id-Version: MainWP Child v0.11\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: 2013-11-15 14:00:59+0000\n"
"Last-Translator: admin <mainwp@mainwp.com>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: CSL v1.x\n"
"X-Poedit-Language: Serbian\n"
"X-Poedit-Country: SERBIA\n"
"X-Poedit-SourceCharset: utf-8\n"
"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;\n"
"X-Poedit-Basepath: \n"
"X-Poedit-Bookmarks: \n"
"X-Poedit-SearchPath-0: .\n"
"X-Textdomain-Support: yes"
#: class/MainWPChild.class.php:132
#: class/MainWPChild.class.php:154
#@ mainwp-child
msgid "MainWP Settings"
msgstr "MainWP Podešavanje"
#: class/MainWPChild.class.php:158
#@ mainwp-child
msgid "Connection Settings"
msgstr "Podešavanje konekcije"
#: class/MainWPChild.class.php:166
#@ mainwp-child
msgid "Require Unique Security ID"
msgstr "Zahtev za jedinstveni sigurnosni ključ"
#: class/MainWPChild.class.php:169
#@ mainwp-child
msgid "Your Unique Security ID is:"
msgstr "Vaš jedinstveni sigurnosni ključ je:"
#: class/MainWPChild.class.php:173
#@ mainwp-child
msgid "The Unique Security ID adds additional protection between the Child plugin and your<br/>Main Dashboard. The Unique Security ID will need to match when being added to <br/>the Main Dashboard. This is additional security and should not be needed in most situations."
msgstr "Jedinstveni sigurnosni ključ obezbeđuje dodatnu zaštitu između sajta i kontrolne table.<br/> Jedinstveni sigurnosni ključ se mora poklapati prilikom dodavanja sajta u kontrolnu tablu. <br/> Ova dodatna sigrnosna opcija, u većini slučajeva nije potrebna."
#: class/MainWPChild.class.php:179
#@ mainwp-child
msgid "Save Changes"
msgstr "Sačuvaj Promene"
#: class/MainWPChild.class.php:424
#@ mainwp-child
msgid "Authentication failed. Reinstall MainWP plugin please"
msgstr "Autentifikacija neuspešna. Molimo, reinstalirajte MainWP."
#: class/MainWPChild.class.php:433
#: class/MainWPChild.class.php:787
#@ mainwp-child
msgid "No such user"
msgstr "Nepostojeći korisnik"
#: class/MainWPChild.class.php:438
#: class/MainWPChild.class.php:791
#@ mainwp-child
msgid "User is not an administrator"
msgstr "Korisnik nema administratorske privilegije."
#: class/MainWPChild.class.php:528
#@ mainwp-child
msgid "Bad request."
msgstr "Loš zahtev."
#: class/MainWPChild.class.php:699
#: class/MainWPChild.class.php:704
#: class/MainWPChild.class.php:736
#: class/MainWPChild.class.php:741
#: class/MainWPChild.class.php:746
#@ mainwp-child
msgid "Bad request"
msgstr "Loš zahtev."
#: class/MainWPChild.class.php:761
#@ mainwp-child
msgid "Invalid request"
msgstr "Nevažeći zahtev."
#: class/MainWPChild.class.php:767
#@ mainwp-child
msgid "Public key already set, reset the MainWP plugin on your site and try again."
msgstr "Javni ključ je već podešen, resetujte MainWP na sajtu i pokušajte ponovo."
#: class/MainWPChild.class.php:774
#@ mainwp-child
msgid "This Child Site is set to require a Unique Security ID - Please Enter It before connection can be established."
msgstr "Jedinstveni sigurnosni ključ je potreban za ovaj sajt - Molimo, unesite ključ kako bi konekcija mogla biti uspostavljena."
#: class/MainWPChild.class.php:778
#@ mainwp-child
msgid "The Unique Security ID you have entered does not match Child Security ID - Please Correct It before connection can be established."
msgstr "Jedinstveni sigurnosni ključ koji ste uneli se ne poklapa sa ključem na sajtu - Molimo, ispravite ključ kako bi konekcija mogla biti uspostavljena."
#: class/MainWPChild.class.php:1036
#@ mainwp-child
msgid "Could not change the admin password."
msgstr "Administratorska šifra nije mogla biti promenjena."
#: class/MainWPChild.class.php:1058
#@ mainwp-child
msgid "Undefined error"
msgstr "Nedefinisana greška"
#: class/MainWPChild.class.php:1072
#, php-format
#@ default
msgid "Username: %s"
msgstr "Korisnično ime: %s"
#: class/MainWPChild.class.php:1073
#, php-format
#@ default
msgid "Password: %s"
msgstr "Lozinka: %s"
#: class/MainWPChild.class.php:1076
#, php-format
#@ default
msgid "[%s] Your username and password"
msgstr "[%s] Vaše korisničko ime i lozinka"
#: class/MainWPChild.class.php:2326
#@ mainwp-child
msgid "This site already contains a link - please disable and enable the MainWP plugin."
msgstr "Saj već poseduje link - Molimo, deaktivirajte, pa ponovo aktivirajte MainWP"
#: class/MainWPChild.class.php:2433
#@ mainwp-child
msgid "Wordpress Filesystem error: "
msgstr "WordPress sistemska greška: "
#: class/MainWPClone.class.php:70
#@ mainwp-child
msgid "File could not be uploaded."
msgstr "Datoteka nije mogla biti uploadovana."
#: class/MainWPClone.class.php:75
#@ mainwp-child
msgid "File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini or by post_max_size being defined as smaller than upload_max_filesize in php.ini."
msgstr "Datoteka je prazna. Molimo, uplodujte validnu datoteku. Do ove greške moglo je doći ako je upload zabranjen u Vašoj php.ini datoteci ili ako je post_max_size definisan kao manji od upload_max_filesize u php.ini datoteci."
#: class/MainWPClone.class.php:84
#@ mainwp-child
msgid "Clone or Restore"
msgstr "Kloniranje ili Vratite prethodno stanje"
#: class/MainWPClone.class.php:88
#@ mainwp-child
msgid "Cloning is currently off - To turn on return to your main dashboard and turn cloning on on the Migrate/Clone page."
msgstr "Kloniranje je trenutno isključeno - da biste omogućili kloniranje, vratite se na Kontrolni sajt i uključite kloniranje na stranici Kloniranje."
#: class/MainWPClone.class.php:94
#@ mainwp-child
msgid "Your content directory is not writable. Please set 0755 permission to "
msgstr "Direktorium u kome se nalazi Vaš sadržaj nije upisiv. Molimo, podesite ovlašćenja na 0755. "
#: class/MainWPClone.class.php:98
#@ mainwp-child
msgid "Cloning process completed successfully! You will now need to click "
msgstr "Proces kloniranja uspešno završen! Potrebno je da kliknete "
#: class/MainWPClone.class.php:98
#: class/MainWPClone.class.php:956
#@ mainwp-child
msgid "here"
msgstr "ovde"
#: class/MainWPClone.class.php:98
#@ mainwp-child
msgid " to re-login to the admin and re-save permalinks."
msgstr "da biste se logovali i opet podesili linkove."
#: class/MainWPClone.class.php:103
#@ mainwp-child
msgid "Upload successful."
msgstr "Upload uspešan."
#: class/MainWPClone.class.php:103
#: class/MainWPClone.class.php:153
#@ mainwp-child
msgid "Clone/Restore Website"
msgstr "Klonira/Vrati Sajt"
#: class/MainWPClone.class.php:114
#@ mainwp-child
msgid "Cloning is currently on but no sites have been allowed, to allow sites return to your main dashboard and turn cloning on on the Migrate/Clone page."
msgstr "Kloniranje je trenutno uključeno, ali nema sajtova sa ovlašćenjem za kloniranje. Da biste omogućili sajtu da bude kloniran, vratite se na Kontrolni sajt i odaberite selktujte sajtove na stranici Kloniranje."
#: class/MainWPClone.class.php:122
#@ mainwp-child
msgid "Display by:"
msgstr "Prikaži po:"
#: class/MainWPClone.class.php:122
#@ mainwp-child
msgid "Site Name"
msgstr "Naziv Sajta"
#: class/MainWPClone.class.php:122
#@ mainwp-child
msgid "URL"
msgstr "URL"
#: class/MainWPClone.class.php:122
#@ mainwp-child
msgid "Clone Options"
msgstr "Opcije za kloniranje"
#: class/MainWPClone.class.php:139
#@ mainwp-child
msgid "Clone Website"
msgstr "Kloniraj sajt"
#: class/MainWPClone.class.php:148
#@ mainwp-child
msgid "Restore/Clone From Backup"
msgstr "Vrati/Kloniraj sa Backup datotekom"
#: class/MainWPClone.class.php:150
#@ mainwp-child
msgid "Upload backup in .zip format (Maximum filesize for your server settings: "
msgstr "Uploadujte backup datoteku u .zip formatu. (Maksimalna veličina datoteke za Vaš server je: "
#: class/MainWPClone.class.php:151
#@ mainwp-child
msgid "If you have a FULL backup created by your Network dashboard you may restore it by uploading here."
msgstr "Ako image Kompletan Backup kreiran uz pomoć MainWP plugina, možete ga uploadovati ovde."
#: class/MainWPClone.class.php:152
#@ mainwp-child
msgid "A database only backup will not work."
msgstr "Backup samo baze podataka neće raditi."
#: class/MainWPClone.class.php:662
#: class/MainWPClone.class.php:699
#@ mainwp-child
msgid "No site given"
msgstr "Nema datog sajta"
#: class/MainWPClone.class.php:667
#: class/MainWPClone.class.php:704
#@ mainwp-child
msgid "Site not found"
msgstr "Sajt nije pronađen"
#: class/MainWPClone.class.php:679
#@ mainwp-child
msgid "Could not create backupfile on child"
msgstr "Kreiranje backup datoteke na sajtu neuspešan"
#: class/MainWPClone.class.php:715
#@ mainwp-child
msgid "Invalid response"
msgstr "Nevažeći odgovor"
#: class/MainWPClone.class.php:731
#@ mainwp-child
msgid "No download link given"
msgstr "Link za preuzimanje nije dat"
#: class/MainWPClone.class.php:803
#: class/MainWPClone.class.php:832
#@ mainwp-child
msgid "No download file found"
msgstr "Datoteka za preuzimanje nije pronađena"
#: class/MainWPClone.class.php:838
#@ mainwp-child
msgid "Backup file not found"
msgstr "Backup datoteka nije pronađena"
#: class/MainWPClone.class.php:956
#@ mainwp-child
msgid "Cloning process completed successfully! Check and re-save permalinks "
msgstr "Process kloniranja uspešno završen! Proverite i ponovo sačuvajte perma-linkove "
#: class/MainWPCloneInstall.class.php:79
#: class/MainWPCloneInstall.class.php:80
#@ mainwp-child
msgid "Not a full backup."
msgstr "Nije kompletan backup."
#: class/MainWPCloneInstall.class.php:81
#@ mainwp-child
msgid "Database backup not found."
msgstr "Backup baze podataka nije pronađen."
#: class/MainWPCloneInstall.class.php:118
#@ mainwp-child
msgid "Cant read configuration file from backup"
msgstr "Nije moguće prošitati konfiguracionu datoteku iz backup-a"
#: class/MainWPCloneInstall.class.php:130
#@ mainwp-child
msgid "Invalid database host or user/password."
msgstr "Nevažeći host baze podataka ili korisničko ime i lozinka."
#: class/MainWPCloneInstall.class.php:133
#@ mainwp-child
msgid "Invalid database name"
msgstr "Pogrešan naziv baze podataka"
#: class/MainWPCloneInstall.class.php:239
#@ mainwp-child
msgid "Error importing database"
msgstr "Greška pri unosu baze podataka"
#: class/MainWPCloneInstall.class.php:244
#@ mainwp-child
msgid "Error: unexpected end of file for database"
msgstr "Greška: neočekivan kraj baze podataka"
#: class/MainWPHeatmapTracker.class.php:68
#@ default
msgid "Home Page"
msgstr "Glavna strana"
#: class/MainWPHeatmapTracker.class.php:111
#@ default
msgid "Archive"
msgstr "Arhiva"
#: class/MainWPHeatmapTracker.class.php:135
#@ default
msgid "Search"
msgstr "Pretraži"
#: class/MainWPHeatmapTracker.class.php:144
#@ default
msgid "Blog Home Page"
msgstr "Glavan strana bloga"
#: class/MainWPHelper.class.php:233
#@ mainwp-child
msgid "Unable to create directory "
msgstr "Kreiranje direktorijuma nemoguće "
#: class/MainWPHelper.class.php:233
#@ mainwp-child
msgid " Is its parent directory writable by the server?"
msgstr "Da li je direktorijum upisiv od strane servera?"
#: class/MainWPHelper.class.php:376
#@ mainwp-child
msgid "Something went wrong while contacting the child site. Please check if there is an error on the child site. This error could also be caused by trying to clone or restore a site to large for your server settings."
msgstr "Nešto nije u redu u komunikaciji za sajtom. Molimo proverite da li ima grešaka na sajtu. Do ove greške moglo je doći ako ste pokušali klonirati sajt veći nego što je dozvoljeno u podešavanjima servera."
#: class/MainWPHelper.class.php:380
#@ mainwp-child
msgid "Child plugin is disabled or the security key is incorrect. Please resync with your main installation."
msgstr "Child Plugin je isključen ili je sigurnosni ključ pogrešan. Molimo, sinhronizujte sa Vašnom glavnom instalacijom."
#: class/MainWPClone.class.php:15
#@ mainwp-child
msgid "MainWP Clone"
msgstr "MainWP Kloniranje"
#: class/MainWPClone.class.php:221
#, php-format
#@ mainwp-child
msgid "This is a large site (%dMB), the clone process will more than likely fail."
msgstr "Ovo je veliki sajt (%dMB), kloniranje verovatno neće uspeti."
#: class/MainWPClone.class.php:222
#@ mainwp-child
msgid "Continue Anyway?"
msgstr "Nastavi u svakom slučaju?"
#: class/MainWPClone.class.php:223
#, php-format
#@ mainwp-child
msgid "Creating backup on %s expected size: %dMB (estimated time: %d seconds)"
msgstr "Kreiranje backupa na %s očekivana veličina %dMB (očekivano vreme trajanja %d sekundi)"
#: class/MainWPClone.class.php:224
#, php-format
#@ mainwp-child
msgid "Backup created on %s total size to download: %dMB"
msgstr "Backup kreiran na %s puna veličina za download: %dMB"
#: class/MainWPClone.class.php:225
#@ mainwp-child
msgid "Downloading backup"
msgstr "Preuzimanje backupa"
#: class/MainWPClone.class.php:226
#@ mainwp-child
msgid "Backup downloaded"
msgstr "Backup preuzet"
#: class/MainWPClone.class.php:227
#@ mainwp-child
msgid "Extracting backup and updating your database, this might take a while. Please be patient."
msgstr "Raspakivanje backupa i ažuriranje baze podataka u toku, ovo može potrajati. Molimo, budite strpljivi."
#: class/MainWPClone.class.php:228
#@ mainwp-child
msgid "Cloning process completed successfully!"
msgstr "Kloniranje uspešno završeno!"

35
mainwp-child.php Normal file
View file

@ -0,0 +1,35 @@
<?php
/*
Plugin Name: MainWP Child
Plugin URI: http://mainwp.com/
Description: Child Plugin for MainWP. The plugin is used so the installed blog can be securely managed remotely by your network. Plugin documentation and options can be found here http://docs.mainwp.com
Author: MainWP
Author URI: http://mainwp.com
Version: 0.27
*/
header('X-Frame-Options: ALLOWALL');
//header('X-Frame-Options: GOFORIT');
include_once(ABSPATH . 'wp-includes' . DIRECTORY_SEPARATOR . 'version.php'); //Version information from wordpress
$classDir = WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . str_replace(basename(__FILE__), '', plugin_basename(__FILE__)) . 'class' . DIRECTORY_SEPARATOR;
function mainwp_child_autoload($class_name) {
$class_file = WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . str_replace(basename(__FILE__), '', plugin_basename(__FILE__)) . 'class' . DIRECTORY_SEPARATOR . $class_name . '.class.php';
if (file_exists($class_file)) {
require_once($class_file);
}
}
if (function_exists('spl_autoload_register'))
{
spl_autoload_register('mainwp_child_autoload');
}
else
{
function __autoload($class_name) {
mainwp_child_autoload($class_name);
}
}
$mainWPChild = new MainWPChild(WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . plugin_basename(__FILE__));
register_activation_hook(__FILE__, array($mainWPChild, 'activation'));
register_deactivation_hook(__FILE__, array($mainWPChild, 'deactivation'));
?>

157
readme.txt Normal file
View file

@ -0,0 +1,157 @@
=== MainWP Child ===
Contributors: MainWP
Donate link:
Tags: WordPress Management, WordPress Controller
Author URI: http://mainwp.com
Plugin URI: http://mainwp.com
Requires at least: 3.6
Tested up to: 3.8
Stable tag: 0.26
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Allows you to manage multiple blogs from one dashboard by providing a secure connection between your child site and your MainWP dashboard.
== Description ==
[MainWP](http://mainwp.com) is a self-hosted WordPress management system that allows you to manage an endless amount of WordPress blogs from one dashboard on your server.
The MainWP Child plugin is used so the installed blog can be securely managed remotely by your Network.
**Features include:**
* Connect and control all your WordPress installs even those on different hosts!
* Update all WordPress installs, Plugins and Themes from one location
* Manage and Add all your Posts from one location
* Manage and Add all your Pages from one location
* Run everything from 1 Dashboard that you host!
== Installation ==
1. Upload the MainWP Child folder to the /wp-content/plugins/ directory
2. Activate the MainWP Child plugin through the 'Plugins' menu in WordPress
== Frequently Asked Questions ==
= What is the purpose of this plugin? =
It allows the connection between the MainWP main dashboard plugin and the site it is installed on.
To see full documentation and FAQs please visit [MainWP Documentation](http://docs.mainwp.com/)
== Screenshots ==
1. The Dashboard Screen
2. The Posts Screen
3. The Comments Screen
4. The Sites Screen
5. The Plugins Screen
6. The Themes Screen
7. The Groups Screen
8. The Offline Checks Screen
9. The Clone Screen
10. The Extension Screen
== Changelog ==
= 0.27 =
* Wordpress 3.9 changes
= 0.26 =
* Minor fix for heatmap extension
= 0.25 =
* Fix for premium plugins
= 0.24 =
* Added support for premium plugins
* Fixed the restore functionality disappearing without Clone Extension
* Fixed some deprecated calls
= 0.23 =
* Fixed some deprecated warnings
* Fixed issues with Keyword Links extension
= 0.22 =
* Added extra functionality for keyword link extension
= 0.21 =
* Fixed clone issue for some hosts with FTP settings
* German translations added
* Support for 1.0.0 major version of main dashboard
= 0.20 =
* Fixed BPS-conflict where plugins were not upgrading
= 0.19 =
* Fixed issue for upgrading core/themes/plugins without FTP credentials
= 0.18 =
* Fixed issue for sending correct roles to the main dashboard
* Added htaccess file backup (backed up as mainwp-htaccess to prevent restore conflicts)
= 0.17 =
* Tuned for faster backup
* Added extension support for Maintenance extension
= 0.16 =
* Fixed some plugin conflicts preventing updates to themes/plugins/core
= 0.15 =
* Fixed issue with mismatching locale on core update
= 0.14 =
* Fixed redirection issue with wrongly encoded HTTP request
= 0.13 =
* Added restore function
= 0.12 =
* Fixed conflict with main dashboard on same site
= 0.11 =
* Plugin localisation
* Extra check for readme.html file
* Added child server information
* Fixed restore issue: not all previous plugins/themes were removed
* Fixed backup issue: not all files are being backed up
= 0.10 =
* Fixed plugin conflict
* Fixed backup issue with database names with dashes
* Fixed date formatting
* Tags are now being saved to new posts
* Fixed issue when posting an image with a link
= 0.9 =
* Fixed delete permanently bug
* Fixed plugin conflict
= 0.8 =
* Fixed issue with Content Extension
* Added feature to add sticky posts
= 0.7 =
* Fixed the message "This site already contains a link" even after reactivating the plugin
= 0.6 =
* Fixed plugin conflict with WooCommerce plugin for cloning
* Fixed backups having double the size
= 0.5 =
* Fixed issue with importing database with custom foreign key references
* Fixed issue with disabled functions from te "suhosin" extension
* Fixed issue with click-heatmap
= 0.4 =
Fixed cloning issue with custom prefix
= 0.3 =
* Fixed issues with cloning (not cloning the correct source if the source was cloned)
= 0.2 =
* Added unfix option for security issues
= 0.1 =
* Initial version