Pro Templates Not Importing

Hi,

I am having a problem with importing .tco templates. All websites are on Pro 6.02. When I create a Section template on website A and download it, I then open the Template Library on website B and start the import process of the downloaded .tco file. The error message "Uh oh! This file you chose was not valid and could not be imported " appears.

I am having exactly the same issue on multiple websites.

Thanks,
Christopher

Hi Christopher,

Thanks for reaching out.
I have checked in my local environment and it worked perfectly fine. Can you please share the .tco file along with the credentials of both sites for further investigation?

Thanks

Sorry for the delay, login credentials are in a secure note.

Hi Christopher,

I have checked website A and downloaded the .tco file and surprisingly it can’t be imported into website A itself and shows the issue. It seems that there is some problem with the website, I would like to suggest troubleshooting the following common issue to help us to recognize the reason.

  1. Theme Related Issue
  2. Plugin Conflict
  3. Theme Update related issue
  4. Child Theme Related issue
  5. CSS/JS Customization
  6. Disabling Cache
  7. Disabling CDN

If you discover that an issue is coming from a custom code or 3rd party plugin, kindly consult with a developer or contact the plugin author. Please note that we do not provide support for custom codes and 3rd party plugins.
If none of the above help, please copy your live site to a staging server so we could troubleshoot freely without breaking your live site.
And give us access to the secure note including:

– WordPress Site URL & Login URL
– WordPress Admin username/password

To create a secure note, click the key icon underneath any of your posts.

Thanks

Hi,

Disabling the plugins, cache and everything in the list did not help. I have created a staging version of the website for you.

Many thanks,
Christopher

Hey Christopher,

Your .tco exports are completely empty for some reason. Could you turn on WP_DEBUG for that staging site and see if we can get lucky? We might need SSH / FTP for this one. .tco files are just zip files so you should be able to open them with an archive manager. I already tried disabling all plugin. There aren’t any custom PHP / Apache setups on these right? On every site do you have a completely empty .tco file when you try to download? Importing is totally fine on that site.

Hi @charlie,

I have also created a staging version of website A (details in secure note).

WP DEBUG is enabled on both staging sites. It did not appear to create a log file upon exporting the .tco.

To my knowledge there is no customisation on PHP / Apache.

On two other websites where I have the issue, if I attempt to change.tco to .zip it is not possible to open the .zip as I get the error message The Compressed (zipped) Folder 'C:\Users\name\Downloads\reviews.zip' is invalid. If however, I change the suffix to .txt I get one of two messages in the file :

  • {"success":false,"data":{"message":"nonce verification failed: "}}
  • <p>There has been a critical error on this website.</p><p><a href="https://wordpress.org/support/article/faq-troubleshooting/">Learn more about troubleshooting WordPress.</a></p>

Prior to creating the new staging website, there was an older one with Pro 5.1.5 in place. The .tco exported correctly with content from that site, but not when it was upgraded to Pro 6.0.0.

I don’t know if this helps you any further?

Thanks,
Christopher

Okay great, yeah that helps us greatly thanks!

The first one seems like a redirect issue, we had this come up for site imports so it might be fixed by association. I would ensure you are passing the request when you redirect if this comes up outside of Pro. That’s usually what the nonce failure means. I’ll make sure this is what I think it is.

The second one we will have to see the PHP message with WP_DEBUG on, but that’s definitely a separate issue.

We’ll take a look before the weekend have a great day!

Thanks @charlie,

The critical error message noted in my last post provides the following fatal error in WP DEBUG:

[11-Jan-2023 15:13:15 UTC] PHP Fatal error: Uncaught TypeError: file_get_contents(): Argument #1 ($filename) must be of type string, WP_Error given in /home/*********/public_html/*********.co.uk/wp-admin/includes/class-wp-filesystem-direct.php:39

To produce this error I had Cornerstone’s Template Library open with a template ready to be downloaded. At this point the debug.log file was deleted from the server. next I clicked the template Download button to start the export and opened debug.log which had the above error message in it. More information in a Secure Note.

Thanks,
Christopher

1 Like

Hi @charlie,

I think I may have found something which may help you track down the error.

The two staging websites, which output blank .tco files were both on the same cPanel which was running PHP 7.4.

Before re-creating one of the staging websites to clone its parent, the previous clone was at Pro 5.1.5. I can confirm that the .tco export from Pro 5.1.5 with PHP 7.4 was successful.

The other websites which were throwing the fatal error for the .tco export are on a different cPanel running PHP 8.1 (for around a year now). I have done the same download tests on several other cPanels where the websites are running on Pro 6.0.* and the results are consistent, irrespective if it is Pro 6.00, 6.01, 6.02, or 6.03.

I have just changed the staging websites’ cPanel to PHP 8.1 and can confirm that the fatal error is now happening on them too.

Hopefully this will help save a bit of legwork!
Christopher

1 Like

Thanks a bunch this will narrow it down immensely. I’ve made a note and will import your site if need be. I’ll keep you updated. Let me know if you find anything else.

You know I think you need to install the Zip PHP extension on these servers. Should just be something like the below and probably need to restart Apache.

I am going to add a more clearer error when this happens, so thanks for bringing this up. Let me know if you have any other issues here.

sudo apt install php-zip

@charlie,

You hit the nail on the head, my friend!

In cPanel, “Zip” is one on the settings which is not enabled by default. It did the trick though!

Many thanks once again!
Christopher

1 Like

Great to hear and happy to help!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.