• Resolved Rhand

    (@rhand)


    Testing PHPH 8.1 and we have OMGF Pro. We now see this error

    [24-Mar-2022 06:32:26 UTC] PHP Fatal error: Uncaught Error: Call to undefined function get_plugin_data() in /home/wp_fjg2if/sitecom.stage.site/wp-content/plugins/host-google-fonts-pro/includes/class-omgf-pro.php:258

    Stack trace:
    #0 /home/wp_fjg2if/sitecom.stage.site/wp-includes/class-wp-hook.php(307): OmgfPro->check_dependencies('')
    #1 /home/wp_fjg2if/sitecom.stage.site/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(NULL, Array)
    #2 /home/wp_fjg2if/sitecom.stage.site/wp-includes/plugin.php(474): WP_Hook->do_action(Array)
    #3 /home/wp_fjg2if/sitecom.stage.site/wp-settings.php(587): do_action('init')
    #4 /home/wp_fjg2if/sitecom.stage.site/wp-config.php(92): require_once('/home/wp_fjg2if...')
    #5 /home/wp_fjg2if/sitecom.stage.site/wp-load.php(50): require_once('/home/wp_fjg2if...')
    #6 /home/wp_fjg2if/sitecom.stage.site/wp-admin/admin.php(34): require_once('/home/wp_fjg2if...')
    #7 /home/wp_fjg2if/sitecom.stage.site/wp-admin/index.php(10): require_once('/home/wp_fjg2if...')
    #8 {main}
      thrown in /home/wp_fjg2if/sitecom.stage.site/wp-content/plugins/host-google-fonts-pro/includes/class-omgf-pro.php on line 258

    License manager directory ffwp-license-manager / plugin is there.. so not sure why

    $inactive_plugin = array_search(false, $required_plugins);
    
    if ($inactive_plugin) {
    $plugin_name = get_plugin_data(OMGF_PRO_PLUGIN_FILE)['Name'];
    
    // Clear all previously set notices.
    
    delete_transient(OmgfPro_Admin_Notice::OMGF_PRO_ADMIN_NOTICE_TRANSIENT);
    
    OmgfPro_Admin_Notice::set_pro_notice(sprintf(__('<strong>%s</strong> needs to be installed and active for %s to function properly. Please make sure it\'s installed and activated, before activating %s.', $this->plugin_text_domain), $inactive_plugin, $plugin_name, $inactive_plugin), 'error', 'omgf_pro_license_manager_not_active');
    
    deactivate_plugins(OMGF_PRO_PLUGIN_BASENAME);
    
    $this->init = false;
    
    return;
    }

    is causing issues

    Not sure why it would be undefined all of the sudden here and if this could be related to PHP 8.1 but would love some feedback.

    • This topic was modified 2 years, 11 months ago by Rhand.
    • This topic was modified 2 years, 11 months ago by Rhand.
    • This topic was modified 2 years, 11 months ago by Rhand.
    • This topic was modified 2 years, 11 months ago by Rhand.
    • This topic was modified 2 years, 11 months ago by Rhand.
Viewing 15 replies - 1 through 15 (of 19 total)
  • Plugin Author DaanvandenBergh

    (@daanvandenbergh)

    I’ve never even received a formal notice that WordPress itself is compatible with PHP 8.1. Last thing I can find about that is this.

    So, I can imagine that some code of WordPress isn’t being executed on PHP8.1, which eventually results in core functions not being available.

    This is all speculation, ofcourse. But I’ll have to test this, and get back to you.

    Plugin Author DaanvandenBergh

    (@daanvandenbergh)

    Ah, wait. This is about OMGF Pro. Are you running the latest version? The last version is v3.3.2.

    Thread Starter Rhand

    (@rhand)

    @daanvandenbergh well I did clone over the production site to staging so I believe I have

    OMGF
    Deactivate | Troubleshoot | Settings
    Increase GDPR compliance, reduce DNS requests and leverage browser cache by automatically downloading Google Fonts to your server.
    
    Version 5.0.6 | By Daan from FFW.Press | View details
    Disable auto-updates
    Select OMGF Pro	
    OMGF Pro
    Deactivate | Troubleshoot | Enter License Key
    Premium add-on for OMGF. Requires OMGF to activate.
    
    Version 3.0.2 | By Daan from FFW.Press | Visit plugin site

    It is just that staging has died on me. Frontend does load but Elementor/Astra layout all broken as well… but wait.. decided to check readme for OMGF Pro on staging and it is 3.0.2:

    === OMGF Pro ===
    Contributors: DaanvandenBergh
    Tags: OMGF Pro, Google Fonts, Host Fonts Locally
    Requires at least: 5.3
    Tested up to: 5.8
    Stable tag: 3.0.2
    Requires PHP: 7.0
    
    == Description ==
    
    Replace all Google Fonts in your webpages with locally hosted versions. Also removes preconnect, dns-prefetch and preload headers.
    
    == Changelog ==
    
    = 3.0.2 | October 5th, 2021 =
    * Fix: Manual Mode works again when Advanced Processing is on.
    * Fix: Empty Cache Directory broke down due to 3.0.1's dependency checks.
    * Fix: Don't throw any more notices, when optimization is finished.
    * Fix: When Automatic Optimization Mode hasn't processed the page yet, serve the original page, including Google Fonts.

    Hmm wonder why we never updated then.. do hope it will help and I will have to do it manually on staging..

    • This reply was modified 2 years, 11 months ago by Rhand.
    • This reply was modified 2 years, 11 months ago by Rhand.
    Plugin Author DaanvandenBergh

    (@daanvandenbergh)

    Try temporarily deactivating your license from within the license manager. Then enter your license again, and click Activate Licenses.

    A quick reactivation might pull the update in properly.

    Plugin Author DaanvandenBergh

    (@daanvandenbergh)

    Otherwise you can of course download it from within your ffw.press account.

    Thread Starter Rhand

    (@rhand)

    @daanvandenbergh I deactivated old OMGF Pro by adding -deadto directory, then uploaded latest plugin via SFTP. Here part of new readme.txt.:

    == Changelog ==

    = 3.4.1 | March 22nd, 2022 =
    * Fixed: Process Local Stylesheets didn’t work in v3.4.0.

    Still seeing

    [24-Mar-2022 06:32:26 UTC] PHP Fatal error:  Uncaught Error: Call to undefined function get_plugin_data() in /home/wp_fjg2if/sitecom.stage.site/wp-content/plugins/host-google-fonts-pro/includes/class-omgf-pro.php:258
    Stack trace:
    #0 /home/wp_fjg2if/sitecom.stage.site/wp-includes/class-wp-hook.php(307): OmgfPro->check_dependencies('')
    #1 /home/wp_fjg2if/sitecom.stage.site/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(NULL, Array)
    #2 /home/wp_fjg2if/sitecom.stage.site/wp-includes/plugin.php(474): WP_Hook->do_action(Array)
    #3 /home/wp_fjg2if/sitecom.stage.site/wp-settings.php(587): do_action('init')
    #4 /home/wp_fjg2if/sitecom.stage.site/wp-config.php(92): require_once('/home/wp_fjg2if...')
    #5 /home/wp_fjg2if/sitecom.stage.site/wp-load.php(50): require_once('/home/wp_fjg2if...')
    #6 /home/wp_fjg2if/sitecom.stage.site/wp-admin/admin.php(34): require_once('/home/wp_fjg2if...')
    #7 /home/wp_fjg2if/sitecom.stage.site/wp-admin/index.php(10): require_once('/home/wp_fjg2if...')
    #8 {main}
      thrown in /home/wp_fjg2if/sitecom.stage.site/wp-content/plugins/host-google-fonts-pro/includes/class-omgf-pro.php on line 258

    though. Other issue might be that license is for one site and I am testing staging site on *.stage.site with DreamPress

    • This reply was modified 2 years, 11 months ago by Rhand.
    Thread Starter Rhand

    (@rhand)

    I added a new copy of the production site to staging again and it does load. Have not tried to update nor open OMGF Pro admin page yet to see if all is well now.

    Thread Starter Rhand

    (@rhand)

    I can open https://site.stage.site/wp-admin/options-general.php?page=ffwp-license-manager now and see license active. No issues yet. Perhaps during migration something got corrupted? But still, update with latest did not change the issue.

    NB Also can load https://site.stage.site/wp-admin/options-general.php?page=optimize-webfonts now

    • This reply was modified 2 years, 11 months ago by Rhand.
    Plugin Author DaanvandenBergh

    (@daanvandenbergh)

    Alright, well, my previous point remains ??

    I’ve never even received a formal notice that WordPress itself is compatible with PHP 8.1. Last thing I can find about that is this.

    So, I can imagine that some code of WordPress isn’t being executed on PHP8.1, which eventually results in core functions not being available.

    This is all speculation, ofcourse. But I’ll have to test this, and get back to you.

    I’m going to setup my environment with PHP 8.1 and hopefully I’ll be able to reproduce the issue. I’ll keep you posted!

    Thread Starter Rhand

    (@rhand)

    Well I updated to latest 3.4.2 version now and site still loads. But do get these errors now. Perhaps I need to do some resetting or rebuilding..

    Access to font at 'https://site.com/wp-content/uploads/2021/04/amalfi_coast-webfont.woff2' from origin 'https://sitecom.stage.site' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
    post-7.css:1          GET https://site.com/wp-content/uploads/2021/04/amalfi_coast-webfont.woff2 net::ERR_FAILED 200
    sitecom.stage.site/:1 Access to font at 'https://site.com/wp-content/uploads/2021/04/amalfi_coast-webfont.woff' from origin 'https://sitecom.stage.site' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
    post-7.css:1          GET https://site.com/wp-content/uploads/2021/04/amalfi_coast-webfont.woff net::ERR_FAILED 200
    sitecom.stage.site/:1 Access to font at 'https://site.com/wp-content/uploads/2021/04/amalfi_coast-webfont.ttf' from origin 'https://sitecom.stage.site' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
    post-7.css:1          GET https://site.com/wp-content/uploads/2021/04/amalfi_coast-webfont.ttf net::ERR_FAILED 200

    Did empty WP Rocket Cache already on this DreamPress staging site mind you..

    Thread Starter Rhand

    (@rhand)

    And because staging is behind htaccess wall I seem to get this on clicking “start optimizing”:

    OMGF encountered an error while fetching this site's frontend HTML: 401 - Unauthorized

    Plugin Author DaanvandenBergh

    (@daanvandenbergh)

    And because staging is behind htaccess wall I seem to get this on clicking “start optimizing”

    Yep, that makes sense. OMGF needs to be able to access the frontend to scan for fonts. PHP can’t act as an admin or something. So, you’d have to disable that temporarily.

    To investigate the other issue in post-7.css I’d need the URL of your site. If you don’t want to share it here, please send it to me using this contact form.

    Thread Starter Rhand

    (@rhand)

    Plugin Author DaanvandenBergh

    (@daanvandenbergh)

    That site requires basic auth, but don’t provide these credentials here. As an alternative, please provide the full URL to the post-7.css file.

    Thread Starter Rhand

    (@rhand)

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘PHP Fatal error: Uncaught Error: Call to undefined function get_plugin_data()’ is closed to new replies.