By using Elementorforum.com’s services you agree to our Cookies Use and Data Transfer outside the EU.
We and our partners operate globally and use cookies, including for analytics, personalisation, ads and Newsletters.

  • Join the Best Unofficial Elementor Support forum

    Provide or get advice on everything Elementor and Wordpress, ask questions, gain confirmation or just become apart of a friendly, like minded community who love Wordpress and Elementor


    Join us!
elementor official

Site not loading following Elementor Update

M

MrMoores

New Member
The site is experiencing technical difficulties.
Uncaught Error: Class 'Elementor\Post_CSS_File' not found in /home/canonixnxx/www/wp-content/plugins/jet-theme-core/includes/locations.php:114
Stack trace:
#0 /home/canonixnxx/www/wp-includes/class-wp-hook.php(286): Jet_Theme_Core_Locations->enqueue_styles('')
#1 /home/canonixnxx/www/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)
#2 /home/canonixnxx/www/wp-includes/plugin.php(465): WP_Hook->do_action(Array)
#3 /home/canonixnxx/www/wp-includes/script-loader.php(2539): do_action('wp_enqueue_scri...')
#4 /home/canonixnxx/www/wp-includes/class-wp-hook.php(286): wp_enqueue_scripts('')
#5 /home/canonixnxx/www/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)
#6 /home/canonixnxx/www/wp-includes/plugin.php(465): WP_Hook->do_action(Array)
#7 /home/canonixnxx/www/wp-includes/general-template.php(2745): do_action('wp_head')
#8 /home/canonixnxx/www/wp-content/themes/kava/header.php(19): wp_head()
#9 /home/canonixnxx/www/wp-includes/template.php(722): require_once('/home/cano
 
elementor official
westial

westial

New Member
Same problem here when I transferred a site with Elementor Pro to a new server with PHP 7.2.

I found two instantiations of the Elementor\Post_CSS_File class:

Code:
./jet-theme-core/includes/templates/post-type.php:
$css = new \Elementor\Post_CSS_File( $template );
./jet-theme-core/includes/locations.php:#
$css_file = new Elementor\Post_CSS_File( $template_id );
The first one, in post-type.php file is indeed quite particular, in this case, we are safe, Post_CSS_File will never be instantiated due to `$template=false` expression before checking if $template is true (amazing...):

Code:
foreach ( $parts as $part ){$template = false;
    if ( $template ){$css = new \Elementor\Post_CSS_File( $template );
        $css->enqueue();
    }
}
So, after the high quality demonstration of programming above and after waited some time with the website broken, I modified the source code of the first case, the locations.php and I ignored this class instantiation. And it works for me.

The trick is commenting the instantiation lines in the locations.php file:
Code:
foreach ( $locations as $location => $structure ){$template_id = jet_theme_core()->conditions->find_matched_conditions( $structure->get_id() );
#    if ( $current_post_id !== $template_id ){#        $css_file = new Elementor\Post_CSS_File( $template_id );
#        $css_file->enqueue();
#    }
}
 
elementor official
A

Agemo

New Member
Great reply.

I had bad issues with a migration to a hosting package that ustlised cPanel php 7.2 and was getting horrible 503's and was I think causing duplicator some issues too.

I had migrated from a php 7.2 environment, using Duplcator obviously to ge the data out (no problems then) - cPanel has a nifty php switcher, which I don't pretend to understand if it is safe or efficient, but it claims to harden older php versions, so if you need to run 5.x you should be covered. (Really?)

The moral of my story is - always run a backup before any update or similar event.

Duplicator was new to me I had manually migrated pervious element or sites, but not from this specific host to another one - backup of any kind before major updates or plugin updates - I think should be par for the course for anyone of any technical level, it's easy to run a backup utilising duplicator and many something like migration-all-in-one plugin or similar, it comes down to covering your ass and not wasting a day fixing something that would have been less time in recovery if there was a useable backup.

I know I would not have the technical insight to look at the level of the above reply, nice to know in case similar occur in future. Thanks!
 
elementor official
SergiuC

SergiuC

New Member
Same problem here when I transferred a site with Elementor Pro to a new server with PHP 7.2.

I found two instantiations of the Elementor\Post_CSS_File class:

Code:
./jet-theme-core/includes/templates/post-type.php:
$css = new \Elementor\Post_CSS_File( $template );
./jet-theme-core/includes/locations.php:#
$css_file = new Elementor\Post_CSS_File( $template_id );
The first one, in post-type.php file is indeed quite particular, in this case, we are safe, Post_CSS_File will never be instantiated due to `$template=false` expression before checking if $template is true (amazing...):

Code:
foreach ( $parts as $part ){$template = false;
    if ( $template ){$css = new \Elementor\Post_CSS_File( $template );
        $css->enqueue();
    }
}
So, after the high quality demonstration of programming above and after waited some time with the website broken, I modified the source code of the first case, the locations.php and I ignored this class instantiation. And it works for me.

The trick is commenting the instantiation lines in the locations.php file:
Code:
foreach ( $locations as $location => $structure ){$template_id = jet_theme_core()->conditions->find_matched_conditions( $structure->get_id() );
#    if ( $current_post_id !== $template_id ){#        $css_file = new Elementor\Post_CSS_File( $template_id );
#        $css_file->enqueue();
#    }
}
@westial your method is working! Thanks.
 
elementor official
elementor official
Top