jetpack
jetpack copied to clipboard
De-Fusion: Site Logo
Impacted plugin
Jetpack
What
Site Logo
How
// `.min` and `rtl` asset files not included, because those are handled differently in wpcom and Jetpack.
// `modules/theme-tools/site-logo/inc/class-site-logo.php` not included, because of differences in how wpcom handles image sizes.
"$plugin_root/modules/theme-tools/site-logo.php" => "$wpcom_root/wp-content/mu-plugins/site-logo.php",
"$plugin_root/modules/theme-tools/site-logo/inc/compat.php" => "$wpcom_root/wp-content/mu-plugins/site-logo/inc/compat.php",
"$plugin_root/modules/theme-tools/site-logo/inc/functions.php" => "$wpcom_root/wp-content/mu-plugins/site-logo/inc/functions.php",
"$plugin_root/modules/theme-tools/site-logo/js/site-logo-header-text.js" => "$wpcom_root/wp-content/mu-plugins/site-logo/js/site-logo-header-text.js",
Putting this approach up for review:
- Prerequisite JP PR to require out-of-sync wpcom specific implementation: #25359
- Update main mu-plugin file to point to the Jetpack plugin path: D85249-code
- Cleanup obsolete Fusion refs: D85251-code
To test:
- Patch D85249-code to sandbox. This will require the
site-logo.php
file from the jetpack-plugin dir. - Update the
site-logo.php
file in the jetpack-plugin dir with the changes in #25359 - Place an error log in the wpcom specific/dir
class-site-logo.php
file. - On a sandboxed site navigate to Appearance > Customize > Logo. Make sure you see your error log indicating the correct paths have been updated and no other errors are generated.
This all tests ok, except the error logging. That wasn't working for me so I then noticed by adding error logs in the Jetpack production site-logo.php
file, it would get as far as site_logo_init()
but wasn't making it into if ( current_theme_supports( 'site-logo' ) && ! class_exists( 'Site_Logo', false ) ) {
, despite using themes that support site logos.
Have I added the code here - https://github.com/Automattic/jetpack/pull/25359/ - to the right file, by adding it to jetpack-plugin/production/modules/theme-tools/site-logo.php
?
@coder-karen
Have I added the code here - https://github.com/Automattic/jetpack/pull/25359 - to the right file, by adding it to jetpack-plugin/production/modules/theme-tools/site-logo.php?
Yes, and with D85249-code applied that file should be accessed. The theme would need to support site-logo
though, and it seems like when I test with Twenty Fifteen, I can at least put an error log in the instance()
method in the wpcom copy of wp-content/mu-plugins/site-logo/inc/class-site-logo.php
and see that fire.
~~I did notice that I'll need to figure out the enqueue for site-logo-header-text.js
though 🤔~~
Updated D85249-code to use the JP plugin path of that JS file.
The moment I switched to Twenty Fifteen, the error log worked correctly. My mistake was choosing a few themes purely based on feature:site-logo
in WordPress.com. Works well now.
Jetpack PR merged: #25359 (and early sync to JP prod in D85943-code ) Update changeset: r250673-wpcom Cleanup changeset: r250675-wpcom Build cleanup: #25642