Title: Time Machine
Author: Aleksandar Urošević
Published: <strong>2009 年 2 月 14 日</strong>
Last modified: 2026 年 9 月 20 日

---

搜尋外掛

![](https://ps.w.org/time-machine/assets/banner-772x250.png?rev=3703683)

![](https://ps.w.org/time-machine/assets/icon.svg?rev=1050533)

# Time Machine

 由 [Aleksandar Urošević](https://profiles.wordpress.org/urkekg/) 開發

[下載](https://downloads.wordpress.org/plugin/time-machine.26.9.0.zip)

 * [詳細資料](https://tw.wordpress.org/plugins/time-machine/#description)
 * [使用者評論](https://tw.wordpress.org/plugins/time-machine/#reviews)
 *  [安裝方式](https://tw.wordpress.org/plugins/time-machine/#installation)
 * [開發資訊](https://tw.wordpress.org/plugins/time-machine/#developers)

 [技術支援](https://wordpress.org/support/plugin/time-machine/)

## 外掛說明

Time Machine is a simple plugin that grab `N` published articles from database (
posts and/or pages) published on current day and/or offset of time in past years,
and list them in widget or block.
 User can set widget title, number of displayed
articles and message shown when there is no public articles in past.

#### Features

 * Shortcode, legacy widget, block-based widget and Gutenberg block, all with the
   same options
 * Set the number of articles to list
 * Set a custom message for days with no articles in the past, or hide the whole
   list when there is nothing to show
 * Include or exclude pages, and optionally exclude articles from the current year
 * Set offset and offset direction (before, after or both) with a time range in 
   days, weeks or months
 * Optionally show an excerpt with a custom length; it is generated from post content
   when there is no manual excerpt
 * Optionally show the number of comments
 * Lists only published articles (drafts are never included)
 * Password protected articles are excluded unless you explicitly enable them; when
   included, the manual excerpt is used if there is one, otherwise no excerpt is
   generated from the content until the visitor unlocks the article (same as WordPress
   core)
 * Works with full page cache plugins: the list is refreshed after page load through
   a small REST endpoint (can be disabled with a constant in `wp-config.php`)
 * Site Health check warns you if a REST API restriction blocks that refresh, and
   tells you how to fix it
 * Cached queries that are cleared automatically whenever a post or page is saved
 * Clean, semantic HTML5 markup that validates without errors, styled by your theme’s
   CSS

## 螢幕擷圖

[⌊Time Machine Widget Options anr Preview⌉⌊Time Machine Widget Options anr Preview⌉[

Time Machine Widget Options anr Preview

## 適用於區塊編輯器

這個外掛提供 1 個可供區塊編輯器使用的區塊。

 *   Time Machine List articles published in the past, relative to today, by a configurable
   time offset.

## 安裝方式

#### Manual

 1. Upload the entire `time-machine` folder to the `/wp-content/plugins/` directory.
 2. Activate the plugin through the `Plugins` menu in WordPress.
 3. Insert new `Time Machine` widget on `Appearance`  `Widgets`.
 4. Configure `Time Machine` options.

#### Automatic

 1. Go to `Plugins`  `Add New` and search for `time machine`.
 2. Click on `Install Now` link bellow `Time Machine` search result and aswer `Yes`
    on popup question.
 3. If you need enter FTP parameters for your host and click on `Proceed`.
 4. Activate the plugin through the `Plugins` menu in WordPress.
 5. Insert new `Time Machine` widget on `Appearance`  `Widgets`.
 6. Configure `Time Machine` options.

## 常見問題集

### Why name Time Machine?

I like effect that produce Time Machine – traveling trough time. This plugin does
exactly that, but with fixed month and day constant.

### How I can help?

Revire and rate plugin, submit suggestions, contribute on WordPress forum.

### Does Time Machine work with full page cache plugins (WP Rocket, WP Fastest Cache, W3 Total Cache…)?

Yes. Time Machine’s list is refetched from a small REST endpoint right after the
page finishes loading, so the visible content stays current even when the whole 
page has been cached for longer than a day. The cached markup already on the page
stays visible until (and unless) that request succeeds, so nothing is ever blank
while it refreshes, and the page cache itself is never touched or purged. If you
prefer to disable this and rely only on the page cache’s own expiry, add `define('
TIME_MACHINE_DISABLE_REFRESH', true );` to `wp-config.php`.

### How do I turn the front end auto-refresh off?

Add this to `wp-config.php`:

    ```
    define( 'TIME_MACHINE_DISABLE_REFRESH', true );
    ```

No `data-time-machine-*` attributes are printed after that, the refresh script is
never enqueued, and no REST request is ever made. Lists render once, on the server.
On a page held in a full page cache for longer than a day, the list can then be 
a day or more behind.

### The browser console shows a 401 on `/wp-json/time-machine/v1/list`. What is wrong?

A security plugin or snippet on your site closes the whole REST API to signed out
visitors, through the `rest_authentication_errors` filter. That filter runs before
any route can state that it is public, so Time Machine cannot exempt its own route
from it, however read only that route is.

Nothing is broken for your visitors. The list is rendered on the server and stays
on screen; only the refresh described above is skipped, and the failed request is
logged in the console. Time Machine checks this once a day and tells you in `Tools`-
> `Site Health`, which spells out the two options below.

**Option 1: switch the refresh off.** Add this to `wp-config.php`:

    ```
    define( 'TIME_MACHINE_DISABLE_REFRESH', true );
    ```

No request is made after that, so the console stays clean. Lists render once, on
the server, exactly as they did before this feature existed. On a page held in a
full page cache for longer than a day, the list can then be a day or more behind.

**Option 2: let this one route through.** It is read only and returns the same published
titles, excerpts and links the page already shows to the same visitor, so letting
it through gives nothing away. Add this to a must-use plugin or to your theme’s `
functions.php`:

    ```
    add_filter(
        'rest_authentication_errors',
        function ( $result ) {

            if ( ! is_wp_error( $result ) ) {
                return $result;
            }

            $route = isset( $GLOBALS['wp']->query_vars['rest_route'] )
                ? ltrim( $GLOBALS['wp']->query_vars['rest_route'], '/' )
                : '';

            if ( 0 === strpos( $route, 'time-machine/v1/' ) ) {
                return null;
            }

            return $result;
        },
        99
    );
    ```

It runs after the restriction and before the core cookie check, and clears the error
for the `time-machine/v1` namespace only. Every other route keeps the restriction
exactly as it is.

## 使用者評論

![](https://secure.gravatar.com/avatar/30cf8bee55fa7e62845d7639e478e0e3c3660f7f1c4366e8bbfb08b3f6a5e0af?
s=60&d=retro&r=g)

### 󠀁[Great Plugin](https://wordpress.org/support/topic/great-plugin-8388/)󠁿

 [Marko6548](https://profiles.wordpress.org/marko6548/) 2016 年 9 月 3 日

Thank you, Great and Useful Plugin

 [ 閱讀全部 2 則使用者評論 ](https://wordpress.org/support/plugin/time-machine/reviews/)

## 參與者及開發者

以下人員參與了開源軟體〈Time Machine〉的開發相關工作。

參與者

 *   [ Aleksandar Urošević ](https://profiles.wordpress.org/urkekg/)
 *   [ TechWebUX ](https://profiles.wordpress.org/techwebux/)

[將〈Time Machine〉外掛本地化為台灣繁體中文版](https://translate.wordpress.org/projects/wp-plugins/time-machine)

### 對開發相關資訊感興趣？

任何人均可[瀏覽程式碼](https://plugins.trac.wordpress.org/browser/time-machine/)、
查看 [SVN 存放庫](https://plugins.svn.wordpress.org/time-machine/)，或透過 [RSS](https://plugins.trac.wordpress.org/log/time-machine/?limit=100&mode=stop_on_copy&format=rss)
訂閱[開發記錄](https://plugins.trac.wordpress.org/log/time-machine/)。

## 變更記錄

#### 26.9.0 (2026-09-19)

 * Test: WordPress 7.1
 * Refactor: Full plugin refactored
 * Add: Support for Block Editor (FSE Widget and Gutenberg Block)
 * Add: Excerpt is now generated from post content when no manual excerpt is set,
   same fallback WordPress core uses for `the_excerpt()`
 * Add: Password protected posts with no manual excerpt show a notice instead of
   a generated excerpt, until the current visitor unlocks that post
 * Add: Front-end auto-refresh of the post list via a REST endpoint, so pages served
   from a full page cache plugin still show current content
 * Add: Daily check of whether a site wide REST API restriction blocks the front-
   end refresh route, reported in a dismissible admin notice and in a Site Health
   test, with the snippet needed to allow that one read only route
 * Add: `TIME_MACHINE_DISABLE_REFRESH` constant to switch the front-end refresh 
   off site wide from `wp-config.php`
 * Change: Remove `hours` offset
 * Change: Rename rangetype -> direction and rangenum -> offset
 * Change: Remove Excerpt before/after HTML tags and wrap excerpt into span with
   class excerpt
 * Change: Offset query results are now sorted newest year first
 * Improve: Offset query now compares whole days instead of the exact time, and 
   results are cached (object cache, or transient when no persistent object cache
   is active)
 * Improve: Offset query loop now starts from the oldest published post’s year (
   cached for a month) instead of a hardcoded 2002
 * Improve: Cache is invalidated automatically whenever a post or page is saved,
   instead of only relying on the daily/monthly expiration
 * Improve: Front-end script is enqueued minified, and served as readable source
   only while `SCRIPT_DEBUG` is on

#### 0.4.1 (2014-12-20)

 * Improve: multi instance widget
 * Improve: rewritten to OOP and optimized code
 * Add: rel=”nofollow” to post links, to prevent reindexing old posts and and affect
   page rank
 * Add: uninstall procedure to remove widget settings
 * Test on WordPress 4.1

#### 0.0.6 (2011-04-02)

 * Fixed timezone bug. Now Time Machine instead of GMT use WordPres timezone for
   time offset calculations.

#### 0.0.5.5svn (2009-08-03)

 * Added option to display excerpt, with feature to short and insert XHTML code 
   before and after excerpt
 * Added date offset (+/- N hours/days/weeks/months)
 * Added offset type (before to current date, before to after current date, current
   date to after)

#### 0.0.5.4 (2009-07-13)

 * fixed bug for feature added in 0.0.5.3 (reported by Rarst)
 * Added Belorussian language (submited by Marcis Gasuns)

#### 0.0.5.3 (2009-07-12)

 * Added option do hide widget if there is no posts in past (sugessted by Rarst)
 * Added Simplified Chinese language (submited by Leslie Yeh)
 * Updated Serbian and Italian language
 * Fixed post links if blog is not in root with permalink (thanks Leslie)

#### 0.0.5.2 (2009-06-19)

 * Added Italian localisation (submited by Caporale Reyes)

#### 0.0.5.1 (2009-03-08)

 * Fixed broken 0.0.5 (‘Number of posts’ above links)

#### 0.0.5 (2009-03-08)

 * compare GMT date, not local date on host
 * added description to displayed number of comments

#### 0.0.4 (2009-02-28)

 * Added option to display number of comments

#### 0.0.3 (2009-02-14)

 * Fixed links to articles when is active non-Home pages
 * Added option to exclude WordPress Pages from listing
 * Added option to exclude articles published in current year from listing
 * Updated Serbian translation

#### 0.0.2 (2009-02-14)

 * Fixed SQL query to work as expected
 * Added option to display password protected posts in list

#### 0.0.1 (2009-02-13)

 * Initial release

## 中繼資料

 *  版本 **26.9.0**
 *  最後更新 **16 小時前**
 *  啟用安裝數 **40+**
 *  WordPress 版本需求 ** 5.3 或更新版本 **
 *  已測試相容的 WordPress 版本 **7.1.1**
 *  PHP 版本需求 ** 7.4 或更新版本 **
 *  語言
 * [English (US)](https://wordpress.org/plugins/time-machine/)
 * 標籤:
 * [archive](https://tw.wordpress.org/plugins/tags/archive/)[block](https://tw.wordpress.org/plugins/tags/block/)
   [history](https://tw.wordpress.org/plugins/tags/history/)[on this day](https://tw.wordpress.org/plugins/tags/on-this-day/)
   [widget](https://tw.wordpress.org/plugins/tags/widget/)
 *  [進階檢視](https://tw.wordpress.org/plugins/time-machine/advanced/)

## 評分

 5 星，滿分為 5 星

 *  [  2 個 5 星使用者評論     ](https://wordpress.org/support/plugin/time-machine/reviews/?filter=5)
 *  [  0 個 4 星使用者評論     ](https://wordpress.org/support/plugin/time-machine/reviews/?filter=4)
 *  [  0 個 3 星使用者評論     ](https://wordpress.org/support/plugin/time-machine/reviews/?filter=3)
 *  [  0 個 2 星使用者評論     ](https://wordpress.org/support/plugin/time-machine/reviews/?filter=2)
 *  [  0 個 1 星使用者評論     ](https://wordpress.org/support/plugin/time-machine/reviews/?filter=1)

[撰寫評分](https://wordpress.org/support/plugin/time-machine/reviews/#new-post)

[查看全部使用者評論](https://wordpress.org/support/plugin/time-machine/reviews/)

## 參與者

 *   [ Aleksandar Urošević ](https://profiles.wordpress.org/urkekg/)
 *   [ TechWebUX ](https://profiles.wordpress.org/techwebux/)

## 技術支援

使用者可在技術支援論壇提出意見反應或使用問題。

 [檢視技術支援論壇](https://wordpress.org/support/plugin/time-machine/)

## 贊助

想要支援這個外掛的發展嗎？

 [ 贊助這個外掛 ](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=Q6Q762MQ97XJ6)