Changeset 3432112
- Timestamp:
- 01/04/2026 01:52:20 PM (3 months ago)
- Location:
- post2podcast/trunk
- Files:
-
- 4 edited
-
README.md (modified) (1 diff)
-
includes/class-post2podcast-admin.php (modified) (5 diffs)
-
post2podcast.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
post2podcast/trunk/README.md
r3432101 r3432112 5 5 Tested up to: 6.8 6 6 Requires PHP: 7.4 7 Stable tag: 1.1. 77 Stable tag: 1.1.8 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html -
post2podcast/trunk/includes/class-post2podcast-admin.php
r3431746 r3432112 358 358 $options = get_option('post2podcast_options'); 359 359 360 // Display two tier options in a clear layout 360 // Check if self-hosted is configured (for whitelisted sites) 361 $self_hosted_api_key = isset($options['openai_api_key']) ? $options['openai_api_key'] : ''; 362 $self_hosted_server_url = isset($options['api_base_url']) ? $options['api_base_url'] : ''; 363 $self_hosted_enabled = isset($options['self_hosted_enabled']) && $options['self_hosted_enabled']; 364 $is_self_hosted_configured = $this->is_whitelisted && $self_hosted_enabled && !empty($self_hosted_api_key) && !empty($self_hosted_server_url); 365 366 // Display tier options in a clear layout 361 367 echo '<div class="post2podcast-options-container" style="display: flex; gap: 20px; flex-wrap: wrap; margin: 20px 0;">'; 362 368 363 369 // Option 1: Free Hosted Service 364 370 $free_credits_available = 10 - intval($free_credits_used); 365 371 $credits_display = $free_credits_available > 0 ? $free_credits_available : 0; 366 372 $free_credits_percentage = ($credits_display / 10) * 100; 367 $is_current_free = ($subscription_status !== 'active') || (!$current_period_end_ts) || (time() > $current_period_end_ts);373 $is_current_free = !$is_self_hosted_configured && (($subscription_status !== 'active') || (!$current_period_end_ts) || (time() > $current_period_end_ts)); 368 374 369 375 echo '<div class="post2podcast-tier-card post2podcast-free-tier-status" style="flex: 1; min-width: 280px; ' . ($is_current_free ? 'border: 2px solid #667eea;' : '') . '">'; … … 395 401 396 402 // Option 2: PRO Hosted Service 397 $is_current_pro = $subscription_status === 'active' && $current_period_end_ts && time() < $current_period_end_ts;403 $is_current_pro = !$is_self_hosted_configured && $subscription_status === 'active' && $current_period_end_ts && time() < $current_period_end_ts; 398 404 399 405 echo '<div class="post2podcast-tier-card post2podcast-pro-tier-status" style="flex: 1; min-width: 280px; ' . ($is_current_pro ? 'border: 2px solid #667eea;' : '') . '">'; … … 460 466 // Option 3: Self-Hosted (only for whitelisted sites) 461 467 if ($this->is_whitelisted) { 462 $self_hosted_api_key = isset($options['openai_api_key']) ? $options['openai_api_key'] : '';463 $self_hosted_server_url = isset($options['api_base_url']) ? $options['api_base_url'] : '';464 $self_hosted_enabled = isset($options['self_hosted_enabled']) && $options['self_hosted_enabled'];465 $is_self_hosted_configured = $self_hosted_enabled && !empty($self_hosted_api_key) && !empty($self_hosted_server_url);466 467 468 echo '<div class="post2podcast-tier-card post2podcast-selfhosted-tier-status" style="flex: 1; min-width: 280px; ' . ($is_self_hosted_configured ? 'border: 2px solid #48bb78;' : '') . '">'; 468 469 echo '<div class="post2podcast-tier-header">'; … … 504 505 echo '</div>'; // .post2podcast-options-container 505 506 506 // Show warning if free credits are exhausted 507 if (!$is_current_pro && $free_credits_available <= 0) {507 // Show warning if free credits are exhausted (but not if self-hosted is configured) 508 if (!$is_current_pro && !$is_self_hosted_configured && $free_credits_available <= 0) { 508 509 echo '<div class="notice notice-info" style="margin: 15px 0;">'; 509 510 echo '<p>' . esc_html__('You\'ve used all your free generations. Upgrade to PRO for 300 monthly credits.', 'post2podcast') . '</p>'; … … 1535 1536 ); 1536 1537 } 1537 1538 1539 // Check if self-hosted is configured (unlimited credits for whitelisted sites) 1540 $options = get_option('post2podcast_options'); 1541 $self_hosted_api_key = isset($options['openai_api_key']) ? $options['openai_api_key'] : ''; 1542 $self_hosted_server_url = isset($options['api_base_url']) ? $options['api_base_url'] : ''; 1543 $self_hosted_enabled = isset($options['self_hosted_enabled']) && $options['self_hosted_enabled']; 1544 $is_self_hosted_configured = $this->is_whitelisted && $self_hosted_enabled && !empty($self_hosted_api_key) && !empty($self_hosted_server_url); 1545 1546 if ($is_self_hosted_configured) { 1547 return array( 1548 'can_generate' => true, 1549 'message' => '', 1550 'credits_remaining' => PHP_INT_MAX // Unlimited 1551 ); 1552 } 1553 1538 1554 $subscription_status = get_user_meta($user_id, '_post2podcast_subscription_status', true); 1539 $user_id = get_current_user_id();1540 1555 $current_period_end = get_user_meta($user_id, '_post2podcast_current_period_end', true); 1541 1556 $credits_remaining = get_user_meta($user_id, '_post2podcast_credits_remaining', true); 1542 1557 $free_credits_used = get_user_meta($user_id, '_post2podcast_free_credits_used', true); 1543 1558 1544 1559 if ($free_credits_used === '') $free_credits_used = 0; 1545 1560 if ($credits_remaining === '') $credits_remaining = 0; -
post2podcast/trunk/post2podcast.php
r3432101 r3432112 4 4 * Plugin server URI: https://github.com/samukbg/post2podcast-server 5 5 * Description: Convert WordPress posts into podcast episodes with AI voices 6 * Version: 1.1. 76 * Version: 1.1.8 7 7 * Author: Samuel Bezerra 8 8 * Author URI: https://github.com/samukbg … … 20 20 21 21 // Define plugin constants 22 define('POST2PODCAST_VERSION', '1.1. 7');22 define('POST2PODCAST_VERSION', '1.1.8'); 23 23 define('POST2PODCAST_PLUGIN_DIR', plugin_dir_path(__FILE__)); 24 24 define('POST2PODCAST_PLUGIN_URL', plugin_dir_url(__FILE__)); -
post2podcast/trunk/readme.txt
r3432101 r3432112 5 5 Tested up to: 6.8 6 6 Requires PHP: 7.4 7 Stable tag: 1.1. 77 Stable tag: 1.1.8 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 273 273 274 274 == Changelog == 275 = 1.1.8 = 276 * FIXED: Tier activation logic for improved subscription handling 277 * FIXED: Automatic and bulk generation feature availability 278 * IMPROVED: Credit checking system for better user experience 279 275 280 = 1.1.7 = 276 281 * FIXED: Configuration detection in settings page
Note: See TracChangeset
for help on using the changeset viewer.