Support » Plugin: No Right Click Images Plugin » Plugin doesn’t work with https

  • Resolved ahbit

    (@ahbit)


    Plugin doesn’t work with https (assuming a security-conscious browser), as use of WP_PLUGIN_URL results in http reference for the JS file.

    Please update plugin so it can be used with https, and follows best practice for setting plugin path, using plugins_url(), if not also enqueuing the JS, e.g.,

    — wp-content/plugins/no-right-click-images-plugin/no-right-click-images-plugin.php
    +++ wp-content/plugins/no-right-click-images-plugin/no-right-click-images-plugin.php
    @@ -38,9 +38,8 @@ function kpg_no_rc_img_fixup() {
    if ($cell!=’Y’) $cell=’N’;
    // if the user is logged in and the option is set, let them copy images
    if ($allowforlogged==’Y’ && is_user_logged_in() ) { return; }
    – $dir = WP_PLUGIN_URL.’/’.str_replace(basename( __FILE__),””,plugin_basename(__FILE__));
    – $img = addslashes($dir.’not.gif’);
    – $js = addslashes($dir.’no-right-click-images.js’);
    + $img = plugins_url( ‘not.gif’, __FILE__ );
    + $js = plugins_url( ‘no-right-click-images.js’, __FILE__ );
    $altimg=trim($altimg);
    if (!empty($altimg)) $img=$altimg;

    @@ -105,8 +104,7 @@ function kpg_no_rc_img_control() {

    }
    $nonce=wp_create_nonce(‘kpg_no_rc’);
    – $dir = WP_PLUGIN_URL.’/’.str_replace(basename( __FILE__),””,plugin_basename(__FILE__));
    – $img = addslashes($dir.’not.gif’);
    + $img = plugins_url( ‘not.gif’, __FILE__ );
    $altimg=trim($altimg);
    if (!empty($altimg)) $img=$altimg;

  • The topic ‘Plugin doesn’t work with https’ is closed to new replies.