• Resolved mickaelperrin

    (@mickaelperrin)


    Hi,

    I had troubles to get your plugin working with our custom installation of wordpress.

    After digging around, I found that the wp-content folder is hardcoded in the UploadsWebpcDirectory class and it requires to exist to have the uploads folder selectable in the settings panel.

    Note, that this happen even by using the custom filter.

    Also, I would point to your attention that you use ABSPATH as default folder, but you should maybe have a look at WP_CONTENT_DIR which defaults to ABSPATH . ‘/wp-content’ in standard wordpress installation and allows you to get rid of the wp-content folder.

    We use that setting in conjunction of WP_CONTENT_URL to provide a custom cookie free no php domain to deliver all plugins/themes/uploads static assets (js, css, medias…).

    Our custom directory structure is:

    /src/
    |
    |—- app/. <- directory root of our https://media.domain.TLD
    . |
    . |- languages/
    . |- plugins/
    . |- themes/
    . |- uploads/
    . |- webp/ <- output folder of webp converted files
    |
    |—- www/ <- directory root of out https://domain.TLD with wordpress core only

    To get your plugin working I needed to create an empty /src/app/wp-content/uploads.

    Hope it helps,

    • This topic was modified 3 years, 6 months ago by mickaelperrin.
Viewing 1 replies (of 1 total)
  • Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    Hello @mickaelperrin,

    Thanks for your message.

    Can you edit this file?
    /src/Conversion/Directory/UploadsDirectory.php

    Add a method inside this class:

    	/**
    	 * Returns status if directory is available.
    	 *
    	 * @return bool Directory is available?
    	 */
    	public function is_available(): bool {
    		return true;
    	}

    Does this fix the problem without creating an empty directory?

    Best,
    Mateusz

Viewing 1 replies (of 1 total)
  • The topic ‘Requires a wp-content folder to exist’ is closed to new replies.