itteco / iframely-wordpress Goto Github PK
View Code? Open in Web Editor NEWIframely plugin for WordPress. Embed anything, with responsive widgets.
Home Page: http://wordpress.org/plugins/iframely/
Iframely plugin for WordPress. Embed anything, with responsive widgets.
Home Page: http://wordpress.org/plugins/iframely/
This one doesn't work:
[iframely]http://espn.go.com/video/clip?categoryId=2459789&id=10860466[/iframely]
This one works fine now:
[iframely url="http://espn.go.com/video/clip?categoryId=2459789&id=10860466" /]
Hi,
I have tested the latest version of your WordPress plugin on WP 6.3.2 and 6.41 and it does not seem to work.
In 6.3.2 observed the following issues:
blocks.min.js?ver=b5d3b99262dfb659bd26:10 Block validation: Block validation failed for `core/embed` (Object).
Content generated by `save` function:
<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube"><div class="wp-block-
embed__wrapper">
https://www.youtube.com/watch?v=84wL7JOar8wu0026iframely=eyJjbGlja190b19wbGF5Ijp0cnVlfQ%3D%3D
</div></figure>
Content retrieved from post body:
<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube"><div class="wp-block- embed__wrapper">
https://www.youtube.com/watch?v=84wL7JOar8w&iframely=eyJjbGlja190b19wbGF5Ijp0cnVlfQ%3D%3D
</div></figure>
In 6.4.1 the embed block crashes once you enter the URL:
The console reports the following error:
TypeError: Cannot read properties of null (reading 'innerHTML')
at c.updateEmptyPlaceholder (index.js?ver=1.0.2:1:1175)
at c.componentDidMount (index.js?ver=1.0.2:1:1690)
at Jr (react-dom.min.js?ver=18.2.0:10:80714)
at Zr (react-dom.min.js?ver=18.2.0:10:80489)
at Gr (react-dom.min.js?ver=18.2.0:10:80023)
at react-dom.min.js?ver=18.2.0:10:91526
at xl (react-dom.min.js?ver=18.2.0:10:92039)
at fl (react-dom.min.js?ver=18.2.0:10:85808)
at Nn (react-dom.min.js?ver=18.2.0:10:32474)
at react-dom.min.js?ver=18.2.0:10:83226
This leads to this line in the current version of the plugin https://github.com/itteco/iframely-wordpress/blob/main/src/js/components/IframelyOptions.js#L16C1-L16C1 which does not check if the element exists (the placeholder
element is null sometimes).
Could you look into these errors?
In order to implement all changes we need for this release, we also need an options page for it. Here it is. The text in (brackets) is explanations. Everything else is actual copy of the page.
Iframely will take URLs you place in editor on a separate line and will try to detect responsive embed codes for it. If successful, Iframely will put embed HTML code in your post. You can also use Iframely with [iframely http://url.com]
shortcode.
Enter Iframely API Key: [ ]
[(checkbox)] Only use Iframely with [iframely] shortcode
[Submit]
Hi,
Thanks for fixing the issue in #41, but there is one more place where the install_plugins
capability is used for multisite instances, could you also change the capability to manage_network_options
here:
This prevents from saving the settings on save there is not enough permissions screen.
Thanks,
Piotr
We need it, as it will be the default way of using the plugin.
Also, please, delete "http://" and "https://" from origin field as domain name is sufficient
Hi,
I noticed in these lines:
iframely-wordpress/app/UI/Settings.php
Line 30 in d3255e4
iframely-wordpress/app/UI/Settings.php
Line 65 in d3255e4
you used the install_plugins
capability for Multisite WP instances to check if the user has permission for certain actions.
If the wp_is_file_mod_allowed
returns false
(the file modification is not allowed through constant DISALLOW_FILE_MODS
or file_mod_allowed
filter), the plugin's settings page will not show up on such instances and there will be no way to save API key.
We are building a site on WP VIP hosting which has these restrictions, and we cannot use this plugin without a workaround.
Is it possible to change these capabilities to manage_options
or add a filter to customize them?
For the context, the WP core checks if the files are writable and returns false for the install_plugins
capability check here:
https://github.com/WordPress/WordPress/blob/master/wp-includes/capabilities.php#L615-L627
Example:
http://192.237.212.156/wp/?p=35
http://192.237.212.156/wp/?p=49
http://192.237.212.156/wp/?p=51
@nleush Please, add some instructions here
We have a new (hosted) API Endpoint for Iframely.
http://iframe.ly/oembed?url={YOUR URL}&api_key={YOUR KEY}&origin=hashtag
See the API Spec here.
Of course, you can change the order of GET
parameters to easier configure endpoint in WP. For example, put static api_key
and origin
first, followed by url that will be changing.
api_key
is configured in Options - use it here. Otherwise, omit the api_key all togetherorigin
field is the name of blog's domain that WP should have in its settings.We need to create the shortcode for Iframely in a format [iframely http://url.com]
.
It should work as default [embed]
shortcode, with one twist:
If options suggest that plugin should only be used to detect iframe.ly URLs on separate line, we need to follow the instructions.
In this case, we only add Iframely oembed endpoint for iframe.ly domain.
Also, we still need to make sure that all URLs are sent to our endpoint through [iframely] shortcode
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.