• Hi
    When choosing which styles and scripts to disable from Theme Panel -> Scripts & Styles the result is one generated style and one generated script in wp-content/uploads/oceanwp/

    However both of these files are empty. PHP error log shows no errors or warnings, PHP version is 7. This happens with default or child theme and all other plugins deactivated. Plugin version is 1.4.7

    What’s wrong?

    This thread is a kind of a sequel of https://ww.wp.xz.cn/support/topic/issue-with-child-theme-2/

    • This topic was modified 8 years, 3 months ago by drazon.
Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author oceanwp

    (@oceanwp)

    Hello, there is this problem because I use “$wp_filesystem->get_contents()” to get the content of the files and on some hosts, this function is blocked, you need to contact your web host to ask him if you can use this function on your server. it is probably a small thing to activate, then it should work.

    Thread Starter drazon

    (@drazon)

    Nope it is not that.

    get_filesystem_method() returns direct on my setup plus this function

    function testfilesystem(){
    	global $wp_filesystem;
    	require_once( ABSPATH . '/wp-admin/includes/file.php' );
    			WP_Filesystem();
    	
    	$myarray = $wp_filesystem->get_contents( get_stylesheet_directory() . '/style.css' );
    	$wp_filesystem->put_contents( get_stylesheet_directory() . '/style2.css' , $myarray );	
    }

    gets the style.css and copies it to style2.css successfully in the child theme. However if i call instead get_contents(‘https://raw.githubusercontent.com/oceanwp/oceanwp/master/assets/css/third/bbpress.css’)

    then the result is an empty file.

    So there is the problem. Why anyway do you call the WP filesystem to handle external files while the same files exist in the oceanwp theme locally? It doesn’t feel right or secure.

    • This reply was modified 8 years, 3 months ago by drazon.
    Plugin Author oceanwp

    (@oceanwp)

    Hi, I don’t get the style.css file, there is no purpose to that πŸ™‚
    If you disable a script or style, a JS and CSS files are automatically generated without the scripts you un-checked.

    Thread Starter drazon

    (@drazon)

    Please read my answer again, I ‘ve just shown you that the functions $wp_filesystem->get_contents() and $wp_filesystem->put_contents() work very well on my system and as an example I used style.css file for demonstration. While when I used the https://raw.githubusercontent.com/oceanwp/oceanwp/master/assets/css/third/bbpress.css file it returned blank.

    Do you understand?

    Plugin Author oceanwp

    (@oceanwp)

    Oh, can you create a pre-purchase ticket? I will ask you more information to try to solve this problem.
    Thank you.

    Thread Starter drazon

    (@drazon)

    Sure how/where can I do this? I will do it later tonight.

    Plugin Author oceanwp

    (@oceanwp)

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    Don’t create “sequel” topics. Those are duplicates and not allowed here.

    For pro or commercial product support please contact the author directly on their site. This includes any pre-sales topics as well.

    As the author is aware, commercial products are not supported in these forums. I am sure they will have no problem supporting you there.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Not generating custom style and script in uploads folder’ is closed to new replies.