From 37a844ab4d42eaa5888d2aca441966ca43de39d8 Mon Sep 17 00:00:00 2001 From: Matthias Kittsteiner Date: Sat, 25 May 2024 06:56:33 +0200 Subject: [PATCH 1/6] =?UTF-8?q?=F0=9F=90=9B=20Always=20check=20all=20embed?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inc/class-embed-privacy.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/class-embed-privacy.php b/inc/class-embed-privacy.php index b431715..e05f30c 100644 --- a/inc/class-embed-privacy.php +++ b/inc/class-embed-privacy.php @@ -1932,7 +1932,7 @@ public function replace_embeds_oembed( $output, $url, $args ) { $embed_provider = ''; $embed_provider_lowercase = ''; - $embed_providers = $this->get_embeds( 'oembed' ); + $embed_providers = $this->get_embeds(); // get embed provider name foreach ( $embed_providers as $provider ) { From ee21c963f5d55f9259efaec6e1d07eeffa6e86fc Mon Sep 17 00:00:00 2001 From: Matthias Kittsteiner Date: Sat, 25 May 2024 10:00:21 +0200 Subject: [PATCH 2/6] =?UTF-8?q?=F0=9F=90=9B=20Fix=20widget=20filter=20prio?= =?UTF-8?q?rity=20See=20#219?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inc/class-embed-privacy-widget-output-filter.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/inc/class-embed-privacy-widget-output-filter.php b/inc/class-embed-privacy-widget-output-filter.php index 3d3be02..a918099 100644 --- a/inc/class-embed-privacy-widget-output-filter.php +++ b/inc/class-embed-privacy-widget-output-filter.php @@ -69,8 +69,7 @@ public static function get_instance() { * Initialize the functionality by registering actions and filters. */ private function __construct() { - // priority of 9 to run before the Widget Logic plugin. - \add_filter( 'dynamic_sidebar_params', [ $this, 'filter_dynamic_sidebar_params' ], 9 ); + \add_filter( 'dynamic_sidebar_params', [ $this, 'filter_dynamic_sidebar_params' ], \PHP_INT_MAX ); } /** From cb0f820e63b3e845def329c91bd9d12f9536ee01 Mon Sep 17 00:00:00 2001 From: Matthias Kittsteiner Date: Sat, 25 May 2024 10:18:57 +0200 Subject: [PATCH 3/6] =?UTF-8?q?=F0=9F=92=84=20Add=20support=20for=20Divi?= =?UTF-8?q?=20fluid=20width=20video=20wrapper=20See=20#206?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/style/scss/divi.scss | 5 +++++ inc/class-embed-privacy.php | 6 ++++++ webpack.config.js | 1 + 3 files changed, 12 insertions(+) diff --git a/assets/style/scss/divi.scss b/assets/style/scss/divi.scss index 7ce3e99..e4e2921 100644 --- a/assets/style/scss/divi.scss +++ b/assets/style/scss/divi.scss @@ -1,5 +1,10 @@ .embed-privacy-container { line-height: 1.7em; + + .fluid-width-video-wrapper > & { + inset: 0; + position: absolute; + } } // prevent hiding container around Embed Privacy diff --git a/inc/class-embed-privacy.php b/inc/class-embed-privacy.php index e05f30c..fb092f7 100644 --- a/inc/class-embed-privacy.php +++ b/inc/class-embed-privacy.php @@ -1592,6 +1592,7 @@ public function print_assets() { } if ( $this->is_theme( 'Divi' ) ) { + \wp_enqueue_script( 'embed-privacy-divi' ); \wp_enqueue_style( 'embed-privacy-divi' ); } @@ -1696,6 +1697,11 @@ public function register_assets() { \wp_register_style( 'embed-privacy-astra', $css_file_url, [], $file_version ); + $js_file_url = \EPI_EMBED_PRIVACY_URL . 'assets/js/divi' . $suffix . '.js'; + $file_version = $is_debug ? \filemtime( \EPI_EMBED_PRIVACY_BASE . 'assets/js/divi' . $suffix . '.js' ) : \EMBED_PRIVACY_VERSION; + + \wp_register_script( 'embed-privacy-divi', $js_file_url, [], $file_version, [ 'strategy' => 'defer' ] ); + $css_file_url = \EPI_EMBED_PRIVACY_URL . 'assets/style/divi' . $suffix . '.css'; $file_version = $is_debug ? \filemtime( \EPI_EMBED_PRIVACY_BASE . 'assets/style/divi' . $suffix . '.css' ) : \EMBED_PRIVACY_VERSION; diff --git a/webpack.config.js b/webpack.config.js index 663ef2a..ff6f6ea 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -8,6 +8,7 @@ const mode = isProduction ? 'production' : 'development'; const jsFiles = { 'admin/image-upload': path.resolve( process.cwd(), 'assets/js/admin', 'image-upload.js' ), + 'divi': path.resolve( process.cwd(), 'assets/js', 'divi.js' ), 'elementor-video': path.resolve( process.cwd(), 'assets/js', 'elementor-video.js' ), 'embed-privacy': path.resolve( process.cwd(), 'assets/js', 'embed-privacy.js' ), }; From 87902489f3491d19c2302432c810450bce56d401 Mon Sep 17 00:00:00 2001 From: Matthias Kittsteiner Date: Sat, 25 May 2024 10:23:35 +0200 Subject: [PATCH 4/6] =?UTF-8?q?=F0=9F=8D=B1=20Add=20missing=20asset=20See?= =?UTF-8?q?=20#206?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/js/divi.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 assets/js/divi.js diff --git a/assets/js/divi.js b/assets/js/divi.js new file mode 100644 index 0000000..67160dd --- /dev/null +++ b/assets/js/divi.js @@ -0,0 +1,15 @@ +/** + * Divi functionality + * + * @author Epiphyt + * @license GPL2 + * @package epiphyt\Embed_Privacy + */ +document.addEventListener( 'DOMContentLoaded', () => { + // Generate responsive video wrapper for Embed Privacy container + if ( $.fn.fitVids ) { + $( '#main-content' ).fitVids( { + customSelector: ".embed-privacy-container" + } ); + } +} ); From 6c570133995499b1dcb2aa80aaf5da8ef42cff13 Mon Sep 17 00:00:00 2001 From: Matthias Kittsteiner Date: Tue, 28 May 2024 11:22:41 +0200 Subject: [PATCH 5/6] =?UTF-8?q?=E2=99=BF=EF=B8=8F=20Improve=20screen=20rea?= =?UTF-8?q?der=20button=20text=20See=20#220?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inc/class-embed-privacy.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/inc/class-embed-privacy.php b/inc/class-embed-privacy.php index fb092f7..0505c60 100644 --- a/inc/class-embed-privacy.php +++ b/inc/class-embed-privacy.php @@ -977,7 +977,7 @@ public function get_output_template( $embed_provider, $embed_provider_lowercase, $footer_content .= ''; $footer_content .= \sprintf( /* translators: content name or 'content' */ - \esc_html__( 'Open %s directly', 'embed-privacy' ), + \esc_html__( 'Open "%s" directly', 'embed-privacy' ), ! empty( $args['embed_title'] ) ? $args['embed_title'] : \__( 'content', 'embed-privacy' ) ); $footer_content .= ''; @@ -994,8 +994,16 @@ public function get_output_template( $embed_provider, $embed_provider_lowercase, } ?>
> - - + +
@@ -1177,7 +1185,7 @@ public function get_single_overlay( $content, $embed_provider, $embed_provider_l } /* translators: embed title */ - $args['embed_title'] = $element->hasAttribute( 'title' ) ? \sprintf( \__( '"%s"', 'embed-privacy' ), $element->getAttribute( 'title' ) ) : ''; + $args['embed_title'] = $element->hasAttribute( 'title' ) ? $element->getAttribute( 'title' ) : ''; $args['embed_url'] = $element->getAttribute( $args['element_attribute'] ); $args['height'] = $element->hasAttribute( 'height' ) ? $element->getAttribute( 'height' ) : 0; $args['width'] = $element->hasAttribute( 'width' ) ? $element->getAttribute( 'width' ) : 0; @@ -1982,7 +1990,7 @@ public function replace_embeds_oembed( $output, $url, $args ) { $embed_title = $this->get_oembed_title( $output ); /* translators: embed title */ - $args['embed_title'] = ! empty( $embed_title ) ? \sprintf( \__( '"%s"', 'embed-privacy' ), $embed_title ) : ''; + $args['embed_title'] = ! empty( $embed_title ) ? $embed_title : ''; $args['embed_url'] = $url; $args['strip_newlines'] = true; From 339116a7782500cc682339718c0f6ff1b1a6b0be Mon Sep 17 00:00:00 2001 From: Matthias Kittsteiner Date: Fri, 31 May 2024 13:11:25 +0200 Subject: [PATCH 6/6] =?UTF-8?q?=F0=9F=94=96=20Prepare=20version=201.9.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 5 +++++ embed-privacy.php | 6 +++--- readme.txt | 7 ++++++- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ac1d003..4793f44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 1.9.2 +* Improve the text for screen readers upon activating the embedded content +* Fixed compatibility with other widget plugins +* Fixed handling of videos in Divi + ## 1.9.1 * Fixed an error while uninstalling the plugin * Fixed aspect ratio of embeds embedded via Divi diff --git a/embed-privacy.php b/embed-privacy.php index be7b903..827b594 100644 --- a/embed-privacy.php +++ b/embed-privacy.php @@ -4,7 +4,7 @@ /* Plugin Name: Embed Privacy Description: Embed Privacy prevents from loading external embeds directly and lets the user control which one should be loaded. -Version: 1.9.1 +Version: 1.9.2 Author: Epiphyt Author URI: https://epiph.yt License: GPL2 @@ -29,7 +29,7 @@ // exit if ABSPATH is not defined \defined( 'ABSPATH' ) || exit; -\define( 'EMBED_PRIVACY_VERSION', '1.9.1' ); +\define( 'EMBED_PRIVACY_VERSION', '1.9.2' ); if ( ! \defined( 'EPI_EMBED_PRIVACY_BASE' ) ) { \define( 'EPI_EMBED_PRIVACY_BASE', \WP_PLUGIN_DIR . '/embed-privacy/' ); @@ -58,7 +58,7 @@ function disable_plugin() { /** * Autoload all necessary classes. * - * @param string $class The class name of the autoloaded class + * @param string $class The class name of the auto-loaded class */ \spl_autoload_register( function( $class ) { $path = \explode( '\\', $class ); diff --git a/readme.txt b/readme.txt index 4ab8279..d673706 100644 --- a/readme.txt +++ b/readme.txt @@ -2,7 +2,7 @@ Contributors: epiphyt, kittmedia, krafit Tags: oembed, privacy, gutenberg Requires at least: 5.9 -Stable tag: 1.9.1 +Stable tag: 1.9.2 Tested up to: 6.5 Requires PHP: 5.6 License: GPL2 @@ -170,6 +170,11 @@ We are [Epiphyt](https://epiph.yt/), your friendly neighborhood WordPress plugin == Changelog == += 1.9.2 = +* Improve the text for screen readers upon activating the embedded content +* Fixed compatibility with other widget plugins +* Fixed handling of videos in Divi + = 1.9.1 = * Fixed an error while uninstalling the plugin * Fixed aspect ratio of embeds embedded via Divi