WordPress.org

Ready to get started?Download WordPress

Forums

PiwigoPress
PiwigoPress does not honor URL scheme (1 post)

  1. Norbert
    Member
    Posted 12 months ago #

    Hi,

    if I run wordpress over https when in admin mode, firefox always gave me a warning that not all content is protected.

    I tracked it down to PiwigoPress which uses
    WP_PLUGIN_URL
    instead of
    plugins_url(...)
    in calls to wp_register_script and some css inclusion.

    By searching and fixing these calls to use plugins_url(..) I was able to get PiwigoPress to always use https:// when the original page is also shared via https.

    I attach a patch that fixes this issue.

    Thanks for consideration

    Norbert

    --- piwigopress.php.orig        2013-08-26 13:15:32.635352626 +0900
    +++ piwigopress.php     2013-08-26 13:22:02.343223948 +0900
    @@ -150,7 +150,7 @@
            define('PWGP_CSS_FILE','');
            if ( is_admin() ) {
                    echo '<link media="all" type="text/css" href="' .
    -                       WP_PLUGIN_URL . '/piwigopress/css/piwigopress_adm.min.css?ver=' . PWGP_VERSION . '" id="piwigopress_a-css" rel="stylesheet">'; // that's fine
    +                       plugins_url( 'piwigopress/css/piwigopress_adm.min.css?ver=') . PWGP_VERSION . '" id="piwigopress_a-css" rel="stylesheet">'; // that's fine
            }
            else {
                    echo '<link media="all" type="text/css" href="' .
    @@ -162,10 +162,10 @@
     // Script to be used
     function PiwigoPress_load_in_footer() {
            /* Scripts */
    -       wp_register_script( 'piwigopress_s', WP_PLUGIN_URL . '/piwigopress/js/piwigopress.js', array('jquery'), PWGP_VERSION );
    +       wp_register_script( 'piwigopress_s', plugins_url( 'piwigopress/js/piwigopress.js'), array('jquery'), PWGP_VERSION );
            wp_enqueue_script( 'jquery'); // include it even if it's done
            if ( is_admin() ) {
    -               wp_register_script( 'piwigopress_a', WP_PLUGIN_URL . '/piwigopress/js/piwigopress_adm.min.js', array('jquery'), PWGP_VERSION );
    +               wp_register_script( 'piwigopress_a', plugins_url( 'piwigopress/js/piwigopress_adm.min.js'), array('jquery'), PWGP_VERSION );
                    wp_enqueue_script( 'jquery-ui-draggable' );
                    wp_enqueue_script( 'jquery-ui-droppable' );
                    wp_enqueue_script( 'piwigopress_a' );
    @@ -200,4 +200,4 @@
     }  
    
     add_filter( 'plugin_row_meta', PWGP_NAME . '_plugin_links', 10, 2 );
    -?>
    \ No newline at end of file
    +?>
    --- PiwigoPress_options.php.orig        2013-08-26 13:15:46.660059868 +0900
    +++ PiwigoPress_options.php     2013-08-26 13:18:04.490974258 +0900
    @@ -2,7 +2,7 @@
     if (defined('PHPWG_ROOT_PATH')) return; /* Avoid direct usage under Piwigo */
     if (!defined('PWGP_NAME')) return; /* Avoid unpredicted access */
    
    -       wp_register_script( 'piwigopress_ws', WP_PLUGIN_URL . '/piwigopress/js/piwigopress_widgets.js', array('jquery'), PWGP_VERSION );
    +       wp_register_script( 'piwigopress_ws', plugins_url( 'piwigopress/js/piwigopress_widgets.js'), array('jquery'), PWGP_VERSION );
            wp_enqueue_script( 'piwigopress_ws' );
            // Defaults
            $gallery = wp_parse_args( (array) $gallery, array('title'=>__('Random picture'),
    @@ -192,4 +192,4 @@
            . '" type="text" value="' . $class . '" /></label></td>
            </tr></table>
            </div>';
    -?>
    \ No newline at end of file
    +?>

    http://wordpress.org/plugins/piwigopress/

Reply

You must log in to post.

About this Plugin

About this Topic

Tags