Skip to content
Advertisement

PHP – Getting an “[filename] is not commonly downloaded and may be dangerous” alert on an ics file in Google Chrome

I’ve built a plugin in WordPress that allows the creation of autogenerated .ics files. The header are these two lines:-

header('Content-Type: text/calendar; charset=utf-8');
header('Content-Disposition: inline; filename=' . get_the_title() . '.ics');

I’ve uploaded it to a new site, and whenever I download the .ical file I get an error saying “[filename] is not commonly downloaded and may be dangerous” within Google Chrome and to download the file I need to select “Keep”. This only occurs in Google Chrome (Safari / Firefox download the file as intended).

The domain is registered approximately at the time of writing 24 hours old. Here is what I’ve done so far.

  • Installed a different plugin on the same domain, same server that does .ical file export (The Events Calendar), test created an event with ical export. Done the export unsuccessfully (I still get the error).
  • Installed both The Events Calendar & my plugin on a different domain, different sever. Test created an event in both The Events Calendar & my plugin. Done an export in both plugins successfully (I get no errors).
  • Installed both The Events Calendar & my plugin on a different domain, same server. Test created an event in both The Events Calendar & my plugin. Done an export in both plugins successfully (I get no errors).

This leads me to believe that the domain is possibly an issue. It is brand new and may need whitelisting(?) in Chrome. Is there a way to do this?

Thanks!

Advertisement

Answer

Okay. If anybody else gets this issue, it’s because it’s a brand new site. After a while (about a week for me), it corrected itself.

Gabor’s answer below is half way there, if you sign up to Google Search Console and go to Security & Manual Actions > Security, you will see if your site has any security issues.

If you don’t, then eventually the warning will disappear. Again, it was about a week, but you may be different.

I guess possible advice is to register a domain before needing it.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement