Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
gamecreature opened this issue Mar 4, 2021 · 5 comments
Closed

Comments

@gamecreature
Copy link

gamecreature commented Mar 4, 2021

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:

In class class-kirki-fonts-downloader.php (line 113)
Kirki 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 Kirki, 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?

@pagelab
Copy link
Contributor

pagelab commented Mar 5, 2021

Just a heads-up: the part of the function you mentioned is the same from WPTT/webfont-loader. It is from the same developer and is being actively developed there.

@gamecreature
Copy link
Author

@pagelab Thanks for noticing this. Added this issue to WPTT/webfont-loader#11).
I think this font generation should be configurable to no be generated via the WP Filesystem class.

@gamecreature
Copy link
Author

A possible solution? WPTT/webfont-loader#11 (comment)
(Use a normal rename if the webserver has write access, else try the WP_Fileystem).
This way it's possible to keep the password-protected WP_Filesystem. (SFTP protected plugin/wordpress directory)

@manelephant
Copy link

manelephant commented Mar 20, 2021

Same thing for me, after a few month it flooded my /tmp and crashed my server cause filesystem has no more inode to allocate.

Once kirki-framework is disabled the problem stops.

Took me a while to understsand what was going on cause you have no clue that link those temp files to the plugin.

Then took me a while to cleanup the mess (removing those millions of all micro .tmp files when you can't "rm").

@mapsteps
Copy link
Contributor

Hello and thank you for reporting this issue.

We are closing most open GitHub issues with the release of Kirki 4 to start fresh with this major release.

If you are still running into issues after you have tested your theme with Kirki 4, please let us know so we can reopen the issue.

Please note that Kirki 3 is no longer actively supported. Moving forward, we will only provide support the very latest version of Kirki.

Thank you for your understanding.

Best,
David

@mapsteps mapsteps reopened this Dec 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants