Trex Dual Preview

설명

Trex Dual Preview adds a one-click PC & smartphone simultaneous preview to the WordPress block editor (Gutenberg) sidebar.

Features

  • Open a modal with PC and smartphone previews side by side with one click
  • Compare PC (1200-1920px) and SP (320-768px) viewports in real time
  • Adjust display width instantly using sliders
  • Open a full-screen dual preview in a new tab
  • Automatically hides the WordPress admin bar and theme-specific toolbars (e.g. Cocoon)
  • Responsive layout that adapts to window resize via ResizeObserver

Security

  • Full-screen preview access is protected by wp_verify_nonce() and current_user_can()
  • iframes use the sandbox attribute to restrict unnecessary permissions
  • All input is sanitized and escaped (absint, sanitize_text_field, esc_url, etc.)

스크린샷

  • The trigger button in the editor sidebar.
  • Modal showing PC and SP previews simultaneously (with sliders).
  • Full-screen dual preview opened in a new tab.

설치

  1. Upload the plugin ZIP and activate it from the Plugins menu.
  2. Open any post or page in the block editor (Gutenberg).
  3. In the right sidebar, go to the “Post” tab and click the “PC/SP Dual Preview” button.
  4. Save as a draft first to preview the latest content.

FAQ

The preview is blank.

Please save your post as a draft first. Without saving, a preview URL cannot be generated.

The admin bar is visible in Cocoon theme.

This was fixed in v2.3.2 and later. Please update to the latest version.

Is this available to non-administrator users?

Yes. Any user with the edit_post capability (Editor, Author, etc.) can use it.

후기

이 플러그인에 대한 평가가 없습니다.

기여자 & 개발자

“Trex Dual Preview”(은)는 오픈 소스 소프트웨어입니다. 다음의 사람들이 이 플러그인에 기여하였습니다.

기여자

자국어로 “Trex Dual Preview”(을)를 번역하세요.

개발에 관심이 있으십니까?

코드 탐색하기는, SVN 저장소를 확인하시거나, 개발 기록RSS로 구독하세요.

변경이력

2.4.3

  • Fix: Remove Plugin URI to avoid conflict with Author URI (WordPress.org submission requirement)

2.4.2

  • Add: Usage notes added to modal footer and full-screen page footer (save reminder & display accuracy notice)

2.4.1

  • Fix: Apply esc_html() / esc_url() directly at output point to pass Plugin Check (OutputNotEscaped)
  • Fix: Updated “Tested up to” to WordPress 6.9
  • Fix: Short description and description rewritten in English per WordPress.org guidelines

2.4.0

  • Refactor: Full code rewrite with PHPDoc / JSDoc comments
  • Refactor: WordPress Coding Standards (WPCS) compliance
  • Refactor: JS restructured as IIFE with TDP namespace object
  • Add: ARIA attributes for improved accessibility
  • Improve: PC preview height now dynamically maximized
  • Improve: Full-screen loading overlay fully removed from DOM after transition

2.3.4

  • Add: Full-screen loading overlay for new-tab preview
  • Fix: Pre-set initial clip width in HTML attribute to eliminate flash
  • Fix: Changed initialization timing to DOMContentLoaded

2.3.3

  • Change: PC slider range changed to 1200-1920px

2.3.2

  • Fix: Removed overly broad CSS selector ([class*=”toolbar”]) from injected styles
  • Fix: PC slider minimum changed to 769px (avoids Cocoon breakpoint)

2.3.1

  • Change: PC slider minimum changed to 768px

2.3.0

  • Improve: PC preview height now dynamically fills the window

2.2.0

  • Improve: SP preview height adapts to window height via ResizeObserver

2.1.0

  • Add: Real-time width slider for both PC and SP previews

2.0.3

  • Change: Author changed to “Pro Engineer Trex”

2.0.2

  • Fix: Remove Cocoon toolbar (fixed bottom bar) in full-screen preview

2.0.1

  • Fix: Blank iframe in new-tab full-screen preview

2.0.0

  • Add: “Open in new tab” full-screen dual preview via template_redirect endpoint

1.0.5

  • Initial stable release