ultimatemember / Extended

All custom extended features and codes
16 stars 14 forks source link

Big Profile photos not cropping correctly - um-profile-photo #21

Closed pkanel80 closed 8 months ago

pkanel80 commented 1 year ago

Issue regarding extension "Enable Profile Photo in Register form" - um-profile-photo When users uploading profile photo that is a little bit bigger than normal, then the cropping is not working correctly. For example check the attached screenshots where the upload profile photo has dimensions 2252x4000, but as you can see crop is not working. The only active plugin is ultimate-member

Initial upload & crop selection: https://ibb.co/PFx2HCz After Crop: https://ibb.co/vsjGFPs

MissVeronica commented 1 year ago

This might be a PHP memory size issue. Look at all points in this guide https://docs.ultimatemember.com/article/114-photo-uploads-not-working

pkanel80 commented 1 year ago

Hi MissVeronica, do you know any other (demo) sites that have profile photo in registration to check if it's working? The problem is not the uploading, but the cropping in big RESOLUTION photos.

MissVeronica commented 1 year ago

Now I have made a test uploading a picture with the size 5312 x 2988 ( 4,19 MB ) without issues. Your issue is with a picture size of 2252×4000.

Look in your browser's web console if you have any JavaScript errors as the cropping is made by JavaScript.

If no JavaScript errors enable PHP debug logging: https://docs.ultimatemember.com/article/1751-enable-debug-logging

You will probably get a PHP log file with notices and errors in /wp-content/debug.log when you do a picture upload. Post the content of this file here and we can give you a PHP error explanation.

pkanel80 commented 1 year ago

Thanks for your prompt response. I have enabled the debug logs. I can't see any errors. Only the following which I believe is irrelevant because I see it in every page load.

"VM2729 js:51 POST https://region1.google-analytics.com/g/collect?v=2&tid=G-LC0EVQZLR1&gtm=45je3360&_p=142219104&gdid=dZGIzZG&cid=1179477344.1677872469&ul=en-gb&sr=3440x1440&uaa=x86&uab=64&uafvl=Chromium%3B110.0.5481.180%7CNot%2520A(Brand%3B24.0.0.0%7CGoogle%2520Chrome%3B110.0.5481.180&uamb=0&uam=&uap=Windows&uapv=15.0.0&uaw=0&_s=7&sid=1678541967&sct=7&seg=1&dl=https%3A%2F%2Fwww.themodel.gr%2Fregister%2F&dr=https%3A%2F%2Fwww.themodel.gr%2F&dt=Registration%20-%20The%20Model&en=click&ep.forceSSL=true&ep.link_attribution=true&ep.link_id=&ep.link_classes=um-modal-btn%20um-finish-upload%20image&ep.link_url=javascript%3Avoid(0)%3B&ep.link_domain=&ep.outbound=true&_et=5841 net::ERR_BLOCKED_BY_CLIENT"

Do you want to make a try? the page is the following: https://www.themodel.gr/register/ the image is the following: https://ibb.co/MfNgnBP

maybe the issue is when the picture has very big height? eg. 2252×4000

BR/Panos

MissVeronica commented 1 year ago

I downloaded your picture and made a test at my site without any issues.

Can you post here your UM Settings -> Install Info

pkanel80 commented 1 year ago

sure, find attached --> https://easyupload.io/zny6i0 let me note that I have already tried to disable all other plugins or change theme. still the same issue from any browser (chrome, firefox, opera).

MissVeronica commented 1 year ago

You have a Theme JavaScript error on your Registration page

Uncaught TypeError: $(...).owlCarousel is not a function
    <anonymous> https://www.themodel.gr/wp-content/themes/talenthunt/js/custom.js?ver=81582bdb254a94e4464424087c6479a8:110
    <anonymous> https://www.themodel.gr/wp-content/themes/talenthunt/js/custom.js?ver=81582bdb254a94e4464424087c6479a8:159

Change to a WP default theme like "Twenty Twenty-Two"

For the PHP Debug error can you deactivate the Google Analytics plugin.

I found that you have the UM "User Photos" Extension can you deactivate that plugin.

MissVeronica commented 1 year ago

Increase memory to at least 512MB to follow Elementor guidelines:

https://elementor.com/help/requirements/

WP Memory limit of 256 MB (Elementor and Elementor Pro only), 512 MB recommended, 768 MB for best performance. Note: These requirements are for Elementor. If you are using additional plugins on your site that also have minimum requirements such as WooCommerce, you may need to increase your memory to 512 MB to help avoid loading issues.

pkanel80 commented 1 year ago

Changed to default wordpress theme in dev environment and disabled all plugins except UM and register profile photo (with debug logs). Still the same issue :/
Link: https://uat.themodel.gr/register/

I think I found the issue. With image resolution 4000x2252 everything is working correctly. --> https://ibb.co/HP1MLjx With image resolution 2252x4000 I can reproduce the issue, so I guess it's about the resolution and the height. --> https://ibb.co/MfNgnBP

MissVeronica commented 1 year ago

I made a profile upload with resolution 2252x4000 without any issues so it's your site that have the issue.

pkanel80 commented 1 year ago

I made a profile upload with resolution 2252x4000 without any issues so it's your site that have the issue.

and the crop worked correctly? for example you tried to upload the same picture and crop down-left area and everything worked as expected? Can you please provide me the url to also make a try?

MissVeronica commented 1 year ago

After uploading the cropped picture

https://imgur.com/a/wjDldSu

pkanel80 commented 1 year ago

this is a video of how I reproduce it. I also increased memory to maximum, nothing changed. Now are with all plugins disabled and default wp theme.

https://screenrec.com/share/QYpKovAqwW

MissVeronica commented 1 year ago

Still your issue maybe your browser settings?

The second uploaded screen copy https://imgur.com/a/wjDldSu

MissVeronica commented 1 year ago

I made the same test upload with Chrome and it's working OK also with lower left corner cropped from the picture.

pkanel80 commented 1 year ago

it can't be the browser settings. Tried from all of them, and the issue has been reported from visitors. I also deleted UM plugin with all settings / folder and installed it again from scratch. Issue still here. I am out of ideas what else to try.

pkanel80 commented 1 year ago

the issue remains if I also try another setting in the relevant field like: crop and force user-defined ratio: Only if I disable the crop the photo is ok.

image

MissVeronica commented 1 year ago

An issue with your Greek internet provider? Your Web hosting/CDN connection to your Greek internet. I'm connected from Sweden.

pkanel80 commented 1 year ago

I also tried this with mobile phone which is different provider. haha :)

pkanel80 commented 1 year ago

just a question. you tried on this link and it's working? https://uat.themodel.gr/register/

MissVeronica commented 1 year ago

Yes it's working this 3rd screen copy from Chrome: https://imgur.com/a/wjDldSu

pkanel80 commented 1 year ago

Ok maybe I found something. Everytime I load the image for croping I don't have error but I have the following warning:


jquery.js?ver=3.6.1:5282
[Violation] Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952
  add @ jquery.js?ver=3.6.1:5282
  jQuery.event.add @ jquery-migrate.js?ver=3.3.2:642
  (anonymous) @ jquery.js?ver=3.6.1:5182
  each @ jquery.js?ver=3.6.1:385
  each @ jquery.js?ver=3.6.1:207
  on @ jquery.js?ver=3.6.1:5181
  on @ jquery.js?ver=3.6.1:5906
  addListeners @ um-crop.js?ver=2.5.4:338
  build @ um-crop.js?ver=2.5.4:257
  (anonymous) @ um-crop.js?ver=2.5.4:185
  fn @ jquery.js?ver=3.6.1:5175
  dispatch @ jquery.js?ver=3.6.1:5430
  elemData.handle @ jquery.js?ver=3.6.1:5234


I asked chatgpt what is the meaning. Check the last paragraph:

_This message is a browser console warning called a "violation" that occurred in the jQuery library. Specifically, it is a warning related to the use of an event listener on a touch device that may cause a delay or "blocking" of the scrolling action.

The warning suggests that the event listener should be marked as "passive" to improve the responsiveness of the page. Passive event listeners allow the browser to handle scrolling events more efficiently, without waiting for the listener to finish executing before taking action.

The warning includes a link to a page on Chrome's feature status site that provides more information about the passive event listener feature.

In this case, the warning is being triggered by the "um-crop.js" script, which is using the jQuery library to add event listeners to a touch device. The "addListeners" function in the script is where the event listeners are being added.

To resolve the warning, the event listeners in the "um-crop.js" script should be updated to include the "passive: true" option when adding touch event listeners. This will help to improve the performance and responsiveness of the page on touch devices._

MissVeronica commented 1 year ago

OK There is no passive: true in the um-crop.js. Can you test without touch option enabled? My screen is a non-touch unit.

pkanel80 commented 1 year ago

my screen is also non-touch unit. :/

pkanel80 commented 1 year ago

Let me note that I have also the same issue when I change the profile photo on an existing account, not just the register screen. With image resolution 4000x2252 everything is working correctly. With image resolution 2252x4000 no. with lower resolutions also ok.

pkanel80 commented 1 year ago

I make full tests. an image with resolution 2252x4000 in png is working. in jpg and the same resolution I tried 3-4 photos and all of them are not working. I also tried to upload a cover photo and I had the same results. in png all ok, in jpg for these specific resolution the same issue.

it's not issue in the extension, but general issue of the UM plugin. the strange thing is that is not reproducable in you.

MissVeronica commented 1 year ago

I'm using Windows 10 Your UM Install Info says also Windows 10 Right?

pkanel80 commented 1 year ago

Windows 11. But the same issue occurs also from iPhones or Android phones. It's very strange you can't reproduce it. I can do it from any device.

Ps. Make sure you are uploading the full size image.

champsupertramp commented 8 months ago

Please let us know if you're still encountering issues with the latest version. We'd be happy to help