diff --git a/classes/LBRY_Admin.php b/classes/LBRY_Admin.php index 41432a5..ae1c040 100644 --- a/classes/LBRY_Admin.php +++ b/classes/LBRY_Admin.php @@ -209,8 +209,7 @@ class LBRY_Admin /** * Checks at most once an hour to see if the wallet balance is too low */ - // COMBAK: Check user permissions possibly, figure out proper timing Interval, Email warning - // TODO: make sure it doesn't set a bunch of warnings + // COMBAK: Check user permissions possibly public static function wallet_balance_warning() { if (!get_transient('lbry_wallet_warning')) { @@ -219,16 +218,16 @@ class LBRY_Admin if (!get_transient('lbry_wallet_warning_email')) { $email = get_option('admin_email'); $subject = 'Your LBRYPress Wallet Balance is Low!'; - $message = 'You LBRY Wallet for your wordpress installation at ' . get_option('site_url') . 'is running very low. In order to keep publishing to the LBRY network, please add some LBC to your account.'; + $message = "You LBRY Wallet for your wordpress installation at " . site_url() . " is running very low.\r\n\r\nYou currently have " . $balance . ' LBC left in your wallet. In order to keep publishing to the LBRY network, please add some LBC to your account.'; wp_mail($email, $subject, $message); - set_transient('lbry_wallet_warning_email', true, 30); + set_transient('lbry_wallet_warning_email', true, DAY_IN_SECONDS); // TODO: Fix outgoing email } LBRY()->notice->set_notice('error', 'Your account balance is low, please add LBC to your account to continue publishing to the LBRY Network', true); } - set_transient('lbry_wallet_warning', true, 30); + set_transient('lbry_wallet_warning', true, 2 * HOUR_IN_SECONDS); } } } diff --git a/classes/LBRY_Admin_Notice.php b/classes/LBRY_Admin_Notice.php index 44b7a5b..bde0438 100644 --- a/classes/LBRY_Admin_Notice.php +++ b/classes/LBRY_Admin_Notice.php @@ -29,7 +29,7 @@ class LBRY_Admin_Notice /** * Sets transients for admin errors */ - // TODO: Make sure we only set one transient at a time + // TODO: Make sure we only set one transient at a time per error public function set_notice($status = 'error', $message = 'Something went wrong', $is_dismissible = false) { $notice = array( diff --git a/classes/lbrypress.php b/classes/lbrypress.php index b35751f..6558c7d 100644 --- a/classes/lbrypress.php +++ b/classes/lbrypress.php @@ -108,7 +108,7 @@ class LBRYPress 'license2' => 'License 2', 'license3' => 'License 3' )); - $this->define('LBRY_MIN_BALANCE', 2000); + $this->define('LBRY_MIN_BALANCE', 20); } /**