Comments (4)
Thought on this:
- Create an admin page, accessible to super-admins on multisite and admins on single-site, that allows whitelisting sources for the
pymsrc
and whitelisting domains for thesrc
attribute. - As a default, whitelist the current site's default
pymsrc
URL and the current domain. - At page render time, only output the
pymsrc
script on the page if it's in the whitelist. Only output thesrc
on the page if it's in the whitelist. - For a version before the on-render whitelisting goes active, for each site, set up some sort of cron job or something that looks at posts with the
[pym
shortcode and adds theirpymsrc
s andsrc
domains to the whitelist, before we present the whitelist to the users. - On post save, throw an error in the admin if the post's
pymsrc
orpym
domain aren't whitelisted. include a link to an explanation why. Include the text of the forbidden shortcode. In the post, leave the shortcode there but change the attribute names so that they're obviously not working.- maybe include a list of users with the appropriate permission to do the edit?
Why limit it to those users? They're who can put <script>
tags in posts, by default. (This is the unfiltered_html permission). By limiting editing the whitelist to those users, we raise the trust level required to put javascript on the page. Right now it's anyone who can edit who determines what javascript is allowed on the page. This change limits the determination of what javascript is allowed to the people who normally have that permission.
Why collect data for a version before it goes active? Because if we launch whitelisting with an empty whitelist, we have the chance of silently breaking everyone's existing embeds.
Why cause an error? Because we need to provide feedback that the embed isn't permitted. Why provide instructions? So people know how to remedy the error.
from pym-shortcode.
Another possible solution:
- on the settings page #32, register a setting that allows admins to enable the
pymsrc
attribute, which would be disabled by default. - If the attribute is enabled, allow the custom pymsrc.
from pym-shortcode.
Like, at minimum, we should be using https://developer.wordpress.org/reference/functions/wp_http_validate_url/ or something to make sure that the URL is valid.
from pym-shortcode.
register a setting that allows admins to enable the pymsrc attribute, which would be disabled by default.
This would be a breaking change for sites that have used an alternate pymsrc.
However, we can encourage admins in the upgrade notes and in the general readme and in the install notes to check the box and set the pymsrc to the CDN. As part of this, link to the "how to test upgrading this plugin on your site" docs, which should be written as part of #32.
from pym-shortcode.
Related Issues (20)
- rename text domain HOT 1
- React is dropping className for class HOT 1
- Add CONTRIBUTING.md
- contributors: inn_nerds becomes innlabs
- Tag 1.3.2.1 HOT 2
- Test against Gutenberg 4.0 and WP 5.0
- Gutenberg Block failing for me on Wordpress.com HOT 4
- Editor JS not enqueued in WordPress 5.0-beta versions HOT 2
- AMP support? HOT 6
- php error with latest version? HOT 6
- Test in Reader Mode in various browsers HOT 2
- Remove Pull Request Template from this repo so it's covered by INN's org-wide PR template HOT 2
- typo in docs: nwesroom
- Text domain corrections
- Release checklist for tagging version 1.3.2.3 HOT 2
- Update support.inn.org docs
- Release checklist for tagging version 1.3.2.4 HOT 3
- Test against WordPress 5.4 RC HOT 1
- Review `http:` strings in plugin and update to `https:` where possible
- Release checklist for tagging version [next]
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pym-shortcode.