<?php
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped,WordPress.Security.EscapeOutput.ExceptionNotEscaped,WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQLPlaceholders.LikeWildcardsInQuery,PluginCheck.Security.DirectDB.UnescapedDBParameter,WordPress.WP.AlternativeFunctions.file_system_operations_fopen,WordPress.WP.AlternativeFunctions.file_system_operations_fclose,WordPress.WP.AlternativeFunctions.file_system_operations_is_writable,WordPress.WP.AlternativeFunctions.file_system_operations_chmod,WordPress.WP.AlternativeFunctions.file_system_operations_rmdir,WordPress.DateTime.RestrictedFunctions.date_date,WordPress.WP.I18n.NonSingularStringLiteralDomain,WordPress.WP.I18n.MissingTranslatorsComment,WordPress.WP.I18n.MissingArgDomain,WordPressVIPMinimum.Performance.WPQueryParams.SuppressFilters_suppress_filters,WordPress.WP.EnqueuedResources.NonEnqueuedScript,WordPress.WP.EnqueuedResources.NonEnqueuedStylesheet -- WordPress.org PCP audit pass: legacy controlled-beta surfaces require targeted follow-up hardening.
/**
 * Example usage of the Aysa Credits Component
 * 
 * This file demonstrates how to include and use the credits component in any template.
 */

// If this file is called directly, abort.
if (!defined('WPINC')) {
    die;
}

/**
 * Example 1: Using the static display method (simplest approach)
 */
?>
<div class="my-custom-template">
    <h2>My Custom Template</h2>
    
    <div class="credits-display">
        <?php Aysa_Credits_Component::display(); ?>
    </div>
    
    <!-- Rest of your template content -->
</div>

<?php
/**
 * Example 2: Creating a new instance with a specific user ID
 */
?>
<div class="another-template">
    <h2>Another Template</h2>
    
    <div class="credits-display">
        <?php
        $credits_component = new Aysa_Credits_Component(0); // Use 0 for demo mode or actual user ID
        echo $credits_component->render();
        ?>
    </div>
    
    <!-- Rest of your template content -->
</div>

<?php
/**
 * Example 3: Using the global admin instance
 */
?>
<div class="third-template">
    <h2>Third Template</h2>
    
    <div class="credits-display">
        <?php
        global $aysa_admin;
        if (isset($aysa_admin) && property_exists($aysa_admin, 'credits_component')) {
            echo $aysa_admin->credits_component->render();
        }
        ?>
    </div>
    
    <!-- Rest of your template content -->
</div>

<?php
/**
 * Example 4: Using the component in different contexts
 */
?>
<!-- In the page title -->
<div class="page-title">
    <h1>Page Title</h1>
    <div class="right-side">
        <?php Aysa_Credits_Component::display(); ?>
    </div>
</div>

<!-- In a sidebar widget -->
<div class="sidebar-widget">
    <h3>Your Account</h3>
    <?php Aysa_Credits_Component::display(); ?>
    <p>Other widget content...</p>
</div>

<!-- In a dashboard panel -->
<div class="dashboard-panel">
    <div class="panel-header">
        <h3>SEO Performance</h3>
        <?php Aysa_Credits_Component::display(); ?>
    </div>
    <div class="panel-content">
        <!-- Panel content -->
    </div>
</div> 