• Resolved Shane Bishop

    (@nosilver4u)


    Hi Daan, I was trying to setup OMGF, and when I click Save & Optimize, I get this:

    PHP Fatal error:  Uncaught TypeError: ucfirst(): Argument #1 ($string) must be of type string, array given in /sites/test.exactlywww.com/files/wp-content/plugins/host-webfonts-local/src/Optimize/Run.php:201
    Stack trace:
    #0 [internal function]: ucfirst()
    #1 /sites/test.exactlywww.com/files/wp-content/plugins/host-webfonts-local/src/Optimize/Run.php(201): array_map()
    #2 /sites/test.exactlywww.com/files/wp-content/plugins/host-webfonts-local/src/Optimize/Run.php(165): OMGF\Optimize\Run->fluent_implode()
    #3 /sites/test.exactlywww.com/files/wp-content/plugins/host-webfonts-local/src/Optimize/Run.php(50): OMGF\Optimize\Run->optimization_succeeded()
    #4 /sites/test.exactlywww.com/files/wp-content/plugins/host-webfonts-local/src/Optimize/Run.php(34): OMGF\Optimize\Run->run()
    #5 /sites/test.exactlywww.com/files/wp-content/plugins/host-webfonts-local/src/Admin/Optimize.php(90): OMGF\Optimize\Run->__construct()
    #6 /sites/test.exactlywww.com/files/wp-content/plugins/host-webfonts-local/src/Admin/Optimize.php(66): OMGF\Admin\Optimize->run()
    #7 /sites/test.exactlywww.com/files/wp-content/plugins/host-webfonts-local/src/Admin/Optimize.php(43): OMGF\Admin\Optimize->init()
    #8 /sites/test.exactlywww.com/files/wp-content/plugins/host-webfonts-local/src/Admin/Actions.php(49): OMGF\Admin\Optimize->__construct()
    #9 /sites/test.exactlywww.com/files/wp-includes/class-wp-hook.php(308): OMGF\Admin\Actions->do_optimize()
    #10 /sites/test.exactlywww.com/files/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()
    #11 /sites/test.exactlywww.com/files/wp-includes/plugin.php(517): WP_Hook->do_action()
    #12 /sites/test.exactlywww.com/files/wp-admin/admin.php(175): do_action()
    #13 /sites/test.exactlywww.com/files/wp-admin/options-general.php(10): require_once('...')
    #14 {main}
      thrown in /sites/test.exactlywww.com/files/wp-content/plugins/host-webfonts-local/src/Optimize/Run.php on line 201

    I haven’t used the plugin in a while, so I might have old data from a previous version of the plugin. Is there a way to reset the plugin or could I just remove all the omgf* options from the db?

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Daan van den Bergh

    (@daanvandenbergh)

    Which version of PHP are you running?

    Thread Starter Shane Bishop

    (@nosilver4u)

    The site is running 8.0.29 with WP 6.2.2

    Plugin Author Daan van den Bergh

    (@daanvandenbergh)

    Hmmm, thoroughly tested with both and haven’t seen this before.

    Can you enable Debug Mode (Advanced Settings), hit Save & Optimize again and send me the debug log?

    You can send it to me using this form. (Rename the .log file to .txt. It’s a bug in WP Forms I still need to tell them about 😅)

    Thread Starter Shane Bishop

    (@nosilver4u)

    Done!

    Plugin Author Daan van den Bergh

    (@daanvandenbergh)

    Circling back to this, me and @nosilver4u figured out by email that the error was caused by a few years old, not properly migrated (probably my bad), setting using the same name in the database as the now new Used Subsets option.

    Setting the Used Subsets option (and overwriting the invalid value in the database) resolved the error.

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

The topic ‘fatal error trying to optimize fonts’ is closed to new replies.