• Resolved Parsa

    (@parselearn)


    Hello
    I have this error on WP dashboard

    PHP Fatal error:  Uncaught Error: Call to a member function getTimestamp() on bool in /.../wp-content/plugins/wp-smushit/core/external/blackfriday/banner.php:262
    Stack trace:
    #0 /.../wp-content/plugins/wp-smushit/core/external/blackfriday/banner.php(223): WPMUDEV\BlackFriday\Banner->event_expired()
    #1 /.../wp-content/plugins/wp-smushit/core/external/blackfriday/banner.php(147): WPMUDEV\BlackFriday\Banner->can_load()
    #2 /.../wp-includes/class-wp-hook.php(307): WPMUDEV\BlackFriday\Banner->current_screen_actions()
    #3 /.../wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()
    #4 /.../wp-includes/plugin.php(476): WP_Hook->do_action()
    #5 /.../wp-admin/includes/class-wp-screen.php(422): do_action()
    #6 /.../wp-admin/includes/screen.php(243): WP_Screen->set_current_screen()
    #7 /.../wp-admin/admin.php(212): s in /.../wp-content/plugins/wp-smushit/core/external/blackfriday/banner.php on line 262
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support Patrick – WPMU DEV Support

    (@wpmudevsupport12)

    Hi @parselearn

    Sorry to hear you are having this issue.

    Do you have any access to WordPress or not access at all?

    If you don’t have any access, can you use the Hosting file manager or sFTP to access the WordPress folder > plugins, find the wp-smushit folder and remove it temporarily?

    Before reinstalling the plugin, please let us know the WordPress version, language and PHP that your site uses, those information can be found at WordPress > Tools > Site Health.

    Let us know the result you got.
    Best Regards
    Patrick Freitas

    Thread Starter Parsa

    (@parselearn)

    Your welcome
    Yes, I rename folder from host file manager.

    WP Version: 6.0.3
    Language: Farsi
    PHP Version: 7.4.8

    Plugin Support Adam – WPMU DEV Support

    (@wpmudev-support8)

    Hi @parselearn

    Thank you for response!

    I understand that disabling plugin this way removed the error and gave you site back, right?

    A quick workaround for now would be to downgrade plugin to previous version which doesn’t include the code that caused that issue. You can download the previous 3.11.1 version from here (form at the very bottom of the page):

    https://wordpress.org/plugins/wp-smushit/advanced/

    and installing it on site should not cause such issue again. It will not “unoptimize” your images so it can be used as a workaround.

    I have also asked our developers for advice on the issue – why this is happening and how can we possibly fix it or what should be additionally checked on site – so please keep an eye on this ticket and we’ll update you with more information once we got feedback on this.

    Kind regards,
    Adam

    Plugin Support Adam – WPMU DEV Support

    (@wpmudev-support8)

    Hi again @parselearn

    I got updated from our developers on this!

    They think you may be using this plugin on site:

    https://wordpress.org/plugins/wp-persian/

    Are you? If yes, apparently this plugin is causing some issue with date_create() function, which in turn causes the issue.

    Aside from downgrading Smush, another workaround would be adding this code to the site as an MU plugin (and then re-enabling current Smush version) and it should also help:

    <?php 
    add_action( 'admin_init', function() {
    	$banner_file = WP_SMUSH_DIR . 'core/external/blackfriday/banner.php';
    	if ( file_exists( $banner_file ) ) {
    		unlink( $banner_file );
    	}
    });

    To add code as MU plugin:

    – create an empty file with a .php extension (e.g. “smush-bf-banner-fix.php”)
    – copy and paste this code into it
    – save the file and upload it to the /wp-content/mu-plugins/ folder of your site’s WordPress installation.

    Best regards,
    Adam

    Thread Starter Parsa

    (@parselearn)

    Thanks for your help

    I use wp-parsidate, I think my plugin conflict with wp-smushit

    Thanks for the code, I will use it.

    This solution solved my problem.

    Thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘PHP Fatal error Call to a member function getTimestamp() banner.php’ is closed to new replies.