Skip to content

tmp folder flooded with downloaded Font files (when using SFTP).  #11

Open
@gamecreature

Description

@gamecreature

Issue description:

When using an SFTP filesystem backend the tmp-file directory is flooded with dowloaded google font files
(When using SFTP without storing the password, Wordpress asks for password when updating plugins etc.)

Version used:

The version that's from the 'master branch'. It seems that's the latest version that is updated via Wordpress plugins.
(Develop branch is totally different)

Description:

(Copied from themeum/kirki#2375).
It seems this repository is the base of the webfont-loader

In class WPTT_WebFont_Loader (line 343)
The library tries to move the tmp file via the wp_filesystem

 // Move temp file to final destination.
 $success = $this->get_filesystem()->move( $tmp_path, $font_path, true );

This fails, because the SFTP cannot login. (and on the frontend no password-dialog is used)
This results in a tmp folder with endless numbers of files.

Hacky fix for now is to move it directly without the filesystem. (wp-content/fonts should be writable by the webserver)

 // Move temp file to final destination.
// $success = $this->get_filesystem()->move( $tmp_path, $font_path, true );
$succes = rename($tmp_path, $font_path);

This resolves my issue.
But it would be nice if it was possible to configure the library, to not use the wp-filesystem to move this temp file. Because in some cases the filesystem needs input from the administrator.

Maybe it should be configurable by a configuration switch?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions