Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codename065/b0c1aba46ee6a4f5fe6ff8748f432e4b to your computer and use it in GitHub Desktop.
Save codename065/b0c1aba46ee6a4f5fe6ff8748f432e4b to your computer and use it in GitHub Desktop.
WordPress Download Manager - Bulk generate master key
<?php
//www.wpdownloadmanager.com
$all_packages = get_posts(['post_type' => 'wpdmpro', 'posts_per_page' => -1]);
foreach($all_packages as $package){
$masterKey = \WPDM\__\Crypt::encrypt( [ 'id' => $package->ID, 'time' => time() ] );
update_post_meta($package->ID, '__wpdm_masterkey', $masterKey);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment