S3 backup list times are shifted by the site's UTC offset (timezone offset applied twice)
Nadie ha tomado este issue todavía.
- #239 de @chata — cerrado sin fusionar
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 76/100
Línea de trabajo
Comienza en BackWPup_Destination_S3::file_update_list() e inspecciona cómo LastModified se convierte en $changetime; después, sigue su uso en components/table-row-backups.php, BackWPup_Page_Backups::column_time() y la lista de archivos de S3. Reprodúcelo con una zona horaria del sitio distinta de UTC y confirma que las tres vistas muestran la hora real de la copia de seguridad exactamente una vez en la zona horaria del sitio, coincidiendo con las copias de seguridad en carpetas locales.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
Backups stored on an S3 (or S3-compatible) destination are listed in the Backups History table with a time shifted into the future by the site's UTC offset. On a UTC+9 (Asia/Tokyo) site, a scheduled backup that ran at 0:00 JST is shown as "9:00 AM", and a manual backup taken at 1:40 PM is shown as "10:40 PM". Backups stored on the local folder destination show the correct time, so S3 rows look inconsistent next to them.
Cause
BackWPup_Destination_S3::file_update_list() converts the S3 object's LastModified (UTC) into a Unix timestamp and then adds the site's gmt_offset:
$changetime = strtotime((string) $object['LastModified']) + (get_option('gmt_offset') * 3600);
Unix timestamps are timezone-independent, and all three consumers of this value format it with wp_date(), which already converts the epoch to the site timezone:
- the backups history table:
components/table-row-backups.php(lines 9-10) - the legacy backups page:
BackWPup_Page_Backups::column_time() - the S3 file list (download/restore view):
$files[$filecounter]['time']within the same method
The offset is therefore applied twice.
To Reproduce
- Set the site timezone to a non-UTC zone (e.g. Asia/Tokyo, UTC+9) in Settings → General.
- Configure a job with an S3 (or S3-compatible, e.g. Cloudflare R2) destination and run it.
- Open BackWPup → Backups History: the row shows the backup 9 hours in the future, while the filename (which uses site-local time) and a backup stored on the server show the correct time.
Expected behavior
The S3 backup rows show the actual backup time in the site timezone, matching backups stored on the local folder destination.
Environment
- BackWPup 5.7.4
- WordPress with PHP 8.4
- Destination: Cloudflare R2 (S3-compatible)
Additional context
Proposed fix in #239: drop the gmt_offset addition and keep the true epoch.
- Lenguaje dominante
- PHP
- Estrellas
- 96
- Forks
- 48
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de wp-media/backwpup
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
-
WordPress XML export: posts have no categories or tags since 5.6.6Posiblemente ocupada @rafaelmaeuer la tomó hace 14 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 25/100
-
Complete restore can leave the site half-restoredPosiblemente ocupada @rafaelmaeuer la tomó hace 14 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 20/100
-
Complete restore stops after the file step: user is logged out, database is not restoredPosiblemente ocupada @rafaelmaeuer la tomó hace 14 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
-
Database restore loses data when a row is larger than max_allowed_packetPosiblemente ocupada @rafaelmaeuer la tomó hace 14 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
Todos los issues de wp-media/backwpup
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 3 días
-
sync-en
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día
-
[Sync EN] Formatting improvements to "Large Objects (LOBs)" docs (#6056)Posiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertosync-en
Dificultad 1/5 Menos de una hora Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día
-
Перевод устарел
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
Los mantenedores suelen responder en 1 día
-
repo:cms
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
craftcms/cms#20613 · 1 comentario ·
Los mantenedores suelen responder en 1 día