Example #1
0
 function leaky_paywall_hash($str)
 {
     _deprecated_function(__FUNCTION__, 'CHANGEME', 'create_leaky_paywall_login_hash( $str )');
     return create_leaky_paywall_login_hash($str);
 }
Example #2
0
 /**
  * Creates a 32-character hash string
  *
  * Generally used to create a unique hash for each subscriber, stored in the database
  * and used for campaign links
  *
  * @since 1.0.0
  *
  * @param string $str String you want to hash
  */
 function create_leaky_paywall_login_hash($str)
 {
     if (defined(SECURE_AUTH_SALT)) {
         $salt[] = SECURE_AUTH_SALT;
     }
     if (defined(AUTH_SALT)) {
         $salt[] = AUTH_SALT;
     }
     $salt[] = get_bloginfo('name');
     $salt[] = time();
     $hash = md5(md5(implode($salt)) . md5($str));
     while (!is_leaky_paywall_login_hash_unique($hash)) {
         $hash = create_leaky_paywall_login_hash($hash);
     }
     // I did this on purpose...
     return $hash;
     // doesn't have to be too secure, just want a pretty random and very unique string
 }