You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Display a message box if the custom meta box removal has been overridden.
63
-
64
-
if ( '1' === $options['meta_box'] ) {
65
-
echo'<div class="error fade"><p><strong>' . esc_html( __( 'Warning: You have custom post fields switched on for users who do not have the unfiltered HTML capability. This means that insecure code can be added. Please see the plugin README for more details.', 'simple-embed-code' ) ) . "</strong></p></div>\n";
/><?phpesc_html_e( 'Allows custom meta boxes to be shown for all users, including those without unfiltered HTML permissions.', 'simple-embed-code' ); ?><p class="description"><?phpesc_html_e( 'For security purposes, it is recommended that you do not select this option unless you have to. Please the plugin README for more details.' ); ?></p></td>
85
-
</tr>
86
-
87
68
</table>
88
69
89
70
<?phpecho'<h3>' . esc_html( ucwords( __( 'Identifier format', 'simple-embed-code' ) ) ) . '</h3>' . esc_html__( 'Specify the format that will be used to define the way the code is embedded in your post. The formats are case insensitive and characters < > [ ] are invalid.', 'simple-embed-code' ); ?>
@@ -146,15 +146,13 @@ If you don't wish the output to be full width you can specify a maximum width by
146
146
147
147
By default embed code will not appear in excerpts. However, you can switch this ability on via the Code Embed options screen. If you do this then the standard rules of excerpts will still apply, but now once the code embed has applied - for example, excerpts are just text, a specific length, etc.
148
148
149
-
== Custom Field Security ==
149
+
== Filtering of code ==
150
150
151
151
By default, WordPress allows unfiltered HTML to be used by users in post custom fields, even if their role it set up otherwise. This opens up the possibility of leaving a site vulnerable, if any plugins that uses this data doesn't check it appropriately.
152
152
153
153
"Out of the box", neither the contributor and author roles have unfiltered HTML capabilities but can access custom post fields.
154
154
155
-
As this plugin requires the use unfiltered HTML, we need to ensure that the only users who use it, should be using it. From version 2.4, this plugin will now turn off custom fields for any users that don't have this capability. This will protect this plugin, but any others too. On the flip side, some users may now loose access to these fields who may still require it.
156
-
157
-
For this reason, there is an option in the Code Embed settings screen to turn them back on for all users. Please use this ONLY if it really is needed. I would recommend looking at giving those users different, or modified roles, with the appropriate permissions instead of overridding it here. But the choice is yours.
155
+
As this plugin requires the use unfiltered HTML, we need to ensure that the only users who use it, should be using it. From version 2.5, any users without this permission that update a post containing embeds from this plugin will cause the code to be filtered.
158
156
159
157
== Reviews & Mentions ==
160
158
@@ -179,9 +177,11 @@ Voila! It's ready to go.
179
177
180
178
= My code doesn't work =
181
179
182
-
If your code contains the characters `]]>` then you'll find that it doesn't - WordPress modifies this itself.
180
+
If your code contains the characters `]]>` then you'll find that it doesn't - WordPress modifies this itself.
181
+
182
+
Also, check to see if the post has been modified by a user without `unfiltered_html` permissions - if it was, they may have caused the code to have been modified (see the "Filtering of code" section above).
183
183
184
-
Otherwise, it's likely to be your code and not this plugin. The best way to confirm this is to look at the source of the page and compare the code output with what you embedded. Does it match? If it does, then your code is at fault.
184
+
Otherwise, it's likely to be your code and not this plugin. The best way to confirm this is to look at the source of the page and compare the code output with what you embedded. Does it match? If it does, then your code is at fault.
185
185
186
186
= What's the maximum size of the embed code that I can save in a custom field? =
187
187
@@ -207,6 +207,10 @@ It is, in that it doesn't save any data that could be odds with GDPR compliance
207
207
208
208
I use semantic versioning, with the first release being 1.0.
209
209
210
+
= 2.5 =
211
+
* Enhancement: This release is a revised version of 2.4, with less impact to other plugins and users. See the README for more details, but this undoes the changes in 2.4 and adds in filtering of code embed fields for users without the correct permissions.
212
+
* Bug: Fixed a long time bug that could cause an infinite loop to occur in rare situations
213
+
210
214
= 2.4 =
211
215
* Enhancement: A vulnerability was raised to me but is actually an issue with Core. I've implemented a fix that protects not just this plugin but any others you may have installed. Please read the section in the README titled "Custom Field Security" for more details
212
216
* Enhancement: Tweaked a few bits of code here. No visible changes, just quality improvements
0 commit comments