I have a client who is using WP Bakery page builder (I know…). Your plugin conflicts with that and won’t allow a post to be published, even when I have NOT set the default Posts post-type to use the plugin’s size parameters (I’m only using it on another CPT). Is this plugin still supported? And if so, what is the fix for this? Thank you.
]]>Hello. Love the plugin, we use it on most of our builds.
I noticed that when restricting the products custom post type image to exact dimensions that a user can still add product gallery images of any dimensions.
Thought maybe you could address this in a future release.
Cheers!
]]>Hi,
thanks for the plugin.
One suggestion: In addition to the option to set different setting for different post types, it would be great to enable setting different options for different post templates.
This would enable the use of “use exact dimensions” even for users who need different thumbnail aspect ratios for different templates of the same post type.
Thanks!
Bests
When configuring the plugin, you can enter a custom error message. If you enter a message with a newline or a special character like double quotes (“), then that causes the JSON that is returned from the API to break, and to look like this for instance:
{"image_check":"fail", "error_message":"Foo
bar"}
This example is invalid JSON, as newlines need to be encoded using backslash n.
I suggest these changes:
1. In the file mfis.php
, change this line in particular:
$returned_data = '{"image_check":"fail", "error_message":"' . $mfis_ajax_error_message . '"}';
Instead, it should look like this:
$returned_data = json_encode([
"image_check" => "fail",
"error_message" => $mfis_ajax_error_message,
]);
2. In mfis-admin-scripts.js
, you can see this line:
var mfis_publishing_disabled_message = '<div class="mfis_publishing_disabled"><span class="mfis_icon">!</span><span class="mfis_error_message"> + json.error_message + '</span></div>';
I would change this line to look like:
function escapeHtml(unsafe) {
return unsafe
.replace(/&/g, "&" + "amp;")
.replace(/</g, "&" + "lt;")
.replace(/>/g, "&" + "gt;")
.replace(/"/g, "&" + "quot;")
.replace(/'/g, "&" + "#039;");
}
var mfis_publishing_disabled_message = $('<div class="mfis_publishing_disabled"><span class="mfis_icon">!</span><span class="mfis_error_message"> + escapeHtml(json.error_message) + '</span></div>';
Fortunately, only admins can modify the plugin settings. If this string originated from users, then this lack of proper escaping would be a potential security vulnerability.
]]>Hi,
I’m seeing the following error in my debug log:
PHP Notice: Trying to get property ‘post_type’ of non-object in /wp-content/plugins/minimum-featured-image-size/mfis.php on line 547
Any idea what might be causing it, and is it something I should be concerned about?
I’m using the last version of plugin
Thanks
]]>Hi!
I am seeing this error as well. Have noted it for the last week or so. It causes Gutenberg to hit admin-ajax.php an average of 25 attempts per edit page load.
Uncaught SyntaxError: Unexpected token < in JSON at position 0
at JSON.parse (<anonymous>)
at Object.success (mfis-admin-block-editor-scripts.js?ver=5.3.2:57)
at i (jquery.js:2)
at Object.fireWith [as resolveWith] (jquery.js:2)
at x (jquery.js:4)
at XMLHttpRequest.c (jquery.js:4)
I am not sure if this is worth mentioning but when I noticed the error initially, it was hitting admin-ajax.php upwards of 200+ attempts per edit page load. My first response was to disable and then re-enable the plugin. In this case, the caching might have been helping repeat the editor load. Unsure.
]]>Hey,
since the last update the PlugIn is now active for pages and there is no way to deactivate this. We hide the featured images at pages as they are not used so it was not possible to save any changes on any page any more without deactivating the plugin.
Please exclude pages or make them optional as any other CPT.
Thanks, Julian
]]>Hi,
I’ve set a localized error message in the settings of this plugin.
Yet it seems to be ignored when editing a post or page, it displays the default (English) error message. (despite ‘disable AJAX’ setting)
screenshots: https://imgur.com/a/VAmAJgj
]]>Awsome plugin, thanks a lot.
it would be great if you could add an option for users with admin capabilities to only be presented with a warning, but without really preventing them from saving the post.
possible?
Thanks
]]>Thanks for the plugin! I bought you a beer!
It works great, however since I’m hiding certain sidebar items it looks really cluttered with two error messages showing right next to each other. It would be great if we had the option to display the message either below the publish panel, below the thumbnail, or both.
(Also, one more thing that would be cool would be to have the option of displaying a simple custom instruction message in the featured image panel, e.g. “Minimum image dimensions 2000 x 1200 pixels.”, so that people know there’s a requirement beforehand.)
Thanks again!
]]>At any admin-page, the console complains about the following:
mfis-admin-scripts.min.js?ver=4.9.9:1
Uncaught TypeError: $ is not a function
at mfis_check_image (mfis-admin-scripts.min.js?ver=4.9.9:1)
at HTMLDocument.<anonymous> (mfis-admin-scripts.min.js?ver=4.9.9:1)
at i (load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils&ver=4.9.9:2)
at Object.fireWith [as resolveWith] (load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils&ver=4.9.9:2)
at Function.ready (load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils&ver=4.9.9:2)
at HTMLDocument.K (load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils&ver=4.9.9:2)
Disabling the plugin resolves all issues.
]]>Thanks for all your work on this plugin!
For less-experienced users, I think it would be helpful to show an additional “image too small” notification directly below the Publish button. My clients aren’t noticing the notification below the featured image meta box. They just see that the Publish button is disabled and they don’t know why. What do you think?
Thanks again!
]]>Great plugin, however it would be great if there was a way to restrict images to an exact size so that users couldnt still screw things up by uploading images with a bad aspect ratio. I try to make things as idiot proof as possible. Cheers!
]]>Wonderful plugin; thank you very much for this.
It would be great to choose whether uploading an image that doesn’t meet minimum requirements should:
– refuse publishing (current behaviour); or
– display a warning, but still go through with publishing
In general I like this plugin but it still lacks some important validation option. It’s very important to validate aspect ratio of original image too. Please add aspect ratio option too!!
]]>When clicking “override with <original language> content” on a WPML translation, the plugin throws an error :
Fatal error: Call to undefined function get_current_screen() in <my site’s URL>/wp-content/plugins/minimum-featured-image-size/mfis.php on line 353
I’m using the latest version of WP and both plugins.
]]>I’d need it for product images…
]]>We recently had a problem where, when you would try to add a topic or reply in the bbPress forum we would get a 500 error. After trouble shooting with the host, they found out that this plug-in was causing the issue. As soon as we disabled it, the problem stopped.
Just thought I should point this out in case other have the same problem.
]]>Hi! Thanks for your work on this great plugin. It would be awesome if you could allow different image requirements for different post types. Thanks again!
Joel
]]>Hi,
the plugin publishes the post and than sets it back to draft. This is problematic because some mechanism run in this moment like push services or auto publishing. Is there a way to not publish at all?
Best, Daniel
]]>Hello,
really a great idea and what I was looking for. Thanks a lot!
Is there a way translate /rewrite the message?
Best, Daniel
]]>Nice job on the design. This works great. I’m using a customized version of your code on heavy.com now and I wanted to let you know some of the changes I made.
1. I turned this into a class (actually I merged it with an existing class) so that there are no conflicts in function call names.
2. I escaped all of the variables added into the messages with esc_attr() before saving it to the database and then upon display I wrapped the whole message in esc_html(). Without this, your plugin should not be considered safe.
3. I changed your get_option(), update_option() and delete_option() to get_transient(), set_transient() and delete_transient() so that it would use the caching system that is available on well optimized sites rather than forcing a DB write of the value.
Hope that helps!
]]>Love the plugin. Should help especially beginners realize they need to upload larger images.
However, I’m afraid the “image too small” notification is not bold enough for the beginner that this feature will likely help the most. Maybe a full red background on the alert message? Or outline the featured image box with a red border? Otherwise I think beginners will not realize their post isn’t published.
Just a thought. Thanks for your work here!
]]>