這個外掛並未在最新的 3 個 WordPress 主要版本上進行測試。開發者可能不再對這個外掛進行維護或提供技術支援,並可能會與更新版本的 WordPress 產生使用上的相容性問題。

Screenshot Generator

外掛說明

Screenshot Generator is a WordPress plugin that takes screenshots of posts for social media etc. when they are updated.
It uses PhantomJS to do this.

Why? When developing Toptrust, I was tired of manually adding images of posts
when sharing on social media. This was especially true for pages that had no featured/thumbnail images.
I wanted screenshots to be taken automatically, and so Screenshot Generator was born.

Usage

When you update a post or page, a screenshot is automatically taken in the background.
After a few seconds, the screenshot URL is saved to the post’s meta key _scrgen_screenshot.

Screenshots on social media

An og:image and twitter:image:src is automatically added to the meta tags
when viewing the post. These are only added if the post doesn’t have a
thumbnail, in which case the plugin expects the thumbnail to be added by
you or another plugin. You can change this in the plugin settings page.

Retrieving screenshots manually

If you want to retrieve the screenshot manually, you can do so inside a post:

<img src="<?php echo scrgen_screenshot(); ?>" />

Contributing

Contributions are appreciated and very welcome. You can contribute in the
plugin’s GitHub repository.

Credits

The screenshot functionality is adapted from Microweber’s
Screen code.

螢幕擷圖

  • How the screenshot will look when shared in social media.
  • The settings page.

安裝方式

  1. Download the plugin to wp-content/plugins.
  2. Install PhantomJS.

    • Mac:

        $ brew install phantomjs
      

      Or if this fails, download from here.

    • Linux:

        $ apt-get install phantomjs fontconfig freetype*
      
  3. Make sure the phantomjs binary is in your PHP’s PATH.

    If you can’t modify your PATH, you can set the PHANTOMJS constant to the
    binary’s path and this will be used:

      define('PHANTOMJS', '/usr/local/bin/phantomjs');
    
  4. Create a folder called wp-content/screenshots and grant write permissions.

  5. Update a post.

使用者評論

這個外掛目前沒有任何使用者評論。

參與者及開發者

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

參與者

將〈Screenshot Generator〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄