WordPress.org

Ready to get started?Download WordPress

Forums

MaxGalleria: WordPress Gallery Platform
[resolved] Unable to add images, possible code fix (3 posts)

  1. kokimo1
    Member
    Posted 2 months ago #

    Hello,

    We've been experiencing an issue on our staging and production multisites where we are unable to add images to Maxgalleria galleries. The "add images" button is unresponsive and new galleries don't show the option to choose between images or video.

    One of our devs was able to fix it by editing a line in maxgalleria.php. She has to change this line whenever we update the Maxgalleria core, so I thought I'd pass it along for your consideration.

    Below is her message:

    The MaxGalleria problems appear to be caused by the fact they are loading http resources over https. Their references to scripts and css are not set to https, or even better, protocol agnostic.

    If you're using Chrome or Firefox, open the development tool window and check the console. Safari seems to be more forgiving because I was able to add an image in both galleries. Chrome will load images http images over https but put out a warning in the console.

    I did a bit of digging, and it turns out MaxGalleria is using an outdated way to refer to the plugins directory:

    What they do:
    #define('MAXGALLERIA_PLUGIN_URL', WP_PLUGIN_URL . '/' . MAXGALLERIA_PLUGIN_NAME);

    How it should be:
    define('MAXGALLERIA_PLUGIN_URL', plugin_dir_url() . '/' . MAXGALLERIA_PLUGIN_NAME);

    per:
    http://wordpress.org/ideas/topic/wp_plugin_url-doesnt-take-ssl-into-account
    http://codex.wordpress.org/Determining_Plugin_and_Content_Directories

    So I fixed it on staging and production, but every time the plugin is updated this will be rolled back. Best way would be to suggest this fix so it's fixed upstream. Since I found it for you, I would appreciate it if you forward it onto the plugin maintainers :)

    Alina

    ----

    Please let me know if you have any questions.

    thanks

    Kurt

  2. kokimo1
    Member
    Posted 2 months ago #

    Just a heads up: that was for an older version of MaxGalleria. For the current version (2.2.2), this line here

    define('MAXGALLERIA_PLUGIN_URL', WP_PLUGIN_URL . '/' . MAXGALLERIA_PLUGIN_NAME);

    has to be changed to this

    define('MAXGALLERIA_PLUGIN_URL', plugin_dir_url() . '/' . MAXGALLERIA_PLUGIN_NAME);

  3. arcware
    Member
    Plugin Author

    Posted 2 months ago #

    Ah yes, that's definitely a change we'll make. Look for this in the next update, and thanks for bringing this to our attention.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.