wp-media / imagify-plugin

Speed up your website with lighter images without losing quality.
https://imagify.io
72 stars 26 forks source link

Improved Popup Message For Blocked Self-requests Due to Firewall, HTTP Auth, Etc #636

Open joejoe04 opened 2 years ago

joejoe04 commented 2 years ago

When the self-requests for optimization are being blocked by a user's server due to firewall setting, HTTP authentication, security plugin, or something similar, Imagify Tools shows something like this (though the error codes can also be 401 or 403):

image image image

We could offer a popup informing users this is the cause and linking to possible solutions:

image

The code below links to the same Optimization is Stuck page as we do for cURL Error 28 / timeout issues, and we could add a section to it specifically for these cases with suggestions like:

• Whitelist 51.68.166.142 with the server or possibly security plugins

• Use the following in wp-config.php if site is behind HTTP authentication:

define( 'IMAGIFY_AUTH_USER', 'your_auth_username_here' );
define( 'IMAGIFY_AUTH_PASSWORD', 'your_auth_password_here' );

• Disable security plugin

Or we could create a new page with these suggestions, whatever the team thinks is the best option.

<div id="swal2-content" class="swal2-content" style="display: block;">A firewall, server setting, HTTP Authentication, or security plugin is preventing image optimization. <a href="https://imagify.io/documentation/optimization-is-stuck/" rel="noopener" target="_blank">More info and possible solutions</a>.</div>

GeekPress commented 2 years ago

@joejoe04 Don't we have a problem too when validating the API key when self-requests are blocked?

joejoe04 commented 2 years ago

@GeekPress Yes, you're right, it also applies to API key validation when self-requests are blocked. So maybe there could be different error popups, depending on the situation. Maybe something like:

A firewall, server setting, HTTP Authentication, or a security plugin is preventing image optimization.

A firewall, server setting, HTTP Authentication, or a security plugin is preventing validation of your Imagify API key.