mondendev
Forum Replies Created
-
Forum: Plugins
In reply to: [One Click Demo Import] Import Failed, Error: error (500)I resolved the issue. The XML file’s paths pointed to a secondary demo website which didn’t have the media. You can disregard this topic.
Forum: Plugins
In reply to: [One Click Demo Import] Elementor Content URLs don’t get updatedIf anyone needs a solution, I fixed this myself using Elementor’s code for their “Tools > Replace URL” function. Put the code below at the end of your ocdi_after_import function and replace <YOUR_URL_GOES_HERE> with the source URL where your assets are pulled from, WITHOUT the slash at the end:
/** * Replace URLs in content created with Elementor */ if ( class_exists( '\Elementor\Plugin' ) ) { global $wpdb; $old_url = '<YOUR_URL_GOES_HERE>'; $new_url = get_site_url(); $escaped_from = str_replace( '/', '\\/', $old_url ); $escaped_to = str_replace( '/', '\\/', $new_url ); $meta_value_like = '[%'; // meta_value LIKE '[%' are json formatted $rows_affected = $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->postmeta} " . 'SET
meta_value
= REPLACE(meta_value
, %s, %s) ' . "WHEREmeta_key
= '_elementor_data' ANDmeta_value
LIKE %s;", $escaped_from, $escaped_to, $meta_value_like ) ); if ( false === $rows_affected ) { throw new \Exception( 'An error occurred while replacing URL\'s.' ); } // Allow externals to replace-urls, when they have to. $rows_affected += (int) apply_filters( 'elementor/tools/replace-urls', 0, $old_url, $new_url ); \Elementor\Plugin::$instance->files_manager->clear_cache(); }Same issue here.
Forum: Plugins
In reply to: [Contact Form 7] Contact Form 7 compatible with PHP 8?Also getting deprecated warnings on php 8.1.6
@kellymetal here:
https://www.ads-software.com/support/topic/w3c-validation-error-26/I’m getting the error wherever MailPoet form is present because it does exactly whet the error on W3C says, it prints out style tags with CSS in the middle of the page which is forbidden.
It’s present on normal pages, gutenberg pages, elementor pages. Regardless of location. The code mustn’t do that.
Forum: Plugins
In reply to: [One Click Demo Import] How To ExportHi @capuderg,
Yes, it’s all OK. Elementor issue is still there but I guess it’s them who need to adjust to Tools > Export and not the other way around?
This is hopefully my last two questions, I already have a “Install Demos” admin page, is there a way I could insert your plugin there? And can I skip the “Recommended Plugins” part? (I already have a custom TGM based automatic plugin installation).
Thanks and great plugin!
Forum: Plugins
In reply to: [One Click Demo Import] How To Export@capuderg You take care as well and thanks again for the help!
Forum: Plugins
In reply to: [One Click Demo Import] How To ExportHi @capuderg,
Shame on me, I didn’t change ‘widgets.json’ to my .wie file (homer sound).
As for the menu, in short – it’s OK now. Long version: I named the menu “Main Menu” in register_nav_menus and named the actual menu in WP Admin “Main Menu (demo)“. And when I set it up in ocdi/after_import, and I used the register_nav_menus name, the result was it literally picked up the second sub-menu and only and the HTML was completely different than standard WP generated menu html (and, weirdly enough, it an actual HTML menu, but all the classes were off, as if it was generated by some other menu walker or something). Using the WP Admin menu name fixed the problem.
Forum: Plugins
In reply to: [One Click Demo Import] How To ExportI fixed the menu issue (didn’t put in the proper name). Now it’s only the widgets that I’d need some help with and I think I can handle Elementor and localhost URLs in the menu on my own.
Forum: Plugins
In reply to: [One Click Demo Import] How To ExportHi @capuderg,
Thank you for sorting this out for me and for adding the paragraph in the documentation, that’s awesome!
I have run a couple of imports and media gets imported properly. But have issues with
- widgets: not imported.
- Menu: doesn’t get assigned to its location and there’s a weird result on live preview – different HTML markup e.g. “menu-item
- has a class “page_item” (but it goes to normal once I manually assign the Main Menu to its location).
- Elementor: I think it’s on their side, but reporting anyway: “Background Overlay” gradient option doesn’t get imported (first color is not set and second one is wrong(red))
No errors are reported, successful import is reported.
If you have any pointers regarding assigning Menu to location after import and Widgets Import I’d appreciate it very much (I know I’m going off-topic).
P.S. The links in the menus (and I guess all other URLs) point to my localhost project. Why does the plugin not change those URLs to correct ones (to match the project of the person who’s installing the demos)?
Forum: Plugins
In reply to: [One Click Demo Import] How To ExportThank you for a quick reply. So, if I’m understanding correctly, I must have all those assets live (either on a live version of my theme or I can copy/paste my “uploads” folder to some location and swap the URLs in the .xml with URLs from that location)?
If this is correct, you should definitely include it guide. I was pulling my hair for hours, especially since tools > export has the option to export ‘media’ which, you guessed it, doesn’t export media.