glomex oEmbed

Description

This is a WordPress plugin that acts as a bridge between our oEmbed endpoint and internal WP oEmbed service. It allows simple oEmbed operation – just paste a link into (basically) any WordPress editor and it will automagically convert this link into glomex player/playlist/integration.

Installation and operation

Operation simple as follows:

  1. Install plugin into WordPress
  2. Activate plugin
  3. Follow instructions and configure the plugin
  4. Forge a URL from template: https://exchange.glomex.com/[video|videos|playlist|playlists]/VIDEO_OR_PLAYLIST_ID (integrationId parameter is optional)
  5. Go to your post and paste the url into any editor (editor must support oEmbed)
  6. You get an embedded player inside content!

This plugin is intended for internal and external usage. It only requires a glomex Exchange integration ID to operate.

Shortcodes

[glomex_integration]

You can use the shortcode [glomex_integration] to embed a player in your post.
Additional shortcode parameters (not required):
* playlist_id – ID of the playlist to embed
* integration_id – override default integration ID
* variant – player variant (default: ‘player-listicle’)
* width – player width in pixels (default: responsive width)
* height – player height in pixels (default: 16:9 aspect ratio)

Note: All shortcode attributes are properly sanitized for security.
If both width and height are not specified, the player will use responsive sizing with 16:9 aspect ratio.

URL

The supported url scheme is https://exchange.glomex.com/[video|videos|playlist|playlists]/VIDEO_OR_PLAYLIST_ID

The placeholder variables are:
* VIDEO_OR_PLAYLIST_ID (mandatory) – the element id to embed
* [video|videos|playlist|playlists] (mandatory) – select one item to embed – it should exist in your account and be accessible with the given integration ID

Allowed parameters:

  • integrationId (optional) – allows overriding integration ID for this single embed
  • includeStructuredData (optional) – allows overriding structured data inclusion for this single embed

Plugin settings are used by default in all cases. Query strings will override the setting.

Configuration options

You can set up the default integration ID using the GLOMEX_INTEGRATION_ID environment variable.

Custom script attributes

On the settings page you can add custom HTML data-* attributes to the glomex player script tags. This is useful for telling performance/optimization plugins to leave the player script alone – for example, add data-cfasync = false to exclude the script from Cloudflare Rocket Loader, or data-no-optimize = 1 to exclude it from WP Rocket. Only data-* attribute names are accepted; other names are ignored. When “Output general script?” is enabled, the attributes are applied to the single script loaded on every page; otherwise they are added to each embed’s inline script on a best-effort basis.

Installation

Uploading in WordPress Dashboard

  1. Navigate to the ‘Add New’ in the plugins dashboard
  2. Navigate to the ‘Upload’ area
  3. Select the plugin archive from your computer
  4. Click ‘Install Now’
  5. Activate the plugin in the Plugin dashboard

Using FTP

  1. Download plugin archive
  2. Extract the archive to your computer
  3. Upload the plugin directory to the plugins directory (it is usually /wp-content/plugins/ but sometimes it may vary)
  4. Activate the plugin in the Plugin dashboard

FAQ

Which features do I need on my server?

You need at least WP 5.3.14, PHP 7.4 with the mbstring and curl extensions enabled.

What do I need to operate the plugin?

You need to configure the plugin. There are 4 options at the moment – integration ID, structured data output, whether to load the player script once on all pages, and custom script attributes.
You need an account at glomex Exchange.

Where do I get my integration ID?

  1. You need to navigate to your account at glomex Exchange.
  2. Go to Manage => Players
  3. Select one and copy Configuration ID
  4. Paste the ID into the field on site or use to forge a link

Can I use more than one integration ID on the site?

Yes you can. You can have one “basic” integration ID in your plugin configuration and any amount of integration IDs for embedded player.

What is a Structured data?

Structured data allows you to have more search-engine friendly site. In case of our plugin this means that results from
your site may appear as “Video” in Google search results. We provide a JSON-LD structured data for you. Read more on
JSON-LD.

How do I stop my performance/optimization plugin from breaking the player?

Some optimization plugins (script deferring/combining, Cloudflare Rocket Loader, etc.) can interfere with the glomex player script. Use the “Custom script attributes” setting to add the attribute your plugin uses to skip a script. For example:

  • Cloudflare Rocket Loader: data-cfasync = false
  • WP Rocket: data-no-optimize = 1

Only data-* attribute names are accepted; the attributes are added to the player script tags on the front end.

Reviews

There are no reviews for this plugin.

Contributors & Developers

“glomex oEmbed” is open source software. The following people have contributed to this plugin.

Contributors

Translate “glomex oEmbed” into your language.

Interested in development?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.

Changelog

0.9.6

  • added a “Custom script attributes” setting to attach data-* attributes (e.g. data-cfasync="false") to the glomex player script tags, so they can be excluded from Cloudflare Rocket Loader and similar optimizers
  • fixed the missing “Settings” link on the Plugins page (corrected the plugin file name and menu URL in the action-link hook)

0.9.5

  • tested with WordPress 7.0.1
  • fixed _load_textdomain_just_in_time notice on WordPress 6.7+ by no longer calling translation functions before the init hook
  • hardened the activation/deactivation hooks against being invoked with a null argument (e.g. by older WP-CLI versions)
  • updated bundled dependencies (upstream i18n loading improvements)
  • reduced package size by removing development files (VCS/CI metadata) from bundled dependencies

0.9.4

  • improved security by adding proper escaping for shortcode attributes

0.9.3

  • improved code quality to align with WordPress Coding Standards.
  • improved security by adding proper sanitize for shortcode attributes

0.9.2

  • improved security by adding proper escaping for shortcode attributes
  • updated/tested with WP 6.7.1

0.9.1

  • created glomex_integration shortcode to embed a player in your post

0.9.0

  • created functionality for the prefixing video ID in the URL
  • updated/tested with WP 6.4.3

0.8.5

  • updated vendor requirements

0.8.4

  • removed internal update checker
  • renamed functions/namespaces/constants names with new prefix

0.8.3

  • updated vendor requirements

0.8.2

  • fixed the problem with embedding URL decoding in popular page builders

0.8.1

  • fixed the problem with embedding URL decoding in older WP versions

0.8

  • fix files headers
  • fix grumphp config
  • refactor main oEmbed code to be better quality
  • implement custom codestyle based on CodeatCS

0.7

  • Use 2 different vendor directories and composer files

0.6

  • Load only single glomex-player.js on frontend

0.5.5

  • Bugfix in oEmbed URL generation function

0.5.4

  • Update documentation

0.5.3

  • Implemented update checker with support for Github repo

0.5.0

  • Initial release with basic functions