WSP-29 WP author byline by
This commit is contained in:
12
mvp.php
12
mvp.php
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user