tddjaved
Forum Replies Created
-
Hi,
I have managed to resolve this with a custom PHP script, in the posts meta table, Elementor serializes the content to JSON and I needed to remove the hyperlinks attributes from there.
Here is a copy of the script;
<?php
// Include WordPress to access $wpdb
require_once( 'wp-load.php' );
global $wpdb;
// Query the wp_postmeta table for posts with target="_new" or rel="noopener" in _elementor_data
$query = "
SELECT post_id, meta_value
FROM wpc5_postmeta
WHERE meta_key = '_elementor_data'
AND (meta_value LIKE '%target=%' OR meta_value LIKE '%rel=%')
LIMIT 500;
";
$posts = $wpdb->get_results( $query );
// Check if posts are returned
if ( empty( $posts ) ) {
echo "No matching posts found in wpc5_postmeta with '_elementor_data'.<br>";
exit;
}
echo "Found " . count( $posts ) . " posts to update.<br>";
// Loop through each post to process and update
foreach ( $posts as $post ) {
echo "<br>Processing post ID: " . $post->post_id . "<br>";
// Output the raw meta_value to see the format
echo "<strong>Raw meta_value:</strong><br>";
var_dump($post->meta_value);
echo "<br>";
// Decode the JSON data
$decoded_content = json_decode( $post->meta_value, true );
if ( json_last_error() === JSON_ERROR_NONE ) {
// Process the decoded content (if it's valid JSON)
array_walk_recursive( $decoded_content, function( &$value ) {
if ( is_string( $value ) ) {
// Replace target and rel attributes
$value = str_replace( 'target="_new"', '', $value );
$value = str_replace( 'rel="noopener"', '', $value );
}
});
// Re-encode the content as JSON
$updated_meta_value = json_encode( $decoded_content );
// Update the postmeta table with the new cleaned value
$wpdb->update(
'wpc5_postmeta',
array( 'meta_value' => $updated_meta_value ),
array( 'post_id' => $post->post_id, 'meta_key' => '_elementor_data' )
);
echo "Updated post ID: " . $post->post_id . "<br>";
} else {
echo "The content for post ID " . $post->post_id . " is not valid JSON.<br>";
}
}
echo "Processing completed successfully!";I then had to regenerate the CSS and library, cleared cache, checked the content and it’s removed those hyperlink attributes.
So I don’t think I need to share a Loom recording for this.
I’ll mark this as resolved.Thanks
Javed@mirrowdesign have you checked the console in the browser to see what error message is being shown, if any?
In the settings for the plugin, it will flag the account whether you need to connect as a Business account – if it does, do that and then flush any caches on the server/website and the feed should work for you.
Hello @ricav
Please can you let us know what plans you have in place in terms of fixing this bug with your plugin?
This has been going on for a while now and we need a fix for this to be implemented.
The problem is with the latest release you have introduced and the conflicting plugin Elementor Kit Lite is not the problem here.
Thank you,
JavedHi @smartcloud
I’m using ElementsKit Lite for the header and footer of the websites I am building amongst the other widgets the plugin offers.
I can’t disable the plugin, otherwise it’ll end up removing the header + footer.
Thanks,
JavedHi @miloss84
I’ve updated Elementor to Version 3.24.3, gone to Elementor > Tools > Regenerate CSS > cleared the cache and tested it in several browsers. I can confirm the Zoom functionality seems to be working as normal.
What I have noticed is if you are logged into WordPress and refresh the page several times (homepage) or the page that has the zoom animation on, it reverts back to being in your face, however when logging out of WordPress and then refreshing the page on the frontend, the Zoom functionality is working as expected.
Thanks,
JavedHi @doublezed2
The performance related changes on the staging website was to remove any disabled plugins, update the WooCommerce templates that were outdated and then setting the primary key on the required WooCommerce action scheduler tables, then I removed the failed actions and, cleared the cache on the server and let the action scheduler run through the backlog.
I also cleared the database of any revisions etc and it seems to be working fine now. I also turned off the autoload option for the theme.
The other tables mentioned I am yet to look at setting the primary key on it.
In terms of WooCommerce, I don’t think I have anything further to add to this thread. If I do, then I will repost back here.
Thanks,
JavedMassive difference made to sorting out the tables mentioned, the backend and frontend seems to be running quicker now.
I have the following tables to repair and optimise and hopefully will give the site a further speed lift!
wp_h5_commentmeta – ~45,750 rows
wp_h5_fg_redirect – ~24,378 rows
wp_h5_gla_budget_recommendations – ~8,506 rows
wp_h5_facetwp_index – ~7,605 rows
wp_h5_defender_lockout_log – ~466 rowsThanks,
JavedI’ve had the following from the hosting company;
We're seeing a quite a few tables that are very large and don't have a primary key in the table defined. This can lead to spending a LOT of time looping through data in the database to retrieve the data that's used to render pages. Here are some examples of very large tables that don't have a primary key set for any of the columns:
wp_h5_actionscheduler_logs - ~294,749 rows
wp_h5_404_to_301 - ~708,433 rows
wp_h5_comments - ~99,123 rows
wp_h5_commentmeta - ~45,750 rows
wp_h5_fg_redirect - ~24,378 rows
wp_h5_actionscheduler_groups - ~20,961 rows
wp_h5_actionscheduler_actions - ~19,623 rows
wp_h5_gla_budget_recommendations - ~8,506 rows
wp_h5_facetwp_index - ~7,605 rows
wp_h5_defender_lockout_log - ~466 rows
We would suggest cleaning up these tables either by truncating them if they can be completely cleaned or for the ones where you need the data, check to see if any old data can be removed. Then I would suggest working with a developer to add in some primary keys to some of these tables which should help to speed up searching these tables for data needed when the pages are being built. Additionally, we're seeing some very large autoloaded options, specifically for wphb_scripts_collection. If these aren't needed on every page load, you can turn autoload off for these so that they're only being loaded on pages where they're needed. Please review this info and work on cleaning up the data mentioned and then let us know if you're still seeing issues with 504 timeouts when trying to load pages.Ok, so my questions;
- What is the best and safest way of adding a primary key to the following tables? Approach?
- wphb_scripts_collection – autoload, how do I turn off autoload?
Thanks,
JavedHi @joelsm
Do we have an update on this?
Since, I’ve noticed that Elementor has been updated, the problem still exists.
Thanks,
JavedHi @joelsm
I have implemented that change and cleared the cache in WordPress and on the server and that doesn’t seem to have helped.
It momentarily worked on a development site I am currently worked on but after refreshing the page again, the zoom in effect is in your face again.
I think this is a bug on your end and needs to be looked into, as this will be affecting loads of websites with that animation set.
Thank you,
Javed