WSP-29 WP author byline by

This commit is contained in:
Filip Penkava
2017-01-20 10:07:15 +01:00
parent 3cebf005c3
commit 8a19a64615
3 changed files with 48 additions and 2 deletions

12
mvp.php
View File

@@ -26,6 +26,7 @@ define('MVP_PLUGIN_URL', untrailingslashit(plugins_url('', MVP_PLUGIN)));
define('MVP_DATABASE_VERSION', '2');
define('DB_TABLE_SYNC_POST', 'sync_posts');
define('DB_TABLE_USERS', 'users');
require_once MVP_PLUGIN_DIR . '/settings.php';
@@ -69,5 +70,16 @@ function saveFile($from, $to) {
fclose($fp);
}
function generatePassword() {
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ%./\@';
$charactersLength = strlen($characters);
$password = '';
for ($i = 0; $i < 8; $i++) {
$password .= $characters[rand(0, $charactersLength - 1)];
}
$password = $password . strtotime("now");
return $password;
}
register_activation_hook(__FILE__, 'mvp_database_install');
add_action('plugins_loaded', 'mvp_database_update');