Automattic / wp-calypso

The JavaScript and API powered WordPress.com
https://developer.wordpress.com
GNU General Public License v2.0
12.42k stars 1.99k forks source link

WPcom Editing Toolkit causes fatal errors on self-hosted sites #77573

Open cuemarie opened 1 year ago

cuemarie commented 1 year ago

Quick summary

If I activate WordPress.com Editing Toolkit on my self-hosted site (hosted with Pressable), I encounter several critical PHP errors.

First, activating the plugin with no other plugins active results in the following error:

PHP Fatal error: Uncaught Error: Class "Jetpack_Options" not found in /srv/htdocs/wp-content/plugins/full-site-editing/help-center/class-help-center.php:139

After deactivating, I activated and connected Jetpack on my site, then tried again. This time, I encountered this error:

PHP Fatal error: Uncaught Error: Call to undefined function A8C\FSE\wpcom_get_site_purchases() in /srv/htdocs/wp-content/plugins/full-site-editing/help-center/class-help-center.php:143

These errors seem to imply that this plugin cannot work on a self-hosted site, but we don't make that known anywhere on the plugin's page. The reviews for the plugin also reflect this poor experience

Steps to reproduce

  1. On a self-hosted site, install and activate the WordPress.com Editing Toolkit plugin

What you expected to happen

Either the plugin would work, or it would warn me that it cannot work outside of WordPress.com

What actually happened

A series of fatal errors, noted above.

Impact

Some (< 50%)

Available workarounds?

No and the platform is unusable

Platform (Simple and/or Atomic)

Self-hosted

Logs or notes

cuemarie commented 11 months ago

Fixed by https://github.com/Automattic/wp-calypso/pull/81967

cuemarie commented 11 months ago

I tested this to close yesterday, but returned to my self-hosted site today to find it fatal-ing after all. Currently have the following plugins active:

⚠️ ERROR

PHP Fatal error: Uncaught Error: Class "Domain_Mapping" not found in /srv/htdocs/wp-content/plugins/full-site-editing/wpcom-domain-upsell-callout/class-wpcom-domain-upsell-callout.php:153 Stack trace: #0 /srv/htdocs/wp-content/plugins/full-site-editing/wpcom-domain-upsell-callout/class-wpcom-domain-upsell-callout.php(87): A8C\FSE\WPCOM_Domain_Upsell_Callout->blog_has_custom_domain(194267179) #1 /srv/htdocs/wp-content/plugins/full-site-editing/wpcom-domain-upsell-callout/class-wpcom-domain-upsell-callout.php(45): A8C\FSE\WPCOM_Domain_Upsell_Callout->should_not_show_callout() #2 /wordpress/core/6.3.2/wp-includes/class-wp-hook.php(310): A8C\FSE\WPCOM_Domain_Upsell_Callout->enqueue_script_and_style('') #3 /wordpress/core/6.3.2/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters(NULL, Array) #4 /wordpress/core/6.3.2/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #5 /wordpress/core/6.3.2/wp-admin/edit-form-blocks.php(272): do_action('enqueue_block_e...') #6 /wordpress/core/6.3.2/wp-admin/post-new.php(72): require('/wordpress/core...') #7 {main} thrown in /srv/htdocs/wp-content/plugins/full-site-editing/wpcom-domain-upsell-callout/class-wpcom-domain-upsell-callout.php on line 153
obenland commented 11 months ago

@lupus2k Could you take a look at this when you get a chance? Looks like it just needs a class_exists check before using it.

katiebethbrown commented 7 months ago

Wanted to note that this is still occurring.

Deactivating Jetpack on an Atomic site while ETK is active causes a fatal in wp-admin:

[15-Mar-2024 02:25:02 UTC] PHP Fatal error:  Uncaught Error: Class "Jetpack_Options" not found in /wordpress/plugins/full-site-editing/4.15835/wpcom-domain-upsell-callout/class-wpcom-domain-upsell-callout.php:84
Stack trace:
#0 /wordpress/plugins/full-site-editing/4.15835/wpcom-domain-upsell-callout/class-wpcom-domain-upsell-callout.php(45): A8C\FSE\WPCOM_Domain_Upsell_Callout->should_not_show_callout()
#1 /wordpress/core/6.4.3/wp-includes/class-wp-hook.php(324): A8C\FSE\WPCOM_Domain_Upsell_Callout->enqueue_script_and_style('')
#2 /wordpress/core/6.4.3/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#3 /wordpress/core/6.4.3/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#4 /wordpress/core/6.4.3/wp-admin/edit-form-blocks.php(272): do_action('enqueue_block_e...')
#5 /wordpress/core/6.4.3/wp-admin/post-new.php(72): require('/wordpress/core...')
#6 {main}
  thrown in /wordpress/plugins/full-site-editing/4.15835/wpcom-domain-upsell-callout/class-wpcom-domain-upsell-callout.php on line 84
obenland commented 7 months ago

@lupus2k This module should probably not run on self-hosted sites. Could add a check that avoids the plugin fataling on self-hosted sites?

katiebethbrown commented 6 months ago

@obenland @lupus2k - If we're adding a conditional for self-hosted sites, can we extend that so things also fail gracefully on Atomic sites if Jetpack gets disabled?

obenland commented 6 months ago

Maybe we could declare a dependency to Jetpack, so the plugin has to be deactivated before deactivating Jetpack.

taipeicoder commented 1 week ago

The ETK plugin is now deprecated. @obenland could you advise on the next steps to delist the plugin from .org? cc: @arthur791004

obenland commented 1 week ago

Is it no longer a managed plugin on Atomic? pekYwv-4As-p2#comment-4238

github-actions[bot] commented 1 week ago

Support References

This comment is automatically generated. Please do not edit it.

taipeicoder commented 1 week ago

@arthur791004 did we fix that via D162416-code?

arthur791004 commented 1 week ago

Yes. The ETK plugin won't be installed on the newly created atomic sites anymore.