• Resolved berkux

    (@berkux)


    When a gutenbrg-block /page is saved, the shortcode inside are executed. This is bad when the plugin crashes or sends or in this situation the plugin seems to fail.

    My plugin tries to get external API-data. If the external API-URL is invalid or temporarilly unavailable the page won’t save. Or the debugmode sends info.
    https://www.ads-software.com/plugins/json-content-importer/

    My solution in my plugin: If the REQUEST_URI is wp-json or wp-admin the plugin is terminated by a return “”;

    This works but seems not that elegant.
    Is it a bad idea?

    Bernhard

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi Bernhard –

    This may have already been previously discussed. Have you had a look through Github yet? https://github.com/wordpress/gutenberg/

    This is bad when the plugin crashes or sends or in this situation the plugin seems to fail.

    Is this something that you’ve experienced or just anticipate?

    Thread Starter berkux

    (@berkux)

    Hi lizkarkoski,

    <<This may have already been previously discussed. >>
    Maybe, but I can’t find those.

    In principle it might make sense to execute the shortcode to show content in the editor. But this not always makes sense.

    I’m testing with the Gutenberg plugin and can reproduce such situations.
    So I’m search for a solid solution to avoid executing (or stop the plugin at the start) when saving in the editor.

    Thank you
    Bernhard

    Thanks – Please tell me which short codes you have been testing with.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Plugin: Exit on wp-json / wp-admin requests’ is closed to new replies.