• Resolved wuboys

    (@wuboys)


    in wp-slimstat.php line 1442:

    $params = array(
    			'ajaxurl' => admin_url('admin-ajax.php', ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || $_SERVER['SERVER_PORT'] == 443)?'https':'http'),
    			'async_tracker' => 'false'
    		);

    you use $_SERVER to determine protocol.
    However, admin_url(‘admin-ajax.php’) is better.

    When you use $_SERVER, if you use reverse proxy like cloudflare flexible SSL.
    User uses https to connect to cloudflare. But cloudflare use http to connect to your server.
    So the admin ajax url will be http instead of https. use plain admin_url(‘admin-ajax.php’) fix the problem. It will just use the protocol that user uses.

    https://www.ads-software.com/plugins/wp-slimstat/

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘use admin_url without second parameter’ is closed to new replies.