From f859e64a57c624ff2daa2b21355f65a49fd4807d Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Sat, 29 Aug 2026 03:09:12 +0000
Subject: [PATCH] =Some more tweaks. Mostly on the MenuBlock and adding the Meta.php to WooCommerce Products
---
inc/managers/Referrals.php | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/inc/managers/Referrals.php b/inc/managers/Referrals.php
index d71005e..396d1f2 100644
--- a/inc/managers/Referrals.php
+++ b/inc/managers/Referrals.php
@@ -1,6 +1,7 @@
<?php
namespace JVBase\managers;
+use Exception;
use JVBase\Instance;
use JVBase\integrations\services\Cloudflare;
use JVBase\meta\Form;
@@ -910,7 +911,7 @@
'From ' . $yesterday
);
- $content .= Emails::getInstance()->spacer(20);
+ $content .= Emails::getInstance()->spacer();
$content .= Emails::getInstance()->h2('New Referrals');
// Build list of referrals
@@ -980,7 +981,7 @@
Emails::getInstance()->stat($from_user->referral_count, 'Total Referrals'),
Emails::getInstance()->stat($from_user->treated_count, 'Treated')
];
- $cardContent .= Emails::getInstance()->grid($stats, 2);
+ $cardContent .= Emails::getInstance()->grid($stats);
$content .= Emails::getInstance()->card($cardContent);
$rank++;
@@ -1000,7 +1001,7 @@
*/
protected function generateCSV(array $referrals): string
{
- $cache = Cache::for('referralCSV', null, HOUR_IN_SECONDS);
+ $cache = Cache::for('referralCSV');
return $cache->remember(
'csv',
function () use ($referrals) {
@@ -1223,7 +1224,7 @@
}
// Check if code is unique
- if ($this->isCodeTaken($code, $user_id)) {
+ if ($this->isCodeTaken($code)) {
add_action('user_profile_update_errors', function($errors) {
$errors->add('referral_code_taken',
'This referral code is already in use.');
@@ -1239,7 +1240,7 @@
* Display user's referral code and share options
* Use in templates or dashboard with: echo jvbReferralShareWidget();
*
- * @return string HTML output
+ * @return array HTML output
*/
public function outputShareWidget(array $actions):array
{
@@ -1272,7 +1273,7 @@
Cloudflare::getInstance()->renderTurnstile();
$turnstile = ob_get_clean();
- $reward_text = $this->getRewardText(true);
+ $reward_text = $this->getRewardText();
// Pre-fill code if from referral link
$prefill_code = $_GET['ref'] ?? '';
@@ -1846,8 +1847,7 @@
* Add referral settings subpage to admin menu
* Add referral settings subpage to admin menu
*
- * @param array $subpages
- * @return array
+ * @return void
*/
public static function addSubpage():void
{
@@ -2781,7 +2781,7 @@
'message' => 'Referral settings saved successfully!'
];
- } catch (\Exception $e) {
+ } catch (Exception $e) {
return [
'success' => false,
'message' => 'Failed to save settings: ' . $e->getMessage()
--
Gitblit v1.10.0