Σ(゚Д゚;≡;゚д゚)Σ(゚Д゚;≡;゚д゚)Σ(゚Д゚;≡;゚д゚)始,故人唐宰相鲁公,🆚开府南服,余以布衣从戎。明年,别公漳水湄。后明年,公以事过张睢阳庙及颜杲卿所尝往来处,悲歌慷慨,卒不负其言而从之游。今其诗具在,可考也。😭
seedprod-admin-welcome.php 0000644 00000012440 15233474616 0011615 0 ustar 00 <?php
/**
* Welcome page for plugin activation
*
* @package SeedProd
* @subpackage SeedProd/admin/partials
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Get necessary data.
$is_pro = ! seedprod_lite_v2_is_lite_view();
$page_slug = $is_pro ? 'seedprod_lite' : 'seedprod_lite';
$site_token = get_option( 'seedprod_token' );
$admin_email = get_option( 'admin_email' );
$plugin_version = SEEDPROD_VERSION;
// Laravel wizard appends 'admin.php?page=seedprod_lite#/setup/{id}', so we only need base admin URL.
$admin_url = admin_url();
// Build SaaS wizard URL for Lite.
$wizard_url = '';
if ( ! $is_pro ) {
$upgrade_url = seedprod_lite_v2_get_upgrade_url( 'onboarding', 'welcome' );
// Build base URL without trailing slash.
$base_url = untrailingslashit( SEEDPROD_WEB_API_URL );
// Build wizard URL - Laravel expects return to be base64 encoded then URL encoded.
$wizard_url = sprintf(
'%s/setup-wizard-seedprod_lite?token=%s&return=%s&version=%s&utm_campaign=%s&email=%s&upgrade_to_pro_url=%s',
$base_url,
rawurlencode( $site_token ),
rawurlencode( base64_encode( $admin_url ) ), // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode -- Base64 required for Laravel API, not for obfuscation.
rawurlencode( $plugin_version ),
rawurlencode( 'onboarding_seedprod_lite' ),
rawurlencode( $admin_email ),
rawurlencode( $upgrade_url )
);
}
?>
<div class="seedprod-welcome-page">
<div class="seedprod-welcome-top">
<div class="seedprod-welcome-container">
<div class="seedprod-welcome-header">
<img
src="<?php echo esc_url( SEEDPROD_PLUGIN_URL . 'public/svg/seedprod-logo.svg' ); ?>"
alt="SeedProd"
class="seedprod-welcome-logo"
/>
<p class="seedprod-welcome-subtitle">
<?php esc_html_e( 'Thank you for choosing SeedProd - The Best Website Builder, Landing Page Builder, Coming Soon, Maintenance Mode & more...', 'coming-soon' ); ?>
</p>
</div>
<div class="seedprod-welcome-content">
<?php
?>
<!-- LITE Version: External wizard redirect -->
<div class="seedprod-welcome-box">
<h2>
<?php
esc_html_e( 'Use our setup wizard to get started in less than 2 minutes and unlock free templates!', 'coming-soon' );
?>
</h2>
<div class="seedprod-welcome-actions">
<a href="<?php echo esc_url( $wizard_url ); ?>"
class="button button-primary button-hero seedprod-button-primary seedprod-wizard-button"
data-fallback-url="<?php echo esc_url( admin_url( 'admin.php?page=seedprod_lite' ) ); ?>"
rel="noopener noreferrer">
<?php esc_html_e( 'Get Started', 'coming-soon' ); ?> →
</a>
</div>
</div>
<div class="seedprod-welcome-footer">
<a href="<?php echo esc_url( admin_url( 'admin.php?page=seedprod_lite' ) ); ?>"
class="seedprod-skip-link seedprod-exit-setup">
<?php esc_html_e( '← Exit Setup', 'coming-soon' ); ?>
</a>
<p class="seedprod-welcome-note">
<?php esc_html_e( 'Note: You will be transfered to an SeedProd.com to complete the setup wizard.', 'coming-soon' ); ?>
</p>
</div>
<?php
?>
</div>
</div>
</div>
<?php if ( ! $is_pro ) : ?>
<script>
jQuery(document).ready(function($) {
// Check wizard service availability before redirecting
$('.seedprod-wizard-button').on('click', function(e) {
e.preventDefault();
var $button = $(this);
var wizardUrl = $button.attr('href');
var fallbackUrl = $button.data('fallback-url');
// Add loading state
$button.addClass('disabled').html('<?php esc_html_e( 'Redirecting...', 'coming-soon' ); ?>');
// TEMPORARILY DISABLED: Skip health check and redirect directly
window.location.href = wizardUrl;
return;
// Check if wizard service is available using AJAX to avoid CORS
$.ajax({
url: ajaxurl,
type: 'POST',
data: {
action: 'seedprod_lite_v2_check_wizard_availability',
nonce: '<?php echo esc_js( wp_create_nonce( 'seedprod_lite_v2_check_wizard_availability' ) ); ?>'
},
timeout: 5000, // 5 second timeout
success: function(response) {
if (response.success && response.data.available) {
// Service is available, redirect to wizard
window.location.href = wizardUrl;
} else {
// Service unavailable, go to dashboard
window.location.href = fallbackUrl;
}
},
error: function() {
// Error checking, assume service is down, go to dashboard
window.location.href = fallbackUrl;
}
});
});
// Exit setup confirmation for Lite version only
$('.seedprod-exit-setup').on('click', function(e) {
e.preventDefault();
var confirmText =
<?php
echo wp_json_encode(
__( "Are you sure you want to exit the setup wizard?\n\nYou will miss out on our free templates. 😬", 'coming-soon' )
);
?>
;
if (confirm(confirmText)) {
// Set dismiss option via AJAX before redirecting
var redirectUrl = $(this).attr('href');
$.ajax({
url: ajaxurl,
type: 'POST',
data: {
action: 'seedprod_lite_v2_dismiss_setup_wizard',
_ajax_nonce: '<?php echo esc_js( wp_create_nonce( 'seedprod_v2_nonce' ) ); ?>'
},
success: function() {
window.location.href = redirectUrl;
},
error: function() {
// Redirect even if AJAX fails
window.location.href = redirectUrl;
}
});
}
});
});
</script>
<?php endif; ?>
seedprod-admin-dashboard.php 0000644 00000126661 15233474616 0012124 0 ustar 00 <?php
/**
* Dashboard page for SeedProd
*
* @package SeedProd
* @subpackage SeedProd/admin/partials
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Check if we have a valid license (Pro version).
$license_key = get_option( 'seedprod_api_key' );
$license_status = get_option( 'seedprod_api_message' );
$has_valid_license = ! empty( $license_key ) && ! empty( get_option( 'seedprod_api_token' ) );
// Use utility function to check for Lite view (includes test parameter).
$is_lite_view = seedprod_lite_v2_is_lite_view();
$is_pro = ! $is_lite_view;
// Check if returning from wizard (query parameter format).
$wizard_id = isset( $_GET['wizard_id'] ) ? sanitize_text_field( wp_unslash( $_GET['wizard_id'] ) ) : null; // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Read-only parameter for display logic.
// Note: Laravel currently returns admin.php?page=seedprod_lite#/setup/{wizard_id}.
// We'll handle the hash format in JavaScript since PHP can't read URL fragments.
?>
<div class="seedprod-dashboard-page <?php echo ( $is_pro && ! $has_valid_license ) ? 'seedprod-license-activation-view' : ''; ?> <?php echo $is_lite_view ? 'seedprod-lite' : ''; ?>">
<?php
// Include header with page title.
$page_title = __( 'Dashboard', 'coming-soon' );
require_once plugin_dir_path( __FILE__ ) . 'seedprod-admin-header.php';
?>
<div class="seedprod-dashboard-container">
<?php if ( $is_pro && ! $has_valid_license ) : ?>
<!-- Welcome section for new Pro users -->
<div class="seedprod-welcome-section">
<img src="<?php echo esc_url( plugin_dir_url( __DIR__ ) . 'images/seedprod-logo.svg' ); ?>" alt="SeedProd" class="seedprod-welcome-logo" />
<h1 class="seedprod-welcome-title"><?php esc_html_e( '🎉 Welcome to SeedProd Lite!', 'coming-soon' ); ?></h1>
<p class="seedprod-welcome-subtitle"><?php esc_html_e( 'The Next-Gen WordPress Website Builder', 'coming-soon' ); ?></p>
<p class="seedprod-welcome-message">
<?php esc_html_e( 'Build stunning websites in under 30 seconds with AI-powered design, drag & drop simplicity, and professional templates. No coding required.', 'coming-soon' ); ?>
</p>
</div>
<!-- Pro version but no license activated -->
<div class="postbox seedprod-card seedprod-license-notice seedprod-license-activation-focused">
<div class="inside">
<div class="seedprod-activation-steps">
<h2><?php esc_html_e( "Let's get started!", 'coming-soon' ); ?></h2>
<div class="seedprod-step-indicator seedprod-step-active">
<span class="seedprod-step-number">1</span>
<span class="seedprod-step-label"><?php esc_html_e( 'Activate your license to unlock all features', 'coming-soon' ); ?></span>
</div>
<div class="seedprod-step-indicator seedprod-step-upcoming">
<span class="seedprod-step-number">2</span>
<span class="seedprod-step-label"><?php esc_html_e( 'Create your first stunning page', 'coming-soon' ); ?></span>
</div>
</div>
<form id="seedprod-license-form" class="seedprod-license-form">
<div class="seedprod-license-input-group">
<input
type="password"
id="seedprod-license-key"
name="license_key"
placeholder="<?php esc_attr_e( 'Enter your license key here', 'coming-soon' ); ?>"
class="regular-text seedprod-license-input"
/>
<button type="submit" class="button button-primary button-hero seedprod-button-primary">
<span class="button-text"><?php esc_html_e( 'Activate License', 'coming-soon' ); ?></span>
<span class="button-spinner" style="display:none;">
<span class="dashicons dashicons-update-alt"></span>
</span>
</button>
</div>
<!-- Inline message area -->
<div id="seedprod-license-message" class="seedprod-license-message"></div>
</form>
<p class="seedprod-license-help">
<?php
printf(
/* translators: %1$s: link to account page */
wp_kses_post( __( "Don't have a license key or need to renew? Visit %1\$s", 'coming-soon' ) ),
'<a href="' . esc_url( seedprod_lite_get_external_link( 'https://www.seedprod.com/', 'admin-license-help', 'proplugin' ) ) . '" target="_blank" rel="noopener">' . esc_html__( 'seedprod.com', 'coming-soon' ) . '</a>'
);
?>
</p>
</div>
</div>
<!-- Quick actions section -->
<div class="seedprod-quick-actions">
<a href="<?php echo esc_url( seedprod_lite_get_external_link( 'https://www.seedprod.com/docs/', 'dashboard-quick-actions', seedprod_lite_v2_is_lite_view() ? 'liteplugin' : 'proplugin' ) ); ?>" target="_blank" rel="noopener" class="seedprod-quick-action">
<span class="dashicons dashicons-book-alt"></span>
<?php esc_html_e( 'Documentation', 'coming-soon' ); ?>
</a>
<a href="https://www.youtube.com/seedprod" target="_blank" rel="noopener" class="seedprod-quick-action">
<span class="dashicons dashicons-video-alt3"></span>
<?php esc_html_e( 'Video Tutorials', 'coming-soon' ); ?>
</a>
<a href="https://www.facebook.com/groups/wpbeginner" target="_blank" rel="noopener" class="seedprod-quick-action">
<span class="dashicons dashicons-groups"></span>
<?php esc_html_e( 'Community', 'coming-soon' ); ?>
</a>
</div>
<?php
else :
// Get stats data using V2 function.
$stats = seedprod_lite_v2_get_dashboard_stats();
// Extract stats for easier use in template.
$coming_soon_count = $stats['coming_soon_count'];
$maintenance_count = $stats['maintenance_count'];
$landing_pages_count = $stats['landing_pages_count'];
$theme_templates_count = $stats['theme_templates_count'];
$total_subscribers = $stats['total_subscribers'];
$recent_subscribers = $stats['recent_subscribers'];
// Check if theme builder is enabled (checks both old and new format).
$theme_builder_enabled = seedprod_lite_v2_is_theme_enabled();
?>
<!-- Main Dashboard Content -->
<div class="seedprod-dashboard-content">
<!-- Top row: Setup & Status | What's New -->
<div class="seedprod-dashboard-row">
<!-- Setup & Status Widget (Left) -->
<div class="postbox seedprod-card">
<h2 class="hndle">
<span class="dashicons dashicons-admin-generic"></span>
<?php esc_html_e( 'Setup & Status', 'coming-soon' ); ?>
</h2>
<div class="inside">
<?php
// Check if user just activated their license.
$just_activated = isset( $_GET['activated'] ) && 'true' === $_GET['activated']; // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Read-only parameter for display logic.
if ( true === $just_activated ) :
?>
<div class="seedprod-welcome-activated">
<h3>🎉 <?php esc_html_e( 'Welcome to SeedProd Lite!', 'coming-soon' ); ?></h3>
<p><?php esc_html_e( 'Your license is activated! Now choose what you\'d like to create first:', 'coming-soon' ); ?></p>
</div>
<?php else : ?>
<p class="seedprod-setup-intro"><?php esc_html_e( 'Get your website set up quickly with these essential features:', 'coming-soon' ); ?></p>
<?php endif; ?>
<?php
// Use stats from V2 function.
$csp_id = $stats['csp_id'];
$csp_setup_status = $stats['csp_setup_status'];
$csp_active = $stats['csp_active'];
$mmp_id = $stats['mmp_id'];
$mmp_active = $stats['mmp_active'];
$loginp_id = $stats['loginp_id'];
$loginp_active = $stats['loginp_active'];
$p404_id = $stats['p404_id'];
$p404_active = $stats['p404_active'];
// Check if returning from wizard (URL parameter indicates wizard completion).
$is_wizard_return = isset( $_GET['seedprod_wizard_complete'] ) || isset( $_GET['id'] ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Read-only parameter for display logic.
?>
<!-- Coming Soon Mode -->
<div class="seedprod-setup-item">
<span class="dashicons dashicons-clock seedprod-setup-icon <?php echo $csp_id && $csp_active ? 'active' : ''; ?>"></span>
<div class="seedprod-setup-item-content">
<div class="seedprod-setup-item-header">
<h3 class="seedprod-setup-item-title">
<span class="seedprod-setup-title-text">
<?php esc_html_e( 'Coming Soon Mode', 'coming-soon' ); ?>
<span class="dashicons dashicons-info seedprod-info-icon"></span>
<span class="seedprod-tooltip seedprod-tooltip-large"><?php esc_html_e( 'A Coming Soon Page will hide your site from public but you\'ll still be able to see it and work on it if logged in.', 'coming-soon' ); ?></span>
</span>
</h3>
<div class="seedprod-setup-item-controls">
<?php if ( $csp_id && $csp_active ) : ?>
<span class="seedprod-status-badge seedprod-status-active"><?php esc_html_e( 'ACTIVE', 'coming-soon' ); ?></span>
<?php elseif ( $csp_id && ! $csp_active ) : ?>
<span class="seedprod-status-badge seedprod-status-inactive"><?php esc_html_e( 'INACTIVE', 'coming-soon' ); ?></span>
<?php endif; ?>
<?php if ( $csp_id ) : ?>
<label class="seedprod-switch">
<input type="checkbox" class="seedprod-toggle" data-mode="coming_soon" <?php checked( $csp_active ); ?>>
<span class="seedprod-slider"></span>
</label>
<?php endif; ?>
<?php if ( ! $csp_id ) : ?>
<a href="<?php echo esc_url( admin_url( 'admin.php?page=seedprod_lite_template_selection&type=cs&name=' . rawurlencode( __( 'Coming Soon Page', 'coming-soon' ) ) . '&slug=coming-soon-page' ) ); ?>" class="button button-primary button-small seedprod-button-primary">
<?php esc_html_e( 'Setup', 'coming-soon' ); ?>
</a>
<?php elseif ( $is_wizard_return && ! $csp_setup_status ) : ?>
<a href="<?php echo esc_url( admin_url( 'admin.php?page=seedprod_lite_builder&id=' . $csp_id . '#/setup/cs' ) ); ?>" class="button button-primary button-small seedprod-button-primary seedprod-pulse">
<span class="dashicons dashicons-arrow-right-alt"></span>
<?php esc_html_e( 'Finish', 'coming-soon' ); ?>
</a>
<?php else : ?>
<a href="<?php echo esc_url( admin_url( 'admin.php?page=seedprod_lite_builder&id=' . $csp_id ) ); ?>" class="button button-small seedprod-button-secondary">
<?php esc_html_e( 'Edit', 'coming-soon' ); ?>
</a>
<a href="<?php echo esc_url( get_preview_post_link( $csp_id ) ); ?>" target="_blank" class="button button-small seedprod-button-secondary">
<?php esc_html_e( 'Preview', 'coming-soon' ); ?>
</a>
<?php endif; ?>
</div>
</div>
</div>
</div>
<!-- Maintenance Mode -->
<div class="seedprod-setup-item">
<span class="dashicons dashicons-admin-tools seedprod-setup-icon <?php echo $mmp_id && $mmp_active ? 'active' : ''; ?>"></span>
<div class="seedprod-setup-item-content">
<div class="seedprod-setup-item-header">
<h3 class="seedprod-setup-item-title">
<span class="seedprod-setup-title-text">
<?php esc_html_e( 'Maintenance Mode', 'coming-soon' ); ?>
<span class="dashicons dashicons-info seedprod-info-icon"></span>
<span class="seedprod-tooltip seedprod-tooltip-large"><?php esc_html_e( 'A Maintenance Page will notify search engines that the site is unavailable.', 'coming-soon' ); ?></span>
</span>
</h3>
<div class="seedprod-setup-item-controls">
<?php if ( $mmp_id && $mmp_active ) : ?>
<span class="seedprod-status-badge seedprod-status-active"><?php esc_html_e( 'ACTIVE', 'coming-soon' ); ?></span>
<?php elseif ( $mmp_id && ! $mmp_active ) : ?>
<span class="seedprod-status-badge seedprod-status-inactive"><?php esc_html_e( 'INACTIVE', 'coming-soon' ); ?></span>
<?php endif; ?>
<?php if ( $mmp_id ) : ?>
<label class="seedprod-switch">
<input type="checkbox" class="seedprod-toggle" data-mode="maintenance" <?php checked( $mmp_active ); ?>>
<span class="seedprod-slider"></span>
</label>
<?php endif; ?>
<?php if ( ! $mmp_id ) : ?>
<a href="<?php echo esc_url( admin_url( 'admin.php?page=seedprod_lite_template_selection&type=mm&name=' . rawurlencode( __( 'Maintenance Mode Page', 'coming-soon' ) ) . '&slug=maintenance-mode-page' ) ); ?>" class="button button-primary button-small seedprod-button-primary">
<?php esc_html_e( 'Setup', 'coming-soon' ); ?>
</a>
<?php else : ?>
<a href="<?php echo esc_url( admin_url( 'admin.php?page=seedprod_lite_builder&id=' . $mmp_id ) ); ?>" class="button button-small seedprod-button-secondary">
<?php esc_html_e( 'Edit', 'coming-soon' ); ?>
</a>
<a href="<?php echo esc_url( get_preview_post_link( $mmp_id ) ); ?>" target="_blank" class="button button-small seedprod-button-secondary">
<?php esc_html_e( 'Preview', 'coming-soon' ); ?>
</a>
<?php endif; ?>
</div>
</div>
</div>
</div>
<!-- Landing Pages -->
<div class="seedprod-setup-item">
<span class="dashicons dashicons-admin-page seedprod-setup-icon <?php echo $landing_pages_count > 0 ? 'active' : ''; ?>"></span>
<div class="seedprod-setup-item-content">
<div class="seedprod-setup-item-header">
<h3 class="seedprod-setup-item-title">
<span class="seedprod-setup-title-text">
<?php esc_html_e( 'Landing Pages', 'coming-soon' ); ?>
<span class="dashicons dashicons-info seedprod-info-icon"></span>
<span class="seedprod-tooltip seedprod-tooltip-large"><?php esc_html_e( 'Landing Pages are meant to be standalone pages separate from the design of your site and theme.', 'coming-soon' ); ?></span>
</span>
</h3>
<div class="seedprod-setup-item-controls">
<?php if ( $landing_pages_count > 0 ) : ?>
<span class="seedprod-count-badge"><?php echo esc_html( $landing_pages_count ); ?> <?php esc_html_e( 'pages', 'coming-soon' ); ?></span>
<a href="<?php echo esc_url( admin_url( 'admin.php?page=seedprod_lite_landing_pages' ) ); ?>" class="button button-small seedprod-button-secondary">
<?php esc_html_e( 'Manage', 'coming-soon' ); ?>
</a>
<?php else : ?>
<a href="<?php echo esc_url( admin_url( 'admin.php?page=seedprod_lite_landing_pages' ) ); ?>" class="button button-primary button-small seedprod-button-primary">
<?php esc_html_e( 'Setup', 'coming-soon' ); ?>
</a>
<?php endif; ?>
</div>
</div>
</div>
</div>
<!-- Website Builder -->
<div class="seedprod-setup-item <?php echo $is_lite_view ? 'seedprod-pro-feature' : ''; ?>">
<span class="dashicons dashicons-admin-appearance seedprod-setup-icon <?php echo $theme_builder_enabled ? 'active' : ''; ?>"></span>
<div class="seedprod-setup-item-content">
<div class="seedprod-setup-item-header">
<h3 class="seedprod-setup-item-title">
<span class="seedprod-setup-title-text">
<?php esc_html_e( 'Website Builder', 'coming-soon' ); ?>
<?php if ( $is_lite_view ) : ?>
<?php echo wp_kses_post( seedprod_lite_v2_get_pro_badge( 'inline' ) ); ?>
<span class="seedprod-pro-value"><?php esc_html_e( 'Build custom themes', 'coming-soon' ); ?></span>
<?php endif; ?>
<span class="dashicons dashicons-info seedprod-info-icon"></span>
<span class="seedprod-tooltip seedprod-tooltip-large"><?php esc_html_e( 'Build your entire Website. Create Headers, Footers, Pages, Posts, Archives, Sidebars, and more.', 'coming-soon' ); ?></span>
</span>
</h3>
<div class="seedprod-setup-item-controls">
<?php if ( $is_lite_view ) : ?>
<?php echo wp_kses_post( seedprod_lite_v2_get_setup_item_upgrade( 'website-builder' ) ); ?>
<?php else : ?>
<?php if ( $theme_builder_enabled ) : ?>
<span class="seedprod-status-badge seedprod-status-active"><?php esc_html_e( 'ACTIVE', 'coming-soon' ); ?></span>
<a href="<?php echo esc_url( admin_url( 'admin.php?page=seedprod_lite_website_builder' ) ); ?>" class="button button-small seedprod-button-secondary">
<?php esc_html_e( 'Manage', 'coming-soon' ); ?>
</a>
<?php else : ?>
<a href="<?php echo esc_url( admin_url( 'admin.php?page=seedprod_lite_website_builder' ) ); ?>" class="button button-primary button-small seedprod-button-primary">
<?php esc_html_e( 'Setup', 'coming-soon' ); ?>
</a>
<?php endif; ?>
<?php endif; ?>
</div>
</div>
</div>
</div>
<!-- Login Page -->
<div class="seedprod-setup-item <?php echo $is_lite_view ? 'seedprod-pro-feature' : ''; ?>">
<span class="dashicons dashicons-admin-network seedprod-setup-icon <?php echo $loginp_id && $loginp_active ? 'active' : ''; ?>"></span>
<div class="seedprod-setup-item-content">
<div class="seedprod-setup-item-header">
<h3 class="seedprod-setup-item-title">
<span class="seedprod-setup-title-text">
<?php esc_html_e( 'Login Page', 'coming-soon' ); ?>
<?php if ( $is_lite_view ) : ?>
<?php echo wp_kses_post( seedprod_lite_v2_get_pro_badge( 'inline' ) ); ?>
<span class="seedprod-pro-value"><?php esc_html_e( 'Match your brand', 'coming-soon' ); ?></span>
<?php endif; ?>
<span class="dashicons dashicons-info seedprod-info-icon"></span>
<span class="seedprod-tooltip seedprod-tooltip-large"><?php esc_html_e( 'Create a custom Login page for your website.', 'coming-soon' ); ?></span>
</span>
</h3>
<div class="seedprod-setup-item-controls">
<?php if ( $is_lite_view ) : ?>
<?php echo wp_kses_post( seedprod_lite_v2_get_setup_item_upgrade( 'login-page' ) ); ?>
<?php else : ?>
<?php if ( $loginp_id && $loginp_active ) : ?>
<span class="seedprod-status-badge seedprod-status-active"><?php esc_html_e( 'ACTIVE', 'coming-soon' ); ?></span>
<?php elseif ( $loginp_id && ! $loginp_active ) : ?>
<span class="seedprod-status-badge seedprod-status-inactive"><?php esc_html_e( 'INACTIVE', 'coming-soon' ); ?></span>
<?php endif; ?>
<?php if ( $loginp_id ) : ?>
<label class="seedprod-switch">
<input type="checkbox" class="seedprod-toggle" data-mode="login" <?php checked( $loginp_active ); ?>>
<span class="seedprod-slider"></span>
</label>
<?php endif; ?>
<?php if ( ! $loginp_id ) : ?>
<a href="<?php echo esc_url( admin_url( 'admin.php?page=seedprod_lite_template_selection&type=loginp&name=' . rawurlencode( __( 'Login Page', 'coming-soon' ) ) . '&slug=login-page' ) ); ?>" class="button button-primary button-small seedprod-button-primary">
<?php esc_html_e( 'Setup', 'coming-soon' ); ?>
</a>
<?php else : ?>
<a href="<?php echo esc_url( admin_url( 'admin.php?page=seedprod_lite_builder&id=' . $loginp_id ) ); ?>" class="button button-small seedprod-button-secondary">
<?php esc_html_e( 'Edit', 'coming-soon' ); ?>
</a>
<a href="<?php echo esc_url( get_preview_post_link( $loginp_id ) ); ?>" target="_blank" class="button button-small seedprod-button-secondary">
<?php esc_html_e( 'Preview', 'coming-soon' ); ?>
</a>
<?php endif; ?>
<?php endif; ?>
</div>
</div>
</div>
</div>
<!-- 404 Page -->
<div class="seedprod-setup-item <?php echo $is_lite_view ? 'seedprod-pro-feature' : ''; ?>">
<span class="dashicons dashicons-warning seedprod-setup-icon <?php echo $p404_id && $p404_active ? 'active' : ''; ?>"></span>
<div class="seedprod-setup-item-content">
<div class="seedprod-setup-item-header">
<h3 class="seedprod-setup-item-title">
<span class="seedprod-setup-title-text">
<?php esc_html_e( '404 Page', 'coming-soon' ); ?>
<?php if ( $is_lite_view ) : ?>
<?php echo wp_kses_post( seedprod_lite_v2_get_pro_badge( 'inline' ) ); ?>
<span class="seedprod-pro-value"><?php esc_html_e( 'Convert lost visitors', 'coming-soon' ); ?></span>
<?php endif; ?>
<span class="dashicons dashicons-info seedprod-info-icon"></span>
<span class="seedprod-tooltip seedprod-tooltip-large"><?php esc_html_e( 'Create a custom 404 page for your website.', 'coming-soon' ); ?></span>
</span>
</h3>
<div class="seedprod-setup-item-controls">
<?php if ( $is_lite_view ) : ?>
<?php echo wp_kses_post( seedprod_lite_v2_get_setup_item_upgrade( '404-page' ) ); ?>
<?php else : ?>
<?php if ( $p404_id && $p404_active ) : ?>
<span class="seedprod-status-badge seedprod-status-active"><?php esc_html_e( 'ACTIVE', 'coming-soon' ); ?></span>
<?php elseif ( $p404_id && ! $p404_active ) : ?>
<span class="seedprod-status-badge seedprod-status-inactive"><?php esc_html_e( 'INACTIVE', 'coming-soon' ); ?></span>
<?php endif; ?>
<?php if ( $p404_id ) : ?>
<label class="seedprod-switch">
<input type="checkbox" class="seedprod-toggle" data-mode="404" <?php checked( $p404_active ); ?>>
<span class="seedprod-slider"></span>
</label>
<?php endif; ?>
<?php if ( ! $p404_id ) : ?>
<a href="<?php echo esc_url( admin_url( 'admin.php?page=seedprod_lite_template_selection&type=p404&name=' . rawurlencode( __( '404 Page', 'coming-soon' ) ) . '&slug=404-page' ) ); ?>" class="button button-primary button-small seedprod-button-primary">
<?php esc_html_e( 'Setup', 'coming-soon' ); ?>
</a>
<?php else : ?>
<a href="<?php echo esc_url( admin_url( 'admin.php?page=seedprod_lite_builder&id=' . $p404_id ) ); ?>" class="button button-small seedprod-button-secondary">
<?php esc_html_e( 'Edit', 'coming-soon' ); ?>
</a>
<a href="<?php echo esc_url( get_preview_post_link( $p404_id ) ); ?>" target="_blank" class="button button-small seedprod-button-secondary">
<?php esc_html_e( 'Preview', 'coming-soon' ); ?>
</a>
<?php endif; ?>
<?php endif; ?>
</div>
</div>
</div>
</div>
<!-- Subscribers Stat -->
<div class="seedprod-setup-item seedprod-subscribers-item <?php echo $is_lite_view ? 'seedprod-pro-feature' : ''; ?>">
<span class="dashicons dashicons-groups seedprod-setup-icon"></span>
<div class="seedprod-setup-item-content">
<div class="seedprod-setup-item-header">
<h3 class="seedprod-setup-item-title">
<span class="seedprod-setup-title-text">
<?php esc_html_e( 'Subscribers', 'coming-soon' ); ?>
<?php if ( $is_lite_view ) : ?>
<?php echo wp_kses_post( seedprod_lite_v2_get_pro_badge( 'inline' ) ); ?>
<span class="seedprod-pro-value"><?php esc_html_e( 'Grow your email list', 'coming-soon' ); ?></span>
<?php endif; ?>
</span>
</h3>
<div class="seedprod-setup-item-controls">
<?php if ( $is_lite_view ) : ?>
<?php echo wp_kses_post( seedprod_lite_v2_get_setup_item_upgrade( 'subscribers' ) ); ?>
<?php else : ?>
<span class="seedprod-subscriber-count">
<strong><?php echo esc_html( number_format( $total_subscribers ) ); ?></strong> <?php esc_html_e( 'total', 'coming-soon' ); ?>
<?php if ( $recent_subscribers > 0 ) : ?>
<span class="seedprod-stat-trend">+<?php echo esc_html( $recent_subscribers ); ?> <?php esc_html_e( 'this week', 'coming-soon' ); ?></span>
<?php endif; ?>
</span>
<?php if ( $total_subscribers > 0 ) : ?>
<a href="<?php echo esc_url( admin_url( 'admin.php?page=seedprod_lite_settings&tab=subscribers' ) ); ?>" class="button button-small seedprod-button-secondary">
<?php esc_html_e( 'View', 'coming-soon' ); ?>
</a>
<?php endif; ?>
<?php endif; ?>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Recommended Plugins Widget (Right) -->
<div class="postbox seedprod-card">
<h2 class="hndle">
<span class="dashicons dashicons-admin-plugins"></span>
<?php esc_html_e( 'Recommended Plugins', 'coming-soon' ); ?>
</h2>
<div class="inside">
<div class="seedprod-plugins-grid">
<?php
// Get dashboard specific recommended plugins.
$recommended_plugins = seedprod_lite_v2_get_dashboard_recommended_plugins();
foreach ( $recommended_plugins as $plugin_key => $plugin_info ) :
// Check if pro version is installed.
$has_pro = seedprod_lite_v2_has_pro_version( $plugin_key );
$button_text = seedprod_lite_v2_get_plugin_action_text( $plugin_info );
$button_class = '';
// Determine button class based on status.
if ( $has_pro ) {
$button_text = __( 'PRO Version Installed', 'coming-soon' );
$button_class = 'button-small button-disabled';
} elseif ( 1 === $plugin_info['status_code'] ) {
// Active - show deactivate as secondary button (WordPress .button + SeedProd modifier).
$button_class = 'button-small seedprod-button-secondary';
} elseif ( 2 === $plugin_info['status_code'] ) {
// Inactive - show activate as primary button (WordPress .button-primary + SeedProd modifier).
$button_class = 'button-primary button-small seedprod-button-primary';
} else {
// Not installed - show install as primary button (WordPress .button-primary + SeedProd modifier).
$button_class = 'button-primary button-small seedprod-button-primary';
}
?>
<div class="seedprod-plugin-card" data-plugin="<?php echo esc_attr( $plugin_key ); ?>">
<div class="seedprod-plugin-card-header">
<img src="<?php echo esc_url( $plugin_info['icon'] ); ?>" alt="<?php echo esc_attr( $plugin_info['name'] ); ?>" class="seedprod-plugin-icon">
<h4 class="seedprod-plugin-name"><?php echo esc_html( $plugin_info['name'] ); ?></h4>
</div>
<p class="seedprod-plugin-desc"><?php echo esc_html( $plugin_info['desc'] ); ?></p>
<div class="seedprod-plugin-action">
<?php if ( ! $has_pro ) : ?>
<button class="button <?php echo esc_attr( $button_class ); ?> seedprod-plugin-button"
data-plugin-slug="<?php echo esc_attr( $plugin_info['slug'] ); ?>"
data-plugin-id="<?php echo esc_attr( $plugin_key ); ?>"
data-status="<?php echo esc_attr( $plugin_info['status_code'] ); ?>">
<span class="button-text"><?php echo esc_html( $button_text ); ?></span>
<span class="button-spinner" style="display:none;">
<span class="dashicons dashicons-update-alt"></span>
</span>
</button>
<?php endif; ?>
</div>
</div>
<?php endforeach; ?>
</div>
<!-- View All Plugins Link -->
<div class="seedprod-plugins-footer">
<a href="<?php echo esc_url( admin_url( 'admin.php?page=seedprod_lite_settings&tab=recommended-plugins' ) ); ?>" class="seedprod-view-all-plugins">
<?php esc_html_e( 'View All Recommended Plugins', 'coming-soon' ); ?> →
</a>
</div>
</div>
</div>
</div>
<!-- Bottom row: Help & Resources | What's New -->
<div class="seedprod-dashboard-row">
<!-- Help & Resources Widget (Left) -->
<div class="postbox seedprod-card">
<h2 class="hndle">
<span class="dashicons dashicons-sos"></span>
<?php esc_html_e( 'Help & Resources', 'coming-soon' ); ?>
</h2>
<div class="inside">
<div class="seedprod-resources-list">
<!-- Documentation -->
<div class="seedprod-resource-item">
<span class="dashicons dashicons-book-alt seedprod-resource-icon"></span>
<div class="seedprod-resource-content">
<span class="seedprod-resource-title"><?php esc_html_e( 'Documentation', 'coming-soon' ); ?></span>
<a href="<?php echo esc_url( seedprod_lite_get_external_link( 'https://www.seedprod.com/docs/', 'dashboard-resources-docs', seedprod_lite_v2_is_lite_view() ? 'liteplugin' : 'proplugin' ) ); ?>" target="_blank" class="seedprod-resource-action">
<?php esc_html_e( 'View Docs', 'coming-soon' ); ?> →
</a>
</div>
</div>
<!-- Video Tutorials -->
<div class="seedprod-resource-item">
<span class="dashicons dashicons-video-alt3 seedprod-resource-icon"></span>
<div class="seedprod-resource-content">
<span class="seedprod-resource-title"><?php esc_html_e( 'Video Tutorials', 'coming-soon' ); ?></span>
<a href="https://www.youtube.com/seedprod" target="_blank" class="seedprod-resource-action">
<?php esc_html_e( 'Watch Videos', 'coming-soon' ); ?> →
</a>
</div>
</div>
<!-- Support Center -->
<div class="seedprod-resource-item">
<span class="dashicons dashicons-editor-help seedprod-resource-icon"></span>
<div class="seedprod-resource-content">
<span class="seedprod-resource-title"><?php esc_html_e( 'Support Center', 'coming-soon' ); ?></span>
<a href="<?php echo esc_url( seedprod_lite_get_support_link( '', 'WordPress', 'dashboard-resources' ) ); ?>" target="_blank" class="seedprod-resource-action">
<?php esc_html_e( 'Get Help', 'coming-soon' ); ?> →
</a>
</div>
</div>
<!-- Community -->
<div class="seedprod-resource-item">
<span class="dashicons dashicons-groups seedprod-resource-icon"></span>
<div class="seedprod-resource-content">
<span class="seedprod-resource-title"><?php esc_html_e( 'Community', 'coming-soon' ); ?></span>
<a href="https://www.facebook.com/groups/wpbeginner" target="_blank" class="seedprod-resource-action">
<?php esc_html_e( 'Join Community', 'coming-soon' ); ?> →
</a>
</div>
</div>
<!-- Request a Feature -->
<div class="seedprod-resource-item">
<span class="dashicons dashicons-admin-comments seedprod-resource-icon"></span>
<div class="seedprod-resource-content">
<span class="seedprod-resource-title"><?php esc_html_e( 'Request a Feature', 'coming-soon' ); ?></span>
<a href="<?php echo esc_url( seedprod_lite_get_external_link( 'https://www.seedprod.com/suggest-a-feature/', 'plugin-dashboard', 'suggest-a-feature' ) ); ?>" target="_blank" class="seedprod-resource-action">
<?php esc_html_e( 'Suggest', 'coming-soon' ); ?> →
</a>
</div>
</div>
<!-- Settings -->
<div class="seedprod-resource-item">
<span class="dashicons dashicons-admin-generic seedprod-resource-icon"></span>
<div class="seedprod-resource-content">
<span class="seedprod-resource-title"><?php esc_html_e( 'Settings', 'coming-soon' ); ?></span>
<a href="<?php echo esc_url( admin_url( 'admin.php?page=seedprod_lite_settings' ) ); ?>" class="seedprod-resource-action">
<?php esc_html_e( 'Manage', 'coming-soon' ); ?> →
</a>
</div>
</div>
<!-- Changelog -->
<div class="seedprod-resource-item">
<span class="dashicons dashicons-megaphone seedprod-resource-icon"></span>
<div class="seedprod-resource-content">
<span class="seedprod-resource-title"><?php esc_html_e( 'Changelog', 'coming-soon' ); ?></span>
<a href="<?php echo esc_url( seedprod_lite_get_external_link( 'https://www.seedprod.com/docs/changelog/', 'dashboard-resources-changelog', seedprod_lite_v2_is_lite_view() ? 'liteplugin' : 'proplugin' ) ); ?>" target="_blank" class="seedprod-resource-action">
<?php esc_html_e( 'View Updates', 'coming-soon' ); ?> →
</a>
</div>
</div>
</div>
<!-- Fun Fact -->
<div class="seedprod-fun-fact">
<div class="seedprod-fun-fact-content">
<span class="dashicons dashicons-lightbulb"></span>
<p>
<strong><?php esc_html_e( 'Did You Know?', 'coming-soon' ); ?></strong>
<?php esc_html_e( "We've been part of the WordPress community since 2011, growing from a simple coming soon plugin to help over 1 million users build beautiful websites!", 'coming-soon' ); ?>
<a href="<?php echo esc_url( admin_url( 'admin.php?page=seedprod_lite_settings&tab=about' ) ); ?>" style="margin-left: 5px;">
<?php esc_html_e( 'Learn More →', 'coming-soon' ); ?>
</a>
</p>
</div>
</div>
</div>
</div>
<!-- What's New Widget (Right) -->
<div class="postbox seedprod-card">
<h2 class="hndle">
<span class="dashicons dashicons-megaphone"></span>
<?php esc_html_e( "What's New", 'coming-soon' ); ?>
</h2>
<div class="inside">
<?php
// Get only 2 news items from RSS feed.
$news_items = seedprod_lite_v2_get_news_feed( 2 ); if ( ! empty( $news_items ) ) :
?>
<div class="seedprod-news-items">
<?php foreach ( $news_items as $item ) : ?>
<div class="seedprod-news-item <?php echo ! empty( $item['thumbnail'] ) ? 'has-thumbnail' : ''; ?>">
<?php if ( ! empty( $item['thumbnail'] ) ) : ?>
<div class="seedprod-news-thumbnail">
<img src="<?php echo esc_url( $item['thumbnail'] ); ?>" alt="<?php echo esc_attr( $item['title'] ); ?>" />
</div>
<?php endif; ?>
<div class="seedprod-news-content">
<h4><?php echo wp_kses_post( $item['title'] ); ?></h4>
<?php if ( ! empty( $item['description'] ) ) : ?>
<p class="seedprod-news-excerpt"><?php echo wp_kses_post( $item['description'] ); ?></p>
<?php endif; ?>
<div class="seedprod-news-meta">
<?php if ( ! empty( $item['date'] ) ) : ?>
<span class="seedprod-news-date"><?php echo esc_html( $item['date'] ); ?></span>
<?php endif; ?>
<a href="<?php echo esc_url( $item['link'] ); ?>" target="_blank" rel="noopener">
<?php esc_html_e( 'Read More →', 'coming-soon' ); ?>
</a>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
<div class="seedprod-news-footer">
<a href="<?php echo esc_url( seedprod_lite_get_external_link( 'https://www.seedprod.com/blog/', 'dashboard-blog-header', seedprod_lite_v2_is_lite_view() ? 'liteplugin' : 'proplugin' ) ); ?>" target="_blank" rel="noopener" class="seedprod-view-all-link">
<?php esc_html_e( 'View All Articles →', 'coming-soon' ); ?>
</a>
</div>
<?php else : ?>
<p><?php esc_html_e( 'Stay updated with the latest features and tips!', 'coming-soon' ); ?></p>
<a href="<?php echo esc_url( seedprod_lite_get_external_link( 'https://www.seedprod.com/blog/', 'dashboard-blog-button', seedprod_lite_v2_is_lite_view() ? 'liteplugin' : 'proplugin' ) ); ?>" target="_blank" rel="noopener" class="button button-secondary">
<?php esc_html_e( 'Visit Our Blog', 'coming-soon' ); ?>
</a>
<?php endif; ?>
</div>
</div>
</div>
</div>
<?php endif; ?>
</div>
</div>
<!-- Wizard Completion Modal (shown via JavaScript if wizard_id detected) -->
<div id="seedprod-wizard-completion-modal" class="seedprod-modal-overlay" style="display: none;">
<div class="seedprod-modal-content">
<!-- Processing State -->
<div id="seedprod-wizard-processing" class="seedprod-wizard-state">
<h2><?php esc_html_e( 'Finishing Up!', 'coming-soon' ); ?></h2>
<p><?php esc_html_e( 'Please do not refresh or exit this page until this process is complete.', 'coming-soon' ); ?></p>
<div class="seedprod-spinner-wrapper">
<span class="spinner is-active"></span>
</div>
</div>
<!-- Plugin Installation State -->
<div id="seedprod-wizard-plugins" class="seedprod-wizard-state" style="display: none;">
<h2><?php esc_html_e( 'Setup Almost Complete!', 'coming-soon' ); ?></h2>
<p><?php esc_html_e( 'We recommend installing these free plugins:', 'coming-soon' ); ?></p>
<div id="seedprod-recommended-plugins-list"></div>
<div class="seedprod-modal-buttons">
<button id="seedprod-install-plugins" class="button button-primary">
<?php esc_html_e( 'Install & Activate Now', 'coming-soon' ); ?>
</button>
<button id="seedprod-skip-plugins" class="button button-secondary">
<?php esc_html_e( "I'll do it later", 'coming-soon' ); ?>
</button>
</div>
</div>
<!-- Success State -->
<div id="seedprod-wizard-success" class="seedprod-wizard-state" style="display: none;">
<h2><?php esc_html_e( '🎉 Setup Complete!', 'coming-soon' ); ?></h2>
<p id="seedprod-success-message"></p>
<div class="seedprod-modal-buttons">
<a id="seedprod-edit-page-button" href="#" class="button button-primary">
<?php esc_html_e( 'Finish Setup', 'coming-soon' ); ?>
</a>
<a href="<?php echo esc_url( admin_url( 'admin.php?page=seedprod_lite' ) ); ?>" class="button button-secondary">
<?php esc_html_e( 'Go to Dashboard', 'coming-soon' ); ?>
</a>
</div>
</div>
<!-- Error State -->
<div id="seedprod-wizard-error" class="seedprod-wizard-state" style="display: none;">
<h2><?php esc_html_e( 'Setup Error', 'coming-soon' ); ?></h2>
<p id="seedprod-error-message"></p>
<div class="seedprod-modal-buttons">
<a href="<?php echo esc_url( admin_url( 'admin.php?page=seedprod_lite' ) ); ?>" class="button button-primary">
<?php esc_html_e( 'Go to Dashboard', 'coming-soon' ); ?>
</a>
</div>
</div>
</div>
</div>
<script>
jQuery(document).ready(function($) {
// Check for wizard ID in multiple formats
var wizardId = '<?php echo esc_js( $wizard_id ); ?>'; // Query parameter format
// Check for hash format (Laravel returns: #/setup/{wizard_id})
if (!wizardId && window.location.hash) {
var hashMatch = window.location.hash.match(/#\/setup\/(\d+)/);
if (hashMatch && hashMatch[1]) {
wizardId = hashMatch[1];
}
}
if (wizardId) {
// Show modal immediately
$('#seedprod-wizard-completion-modal').show();
$('#seedprod-wizard-processing').show();
// Call complete setup wizard
$.ajax({
url: ajaxurl,
type: 'POST',
data: {
action: 'seedprod_lite_v2_complete_setup_wizard',
wizard_id: wizardId,
_ajax_nonce: '<?php echo esc_js( wp_create_nonce( 'seedprod_lite_v2_complete_setup_wizard' ) ); ?>'
},
success: function(response) {
if (response.success) {
handleWizardSuccess(response.data);
} else {
showWizardError(response.data ? response.data.message : '<?php esc_html_e( 'There was an issue completing the setup. Please refresh the page and try again.', 'coming-soon' ); ?>');
}
},
error: function() {
showWizardError('<?php esc_html_e( 'Connection error. Please refresh the page and try again.', 'coming-soon' ); ?>');
}
});
}
function handleWizardSuccess(data) {
// Hide processing
$('#seedprod-wizard-processing').hide();
// Check if there are plugins to install
if (data.options && data.options.length > 0) {
showPluginOptions(data);
} else {
showSuccessState(data);
}
}
function showPluginOptions(data) {
// Store data for later use
window.wizardData = data;
// Parse plugin options
var plugins = [];
if (data.options.includes('rafflepress')) plugins.push('RafflePress');
if (data.options.includes('allinoneseo')) plugins.push('All in One SEO');
if (data.options.includes('wpforms')) plugins.push('WPForms');
if (data.options.includes('optinmonster')) plugins.push('OptinMonster');
if (data.options.includes('ga')) plugins.push('MonsterInsights');
if (plugins.length > 0) {
$('#seedprod-recommended-plugins-list').html('<ul><li>' + plugins.join('</li><li>') + '</li></ul>');
$('#seedprod-wizard-plugins').show();
} else {
showSuccessState(data);
}
}
function showSuccessState(data) {
$('#seedprod-wizard-plugins').hide();
// Set success message based on page type
var message = '<?php esc_html_e( 'Your page has been created successfully!', 'coming-soon' ); ?>';
if (data.page_type) {
switch(data.page_type) {
case 'cs':
message = '<?php esc_html_e( 'Your Coming Soon page is ready!', 'coming-soon' ); ?>';
break;
case 'mm':
message = '<?php esc_html_e( 'Your Maintenance Mode page is ready!', 'coming-soon' ); ?>';
break;
case 'p404':
message = '<?php esc_html_e( 'Your 404 page is ready!', 'coming-soon' ); ?>';
break;
case 'loginpage':
message = '<?php esc_html_e( 'Your Login page is ready!', 'coming-soon' ); ?>';
break;
}
}
$('#seedprod-success-message').text(message);
// Set edit button URL if page was created
if (data.id) {
var editUrl = '<?php echo esc_js( admin_url( 'admin.php' ) ); ?>?page=seedprod_lite_builder&id=' + data.id;
$('#seedprod-edit-page-button').attr('href', editUrl).show();
} else {
$('#seedprod-edit-page-button').hide();
}
$('#seedprod-wizard-success').show();
// Remove wizard_id from URL without reload (handles both query param and hash format)
if (window.history && window.history.replaceState) {
var newUrl = window.location.href.replace(/[?&]wizard_id=[^&]+/, '').replace(/#\/setup\/\d+/, '');
window.history.replaceState({}, document.title, newUrl);
}
}
function showWizardError(message) {
$('#seedprod-wizard-processing').hide();
$('#seedprod-wizard-plugins').hide();
$('#seedprod-error-message').text(message);
$('#seedprod-wizard-error').show();
}
// Install plugins button
$('#seedprod-install-plugins').on('click', function() {
var $button = $(this);
$button.prop('disabled', true).text('<?php esc_html_e( 'Installing...', 'coming-soon' ); ?>');
// Call install addon setup
$.ajax({
url: ajaxurl,
type: 'POST',
data: {
action: 'seedprod_lite_v2_install_addon_setup',
plugins: window.wizardData.options,
nonce: '<?php echo esc_js( wp_create_nonce( 'seedprod_lite_v2_install_addon_setup' ) ); ?>'
},
success: function(response) {
if (response.success) {
showSuccessState(window.wizardData);
} else {
alert('<?php esc_html_e( 'There was an error installing the plugins.', 'coming-soon' ); ?>');
showSuccessState(window.wizardData);
}
},
error: function() {
alert('<?php esc_html_e( 'There was an error installing the plugins.', 'coming-soon' ); ?>');
showSuccessState(window.wizardData);
}
});
});
// Skip plugins button
$('#seedprod-skip-plugins').on('click', function() {
showSuccessState(window.wizardData);
});
});
</script>
seedprod-admin-theme-kits-selection.php 0000644 00000022256 15233474616 0014225 0 ustar 00 <?php
/**
* Theme Kits Selection Page
*
* Native WordPress implementation of the theme kits selector
* Based on the landing page template selector but for complete theme kits
*
* @package SeedProd_Lite
*/
// Exit if accessed directly.
if ( ! defined( 'WPINC' ) ) {
die;
}
// Get active tab.
$active_tab = isset( $_GET['tab'] ) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : 'all-templates'; // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Read-only parameter for tab display.
?>
<div class="seedprod-dashboard-page seedprod-theme-kits-selection-page">
<?php
// Include header with page title.
$page_title = __( 'Choose a Website Theme Kit', 'coming-soon' );
require_once plugin_dir_path( __FILE__ ) . 'seedprod-admin-header.php';
?>
<div class="seedprod-dashboard-container">
<!-- WordPress Native Tabs -->
<nav class="nav-tab-wrapper">
<a href="?page=seedprod_lite_theme_kits_selection&tab=all-templates"
class="nav-tab <?php echo 'all-templates' === $active_tab ? 'nav-tab-active' : ''; ?>">
<?php esc_html_e( 'All Themes', 'coming-soon' ); ?>
</a>
<a href="?page=seedprod_lite_theme_kits_selection&tab=favorite-templates"
class="nav-tab <?php echo 'favorite-templates' === $active_tab ? 'nav-tab-active' : ''; ?>">
<?php esc_html_e( 'Favorite Themes', 'coming-soon' ); ?>
</a>
</nav>
<div class="seedprod-template-content">
<?php if ( 'all-templates' === $active_tab ) : ?>
<!-- All Templates Tab -->
<div class="seedprod-template-filters">
<div class="seedprod-template-search">
<input type="text"
id="seedprod-template-search"
placeholder="<?php esc_attr_e( 'Search theme kits...', 'coming-soon' ); ?>"
class="seedprod-search-input" />
<span class="dashicons dashicons-search"></span>
</div>
<div class="seedprod-filters-section">
<span class="seedprod-filters-label"><?php esc_html_e( 'Filters:', 'coming-soon' ); ?></span>
<div class="seedprod-filter-pills">
<button class="seedprod-filter-pill active" data-filter="all">
<?php esc_html_e( 'All', 'coming-soon' ); ?>
</button>
<button class="seedprod-filter-pill" data-filter="woocommerce">
<?php esc_html_e( 'WooCommerce', 'coming-soon' ); ?>
</button>
</div>
<span class="seedprod-sort-label"><?php esc_html_e( 'Sort:', 'coming-soon' ); ?></span>
<select id="seedprod-theme-sort" class="seedprod-sort-select">
<option value=""><?php esc_html_e( 'Default', 'coming-soon' ); ?></option>
<option value="popular"><?php esc_html_e( 'Popular', 'coming-soon' ); ?></option>
<option value="new"><?php esc_html_e( 'Newest to Oldest', 'coming-soon' ); ?></option>
<option value="old"><?php esc_html_e( 'Oldest to Newest', 'coming-soon' ); ?></option>
</select>
</div>
</div>
<div class="seedprod-theme-kits-grid" id="all-themes-grid">
<!-- Theme kits will be loaded here via AJAX -->
<div class="seedprod-templates-loading">
<span class="spinner is-active"></span>
<p><?php esc_html_e( 'Loading theme kits...', 'coming-soon' ); ?></p>
</div>
</div>
<!-- Pagination -->
<div class="seedprod-themes-pagination" style="display: none;">
<button class="button seedprod-pagination-btn" id="seedprod-first-page" disabled>
<span class="dashicons dashicons-controls-skipback"></span>
<?php esc_html_e( 'First Page', 'coming-soon' ); ?>
</button>
<button class="button seedprod-pagination-btn" id="seedprod-prev-page" disabled>
<span class="dashicons dashicons-arrow-left-alt2"></span>
<?php esc_html_e( 'Prev', 'coming-soon' ); ?>
</button>
<span class="seedprod-page-info">
<?php esc_html_e( 'Page', 'coming-soon' ); ?>
<span id="seedprod-current-page">1</span>
<?php esc_html_e( 'of', 'coming-soon' ); ?>
<span id="seedprod-total-pages">1</span>
</span>
<button class="button seedprod-pagination-btn" id="seedprod-next-page">
<?php esc_html_e( 'Next', 'coming-soon' ); ?>
<span class="dashicons dashicons-arrow-right-alt2"></span>
</button>
<button class="button seedprod-pagination-btn" id="seedprod-last-page">
<?php esc_html_e( 'Last Page', 'coming-soon' ); ?>
<span class="dashicons dashicons-controls-skipforward"></span>
</button>
</div>
<?php elseif ( 'favorite-templates' === $active_tab ) : ?>
<!-- Favorite Templates Tab -->
<div class="seedprod-template-filters">
<div class="seedprod-template-search">
<input type="text"
id="seedprod-template-search"
placeholder="<?php esc_attr_e( 'Search favorite theme kits...', 'coming-soon' ); ?>"
class="seedprod-search-input" />
<span class="dashicons dashicons-search"></span>
</div>
</div>
<div class="seedprod-theme-kits-grid" id="favorite-themes-grid">
<div class="seedprod-templates-loading">
<span class="spinner is-active"></span>
<p><?php esc_html_e( 'Loading favorite theme kits...', 'coming-soon' ); ?></p>
</div>
</div>
<!-- Pagination for favorites -->
<div class="seedprod-themes-pagination" style="display: none;">
<button class="button seedprod-pagination-btn" id="seedprod-first-page" disabled>
<span class="dashicons dashicons-controls-skipback"></span>
<?php esc_html_e( 'First Page', 'coming-soon' ); ?>
</button>
<button class="button seedprod-pagination-btn" id="seedprod-prev-page" disabled>
<span class="dashicons dashicons-arrow-left-alt2"></span>
<?php esc_html_e( 'Prev', 'coming-soon' ); ?>
</button>
<span class="seedprod-page-info">
<?php esc_html_e( 'Page', 'coming-soon' ); ?>
<span id="seedprod-current-page">1</span>
<?php esc_html_e( 'of', 'coming-soon' ); ?>
<span id="seedprod-total-pages">1</span>
</span>
<button class="button seedprod-pagination-btn" id="seedprod-next-page">
<?php esc_html_e( 'Next', 'coming-soon' ); ?>
<span class="dashicons dashicons-arrow-right-alt2"></span>
</button>
<button class="button seedprod-pagination-btn" id="seedprod-last-page">
<?php esc_html_e( 'Last Page', 'coming-soon' ); ?>
<span class="dashicons dashicons-controls-skipforward"></span>
</button>
</div>
<?php endif; ?>
</div>
</div>
</div>
<!-- Theme Kit Preview Modal -->
<div id="seedprod-template-preview-modal" style="display: none;">
<div class="seedprod-modal-overlay"></div>
<div class="seedprod-modal-content">
<div class="seedprod-modal-header">
<div class="seedprod-modal-header-left">
<h2 id="seedprod-preview-title"><?php esc_html_e( 'Theme Kit Preview', 'coming-soon' ); ?></h2>
</div>
<div class="seedprod-modal-header-right">
<button class="seedprod-modal-close">
<span class="dashicons dashicons-no"></span>
</button>
</div>
</div>
<div class="seedprod-modal-body">
<iframe id="seedprod-preview-iframe" src="" frameborder="0"></iframe>
</div>
</div>
</div>
<!-- Theme Import Confirmation Modal -->
<div id="seedprod-theme-import-modal" style="display: none;">
<div class="seedprod-modal-overlay"></div>
<div class="seedprod-modal-content seedprod-modal-small">
<div class="seedprod-modal-header">
<h2><?php esc_html_e( 'Import Theme Kit', 'coming-soon' ); ?></h2>
<button class="seedprod-modal-close">
<span class="dashicons dashicons-no"></span>
</button>
</div>
<div class="seedprod-modal-body">
<p class="seedprod-import-warning">
<?php esc_html_e( 'This will import all templates from this theme kit. Any existing theme templates with the same names will be replaced.', 'coming-soon' ); ?>
</p>
<p>
<strong><?php esc_html_e( 'Theme Kit:', 'coming-soon' ); ?></strong>
<span id="seedprod-import-theme-name"></span>
</p>
<p><?php esc_html_e( 'Would you like to continue?', 'coming-soon' ); ?></p>
</div>
<div class="seedprod-modal-footer">
<button class="button seedprod-modal-cancel">
<?php esc_html_e( 'Cancel', 'coming-soon' ); ?>
</button>
<button class="button button-primary" id="seedprod-confirm-import-btn">
<span class="button-text"><?php esc_html_e( 'Import Theme Kit', 'coming-soon' ); ?></span>
<span class="spinner" style="display: none;"></span>
</button>
</div>
</div>
</div>
<script>
// Store theme kits data
var seedprodThemeKitsData = {
activeTab: <?php echo wp_json_encode( $active_tab ); ?>,
ajaxUrl: <?php echo wp_json_encode( admin_url( 'admin-ajax.php' ) ); ?>,
nonce: <?php echo wp_json_encode( wp_create_nonce( 'seedprod_v2_nonce' ) ); ?>,
currentPage: 1,
totalPages: 1,
currentFilter: 'all',
currentSort: '',
searchTerm: ''
};
// Add missing strings for JavaScript
var seedprod_admin = window.seedprod_admin || {};
seedprod_admin.strings = seedprod_admin.strings || {};
seedprod_admin.strings.loading_templates = <?php echo wp_json_encode( __( 'Loading theme kits...', 'coming-soon' ) ); ?>;
seedprod_admin.strings.no_templates_found = <?php echo wp_json_encode( __( 'No theme kits found.', 'coming-soon' ) ); ?>;
seedprod_admin.strings.error_loading_templates = <?php echo wp_json_encode( __( 'Error loading theme kits. Please try again.', 'coming-soon' ) ); ?>;
</script>
seedprod-admin-product-education.php 0000644 00000016376 15233474616 0013627 0 ustar 00 <?php
/**
* Product Education page template
*
* This template displays educational content for Pro features to Lite users.
* It expects a $product_education_config array to be set with the following keys:
* - feature_name: Name of the feature (e.g., 'Website Builder')
* - headline: Main headline text
* - subheadline: Subtitle text
* - description: Detailed description paragraph
* - benefits: Array of benefit strings
* - features: Array of feature highlights
* - image: Image filename or path
* - video_url: Optional video URL
* - testimonial: Optional testimonial array with 'text', 'author', 'company'
* - cta_headline: Call-to-action headline
* - feature_slug: Feature identifier for tracking
*
* @package SeedProd
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Ensure config is set.
if ( ! isset( $product_education_config ) ) {
return;
}
// Extract config for easier use.
$config = $product_education_config;
// Get upgrade URL with proper tracking.
if ( isset( $config['use_exact_utm_medium'] ) && true === $config['use_exact_utm_medium'] ) {
// Use exact UTM medium without 'plugin' prefix for legacy tracking compatibility.
$medium = isset( $config['cta_context'] ) ? $config['cta_context'] : 'product-education';
$upgrade_url = seedprod_lite_get_external_link(
'https://www.seedprod.com/lite-upgrade/',
$medium,
'liteplugin'
);
// Add utm_content if feature_slug is set.
if ( ! empty( $config['feature_slug'] ) ) {
$upgrade_url = add_query_arg( 'utm_content', $config['feature_slug'], $upgrade_url );
}
} else {
// Default: use the standard function which adds 'plugin' prefix.
$context = isset( $config['cta_context'] ) ? $config['cta_context'] : 'product-education';
$upgrade_url = seedprod_lite_v2_get_upgrade_url( $config['feature_slug'], $context );
}
?>
<div class="seedprod-product-education-page">
<div class="postbox seedprod-card">
<div class="inside">
<!-- Main 50-50 Layout Container -->
<div class="seedprod-product-education-main">
<!-- Left Column -->
<div class="seedprod-product-education-left">
<!-- PRO Feature Badge -->
<div class="seedprod-product-education-badge">
<span class="dashicons dashicons-lock"></span>
<span class="seedprod-product-education-badge-text">
<strong><?php esc_html_e( 'PRO Feature', 'coming-soon' ); ?></strong>
</span>
</div>
<!-- Headline -->
<h1><?php echo esc_html( $config['headline'] ); ?></h1>
<!-- Subheadline -->
<p class="seedprod-product-education-subtitle">
<?php echo esc_html( $config['subheadline'] ); ?>
</p>
<!-- Description -->
<?php if ( ! empty( $config['description'] ) ) : ?>
<p class="seedprod-product-education-description">
<?php echo esc_html( $config['description'] ); ?>
</p>
<?php endif; ?>
<!-- Benefits List -->
<?php if ( ! empty( $config['benefits'] ) ) : ?>
<div class="seedprod-product-education-benefits">
<ul>
<?php foreach ( $config['benefits'] as $benefit ) : ?>
<li>
<span class="dashicons dashicons-yes-alt"></span>
<?php echo esc_html( $benefit ); ?>
</li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>
<!-- CTA Button -->
<div class="seedprod-product-education-cta">
<a href="<?php echo esc_url( $upgrade_url ); ?>"
target="_blank"
rel="noopener"
class="button button-hero seedprod-upgrade-button">
<span class="dashicons dashicons-star-filled seedprod-upgrade-icon"></span>
<?php
// Use custom button text if provided, otherwise default to "Unlock [Feature]".
if ( ! empty( $config['primary_button']['text'] ) ) {
$button_text = $config['primary_button']['text'];
} else {
/* translators: %s: Feature name (e.g., Website Builder, Login Page) */
$button_text = sprintf( __( 'Unlock %s', 'coming-soon' ), $config['feature_name'] );
}
echo esc_html( $button_text );
?>
</a>
<?php // Secondary button (optional) - for alternative actions like community support. ?>
<?php if ( ! empty( $config['secondary_button'] ) ) : ?>
<a href="<?php echo esc_url( $config['secondary_button']['url'] ); ?>"
<?php echo ! empty( $config['secondary_button']['new_tab'] ) ? 'target="_blank" rel="noopener"' : ''; ?>
class="button button-hero seedprod-button-secondary seedprod-secondary-button">
<?php if ( ! empty( $config['secondary_button']['icon'] ) ) : ?>
<span class="dashicons <?php echo esc_attr( $config['secondary_button']['icon'] ); ?>"></span>
<?php endif; ?>
<?php echo esc_html( $config['secondary_button']['text'] ); ?>
</a>
<?php endif; ?>
<p class="seedprod-product-education-guarantee">
<span class="dashicons dashicons-shield"></span>
<?php esc_html_e( '14-Day Money Back Guarantee', 'coming-soon' ); ?>
</p>
</div>
</div>
<!-- Right Column -->
<div class="seedprod-product-education-right">
<!-- Hero Image/Video -->
<?php if ( ! empty( $config['video_url'] ) ) : ?>
<div class="seedprod-product-education-video">
<iframe src="<?php echo esc_url( $config['video_url'] ); ?>"
frameborder="0"
allowfullscreen
title="<?php echo esc_attr( $config['feature_name'] . ' Demo' ); ?>">
</iframe>
</div>
<?php elseif ( ! empty( $config['image'] ) ) : ?>
<?php if ( ! empty( $config['image_link'] ) ) : ?>
<a href="<?php echo esc_url( $config['image_link'] ); ?>" target="_blank" rel="noopener">
<?php endif; ?>
<img src="<?php echo esc_url( plugin_dir_url( __DIR__ ) . 'images/' . $config['image'] ); ?>"
alt="<?php echo esc_attr( $config['feature_name'] ); ?>"
class="seedprod-product-education-screenshot">
<?php if ( ! empty( $config['image_link'] ) ) : ?>
</a>
<div class="seedprod-template-link-wrapper" style="text-align: center; margin-top: 15px;">
<a href="<?php echo esc_url( $config['image_link'] ); ?>" target="_blank" rel="noopener" class="seedprod-template-link" style="color: #E14E1B; font-size: 16px; font-weight: 500; text-decoration: none;">
<?php esc_html_e( 'Browse 350+ Website Templates', 'coming-soon' ); ?> →
</a>
</div>
<?php endif; ?>
<?php endif; ?>
</div>
</div>
<!-- Bottom Full Width Section -->
<div class="seedprod-product-education-bottom">
<!-- Testimonial Section -->
<?php if ( ! empty( $config['testimonial'] ) ) : ?>
<div class="seedprod-product-education-testimonial">
<blockquote>
<p>"<?php echo esc_html( $config['testimonial']['text'] ); ?>"</p>
<cite>
<strong><?php echo esc_html( $config['testimonial']['author'] ); ?></strong>
<?php if ( ! empty( $config['testimonial']['company'] ) ) : ?>
<span> - <?php echo esc_html( $config['testimonial']['company'] ); ?></span>
<?php endif; ?>
</cite>
</blockquote>
</div>
<?php endif; ?>
<!-- Social Proof -->
<p class="seedprod-product-education-users">
<?php esc_html_e( 'Join 1,000,000+ professionals using SeedProd', 'coming-soon' ); ?>
</p>
</div>
</div>
</div>
</div>
seedprod-admin-landing-pages.php 0000644 00000071473 15233474616 0012706 0 ustar 00 <?php
/**
* Landing Pages Management Page
*
* @package SeedProd_Lite
* @subpackage SeedProd_Lite/admin/partials
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Load admin functions if not already loaded.
if ( ! function_exists( 'seedprod_lite_v2_is_lite_view' ) ) {
require_once plugin_dir_path( __DIR__ ) . 'admin-functions.php';
}
// Check if we're in Lite view.
$is_lite_view = seedprod_lite_v2_is_lite_view();
// Get current settings (stored as JSON string).
$settings_json = get_option( 'seedprod_settings' );
if ( ! empty( $settings_json ) ) {
$settings = json_decode( $settings_json, true );
if ( ! is_array( $settings ) ) {
$settings = array();
}
} else {
$settings = array();
}
// Get Coming Soon page info.
$csp_id = get_option( 'seedprod_coming_soon_page_id' );
$csp_active = ! empty( $settings['enable_coming_soon_mode'] );
// Get Maintenance Mode page info.
$mmp_id = get_option( 'seedprod_maintenance_mode_page_id' );
$mmp_active = ! empty( $settings['enable_maintenance_mode'] );
// Get Login page info.
$loginp_id = get_option( 'seedprod_login_page_id' );
$loginp_active = ! empty( $settings['enable_login_mode'] );
// Get 404 page info.
$p404_id = get_option( 'seedprod_404_page_id' );
$p404_active = ! empty( $settings['enable_404_mode'] );
// Load the table class.
require_once plugin_dir_path( __DIR__ ) . 'includes/class-seedprod-landing-pages-table.php';
// Create an instance of our table class.
$landing_pages_table = new SeedProd_Landing_Pages_Table();
// Prepare table items.
$landing_pages_table->prepare_items();
?>
<div class="seedprod-dashboard-page seedprod-landing-pages-page <?php echo $is_lite_view ? 'seedprod-lite' : ''; ?>">
<?php
// Include header.
$page_title = __( 'Landing Pages', 'coming-soon' );
require_once plugin_dir_path( __FILE__ ) . 'seedprod-admin-header.php';
?>
<div class="seedprod-dashboard-container">
<!-- Special Pages Section -->
<h2 class="seedprod-section-title"><?php esc_html_e( 'Website Mode Pages', 'coming-soon' ); ?></h2>
<p class="seedprod-section-description"><?php esc_html_e( 'Control what visitors see when your site is coming soon, under maintenance, or when they need to log in.', 'coming-soon' ); ?></p>
<!-- Mode Cards Section -->
<div class="seedprod-mode-cards-grid">
<!-- Coming Soon Mode Card -->
<div class="postbox seedprod-card seedprod-mode-card" data-mode="coming_soon">
<div class="inside">
<div class="seedprod-mode-card-icon">
<img src="<?php echo esc_url( plugin_dir_url( __DIR__ ) . 'images/cs-page.svg' ); ?>" alt="<?php esc_attr_e( 'Coming Soon Mode', 'coming-soon' ); ?>" />
</div>
<h3 class="seedprod-mode-card-title"><?php esc_html_e( 'Coming Soon Mode', 'coming-soon' ); ?></h3>
<p class="seedprod-mode-card-description">
<?php esc_html_e( 'The Coming Soon Page will be available to search engines if your site is not private.', 'coming-soon' ); ?>
</p>
<div class="seedprod-mode-card-actions">
<?php if ( ! $csp_id ) : ?>
<a href="<?php echo esc_url( admin_url( 'admin.php?page=seedprod_lite_template_selection&type=cs&name=' . rawurlencode( __( 'Coming Soon Page', 'coming-soon' ) ) . '&slug=coming-soon-page' ) ); ?>" class="button button-primary seedprod-button-primary">
<?php esc_html_e( 'Set up Coming Soon Page', 'coming-soon' ); ?>
</a>
<?php else : ?>
<a href="<?php echo esc_url( admin_url( 'admin.php?page=seedprod_lite_builder&id=' . $csp_id ) ); ?>" class="button button-primary seedprod-button-primary">
<?php esc_html_e( 'Edit Page', 'coming-soon' ); ?>
</a>
<a href="<?php echo esc_url( get_preview_post_link( $csp_id ) ); ?>" target="_blank" class="button seedprod-button-secondary">
<?php esc_html_e( 'Preview', 'coming-soon' ); ?>
</a>
<?php endif; ?>
</div>
<?php if ( $csp_id ) : ?>
<div class="seedprod-mode-card-toggle">
<label class="seedprod-switch">
<input type="checkbox" class="seedprod-toggle" data-mode="coming_soon" <?php checked( $csp_active ); ?>>
<span class="seedprod-slider"></span>
</label>
<span class="seedprod-toggle-label">
<?php if ( $csp_active ) : ?>
<span class="active"><?php esc_html_e( 'ACTIVE', 'coming-soon' ); ?></span>
<?php else : ?>
<span class="inactive"><?php esc_html_e( 'INACTIVE', 'coming-soon' ); ?></span>
<?php endif; ?>
</span>
</div>
<?php endif; ?>
</div>
</div>
<!-- Maintenance Mode Card -->
<div class="postbox seedprod-card seedprod-mode-card" data-mode="maintenance">
<div class="inside">
<div class="seedprod-mode-card-icon">
<img src="<?php echo esc_url( plugin_dir_url( __DIR__ ) . 'images/mm-page.svg' ); ?>" alt="<?php esc_attr_e( 'Maintenance Mode', 'coming-soon' ); ?>" />
</div>
<h3 class="seedprod-mode-card-title"><?php esc_html_e( 'Maintenance Mode', 'coming-soon' ); ?></h3>
<p class="seedprod-mode-card-description">
<?php esc_html_e( 'The Maintenance Mode Page will notify search engines that the site is unavailable.', 'coming-soon' ); ?>
</p>
<div class="seedprod-mode-card-actions">
<?php if ( ! $mmp_id ) : ?>
<a href="<?php echo esc_url( admin_url( 'admin.php?page=seedprod_lite_template_selection&type=mm&name=' . rawurlencode( __( 'Maintenance Mode Page', 'coming-soon' ) ) . '&slug=maintenance-mode-page' ) ); ?>" class="button button-primary seedprod-button-primary">
<?php esc_html_e( 'Set up Maintenance Page', 'coming-soon' ); ?>
</a>
<?php else : ?>
<a href="<?php echo esc_url( admin_url( 'admin.php?page=seedprod_lite_builder&id=' . $mmp_id ) ); ?>" class="button button-primary seedprod-button-primary">
<?php esc_html_e( 'Edit Page', 'coming-soon' ); ?>
</a>
<a href="<?php echo esc_url( get_preview_post_link( $mmp_id ) ); ?>" target="_blank" class="button seedprod-button-secondary">
<?php esc_html_e( 'Preview', 'coming-soon' ); ?>
</a>
<?php endif; ?>
</div>
<?php if ( $mmp_id ) : ?>
<div class="seedprod-mode-card-toggle">
<label class="seedprod-switch">
<input type="checkbox" class="seedprod-toggle" data-mode="maintenance" <?php checked( $mmp_active ); ?>>
<span class="seedprod-slider"></span>
</label>
<span class="seedprod-toggle-label">
<?php if ( $mmp_active ) : ?>
<span class="active"><?php esc_html_e( 'ACTIVE', 'coming-soon' ); ?></span>
<?php else : ?>
<span class="inactive"><?php esc_html_e( 'INACTIVE', 'coming-soon' ); ?></span>
<?php endif; ?>
</span>
</div>
<?php endif; ?>
</div>
</div>
<!-- Login Page Card -->
<div class="postbox seedprod-card seedprod-mode-card <?php echo $is_lite_view ? 'seedprod-pro-feature' : ''; ?>" data-mode="login">
<div class="inside">
<div class="seedprod-mode-card-icon">
<img src="<?php echo esc_url( plugin_dir_url( __DIR__ ) . 'images/login-page.svg' ); ?>" alt="<?php esc_attr_e( 'Login Page', 'coming-soon' ); ?>" />
</div>
<h3 class="seedprod-mode-card-title">
<?php esc_html_e( 'Login Page', 'coming-soon' ); ?>
<?php if ( $is_lite_view ) : ?>
<?php echo wp_kses_post( seedprod_lite_v2_get_pro_badge( 'inline' ) ); ?>
<?php endif; ?>
</h3>
<p class="seedprod-mode-card-description">
<?php esc_html_e( 'Create a Custom Login Page for your website. Optionally replace the default login page.', 'coming-soon' ); ?>
</p>
<div class="seedprod-mode-card-actions">
<?php if ( $is_lite_view ) : ?>
<a href="<?php echo esc_url( seedprod_lite_get_upgrade_link( 'pluginloginpage', 'liteplugin' ) ); ?>" target="_blank" class="button button-primary seedprod-upgrade-button">
<span class="dashicons dashicons-star-filled"></span>
<?php esc_html_e( 'Upgrade to Pro', 'coming-soon' ); ?>
</a>
<?php else : ?>
<?php if ( ! $loginp_id ) : ?>
<a href="<?php echo esc_url( admin_url( 'admin.php?page=seedprod_lite_template_selection&type=loginp&name=' . rawurlencode( __( 'Login Page', 'coming-soon' ) ) . '&slug=login-page' ) ); ?>" class="button button-primary seedprod-button-primary">
<?php esc_html_e( 'Set up a Login Page', 'coming-soon' ); ?>
</a>
<?php else : ?>
<a href="<?php echo esc_url( admin_url( 'admin.php?page=seedprod_lite_builder&id=' . $loginp_id ) ); ?>" class="button button-primary seedprod-button-primary">
<?php esc_html_e( 'Edit Page', 'coming-soon' ); ?>
</a>
<a href="<?php echo esc_url( get_preview_post_link( $loginp_id ) ); ?>" target="_blank" class="button seedprod-button-secondary">
<?php esc_html_e( 'Preview', 'coming-soon' ); ?>
</a>
<?php endif; ?>
<?php endif; ?>
</div>
<?php if ( ! $is_lite_view && $loginp_id ) : ?>
<div class="seedprod-mode-card-toggle">
<label class="seedprod-switch">
<input type="checkbox" class="seedprod-toggle" data-mode="login" <?php checked( $loginp_active ); ?>>
<span class="seedprod-slider"></span>
</label>
<span class="seedprod-toggle-label">
<?php if ( $loginp_active ) : ?>
<span class="active"><?php esc_html_e( 'ACTIVE', 'coming-soon' ); ?></span>
<?php else : ?>
<span class="inactive"><?php esc_html_e( 'INACTIVE', 'coming-soon' ); ?></span>
<?php endif; ?>
</span>
</div>
<?php endif; ?>
</div>
</div>
<!-- 404 Page Card -->
<div class="postbox seedprod-card seedprod-mode-card <?php echo $is_lite_view ? 'seedprod-pro-feature' : ''; ?>" data-mode="404">
<div class="inside">
<div class="seedprod-mode-card-icon">
<img src="<?php echo esc_url( plugin_dir_url( __DIR__ ) . 'images/404-page.svg' ); ?>" alt="<?php esc_attr_e( '404 Page', 'coming-soon' ); ?>" />
</div>
<h3 class="seedprod-mode-card-title">
<?php esc_html_e( '404 Page', 'coming-soon' ); ?>
<?php if ( $is_lite_view ) : ?>
<?php echo wp_kses_post( seedprod_lite_v2_get_pro_badge( 'inline' ) ); ?>
<?php endif; ?>
</h3>
<p class="seedprod-mode-card-description">
<?php esc_html_e( 'Replace your default theme 404 page with a custom high converting 404 page.', 'coming-soon' ); ?>
</p>
<div class="seedprod-mode-card-actions">
<?php if ( $is_lite_view ) : ?>
<a href="<?php echo esc_url( seedprod_lite_get_upgrade_link( 'plugin404page', 'liteplugin' ) ); ?>" target="_blank" class="button button-primary seedprod-upgrade-button">
<span class="dashicons dashicons-star-filled"></span>
<?php esc_html_e( 'Upgrade to Pro', 'coming-soon' ); ?>
</a>
<?php else : ?>
<?php if ( ! $p404_id ) : ?>
<a href="<?php echo esc_url( admin_url( 'admin.php?page=seedprod_lite_template_selection&type=p404&name=' . rawurlencode( __( '404 Page', 'coming-soon' ) ) . '&slug=404-page' ) ); ?>" class="button button-primary seedprod-button-primary">
<?php esc_html_e( 'Set up a 404 Page', 'coming-soon' ); ?>
</a>
<?php else : ?>
<a href="<?php echo esc_url( admin_url( 'admin.php?page=seedprod_lite_builder&id=' . $p404_id ) ); ?>" class="button button-primary seedprod-button-primary">
<?php esc_html_e( 'Edit Page', 'coming-soon' ); ?>
</a>
<a href="<?php echo esc_url( get_preview_post_link( $p404_id ) ); ?>" target="_blank" class="button seedprod-button-secondary">
<?php esc_html_e( 'Preview', 'coming-soon' ); ?>
</a>
<?php endif; ?>
<?php endif; ?>
</div>
<?php if ( ! $is_lite_view && $p404_id ) : ?>
<div class="seedprod-mode-card-toggle">
<label class="seedprod-switch">
<input type="checkbox" class="seedprod-toggle" data-mode="404" <?php checked( $p404_active ); ?>>
<span class="seedprod-slider"></span>
</label>
<span class="seedprod-toggle-label">
<?php if ( $p404_active ) : ?>
<span class="active"><?php esc_html_e( 'ACTIVE', 'coming-soon' ); ?></span>
<?php else : ?>
<span class="inactive"><?php esc_html_e( 'INACTIVE', 'coming-soon' ); ?></span>
<?php endif; ?>
</span>
</div>
<?php endif; ?>
</div>
</div>
</div>
<!-- Landing Pages Section -->
<h2 class="seedprod-section-title"><?php esc_html_e( 'Landing Pages', 'coming-soon' ); ?></h2>
<p class="seedprod-section-description"><?php esc_html_e( 'Create custom landing pages like sales pages, webinar pages, thank you pages, and more.', 'coming-soon' ); ?></p>
<div class="seedprod-landing-pages-section">
<div class="seedprod-section-header">
<div class="seedprod-section-header-buttons">
<button id="seedprod-show-new-page-form" class="button button-primary seedprod-button-primary">
+ <?php esc_html_e( 'Add New Landing Page', 'coming-soon' ); ?>
</button>
<button id="seedprod-landing-import-export-btn" class="button seedprod-button-secondary">
<span class="dashicons dashicons-download"></span>
<?php esc_html_e( 'Import/Export', 'coming-soon' ); ?>
</button>
</div>
<!-- Inline New Page Form (Hidden by default) -->
<div id="seedprod-new-page-inline">
<div class="postbox seedprod-card">
<div class="inside">
<h3><?php esc_html_e( 'Create New Landing Page', 'coming-soon' ); ?></h3>
<?php $slug_check_url = html_entity_decode( wp_nonce_url( 'admin-ajax.php?action=seedprod_lite_slug_exists', 'seedprod_lite_slug_exists' ) ); ?>
<script type="text/javascript">
var seedprod_slug_check_url = <?php echo wp_json_encode( esc_url_raw( $slug_check_url ) ); ?>;
</script>
<form id="seedprod-create-page-form" class="seedprod-inline-form">
<table class="form-table">
<tbody>
<tr>
<th scope="row">
<label for="seedprod-page-name"><?php esc_html_e( 'Page Name', 'coming-soon' ); ?></label>
</th>
<td>
<input type="text"
id="seedprod-page-name"
name="page_name"
class="regular-text"
placeholder="<?php esc_attr_e( 'My Awesome Landing Page', 'coming-soon' ); ?>"
required />
<p class="description">
<?php esc_html_e( 'Enter a descriptive name for your landing page.', 'coming-soon' ); ?>
</p>
</td>
</tr>
<tr>
<th scope="row">
<label for="seedprod-page-slug"><?php esc_html_e( 'Page URL', 'coming-soon' ); ?></label>
</th>
<td>
<code><?php echo esc_url( home_url( '/' ) ); ?></code>
<input type="text"
id="seedprod-page-slug"
name="page_slug"
class="regular-text code"
placeholder="<?php esc_attr_e( 'my-awesome-page', 'coming-soon' ); ?>" />
<p class="description">
<?php esc_html_e( 'The URL slug for your page. Leave blank to auto-generate from the page name.', 'coming-soon' ); ?>
</p>
<p id="seedprod-page-slug-error" class="description" style="display: none; color: #dc3232; font-weight: 600;">
<?php esc_html_e( 'This page URL already exists. Please choose a unique page URL.', 'coming-soon' ); ?>
</p>
</td>
</tr>
</tbody>
</table>
<p class="submit">
<button type="submit" class="button button-primary seedprod-button-primary">
<?php esc_html_e( 'Next: Choose Template', 'coming-soon' ); ?>
</button>
<button type="button" id="seedprod-cancel-new-page" class="button seedprod-button-secondary">
<?php esc_html_e( 'Cancel', 'coming-soon' ); ?>
</button>
</p>
</form>
</div>
</div>
</div>
</div>
<form id="seedprod-landing-pages-form" method="get">
<input type="hidden" name="page" value="seedprod_lite_landing_pages" />
<?php
// Display search box (WordPress native).
$landing_pages_table->search_box( __( 'Search Landing Pages', 'coming-soon' ), 'seedprod-landing-pages' );
// Display the table with views and pagination.
$landing_pages_table->views();
$landing_pages_table->display();
// Add upgrade row for Lite users.
if ( $is_lite_view ) :
?>
<script type="text/javascript">
jQuery(document).ready(function($) {
// Use localized strings from seedprod_admin
var strings = window.seedprod_admin && window.seedprod_admin.strings ? window.seedprod_admin.strings : {};
// Add the upgrade row to the table for Lite users
var upgradeRow = '<tr class="seedprod-upgrade-row">';
upgradeRow += '<td class="column-cb"></td>';
upgradeRow += '<td class="column-title" colspan="2" style="white-space: normal;">';
upgradeRow += '<div style="display: flex; align-items: flex-start; gap: 5px;">';
upgradeRow += '<span class="dashicons dashicons-megaphone" style="color: var(--seedprod-orange); flex-shrink: 0; margin-top: 2px;"></span>';
upgradeRow += '<div>';
upgradeRow += '<strong style="color: var(--seedprod-orange);">' + strings.pro_tip + '</strong> ';
upgradeRow += strings.landing_pages_upgrade_message;
upgradeRow += '</div>';
upgradeRow += '</div>';
upgradeRow += '</td>';
upgradeRow += '<td class="column-status">';
upgradeRow += '<a href="<?php echo esc_url( seedprod_lite_get_upgrade_link( 'landingpagestable', 'liteplugin' ) ); ?>" target="_blank" style="color: var(--seedprod-orange);">' + strings.learn_more + '</a>';
upgradeRow += '</td>';
upgradeRow += '<td class="column-date">';
upgradeRow += '<a href="<?php echo esc_url( seedprod_lite_get_upgrade_link( 'landingpagestable', 'liteplugin' ) ); ?>" target="_blank" class="button button-small button-primary seedprod-upgrade-button" style="display: inline-flex; align-items: center;">';
upgradeRow += '<span class="dashicons dashicons-star-filled" style="margin-right: 4px; font-size: 14px; width: 14px; height: 14px;"></span>';
upgradeRow += strings.upgrade_to_pro;
upgradeRow += '</a>';
upgradeRow += '</td>';
upgradeRow += '</tr>';
// Check if we have a tbody in the table
var $tbody = $('.wp-list-table tbody');
if ($tbody.length > 0) {
// Always append the upgrade row to the table
// This preserves the "No landing pages found" message or any existing rows
$tbody.append(upgradeRow);
}
});
</script>
<?php endif; ?>
</form>
</div>
</div>
</div>
<!-- Landing Pages Import/Export Modal -->
<div id="seedprod-landing-import-export-modal" class="seedprod-modal" style="display: none;">
<div class="seedprod-modal-content">
<div class="seedprod-modal-header">
<h2><?php esc_html_e( 'Import/Export Landing Pages', 'coming-soon' ); ?></h2>
<button type="button" class="seedprod-modal-close" aria-label="<?php esc_attr_e( 'Close', 'coming-soon' ); ?>">
<span class="dashicons dashicons-no-alt"></span>
</button>
</div>
<div class="seedprod-modal-body">
<!-- Tab Navigation -->
<div class="seedprod-import-export-tabs">
<button type="button" class="seedprod-tab-button active" data-tab="export">
<?php esc_html_e( 'Export', 'coming-soon' ); ?>
</button>
<button type="button" class="seedprod-tab-button" data-tab="import">
<?php esc_html_e( 'Import', 'coming-soon' ); ?>
</button>
</div>
<!-- Export Tab Content -->
<div class="seedprod-tab-content" id="seedprod-landing-export-tab" style="display: block;">
<div class="seedprod-export-section">
<h3><?php esc_html_e( 'Export Landing Pages', 'coming-soon' ); ?></h3>
<p class="description"><?php esc_html_e( 'Export your landing pages including Coming Soon, Maintenance Mode, 404, and custom landing pages. The export will include all page settings, content, and associated images.', 'coming-soon' ); ?></p>
<div class="seedprod-export-options" style="margin: 20px 0;">
<label for="seedprod-export-page-select" style="display: block; margin-bottom: 10px;">
<strong><?php esc_html_e( 'Select Pages to Export:', 'coming-soon' ); ?></strong>
</label>
<select id="seedprod-export-page-select" class="regular-text" style="min-width: 300px;">
<option value="all"><?php esc_html_e( 'All Landing Pages', 'coming-soon' ); ?></option>
<?php
global $wpdb;
$tablename = $wpdb->prefix . 'posts';
$meta_tablename = $wpdb->prefix . 'postmeta';
// Get special page IDs first.
$coming_soon_id = get_option( 'seedprod_coming_soon_page_id' );
$maintenance_id = get_option( 'seedprod_maintenance_mode_page_id' );
$login_id = get_option( 'seedprod_login_page_id' );
$fourohfour_id = get_option( 'seedprod_404_page_id' );
// Build list of special page IDs to include.
$special_page_ids = array();
if ( ! empty( $coming_soon_id ) ) {
$special_page_ids[] = $coming_soon_id;
}
if ( ! empty( $maintenance_id ) ) {
$special_page_ids[] = $maintenance_id;
}
if ( ! empty( $login_id ) ) {
$special_page_ids[] = $login_id;
}
if ( ! empty( $fourohfour_id ) ) {
$special_page_ids[] = $fourohfour_id;
}
// Query for landing pages - include multiple conditions to catch all pages:
// 1. Pages with _seedprod_page_template_type = 'lp' (new landing pages).
// 2. Pages with _seedprod_page = '1' (legacy/older landing pages).
// 3. Special pages (CS, MM, Login, 404) by their specific IDs.
// Build special pages condition separately.
$special_pages_condition = '';
if ( ! empty( $special_page_ids ) ) {
$special_ids_string = implode( ',', array_map( 'intval', $special_page_ids ) );
$special_pages_condition = " OR p.ID IN ($special_ids_string)";
}
$sql = "SELECT DISTINCT p.ID, p.post_title, p.post_type, p.post_status, p.post_date, pm2.meta_value as page_type
FROM $tablename p
LEFT JOIN $meta_tablename pm ON (pm.post_id = p.ID AND pm.meta_key = '_seedprod_page_uuid')
LEFT JOIN $meta_tablename pm2 ON (pm2.post_id = p.ID AND pm2.meta_key = '_seedprod_page_type')
LEFT JOIN $meta_tablename pm4 ON (pm4.post_id = p.ID AND pm4.meta_key = '_seedprod_page_template_type')
LEFT JOIN $meta_tablename pm5 ON (pm5.post_id = p.ID AND pm5.meta_key = '_seedprod_page')
WHERE p.post_status != 'trash'
AND p.post_type IN ('page', 'seedprod')
AND (
(p.post_type = 'page' AND pm4.meta_value = 'lp')
OR (p.post_type = 'page' AND pm5.meta_value IS NOT NULL)
$special_pages_condition
)
AND (pm.meta_value IS NOT NULL OR pm5.meta_value IS NOT NULL $special_pages_condition)
ORDER BY p.post_date DESC";
$pages = $wpdb->get_results( $sql ); // phpcs:ignore
// DEBUG: Let's see what we're getting.
if ( current_user_can( 'manage_options' ) && isset( $_GET['debug_landing_pages'] ) ) {
echo '<h4>Debug: Landing Pages Query Results</h4>';
echo '<pre>';
echo 'SQL: ' . esc_html( $sql ) . "\n\n";
echo 'Results (' . count( $pages ) . " found):\n";
print_r( $pages ); // phpcs:ignore
echo '</pre>';
// Also show ALL SeedProd pages.
$debug_sql = "SELECT p.ID, p.post_title, p.post_type, p.post_status,
pm1.meta_value as page_uuid,
pm2.meta_value as page_type,
pm3.meta_value as is_theme_template
FROM $tablename p
LEFT JOIN $meta_tablename pm1 ON (pm1.post_id = p.ID AND pm1.meta_key = '_seedprod_page_uuid')
LEFT JOIN $meta_tablename pm2 ON (pm2.post_id = p.ID AND pm2.meta_key = '_seedprod_page_type')
LEFT JOIN $meta_tablename pm3 ON (pm3.post_id = p.ID AND pm3.meta_key = '_seedprod_is_theme_template')
WHERE pm1.meta_value IS NOT NULL
ORDER BY p.ID";
$debug_results = $wpdb->get_results( $wpdb->prepare( $debug_sql ) ); // phpcs:ignore
echo '<h4>Debug: ALL SeedProd Pages</h4>';
echo '<pre>';
print_r( $debug_results ); // phpcs:ignore
echo '</pre>';
}
foreach ( $pages as $page_item ) {
$page_label = esc_html( $page_item->post_title );
$page_type = '';
// Add page type indicator.
if ( (int) $page_item->ID === (int) $coming_soon_id ) {
$page_type = 'cs';
$page_label .= ' ' . __( '(Coming Soon)', 'coming-soon' );
} elseif ( (int) $page_item->ID === (int) $maintenance_id ) {
$page_type = 'mm';
$page_label .= ' ' . __( '(Maintenance Mode)', 'coming-soon' );
} elseif ( (int) $page_item->ID === (int) $login_id ) {
$page_type = 'loginp';
$page_label .= ' ' . __( '(Login Page)', 'coming-soon' );
} elseif ( (int) $page_item->ID === (int) $fourohfour_id ) {
$page_type = 'p404';
$page_label .= ' ' . __( '(404 Page)', 'coming-soon' );
} elseif ( ! empty( $page_item->page_type ) ) {
$page_type = $page_item->page_type;
} else {
$page_type = 'lp';
}
echo '<option value="' . esc_attr( $page_item->ID ) . '" data-ptype="' . esc_attr( $page_type ) . '">' . esc_html( $page_label ) . '</option>';
}
?>
</select>
</div>
<div class="seedprod-export-actions">
<button type="button" class="button button-primary seedprod-button-primary" id="seedprod-export-landing-btn">
<span class="dashicons dashicons-download"></span>
<span class="button-text"><?php esc_html_e( 'Export Selected', 'coming-soon' ); ?></span>
<span class="spinner" style="display: none;"></span>
</button>
</div>
<div class="seedprod-export-status" style="display: none;">
<div class="notice notice-info">
<p><?php esc_html_e( 'Preparing export file...', 'coming-soon' ); ?></p>
</div>
</div>
</div>
</div>
<!-- Import Tab Content -->
<div class="seedprod-tab-content" id="seedprod-landing-import-tab" style="display: none;">
<div class="seedprod-import-section">
<h3><?php esc_html_e( 'Import Landing Pages', 'coming-soon' ); ?></h3>
<p class="description"><?php esc_html_e( 'Import landing pages from a SeedProd export file (.zip). This will add the pages to your existing landing pages.', 'coming-soon' ); ?></p>
<div class="seedprod-import-options">
<div class="seedprod-import-file-section">
<h4><?php esc_html_e( 'Upload File', 'coming-soon' ); ?></h4>
<div class="seedprod-file-upload">
<input type="file" id="seedprod-landing-import-file" accept=".zip" style="display: none;">
<button type="button" class="button" id="seedprod-landing-select-file-btn">
<span class="dashicons dashicons-upload"></span>
<?php esc_html_e( 'Select File', 'coming-soon' ); ?>
</button>
<span class="seedprod-file-name"></span>
</div>
</div>
<!-- URL import is not supported for landing pages, only for themes -->
<div class="seedprod-import-url-section" style="display: none;">
<h4><?php esc_html_e( 'Or Import from URL', 'coming-soon' ); ?></h4>
<input type="url" id="seedprod-landing-import-url" class="regular-text" placeholder="https://example.com/landing-pages-export.zip">
</div>
</div>
<div class="seedprod-import-warning">
<div class="notice notice-warning inline">
<p>
<strong><?php esc_html_e( 'Important:', 'coming-soon' ); ?></strong>
<?php esc_html_e( 'Importing will create new landing pages. If you have existing pages with the same names, duplicates will be created. Mode pages (Coming Soon, Maintenance, 404, Login) will replace existing ones if present.', 'coming-soon' ); ?>
<?php
printf(
/* translators: %s: Link to Duplicator plugin. */
esc_html__( ' We recommend creating a backup with %s (free plugin) before importing.', 'coming-soon' ),
'<a href="' . esc_url( admin_url( 'admin.php?page=seedprod_lite_settings&tab=recommended-plugins&filter=duplicator' ) ) . '">Duplicator</a>'
);
?>
</p>
</div>
</div>
<div class="seedprod-import-actions">
<button type="button" class="button button-primary seedprod-button-primary" id="seedprod-import-landing-btn" disabled>
<span class="dashicons dashicons-upload"></span>
<span class="button-text"><?php esc_html_e( 'Import Landing Pages', 'coming-soon' ); ?></span>
<span class="spinner" style="display: none;"></span>
</button>
</div>
<div class="seedprod-import-status" style="display: none;">
<div class="notice">
<p></p>
</div>
</div>
</div>
</div>
</div>
<div class="seedprod-modal-footer">
<button type="button" class="button button-secondary seedprod-modal-cancel">
<?php esc_html_e( 'Close', 'coming-soon' ); ?>
</button>
</div>
</div>
</div>
seedprod-admin-header.php 0000644 00000021654 15233474616 0011421 0 ustar 00 <?php
/**
* Admin header partial for SeedProd
*
* This partial displays the consistent header across all admin pages.
*
* @param string $page_title The title to display in the header
*
* @package SeedProd
* @subpackage SeedProd/admin/partials
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Load admin functions if not already loaded.
if ( ! function_exists( 'seedprod_lite_get_support_link' ) ) {
require_once plugin_dir_path( __DIR__ ) . 'admin-functions.php';
}
// Check if we're in Lite view.
$is_lite_view = seedprod_lite_v2_is_lite_view();
// Get the page title from the passed variable or use a default.
$page_title = isset( $page_title ) ? $page_title : __( 'Dashboard', 'coming-soon' );
// Get the current page context for UTM tracking.
$page_context = seedprod_lite_get_admin_page_context();
// Check license status for Pro version.
$show_license_warning = false;
$is_lite_view = seedprod_lite_v2_is_lite_view();
if ( ! $is_lite_view ) {
$seedprod_a = get_option( 'seedprod_a' );
$license_key = get_option( 'seedprod_api_key' );
// Show warning if no license or invalid license.
if ( empty( $seedprod_a ) || empty( $license_key ) ) {
// Don't show warning on dashboard when it's showing the welcome/activation screen.
$current_page = isset( $_GET['page'] ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Read-only parameter for display logic.
if ( 'seedprod_lite' !== $current_page ) {
// Only show on non-dashboard pages (Landing Pages, Website Builder, Settings, etc.).
$show_license_warning = true;
}
}
}
// Get notifications.
$notifications = array();
$notification_to_show = null;
if ( class_exists( 'SeedProd_Notifications' ) ) {
$n = SeedProd_Notifications::get_instance();
$notifications = $n->get();
$notification_count = $n->get_count();
// Check if notifications are disabled.
$seedprod_app_settings = get_option( 'seedprod_app_settings' );
if ( ! empty( $seedprod_app_settings ) ) {
$seedprod_app_settings = json_decode( stripslashes( $seedprod_app_settings ) );
if ( isset( $seedprod_app_settings->disable_seedprod_notification ) &&
true === $seedprod_app_settings->disable_seedprod_notification ) {
$notification_count = 0;
$notifications = array();
}
}
// Get the first non-dismissed notification to show.
if ( ! empty( $notifications ) && is_array( $notifications ) ) {
$notification_to_show = $notifications[0];
}
// Test mode: Show mock notification if test_notification=1 is in URL.
if ( isset( $_GET['test_notification'] ) && '1' === $_GET['test_notification'] ) {
$notification_to_show = array(
'id' => 'test-notification',
'title' => __( '🎉 NEW: AI Theme Builder Now Available!', 'coming-soon' ),
'content' => __( 'Create stunning WordPress themes in seconds with our new AI-powered theme builder. Generate complete websites with just a few prompts!', 'coming-soon' ),
'icon' => '', // Will use default bell icon.
'btns' => array(
'main' => array(
'text' => __( 'Try It Now', 'coming-soon' ),
'url' => seedprod_lite_get_external_link( 'https://www.seedprod.com/ai-theme-builder/', 'notification-test', 'notification' ),
'target' => '_blank',
),
'alt' => array(
'text' => __( 'Watch Demo', 'coming-soon' ),
'url' => seedprod_lite_get_external_link( 'https://www.seedprod.com/ai-theme-builder-demo/', 'notification-test', 'notification' ),
'target' => '_blank',
),
),
);
}
}
?>
<?php if ( $show_license_warning ) : ?>
<!-- License warning bar for Pro version -->
<div class="seedprod-license-warning-bar">
<div class="seedprod-license-bar-content">
<span class="seedprod-license-warning-text">
<?php esc_html_e( 'License Activation Required', 'coming-soon' ); ?>
<span class="seedprod-license-separator">•</span>
<a href="<?php echo esc_url( admin_url( 'admin.php?page=seedprod_lite_settings' ) ); ?>" class="seedprod-license-link">
<?php esc_html_e( 'Activate now to unlock updates, support & all Pro features', 'coming-soon' ); ?>
</a>
</span>
</div>
</div>
<?php endif; ?>
<?php if ( $is_lite_view ) : ?>
<!-- Upgrade bar for Lite version -->
<div class="seedprod-lite-upgrade-bar">
<div class="seedprod-upgrade-bar-content">
<div class="seedprod-upgrade-bar-message">
<span class="seedprod-upgrade-icon">★</span>
<span class="seedprod-upgrade-text">
<strong><?php esc_html_e( 'You\'re using SeedProd Lite.', 'coming-soon' ); ?></strong>
<?php esc_html_e( 'Unlock more features and grow your website faster with SeedProd!', 'coming-soon' ); ?>
</span>
</div>
<div class="seedprod-upgrade-bar-action">
<a href="<?php echo esc_url( seedprod_lite_get_upgrade_link( 'plugintopbar', 'liteplugin' ) ); ?>" target="_blank" rel="noopener" class="button button-primary seedprod-button-black">
<?php esc_html_e( 'Upgrade to Pro', 'coming-soon' ); ?> →
</a>
</div>
</div>
</div>
<?php endif; ?>
<!-- Header with logo and help -->
<div class="seedprod-dashboard-header">
<div class="seedprod-header-content">
<div class="seedprod-header-left">
<img src="<?php echo esc_url( plugin_dir_url( __DIR__ ) . 'images/seedprod-logo.svg' ); ?>" alt="SeedProd" class="seedprod-logo" />
<span class="seedprod-header-separator">/</span>
<h1 class="seedprod-page-title"><?php echo esc_html( $page_title ); ?></h1>
</div>
<div class="seedprod-header-right">
<?php if ( $is_lite_view ) : ?>
<?php // Lite users go to support upsell page. ?>
<a href="<?php echo esc_url( admin_url( 'admin.php?page=seedprod_lite_support' ) ); ?>" class="seedprod-help-link">
<span class="dashicons dashicons-editor-help"></span>
<span class="seedprod-tooltip"><?php esc_html_e( 'Get Help', 'coming-soon' ); ?></span>
</a>
<?php else : ?>
<?php // Pro users go directly to documentation. ?>
<a href="<?php echo esc_url( seedprod_lite_get_support_link( '', 'WordPress', 'admin-header-' . $page_context ) ); ?>" target="_blank" rel="noopener" class="seedprod-help-link">
<span class="dashicons dashicons-editor-help"></span>
<span class="seedprod-tooltip"><?php esc_html_e( 'Get Help', 'coming-soon' ); ?></span>
</a>
<?php endif; ?>
</div>
</div>
</div>
<?php if ( ! empty( $notification_to_show ) ) : ?>
<!-- Notification bar -->
<div class="seedprod-notification-bar notice notice-info" data-id="<?php echo esc_attr( $notification_to_show['id'] ); ?>">
<div class="seedprod-notification-content">
<div class="seedprod-notification-icon">
<?php if ( ! empty( $notification_to_show['icon'] ) ) : ?>
<img src="<?php echo esc_url( $notification_to_show['icon'] ); ?>" alt="<?php echo esc_attr( $notification_to_show['title'] ); ?>" />
<?php else : ?>
<span class="dashicons dashicons-bell"></span>
<?php endif; ?>
</div>
<div class="seedprod-notification-message">
<?php if ( ! empty( $notification_to_show['title'] ) ) : ?>
<strong><?php echo esc_html( $notification_to_show['title'] ); ?></strong>
<?php endif; ?>
<?php if ( ! empty( $notification_to_show['content'] ) ) : ?>
<div class="seedprod-notification-text">
<?php echo wp_kses_post( $notification_to_show['content'] ); ?>
</div>
<?php endif; ?>
</div>
<?php if ( ! empty( $notification_to_show['btns'] ) ) : ?>
<div class="seedprod-notification-actions">
<?php if ( ! empty( $notification_to_show['btns']['main'] ) ) : ?>
<a href="<?php echo esc_url( $notification_to_show['btns']['main']['url'] ); ?>"
class="button button-primary button-small"
<?php
if ( ( ! empty( $notification_to_show['btns']['main']['target'] ) && '_blank' === $notification_to_show['btns']['main']['target'] ) || ( empty( $notification_to_show['btns']['main']['target'] ) && false === strpos( $notification_to_show['btns']['main']['url'], admin_url() ) ) ) :
?>
target="_blank" rel="noopener"<?php endif; ?>>
<?php echo esc_html( $notification_to_show['btns']['main']['text'] ); ?>
</a>
<?php endif; ?>
<?php if ( ! empty( $notification_to_show['btns']['alt'] ) ) : ?>
<a href="<?php echo esc_url( $notification_to_show['btns']['alt']['url'] ); ?>"
class="button button-small"
<?php
if ( ( ! empty( $notification_to_show['btns']['alt']['target'] ) && '_blank' === $notification_to_show['btns']['alt']['target'] ) || ( empty( $notification_to_show['btns']['alt']['target'] ) && false === strpos( $notification_to_show['btns']['alt']['url'], admin_url() ) ) ) :
?>
target="_blank" rel="noopener"<?php endif; ?>>
<?php echo esc_html( $notification_to_show['btns']['alt']['text'] ); ?>
</a>
<?php endif; ?>
</div>
<?php endif; ?>
<button type="button" class="seedprod-notification-dismiss" aria-label="<?php esc_attr_e( 'Dismiss this notice', 'coming-soon' ); ?>">
<span class="dashicons dashicons-dismiss"></span>
</button>
</div>
</div>
<?php endif; ?>
seedprod-admin-website-builder.php 0000644 00000054140 15233474616 0013253 0 ustar 00 <?php
/**
* Website Builder Management Page
*
* @package SeedProd_Lite
* @subpackage SeedProd_Lite/admin/partials
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Load admin functions if not already loaded.
if ( ! function_exists( 'seedprod_lite_v2_is_lite_view' ) ) {
require_once plugin_dir_path( __DIR__ ) . 'admin-functions.php';
}
// Check if we're in Lite view.
$is_lite_view = seedprod_lite_v2_is_lite_view();
// If Lite view, show product education page instead.
if ( $is_lite_view ) {
// Include the admin class if not already loaded.
if ( ! class_exists( 'SeedProd_Lite_Admin' ) ) {
require_once plugin_dir_path( __DIR__ ) . 'class-seedprod-admin.php';
}
$admin = new SeedProd_Lite_Admin( 'coming-soon', SEEDPROD_VERSION );
$admin->render_website_builder_education();
return;
}
// Check if themebuilder feature is available in the license.
if ( ! function_exists( 'seedprod_lite_cu' ) || ! seedprod_lite_cu( 'themebuilder' ) ) {
// Themebuilder not available - show product education page (same as lite version).
// Include the admin class if not already loaded.
if ( ! class_exists( 'SeedProd_Lite_Admin' ) ) {
require_once plugin_dir_path( __DIR__ ) . 'class-seedprod-admin.php';
}
$admin = new SeedProd_Lite_Admin( 'coming-soon', SEEDPROD_VERSION );
$admin->render_website_builder_education();
return;
}
// Get current settings (stored as JSON string).
$settings_json = get_option( 'seedprod_settings' );
if ( ! empty( $settings_json ) ) {
$settings = json_decode( $settings_json, true );
if ( ! is_array( $settings ) ) {
$settings = array();
}
} else {
$settings = array();
}
// Check if theme is enabled (checks both old and new format).
$theme_enabled = seedprod_lite_v2_is_theme_enabled();
// Ensure theme-templates.php is loaded (contains required functions).
if ( ! function_exists( 'seedprod_lite_conditions_map' ) ) {
require_once SEEDPROD_PLUGIN_PATH . 'app/theme-templates.php';
}
// Get actual theme template counts.
$template_counts = seedprod_lite_v2_get_theme_template_counts();
$header_count = $template_counts['headers'];
$footer_count = $template_counts['footers'];
$template_count = $template_counts['pages'];
// Load the Theme Templates table class.
require_once plugin_dir_path( __DIR__ ) . 'includes/class-seedprod-theme-templates-table.php';
// Create an instance of our table class.
$templates_table = new SeedProd_Theme_Templates_Table();
// Prepare table items.
$templates_table->prepare_items();
?>
<div class="seedprod-dashboard-page seedprod-website-builder-page <?php echo $is_lite_view ? 'seedprod-lite' : ''; ?>">
<?php
// Include header with page title.
$page_title = __( 'Website Builder', 'coming-soon' );
require_once plugin_dir_path( __FILE__ ) . 'seedprod-admin-header.php';
?>
<div class="seedprod-dashboard-container">
<!-- Theme Header Section -->
<h2 class="seedprod-section-title"><?php esc_html_e( 'SeedProd Theme', 'coming-soon' ); ?></h2>
<p class="seedprod-section-description"><?php esc_html_e( 'Replace your WordPress theme with a custom SeedProd theme built with our drag & drop builder.', 'coming-soon' ); ?></p>
<!-- Theme Control Card -->
<div class="postbox seedprod-card seedprod-theme-control-card">
<div class="inside">
<!-- Toggle Section -->
<div class="seedprod-theme-toggle-section">
<div class="seedprod-theme-toggle-header">
<h3><?php esc_html_e( 'Enable SeedProd Theme', 'coming-soon' ); ?></h3>
<div class="seedprod-theme-toggle-control">
<label class="seedprod-switch">
<input type="checkbox" id="seedprod-theme-toggle" <?php checked( $theme_enabled ); ?>>
<span class="seedprod-slider"></span>
</label>
<span class="seedprod-toggle-label">
<?php if ( $theme_enabled ) : ?>
<span class="active"><?php esc_html_e( 'ACTIVE', 'coming-soon' ); ?></span>
<?php else : ?>
<span class="inactive"><?php esc_html_e( 'INACTIVE', 'coming-soon' ); ?></span>
<?php endif; ?>
</span>
</div>
</div>
<p><?php esc_html_e( 'Activate this to replace your current WordPress theme with your custom SeedProd designs.', 'coming-soon' ); ?></p>
<?php if ( $theme_enabled && ( $header_count > 0 || $footer_count > 0 || $template_count > 0 ) ) : ?>
<div class="seedprod-theme-stats">
<span class="seedprod-stat"><?php printf( /* translators: %d: Number of headers */ esc_html__( '%d Headers', 'coming-soon' ), esc_html( $header_count ) ); ?></span>
<span class="seedprod-stat-separator">•</span>
<span class="seedprod-stat"><?php printf( /* translators: %d: Number of footers */ esc_html__( '%d Footers', 'coming-soon' ), esc_html( $footer_count ) ); ?></span>
<span class="seedprod-stat-separator">•</span>
<span class="seedprod-stat"><?php printf( /* translators: %d: Number of page templates */ esc_html__( '%d Page Templates', 'coming-soon' ), esc_html( $template_count ) ); ?></span>
</div>
<?php endif; ?>
</div>
<hr class="seedprod-divider" />
<!-- Quick Actions Section -->
<div class="seedprod-quick-actions-section">
<h4><?php esc_html_e( 'Quick Actions', 'coming-soon' ); ?></h4>
<div class="seedprod-quick-actions-buttons">
<a href="<?php echo esc_url( admin_url( 'admin.php?page=seedprod_lite_theme_kits_selection' ) ); ?>" class="button button-primary seedprod-button-primary">
<span class="dashicons dashicons-admin-appearance"></span>
<?php esc_html_e( 'Browse Template Kits', 'coming-soon' ); ?>
</a>
<a href="#" class="button seedprod-button-secondary seedprod-add-new-template-btn">
<span class="dashicons dashicons-plus-alt"></span>
<?php esc_html_e( 'Add New Template', 'coming-soon' ); ?>
</a>
<a href="#" class="button seedprod-button-secondary" id="seedprod-import-export-btn">
<span class="dashicons dashicons-download"></span>
<?php esc_html_e( 'Import/Export', 'coming-soon' ); ?>
</a>
</div>
</div>
</div>
</div>
<!-- Theme Templates Section -->
<div class="seedprod-theme-templates-section">
<div class="seedprod-section-header">
<h2 class="seedprod-section-title"><?php esc_html_e( 'Theme Templates', 'coming-soon' ); ?></h2>
<p class="seedprod-section-description"><?php esc_html_e( 'Create and manage custom headers, footers, pages, and other theme parts for your website.', 'coming-soon' ); ?></p>
</div>
<form id="seedprod-templates-form" method="get">
<input type="hidden" name="page" value="seedprod_lite_website_builder" />
<?php
// Get filter counts.
$all_count = 0;
$published_count = 0;
$draft_count = 0;
$trash_count = 0;
// Query counts.
$count_args = array(
'post_type' => 'seedprod',
'post_status' => array( 'publish', 'draft', 'future', 'trash' ),
'posts_per_page' => -1,
'meta_query' => array(
array(
'key' => '_seedprod_is_theme_template',
'value' => true,
),
),
'fields' => 'ids',
);
$all_templates = new WP_Query( $count_args );
$all_count = $all_templates->found_posts;
// Published count.
$count_args['post_status'] = 'publish';
$published_templates = new WP_Query( $count_args );
$published_count = $published_templates->found_posts;
// Draft count.
$count_args['post_status'] = 'draft';
$draft_templates = new WP_Query( $count_args );
$draft_count = $draft_templates->found_posts;
// Trash count.
$count_args['post_status'] = 'trash';
$trash_templates = new WP_Query( $count_args );
$trash_count = $trash_templates->found_posts;
// Calculate non-trash count.
$active_count = $all_count - $trash_count;
// Get current filter.
$current_filter = isset( $_GET['filter'] ) ? sanitize_text_field( wp_unslash( $_GET['filter'] ) ) : 'all';
?>
<!-- Filter Tabs -->
<ul class="subsubsub">
<li class="all">
<a href="<?php echo esc_url( admin_url( 'admin.php?page=seedprod_lite_website_builder' ) ); ?>"
class="<?php echo ( 'all' === $current_filter ) ? 'current' : ''; ?>">
<?php esc_html_e( 'All', 'coming-soon' ); ?>
<span class="count">(<?php echo esc_html( $active_count ); ?>)</span>
</a> |
</li>
<li class="published">
<a href="<?php echo esc_url( admin_url( 'admin.php?page=seedprod_lite_website_builder&filter=published' ) ); ?>"
class="<?php echo ( 'published' === $current_filter ) ? 'current' : ''; ?>">
<?php esc_html_e( 'Published', 'coming-soon' ); ?>
<span class="count">(<?php echo esc_html( $published_count ); ?>)</span>
</a> |
</li>
<li class="drafts">
<a href="<?php echo esc_url( admin_url( 'admin.php?page=seedprod_lite_website_builder&filter=drafts' ) ); ?>"
class="<?php echo ( 'drafts' === $current_filter ) ? 'current' : ''; ?>">
<?php esc_html_e( 'Drafts', 'coming-soon' ); ?>
<span class="count">(<?php echo esc_html( $draft_count ); ?>)</span>
</a> |
</li>
<li class="trash">
<a href="<?php echo esc_url( admin_url( 'admin.php?page=seedprod_lite_website_builder&filter=trash' ) ); ?>"
class="<?php echo ( 'trash' === $current_filter ) ? 'current' : ''; ?>">
<?php esc_html_e( 'Trash', 'coming-soon' ); ?>
<span class="count">(<?php echo esc_html( $trash_count ); ?>)</span>
</a>
</li>
</ul>
<!-- Search Box -->
<p class="search-box">
<label class="screen-reader-text" for="seedprod-search-input">
<?php esc_html_e( 'Search Theme Templates', 'coming-soon' ); ?>
</label>
<input type="search" id="seedprod-search-input" name="s"
value="<?php echo isset( $_GET['s'] ) ? esc_attr( sanitize_text_field( wp_unslash( $_GET['s'] ) ) ) : ''; ?>" />
<input type="submit" id="search-submit" class="button"
value="<?php esc_attr_e( 'Search Theme Templates', 'coming-soon' ); ?>" />
</p>
<div class="clear"></div>
<!-- DataTable -->
<?php $templates_table->display(); ?>
</form>
</div>
</div>
<!-- Edit Conditions Modal -->
<div id="seedprod-conditions-modal" class="seedprod-modal" style="display: none;">
<div class="seedprod-modal-overlay"></div>
<div class="seedprod-modal-content seedprod-modal-content-large">
<div class="seedprod-modal-header">
<h2><?php esc_html_e( 'Edit Conditions', 'coming-soon' ); ?></h2>
<button type="button" class="seedprod-modal-close" aria-label="<?php esc_attr_e( 'Close', 'coming-soon' ); ?>">
<span class="dashicons dashicons-no-alt"></span>
</button>
</div>
<div class="seedprod-modal-body">
<!-- Template Name Field -->
<div class="seedprod-form-group">
<label for="seedprod-template-name">
<?php esc_html_e( 'Template Name', 'coming-soon' ); ?>
<span class="required">*</span>
</label>
<input type="text" id="seedprod-template-name" class="seedprod-form-control" placeholder="<?php esc_attr_e( 'Example: Main Header, Blog Page, Search Results', 'coming-soon' ); ?>" />
</div>
<!-- Template Type and Priority -->
<div class="seedprod-form-row">
<div class="seedprod-form-group seedprod-form-group-half">
<label><?php esc_html_e( 'Template Type', 'coming-soon' ); ?></label>
<div id="seedprod-template-type-display" class="seedprod-template-type-display"></div>
</div>
<div class="seedprod-form-group seedprod-form-group-half">
<label for="seedprod-template-priority">
<?php esc_html_e( 'Priority', 'coming-soon' ); ?>
</label>
<input type="number" id="seedprod-template-priority" class="seedprod-form-control" value="20" min="0" max="999" />
<p class="description" style="margin-top: 5px;">
<?php esc_html_e( 'Higher priority templates will override lower priority ones.', 'coming-soon' ); ?>
</p>
</div>
</div>
<!-- Conditions Section -->
<div class="seedprod-form-group">
<label><?php esc_html_e( 'Display Conditions', 'coming-soon' ); ?></label>
<div class="seedprod-conditions-info">
<p><?php esc_html_e( 'Choose where this template should be displayed on your site.', 'coming-soon' ); ?></p>
</div>
<div id="seedprod-conditions-list" class="seedprod-conditions-list">
<!-- Conditions will be added dynamically -->
</div>
<button type="button" class="button seedprod-add-condition">
<span class="dashicons dashicons-plus-alt"></span>
<?php esc_html_e( 'Add Condition', 'coming-soon' ); ?>
</button>
</div>
</div>
<div class="seedprod-modal-footer">
<button type="button" class="button button-secondary seedprod-modal-cancel">
<?php esc_html_e( 'Cancel', 'coming-soon' ); ?>
</button>
<button type="button" class="button button-primary seedprod-button-primary" id="seedprod-save-conditions-btn">
<span class="button-text"><?php esc_html_e( 'Save Conditions', 'coming-soon' ); ?></span>
<span class="spinner" style="display: none;"></span>
</button>
</div>
</div>
</div>
<!-- Add New Template Modal -->
<div id="seedprod-new-template-modal" class="seedprod-modal" style="display: none;">
<div class="seedprod-modal-overlay"></div>
<div class="seedprod-modal-content seedprod-modal-content-large">
<div class="seedprod-modal-header">
<h2><?php esc_html_e( 'New Theme Template', 'coming-soon' ); ?></h2>
<button type="button" class="seedprod-modal-close" aria-label="<?php esc_attr_e( 'Close', 'coming-soon' ); ?>">
<span class="dashicons dashicons-no-alt"></span>
</button>
</div>
<div class="seedprod-modal-body">
<form id="seedprod-new-template-form">
<div class="seedprod-form-group">
<label for="template-name">
<?php esc_html_e( 'Template Name', 'coming-soon' ); ?>
<span class="required">*</span>
</label>
<input type="text"
id="template-name"
name="template_name"
class="seedprod-form-control"
placeholder="<?php esc_attr_e( 'Example: Main Header, Blog Page, Search Results', 'coming-soon' ); ?>"
required />
</div>
<div class="seedprod-form-group">
<label for="template-type">
<?php esc_html_e( 'Template Type', 'coming-soon' ); ?>
<span class="required">*</span>
</label>
<select id="template-type" name="template_type" class="seedprod-form-control" required>
<option value=""><?php esc_html_e( 'Select Type', 'coming-soon' ); ?></option>
<optgroup label="<?php esc_attr_e( 'Site Parts', 'coming-soon' ); ?>">
<option value="header"><?php esc_html_e( 'Header', 'coming-soon' ); ?></option>
<option value="footer"><?php esc_html_e( 'Footer', 'coming-soon' ); ?></option>
<option value="part"><?php esc_html_e( 'Template Part', 'coming-soon' ); ?></option>
</optgroup>
<optgroup label="<?php esc_attr_e( 'Pages', 'coming-soon' ); ?>">
<option value="single_page"><?php esc_html_e( 'Single Page', 'coming-soon' ); ?></option>
<option value="single_post"><?php esc_html_e( 'Single Post', 'coming-soon' ); ?></option>
<option value="archive"><?php esc_html_e( 'Archive', 'coming-soon' ); ?></option>
<option value="search"><?php esc_html_e( 'Search Results', 'coming-soon' ); ?></option>
<option value="author"><?php esc_html_e( 'Author Page', 'coming-soon' ); ?></option>
</optgroup>
<optgroup label="<?php esc_attr_e( 'Advanced', 'coming-soon' ); ?>">
<option value="custom"><?php esc_html_e( 'Custom', 'coming-soon' ); ?></option>
</optgroup>
<?php if ( class_exists( 'WooCommerce' ) ) : ?>
<optgroup label="<?php esc_attr_e( 'WooCommerce', 'coming-soon' ); ?>">
<option value="single_product"><?php esc_html_e( 'Single Product', 'coming-soon' ); ?></option>
<option value="archive_product"><?php esc_html_e( 'Product Archive', 'coming-soon' ); ?></option>
</optgroup>
<?php endif; ?>
</select>
</div>
<div class="seedprod-form-group">
<label for="template-priority">
<?php esc_html_e( 'Priority', 'coming-soon' ); ?>
</label>
<input type="number"
id="template-priority"
name="template_priority"
class="seedprod-form-control seedprod-form-control-small"
value="20"
min="0"
max="999" />
<p class="description" style="margin-top: 5px;">
<?php esc_html_e( 'Higher priority templates will override lower priority ones.', 'coming-soon' ); ?>
</p>
</div>
<div class="seedprod-form-group" id="template-conditions-section" style="display: none;">
<label>
<?php esc_html_e( 'Display Conditions', 'coming-soon' ); ?>
</label>
<div id="template-conditions-list" class="seedprod-conditions-list seedprod-conditions-list-compact">
<!-- Conditions will be added dynamically -->
</div>
<button type="button" class="button seedprod-add-template-condition" style="margin-top: 10px;">
<span class="dashicons dashicons-plus-alt" style="font-size: 16px; line-height: 28px;"></span>
<?php esc_html_e( 'Add Condition', 'coming-soon' ); ?>
</button>
</div>
</form>
</div>
<div class="seedprod-modal-footer">
<button type="button" class="button button-secondary seedprod-modal-cancel">
<?php esc_html_e( 'Cancel', 'coming-soon' ); ?>
</button>
<button type="button" class="button button-primary seedprod-button-primary" id="seedprod-create-template-btn">
<span class="button-text"><?php esc_html_e( 'Create Template', 'coming-soon' ); ?></span>
<span class="spinner" style="display: none;"></span>
</button>
</div>
</div>
</div>
</div>
<!-- Import/Export Modal -->
<div id="seedprod-import-export-modal" class="seedprod-modal" style="display: none;">
<div class="seedprod-modal-content">
<div class="seedprod-modal-header">
<h2><?php esc_html_e( 'Import/Export Templates', 'coming-soon' ); ?></h2>
<button type="button" class="seedprod-modal-close" aria-label="<?php esc_attr_e( 'Close', 'coming-soon' ); ?>">
<span class="dashicons dashicons-no-alt"></span>
</button>
</div>
<div class="seedprod-modal-body">
<!-- Tab Navigation -->
<div class="seedprod-import-export-tabs">
<button type="button" class="seedprod-tab-button active" data-tab="export">
<?php esc_html_e( 'Export', 'coming-soon' ); ?>
</button>
<button type="button" class="seedprod-tab-button" data-tab="import">
<?php esc_html_e( 'Import', 'coming-soon' ); ?>
</button>
</div>
<!-- Export Tab Content -->
<div class="seedprod-tab-content" id="seedprod-export-tab" style="display: block;">
<div class="seedprod-export-section">
<h3><?php esc_html_e( 'Export Theme Templates', 'coming-soon' ); ?></h3>
<p class="description"><?php esc_html_e( 'Export all your theme templates including headers, footers, pages, and template parts. The export will include all template settings, conditions, and associated images.', 'coming-soon' ); ?></p>
<div class="seedprod-export-actions">
<button type="button" class="button button-primary seedprod-button-primary" id="seedprod-export-theme-btn">
<span class="dashicons dashicons-download"></span>
<span class="button-text"><?php esc_html_e( 'Export All Templates', 'coming-soon' ); ?></span>
<span class="spinner" style="display: none;"></span>
</button>
</div>
<div class="seedprod-export-status" style="display: none;">
<div class="notice notice-info">
<p><?php esc_html_e( 'Preparing export file...', 'coming-soon' ); ?></p>
</div>
</div>
</div>
</div>
<!-- Import Tab Content -->
<div class="seedprod-tab-content" id="seedprod-import-tab" style="display: none;">
<div class="seedprod-import-section">
<h3><?php esc_html_e( 'Import Theme Templates', 'coming-soon' ); ?></h3>
<p class="description"><?php esc_html_e( 'Import theme templates from a SeedProd export file (.zip). This will add the templates to your existing theme.', 'coming-soon' ); ?></p>
<div class="seedprod-import-options">
<div class="seedprod-import-file-section">
<h4><?php esc_html_e( 'Upload File', 'coming-soon' ); ?></h4>
<div class="seedprod-file-upload">
<input type="file" id="seedprod-import-file" accept=".zip" style="display: none;">
<button type="button" class="button" id="seedprod-select-file-btn">
<span class="dashicons dashicons-upload"></span>
<?php esc_html_e( 'Select File', 'coming-soon' ); ?>
</button>
<span class="seedprod-file-name"></span>
</div>
</div>
<div class="seedprod-import-url-section">
<h4><?php esc_html_e( 'Or Import from URL', 'coming-soon' ); ?></h4>
<input type="url" id="seedprod-import-url" class="regular-text" placeholder="https://example.com/theme-export.zip">
</div>
</div>
<div class="seedprod-import-warning">
<div class="notice notice-warning inline">
<p>
<strong><?php esc_html_e( 'Important:', 'coming-soon' ); ?></strong>
<?php esc_html_e( 'Importing will create new templates. If you have existing templates with the same names, duplicates will be created. The Global CSS template will be replaced if it exists. We recommend backing up your site before importing.', 'coming-soon' ); ?>
</p>
</div>
</div>
<div class="seedprod-import-actions">
<button type="button" class="button button-primary seedprod-button-primary" id="seedprod-import-theme-btn" disabled>
<span class="dashicons dashicons-upload"></span>
<span class="button-text"><?php esc_html_e( 'Import Templates', 'coming-soon' ); ?></span>
<span class="spinner" style="display: none;"></span>
</button>
</div>
<div class="seedprod-import-status" style="display: none;">
<div class="notice">
<p></p>
</div>
</div>
</div>
</div>
</div>
<div class="seedprod-modal-footer">
<button type="button" class="button button-secondary seedprod-modal-cancel">
<?php esc_html_e( 'Close', 'coming-soon' ); ?>
</button>
</div>
</div>
</div>
seedprod-admin-settings.php 0000644 00000071762 15233474616 0012036 0 ustar 00 <?php
/**
* Settings page for SeedProd Lite
*
* @package SeedProd
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Get current tab.
$current_tab = isset( $_GET['tab'] ) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : 'general'; // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Read-only parameter for tab display.
// Define tabs.
$tabs_array = array(
'general' => __( 'General', 'coming-soon' ),
'subscribers' => __( 'Subscribers', 'coming-soon' ),
'recommended-plugins' => __( 'Recommended Plugins', 'coming-soon' ),
'about' => __( 'About Us', 'coming-soon' ),
);
?>
<div class="seedprod-dashboard-page seedprod-settings-page">
<?php
// Include header with page title.
$page_title = __( 'Settings', 'coming-soon' );
require_once plugin_dir_path( __FILE__ ) . 'seedprod-admin-header.php';
?>
<div class="seedprod-dashboard-container">
<!-- Tab Navigation using WordPress native classes -->
<nav class="nav-tab-wrapper">
<?php foreach ( $tabs_array as $tab_key => $tab_label ) : ?>
<a href="<?php echo esc_url( add_query_arg( 'tab', $tab_key, admin_url( 'admin.php?page=seedprod_lite_settings' ) ) ); ?>"
class="nav-tab <?php echo esc_attr( $current_tab === $tab_key ? 'nav-tab-active' : '' ); ?>">
<?php echo esc_html( $tab_label ); ?>
</a>
<?php endforeach; ?>
</nav>
<!-- Tab Content using existing card class -->
<div class="postbox seedprod-card">
<div class="inside">
<?php if ( 'general' === $current_tab ) : ?>
<!-- General Tab -->
<div class="seedprod-tab-panel" id="seedprod-general-tab">
<?php
// Get app settings and decode if JSON.
$app_settings_json = get_option( 'seedprod_app_settings' );
$app_settings = ! empty( $app_settings_json ) ? json_decode( $app_settings_json, true ) : array();
?>
<form method="post" action="" id="seedprod-settings-form">
<?php wp_nonce_field( 'seedprod_settings_save', 'seedprod_settings_nonce' ); ?>
<!-- License Section -->
<h2><?php esc_html_e( 'License', 'coming-soon' ); ?></h2>
<?php
$is_lite_view = seedprod_lite_v2_is_lite_view();
if ( ! $is_lite_view ) :
?>
<p><?php esc_html_e( 'Your license key provides access to updates and addons.', 'coming-soon' ); ?></p>
<?php else : ?>
<p>
<?php echo wp_kses_post( __( 'You\'re using <strong>SeedProd Lite</strong> - No License needed. Enjoy! 🙂', 'coming-soon' ) ); ?>
</p>
<p>
<?php
$upgrade_url = seedprod_lite_get_external_link(
'https://www.seedprod.com/lite-upgrade/?discount=LITEUPGRADE',
'seedprod-license-page',
'liteplugin'
);
/* translators: %s: Upgrade URL */
printf( wp_kses_post( __( 'To unlock more features consider <a href="%s" target="_blank">upgrading to PRO</a>. As a valued SeedProd Lite user you\'ll receive <strong>a discount off the regular price</strong>, automatically applied at checkout!', 'coming-soon' ) ), esc_url( $upgrade_url ) );
?>
</p>
<?php endif; ?>
<table class="form-table">
<tbody>
<tr>
<th scope="row">
<label for="seedprod-license-key"><?php esc_html_e( 'License Key', 'coming-soon' ); ?></label>
</th>
<td>
<?php
$license_key = get_option( 'seedprod_api_key' );
$license_name = get_option( 'seedprod_license_name' );
?>
<input type="password"
id="seedprod-license-key"
name="seedprod_license_key"
value="<?php echo esc_attr( $license_key ); ?>"
class="regular-text"
placeholder="<?php esc_attr_e( 'Enter Your License Key Here', 'coming-soon' ); ?>" />
<?php if ( $license_name ) : ?>
<button type="button" class="button button-primary seedprod-button-primary" id="seedprod-recheck-license">
<?php esc_html_e( 'Recheck Key', 'coming-soon' ); ?>
</button>
<button type="button" class="button seedprod-button-secondary" id="seedprod-deactivate-license">
<?php esc_html_e( 'Deactivate Key', 'coming-soon' ); ?>
</button>
<?php else : ?>
<button type="button" class="button button-primary seedprod-button-primary" id="seedprod-verify-license">
<?php
if ( seedprod_lite_v2_is_lite_view() ) {
esc_html_e( 'Connect to SeedProd.com', 'coming-soon' );
} else {
esc_html_e( 'Verify Key', 'coming-soon' );
}
?>
</button>
<?php endif; ?>
<div id="seedprod-license-message"></div>
<?php if ( $license_name ) : ?>
<div class="seedprod-license-badge seedprod-license-badge-active">
<div class="seedprod-license-badge-icon">
<span class="dashicons dashicons-awards"></span>
</div>
<div class="seedprod-license-badge-content">
<span class="seedprod-license-badge-label"><?php esc_html_e( 'ACTIVE LICENSE', 'coming-soon' ); ?></span>
<span class="seedprod-license-badge-type"><?php echo esc_html( $license_name ); ?></span>
</div>
<div class="seedprod-license-badge-check">
<span class="dashicons dashicons-yes"></span>
</div>
</div>
<?php else : ?>
<div class="seedprod-license-badge seedprod-license-badge-inactive">
<div class="seedprod-license-badge-icon">
<span class="dashicons dashicons-warning"></span>
</div>
<div class="seedprod-license-badge-content">
<span class="seedprod-license-badge-label"><?php esc_html_e( 'NO ACTIVE LICENSE', 'coming-soon' ); ?></span>
<span class="seedprod-license-badge-help">
<?php esc_html_e( "Don't have a license?", 'coming-soon' ); ?>
<a href="<?php echo esc_url( seedprod_lite_get_pricing_link( 'settings-license-badge' ) ); ?>" target="_blank" rel="noopener">
<?php esc_html_e( 'Get one here', 'coming-soon' ); ?>
</a>
</span>
</div>
<div class="seedprod-license-badge-action">
<span class="dashicons dashicons-no"></span>
</div>
</div>
<?php endif; ?>
</td>
</tr>
</tbody>
</table>
<!-- Global Settings Section -->
<h2><?php esc_html_e( 'Global Settings', 'coming-soon' ); ?></h2>
<table class="form-table">
<tbody>
<?php if ( ! $is_lite_view ) : ?>
<tr>
<th scope="row">
<label for="seedprod-facebook-app-id"><?php esc_html_e( 'Facebook APP ID', 'coming-soon' ); ?></label>
</th>
<td>
<?php
$fb_app_id = ! empty( $app_settings['facebook_g_app_id'] ) ? $app_settings['facebook_g_app_id'] : '';
?>
<input type="text"
id="seedprod-facebook-app-id"
name="seedprod_facebook_app_id"
value="<?php echo esc_attr( $fb_app_id ); ?>"
class="regular-text" />
</td>
</tr>
<tr>
<th scope="row">
<label for="seedprod-google-places-key"><?php esc_html_e( 'Google Places API Key', 'coming-soon' ); ?></label>
</th>
<td>
<?php $google_key = ! empty( $app_settings['google_places_app_key'] ) ? $app_settings['google_places_app_key'] : ''; ?>
<input type="text"
id="seedprod-google-places-key"
name="seedprod_google_places_key"
value="<?php echo esc_attr( $google_key ); ?>"
class="regular-text" />
</td>
</tr>
<tr>
<th scope="row">
<label for="seedprod-yelp-api-key"><?php esc_html_e( 'Yelp API Key', 'coming-soon' ); ?></label>
</th>
<td>
<?php $yelp_key = ! empty( $app_settings['yelp_app_api_key'] ) ? $app_settings['yelp_app_api_key'] : ''; ?>
<input type="text"
id="seedprod-yelp-api-key"
name="seedprod_yelp_api_key"
value="<?php echo esc_attr( $yelp_key ); ?>"
class="regular-text" />
</td>
</tr>
<?php endif; ?>
<tr>
<th scope="row">
<?php esc_html_e( 'Disable Edit with SeedProd Button', 'coming-soon' ); ?>
</th>
<td>
<?php
$disable_button = ! empty( $app_settings['disable_seedprod_button'] ) ? $app_settings['disable_seedprod_button'] : false;
?>
<label for="seedprod-disable-button">
<input type="checkbox"
id="seedprod-disable-button"
name="seedprod_disable_button"
value="1"
<?php checked( $disable_button, true ); ?> />
<?php esc_html_e( 'Disable the Edit with SeedProd button in the admin area', 'coming-soon' ); ?>
</label>
</td>
</tr>
<tr>
<th scope="row">
<?php esc_html_e( 'Enable Usage Tracking', 'coming-soon' ); ?>
</th>
<td>
<?php
$usage_tracking = ! empty( $app_settings['enable_usage_tracking'] ) ? $app_settings['enable_usage_tracking'] : false;
?>
<label for="seedprod-usage-tracking">
<input type="checkbox"
id="seedprod-usage-tracking"
name="seedprod_usage_tracking"
value="1"
<?php checked( $usage_tracking, true ); ?> />
<?php esc_html_e( 'Help improve SeedProd by sharing anonymous usage data', 'coming-soon' ); ?>
</label>
<p class="description">
<a href="<?php echo esc_url( seedprod_lite_get_external_link( 'https://www.seedprod.com/docs/usage-tracking/', 'settings-usage-tracking', seedprod_lite_v2_is_lite_view() ? 'liteplugin' : 'proplugin' ) ); ?>" target="_blank">
<?php esc_html_e( 'Learn More', 'coming-soon' ); ?>
</a>
</p>
</td>
</tr>
<tr>
<th scope="row">
<?php esc_html_e( 'Disable SeedProd Notifications', 'coming-soon' ); ?>
</th>
<td>
<?php
$disable_notifications = ! empty( $app_settings['disable_seedprod_notification'] ) ? $app_settings['disable_seedprod_notification'] : false;
?>
<label for="seedprod-disable-notifications">
<input type="checkbox"
id="seedprod-disable-notifications"
name="seedprod_disable_notifications"
value="1"
<?php checked( $disable_notifications, true ); ?> />
<?php esc_html_e( 'Disable admin notifications from SeedProd', 'coming-soon' ); ?>
</label>
</td>
</tr>
</tbody>
</table>
<p class="submit">
<button type="submit" class="button button-primary seedprod-button-primary" id="seedprod-save-settings">
<?php esc_html_e( 'Save Settings', 'coming-soon' ); ?>
</button>
</p>
</form>
<!-- Debug Information Section -->
<hr />
<h2><?php esc_html_e( 'Debug Information', 'coming-soon' ); ?></h2>
<div class="seedprod-debug-section">
<p>
<button type="button" class="button seedprod-button-secondary" id="seedprod-toggle-system-info">
<span class="dashicons dashicons-arrow-down-alt2"></span>
<?php esc_html_e( 'View System Information', 'coming-soon' ); ?>
</button>
<a href="<?php echo esc_url( admin_url( 'admin.php?page=seedprod_lite_debug' ) ); ?>" class="button seedprod-button-secondary">
<span class="dashicons dashicons-admin-tools"></span>
<?php esc_html_e( 'Advanced Debug Tools', 'coming-soon' ); ?>
</a>
</p>
<div id="seedprod-system-info" style="display: none; margin-top: 20px;">
<p class="description">
<?php esc_html_e( 'Copy this information when contacting support to help us assist you better.', 'coming-soon' ); ?>
</p>
<textarea id="seedprod-system-info-text" readonly="readonly" class="large-text" rows="15" onclick="this.select();"><?php echo esc_textarea( seedprod_lite_v2_get_system_info() ); ?></textarea>
<p>
<button type="button" class="button seedprod-button-secondary" id="seedprod-copy-system-info">
<?php esc_html_e( 'Copy to Clipboard', 'coming-soon' ); ?>
</button>
</p>
</div>
</div>
</div>
<?php elseif ( 'subscribers' === $current_tab ) : ?>
<!-- Subscribers Tab -->
<div class="seedprod-tab-panel" id="seedprod-subscribers-tab">
<?php
// Get subscriber stats.
$stats = seedprod_lite_v2_get_subscriber_stats();
$pages_list = seedprod_lite_v2_get_subscriber_pages();
// Check OptinMonster status.
$optinmonster_installed = false;
$optinmonster_active = false;
$optinmonster_slug = 'optinmonster/optin-monster-wp-api.php';
if ( ! function_exists( 'get_plugins' ) ) {
require_once ABSPATH . 'wp-admin/includes/plugin.php';
}
$all_plugins = get_plugins();
if ( isset( $all_plugins[ $optinmonster_slug ] ) ) {
$optinmonster_installed = true;
$optinmonster_active = is_plugin_active( $optinmonster_slug );
}
?>
<script type="text/javascript">
window.seedprodOptinMonster = {
installed: <?php echo $optinmonster_installed ? 'true' : 'false'; ?>,
active: <?php echo $optinmonster_active ? 'true' : 'false'; ?>,
slug: '<?php echo esc_js( $optinmonster_slug ); ?>'
};
</script>
<!-- Header with export and filters -->
<div class="seedprod-subscribers-header">
<h2><?php esc_html_e( 'Subscribers Overview', 'coming-soon' ); ?></h2>
<?php if ( $stats['total'] > 0 ) : ?>
<div class="seedprod-subscribers-controls">
<button type="button" class="button seedprod-button-secondary" id="seedprod-export-subscribers">
<span class="dashicons dashicons-download"></span>
<?php esc_html_e( 'Export to CSV', 'coming-soon' ); ?>
</button>
<select id="seedprod-subscriber-page-filter" class="seedprod-select">
<option value="all"><?php esc_html_e( 'All Pages', 'coming-soon' ); ?></option>
<?php foreach ( $pages_list as $page_item ) : ?>
<option value="<?php echo esc_attr( $page_item['uuid'] ); ?>">
<?php echo esc_html( $page_item['name'] ); ?>
</option>
<?php endforeach; ?>
</select>
</div>
<?php endif; ?>
</div>
<?php if ( $stats['total'] > 0 ) : ?>
<!-- Search Box -->
<div class="seedprod-subscribers-search-box">
<input type="text"
id="seedprod-subscriber-search"
placeholder="<?php esc_attr_e( 'Search by email or name...', 'coming-soon' ); ?>"
class="regular-text" />
<button type="button" class="button" id="seedprod-subscriber-search-btn">
<?php esc_html_e( 'Search', 'coming-soon' ); ?>
</button>
<button type="button" class="button" id="seedprod-subscriber-clear-search" style="display: none;">
<?php esc_html_e( 'Clear', 'coming-soon' ); ?>
</button>
</div>
<!-- Subscribers Table -->
<table class="wp-list-table widefat fixed striped table-view-list" id="seedprod-subscribers-table">
<thead>
<tr>
<td class="manage-column column-cb check-column">
<input type="checkbox" id="seedprod-subscriber-select-all" />
</td>
<th scope="col" class="manage-column column-email sortable">
<a href="#" data-sort="email">
<span><?php esc_html_e( 'Email', 'coming-soon' ); ?></span>
<span class="sorting-indicator"></span>
</a>
</th>
<th scope="col" class="manage-column column-name sortable">
<a href="#" data-sort="fname">
<span><?php esc_html_e( 'Name', 'coming-soon' ); ?></span>
<span class="sorting-indicator"></span>
</a>
</th>
<th scope="col" class="manage-column column-created sortable desc">
<a href="#" data-sort="created">
<span><?php esc_html_e( 'Created', 'coming-soon' ); ?></span>
<span class="sorting-indicator"></span>
</a>
</th>
<th scope="col" class="manage-column column-actions"><?php esc_html_e( 'Actions', 'coming-soon' ); ?></th>
</tr>
</thead>
<tbody id="seedprod-subscribers-list">
<tr>
<td colspan="5" class="seedprod-loading-message">
<span class="dashicons dashicons-update spin"></span>
<?php esc_html_e( 'Loading subscribers...', 'coming-soon' ); ?>
</td>
</tr>
</tbody>
<tfoot>
<tr>
<td class="manage-column column-cb check-column">
<input type="checkbox" class="seedprod-subscriber-select-all-bottom" />
</td>
<th scope="col" class="manage-column column-email"><?php esc_html_e( 'Email', 'coming-soon' ); ?></th>
<th scope="col" class="manage-column column-name"><?php esc_html_e( 'Name', 'coming-soon' ); ?></th>
<th scope="col" class="manage-column column-created"><?php esc_html_e( 'Created', 'coming-soon' ); ?></th>
<th scope="col" class="manage-column column-actions"><?php esc_html_e( 'Actions', 'coming-soon' ); ?></th>
</tr>
</tfoot>
</table>
<!-- Bulk Actions -->
<div class="tablenav bottom">
<div class="alignleft actions bulkactions">
<select id="seedprod-subscriber-bulk-action">
<option value=""><?php esc_html_e( 'Bulk Actions', 'coming-soon' ); ?></option>
<option value="delete"><?php esc_html_e( 'Delete', 'coming-soon' ); ?></option>
</select>
<button type="button" class="button action" id="seedprod-subscriber-bulk-apply">
<?php esc_html_e( 'Apply', 'coming-soon' ); ?>
</button>
</div>
<!-- Pagination -->
<div class="tablenav-pages">
<span class="displaying-num">
<span id="seedprod-subscriber-count">0</span> <?php esc_html_e( 'items', 'coming-soon' ); ?>
</span>
<span class="seedprod-pagination-links" id="seedprod-subscriber-pagination">
<!-- Pagination will be inserted here via JS -->
</span>
</div>
</div>
<?php else : ?>
<!-- Show table with just OptinMonster row when no subscribers -->
<table class="wp-list-table widefat fixed striped table-view-list" id="seedprod-subscribers-table">
<thead>
<tr>
<td class="manage-column column-cb check-column">
<input type="checkbox" id="seedprod-subscriber-select-all" />
</td>
<th scope="col" class="manage-column column-email sortable">
<a href="#" data-sort="email">
<span><?php esc_html_e( 'Email', 'coming-soon' ); ?></span>
<span class="sorting-indicator"></span>
</a>
</th>
<th scope="col" class="manage-column column-name sortable">
<a href="#" data-sort="name">
<span><?php esc_html_e( 'Name', 'coming-soon' ); ?></span>
<span class="sorting-indicator"></span>
</a>
</th>
<th scope="col" class="manage-column column-created sortable">
<a href="#" data-sort="created_at">
<span><?php esc_html_e( 'Created', 'coming-soon' ); ?></span>
<span class="sorting-indicator"></span>
</a>
</th>
<th scope="col" class="manage-column column-actions"><?php esc_html_e( 'Actions', 'coming-soon' ); ?></th>
</tr>
</thead>
<tbody id="seedprod-subscribers-list">
<!-- OptinMonster row will be inserted here by JavaScript -->
</tbody>
</table>
<?php endif; ?>
</div>
<?php elseif ( 'recommended-plugins' === $current_tab ) : ?>
<!-- Recommended Plugins Tab -->
<div class="seedprod-tab-panel" id="seedprod-recommended-plugins-tab">
<?php
// Check for filter parameter.
$filter = isset( $_GET['filter'] ) ? sanitize_text_field( wp_unslash( $_GET['filter'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Read-only parameter for filtering.
if ( $filter ) :
?>
<a href="<?php echo esc_url( admin_url( 'admin.php?page=seedprod_lite_settings&tab=recommended-plugins' ) ); ?>" class="button button-link" style="margin-bottom: 10px;">
← <?php esc_html_e( 'View All Plugins', 'coming-soon' ); ?>
</a>
<?php endif; ?>
<h2><?php esc_html_e( 'Recommended Plugins', 'coming-soon' ); ?></h2>
<p><?php esc_html_e( 'Supercharge your website with our recommended WordPress plugins.', 'coming-soon' ); ?></p>
<div class="seedprod-plugins-grid">
<?php
// When filtering, get ALL plugins (including active ones).
// Otherwise, get only non-active plugins.
if ( isset( $_GET['filter'] ) && ! empty( $_GET['filter'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Already sanitized above.
$all_plugins = seedprod_lite_v2_get_recommended_plugins();
} else {
$all_plugins = seedprod_lite_v2_get_all_recommended_plugins();
}
// If filter is set, only show that plugin.
if ( $filter && isset( $all_plugins[ $filter ] ) ) {
$filtered_plugins = array( $filter => $all_plugins[ $filter ] );
} else {
// Shuffle the plugins array to randomize order on each page load.
$keys = array_keys( $all_plugins );
shuffle( $keys );
$shuffled_plugins = array();
foreach ( $keys as $key ) {
$shuffled_plugins[ $key ] = $all_plugins[ $key ];
}
$filtered_plugins = $shuffled_plugins;
} foreach ( $filtered_plugins as $plugin_key => $plugin_data ) :
$plugin_status = seedprod_lite_v2_get_plugin_status( $plugin_data['slug'] );
?>
<div class="seedprod-plugin-card" data-plugin="<?php echo esc_attr( $plugin_key ); ?>">
<div class="seedprod-plugin-card-content">
<div class="seedprod-plugin-header">
<img src="<?php echo esc_url( $plugin_data['icon'] ); ?>"
alt="<?php echo esc_attr( $plugin_data['name'] ); ?>"
class="seedprod-plugin-icon" />
<div class="seedprod-plugin-info">
<h4><?php echo esc_html( $plugin_data['name'] ); ?></h4>
<p class="seedprod-plugin-description"><?php echo esc_html( $plugin_data['desc'] ); ?></p>
</div>
</div>
<div class="seedprod-plugin-footer">
<div class="seedprod-plugin-status">
<?php
switch ( $plugin_status['status'] ) {
case 0:
echo '<span class="seedprod-status-badge seedprod-status-not-installed">' . esc_html__( 'NOT INSTALLED', 'coming-soon' ) . '</span>';
break;
case 1:
echo '<span class="seedprod-status-badge seedprod-status-active">' . esc_html__( 'ACTIVE', 'coming-soon' ) . '</span>';
break;
case 2:
echo '<span class="seedprod-status-badge seedprod-status-inactive">' . esc_html__( 'INACTIVE', 'coming-soon' ) . '</span>';
break;
case 3:
echo '<span class="seedprod-status-badge seedprod-status-active">' . esc_html__( 'PRO VERSION', 'coming-soon' ) . '</span>';
break;
}
?>
</div>
<?php if ( 3 !== $plugin_status['status'] ) : // Not Pro version. ?>
<button class="button seedprod-plugin-button
<?php echo 1 === $plugin_status['status'] ? 'seedprod-button-secondary' : 'button-primary seedprod-button-primary'; ?>"
data-plugin-slug="<?php echo esc_attr( $plugin_data['slug'] ); ?>"
data-plugin-id="<?php echo esc_attr( $plugin_key ); ?>"
data-status="<?php echo esc_attr( $plugin_status['status'] ); ?>">
<span class="button-text">
<?php
switch ( $plugin_status['status'] ) {
case 0:
esc_html_e( 'Install', 'coming-soon' );
break;
case 1:
esc_html_e( 'Deactivate', 'coming-soon' );
break;
case 2:
esc_html_e( 'Activate', 'coming-soon' );
break;
}
?>
</span>
<span class="button-spinner" style="display: none;">
<span class="dashicons dashicons-update"></span>
</span>
</button>
<?php endif; ?>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
<?php elseif ( 'about' === $current_tab ) : ?>
<!-- About Us Tab -->
<div class="seedprod-tab-panel" id="seedprod-about-tab">
<div class="seedprod-about-content">
<div class="seedprod-about-main">
<div class="seedprod-about-text">
<h2><?php esc_html_e( 'About SeedProd', 'coming-soon' ); ?></h2>
<p>
<?php esc_html_e( 'Hello and welcome to SeedProd, the #1 WordPress Website Builder with AI. At SeedProd, we build software that helps you create stunning WordPress websites in minutes, not weeks. Our drag & drop builder and AI-powered tools help you design complete websites, landing pages, and custom themes without writing any code.', 'coming-soon' ); ?>
</p>
<p>
<?php esc_html_e( 'What started as a simple coming soon page plugin has evolved into a complete website builder. Today, SeedProd powers millions of websites with our AI website generator, 90+ professional design blocks, theme builder, and extensive template library. Build everything from business websites to online stores, portfolios, and blogs.', 'coming-soon' ); ?>
</p>
<p>
<?php esc_html_e( 'Our mission is simple: empower anyone to build a professional WordPress website without technical skills. With our new AI technology, you can describe your business and watch as a complete website is generated in just 60 seconds.', 'coming-soon' ); ?>
</p>
<p>
<?php
/* translators: 1: WPBeginner link, 2: OptinMonster link, 3: MonsterInsights link, 4: WPForms link, 5: RafflePress link, 6: TrustPulse link */
printf( esc_html__( 'SeedProd is brought to you by the same team that\'s behind the largest WordPress resource site, %1$s, the most popular lead-generation software, %2$s, the best WordPress analytics plugin, %3$s, the best WordPress forms plugin, %4$s, the best WordPress giveaway plugin, %5$s, and finally the best WordPress FOMO plugin, %6$s.', 'coming-soon' ), '<a href="https://www.wpbeginner.com/?utm_source=seedprodplugin&utm_medium=pluginaboutpage&utm_campaign=aboutseedprod" target="_blank" rel="noopener">WPBeginner</a>', '<a href="https://optinmonster.com/?utm_source=seedprodplugin&utm_medium=pluginaboutpage&utm_campaign=aboutseedprod" target="_blank" rel="noopener">OptinMonster</a>', '<a href="https://www.monsterinsights.com/?utm_source=seedprodplugin&utm_medium=pluginaboutpage&utm_campaign=aboutseedprod" target="_blank" rel="noopener">MonsterInsights</a>', '<a href="https://www.wpforms.com/?utm_source=seedprodplugin&utm_medium=pluginaboutpage&utm_campaign=aboutseedprod" target="_blank" rel="noopener">WPForms</a>', '<a href="https://rafflepress.com/?utm_source=seedprodplugin&utm_medium=pluginaboutpage&utm_campaign=aboutseedprod" target="_blank" rel="noopener">RafflePress</a>', '<a href="https://trustpulse.com/?utm_source=seedprodplugin&utm_medium=pluginaboutpage&utm_campaign=aboutseedprod" target="_blank" rel="noopener">TrustPulse</a>' );
?>
</p>
<p>
<?php esc_html_e( 'Yup, we know a thing or two about building awesome products that customers love.', 'coming-soon' ); ?>
</p>
</div>
<div class="seedprod-about-image">
<img src="<?php echo esc_url( plugin_dir_url( __DIR__ ) . 'images/team.jpg' ); ?>"
alt="<?php esc_attr_e( 'SeedProd Team photo', 'coming-soon' ); ?>"
class="seedprod-team-photo" />
<p class="seedprod-team-caption">
<?php esc_html_e( 'The Awesome Motive Team', 'coming-soon' ); ?>
</p>
</div>
</div>
<?php if ( $is_lite_view ) : ?>
<!-- Lite CTA -->
<div class="seedprod-about-cta">
<h3><?php esc_html_e( 'Unlock SeedProd Lite Today', 'coming-soon' ); ?></h3>
<p><?php esc_html_e( 'Get access to all our premium features including theme builder, WooCommerce blocks, advanced integrations, and more!', 'coming-soon' ); ?></p>
<a href="<?php echo esc_url( seedprod_lite_get_upgrade_link( 'about-us' ) ); ?>"
target="_blank"
class="button button-primary seedprod-upgrade-button">
<span class="dashicons dashicons-star-filled seedprod-upgrade-icon"></span>
<?php esc_html_e( 'Upgrade to Pro', 'coming-soon' ); ?>
</a>
</div>
<?php endif; ?>
</div>
</div>
<?php endif; ?>
</div><!-- /.inside -->
</div><!-- /.postbox -->
</div><!-- /.seedprod-dashboard-container -->
</div><!-- /.seedprod-settings-page -->
seedprod-admin-subscribers.php 0000644 00000004036 15233474616 0012512 0 ustar 00 <?php
/**
* Subscribers page template
*
* Shows subscriber management for Pro users and product education for Lite users.
*
* @package SeedProd
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Check if this is the Lite view (or testing with test_lite=1).
$is_lite_view = seedprod_lite_v2_is_lite_view() || ( isset( $_GET['test_lite'] ) && '1' === $_GET['test_lite'] ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Read-only parameter for display logic.
// If Lite view, show product education.
if ( $is_lite_view ) {
if ( ! class_exists( 'SeedProd_Lite_Admin' ) ) {
require_once plugin_dir_path( __DIR__ ) . 'class-seedprod-admin.php';
}
$admin = new SeedProd_Lite_Admin( 'coming-soon', SEEDPROD_VERSION );
$admin->render_subscribers_education();
return;
}
// Pro version: Show actual subscribers functionality.
?>
<div class="wrap">
<div class="seedprod-dashboard-page">
<?php
$page_title = __( 'Subscribers', 'coming-soon' );
require_once plugin_dir_path( __FILE__ ) . 'seedprod-admin-header.php';
?>
<div class="seedprod-dashboard-container">
<div class="postbox seedprod-card">
<div class="inside">
<h2><?php esc_html_e( 'Email Subscribers', 'coming-soon' ); ?></h2>
<p><?php esc_html_e( 'Manage email subscribers collected from your landing pages and coming soon pages.', 'coming-soon' ); ?></p>
<!-- Placeholder for future subscriber management functionality -->
<div class="notice notice-info">
<p><?php esc_html_e( 'Subscriber management interface coming soon. Subscribers are currently stored in the database and can be accessed via the legacy interface.', 'coming-soon' ); ?></p>
</div>
<!-- Temporary link to old Vue interface if needed -->
<p>
<a href="<?php echo esc_url( admin_url( 'admin.php?page=seedprod_lite_settings&tab=subscribers' ) ); ?>" class="button button-secondary">
<?php esc_html_e( 'View in Legacy Interface', 'coming-soon' ); ?>
</a>
</p>
</div>
</div>
</div>
</div>
</div>
seedprod-admin-template-selection.php 0000644 00000030275 15233474616 0013766 0 ustar 00 <?php
/**
* Template Selection Page
*
* Native WordPress implementation of the template selector
*
* @package SeedProd_Lite
*/
// Exit if accessed directly.
if ( ! defined( 'WPINC' ) ) {
die;
}
// Check if this is the Lite view.
$is_lite_view = seedprod_lite_v2_is_lite_view();
// Check if user has subscribed to free templates (Lite only).
$free_templates_subscribed = false;
if ( $is_lite_view ) {
$free_templates_subscribed = get_option( 'seedprod_free_templates_subscribed', false );
}
// Get current user email for subscription.
$current_user_obj = wp_get_current_user();
$current_user_email = $current_user_obj->user_email;
// Check if we have an existing page ID (edge case: page without template).
$page_id = isset( $_GET['id'] ) ? absint( $_GET['id'] ) : 0;
// Get page name and slug from URL parameters or from existing page.
$page_name = isset( $_GET['name'] ) ? sanitize_text_field( wp_unslash( $_GET['name'] ) ) : '';
$page_slug = isset( $_GET['slug'] ) ? sanitize_text_field( wp_unslash( $_GET['slug'] ) ) : '';
// If we have a page ID but no name/slug, fetch from the database.
if ( $page_id && ( empty( $page_name ) || empty( $page_slug ) ) ) {
$existing_page = get_post( $page_id );
if ( $existing_page ) {
$page_name = empty( $page_name ) ? $existing_page->post_title : $page_name;
$page_slug = empty( $page_slug ) ? $existing_page->post_name : $page_slug;
// Also get the page type from meta if not provided.
if ( empty( $page_type ) ) {
$page_type_meta = get_post_meta( $page_id, '_seedprod_page_template_type', true );
if ( $page_type_meta ) {
$page_type = $page_type_meta;
}
}
}
}
// Get free templates URL with UTM tracking.
$free_templates_url = seedprod_lite_get_external_link(
'https://www.seedprod.com/free-templates',
'template-selection-subscribe',
$is_lite_view ? 'liteplugin' : 'proplugin'
);
// Get active tab.
$active_tab = isset( $_GET['tab'] ) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : 'all-templates';
// Get page type for pre-filtering templates.
$page_type = isset( $_GET['type'] ) ? sanitize_text_field( wp_unslash( $_GET['type'] ) ) : '';
// Map page types to filter values.
$type_to_filter_map = array(
'cs' => 'coming-soon',
'mm' => 'maintenance',
'loginp' => 'login',
'p404' => '404',
);
// Determine default active filter based on page type.
$default_filter = 'all';
if ( ! empty( $page_type ) && isset( $type_to_filter_map[ $page_type ] ) ) {
$default_filter = $type_to_filter_map[ $page_type ];
}
?>
<div class="seedprod-dashboard-page seedprod-template-selection-page">
<?php
// Include header with page title.
$page_title = __( 'Choose a New Page Template', 'coming-soon' );
require_once plugin_dir_path( __FILE__ ) . 'seedprod-admin-header.php';
?>
<div class="seedprod-dashboard-container">
<?php if ( $is_lite_view && ! $free_templates_subscribed ) : ?>
<!-- Free Templates Subscription Banner (Lite Only) -->
<div class="seedprod-free-templates-banner">
<div class="seedprod-banner-content">
<strong><?php esc_html_e( 'Get 10 FREE Templates - Instant Access, No Credit Card Required', 'coming-soon' ); ?></strong>
<div class="seedprod-subscribe-form">
<input type="email"
id="seedprod-subscribe-email"
value="<?php echo esc_attr( $current_user_email ); ?>"
placeholder="<?php esc_attr_e( 'Enter your email', 'coming-soon' ); ?>"
class="seedprod-subscribe-input" />
<button id="seedprod-subscribe-button" class="button button-primary">
<?php esc_html_e( 'Subscribe', 'coming-soon' ); ?>
</button>
</div>
</div>
</div>
<?php endif; ?>
<!-- WordPress Native Tabs -->
<nav class="nav-tab-wrapper">
<a href="<?php echo esc_url( add_query_arg( array( 'page' => 'seedprod_lite_template_selection', 'tab' => 'all-templates', 'name' => $page_name ?: false, 'slug' => $page_slug ?: false, 'type' => $page_type ?: false, 'id' => $page_id ?: false ), admin_url( 'admin.php' ) ) ); ?>"
class="nav-tab <?php echo 'all-templates' === $active_tab ? 'nav-tab-active' : ''; ?>">
<?php esc_html_e( 'All Templates', 'coming-soon' ); ?>
</a>
<a href="<?php echo esc_url( add_query_arg( array( 'page' => 'seedprod_lite_template_selection', 'tab' => 'favorite-templates', 'name' => $page_name ?: false, 'slug' => $page_slug ?: false, 'type' => $page_type ?: false, 'id' => $page_id ?: false ), admin_url( 'admin.php' ) ) ); ?>"
class="nav-tab <?php echo 'favorite-templates' === $active_tab ? 'nav-tab-active' : ''; ?>">
<?php esc_html_e( 'Favorite Templates', 'coming-soon' ); ?>
</a>
<a href="<?php echo esc_url( add_query_arg( array( 'page' => 'seedprod_lite_template_selection', 'tab' => 'saved-templates', 'name' => $page_name ?: false, 'slug' => $page_slug ?: false, 'type' => $page_type ?: false, 'id' => $page_id ?: false ), admin_url( 'admin.php' ) ) ); ?>"
class="nav-tab <?php echo 'saved-templates' === $active_tab ? 'nav-tab-active' : ''; ?>">
<?php esc_html_e( 'Saved Templates', 'coming-soon' ); ?>
</a>
</nav>
<div class="seedprod-template-content">
<?php if ( 'all-templates' === $active_tab ) : ?>
<!-- All Templates Tab -->
<div class="seedprod-template-filters">
<div class="seedprod-template-search">
<input type="text"
id="seedprod-template-search"
placeholder="<?php esc_attr_e( 'Search templates...', 'coming-soon' ); ?>"
class="seedprod-search-input" />
<span class="dashicons dashicons-search"></span>
</div>
<div class="seedprod-filters-section">
<span class="seedprod-filters-label"><?php esc_html_e( 'Filters:', 'coming-soon' ); ?></span>
<div class="seedprod-filter-pills">
<button class="seedprod-filter-pill <?php echo 'all' === $default_filter ? 'active' : ''; ?>" data-filter="all">
<?php esc_html_e( 'All', 'coming-soon' ); ?>
</button>
<button class="seedprod-filter-pill <?php echo 'coming-soon' === $default_filter ? 'active' : ''; ?>" data-filter="coming-soon">
<?php esc_html_e( 'Coming Soon', 'coming-soon' ); ?>
</button>
<button class="seedprod-filter-pill <?php echo 'maintenance' === $default_filter ? 'active' : ''; ?>" data-filter="maintenance">
<?php esc_html_e( 'Maintenance Mode', 'coming-soon' ); ?>
</button>
<button class="seedprod-filter-pill <?php echo '404' === $default_filter ? 'active' : ''; ?>" data-filter="404">
<?php esc_html_e( '404 Page', 'coming-soon' ); ?>
</button>
<button class="seedprod-filter-pill <?php echo 'sales' === $default_filter ? 'active' : ''; ?>" data-filter="sales">
<?php esc_html_e( 'Sales', 'coming-soon' ); ?>
</button>
<button class="seedprod-filter-pill <?php echo 'webinar' === $default_filter ? 'active' : ''; ?>" data-filter="webinar">
<?php esc_html_e( 'Webinar', 'coming-soon' ); ?>
</button>
<button class="seedprod-filter-pill <?php echo 'lead-squeeze' === $default_filter ? 'active' : ''; ?>" data-filter="lead-squeeze">
<?php esc_html_e( 'Lead Squeeze', 'coming-soon' ); ?>
</button>
<button class="seedprod-filter-pill <?php echo 'thank-you' === $default_filter ? 'active' : ''; ?>" data-filter="thank-you">
<?php esc_html_e( 'Thank You', 'coming-soon' ); ?>
</button>
<button class="seedprod-filter-pill <?php echo 'login' === $default_filter ? 'active' : ''; ?>" data-filter="login">
<?php esc_html_e( 'Login', 'coming-soon' ); ?>
</button>
</div>
</div>
</div>
<div class="seedprod-templates-grid" id="all-templates-grid">
<!-- Templates will be loaded here via AJAX -->
<div class="seedprod-templates-loading">
<span class="spinner is-active"></span>
<p><?php esc_html_e( 'Loading templates...', 'coming-soon' ); ?></p>
</div>
</div>
<?php elseif ( 'favorite-templates' === $active_tab ) : ?>
<!-- Favorite Templates Tab -->
<div class="seedprod-templates-grid" id="favorite-templates-grid">
<div class="seedprod-templates-loading">
<span class="spinner is-active"></span>
<p><?php esc_html_e( 'Loading favorite templates...', 'coming-soon' ); ?></p>
</div>
</div>
<?php elseif ( 'saved-templates' === $active_tab ) : ?>
<!-- Saved Templates Tab -->
<div class="seedprod-templates-grid" id="saved-templates-grid">
<div class="seedprod-templates-loading">
<span class="spinner is-active"></span>
<p><?php esc_html_e( 'Loading saved templates...', 'coming-soon' ); ?></p>
</div>
</div>
<?php endif; ?>
</div>
</div>
</div>
<script type="text/javascript">
// Pass default filter to JavaScript
window.seedprodDefaultFilter = '<?php echo esc_js( $default_filter ); ?>';
window.seedprodPageType = '<?php echo esc_js( $page_type ); ?>';
</script>
<!-- Template Preview Modal -->
<div id="seedprod-template-preview-modal" style="display: none;">
<div class="seedprod-modal-overlay"></div>
<div class="seedprod-modal-content">
<div class="seedprod-modal-header">
<div class="seedprod-modal-header-left">
<h2 id="seedprod-preview-title"><?php esc_html_e( 'Template Preview', 'coming-soon' ); ?></h2>
</div>
<div class="seedprod-modal-header-center">
<!-- Device switcher placeholder - Will be implemented in Phase 2 -->
<div class="seedprod-device-switcher" style="display: none;">
<button class="seedprod-device-btn seedprod-device-desktop active" data-device="desktop" title="<?php esc_attr_e( 'Desktop', 'coming-soon' ); ?>">
<span class="dashicons dashicons-desktop"></span>
</button>
<button class="seedprod-device-btn seedprod-device-tablet" data-device="tablet" title="<?php esc_attr_e( 'Tablet', 'coming-soon' ); ?>">
<span class="dashicons dashicons-tablet"></span>
</button>
<button class="seedprod-device-btn seedprod-device-mobile" data-device="mobile" title="<?php esc_attr_e( 'Mobile', 'coming-soon' ); ?>">
<span class="dashicons dashicons-smartphone"></span>
</button>
</div>
</div>
<div class="seedprod-modal-header-right">
<button class="seedprod-modal-close">
<span class="dashicons dashicons-no"></span>
</button>
</div>
</div>
<div class="seedprod-modal-body">
<iframe id="seedprod-preview-iframe" src="" frameborder="0"></iframe>
</div>
</div>
</div>
<script>
// Store page creation data
var seedprodTemplateData = {
pageId: <?php echo wp_json_encode( $page_id ); ?>,
pageName: <?php echo wp_json_encode( $page_name ); ?>,
pageSlug: <?php echo wp_json_encode( $page_slug ); ?>,
pageType: <?php echo wp_json_encode( $page_type ); ?>,
activeTab: <?php echo wp_json_encode( $active_tab ); ?>,
ajaxUrl: <?php echo wp_json_encode( admin_url( 'admin-ajax.php' ) ); ?>,
nonce: <?php echo wp_json_encode( wp_create_nonce( 'seedprod_v2_nonce' ) ); ?>,
isLiteView: <?php echo wp_json_encode( $is_lite_view ); ?>,
freeTemplatesSubscribed: <?php echo wp_json_encode( $free_templates_subscribed ); ?>
};
// Add subscription handler for Lite users
jQuery(document).ready(function($) {
$('#seedprod-subscribe-button').on('click', function(e) {
e.preventDefault();
var email = $('#seedprod-subscribe-email').val();
var button = $(this);
if (!email) {
alert('Please enter your email address');
return;
}
// Disable button and show loading
button.prop('disabled', true).text('Subscribing...');
$.ajax({
url: seedprodTemplateData.ajaxUrl,
type: 'POST',
data: {
action: 'seedprod_lite_v2_subscribe_free_templates',
email: email,
_ajax_nonce: seedprodTemplateData.nonce
},
success: function(response) {
if (response.success) {
// Hide the banner
$('.seedprod-free-templates-banner').slideUp();
// Update the subscribed status
seedprodTemplateData.freeTemplatesSubscribed = true;
// Show success message
alert(response.data.message);
// Removed: window.open to free templates page
// Reload templates
if (typeof loadTemplates === 'function') {
loadTemplates();
}
} else {
alert(response.data || 'Subscription failed. Please try again.');
button.prop('disabled', false).text('Subscribe');
}
},
error: function() {
alert('An error occurred. Please try again.');
button.prop('disabled', false).text('Subscribe');
}
});
});
});
</script>
seedprod-admin-growth-tool.php 0000644 00000010703 15233474616 0012447 0 ustar 00 <?php
/**
* Growth Tool promotional page template
*
* This template displays promotional content for partner plugins.
* It expects a $growth_tool_config array to be set with the following keys:
* - partner_name: Name of the partner (e.g., 'OptinMonster', 'WPCode')
* - headline: Main headline text
* - subheadline: Subtitle text
* - benefits: Array of benefit strings
* - cta_headline: Call-to-action headline
* - cta_subtext: Text below the button
* - social_proof: Social proof text
* - image: Image filename in growth-tools folder
* - plugin_slug: Full plugin path (e.g., 'optinmonster/optin-monster-wp-api.php')
* - plugin_id: Plugin ID for installation (e.g., 'optinmonster')
*
* @package SeedProd
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Ensure config is set.
if ( ! isset( $growth_tool_config ) ) {
return;
}
// Extract config for easier use.
$config = $growth_tool_config;
// Get plugin status.
$is_installed = false;
$is_active = false;
$status_code = 0; // 0 = not installed, 1 = active, 2 = inactive
if ( file_exists( WP_PLUGIN_DIR . '/' . $config['plugin_slug'] ) ) {
$is_installed = true;
if ( is_plugin_active( $config['plugin_slug'] ) ) {
$is_active = true;
$status_code = 1;
} else {
$status_code = 2;
}
}
// Set button text and class based on status.
/* translators: %s: Partner name (e.g., OptinMonster, WPCode) */
$button_text = sprintf( __( 'Install %s Now', 'coming-soon' ), $config['partner_name'] );
$button_class = 'button button-primary seedprod-button-primary seedprod-plugin-button';
if ( 2 === $status_code ) {
// Installed but not active.
/* translators: %s: Partner name (e.g., OptinMonster, WPCode) */
$button_text = sprintf( __( 'Activate %s', 'coming-soon' ), $config['partner_name'] );
$button_class = 'button button-primary seedprod-button-primary seedprod-plugin-button';
} elseif ( 1 === $status_code ) {
// Active - show deactivate.
$button_text = __( 'Deactivate', 'coming-soon' );
$button_class = 'button seedprod-button-secondary seedprod-plugin-button';
}
?>
<div class="seedprod-growth-tools-page">
<div class="postbox seedprod-card">
<div class="inside">
<!-- Partner Badge -->
<div class="seedprod-partner-badge">
<div class="seedprod-partner-badge-content">
<span class="dashicons dashicons-heart"></span>
<span class="seedprod-partner-badge-text">
<strong><?php esc_html_e( 'SeedProd', 'coming-soon' ); ?></strong>
<?php esc_html_e( 'recommends', 'coming-soon' ); ?>
<strong><?php echo esc_html( $config['partner_name'] ); ?></strong>
<span class="seedprod-partner-badge-separator">•</span>
<span class="seedprod-partner-badge-trusted">
<span class="dashicons dashicons-awards"></span>
<?php esc_html_e( 'Trusted Partner', 'coming-soon' ); ?>
</span>
</span>
</div>
</div>
<!-- Header Section -->
<div class="seedprod-growth-header">
<h1><?php echo esc_html( $config['headline'] ); ?></h1>
<p class="seedprod-subtitle">
<?php echo esc_html( $config['subheadline'] ); ?>
</p>
</div>
<!-- Hero Image Section -->
<div class="seedprod-growth-hero">
<img src="<?php echo esc_url( plugin_dir_url( __DIR__ ) . 'images/growth-tools/' . $config['image'] ); ?>"
alt="<?php echo esc_attr( $config['partner_name'] ); ?>">
</div>
<!-- Benefit Points Section -->
<div class="seedprod-benefit-points">
<ul>
<?php foreach ( $config['benefits'] as $benefit ) : ?>
<li><?php echo esc_html( $benefit ); ?></li>
<?php endforeach; ?>
</ul>
</div>
<!-- CTA Section -->
<div class="seedprod-growth-cta">
<p class="seedprod-cta-headline">
<?php echo esc_html( $config['cta_headline'] ); ?>
</p>
<button
class="<?php echo esc_attr( $button_class ); ?>"
data-plugin-slug="<?php echo esc_attr( $config['plugin_slug'] ); ?>"
data-plugin-id="<?php echo esc_attr( $config['plugin_id'] ); ?>"
data-status="<?php echo esc_attr( $status_code ); ?>">
<span class="button-text"><?php echo esc_html( $button_text ); ?></span>
<span class="button-spinner" style="display:none;">
<span class="spinner is-active" style="float: none; margin: 0;"></span>
</span>
</button>
<p class="seedprod-cta-subtext">
<?php echo esc_html( $config['cta_subtext'] ); ?>
</p>
<p class="seedprod-cta-social-proof">
<?php echo esc_html( $config['social_proof'] ); ?>
</p>
</div>
</div>
</div>
</div>
seedprod-admin-debug.php 0000644 00000014144 15233474616 0011253 0 ustar 00 <?php
/**
* Debug page for SeedProd Lite
*
* @package SeedProd
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Handle form submission using V2 functions.
$update_message = '';
$update_status = false;
if ( ! empty( $_POST ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing -- Nonce is verified inside seedprod_lite_v2_save_debug_settings().
$result = seedprod_lite_v2_save_debug_settings();
$update_status = $result['status'];
$update_message = $result['message'];
}
// Get current settings using V2 function.
$seedprod_builder_debug = seedprod_lite_v2_get_builder_debug_status();
?>
<div class="seedprod-dashboard-page seedprod-debug-page">
<?php
// Include header with page title.
$page_title = __( 'Debug Tools', 'coming-soon' );
require_once plugin_dir_path( __FILE__ ) . 'seedprod-admin-header.php';
?>
<div class="seedprod-dashboard-container">
<?php if ( ! empty( $update_message ) ) : ?>
<div class="notice notice-<?php echo $update_status ? 'success' : 'error'; ?> is-dismissible seedprod-notice-compact">
<p><?php echo esc_html( $update_message ); ?></p>
</div>
<?php endif; ?>
<!-- Debug Tools Form -->
<form method="post" action="" novalidate="novalidate">
<?php wp_nonce_field( 'seedprod-debug-reset' ); ?>
<table class="form-table" role="presentation">
<tbody>
<!-- Builder Debug -->
<tr>
<th scope="row">
<?php esc_html_e( 'Builder Debug Mode', 'coming-soon' ); ?>
</th>
<td>
<label for="sp_builder_debug">
<input name="sp_builder_debug" type="checkbox" id="sp_builder_debug" value="1" <?php checked( ! empty( $seedprod_builder_debug ) ); ?>>
<?php esc_html_e( 'Enable Builder Debug Mode', 'coming-soon' ); ?>
</label>
<p class="description">
<?php esc_html_e( 'Enable this if you are having problems in the builder like inserting images or other features not working correctly.', 'coming-soon' ); ?>
</p>
</td>
</tr>
</tbody>
</table>
<hr />
<h2><?php esc_html_e( 'Reset Pages', 'coming-soon' ); ?></h2>
<div class="notice notice-warning inline seedprod-notice-compact">
<p>
<strong><?php esc_html_e( 'Warning:', 'coming-soon' ); ?></strong>
<?php esc_html_e( 'These actions will permanently delete the selected pages. This cannot be undone.', 'coming-soon' ); ?>
<br>
<span class="dashicons dashicons-lightbulb" style="color: #f0ad4e; vertical-align: middle;"></span>
<strong><?php esc_html_e( 'Pro Tip:', 'coming-soon' ); ?></strong>
<?php
printf(
/* translators: %s: Link to Duplicator plugin */
esc_html__( 'We recommend creating a backup with %s (free plugin) before proceeding.', 'coming-soon' ),
'<a href="' . esc_url( admin_url( 'admin.php?page=seedprod_lite_settings&tab=recommended-plugins&filter=duplicator' ) ) . '">Duplicator</a>'
);
?>
</p>
</div>
<table class="form-table" role="presentation">
<tbody>
<!-- Reset Coming Soon -->
<tr>
<th scope="row">
<?php esc_html_e( 'Reset Coming Soon Page', 'coming-soon' ); ?>
</th>
<td>
<label for="sp_reset_cs">
<input name="sp_reset_cs" type="checkbox" id="sp_reset_cs" value="1">
<?php esc_html_e( 'Check and save to delete Coming Soon page', 'coming-soon' ); ?>
</label>
<p class="description">
<?php esc_html_e( 'This will delete your current Coming Soon page.', 'coming-soon' ); ?>
</p>
</td>
</tr>
<!-- Reset Maintenance Mode -->
<tr>
<th scope="row">
<?php esc_html_e( 'Reset Maintenance Mode Page', 'coming-soon' ); ?>
</th>
<td>
<label for="sp_reset_mm">
<input name="sp_reset_mm" type="checkbox" id="sp_reset_mm" value="1">
<?php esc_html_e( 'Check and save to delete Maintenance Mode page', 'coming-soon' ); ?>
</label>
<p class="description">
<?php esc_html_e( 'This will delete your current Maintenance Mode page.', 'coming-soon' ); ?>
</p>
</td>
</tr>
<!-- Reset 404 Page -->
<tr>
<th scope="row">
<?php esc_html_e( 'Reset 404 Page', 'coming-soon' ); ?>
</th>
<td>
<label for="sp_reset_p404">
<input name="sp_reset_p404" type="checkbox" id="sp_reset_p404" value="1">
<?php esc_html_e( 'Check and save to delete 404 page', 'coming-soon' ); ?>
</label>
<p class="description">
<?php esc_html_e( 'This will delete your current custom 404 page.', 'coming-soon' ); ?>
</p>
</td>
</tr>
<!-- Reset Login Page -->
<tr>
<th scope="row">
<?php esc_html_e( 'Reset Login Page', 'coming-soon' ); ?>
</th>
<td>
<label for="sp_reset_loginp">
<input name="sp_reset_loginp" type="checkbox" id="sp_reset_loginp" value="1">
<?php esc_html_e( 'Check and save to delete Login page', 'coming-soon' ); ?>
</label>
<p class="description">
<?php esc_html_e( 'This will delete your current custom Login page.', 'coming-soon' ); ?>
</p>
</td>
</tr>
</tbody>
</table>
<hr />
<h2><?php esc_html_e( 'Legacy Migration', 'coming-soon' ); ?></h2>
<table class="form-table" role="presentation">
<tbody>
<tr>
<th scope="row">
<?php esc_html_e( 'Re-run Legacy Migration', 'coming-soon' ); ?>
</th>
<td>
<a href="<?php echo esc_url( wp_nonce_url( home_url( '/?sp-force-migrate=1' ), 'seedprod_force_migrate' ) ); ?>" class="button">
<?php esc_html_e( 'Force Re-run Migration', 'coming-soon' ); ?>
</a>
<p class="description">
<?php esc_html_e( 'Re-runs the migration from SeedProd v4/v5 legacy settings. Only needed if the original migration did not complete correctly.', 'coming-soon' ); ?>
</p>
</td>
</tr>
</tbody>
</table>
<p class="submit">
<button type="submit" name="submit" class="button button-primary seedprod-button-primary">
<?php esc_html_e( 'Save Changes', 'coming-soon' ); ?>
</button>
</p>
</form>
</div>
</div>
preload.php 0000644 00000012074 15233577727 0006731 0 ustar 00 <?php
echo '<a name="preload"></a>';
if ( ! $cache_enabled || ! $super_cache_enabled || true === defined( 'DISABLESUPERCACHEPRELOADING' ) ) {
echo '<div class="notice notice-warning"><p>' . __( 'Preloading of cache disabled. Please make sure simple or expert mode is enabled or talk to your host administrator.', 'wp-super-cache' ) . '</p></div>';
return;
}
$count = wpsc_post_count();
if ( $count > 1000 ) {
$min_refresh_interval = 720;
} else {
$min_refresh_interval = 30;
}
echo '<p>' . __( 'This will cache every published post and page on your site. It will create supercache static files so unknown visitors (including bots) will hit a cached page. This will probably help your Google ranking as they are using speed as a metric when judging websites now.', 'wp-super-cache' ) . '</p>';
echo '<p>' . __( 'Preloading creates lots of files however. Caching is done from the newest post to the oldest so please consider only caching the newest if you have lots (10,000+) of posts. This is especially important on shared hosting.', 'wp-super-cache' ) . '</p>';
echo '<p>' . __( 'In ’Preload Mode’ regular garbage collection will be disabled so that old cache files are not deleted. This is a recommended setting when the cache is preloaded.', 'wp-super-cache' ) . '</p>';
echo '<form name="cache_filler" action="' . esc_url_raw( add_query_arg( 'tab', 'preload', $admin_url ) ) . '" method="POST">';
echo '<input type="hidden" name="action" value="preload" />';
echo '<input type="hidden" name="page" value="wpsupercache" />';
echo '<p>' . sprintf( __( 'Refresh preloaded cache files every %s minutes. (0 to disable, minimum %d minutes.)', 'wp-super-cache' ), "<input type='text' size=4 name='wp_cache_preload_interval' value='" . (int) $wp_cache_preload_interval . "' />", $min_refresh_interval ) . '</p>';
if ( $count > 100 ) {
$step = (int)( $count / 10 );
$select = "<select name='wp_cache_preload_posts' size=1>";
$select .= "<option value='all' ";
if ( ! isset( $wp_cache_preload_posts ) || $wp_cache_preload_posts == 'all' ) {
$checked = 'selectect=1 ';
$best = 'all';
} else {
$checked = ' ';
$best = $wp_cache_preload_posts;
}
$select .= "{$checked}>" . __( 'all', 'wp-super-cache' ) . "</option>";
for( $c = $step; $c < $count; $c += $step ) {
$checked = ' ';
if ( $best == $c )
$checked = 'selected=1 ';
$select .= "<option value='$c'{$checked}>$c</option>";
}
$checked = ' ';
if ( $best == $count )
$checked = 'selected=1 ';
$select .= "<option value='$count'{$checked}>$count</option>";
$select .= "</select>";
echo '<p>' . sprintf( __( 'Preload %s posts.', 'wp-super-cache' ), $select ) . '</p>';
} else {
echo '<input type="hidden" name="wp_cache_preload_posts" value="' . $count . '" />';
}
echo '<input type="checkbox" name="wp_cache_preload_on" value="1" ';
echo $wp_cache_preload_on == 1 ? 'checked=1' : '';
echo ' /> ' . __( 'Preload mode (garbage collection disabled. Recommended.)', 'wp-super-cache' ) . '<br />';
echo '<input type="checkbox" name="wp_cache_preload_taxonomies" value="1" ';
echo $wp_cache_preload_taxonomies == 1 ? 'checked=1' : '';
echo ' /> ' . __( 'Preload tags, categories and other taxonomies.', 'wp-super-cache' ) . '<br />';
echo __( 'Send me status emails when files are refreshed.', 'wp-super-cache' ) . '<br />';
if ( !isset( $wp_cache_preload_email_volume ) )
$wp_cache_preload_email_volume = 'none';
echo '<select type="select" name="wp_cache_preload_email_volume">';
echo '<option value="none" '. selected( 'none', $wp_cache_preload_email_volume ) . '>'. __( 'No Emails', 'wp-super-cache' ) . '</option>';
echo '<option value="many" '. selected( 'many', $wp_cache_preload_email_volume ) . '>'. __( 'Many emails, 2 emails per 100 posts.', 'wp-super-cache' ) . '</option>';
echo '<option value="medium" '. selected( 'medium', $wp_cache_preload_email_volume ) . '>'. __( 'Medium, 1 email per 100 posts.', 'wp-super-cache' ) . '</option>';
echo '<option value="less" '. selected( 'less', $wp_cache_preload_email_volume ) . '>'. __( 'Less emails, 1 at the start and 1 at the end of preloading all posts.', 'wp-super-cache' ) . '</option>';
echo "</select>";
if ( wp_next_scheduled( 'wp_cache_preload_hook' ) || wp_next_scheduled( 'wp_cache_full_preload_hook' ) ) {
$currently_preloading = true;
}
echo '<div class="submit"><input class="button-primary" type="submit" name="preload" value="' . __( 'Save Settings', 'wp-super-cache' ) . '" />';
echo '</div>';
wp_nonce_field( 'wp-cache' );
echo '</form>';
echo '<form name="do_preload" action="' . esc_url_raw( add_query_arg( 'tab', 'preload', $admin_url ) ) . '" method="POST">';
echo '<input type="hidden" name="action" value="preload" />';
echo '<input type="hidden" name="page" value="wpsupercache" />';
echo '<div class="submit">';
if ( false == $currently_preloading ) {
echo '<input class="button-primary" type="submit" name="preload_now" value="' . __( 'Preload Cache Now', 'wp-super-cache' ) . '" />';
} else {
echo '<input class="button-primary" type="submit" name="preload_off" value="' . __( 'Cancel Cache Preload', 'wp-super-cache' ) . '" />';
}
echo '</div>';
wp_nonce_field( 'wp-cache' );
echo '</form>';
rejected_user_agents.php 0000644 00000001750 15233577727 0011466 0 ustar 00 <?php
echo '<a name="useragents"></a><fieldset class="options"><h4>' . __( 'Rejected User Agents', 'wp-super-cache' ) . '</h4>';
echo "<p>" . __( 'Strings in the HTTP ’User Agent’ header that prevent WP-Cache from caching bot, spiders, and crawlers’ requests. Note that super cached files are still sent to these agents if they already exists.', 'wp-super-cache' ) . "</p>\n";
echo '<form name="wp_edit_rejected_user_agent" action="' . esc_url_raw( add_query_arg( 'tab', 'settings', $admin_url ) . '#useragents' ) . '" method="post">';
echo '<textarea name="wp_rejected_user_agent" cols="40" rows="4" style="width: 50%; font-size: 12px;" class="code">';
foreach( $cache_rejected_user_agent as $ua ) {
echo esc_html( $ua ) . "\n";
}
echo '</textarea> ';
echo '<div class="submit"><input class="button-primary" type="submit" ' . SUBMITDISABLED . 'value="' . __( 'Save UA Strings', 'wp-super-cache' ) . '" /></div>';
wp_nonce_field('wp-cache');
echo '</form>';
echo "</fieldset>\n";
advanced.php 0000644 00000077176 15233577727 0007066 0 ustar 00 <?php
if ( isset( $wp_cache_front_page_checks ) == false ) {
$wp_cache_front_page_checks = true;
}
echo '<form name="wp_manager" action="' . esc_url_raw( add_query_arg( 'tab', 'settings', $admin_url ) ) . '" method="post">';
wp_nonce_field( 'wp-cache' );
echo '<input type="hidden" name="action" value="scupdates" />';
?>
<table class="form-table">
<tr valign="top">
<th scope="row"><label for="wp_cache_enabled"><?php _e( 'Caching', 'wp-super-cache' ); ?></label></th>
<td>
<fieldset>
<legend class="hidden"><?php _e( 'Caching', 'wp-super-cache' ); ?></legend>
<label><input type='checkbox' name='wp_cache_enabled' value='1' <?php if ( $cache_enabled == true ) { echo 'checked=checked'; } ?>> <?php _e( 'Enable Caching', 'wp-super-cache' ); ?><br />
</fieldset>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="super_cache_enabled"><?php _e( 'Cache Delivery Method', 'wp-super-cache' ); ?></label></th>
<td>
<fieldset>
<label><input type='radio' name='wp_cache_mod_rewrite' <?php if ( $wp_cache_mod_rewrite == 0 ) echo "checked"; ?> value='0'> <?php _e( '<acronym title="Use PHP to serve cached files">Simple</acronym>', 'wp-super-cache' ); echo " <em>(" . __( "Recommended", "wp-super-cache" ) . ")</em>"; ?></label><br />
<label><input type='radio' name='wp_cache_mod_rewrite' <?php if ( $wp_cache_mod_rewrite == 1 ) echo "checked"; ?> value='1'> <?php _e( '<acronym title="Use mod_rewrite to serve cached files">Expert</acronym>', 'wp-super-cache' ); ?></label><br />
<em><small class='description'><?php _e( 'Expert caching requires changes to important server files and may require manual intervention if enabled.', 'wp-super-cache' ); ?></small></em>
<?php if ( $is_nginx ) { ?>
<em><small class='description'><?php printf( __( 'Nginx rules can be found <a href="%s">here</a> but are not officially supported.', 'wp-super-cache' ), 'https://codex.wordpress.org/Nginx#WP_Super_Cache_Rules' ); ?></small></em>
<?php } ?>
</fieldset>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="wp_cache_status"><?php esc_html_e( 'Miscellaneous', 'wp-super-cache' ); ?></label></th>
<td>
<fieldset>
<legend class="hidden">Miscellaneous</legend>
<strong><?php echo __( 'Cache Restrictions', 'wp-super-cache' ); ?></strong><br />
<label><input type='radio' name='wp_cache_not_logged_in' <?php checked( $wp_cache_not_logged_in, 0 ); ?> value='0'> <?php echo __( 'Enable caching for all visitors.', 'wp-super-cache' ); ?></label><br />
<label><input type='radio' name='wp_cache_not_logged_in' <?php checked( $wp_cache_not_logged_in, 1 ); ?> value='1'> <?php echo __( 'Disable caching for visitors who have a cookie set in their browser.', 'wp-super-cache' ); ?></label><br />
<label><input type='radio' name='wp_cache_not_logged_in' <?php checked( $wp_cache_not_logged_in, 2 ); ?> value='2'> <?php echo __( 'Disable caching for logged in visitors.', 'wp-super-cache' ) . ' <em>(' . esc_html__( 'Recommended', 'wp-super-cache' ) . ')</em>'; ?></label><br /><br />
<label><input type='checkbox' name='wp_cache_no_cache_for_get' <?php checked( $wp_cache_no_cache_for_get ); ?> value='1'> <?php _e( 'Don’t cache pages with GET parameters. (?x=y at the end of a url)', 'wp-super-cache' ); ?></label><br />
<?php if ( ! defined( 'WPSC_DISABLE_COMPRESSION' ) ) : ?>
<?php if ( ! function_exists( 'gzencode' ) ) : ?>
<em><?php esc_html_e( 'Warning! Compression is disabled as gzencode() function was not found.', 'wp-super-cache' ); ?></em><br />
<?php else : ?>
<label><input type='checkbox' name='cache_compression' <?php checked( $cache_compression ); ?> value='1'> <?php echo __( 'Compress pages so they’re served more quickly to visitors.', 'wp-super-cache' ) . ' <em>(' . esc_html__( 'Recommended', 'wp-super-cache' ) . ')</em>'; ?></label><br />
<em><?php esc_html_e( 'Compression is disabled by default because some hosts have problems with compressed files. Switching it on and off clears the cache.', 'wp-super-cache' ); ?></em><br />
<?php endif; ?>
<?php endif; ?>
<label><input type='checkbox' name='cache_rebuild_files' <?php checked( $cache_rebuild_files ); ?> value='1'> <?php echo esc_html__( 'Cache rebuild. Serve a supercache file to anonymous users while a new file is being generated.', 'wp-super-cache' ) . ' <em>(' . esc_html__( 'Recommended', 'wp-super-cache' ) . ')</em>'; ?></label><br />
<?php if ( $wp_cache_mod_rewrite ) { ?>
<br />
<p><strong><?php esc_html_e( 'Warning! The following settings are disabled because Expert caching is enabled.', 'wp-super-cache' ); ?></strong></p>
<br />
<?php } ?>
<label><input <?php disabled( $wp_cache_mod_rewrite ); ?> type='checkbox' name='wpsc_save_headers' <?php checked( $wpsc_save_headers ); ?> value='1' /> <?php esc_html_e( 'Cache HTTP headers with page content.', 'wp-super-cache' ); ?></label><br />
<label><input <?php disabled( $wp_cache_mod_rewrite ); ?> type='checkbox' name='wp_supercache_304' <?php checked( $wp_supercache_304 ); ?> value='1'> <?php echo esc_html__( '304 Browser caching. Improves site performance by checking if the page has changed since the browser last requested it.', 'wp-super-cache' ) . ' <em>(' . esc_html__( 'Recommended', 'wp-super-cache' ) . ')</em>'; ?></label><br />
<?php echo '<em>' . esc_html__( '304 support is disabled by default because some hosts have had problems with the headers used in the past.', 'wp-super-cache' ) . '</em><br />'; ?>
<label><input <?php disabled( $wp_cache_mod_rewrite ); ?> type='checkbox' name='wp_cache_make_known_anon' <?php checked( $wp_cache_make_known_anon ); ?> value='1'> <?php _e( 'Make known users anonymous so they’re served supercached static files.', 'wp-super-cache' ); ?></label><br />
</legend>
</fieldset>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="wp_cache_status"><?php _e( 'Advanced', 'wp-super-cache' ); ?></label></th>
<td>
<fieldset>
<legend class="hidden">Advanced</legend>
<label><input <?php disabled( $wp_cache_mod_rewrite ); ?> type='checkbox' name='wp_cache_mfunc_enabled' <?php if( $wp_cache_mfunc_enabled ) echo "checked"; ?> value='1'> <?php _e( 'Enable dynamic caching. (See <a href="https://wordpress.org/plugins/wp-super-cache/faq/">FAQ</a> or wp-super-cache/plugins/dynamic-cache-test.php for example code.)', 'wp-super-cache' ); ?></label><br />
<label><input type='checkbox' name='wp_cache_mobile_enabled' <?php if( $wp_cache_mobile_enabled ) echo "checked"; ?> value='1'> <?php _e( 'Mobile device support. (External plugin or theme required. See the <a href="https://wordpress.org/plugins/wp-super-cache/faq/">FAQ</a> for further details.)', 'wp-super-cache' ); ?></label><br />
<?php if ( $wp_cache_mobile_enabled ) {
echo '<blockquote><h5>' . __( 'Mobile Browsers', 'wp-super-cache' ) . '</h5>' . esc_html( $wp_cache_mobile_browsers ) . "<br /><h5>" . __( 'Mobile Prefixes', 'wp-super-cache' ) . "</h5>" . esc_html( $wp_cache_mobile_prefixes ) . "<br /></blockquote>";
} ?>
<label><input type='checkbox' name='wp_cache_disable_utf8' <?php if( $wp_cache_disable_utf8 ) echo "checked"; ?> value='1'> <?php _e( 'Remove UTF8/blog charset support from .htaccess file. Only necessary if you see odd characters or punctuation looks incorrect. Requires rewrite rules update.', 'wp-super-cache' ); ?></label><br />
<label><input type='checkbox' name='wp_cache_clear_on_post_edit' <?php if( $wp_cache_clear_on_post_edit ) echo "checked"; ?> value='1'> <?php _e( 'Clear all cache files when a post or page is published or updated.', 'wp-super-cache' ); ?></label><br />
<label><input type='checkbox' name='wp_cache_front_page_checks' <?php if( $wp_cache_front_page_checks ) echo "checked"; ?> value='1'> <?php _e( 'Extra homepage checks. (Very occasionally stops homepage caching)', 'wp-super-cache' ); ?></label><?php echo " <em>(" . __( "Recommended", "wp-super-cache" ) . ")</em>"; ?><br />
<label><input type='checkbox' name='wp_cache_refresh_single_only' <?php if( $wp_cache_refresh_single_only ) echo "checked"; ?> value='1'> <?php _e( 'Only refresh current page when comments made.', 'wp-super-cache' ); ?></label><br />
<label><input type='checkbox' name='wp_supercache_cache_list' <?php if( $wp_supercache_cache_list ) echo "checked"; ?> value='1'> <?php _e( 'List the newest cached pages on this page.', 'wp-super-cache' ); ?></label><br />
<?php if( false == defined( 'WPSC_DISABLE_LOCKING' ) ) { ?>
<label><input type='checkbox' name='wp_cache_mutex_disabled' <?php if( !$wp_cache_mutex_disabled ) echo "checked"; ?> value='0'> <?php _e( 'Coarse file locking. You do not need this as it will slow down your website.', 'wp-super-cache' ); ?></label><br />
<?php } ?>
<label><input type='checkbox' name='wp_super_cache_late_init' <?php if( $wp_super_cache_late_init ) echo "checked"; ?> value='1'> <?php _e( 'Late init. Display cached files after WordPress has loaded.', 'wp-super-cache' ); ?></label><br />
<?php printf( __( '<strong>DO NOT CACHE PAGE</strong> secret key: <a href="%s">%s</a>', 'wp-super-cache' ), trailingslashit( get_bloginfo( 'url' ) ) . "?donotcachepage={$cache_page_secret}", $cache_page_secret ); ?>
</fieldset>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="wp_cache_location"><?php _e( 'Cache Location', 'wp-super-cache' ); ?></label></th>
<td>
<fieldset>
<legend class="hidden">Cache Location</legend>
<input type='text' size=80 name='wp_cache_location' value='<?php echo esc_attr( $cache_path ); ?>' />
<p><?php printf( __( 'Change the location of your cache files. The default is WP_CONTENT_DIR . /cache/ which translates to %s.', 'wp-super-cache' ), WP_CONTENT_DIR . '/cache/' ); ?></p>
<ol>
<li><?php _e( 'Warning: do not use a shared directory like /tmp/ where other users on this server can modify files. Your cache files could be modified to deface your website.', 'wp-super-cache' ); ?></li>
<li><?php _e( 'You must give the full path to the directory.', 'wp-super-cache' ); ?></li>
<li><?php _e( 'If the directory does not exist, it will be created. Please make sure your web server user has write access to the parent directory. The parent directory must exist.', 'wp-super-cache' ); ?></li>
<li><?php _e( 'If the new cache directory does not exist, it will be created and the contents of the old cache directory will be moved there. Otherwise, the old cache directory will be left where it is.', 'wp-super-cache' ); ?></li>
<li><?php _e( 'Submit a blank entry to set it to the default directory, WP_CONTENT_DIR . /cache/.', 'wp-super-cache' ); ?></li>
<?php
if ( get_site_option( 'wp_super_cache_index_detected' ) && strlen( $cache_path ) > strlen( ABSPATH ) && ABSPATH == substr( $cache_path, 0, strlen( ABSPATH ) ) ) {
$msg = __( 'The plugin detected a bare directory index in your cache directory, which would let visitors see your cache files directly and might expose private posts.', 'wp-super-cache' );
if ( ! $is_nginx && $super_cache_enabled && $wp_cache_mod_rewrite == 1 ) {
$msg .= ' ' . __( 'You are using expert mode to serve cache files so the plugin has added <q>Options -Indexes</q> to the .htaccess file in the cache directory to disable indexes. However, if that does not work, you should contact your system administrator or support and ask for them to be disabled, or use simple mode and move the cache outside of the web root.', 'wp-super-cache' );
} else {
$msg .= ' <strong>' . sprintf( __( 'index.html files have been added in key directories, but unless directory indexes are disabled, it is probably better to store the cache files outside of the web root of %s', 'wp-super-cache' ), ABSPATH ) . '</strong>';
}
echo "<li>$msg</li>";
}
?>
<?php if ( $super_cache_enabled && $wp_cache_mod_rewrite == 1 ) { ?>
<li><?php printf( __( 'Since you are using mod_rewrite to serve cache files, you must choose a directory in your web root which is <q>%s</q> and update the mod_rewrite rules in the .htaccess file.', 'wp-super-cache' ), ABSPATH ); ?></li>
<?php } ?>
</ol>
</fieldset>
</td>
</tr>
</table>
<h4><?php esc_html_e( 'Note:', 'wp-super-cache' ); ?></h4>
<ol>
<li><?php esc_html_e( 'Uninstall this plugin on the plugins page. It will automatically clean up after itself. If manual intervention is required, then simple instructions are provided.', 'wp-super-cache' ); ?></li>
<li><?php printf( __( 'If uninstalling this plugin, make sure the directory <em>%s</em> is writeable by the webserver so the files <em>advanced-cache.php</em> and <em>cache-config.php</em> can be deleted automatically. (Making sure those files are writeable is probably a good idea!)', 'wp-super-cache' ), esc_attr( WP_CONTENT_DIR ) ); ?></li>
<li><?php printf( __( 'Please see the <a href="%1$s/wp-super-cache/readme.txt">readme.txt</a> for instructions on uninstalling this script. Look for the heading, "How to uninstall WP Super Cache".', 'wp-super-cache' ), plugins_url() ); ?></li>
<li><?php echo '<em>' . sprintf( __( 'Need help? Check the <a href="%1$s">Super Cache readme file</a>. It includes installation documentation, a FAQ and Troubleshooting tips. The <a href="%2$s">support forum</a> is also available. Your question may already have been answered.', 'wp-super-cache' ), 'https://wordpress.org/plugins/wp-super-cache/', 'https://wordpress.org/support/topic-tag/wp-super-cache/?forum_id=10' ) . '</em>'; ?></li>
<li><?php _e( 'The location of the plugin configuration file can be changed by defining the WPCACHECONFIGPATH constant in wp-config.php. If not defined it will be set to WP_CONTENT_DIR.', 'wp-super-cache' ); ?></li>
</ol>
<?php
echo '<div class="submit"><input class="button-primary" type="submit" ' . SUBMITDISABLED . ' value="' . esc_html__( 'Update Status', 'wp-super-cache' ) . '" /></div>';
wp_nonce_field( 'wp-cache' );
?></form><?php
if ( ! $GLOBALS['is_nginx'] && ! defined( 'WPSC_DISABLE_HTACCESS_UPDATE' ) && $GLOBALS['cache_enabled'] === true && $GLOBALS['wp_cache_mod_rewrite'] === 1 ) {
?>
<a name="modrewrite"></a><fieldset class="options">
<h4><?php _e( 'Mod Rewrite Rules', 'wp-super-cache' ); ?></h4>
<p><?php _e( 'When Expert cache delivery is enabled a file called <em>.htaccess</em> is modified. It should probably be in the same directory as your wp-config.php. This file has special rules that serve the cached files very quickly to visitors without ever executing PHP. The .htaccess file can be updated automatically, but if that fails, the rules will be displayed here and it can be edited by you. You will not need to update the rules unless a warning shows here.', 'wp-super-cache' ); ?></p>
<?php
extract( wpsc_get_htaccess_info() ); // $document_root, $apache_root, $home_path, $home_root, $home_root_lc, $inst_root, $wprules, $scrules, $condition_rules, $rules, $gziprules
$dohtaccess = true;
if ( strpos( $wprules, 'wordpressuser' ) ) { // Need to clear out old mod_rewrite rules
echo "<p><strong>" . __( 'Thank you for upgrading.', 'wp-super-cache' ) . "</strong> " . sprintf( __( 'The mod_rewrite rules changed since you last installed this plugin. Unfortunately, you must remove the old supercache rules before the new ones are updated. Refresh this page when you have edited your .htaccess file. If you wish to manually upgrade, change the following line: %1$s so it looks like this: %2$s The only changes are "HTTP_COOKIE" becomes "HTTP:Cookie" and "wordpressuser" becomes "wordpress". This is a WordPress 2.5 change but it’s backwards compatible with older versions if you’re brave enough to use them.', 'wp-super-cache' ), '<blockquote><code>RewriteCond %{HTTP_COOKIE} !^.*wordpressuser.*$</code></blockquote>', '<blockquote><code>RewriteCond %{HTTP:Cookie} !^.*wordpress.*$</code></blockquote>' ) . "</p>";
} else {
global $valid_nonce;
if ( $dohtaccess && ! isset( $_POST[ 'updatehtaccess' ] ) ){
if ( $scrules == '' ) {
wpsc_update_htaccess_form( 0 ); // don't hide the update htaccess form
} else {
wpsc_update_htaccess_form();
}
} elseif ( $valid_nonce && isset( $_POST[ 'updatehtaccess' ] ) ) {
if ( add_mod_rewrite_rules() ) {
echo "<h5>" . __( 'Mod Rewrite rules updated!', 'wp-super-cache' ) . "</h5>";
echo "<p><strong>" . sprintf( __( '%s.htaccess has been updated with the necessary mod_rewrite rules. Please verify they are correct. They should look like this:', 'wp-super-cache' ), $home_path ) . "</strong></p>\n";
} else {
global $update_mod_rewrite_rules_error;
echo "<h5>" . __( 'Mod Rewrite rules must be updated!', 'wp-super-cache' ) . "</h5>";
echo "<p>" . sprintf( __( 'The plugin could not update %1$s.htaccess file: %2$s.<br /> The new rules go above the regular WordPress rules as shown in the code below:', 'wp-super-cache' ), $home_path, "<strong>" . $update_mod_rewrite_rules_error . "</strong>" ) . "</p>\n";
}
echo "<div style='overflow: auto; width: 800px; height: 400px; padding:0 8px;color:#4f8a10;background-color:#dff2bf;border:1px solid #4f8a10;'>";
echo "<p><pre>" . esc_html( $rules ) . "</pre></p>\n</div>";
} else {
?>
<p><?php printf( __( 'WP Super Cache mod rewrite rules were detected in your %s.htaccess file.<br /> Click the following link to see the lines added to that file. If you have upgraded the plugin, make sure these rules match.', 'wp-super-cache' ), $home_path ); ?></p>
<?php
if ( $rules != $scrules ) {
?><p style='padding:0 8px;color:#9f6000;background-color:#feefb3;border:1px solid #9f6000;'><?php _e( 'A difference between the rules in your .htaccess file and the plugin rewrite rules has been found. This could be simple whitespace differences, but you should compare the rules in the file with those below as soon as possible. Click the ’Update Mod_Rewrite Rules’ button to update the rules.', 'wp-super-cache' ); ?></p><?php
}
?><a href="javascript:toggleLayer('rewriterules');" class="button"><?php _e( 'View Mod_Rewrite Rules', 'wp-super-cache' ); ?></a><?php
wpsc_update_htaccess_form();
echo "<div id='rewriterules' style='display: none;'>";
if ( $rules != $scrules )
echo '<div style="background: #fff; border: 1px solid #333; margin: 2px;">' . wp_text_diff( $scrules, $rules, array( 'title' => __( 'Rewrite Rules', 'wp-super-cache' ), 'title_left' => __( 'Current Rules', 'wp-super-cache' ), 'title_right' => __( 'New Rules', 'wp-super-cache' ) ) ) . "</div>";
echo "<p><pre># BEGIN WPSuperCache\n" . esc_html( $rules ) . "# END WPSuperCache</pre></p>\n";
echo "<p>" . sprintf( __( 'Rules must be added to %s too:', 'wp-super-cache' ), WP_CONTENT_DIR . "/cache/.htaccess" ) . "</p>";
echo "<pre># BEGIN supercache\n" . esc_html( $gziprules ) . "# END supercache</pre></p>";
echo '</div>';
}
}
?></fieldset><?php
}
$timezone_format = _x('Y-m-d G:i:s', 'timezone date format');
?><fieldset class="options">
<a name='expirytime'></a>
<h4><?php _e( 'Expiry Time & Garbage Collection', 'wp-super-cache' ); ?></h4><?php
?><span id="utc-time"><?php printf( __( '<abbr title="Coordinated Universal Time">UTC</abbr> time is <code>%s</code>', 'wp-super-cache' ), date_i18n( $timezone_format, false, 'gmt' ) ); ?></span><?php
$current_offset = get_option('gmt_offset');
if ( get_option('timezone_string') || !empty($current_offset) ) {
?><span id="local-time"><?php printf( __( 'Local time is <code>%1$s</code>', 'wp-super-cache' ), date_i18n( $timezone_format ) ); ?></span><?php
}
$next_gc = wp_next_scheduled( 'wp_cache_gc' );
if ( $next_gc )
echo "<p>" . sprintf( __( 'Next scheduled garbage collection will be at <strong>%s UTC</strong>', 'wp-super-cache' ), date_i18n( $timezone_format, $next_gc, 'gmt' ) ) . "</p>";
if ( $wp_cache_preload_on )
echo "<p>" . __( 'Warning! <strong>PRELOAD MODE</strong> activated. Supercache files will not be deleted regardless of age.', 'wp-super-cache' ) . "</p>";
echo "<script type='text/javascript'>";
echo "jQuery(function () {
jQuery('#cache_interval_time').click(function () {
jQuery('#schedule_interval').attr('checked', true);
});
jQuery('#cache_scheduled_time').click(function () {
jQuery('#schedule_time').attr('checked', true);
});
jQuery('#cache_scheduled_select').click(function () {
jQuery('#schedule_time').attr('checked', true);
});
});";
echo "</script>";
echo '<form name="wp_edit_max_time" action="' . esc_url_raw( add_query_arg( 'tab', 'settings', $admin_url ) . '#expirytime' ) . '" method="post">';
echo '<input name="action" value="expirytime" type="hidden" />';
echo '<table class="form-table">';
echo '<tr><td><label for="wp_max_time"><strong>' . __( 'Cache Timeout', 'wp-super-cache' ) . '</strong></label></td>';
echo "<td><input type='text' id='wp_max_time' size=6 name='wp_max_time' value='" . esc_attr( $cache_max_time ) . "' /> " . __( "seconds", 'wp-super-cache' ) . "</td></tr>\n";
echo "<tr><td></td><td>" . __( 'How long should cached pages remain fresh? Set to 0 to disable garbage collection. A good starting point is 3600 seconds.', 'wp-super-cache' ) . "</td></tr>\n";
echo '<tr><td valign="top"><strong>' . __( 'Scheduler', 'wp-super-cache' ) . '</strong></td><td><table cellpadding=0 cellspacing=0><tr><td valign="top"><input type="radio" id="schedule_interval" name="cache_schedule_type" value="interval" ' . checked( 'interval', $cache_schedule_type, false ) . ' /></td><td valign="top"><label for="cache_interval_time">' . __( 'Timer:', 'wp-super-cache' ) . '</label></td>';
echo "<td><input type='text' id='cache_interval_time' size=6 name='cache_time_interval' value='" . esc_attr( $cache_time_interval ) . "' /> " . __( "seconds", 'wp-super-cache' ) . '<br />' . __( 'Check for stale cached files every <em>interval</em> seconds.', 'wp-super-cache' ) . "</td></tr>";
echo '<tr><td valign="top"><input type="radio" id="schedule_time" name="cache_schedule_type" value="time" ' . checked( 'time', $cache_schedule_type, false ) . ' /></td><td valign="top"><label for="schedule_time">' . __( 'Clock:', 'wp-super-cache' ) . '</label></td>';
echo "<td><input type=\"text\" size=5 id='cache_scheduled_time' name='cache_scheduled_time' value=\"" . esc_attr( $cache_scheduled_time ) . "\" /> " . __( "HH:MM", 'wp-super-cache' ) . "<br />" . __( 'Check for stale cached files at this time <strong>(UTC)</strong> or starting at this time every <em>interval</em> below.', 'wp-super-cache' ) . "</td></tr>";
$schedules = wp_get_schedules();
echo "<tr><td><br /></td><td><label for='cache_scheduled_select'>" . __( 'Interval:', 'wp-super-cache' ) . "</label></td><td><select id='cache_scheduled_select' name='cache_schedule_interval' size=1>";
foreach( $schedules as $desc => $details ) {
echo "<option value='$desc' " . selected( $desc, $cache_schedule_interval, false ) . " /> {$details[ 'display' ]}</option>";
}
echo "</select></td></tr>";
echo '</table></td></tr>';
echo '<tr><td><label for="cache_gc_email_me"><strong>' . __( 'Notification Emails', 'wp-super-cache' ) . '</strong></label></td>';
echo "<td><input type='checkbox' id='cache_gc_email_me' name='cache_gc_email_me' " . checked( $cache_gc_email_me, 1, false ) . " /> " . __( 'Email me when the garbage collection runs.', 'wp-super-cache' ) . "</td></tr>\n";
echo "</table>\n";
echo "<h5>" . __( 'Garbage Collection', 'wp-super-cache' ) . "</h5>";
echo "<ol><li>" . __( '<em>Garbage collection</em> is the simple act of throwing out your garbage. For this plugin that would be old or <em>stale</em> cached files that may be out of date. New cached files are described as <em>fresh</em>.', 'wp-super-cache' ) . "</li>\n";
echo "<li>" . __( 'Cached files are fresh for a limited length of time. You can set that time in the <em>Cache Timeout</em> text box on this page.', 'wp-super-cache' ) . "</li>\n";
echo "<li>" . __( 'Stale cached files are not removed as soon as they become stale. They have to be removed by the garbage collecter. That is why you have to tell the plugin when the garbage collector should run.', 'wp-super-cache' ) . "</li>\n";
echo "<li>" . __( 'Use the <em>Timer</em> or <em>Clock</em> schedulers to define when the garbage collector should run.', 'wp-super-cache' ) . "</li>\n";
echo "<li>" . __( 'The <em>Timer</em> scheduler tells the plugin to run the garbage collector at regular intervals. When one garbage collection is done, the next run is scheduled.', 'wp-super-cache' ) . "</li>\n";
echo "<li>" . __( 'Or, the <em>Clock</em> scheduler allows the garbage collection to run at specific times. If set to run hourly or twice daily, the garbage collector will be first scheduled for the time you enter here. It will then run again at the indicated interval. If set to run daily, it will run once a day at the time specified.', 'wp-super-cache' ) . "</li>\n";
echo "</ol>";
echo "<p>" . __( 'There are no best garbage collection settings but here are a few scenarios. Garbage collection is separate to other actions that clear our cached files like leaving a comment or publishing a post.', 'wp-super-cache' ) . "</p>\n";
echo "<ol>";
echo "<li>" . __( 'Sites that want to serve lots of newly generated data should set the <em>Cache Timeout</em> to 60 and use the <em>Timer</em> scheduler set to 90 seconds.', 'wp-super-cache' ) . "</li>\n";
echo "<li>" . __( 'Sites with widgets and rss feeds in their sidebar should probably use a timeout of 3600 seconds and set the timer to 600 seconds. Stale files will be caught within 10 minutes of going stale.', 'wp-super-cache' ) . "</li>\n";
echo "<li>" . __( 'Sites with lots of static content, no widgets or rss feeds in their sidebar can use a timeout of 86400 seconds or even more and set the timer to something equally long.', 'wp-super-cache' ) . "</li>\n";
echo "<li>" . __( 'Sites where an external data source updates at a particular time every day should set the timeout to 86400 seconds and use the Clock scheduler set appropriately.', 'wp-super-cache' ) . "</li>\n";
echo "</ol>";
echo "<p>" . __( 'Checking for and deleting expired files is expensive, but it’s expensive leaving them there too. On a very busy site, you should set the expiry time to <em>600 seconds</em>. Experiment with different values and visit this page to see how many expired files remain at different times during the day.', 'wp-super-cache' ) . "</p>";
echo "<p>" . __( 'Set the expiry time to 0 seconds to disable garbage collection.', 'wp-super-cache' ) . "</p>";
echo '<div class="submit"><input class="button-primary" type="submit" ' . SUBMITDISABLED . 'value="' . __( 'Change Expiration', 'wp-super-cache' ) . '" /></div>';
wp_nonce_field('wp-cache');
echo "</form>\n";
?></fieldset><?php
echo '<a name="files"></a><fieldset class="options"><h4>' . __( 'Accepted Filenames & Rejected URIs', 'wp-super-cache' ) . '</h4>';
echo '<a name="rejectpages"></a>';
echo '<p>' . __( 'Do not cache the following page types. See the <a href="https://codex.wordpress.org/Conditional_Tags">Conditional Tags</a> documentation for a complete discussion on each type.', 'wp-super-cache' ) . '</p>';
echo '<form name="wp_edit_rejected_pages" action="' . esc_url_raw( add_query_arg( 'tab', 'settings', $admin_url ) . '#rejectpages' ) . '" method="post">';
echo '<input type="hidden" name="wp_edit_rejected_pages" value="1" />';
echo '<label><input type="checkbox" value="1" name="wp_cache_pages[single]" ' . checked( 1, $wp_cache_pages[ 'single' ], false ) . ' /> ' . __( 'Single Posts', 'wp-super-cache' ) . ' (is_single)</label><br />';
echo '<label><input type="checkbox" value="1" name="wp_cache_pages[pages]" ' . checked( 1, $wp_cache_pages[ 'pages' ], false ) . ' /> ' . __( 'Pages', 'wp-super-cache' ) . ' (is_page)</label><br />';
echo '<label><input type="checkbox" value="1" name="wp_cache_pages[frontpage]" ' . checked( 1, $wp_cache_pages[ 'frontpage' ], false ) . ' /> ' . __( 'Front Page', 'wp-super-cache' ) . ' (is_front_page)</label><br />';
echo ' <label><input type="checkbox" value="1" name="wp_cache_pages[home]" ' . checked( 1, $wp_cache_pages[ 'home' ], false ) . ' /> ' . __( 'Home', 'wp-super-cache' ) . ' (is_home)</label><br />';
echo '<label><input type="checkbox" value="1" name="wp_cache_pages[archives]" ' . checked( 1, $wp_cache_pages[ 'archives' ], false ) . ' /> ' . __( 'Archives', 'wp-super-cache' ) . ' (is_archive)</label><br />';
echo ' <label><input type="checkbox" value="1" name="wp_cache_pages[tag]" ' . checked( 1, $wp_cache_pages[ 'tag' ], false ) . ' /> ' . __( 'Tags', 'wp-super-cache' ) . ' (is_tag)</label><br />';
echo ' <label><input type="checkbox" value="1" name="wp_cache_pages[category]" ' . checked( 1, $wp_cache_pages[ 'category' ], false ) . ' /> ' . __( 'Category', 'wp-super-cache' ) . ' (is_category)</label><br />';
echo '<label><input type="checkbox" value="1" name="wp_cache_pages[feed]" ' . checked( 1, $wp_cache_pages[ 'feed' ], false ) . ' /> ' . __( 'Feeds', 'wp-super-cache' ) . ' (is_feed)</label><br />';
echo '<label><input type="checkbox" value="1" name="wp_cache_pages[search]" ' . checked( 1, $wp_cache_pages[ 'search' ], false ) . ' /> ' . __( 'Search Pages', 'wp-super-cache' ) . ' (is_search)</label><br />';
echo '<label><input type="checkbox" value="1" name="wp_cache_pages[author]" ' . checked( 1, $wp_cache_pages[ 'author' ], false ) . ' /> ' . __( 'Author Pages', 'wp-super-cache' ) . ' (is_author)</label><br />';
echo '<div class="submit"><input class="button-primary" type="submit" ' . SUBMITDISABLED . 'value="' . __( 'Save Settings', 'wp-super-cache' ) . '" /></div>';
wp_nonce_field('wp-cache');
echo "</form>\n";
echo '<a name="rejecturi"></a><fieldset class="options"><h4>' . __( 'Rejected URL Strings', 'wp-super-cache' ) . '</h4>';
echo '<form name="wp_edit_rejected" action="' . esc_url_raw( add_query_arg( 'tab', 'settings', $admin_url ) . '#rejecturi' ) . '" method="post">';
echo "<p>" . __( 'Add here strings (not a filename) that forces a page not to be cached. For example, if your URLs include year and you dont want to cache last year posts, it’s enough to specify the year, i.e. ’/2004/’. WP-Cache will search if that string is part of the URI and if so, it will not cache that page.', 'wp-super-cache' ) . "</p>\n";
echo '<textarea name="wp_rejected_uri" cols="40" rows="4" style="width: 50%; font-size: 12px;" class="code">';
foreach( $cache_rejected_uri as $file ) {
echo esc_html( $file ) . "\n";
}
echo '</textarea> ';
echo '<div class="submit"><input class="button-primary" type="submit" ' . SUBMITDISABLED . 'value="' . __( 'Save Strings', 'wp-super-cache' ) . '" /></div>';
wp_nonce_field( 'wp-cache' );
echo "</form>\n";
echo '<a name="rejectcookies"></a><fieldset class="options"><h4>' . __( 'Rejected Cookies', 'wp-super-cache' ) . '</h4>';
echo '<form name="wp_edit_rejected_cookies" action="' . esc_url_raw( add_query_arg( 'tab', 'settings', $admin_url ) . '#rejectcookies' ) . '" method="post">';
echo "<p>" . __( 'Do not cache pages when these cookies are set. Add the cookie names here, one per line. Matches on fragments, so "test" will match "WordPress_test_cookie". (Simple caching only)', 'wp-super-cache' ) . "</p>\n";
echo '<textarea name="wp_rejected_cookies" cols="40" rows="4" style="width: 50%; font-size: 12px;" class="code">';
foreach ( (array) $wpsc_rejected_cookies as $file) {
echo esc_html( $file ) . "\n";
}
echo '</textarea> ';
echo '<div class="submit"><input class="button-primary" type="submit" ' . SUBMITDISABLED . 'value="' . __( 'Save', 'wp-super-cache' ) . '" /></div>';
wp_nonce_field('wp-cache');
echo "</form>\n";
echo '<a name="cancache"></a><fieldset class="options"><h4>' . __( 'Always Cache Filenames', 'wp-super-cache' ) . '</h4>';
echo '<div style="clear:both"></div><form name="wp_edit_accepted" action="' . esc_url_raw( add_query_arg( 'tab', 'settings', $admin_url ) . '#cancache' ) . '" method="post">';
echo "<p>" . __( 'Add here those filenames that can be cached, even if they match one of the rejected substring specified above.', 'wp-super-cache' ) . "</p>\n";
echo '<textarea name="wp_accepted_files" cols="40" rows="8" style="width: 50%; font-size: 12px;" class="code">';
foreach ($cache_acceptable_files as $file) {
echo esc_html($file) . "\n";
}
echo '</textarea> ';
echo '<div class="submit"><input class="button-primary" type="submit" ' . SUBMITDISABLED . 'value="' . __( 'Save Files', 'wp-super-cache' ) . '" /></div>';
wp_nonce_field('wp-cache');
echo "</form>\n";
echo '</fieldset>';
restore.php 0000644 00000001050 15233577727 0006756 0 ustar 00 <?php
echo '<fieldset class="options"><h4>' . __( 'Fix Configuration', 'wp-super-cache' ) . '</h4>';
echo '<form name="wp_restore" action="' . esc_url_raw( add_query_arg( 'tab', 'settings', $admin_url ) . '#top' ) . '" method="post">';
echo '<input type="hidden" name="wp_restore_config" />';
echo '<div class="submit"><input class="button-secondary" type="submit" ' . SUBMITDISABLED . 'id="deletepost" value="' . __( 'Restore Default Configuration', 'wp-super-cache' ) . '" /></div>';
wp_nonce_field('wp-cache');
echo "</form>\n";
echo '</fieldset>';
lockdown.php 0000644 00000011676 15233577727 0007132 0 ustar 00 <a name='lockdown'></a>
<fieldset class="options">
<h4><?php _e( 'Lock Down:', 'wp-super-cache' ); ?> <?php echo $wp_lock_down == '0' ? '<span style="color:red">' . __( 'Disabled', 'wp-super-cache' ) . '</span>' : '<span style="color:green">' . __( 'Enabled', 'wp-super-cache' ) . '</span>'; ?></h4>
<p><?php _e( 'Prepare your server for an expected spike in traffic by enabling the lock down. When this is enabled, new comments on a post will not refresh the cached static files.', 'wp-super-cache' ); ?></p>
<p><?php _e( 'Developers: Make your plugin lock down compatible by checking the "WPLOCKDOWN" constant. The following code will make sure your plugin respects the WPLOCKDOWN setting.', 'wp-super-cache' ); ?>
<blockquote><code>if( defined( 'WPLOCKDOWN' ) && constant( 'WPLOCKDOWN' ) ) {
echo "<?php _e( 'Sorry. My blog is locked down. Updates will appear shortly', 'wp-super-cache' ); ?>";
}</code></blockquote>
<?php
if( $wp_lock_down == '1' ) {
?><p><?php _e( 'WordPress is locked down. Super Cache static files will not be deleted when new comments are made.', 'wp-super-cache' ); ?></p><?php
} else {
?><p><?php _e( 'WordPress is not locked down. New comments will refresh Super Cache static files as normal.', 'wp-super-cache' ); ?></p><?php
}
$new_lockdown = $wp_lock_down == '1' ? '0' : '1';
$new_lockdown_desc = $wp_lock_down == '1' ? __( 'Disable', 'wp-super-cache' ) : __( 'Enable', 'wp-super-cache' );
echo '<form name="wp_lock_down" action="' . esc_url_raw( add_query_arg( 'tab', 'settings', $admin_url ) . '#lockdown' ) . '" method="post">';
echo "<input type='hidden' name='wp_lock_down' value='{$new_lockdown}' />";
echo '<div class="submit"><input class="button-primary" type="submit" ' . SUBMITDISABLED . ' value="' . esc_attr( $new_lockdown_desc . ' ' . __( 'Lock Down', 'wp-super-cache' ) ) . '" /></div>';
wp_nonce_field( 'wp-cache' );
echo '</form>';
?></fieldset><?php
if( $cache_enabled == true && $super_cache_enabled == true ) {
?><a name='direct'></a>
<fieldset class="options">
<h4><?php _e( 'Directly Cached Files', 'wp-super-cache' ); ?></h4><?php
$cached_direct_pages = wpsc_update_direct_pages();
$readonly = '';
if( !is_writeable_ACLSafe( ABSPATH ) ) {
$readonly = 'READONLY';
?><p style='padding:0 8px;color:#9f6000;background-color:#feefb3;border:1px solid #9f6000;'><strong><?php _e( 'Warning!', 'wp-super-cache' ); ?></strong> <?php printf( __( 'You must make %s writable to enable this feature. As this is a security risk, please make it read-only after your page is generated.', 'wp-super-cache' ), ABSPATH ); ?></p><?php
} else {
$abspath_stat = stat(ABSPATH . '/');
$abspath_mode = decoct( $abspath_stat[ 'mode' ] & 0777 );
if ( substr( $abspath_mode, -2 ) == '77' ) {
?><p style='padding:0 8px;color:#9f6000;background-color:#feefb3;border:1px solid #9f6000;'><strong><?php _e( 'Warning!', 'wp-super-cache' ); ?></strong> <?php printf( __( '%s is writable. Please make it readonly after your page is generated as this is a security risk.', 'wp-super-cache' ), ABSPATH ); ?></p><?php
}
}
echo '<form name="direct_page" action="' . esc_url_raw( add_query_arg( 'tab', 'settings', $admin_url ) . '#direct' ) . '" method="post">';
if( is_array( $cached_direct_pages ) ) {
$out = '';
foreach( $cached_direct_pages as $page ) {
if( $page == '' )
continue;
$generated = '';
if( is_file( ABSPATH . $page . '/index.html' ) )
$generated = '<input class="button-secondary" type="Submit" name="deletepage" value="' . $page . '">';
$out .= "<tr><td><input type='text' $readonly name='direct_pages[]' size='30' value='$page' /></td><td>$generated</td></tr>";
}
if( $out != '' ) {
?><table><tr><th><?php _e( 'Existing direct page', 'wp-super-cache' ); ?></th><th><?php _e( 'Delete cached file', 'wp-super-cache' ); ?></th></tr><?php
echo "$out</table>";
}
}
if ( 'READONLY' !== $readonly ) {
echo esc_html__( 'Add direct page:', 'wp-super-cache' ) . '<input type="text" name="new_direct_page" size="30" value="" />';
}
echo '<p>' . sprintf(
esc_html__( 'Directly cached files are files created directly off %s where your blog lives. This feature is only useful if you are expecting a major Digg or Slashdot level of traffic to one post or page.', 'wp-super-cache' ),
esc_attr( ABSPATH )
) . '</p>';
if ( 'READONLY' !== $readonly ) {
echo '<p>' . sprintf( __( 'For example: to cache <em>%1$sabout/</em>, you would enter %1$sabout/ or /about/. The cached file will be generated the next time an anonymous user visits that page.', 'wp-super-cache' ),
esc_attr( trailingslashit( get_option( 'home' ) ) )
) . '</p>';
echo '<p>' . esc_html__( 'Make the textbox blank to remove it from the list of direct pages and delete the cached file.', 'wp-super-cache' ) . '</p>';
echo '<div class="submit"><input class="button-primary" type="submit" ' . SUBMITDISABLED . ' value="' . esc_attr__( 'Update Direct Pages', 'wp-super-cache' ) . '" /></div>';
}
wp_nonce_field( 'wp-cache' );
echo '</form>';
?>
</fieldset>
<?php
} // if $super_cache_enabled
easy.php 0000644 00000025363 15233577727 0006251 0 ustar 00 <?php
echo '<form name="wp_manager" action="' . esc_url_raw( add_query_arg( 'tab', 'easy', $admin_url ) ) . '" method="post">';
echo '<input type="hidden" name="action" value="easysetup" />';
wp_nonce_field( 'wp-cache' );
?>
<table class="form-table">
<tr valign="top">
<th scope="row"><label for="wp_cache_status"><?php esc_html_e( 'Caching', 'wp-super-cache' ); ?></label></th>
<td>
<fieldset>
<label><input type='radio' name='wp_cache_easy_on' value='1' <?php checked( $cache_enabled ); ?> ><?php echo esc_html__( 'Caching On', 'wp-super-cache' ) . ' <em>(' . esc_html__( 'Recommended', 'wp-super-cache' ) . ')</em>'; ?></label><br />
<label><input type='radio' name='wp_cache_easy_on' value='0' <?php checked( ! $cache_enabled ); ?> ><?php esc_html_e( 'Caching Off', 'wp-super-cache' ); ?></label><br />
</fieldset>
</td>
</tr>
</table>
<p><?php _e( 'The following recommended settings will be enabled:', 'wp-super-cache' ); ?></p>
<ol>
<li><?php _e( 'Caching disabled for logged in visitors.', 'wp-super-cache' ); ?></li>
<li><?php _e( 'Simple caching.', 'wp-super-cache' ); ?></li>
<li><?php _e( 'Cache Rebuild.', 'wp-super-cache' ); ?></li>
<li><?php _e( 'Interval garbage collection every 10 minutes with a cache lifetime of 30 minutes (if not configured already).', 'wp-super-cache' ); ?></li>
</ol>
<p><?php _e( 'These settings can be modified on the Advanced Settings page.', 'wp-super-cache' ); ?></p>
<?php
if ( ! $is_nginx && $cache_enabled && ! $wp_cache_mod_rewrite ) {
$scrules = trim( implode( "\n", extract_from_markers( trailingslashit( get_home_path() ) . '.htaccess', 'WPSuperCache' ) ) );
if ( ! empty( $scrules ) ) {
echo '<p><strong>' . esc_html__( 'Notice: Simple caching enabled but Supercache mod_rewrite rules from expert mode detected. Cached files will be served using those rules. If your site is working ok, please ignore this message. Otherwise, you can edit the .htaccess file in the root of your install and remove the SuperCache rules.', 'wp-super-cache' ) . '</strong></p>';
}
}
echo '<div class="submit"><input class="button-primary" type="submit" ' . SUBMITDISABLED . ' value="' . esc_html__( 'Update Status', 'wp-super-cache' ) . '" /></div></form>';
if ( $cache_enabled ) {
echo '<h4>' . esc_html__( 'Cache Tester', 'wp-super-cache' ) . '</h4>';
echo '<p>' . esc_html__( 'Test your cached website by clicking the test button below.', 'wp-super-cache' ) . '</p>';
echo '<p>' . __( 'Note: if you use Cloudflare or other transparent front-end proxy service this test may fail.<ol><li> If you have Cloudflare minification enabled this plugin may detect differences in the pages and report an error.</li><li> Try using the development mode of Cloudflare to perform the test. You can disable development mode afterwards if the test succeeds.</li></ol>', 'wp-super-cache' ) . '</p>';
if ( array_key_exists( 'action', $_POST ) && 'test' === $_POST['action'] && $valid_nonce ) {
$url = trailingslashit( get_bloginfo( 'url' ) );
if ( isset( $_POST['httponly'] ) ) {
$url = str_replace( 'https://', 'http://', $url );
}
$test_messages = array( esc_html__( 'Fetching %s to prime cache: ', 'wp-super-cache' ), esc_html__( 'Fetching first copy of %s: ', 'wp-super-cache' ), esc_html__( 'Fetching second copy of %s: ', 'wp-super-cache' ) );
$c = 0;
$cache_test_error = false;
$page = array();
foreach ( $test_messages as $message ) {
echo '<p>' . sprintf( $message, $url );
$page[ $c ] = wp_remote_get( $url, array( 'timeout' => 60, 'blocking' => true ) );
if ( ! is_wp_error( $page[ $c ] ) ) {
$fp = fopen( $cache_path . $c . '.html', 'w' );
fwrite( $fp, $page[ $c ]['body'] );
fclose( $fp );
echo '<span style="color: #0a0; font-weight: bold;">' . esc_html__( 'OK', 'wp-super-cache' ) . "</span> (<a href='" . esc_url_raw( WP_CONTENT_URL . '/cache/' . $c . '.html' ) . "'>" . $c . '.html</a>)</p>';
sleep( 1 );
} else {
$cache_test_error = true;
echo '<span style="color: #a00; font-weight: bold;">' . esc_html__( 'FAILED', 'wp-super-cache' ) . '</span></p>';
$errors = '';
$messages = '';
foreach ( $page[ $c ]->get_error_codes() as $code ) {
$severity = $page[ $c ]->get_error_data( $code );
foreach ( $page[ $c ]->get_error_messages( $code ) as $err ) {
$errors .= $severity . ': ' . $err . "<br />\n";
}
}
if ( ! empty( $errors ) ) {
echo '<p>' . sprintf( __( '<strong>Errors:</strong> %s', 'wp-super-cache' ), $errors ) . '</p>';
}
}
$c ++;
}
if ( false == $cache_test_error ) {
echo '<ul><li>' . sprintf( esc_html__( 'Page %d: %d (%s)', 'wp-super-cache' ), 1, intval( $page[1]['response']['code'] ), esc_attr( $page[1]['response']['message'] ) ) . '</li>';
echo '<li>' . sprintf( esc_html__( 'Page %d: %d (%s)', 'wp-super-cache' ), 2, intval( $page[2]['response']['code'] ), esc_attr( $page[2]['response']['message'] ) ) . '</li></ul>';
}
if ( false == $cache_test_error && preg_match( '/(Cached page generated by WP-Super-Cache on) ([0-9]*-[0-9]*-[0-9]* [0-9]*:[0-9]*:[0-9]*)/', $page[1]['body'], $matches1 ) &&
preg_match( '/(Cached page generated by WP-Super-Cache on) ([0-9]*-[0-9]*-[0-9]* [0-9]*:[0-9]*:[0-9]*)/', $page[2]['body'], $matches2 ) && $matches1[2] == $matches2[2]
) {
echo '<p>' . sprintf( esc_html__( 'Page 1: %s', 'wp-super-cache' ), $matches1[2] ) . '</p>';
echo '<p>' . sprintf( esc_html__( 'Page 2: %s', 'wp-super-cache' ), $matches2[2] ) . '</p>';
echo '<p><span style="color: #0a0; font-weight: bold;">' . esc_html__( 'The timestamps on both pages match!', 'wp-super-cache' ) . '</span></p>';
} else {
echo '<p><strong>' . esc_html__( 'The pages do not match! Timestamps differ or were not found!', 'wp-super-cache' ) . '</strong></p>';
echo '<p>' . esc_html__( 'Things you can do:', 'wp-super-cache' ) . '</p>';
echo '<ol><li>' . esc_html__( 'Load your homepage in a logged out browser, check the timestamp at the end of the html source. Load the page again and compare the timestamp. Caching is working if the timestamps match.', 'wp-super-cache' ) . '</li>';
echo '<li>' . esc_html__( 'Enable logging on the Debug page here. That should help you track down the problem.', 'wp-super-cache' ) . '</li>';
echo '<li>' . esc_html__( 'You should check Page 1 and Page 2 above for errors. Your local server configuration may not allow your website to access itself.', 'wp-super-cache' ) . '</li>';
echo '</ol>';
}
}
echo '<form name="cache_tester" action="' . esc_url_raw( add_query_arg( 'tab', 'easy', $admin_url ) ) . '" method="post">';
echo '<input type="hidden" name="action" value="test" />';
if ( ! empty( $_SERVER['HTTPS'] ) && 'on' === strtolower( $_SERVER['HTTPS'] ) ) {
echo '<input type="checkbox" name="httponly" checked="checked" value="1" /> ' . esc_html__( 'Send non-secure (non https) request for homepage', 'wp-super-cache' );
}
if ( isset( $wp_super_cache_comments ) && $wp_super_cache_comments == 0 ) {
echo '<p>' . __( '<strong>Warning!</strong> Cache comments are currently disabled. Please go to the Debug page and enable Cache Status Messages there. You should clear the cache before testing.', 'wp-super-cache' ) . '</p>';
echo '<div class="submit"><input disabled style="color: #aaa" class="button-secondary" type="submit" name="test" value="' . esc_html__( 'Test Cache', 'wp-super-cache' ) . '" /></div>';
} else {
echo '<div class="submit"><input class="button-secondary" type="submit" name="test" value="' . __( 'Test Cache', 'wp-super-cache' ) . '" /></div>';
}
wp_nonce_field( 'wp-cache' );
echo '</form>';
}
echo '<h4>' . esc_html__( 'Delete Cached Pages', 'wp-super-cache' ) . '</h4>';
echo '<p>' . esc_html__( 'Cached pages are stored on your server as html and PHP files. If you need to delete them, use the button below.', 'wp-super-cache' ) . '</p>';
echo '<form name="wp_cache_content_delete" action="' . esc_url_raw( add_query_arg( 'tab', 'contents', $admin_url ) ) . '" method="post">';
echo '<input type="hidden" name="wp_delete_cache" />';
echo '<div class="submit"><input id="deletepost" class="button-secondary" type="submit" ' . SUBMITDISABLED . 'value="' . esc_html__( 'Delete Cache', 'wp-super-cache' ) . ' " /></div>';
wp_nonce_field( 'wp-cache' );
echo "</form>\n";
if ( is_multisite() && wpsupercache_site_admin() ) {
echo '<form name="wp_cache_content_delete" action="' . esc_url_raw( add_query_arg( 'tab', 'contents', $admin_url ) . '#listfiles' ) . '" method="post">';
echo '<input type="hidden" name="wp_delete_all_cache" />';
echo '<div class="submit"><input id="deleteallpost" class="button-secondary" type="submit" ' . SUBMITDISABLED . 'value="' . esc_html__( 'Delete Cache On All Blogs', 'wp-super-cache' ) . '" /></div>';
wp_nonce_field( 'wp-cache' );
echo "</form><br />\n";
}
?>
<h4 class="clear"><?php esc_html_e( 'Recommended Links and Plugins', 'wp-super-cache' ); ?></h4>
<p><?php esc_html_e( 'Caching is only one part of making a website faster. Here are some other plugins that will help:', 'wp-super-cache' ); ?></p>
<ul style="list-style: square; margin-left: 2em;">
<li><?php printf( __( '<a href="%s">Jetpack</a> provides everything you need to build a successful WordPress website including an image/photo CDN (free) and a video hosting service (paid).', 'wp-super-cache' ), 'https://jetpack.com/redirect/?source=jitm-wpsc-recommended' ); ?></li>
<li><?php printf( __( '<a href="%s">Yahoo! Yslow</a> analyzes web pages and suggests ways to improve their performance based on a set of rules for high performance web pages. Also try the performance tools online at <a href="%s">GTMetrix</a>.', 'wp-super-cache' ), 'http://yslow.org/', 'https://gtmetrix.com/' ); ?></li>
<li><?php printf( __( '<a href="%s">Use Google Libraries</a> allows you to load some commonly used Javascript libraries from Google webservers. Ironically, it may reduce your Yslow score.', 'wp-super-cache' ), 'https://wordpress.org/plugins/use-google-libraries/' ); ?></li>
<li><?php printf( __( '<a href="%s">commonWP</a> does the same job as "Use Google Libraries" and offloads some commonly used static files to an external CDN.', 'wp-super-cache' ), 'https://wordpress.org/plugins/commonwp/' ); ?></li>
<li><?php printf( __( '<strong>Advanced users only:</strong> Install an object cache. Choose from <a href="%s">Memcached</a>, <a href="%s">XCache</a>, <a href="%s">eAcccelerator</a> and others.', 'wp-super-cache' ), 'https://wordpress.org/plugins/memcached/', 'https://neosmart.net/WP/XCache/', 'https://neosmart.net/WP/eAccelerator/' ); ?></li>
<li><?php printf( __( '<a href="%s">WP Crontrol</a> is a useful plugin to use when trying to debug garbage collection and preload problems.', 'wp-super-cache' ), 'https://wordpress.org/plugins/wp-crontrol/' ); ?></li>
</ul>
<p><?php _e( "* The links above (apart from Jetpack) go to websites outside the author's control. Caution is advised when testing any new software.", 'wp-super-cache' ); ?></p>
tracking_parameters.php 0000644 00000002517 15233577727 0011331 0 ustar 00 <?php
echo '<a name="trackingparameters"></a><fieldset class="options"><h4>' . __( 'Tracking Parameters', 'wp-super-cache' ) . '</h4>';
echo '<form name="edit_tracking_parameters" action="' . esc_url_raw( add_query_arg( 'tab', 'settings', $admin_url ) . '#trackingparameters' ) . '" method="post">';
echo "<p>" . __( 'Tracking parameters to ignore when caching. Visitors from Facebook, Twitter and elsewhere to your website will go to a URL with tracking parameters added. This setting allows the plugin to ignore those parameters and show an already cached page. Any actual tracking by Google Analytics or other Javascript based code should still work as the URL of the page is not modified.', 'wp-super-cache' ) . "</p>\n";
echo '<textarea name="tracking_parameters" cols="20" rows="10" style="width: 50%; font-size: 12px;" class="code">';
foreach ( $wpsc_tracking_parameters as $parameter) {
echo esc_html( $parameter ) . "\n";
}
echo '</textarea> ';
echo "<p><label><input type='checkbox' name='wpsc_ignore_tracking_parameters' value='1' " . checked( 1, $wpsc_ignore_tracking_parameters, false ) . " /> " . __( 'Enable', 'wp-super-cache' ) . "</label></p>";
echo '<div class="submit"><input class="button-primary" type="submit" ' . SUBMITDISABLED . 'value="' . __( 'Save', 'wp-super-cache' ) . '" /></div>';
wp_nonce_field('wp-cache');
echo "</form>\n";
debug.php 0000644 00000012647 15233577727 0006377 0 ustar 00 <?php
extract( wpsc_update_debug_settings() ); // $wp_super_cache_debug, $wp_cache_debug_log, $wp_cache_debug_ip, $wp_super_cache_comments, $wp_super_cache_front_page_check, $wp_super_cache_front_page_clear, $wp_super_cache_front_page_text, $wp_super_cache_front_page_notification, $wp_super_cache_advanced_debug, $wp_cache_debug_username
$admin_url = admin_url( 'options-general.php?page=wpsupercache' );
echo '<a name="debug"></a>';
echo '<fieldset class="options">';
echo '<p>' . __( 'Fix problems with the plugin by debugging it here. It will log to a file in your cache directory.', 'wp-super-cache' ) . '</p>';
if ( ! isset( $wp_cache_debug_log ) || $wp_cache_debug_log == '' ) {
extract( wpsc_create_debug_log() ); // $wp_cache_debug_log, $wp_cache_debug_username
}
$log_file_link = "<a href='" . home_url( str_replace( $_SERVER['DOCUMENT_ROOT'], '', "{$cache_path}view_{$wp_cache_debug_log}?wp-admin=1&wp-json=1&filter=" ) ) . "'>$wp_cache_debug_log</a>";
if ( $wp_super_cache_debug == 1 ) {
echo "<p>" . sprintf( __( 'Currently logging to: %s', 'wp-super-cache' ), $log_file_link ) . "</p>";
} else {
echo "<p>" . sprintf( __( 'Last Logged to: %s', 'wp-super-cache' ), $log_file_link ) . "</p>";
}
echo "<p>" . sprintf( __( 'Username/Password: %s', 'wp-super-cache' ), $wp_cache_debug_username ) . "</p>";
echo '<form name="wpsc_delete" action="' . esc_url_raw( add_query_arg( 'tab', 'debug', $admin_url ) ) . '" method="post">';
wp_nonce_field('wp-cache');
echo "<input type='hidden' name='wpsc_delete_log' value='1' />";
submit_button( __( 'Delete', 'wp-super-cache' ), 'delete', 'wpsc_delete_log_form', false );
echo "</form>";
echo '<form name="wpsc_delete" action="' . esc_url_raw( add_query_arg( 'tab', 'debug', $admin_url ) ) . '" method="post">';
if ( ! isset( $wp_super_cache_debug ) || $wp_super_cache_debug == 0 ) {
$debug_status_message = __( 'Enable Logging', 'wp-super-cache' );
$not_status = 1;
} else {
$debug_status_message = __( 'Disable Logging', 'wp-super-cache' );
$not_status = 0;
}
echo "<input type='hidden' name='wp_super_cache_debug' value='" . $not_status . "' />";
wp_nonce_field('wp-cache');
submit_button( $debug_status_message, 'primary', 'wpsc_log_status', true );
echo "</form>";
echo '<form name="wp_cache_debug" action="' . esc_url_raw( add_query_arg( 'tab', 'debug', $admin_url ) ) . '" method="post">';
echo "<input type='hidden' name='wp_cache_debug' value='1' /><br />";
echo "<table class='form-table'>";
echo "<tr><th>" . __( 'IP Address', 'wp-super-cache' ) . "</th><td> <input type='text' size='20' name='wp_cache_debug_ip' value='{$wp_cache_debug_ip}' /> " . sprintf( __( '(only log requests from this IP address. Your IP is %s)', 'wp-super-cache' ), $_SERVER[ 'REMOTE_ADDR' ] ) . "</td></tr>";
echo "<tr><th valign='top'>" . __( 'Cache Status Messages', 'wp-super-cache' ) . "</th><td><input type='checkbox' name='wp_super_cache_comments' value='1' " . checked( 1, $wp_super_cache_comments, false ) . " /> " . __( 'enabled', 'wp-super-cache' ) . "<br />";
echo __( 'Display comments at the end of every page like this:', 'wp-super-cache' ) . "<br />";
echo "<pre><!-- Dynamic page generated in 0.450 seconds. -->
<!-- Cached page generated by WP-Super-Cache on " . date( "Y-m-d H:i:s", time() ) . " -->
<!-- super cache --></pre></td></tr>";
echo "</table>\n";
if ( isset( $wp_super_cache_advanced_debug ) ) {
echo "<h5>" . __( 'Advanced', 'wp-super-cache' ) . "</h5><p>" . __( 'In very rare cases two problems may arise on some blogs:<ol><li> The front page may start downloading as a zip file.</li><li> The wrong page is occasionally cached as the front page if your blog uses a static front page and the permalink structure is <em>/%category%/%postname%/</em>.</li></ol>', 'wp-super-cache' ) . '</p>';
echo "<p>" . __( 'I’m 99% certain that they aren’t bugs in WP Super Cache and they only happen in very rare cases but you can run a simple check once every 5 minutes to verify that your site is ok if you’re worried. You will be emailed if there is a problem.', 'wp-super-cache' ) . "</p>";
echo "<table class='form-table'>";
echo "<tr><td valign='top' colspan='2'><input type='checkbox' name='wp_super_cache_front_page_check' value='1' " . checked( 1, $wp_super_cache_front_page_check, false ) . " /> " . __( 'Check front page every 5 minutes.', 'wp-super-cache' ) . "</td></tr>";
echo "<tr><td valign='top'>" . __( 'Front page text', 'wp-super-cache' ) . "</td><td> <input type='text' size='30' name='wp_super_cache_front_page_text' value='{$wp_super_cache_front_page_text}' /> (" . __( 'Text to search for on your front page. If this text is missing, the cache will be cleared. Leave blank to disable.', 'wp-super-cache' ) . ")</td></tr>";
echo "<tr><td valign='top' colspan='2'><input type='checkbox' name='wp_super_cache_front_page_clear' value='1' " . checked( 1, $wp_super_cache_front_page_clear, false ) . " /> " . __( 'Clear cache on error.', 'wp-super-cache' ) . "</td></tr>";
echo "<tr><td valign='top' colspan='2'><input type='checkbox' name='wp_super_cache_front_page_notification' value='1' " . checked( 1, $wp_super_cache_front_page_notification, false ) . " /> " . __( 'Email the blog admin when checks are made. (useful for testing)', 'wp-super-cache' ) . "</td></tr>";
echo "</table>\n";
}
echo '<div class="submit"><input class="button-primary" type="submit" ' . SUBMITDISABLED . 'value="' . __( 'Save Settings', 'wp-super-cache' ) . '" /></div>';
wp_nonce_field('wp-cache');
echo "</form>\n";
echo '</fieldset>';