Web-D There is an urgent problem with WordPress that needs immediate attention!

Stringer

Well-known member
Joined
May 11, 2020
Messages
230
URGENT ISSUE!!!

I have removed the Jetpack WordPress plugin from my website and as a result, every Pinterest embed on my site is now broken and only displaying the plain URL. Is there a solution available to automatically convert these URLs into the WordPress Gutenberg Pinterest block? This issue is causing a lot of trouble and frustration for me. Can anyone please assist me with this as soon as possible?

Thank you in advance for your help!
 
Apologies for stating the obvious, but have you considered reactivating Jetpack? It is possible that the issue lies in Jetpack's embedding of its own code around the URL, which might not be compatible with other plugins and Gutenberg. Creating a simple custom plugin could potentially serve as a solution to address this problem.
 
Apologies for stating the obvious, but have you considered reactivating Jetpack? It is possible that the issue lies in Jetpack's embedding of its own code around the URL, which might not be compatible with other plugins and Gutenberg. Creating a simple custom plugin could potentially serve as a solution to address this problem.
Understood. If activating Jetpack is not an ideal solution due to the negative impact it has on your website's performance, it's understandable that you would prefer to avoid it. In that case, you're looking for a way to make mass changes to the code instead of manually modifying each instance personly.
 
Before proceeding, it is highly recommended to create a backup of your website to ensure its safety. The proposed solution involves using a plugin. You can create a PHP file and place it in your plugin folder for implementation.

Code:
<?php
/**
 * Plugin Name: Pinterest Block Conversion for Jetpack
 * Description: Converts Jetpack Pinterest blocks to Gutenberg blocks.
 * Version: 1.0
 * Author: tearzkiller
 * Author URI: https://doesntexist.com
 */

function pinterest_block_conversion_jetpack_register_block() {
  if ( function_exists( 'register_block_type' ) ) {
    // Register the block type
    register_block_type( 'pinterest-block-conversion-jetpack/converted-block', array(
      'render_callback' => 'pinterest_block_conversion_jetpack_render_block',
    ) );
  }
}
add_action( 'init', 'pinterest_block_conversion_jetpack_register_block' );

function pinterest_block_conversion_jetpack_render_block( $attributes ) {
  $output = '';

  // Get the Pinterest URL and board ID from the block attributes
  $pinterest_url = isset( $attributes['pinterestUrl'] ) ? $attributes['pinterestUrl'] : '';
  $board_id = isset( $attributes['boardId'] ) ? $attributes['boardId'] : '';

  // Use the Pinterest URL and board ID to generate the Pinterest block HTML
  $output .= '<a data-pin-do="embedBoard" data-pin-board-width="400" data-pin-scale-height="240" data-pin-scale-width="80" href="' . esc_url( $pinterest_url ) . '"></a>';

  return $output;
}
 
Before proceeding, it is highly recommended to create a backup of your website to ensure its safety. The proposed solution involves using a plugin. You can create a PHP file and place it in your plugin folder for implementation.

Code:
<?php
/**
 * Plugin Name: Pinterest Block Conversion for Jetpack
 * Description: Converts Jetpack Pinterest blocks to Gutenberg blocks.
 * Version: 1.0
 * Author: tearzkiller
 * Author URI: https://doesntexist.com
 */

function pinterest_block_conversion_jetpack_register_block() {
  if ( function_exists( 'register_block_type' ) ) {
    // Register the block type
    register_block_type( 'pinterest-block-conversion-jetpack/converted-block', array(
      'render_callback' => 'pinterest_block_conversion_jetpack_render_block',
    ) );
  }
}
add_action( 'init', 'pinterest_block_conversion_jetpack_register_block' );

function pinterest_block_conversion_jetpack_render_block( $attributes ) {
  $output = '';

  // Get the Pinterest URL and board ID from the block attributes
  $pinterest_url = isset( $attributes['pinterestUrl'] ) ? $attributes['pinterestUrl'] : '';
  $board_id = isset( $attributes['boardId'] ) ? $attributes['boardId'] : '';

  // Use the Pinterest URL and board ID to generate the Pinterest block HTML
  $output .= '<a data-pin-do="embedBoard" data-pin-board-width="400" data-pin-scale-height="240" data-pin-scale-width="80" href="' . esc_url( $pinterest_url ) . '"></a>';

  return $output;
}

I understand that technical expertise might not be your strong suit. Regarding your question, the solution being discussed aims to automate the conversion process of Pinterest embeds from the Jetpack code format to the Gutenberg Pinterest embed block format. By implementing the suggested approach, you can expect the conversion to occur automatically. I'm here to assist you, and I appreciate your appreciation!
 
I understand that technical expertise might not be your strong suit. Regarding your question, the solution being discussed aims to automate the conversion process of Pinterest embeds from the Jetpack code format to the Gutenberg Pinterest embed block format. By implementing the suggested approach, you can expect the conversion to occur automatically. I'm here to assist you, and I appreciate your appreciation!
I completely understand your concern, and you're right that running code from an unfamiliar source can pose risks. It's always advisable to prioritize safety, and manually making the changes would be the safest approach.

Regarding caching plugins, they can indeed be helpful in improving website performance. If you're currently using a caching plugin, it may be worth considering keeping Jetpack activated alongside it. This combination could potentially mitigate the performance issues associated with Jetpack and allow you to leverage its features while still benefiting from the caching plugin's optimizations.
 
It's possible that certain plugins may be conflicting with each other, which could be causing the issue. In such cases, you can attempt to resolve the problem by reactivating Jetpack. This may help to resolve any conflicts and restore normal functionality.
 
Back
Top Bottom