automattic / vip-jetpack Goto Github PK
View Code? Open in Web Editor NEWJetpack changes for VIP Go (DEPRECATED and moved to https://github.com/Automattic/vip-go-mu-plugins/tree/master/vip-jetpack)
License: GNU General Public License v2.0
Jetpack changes for VIP Go (DEPRECATED and moved to https://github.com/Automattic/vip-go-mu-plugins/tree/master/vip-jetpack)
License: GNU General Public License v2.0
We would like notifications from Travis CI, but the token should not be exposed in a public repository.
Travis provides a mechanism for this purpose: https://docs.travis-ci.com/user/encryption-keys/
Right now we are using Photon hooks to re-write images to use the VIP Go file service (https://github.com/Automattic/vip-jetpack/blob/master/jetpack-misc.php#L22). The hope was the Photon JavaScript for detecting device resolution and scale would continue to work and provide the correct image query parameters. Unfortunately the JS has a number of checks that fail.
The two Photon JS files used for modifying images are:
https://s0.wp.com/wp-content/js/devicepx-jetpack.js?ver=201607 (which contains a number of URL checks e.g. img.src.match(/^https?:\/\/([^\/]+)\.files\.wordpress\.com\/.+[?&][wh]=/)
).
and
https://tumbleweed.simonwheatley.co.uk/wp-content/mu-plugins/jetpack/modules/photon/photon.js?m=1432675342g (which may be completely unnecessary).
Our solution to this should be to completely disable Photon and to re-write devicepx-jetpack.js to correctly support the VIP Go file service. This may require us to pass in the current URL into the JavaScript (via variable in the head or a data-attribute) to ensure we are only modifying images served from the current site domain.
Whilst the VIP Go file service only supports one single query parameter we may also be able to prioritise the order in which the query parameters are added to ensure we are giving the best image we can. In future we will be able support multiple query parameters.
From this line: https://github.com/Automattic/vip-jetpack/blob/master/jetpack-mandatory.php#L152 it looks like the plan is to hide deactivate buttons on forced modules. On the Jetpack module pop-ups the deactivate button is visible:
We need to update the UI around forced modules to match the new Jetpack UI. After the redesign, the logic to disable checkboxes for forced or unavailable modules doesn't work. If you try to disable a forced module, you even see a message that says it was successfully disabled even though that's not true.
add_filter( 'jetpack_photon_reject_https', '_return_false' );
When activating the default set of recommended features in Jetpack a console error is thrown:
Fetch API cannot load https://site.go-vip.co/wp-json/jetpack/v4/site. Request header field x-wp-nonce is not allowed by Access-Control-Allow-Headers in preflight response.
It would seem that the x-wp-nonce
header is being blocked. I am hoping we can fix it here, or perhaps we need to go make some changes to our nginx configs?
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.