• Resolved startle9602

    (@startle9602)


    Hi,

    Using: SmartSlider 3.5.1.21, WordPress 5.9.2 and PHP 7.4 I’m getting a warning thrown when accessing a page with a slider because an extra ‘/’ is appended after $upload$ when selecting media for a slide background, resulting in a file uri such as $upload$//an_image.jpeg. Here is the warning:

    Warning: get_headers(): This function may only be used against URLs in /home/user/public_html/wp-content/plugins/smart-slider-3/Nextend/Framework/Cache/CacheImage.php on line 116
    
    Warning: Invalid argument supplied for foreach() in /home/user/public_html/wp-content/plugins/smart-slider-3/Nextend/Framework/Cache/CacheImage.php on line 118

    Which is caused by this code block:

    // wp-content/plugins/smart-slider-3/Nextend/Framework/Cache/CacheImage.php:105
    // $originalFile = /var/www/html/wp-content/themes/theme/images//an_image.jpg
    
    if (strpos($originalFile, '//') !== false) {
        $manifestData['mtime'] = $this->getRemoteMTime($originalFile);

    which decides that $originalFile is a URL, even though it is a file path, because of the ‘//’ in the file path.

    This can all be worked around by removing the extra ‘/’ in the slide background’s file uri manually, so it reads as $upload$/an_image.jpeg, but this is not an ideal solution for multiple people working on a site.

    Is this extra ‘/’ after $upload$ being added because of a theme conflict? Or is there faulty logic here which needs to be corrected?

    • This topic was modified 8 months, 2 weeks ago by startle9602.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Robert

    (@robertnextendweb)

    Hi @startle9602

    Based on your debugging, if the folders are not just examples here:
    /wp-content/themes/theme/images//an_image.jpg
    then your uploads folder path is changed. It is probably done in your wp-config.php file, like this:

    define('UPLOADS', 'wp-content/themes/theme/images/');

    When defining the UPLOADS folder you should not have a / character at the end, so the correct definition would look like this:

    define('UPLOADS', 'wp-content/themes/theme/images');

    If this is truly the problem, then please adjust it, and afterwards the images in Smart Slider will have the correct paths as well. However, if you did not define the UPLOADS folder, then please contact us through our support form here:
    https://smartslider3.com/contact-us/support/?topic=Conflict
    And we’ll help figure out what is causing this problem.

    Thread Starter startle9602

    (@startle9602)

    Hi Robert,

    Thanks for the quick reply, you are exactly right. There was a trailing slash configured in wp-admin > settings > media > Store uploads in this folder. Removing the trailing slash fixes this. 'UPLOADS' was not defined in a file anywhere.

    Cheers

    • This reply was modified 8 months, 2 weeks ago by startle9602.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Extra slash being appended to $upload$ on selecting slide image’ is closed to new replies.