Title: PHP Fatal error: Uncaught Error: Call to undefined function get_plugin_data()
Last modified: March 24, 2022

---

# PHP Fatal error: Uncaught Error: Call to undefined function get_plugin_data()

 *  Resolved [Rhand](https://wordpress.org/support/users/rhand/)
 * (@rhand)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/php-fatal-error-uncaught-error-call-to-undefined-function-get_plugin_data/)
 * 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 4 years, 2 months ago by [Rhand](https://wordpress.org/support/users/rhand/).
    -  This topic was modified 4 years, 2 months ago by [Rhand](https://wordpress.org/support/users/rhand/).
    -  This topic was modified 4 years, 2 months ago by [Rhand](https://wordpress.org/support/users/rhand/).
    -  This topic was modified 4 years, 2 months ago by [Rhand](https://wordpress.org/support/users/rhand/).
    -  This topic was modified 4 years, 2 months ago by [Rhand](https://wordpress.org/support/users/rhand/).

Viewing 15 replies - 1 through 15 (of 19 total)

1 [2](https://wordpress.org/support/topic/php-fatal-error-uncaught-error-call-to-undefined-function-get_plugin_data/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/php-fatal-error-uncaught-error-call-to-undefined-function-get_plugin_data/page/2/?output_format=md)

 *  Plugin Author [Daan van den Bergh](https://wordpress.org/support/users/daanvandenbergh/)
 * (@daanvandenbergh)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/php-fatal-error-uncaught-error-call-to-undefined-function-get_plugin_data/#post-15490534)
 * 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](https://make.wordpress.org/core/2022/01/10/wordpress-5-9-and-php-8-0-8-1/).
 * 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 [Daan van den Bergh](https://wordpress.org/support/users/daanvandenbergh/)
 * (@daanvandenbergh)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/php-fatal-error-uncaught-error-call-to-undefined-function-get_plugin_data/#post-15490538)
 * Ah, wait. This is about OMGF Pro. Are you running the latest version? The last
   version is v3.3.2.
 *  Thread Starter [Rhand](https://wordpress.org/support/users/rhand/)
 * (@rhand)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/php-fatal-error-uncaught-error-call-to-undefined-function-get_plugin_data/#post-15490546)
 * [@daanvandenbergh](https://wordpress.org/support/users/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 4 years, 2 months ago by [Rhand](https://wordpress.org/support/users/rhand/).
    -  This reply was modified 4 years, 2 months ago by [Rhand](https://wordpress.org/support/users/rhand/).
 *  Plugin Author [Daan van den Bergh](https://wordpress.org/support/users/daanvandenbergh/)
 * (@daanvandenbergh)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/php-fatal-error-uncaught-error-call-to-undefined-function-get_plugin_data/#post-15490562)
 * 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 [Daan van den Bergh](https://wordpress.org/support/users/daanvandenbergh/)
 * (@daanvandenbergh)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/php-fatal-error-uncaught-error-call-to-undefined-function-get_plugin_data/#post-15490564)
 * Otherwise you can of course download it from within your ffw.press account.
 *  Thread Starter [Rhand](https://wordpress.org/support/users/rhand/)
 * (@rhand)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/php-fatal-error-uncaught-error-call-to-undefined-function-get_plugin_data/#post-15494186)
 * [@daanvandenbergh](https://wordpress.org/support/users/daanvandenbergh/) I deactivated
   old OMGF Pro by adding `-dead`to 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 4 years, 2 months ago by [Rhand](https://wordpress.org/support/users/rhand/).
 *  Thread Starter [Rhand](https://wordpress.org/support/users/rhand/)
 * (@rhand)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/php-fatal-error-uncaught-error-call-to-undefined-function-get_plugin_data/#post-15494203)
 * 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](https://wordpress.org/support/users/rhand/)
 * (@rhand)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/php-fatal-error-uncaught-error-call-to-undefined-function-get_plugin_data/#post-15494209)
 * 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 4 years, 2 months ago by [Rhand](https://wordpress.org/support/users/rhand/).
 *  Plugin Author [Daan van den Bergh](https://wordpress.org/support/users/daanvandenbergh/)
 * (@daanvandenbergh)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/php-fatal-error-uncaught-error-call-to-undefined-function-get_plugin_data/#post-15501097)
 * 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!
    -  This reply was modified 4 years, 2 months ago by [Daan van den Bergh](https://wordpress.org/support/users/daanvandenbergh/).
 *  Thread Starter [Rhand](https://wordpress.org/support/users/rhand/)
 * (@rhand)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/php-fatal-error-uncaught-error-call-to-undefined-function-get_plugin_data/#post-15522811)
 * 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](https://wordpress.org/support/users/rhand/)
 * (@rhand)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/php-fatal-error-uncaught-error-call-to-undefined-function-get_plugin_data/#post-15522812)
 * 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 [Daan van den Bergh](https://wordpress.org/support/users/daanvandenbergh/)
 * (@daanvandenbergh)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/php-fatal-error-uncaught-error-call-to-undefined-function-get_plugin_data/#post-15522860)
 * > 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](https://ffw.press/contact).
 *  Thread Starter [Rhand](https://wordpress.org/support/users/rhand/)
 * (@rhand)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/php-fatal-error-uncaught-error-call-to-undefined-function-get_plugin_data/#post-15522870)
 * This is the current url [https://dougelliscom.stage.site/](https://dougelliscom.stage.site/)
   [@daanvandenbergh](https://wordpress.org/support/users/daanvandenbergh/)
 *  Plugin Author [Daan van den Bergh](https://wordpress.org/support/users/daanvandenbergh/)
 * (@daanvandenbergh)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/php-fatal-error-uncaught-error-call-to-undefined-function-get_plugin_data/#post-15522934)
 * 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](https://wordpress.org/support/users/rhand/)
 * (@rhand)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/php-fatal-error-uncaught-error-call-to-undefined-function-get_plugin_data/#post-15522974)
 * Url is [https://dougelliscom.stage.site/wp-content/uploads/elementor/css/post-7.css?ver=1647969325](https://dougelliscom.stage.site/wp-content/uploads/elementor/css/post-7.css?ver=1647969325)

Viewing 15 replies - 1 through 15 (of 19 total)

1 [2](https://wordpress.org/support/topic/php-fatal-error-uncaught-error-call-to-undefined-function-get_plugin_data/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/php-fatal-error-uncaught-error-call-to-undefined-function-get_plugin_data/page/2/?output_format=md)

The topic ‘PHP Fatal error: Uncaught Error: Call to undefined function get_plugin_data()’
is closed to new replies.

 * ![](https://ps.w.org/host-webfonts-local/assets/icon-256x256.png?rev=3300821)
 * [OMGF | GDPR/DSGVO Compliant, Faster Google Fonts. Easy.](https://wordpress.org/plugins/host-webfonts-local/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/host-webfonts-local/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/host-webfonts-local/)
 * [Active Topics](https://wordpress.org/support/plugin/host-webfonts-local/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/host-webfonts-local/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/host-webfonts-local/reviews/)

 * 19 replies
 * 2 participants
 * Last reply from: [Daan van den Bergh](https://wordpress.org/support/users/daanvandenbergh/)
 * Last activity: [4 years, 2 months ago](https://wordpress.org/support/topic/php-fatal-error-uncaught-error-call-to-undefined-function-get_plugin_data/page/2/#post-15525014)
 * Status: resolved