• I no longer have the ability to upload images. I have tried on safari and chrome and cleared cache/cookies. I have never had an issue in the past. When I click on add files, nothing happens. When I hit upload files this does flash so quick I had to press it 8 times to get the full message. Your browser does not have flash or html5 support. Check also if page have no JavaScript errors.

    Avada 7.3
    Wordpress 5.7
    PHP 7.4

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • The same for me!
    I tried all options that are available to upload images:
    – import from WP media Library
    – import from Server folder
    – upload from local directory
    None, of this methods works

    Error message for method I and II:
    Import from WP Media Library:
    Fatal error: Array and string offset access syntax with curly braces is no longer supported in /var/www/web123/html/wordpress2/smrtzl/plugins/grand-media/inc/pel/PelDataWindow.php on line 542

    Error message for method III:
    Fails with HTTP-Error 500: “Upload URL might be wrong or does not exist.”

    My opinion: Do NOT buy this plugin!

    Server-Info:
    WP: 5.7.2
    PHP: 8.0
    Gmedia-Plugin: last available
    Server: apache

    As I do not expected the author of this plugin to react:
    The reason is the outdated PHP-Library ‘PEL’ that is used by the Gmedia-Plugin. Gmedia uses PEL but did obviously never update the code of this PHP-library. An update of PEL is available on Github, even for PHP 8. The way is now to change the PHP-files of gmedia.
    Mind that all changes will be lost, if we get an update of gmedia once.

    Solution for people with coding experience:
    1. Do a backup of the gmedia-plugin folder, and even better your whole wordpress site.
    2. Download current pel from github: https://github.com/pel/pel to your machine.
    3. Extract the ./pel/src – Folder of pel to ../wp-content/plugins/grand-media/inc/pel
    4. Change the one and only function in autoload.php in the folder /wp-content/plugins/grand-media/inc/pel to:

    function gmedia_pel_autoloader($class) {
        if ( substr_compare ( $class, 'lsolesen\\pel\\', 0, 13 ) === 0) {
            $file = str_replace('lsolesen\\pel\\', '', $class );
            $load = realpath(dirname(__FILE__) . '/' . $file . '.php');
            if($load !== false) {
                include_once realpath($load);
            }
        }
    }

    5. Change the code in core.php in ../wp-content/plugins/grand-media/inc:
    All occurences of Pel… to \lsolesen\pel\Pel. (pel introduced a namespace).
    I changed lines: 1959, 1964, 1979, 1980, 1982, 1997, 1998, 2005, 2006, 2013, 2014, 2021. I did not change line 2027 for the Exception.
    Example:
    >> 1959 \lsolesen\pel\Pel::setJPEGQuality( 100 );
    6. Upload the new pel-folder and the core.php to your site. Test.
    For me this solved the problem

    I use the plugin now for a long time on several sites and no issues?? On one it‘s the bought version and on others the free version is enough…
    I use also PHP 7.4 and upload every several days…
    So is that problem realy due to PHP? Or just related to PHP 8 which is not yet used on many server providers??
    Thanks for the info…

    The background is that curly braces for string / array access are deprecated, even in PHP 7.4. The outdated version of PEL uses curly braces. PEL is written in PHP, so it as PHP problem of PEL. It is not recommended to use PHP 5.x anymore. PHP 7.4 obviously ignores the curly braces, as Gmedia is working on your site(s) and many others.
    So the recommendation is: Do not update your server to PHP 8 if you are using the Gmedia Plugin and do NOT want to fiddle around with the code, as I did.
    I just wanted to have the work-around documented, maybe it will help another person sometime.

    Thread Starter ezradallas

    (@ezradallas)

    I am also on PHP 7.4, not 8 and having issue. This worked for me as a work around: I have the same issue I submitted a contact form over at https://codeasily.com/ with this issue. Hopefully we see a fix for this soon. It’s related to JQuery and if you need this to work NOW you can use the “Enable jQuery Migrate Helper” WordPress Plugin to get it working again. Just install the plugin access it under “Tools” in WordPress an set the “jQuery Version” to “Legacy XXXX”. As the plugin will tell you….this is NOT a solution, only a work around until the Gmedia Plugin code is updated to use a newer version of JQuery.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Cannot upload images’ is closed to new replies.