Class WooCommerceApplicationSpec

java.lang.Object
com.cloudforgeci.api.application.cms.WordPressApplicationSpec
com.cloudforgeci.api.application.cms.WooCommerceApplicationSpec
All Implemented Interfaces:
ApplicationSpec, CmsSpec, DatabaseSpec

@CmsPlugin(value="woocommerce", category="ecommerce", displayName="WooCommerce", description="WordPress-based e-commerce platform for online stores", phpVersion="8.2", defaultCpu=2048, defaultMemory=4096, defaultInstanceType="t3.medium", supportsOidc=true, oidcMethod="OpenID Connect Generic Plugin", requiresDatabase=true, supportedDatabases={"mysql","mariadb"}, supportsS3Media=true, supportsObjectCache=true, supportsMultisite=false, websiteUrl="https://woocommerce.com", defaultImage="wordpress:php8.2-apache") public class WooCommerceApplicationSpec extends WordPressApplicationSpec
WooCommerce E-commerce ApplicationSpec implementation.

WooCommerce is an e-commerce plugin for WordPress. This specification extends the WordPress configuration with e-commerce-specific requirements.

Key Differences from WordPress:

  • Higher CPU/Memory requirements for order processing
  • Additional PHP extensions (gmp, sodium) for payments
  • E-commerce specific cron jobs
  • PCI-DSS compliance considerations
  • Higher database requirements
  • WooCommerce Stripe Gateway
  • WooCommerce PayPal Payments
  • WooCommerce Subscriptions
  • WP Offload Media - S3 media storage
Since:
3.1.0
See Also:
  • Constructor Details

    • WooCommerceApplicationSpec

      public WooCommerceApplicationSpec()
  • Method Details

    • applicationId

      public String applicationId()
      Description copied from interface: ApplicationSpec
      Returns a unique identifier for this application. Used for logging, metrics, and resource naming.
      Specified by:
      applicationId in interface ApplicationSpec
      Overrides:
      applicationId in class WordPressApplicationSpec
      Returns:
      application identifier (e.g., "jenkins", "gitlab", "vault")
    • defaultHealthCheckGracePeriod

      public int defaultHealthCheckGracePeriod()
      Description copied from interface: ApplicationSpec
      Get the recommended health check grace period for this application.

      The grace period is how long ECS/ALB waits before starting health checks after a container starts. Applications with longer initialization times (like GitLab) need longer grace periods.

      Default values:

      • Most applications: 300 seconds (5 minutes)
      • GitLab: 600 seconds (10 minutes) - due to database migrations and initialization
      • Other database-heavy apps may also need longer periods
      Specified by:
      defaultHealthCheckGracePeriod in interface ApplicationSpec
      Overrides:
      defaultHealthCheckGracePeriod in class WordPressApplicationSpec
      Returns:
      recommended health check grace period in seconds
    • requiredPhpExtensions

      public List<String> requiredPhpExtensions()
      Description copied from interface: CmsSpec
      Returns required PHP extensions for this CMS.

      Common extensions include:

      • mysqli, pdo_mysql - MySQL database connectivity
      • gd, imagick - Image processing
      • curl - HTTP client
      • mbstring - Multibyte string handling
      • xml, dom - XML processing
      • zip - Archive handling
      • intl - Internationalization
      • opcache - Bytecode caching
      • redis - Redis client
      Specified by:
      requiredPhpExtensions in interface CmsSpec
      Overrides:
      requiredPhpExtensions in class WordPressApplicationSpec
      Returns:
      List of PHP extension names
    • phpMemoryLimit

      public int phpMemoryLimit()
      Description copied from interface: CmsSpec
      Returns PHP memory limit in megabytes.

      Recommended values:

      • WordPress: 256MB
      • WooCommerce: 512MB
      • Magento: 756MB-2GB
      • Drupal: 256MB
      Specified by:
      phpMemoryLimit in interface CmsSpec
      Overrides:
      phpMemoryLimit in class WordPressApplicationSpec
      Returns:
      Memory limit in MB
    • phpFpmConfig

      public Map<String,String> phpFpmConfig()
      Description copied from interface: CmsSpec
      Returns PHP-FPM pool configuration overrides.

      Common settings:

      • pm - Process manager (static, dynamic, ondemand)
      • pm.max_children - Maximum worker processes
      • pm.start_servers - Initial workers (dynamic mode)
      • pm.min_spare_servers - Minimum idle workers
      • pm.max_spare_servers - Maximum idle workers
      • pm.max_requests - Requests before worker recycle
      Specified by:
      phpFpmConfig in interface CmsSpec
      Overrides:
      phpFpmConfig in class WordPressApplicationSpec
      Returns:
      Map of PHP-FPM configuration key-value pairs
    • opcacheConfig

      public Map<String,String> opcacheConfig()
      Description copied from interface: CmsSpec
      Returns OPcache configuration for PHP bytecode caching.

      Recommended production settings:

      • opcache.enable=1 - Enable OPcache
      • opcache.memory_consumption=128 - Cache memory (MB)
      • opcache.max_accelerated_files=10000 - Cached file limit
      • opcache.revalidate_freq=60 - File check interval (seconds)
      • opcache.validate_timestamps=0 - Disable for production
      Specified by:
      opcacheConfig in interface CmsSpec
      Overrides:
      opcacheConfig in class WordPressApplicationSpec
      Returns:
      Map of OPcache configuration key-value pairs
    • cronCommands

      public Map<String,String> cronCommands(String siteUrl)
      Description copied from interface: CmsSpec
      Returns scheduled task commands for system cron.

      Map keys are cron schedule expressions, values are commands.

      Example for WordPress:

      "* /15 * * * *" -> "curl -s https://example.com/wp-cron.php"
      
      Specified by:
      cronCommands in interface CmsSpec
      Overrides:
      cronCommands in class WordPressApplicationSpec
      Parameters:
      siteUrl - The site URL for cron execution
      Returns:
      Map of cron schedule to command
    • supportsMultisite

      public boolean supportsMultisite()
      Description copied from interface: CmsSpec
      Returns whether multi-site/multi-store is supported.

      Multi-site capabilities:

      • WordPress: Multisite network
      • Magento: Multi-store views
      • Drupal: Multi-site configuration
      • PrestaShop: Multi-shop
      Specified by:
      supportsMultisite in interface CmsSpec
      Overrides:
      supportsMultisite in class WordPressApplicationSpec
      Returns:
      true if multi-site is available
    • cmsCategory

      public String cmsCategory()
      Description copied from interface: CmsSpec
      Returns the CMS category.

      Categories:

      • "cms" - Content management (WordPress, Joomla, Drupal)
      • "ecommerce" - E-commerce (WooCommerce, Magento, PrestaShop)
      Specified by:
      cmsCategory in interface CmsSpec
      Overrides:
      cmsCategory in class WordPressApplicationSpec
      Returns:
      "cms" or "ecommerce"
    • databaseRequirement

      public DatabaseSpec.DatabaseRequirement databaseRequirement()
      Description copied from interface: DatabaseSpec
      Database requirement for this application.
      Specified by:
      databaseRequirement in interface DatabaseSpec
      Overrides:
      databaseRequirement in class WordPressApplicationSpec
      Returns:
      database requirement (required, optional, or none)
    • backupRetentionDays

      public int backupRetentionDays()
      Description copied from interface: DatabaseSpec
      Database backup retention requirements.
      Specified by:
      backupRetentionDays in interface DatabaseSpec
      Overrides:
      backupRetentionDays in class WordPressApplicationSpec
      Returns:
      backup retention days (1-35), default 7
    • requiresPciCompliance

      public boolean requiresPciCompliance()
      Returns whether this platform requires PCI-DSS compliance.

      WooCommerce stores handle payment card data and should follow PCI-DSS requirements when processing payments directly.

      Returns:
      true if PCI-DSS compliance is required
    • recommendedPaymentGateways

      public List<String> recommendedPaymentGateways()
      Returns recommended payment gateways that support PCI compliance.

      These gateways handle card data off-site, reducing PCI scope:

      • Stripe - PCI Level 1 Service Provider
      • PayPal - PCI Level 1 Service Provider
      • Square - PCI Level 1 Service Provider
      Returns:
      list of recommended payment gateway plugin slugs
    • containerEnvironmentVariables

      public Map<String,String> containerEnvironmentVariables(String fqdn, boolean sslEnabled, String authMode)
      Description copied from interface: ApplicationSpec
      Configures application-specific environment variables for the container.

      Applications can override this to provide custom environment variables based on deployment configuration (FQDN, SSL, authMode, etc.). The infrastructure passes the FQDN, SSL settings, and authentication mode for applications that need reverse proxy configuration or authentication-specific setup.

      Example use cases:

      • Jenkins: JAVA_OPTS, JENKINS_OPTS for reverse proxy configuration, skip setup wizard for application-oidc
      • GitLab: GITLAB_OMNIBUS_CONFIG for external URL configuration and OIDC setup
      • Vault: VAULT_ADDR for API endpoint configuration
      Specified by:
      containerEnvironmentVariables in interface ApplicationSpec
      Overrides:
      containerEnvironmentVariables in class WordPressApplicationSpec
      Parameters:
      fqdn - The fully qualified domain name (may be null)
      sslEnabled - Whether SSL is enabled
      authMode - The authentication mode (may be null, e.g., "none", "alb-oidc", "application-oidc")
      Returns:
      Map of environment variable key-value pairs (never null, may be empty)
    • wooCommerceInstallCommands

      public List<String> wooCommerceInstallCommands()
      Returns commands to install WooCommerce via WP-CLI.
      Returns:
      list of installation commands
    • getPhpConfig

      public static PhpRuntimeConfig getPhpConfig()
      Returns PhpRuntimeConfig optimized for WooCommerce.
      Returns:
      PHP runtime configuration for e-commerce
    • protectedPaths

      public List<String> protectedPaths()
      Returns default protected paths for WooCommerce when using ALB-level OIDC.

      WooCommerce inherits WordPress admin paths plus e-commerce specific:

      • /wp-admin/* - WordPress admin dashboard (includes WooCommerce admin)
      • /wp-login.php - Login page
      Returns:
      list of WooCommerce administrative paths requiring authentication
      See Also: