HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux ip-172-31-4-197 6.8.0-1036-aws #38~22.04.1-Ubuntu SMP Fri Aug 22 15:44:33 UTC 2025 x86_64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/html/wordpress/wp-content/plugins/trinity-audio/migrations/inc/2025-02-10-15-00.php
<?php
  if (!trinity_should_migrate_for('5.20.0')) return;

  // drop cache since we don't need it anymore
  delete_transient('trinity_audio_languages_cache');

  delete_option('trinity_audio_configuration_v5_failed');
  delete_option('trinity_audio_gender_id');
  delete_option('trinity_audio_voice_id');
  delete_option('trinity_audio_translate');

  global $wpdb;

  $meta_key = 'trinity_audio_gender_id';

  $wpdb->query($wpdb->prepare(
  "DELETE FROM $wpdb->postmeta WHERE meta_key = %s",
    $meta_key
  ));

  // migrate voices from standard to neural
  $voices_migration_file = '2025-02-10-15-00-standard-to-neural-map.json';
  $voices_migration_file_path = __DIR__ . '/' . $voices_migration_file;
  if (!file_exists($voices_migration_file_path )) {
    trinity_log("Missing $voices_migration_file file");
    return;
  }

  $voice_mapping = json_decode(file_get_contents($voices_migration_file_path), true);
  if (!$voice_mapping) {
    trinity_log("Invalid JSON in $voices_migration_file");
    return;
  }

  // Migrate post-specific voice IDs
  foreach ($voice_mapping as $standard_id => $neural_id) {
    trinity_log("migrate voice $standard_id to $neural_id");

    $wpdb->query($wpdb->prepare(
      "UPDATE $wpdb->postmeta SET meta_value = %s WHERE meta_key = 'trinity_audio_voice_id' AND meta_value = %s",
      $neural_id,
      $standard_id
    ));
  }