Plugin Directory

Changeset 3431709


Ignore:
Timestamp:
01/03/2026 03:19:59 PM (3 months ago)
Author:
samukbg
Message:

Version 1.1.6: Enhancing subscription tier cards and general UI

Location:
post2podcast/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • post2podcast/trunk/includes/class-post2podcast-admin.php

    r3431665 r3431709  
    253253
    254254        if ($this->is_whitelisted) {
    255             // Section for Self-Hosted Settings (conditionally displayed)
     255            // Section for Self-Hosted Settings (conditionally displayed for whitelisted sites only)
    256256            add_settings_section(
    257257                'post2podcast_self_hosted',
    258                 __('Self-Hosted Server Configuration', 'post2podcast'), // Updated title
    259                 array($this, 'self_hosted_section_text'), 
     258                __('Self-Hosted Server Configuration', 'post2podcast'),
     259                array($this, 'self_hosted_section_text'),
    260260                'post2podcast'
    261261            );
     
    263263            add_settings_field(
    264264                'self_hosted_enabled',
    265                 __('Use Self-Hosted Server', 'post2podcast'), // Updated label for the switch
    266                 array($this, 'self_hosted_callback'), // This will render the switch
     265                __('Use Self-Hosted Server', 'post2podcast'),
     266                array($this, 'self_hosted_callback'),
    267267                'post2podcast',
    268                 'post2podcast_self_hosted' // Now part of this section
     268                'post2podcast_self_hosted'
    269269            );
    270            
     270
    271271            add_settings_field(
    272272                'api_base_url',
     
    284284                'post2podcast_self_hosted'
    285285            );
    286            
     286
    287287            add_settings_field(
    288                 'text_model', // Re-using for "AI Model"
     288                'text_model',
    289289                __('AI Model', 'post2podcast'),
    290                 array($this, 'text_model_callback'), // Re-using existing callback
     290                array($this, 'text_model_callback'),
    291291                'post2podcast',
    292292                'post2podcast_self_hosted'
    293293            );
    294                    
     294
    295295            add_settings_section(
    296296                'post2podcast_instructions',
    297                 __('How to Get API Keys & Setup Self-Hosted Server', 'post2podcast'), // Slightly updated title
     297                __('How to Get API Keys & Setup Self-Hosted Server', 'post2podcast'),
    298298                array($this, 'instructions_section_text'),
    299299                'post2podcast'
     
    457457        echo '</div>';
    458458        echo '</div>';
     459
     460        // Option 3: Self-Hosted (only for whitelisted sites)
     461        if ($this->is_whitelisted) {
     462            $self_hosted_api_key = get_option('post2podcast_openai_api_key', '');
     463            $self_hosted_server_url = get_option('post2podcast_server_url', '');
     464            $is_self_hosted_configured = !empty($self_hosted_api_key) && !empty($self_hosted_server_url);
     465
     466            echo '<div class="post2podcast-tier-card post2podcast-selfhosted-tier-status" style="flex: 1; min-width: 280px; ' . ($is_self_hosted_configured ? 'border: 2px solid #48bb78;' : '') . '">';
     467            echo '<div class="post2podcast-tier-header">';
     468            echo '<div class="post2podcast-tier-badge" style="background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);">' . esc_html__('SELF-HOSTED', 'post2podcast') . '</div>';
     469            if ($is_self_hosted_configured) {
     470                echo '<div style="margin-left: auto; background: #48bb78; color: white; padding: 4px 8px; border-radius: 12px; font-size: 11px; font-weight: 600;">' . esc_html__('ENABLED', 'post2podcast') . '</div>';
     471            }
     472            echo '</div>';
     473
     474            echo '<div class="post2podcast-tier-content">';
     475            echo '<div class="post2podcast-credits-display">';
     476            echo '<div class="post2podcast-credits-count" style="font-size: 2em;">∞</div>';
     477            echo '<span class="post2podcast-credits-label">' . esc_html__('Unlimited Generations', 'post2podcast') . '</span>';
     478            echo '</div>';
     479
     480            echo '<ul class="post2podcast-tier-features">';
     481            echo '<li class="post2podcast-tier-feature">' . esc_html__('Use your own OpenAI API key', 'post2podcast') . '</li>';
     482            echo '<li class="post2podcast-tier-feature">' . esc_html__('Unlimited audio length', 'post2podcast') . '</li>';
     483            echo '<li class="post2podcast-tier-feature">' . esc_html__('Custom server configuration', 'post2podcast') . '</li>';
     484            echo '<li class="post2podcast-tier-feature">' . esc_html__('Full data control', 'post2podcast') . '</li>';
     485            echo '</ul>';
     486
     487            echo '<div class="post2podcast-tier-actions">';
     488            if ($is_self_hosted_configured) {
     489                echo '<div style="font-size: 13px; color: #48bb78; padding: 10px; background: #f0fff4; border-radius: 6px; font-weight: 500; text-align: center;">';
     490                echo '<span class="dashicons dashicons-yes-alt" style="vertical-align: middle;"></span> ';
     491                echo esc_html__('Self-hosted mode active', 'post2podcast');
     492                echo '</div>';
     493            } else {
     494                echo '<div style="font-size: 13px; color: #718096; padding: 10px; background: #f7fafc; border-radius: 6px; text-align: center;">';
     495                echo esc_html__('Configure API key below to enable', 'post2podcast');
     496                echo '</div>';
     497            }
     498            echo '</div>';
     499            echo '</div>';
     500            echo '</div>';
     501        }
    459502
    460503        echo '</div>'; // .post2podcast-options-container
  • post2podcast/trunk/post2podcast.php

    r3431665 r3431709  
    44 * Plugin server URI: https://github.com/samukbg/post2podcast-server
    55 * Description: Convert WordPress posts into podcast episodes with AI voices
    6  * Version: 1.1.5
     6 * Version: 1.1.6
    77 * Author: Samuel Bezerra
    88 * Author URI: https://github.com/samukbg
     
    2020
    2121// Define plugin constants
    22 define('POST2PODCAST_VERSION', '1.1.5');
     22define('POST2PODCAST_VERSION', '1.1.6');
    2323define('POST2PODCAST_PLUGIN_DIR', plugin_dir_path(__FILE__));
    2424define('POST2PODCAST_PLUGIN_URL', plugin_dir_url(__FILE__));
  • post2podcast/trunk/readme.txt

    r3431665 r3431709  
    55Tested up to: 6.8
    66Requires PHP: 7.4
    7 Stable tag: 1.1.5
     7Stable tag: 1.1.6
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    273273
    274274== Changelog ==
     275= 1.1.6 =
     276* IMPROVED: Enhanced subscription tier display in settings page
     277* IMPROVED: Better visual organization of subscription options
     278
    275279= 1.1.5 =
    276280* REMOVED: Lifetime subscription option (now only Free and PRO tiers available)
Note: See TracChangeset for help on using the changeset viewer.