Support » Plugin: Real Thumbnail Generator: Efficient regeneration of thumbnails in all sizes » Blocking http requests… in the REST API

  • Resolved webfantastic

    (@webfantastic)


    Hi!
    The plugin does not work. I am trying to analyze the images, but the process does not start, and there are errors in the browser console. Please tell me how to fix it?

    Mixed content: load all resources via HTTPS to improve the security of your site
    Even though the initial HTML page is loaded over a secure HTTPS connection, some resources like images, stylesheets or scripts are being accessed over an insecure HTTP connection. Usage of insecure resources is restricted to strengthen the security of your entire site.
    To resolve this issue, load all resources over a secure HTTPS connection.
    2 resources
    Name Restriction Status
    ?_v=2.5.23&_locale=user blocked
    ?_v=2.5.23&_locale=user&page=1&posts_per_page=40 blocked

    Requests come from http, but wordpress does not want to process, it only asks for https.

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Contributor Matthias Günter

    (@mguenter)

    Hi there!

    It looks like you are using two different protocols for your home URL and site URL configured in Settings > General. Can you please check this?

    Regards
    Matthew 😊

    Thread Starter webfantastic

    (@webfantastic)

    Hi!
    I checked and all urls start with https. I do not know what the problem may be.

    Thread Starter webfantastic

    (@webfantastic)

    We had a plugin installed that hides WordPress, but we did not disable the REST API
    https://wordpress.org/plugins/wp-hide-security-enhancer/

    I checked the htaccess file, but everything is standard there:

    RewriteCond %{REQUEST_URI} /+[^\.]+$
    RewriteCond %{REQUEST_METHOD} !POST
    RewriteRule ^(.+[^/])$ %{REQUEST_URI}/ [R=301,END]

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    Only single thumbnail regeneration works when you can select only one image and regenerate it, but analysis does not work

    Plugin Contributor Matthias Günter

    (@mguenter)

    Hi again!

    Can you please open your developer console and type the following: realThumbnailGenerator.restRoot and send the result as screenshot?

    Thread Starter webfantastic

    (@webfantastic)

    When I enter this command it shows the address to the rest API
    https://namesite.com/wp-json/

    Thread Starter webfantastic

    (@webfantastic)

    upload.php:2864 Uncaught TypeError: Cannot set properties of null (setting ‘onclick’)
    at upload.php:2864
    (anonymous) @ upload.php:2864
    upload.php:2867 Uncaught TypeError: Cannot set properties of null (setting ‘onclick’)
    at upload.php:2867
    (anonymous) @ upload.php:2867
    upload.php:1 Mixed Content: The page at ‘https://site.com/wp-admin/upload.php?&#8217; was loaded over HTTPS, but requested an insecure resource ‘http://site.com/wp-json/real-thumbnail-generator/v1/stats/?_v=2.5.23&_locale=user&#8217;. This request has been blocked; the content must be served over HTTPS.

    Plugin Contributor Matthias Günter

    (@mguenter)

    Can you please share a screenshot of this error message?

    Thread Starter webfantastic

    (@webfantastic)

    Everything worked. I had to change the htaccess file to the default file, prescribing redirection to https there and it began to work. Apparently you have http links in the plugin that access the api

    Plugin Contributor Matthias Günter

    (@mguenter)

    Hi again!

    Apparently you have http links in the plugin that access the api

    We are using the WordPress core functionality https://developer.wordpress.org/reference/functions/get_rest_url/ to get the REST API URL, so I think this is more a configuration issue. But nice to hear that you have found the root cause, this could also be interesting for other uesrs as well! 🚀

    Thread Starter webfantastic

    (@webfantastic)

    Is it possible that the url with http is written somewhere in the database? Can you tell me how to check it? Thanks

    Plugin Contributor Matthias Günter

    (@mguenter)

    The REST API URL is generated from the home and site URL configured in Settings > General. But it could also be modified through a developer filter. Perhaps another plugin modifies it?

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Blocking http requests… in the REST API’ is closed to new replies.