WordPress.org

Ready to get started?Download WordPress

Forums

My Custom CSS
Update deletes my_style.css (9 posts)

  1. Cetheus
    Member
    Posted 1 year ago #

    Hi Darkwolf,

    everytime I install an Update, it removes the my_style.css File in the Plugins Directory.
    It can't be recreated by saving the Settings. It has to be created manually via FTP everytime.

    Do you have any suggestions how to avoid this?

    Greetings Sascha

    http://wordpress.org/extend/plugins/my-custom-css/

  2. DarkWolf
    Member
    Plugin Author

    Posted 1 year ago #

    Is really strange...
    In latest release i've this function:
    = If is present code in my custom css settings and my_style.css file not exist (removed manually or first upgrade from old release), make new my_style.css

    if (!empty($mycustomcss) && (!file_exists(css_path())))
    {
    	makecss();
    }

    makecss(); =

    function makecss()
    {
    	// make my_style.css and write write css code!
    	$makecss = file_put_contents(css_path(), "/********* Do not edit this file *********/\n/*\nMy Custom CSS - Maked by Salvatore Noschese\na.k.a. DarkWolf - http://www://darkwolf.it/\n*/\n\n".mycustomcss());
    	return $makecss;
    }

    -

    And unlink (remove file) is only with this:
    = if exist file but no code in my custom css settings...

    elseif (empty($mycustomcss) && file_exists(css_path()))
    	{
    		unlink(css_path());
    	}

    I've test in local machine and in webserver and don't have found any problem :/

    Can you try to edit "my-custom-css.php" and change "Version: 1.5" to 1.4 and force a new update to test again? See also directory permission (via ftp) in "my-custom-css" directory ;)

  3. Cetheus
    Member
    Posted 1 year ago #

    Sure. I did the Update again and it removed the CSS File again.
    After the Update I'm receiving the following Message:
    Warning: file_put_contents(/www/htdocs/**********/***********/wp-content/plugins/my-custom-css/my_style.css) [function.file-put-contents]: failed to open stream: Permission denied in /www/htdocs/**********/***********/wp-content/plugins/my-custom-css/my-custom-css.php on line 58

    It's interesting, that he says "Permission denied" instead of "File not found"

    Also if the File was created with CHMOD 644 it isn't filled by the Plugin. It has to be set to 777 manually.

    The directory is set to CHMOD 755...

  4. DarkWolf
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks for report... i've found more info in google... I need more test (maybe is safe mode problem - enabled in my online server).

  5. Cetheus
    Member
    Posted 1 year ago #

    No Problem. If you need more Info, just say it :)

  6. DarkWolf
    Member
    Plugin Author

    Posted 1 year ago #

    I've search more and test in another webserver... All seems to works fine :/
    Anyway, I've found this result:
    http://www.algisinfo.com/ro/forum/9-aiContactSafe--English-/10427-warning-file_put_contents-failed-to-open-stream.html#10430

    You might have the owner of some of the folders changed. You can try asking your hosting provider to reset the owner of all your files and folders either to the user you're using for FTP ( if you activated FTP in Joomla ) or the user under which php is running.

    -
    I think, maybe, you have a similar problem!
    ...
    file_put_contents require folder permission to 755 and if you have set to this isn't any reason to don't work as expected :/

  7. Cetheus
    Member
    Posted 1 year ago #

    I checked the owner and it is completely set to my User.
    I have already reset the User for all my Data again. But no change in the Update behavior.

  8. DarkWolf
    Member
    Plugin Author

    Posted 1 year ago #

    Can i know what is your webhost (and if is linux or windows)?

  9. Cetheus
    Member
    Posted 1 year ago #

    Sure. I'm hosted by All-Inkl.com and they are running a Linux Server

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic