HEX
Server: LiteSpeed
System: Linux server315.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: globfdxw (6114)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //home/globfdxw/www/wp-content/plugins/give/src/DonationForms/AsyncData/FormGrid/FormGridView.php
<?php

namespace Give\DonationForms\AsyncData\FormGrid;

use Give\DonationForms\AsyncData\AsyncDataHelpers;

/**
 * @since 3.16.0
 */
class FormGridView
{
    /**
     * @since 3.16.0
     */
    public function maybeUsePlaceholderOnGoalAmountRaised(bool $usePlaceholder = false): bool
    {
        if (FormGridViewOptions::isProgressBarAmountRaisedAsync()) {
            $usePlaceholder = true;
        }

        return $usePlaceholder;
    }

    /**
     * @since 3.16.0
     */
    public function maybeSetProgressBarAmountRaisedAsync($amountRaisedCachedValue, $formId)
    {
        if (FormGridViewOptions::isProgressBarAmountRaisedAsync()) {
            return AsyncDataHelpers::getSkeletonPlaceholder('1rem');
        }

        if (FormGridViewOptions::useCachedMetaKeys()) {
            return $amountRaisedCachedValue;
        }

        return AsyncDataHelpers::getFormRevenueValue($formId);
    }

    /**
     * @since 3.16.0
     */
    public function maybeSetProgressBarDonationsCountAsync($donationsCountCachedValue, $formId)
    {
        if (FormGridViewOptions::isProgressBarDonationsCountAsync()) {
            return AsyncDataHelpers::getSkeletonPlaceholder('1rem');
        }

        if (FormGridViewOptions::useCachedMetaKeys()) {
            return $donationsCountCachedValue;
        }

        return AsyncDataHelpers::getFormDonationsCountValue($formId);
    }
}