• Resolved Aaron

    (@jstask)


    I get MIME type and 404 errors for non-existing CSS in the uploads folder for 6 gutentor css files.

    I was unable to reproduce this on local testing and I tried to uninstall Gutentor, and start from scratch, since there is only one block I am using it for, but the settings won’t reset, as soon as I activate the plugin it tries to load that non-existing files.

    I don’t use caching plugins at the moment.

    How can I do a reinstallation with a complete reset, and/or get rid of this file requests?

    The page I need help with: [log in to see the link]

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter Aaron

    (@jstask)

    @codersantosh a response on how I could reset the plugin, or get rid of those 404s would be much appreciated.

    I really like the plugin and the themes you sell through it, I would consider spending money on a pro version, as mentioned in your roadmap, if I could use it without errors.

    Plugin Contributor codersantosh

    (@codersantosh)

    Hello @jstask ,

    It seems like the issues come from some cache plugin or maybe server cache. It is because before loading the dynamic CSS file Gutentor first checks if the file exists( with file_exists ).
    Can you please check on that?

    Best Regards!

    Thread Starter Aaron

    (@jstask)

    In addition to turn off caching, I disabled the caching plugins completely, and did a copy to my local machine, to exclude server caching issues. The MIME type errors are gone, not the 404 for the same files, because the files Gutentor tries to load don’t exist in my uploads folder (/app/uploads). I also don’t use any Gutentor Blocks at the moment, only the plugin is activated. I also tried altering the Gutentor optimization settings, but it tries to load those non-existing files anyway.

    Maybe the error is caused by the file_exists function? My folder structure is different from the default one since I am using https://roots.io/bedrock/

    Plugin Contributor codersantosh

    (@codersantosh)

    Hello @jstask ,

    Just wondering if the issue goes after deactivating the Gutetor?

    Best Regards`

    Thread Starter Aaron

    (@jstask)

    Sure, if I disable Gutentor no missing CSS calls are made.

    Plugin Contributor codersantosh

    (@codersantosh)

    @jstask can you please let me know if you are using reusable block?

    Thread Starter Aaron

    (@jstask)

    Plugin Contributor codersantosh

    (@codersantosh)

    I think I got you.

    Can you please replace the code of the plugin file gutentor/includes/hooks.php

    https://plugins.trac.ww.wp.xz.cn/browser/gutentor/trunk/includes/hooks.php#L831

    Line 831 to 837

    if ( $reusable_blocks ) {
    			$upload_dir = wp_upload_dir();
    			foreach ( $reusable_blocks as $reusable_block ) {
    				$css_info = get_post_meta( $reusable_block, 'gutentor_css_info', true );
    				wp_enqueue_style( 'gutentor-dynamic-' . $reusable_block, trailingslashit( $upload_dir['baseurl'] ) . 'gutentor/p-' . $reusable_block . '.css', false, isset( $css_info['saved_version'] ) ? $css_info['saved_version'] : '' );
    			}
    		}

    with the following code below:

    if ( $reusable_blocks ) {
    			$upload_dir = wp_upload_dir();
    			foreach ( $reusable_blocks as $reusable_block ) {
    				if ( file_exists( $upload_dir['basedir'] . '/gutentor/p-' . $reusable_block . '.css' ) ) {
    					$css_info = get_post_meta( $reusable_block, 'gutentor_css_info', true );
    					wp_enqueue_style( 'gutentor-dynamic-' . $reusable_block, trailingslashit( $upload_dir['baseurl'] ) . 'gutentor/p-' . $reusable_block . '.css', false, isset( $css_info['saved_version'] ) ? $css_info['saved_version'] : '' );
    				}
    			}
    		}

    Please don’t forget to backup the file and let me know if the issue goes after replacing the code.

    Best Regards!

    Thread Starter Aaron

    (@jstask)

    This fixed it! Do you include this in your next update?

    Plugin Contributor codersantosh

    (@codersantosh)

    Hello @jstask ,

    We have added it to the recent update. Thanks for letting us know about it.

    Best Regards!

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

The topic ‘MIME type errors for non exisisting css in uploads’ is closed to new replies.