Skip to content

Bug Report: Wikipedia Preview Fails to Generate Previews on Certain Wikipedia Namespaces & Cannot Be Disabled on Specific Links #231

@VDK

Description

@VDK

When linking to Wikipedia pages in certain namespaces (e.g., User:, Wikipedia: for policies), the Wikipedia Preview plugin does not generate previews. Additionally, attempts to turn off link detection (e.g., by setting 'wikipediapreview_detectlinks' => false) do not reliably prevent preview popups. Unlike some WordPress lightbox plugins (where you can add class="nolightbox" to exclude specific links), there is currently no per-link opt-out mechanism for Wikipedia Preview.


Steps to Reproduce

  1. Install and activate the Wikipedia Preview WordPress plugin (version 1.14.3).
  2. Create or edit a post and add a link to a Wikipedia “User:” page (e.g., https://en.wikipedia.org/wiki/User:Example) or a policy page in the “Wikipedia:” namespace (e.g., https://en.wikipedia.org/wiki/Wikipedia:Some_policy).
  3. Publish or preview the post.
  4. Observe one of the following:
    • The plugin does not generate a preview for those links.
    • If you tried disabling detectLinks (via post meta or defaults), the plugin may still attach previews to other Wikipedia links.

Expected Behavior

  1. Namespace Coverage: Ideally, the plugin would either support previews in all namespaces (e.g., User:, Wikipedia:) or skip them gracefully.
  2. Consistent Disable Option: When disabling link detection globally, no previews should appear unless specifically requested (via data-wikipedia-preview or similar).
  3. Per-Link Exclusion: A documented, built-in way (e.g., class="no-wp-preview") to exclude certain Wikipedia links from triggering popups, even if detectLinks is on.

Actual Behavior

  • Links to “User:” and “Wikipedia:” pages do not show a preview (if the plugin even attempts to load them).
  • Attempts to set detectLinks => false in the plugin defaults or post meta do not always disable previews for links that were previously detected.
  • The plugin does not provide a simple method (like a custom class) to exclude specific links while leaving others enabled.

Additional Context / Comparisons

  • Other plugins (e.g., popular lightbox tools) allow site owners to add an attribute or class (nolightbox) on links to prevent unintended behavior.
  • Some site owners want to link to their user profile or policy pages on Wikipedia. Without a preview, those links can appear broken or inconsistent with other previews.
  • If you want partial coverage of Wikipedia links, there is no easy way to disable specific ones without disabling the entire plugin or hacking the plugin's code.

Environment

  • WordPress Version: 6.x (or above)
  • Wikipedia Preview Plugin Version: 1.14.3
  • PHP Version: 7.4 or 8.x
  • Browsers Tested: Chrome, Firefox
  • Relevant WordPress Setup: Using standard theme and a few other plugins (no known direct conflicts).

Proposed Solutions

  1. Namespace Detection: Officially clarify or extend support to include “User:” and “Wikipedia:” namespaces, or gracefully skip them if they’re not supported.
  2. Per-Link Opt-Out: Add a recognized class or data attribute (e.g., class="no-wp-preview") that bypasses the detection logic.
  3. Global Disable Reliability: Ensure that setting detectLinks => false always disables the preview for all posts unless explicitly overridden.

Conclusion / Request

  • Support or Skip: Please consider officially handling all Wikipedia namespaces or gracefully skipping those that are unsupported.
  • Opt-Out Mechanism: Provide a documented way to exclude specific links (similar to nolightbox in the most popular lightbox plugin for WordPress).
  • Reliable Global Setting: Guarantee that detectLinks => false fully disables link detection.

Thank you for considering these improvements!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions