• Resolved jotnarta

    (@jotnarta)


    Hi

    Sorry for the link, but I am working locally. The problem is that when I create a question, I add a featured image for the question, and some image based answers.

    The main question image, appears fine, but not all image based answers appears. I tried to check the difference between the working image and the image that do not appear.

    tried to convert the images from jpg GIF, png, etc. The problem is not with the image type, because some images appear.

    sorry I can’t provide a link, I didn’t upload my website yet.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter jotnarta

    (@jotnarta)

    Everything is perfect in HD Quiz, the timer, the social sharing, everything. The problem is with the images that do not appear .. ??

    Plugin Author Harmonic Design

    (@harmonic_design)

    Hi jotnarta,
    just to be clear, when you are editing a question and select an image – that images appears, but it does not appear when you actually show the quiz itself?

    Also, some are appearing, but some are not? For the ones that are not showing, is it that NONE of the images appear for that question, or that some of the images appear for that question and others don’t?

    I can only think of the following.

    1) Make sure that the errant question actually have a “correct” answer selected

    2) Are you using any kind of image “lazy loading” on your site? HD Quiz should be fully compatible with this, but maybe your site’s implementation of it is causing issues?

    3) Page caching. IF you are using any kind of page caching solution, please try clearing the cache to make sure the issue isn’t a corrupted cache.

    4) once you’ve done/checked the above, try temporarily enabling wp_debug. This can be done by editing wp-config.php located in your main WordPress installation folder. In this file you will see define('WP_DEBUG', false); – change this to define('WP_DEBUG', true);. Now go to the quiz again and see if any errors appear. Report back!

    Thread Starter jotnarta

    (@jotnarta)

    Thank you. Here are the answers:

    1)just to be clear, when you are editing a question and select an image – that images appears, but it does not appear when you actually show the quiz itself?

    Some Images appear while editing a question, some do not. The images that appear will appear on preview.

    2)Also, some are appearing, but some are not? For the ones that are not showing, is it that NONE of the images appear for that question, or that some of the images appear for that question and others don’t?

    The images that do not appear while editing the questions, will not appear on preview or live website.

    3) Page caching. IF you are using any kind of page caching solution, please try clearing the cache to make sure the issue isn’t a corrupted cache.

    I clear the cache everytime I run the application. I use WP Fastest Cache plugin.

    4) once you’ve done/checked the above, try temporarily enabling wp_debug. This can be done by editing wp-config.php located in your main WordPress installation folder. In this file you will see define(‘WP_DEBUG’, false); – change this to define(‘WP_DEBUG’, true);. Now go to the quiz again and see if any errors appear. Report back!

    I have enabled debugging, but I got no messages.

    Thank you for your time.

    • This reply was modified 4 years, 11 months ago by jotnarta.
    Plugin Author Harmonic Design

    (@harmonic_design)

    Thanks for going through all of the steps!

    It looks like the issue is what I initially thought it was. For whatever reason, WordPress is unable to make thumbnails out of those images. Unfortunately, this is not something that can be “fixed” on my end as it is either an issue with the images you are uploading, and issue with your site or host, or maybe even a big with WordPress itself!

    Some basic checks

    1. You are super duper sure that the image is a jpg, png or similar? Like you’re not just renaming the extension, but actualyl saving the image in the correct format?
    2. File size: How large (both resolution and file size) are the images that are not working? It’s possible that your host or WordPress installation can’t process them
    3. PHP Memory: related to above, if the issue is super large files, it might be that your site does not have enough PHP memory (think of it like ram dedicated to PHP) to process the images and create the different sizes.
    4. Host: The issue might lie with your hosts. Most shared hosting services used a tmp folder to store temporary files – files such as the ones that WordPress uses to create and generate thumbnails. On some cheaper hosts, sometimes this folder gets full, meaning that WordPress cannot create new files with it.

    Another thing we can do to confirm is to use the browser console and see what error is returned when you try and set one of these images. For most browsers, the console can be opened by pressing F12.

    With the console open, create or edit a question and try to set an image that does not work. When you do, an error message will appear in the console.

    Thread Starter jotnarta

    (@jotnarta)

    Thank you

    The problem is not with size. because some images of 700 K, and 10 K are uploaded successfully.

    Following is the console message

    Uncaught TypeError: Cannot read property ‘url’ of undefined
    at h.Collection.<anonymous> (hdq_admin.js?v=1.7.0&ver=1.0:97)
    at p (backbone.min.js?ver=1.4.0:2)
    at f (backbone.min.js?ver=1.4.0:2)
    at l (backbone.min.js?ver=1.4.0:2)
    at h.Collection.n.trigger (backbone.min.js?ver=1.4.0:2)
    at h.Collection._onModelEvent (backbone.min.js?ver=1.4.0:2)
    at p (backbone.min.js?ver=1.4.0:2)
    at f (backbone.min.js?ver=1.4.0:2)
    at l (backbone.min.js?ver=1.4.0:2)
    at i.n.trigger (backbone.min.js?ver=1.4.0:2)
    (anonymous) @ hdq_admin.js?v=1.7.0&ver=1.0:97
    p @ backbone.min.js?ver=1.4.0:2
    f @ backbone.min.js?ver=1.4.0:2
    l @ backbone.min.js?ver=1.4.0:2
    n.trigger @ backbone.min.js?ver=1.4.0:2
    _onModelEvent @ backbone.min.js?ver=1.4.0:2
    p @ backbone.min.js?ver=1.4.0:2
    f @ backbone.min.js?ver=1.4.0:2
    l @ backbone.min.js?ver=1.4.0:2
    n.trigger @ backbone.min.js?ver=1.4.0:2
    clickSelect @ media-views.min.js?ver=5.4:2
    click @ media-views.min.js?ver=5.4:2
    dispatch @ load-scripts.php?c=1&load[chunk_0]=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=5.4:3
    r.handle @ load-scripts.php?c=1&load[chunk_0]=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=5.4:3

    The problem is, that all images are uploaded from media library. and they are all linked to localhost media library. Both the displayed image and the images that do not showning

    Plugin Author Harmonic Design

    (@harmonic_design)

    Thanks for the log.

    Unfortunately, that error proves that the issue is unrelated to HD Quiz and is that the issue is that WordPress is unable to create a thumbnail for some reason.

    The message Cannot read property 'url'... is an error meaning that WordPress was unable to get the image URL to display the image thumbnail.

    Please note that the issue could also be that your images are too small. The size will depend on what your theme has it set to, but by default, WordPress thumbnails are 150×150. It’s possible that if your image is smaller than this, then there will be no “thumbnail” since WordPress cannot generate a thumb smaller than that.

    1. Can you see a thumbnail of the uploaded image in your media gallery?
    2. If you were to add the image to just a regular post or quiz, are you able to change the image size? IE: Select thumbnail, medium, large, full?

    These issues could also be caused because you are developing locally. Make sure you are using the latest PHP version with the correct extensions to deal the image generation (gd, imagick).

    Thread Starter jotnarta

    (@jotnarta)

    Thank you.

    The problem is that all images uploaded fine with other quiz maker plugins; like QSM, watu, etc.

    Anyways, I will update my wampserver, and see what would happen.

    Thank you

    Plugin Author Harmonic Design

    (@harmonic_design)

    Those other plugins don’t use thumbnails ??

    HD quiz uses optimized images such as thumbnails and srcset so that images are optimized for screen size. This is one of the things that makes HD Quiz load faster, and be lighter weight than the other plugins – especially on phones.

    Another thing you can do is upload one of the errant images to imgur.com or something, so I can take a look. I can make sure the file size and dimensions are appropriate and test uploading on my own servers.

    Plugin Author Harmonic Design

    (@harmonic_design)

    Hi jotnarta,
    I just pushed a minor update to HD Quiz that will do two things that may help you.

    First, I am now showing more intuitive error messages if HD Quiz detects that an image is not a workable image. So now if you try to upload an image that is not a proper image format, HD Quiz will gracefully notify you of the issue. The same goes for if your image is too large or small to use and thus WordPress cannot create thumbs.

    The second, is that in rare cases like yours, if your site cannot generate a thumbnail for whatever reason, then HD Quiz will fallback to using the full image size. This should hopefully fix this issue for you and any others who may experience it.

    I recently had a support request from another user who had almost the exact same issues as you, except none of the images worked. It was like the site refused to create thumbnails. After poking around, I found that the issue was that their theme set thumbnails to be 0x0 – essentially disabling thumbnails altogether on their site! So this update should help users in those special cases as well ??

    Just note that this update was not posted as a version increase. This means that you will NOT be prompted to upgrade HD Quiz. Instead, simply deactivate and delete HD Quiz, then reinstall from the repository as normal. You will not lose any settings or questions or anything by doing this.

    Please try out this update and let me know if it helps your case in any way

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Answer Images do not show up’ is closed to new replies.