Title: &#8220;Fatal error&#8221; when using plugin
Last modified: June 7, 2023

---

# “Fatal error” when using plugin

 *  Resolved [mswarm](https://wordpress.org/support/users/mswarm/)
 * (@mswarm)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/fatal-error-when-using-plugin-2/)
 * Hi,
 * I’ve set everything up to the point of adding a map in to a form on a page but
   get a fatal error when I either try to save the page within the page editor or
   when I try to view the page directly.
 * Page URL: [Form test – Swarm](https://dev.swarm.eco/form-test/)
 * I turned on debug and can see the below error:
 *     ```wp-block-code
       Fatal error: Uncaught Error: Cannot use object of type WP_Error as array in /home/li26yuh0q757/public_html/dev.swarm.eco/wp-content/plugins/cf7-google-map/public/partials/cf7-googlemap.php:59 
       Stack trace:
        #0 /home/li26yuh0q757/public_html/dev.swarm.eco/wp-content/plugins/cf7-google-map/public/class-cf7-googlemap-public.php(196): include()
        #1 /home/li26yuh0q757/public_html/dev.swarm.eco/wp-content/plugins/contact-form-7/includes/form-tags-manager.php(551): Cf7_GoogleMap_Public->googleMap_shortcode_handler()
        #2 /home/li26yuh0q757/public_html/dev.swarm.eco/wp-content/plugins/contact-form-7/includes/form-tags-manager.php(460): WPCF7_FormTagsManager->scan_callback()
        #3 [internal function]: WPCF7_FormTagsManager->replace_callback()
        #4 /home/li26yuh0q757/public_html/dev.swarm.eco/wp-content/plugins/contact-form-7/includes/form-tags-manager.php(356): preg_replace_callback()
        #5 /home/li26yuh0q757/public_html/dev.swarm.eco/wp-content/plugins/contact-form-7/includes/form-tags-manager.php(328): WPCF7_FormTagsManager->scan()
        #6 /home/li26yuh0q757/public_html/dev.swarm.eco/wp-content/plugins/contact-form-7/includes/contact-form.php(867): WPCF7_FormTagsManager->replace_all()
        #7 /home/li26yuh0q757/public_html/dev.swarm.eco/wp-content/plugins/contact-form-7/includes/contact-form.php(933): WPCF7_ContactForm->replace_all_form_tags()
        #8 /home/li26yuh0q757/public_html/dev.swarm.eco/wp-content/plugins/contact-form-7/includes/contact-form.php(633): WPCF7_ContactForm->form_elements()
        #9 /home/li26yuh0q757/public_html/dev.swarm.eco/wp-content/plugins/contact-form-7/includes/contact-form-functions.php(235): WPCF7_ContactForm->form_html()
        #10 [internal function]: {closure}()
        #11 /home/li26yuh0q757/public_html/dev.swarm.eco/wp-content/plugins/contact-form-7/includes/l10n.php(147): call_user_func()
        #12 /home/li26yuh0q757/public_html/dev.swarm.eco/wp-content/plugins/contact-form-7/includes/contact-form-functions.php(239): wpcf7_switch_locale()
        #13 /home/li26yuh0q757/public_html/dev.swarm.eco/wp-includes/shortcodes.php(355): wpcf7_contact_form_tag_func()
        #14 [internal function]: do_shortcode_tag()
        #15 /home/li26yuh0q757/public_html/dev.swarm.eco/wp-includes/shortcodes.php(227): preg_replace_callback()
        #16 /home/li26yuh0q757/public_html/dev.swarm.eco/wp-includes/class-wp-hook.php(308): do_shortcode()
        #17 /home/li26yuh0q757/public_html/dev.swarm.eco/wp-includes/plugin.php(205): WP_Hook->apply_filters()
        #18 /home/li26yuh0q757/public_html/dev.swarm.eco/wp-includes/post-template.php(255): apply_filters()
        #19 /home/li26yuh0q757/public_html/dev.swarm.eco/wp-content/themes/understrap/loop-templates/content-page.php(28): the_content()
        #20 /home/li26yuh0q757/public_html/dev.swarm.eco/wp-includes/template.php(785): require('/home/li26yuh0q...')
        #21 /home/li26yuh0q757/public_html/dev.swarm.eco/wp-includes/template.php(718): load_template()
        #22 /home/li26yuh0q757/public_html/dev.swarm.eco/wp-includes/general-template.php(204): locate_template()
        #23 /home/li26yuh0q757/public_html/dev.swarm.eco/wp-content/themes/understrap/page.php(38): get_template_part()
        #24 /home/li26yuh0q757/public_html/dev.swarm.eco/wp-includes/template-loader.php(106): include('/home/li26yuh0q...')
        #25 /home/li26yuh0q757/public_html/dev.swarm.eco/wp-blog-header.php(19): require_once('/home/li26yuh0q...')
        #26 /home/li26yuh0q757/public_html/dev.swarm.eco/index.php(17): require('/home/li26yuh0q...')
        #27 {main} thrown in /home/li26yuh0q757/public_html/dev.swarm.eco/wp-content/plugins/cf7-google-map/public/partials/cf7-googlemap.php on line 59
       ```
   
 * When I check line 59 I see:
 *     ```wp-block-code
       require plugin_dir_path( __FILE__ ) . 'includes/class-cf7-googlemap.php';
       ```
   
 * Any idea? I’ve tried turning all other plugins off but had no luck.
   Thanks 🙂
    -  This topic was modified 2 years, 11 months ago by [mswarm](https://wordpress.org/support/users/mswarm/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ffatal-error-when-using-plugin-2%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Aurovrata Venet](https://wordpress.org/support/users/aurovrata/)
 * (@aurovrata)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/fatal-error-when-using-plugin-2/#post-16818030)
 * So the error you are getting is not related to the plugin but rather to your 
   server setup I reckon. The line on which you are getting the error reported is,
 *     ```wp-block-code
       require plugin_dir_path( __FILE__ ) . 'includes/class-cf7-googlemap.php';
       ```
   
 * it is expecting a directory path input from the function `plugin_dir_path( __FILE__)`
   and this is likely the source of the error, returning an error while accessing
   the current file details. Is it possible you have manually installed this plugin
   and its file access permissions are restricted for the PHP server process?
 *  Thread Starter [mswarm](https://wordpress.org/support/users/mswarm/)
 * (@mswarm)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/fatal-error-when-using-plugin-2/#post-16842628)
 * Hi,
 * Thanks for the reply!
 * I installed it normal way (via the WordPress dashboard), contacting my host to
   see if their setup is unusual and may be causing the error.
 * Cheers,
 *  Plugin Author [Aurovrata Venet](https://wordpress.org/support/users/aurovrata/)
 * (@aurovrata)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/fatal-error-when-using-plugin-2/#post-16883756)
 * Did you manage to resolve the issue?
 *  Thread Starter [mswarm](https://wordpress.org/support/users/mswarm/)
 * (@mswarm)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/fatal-error-when-using-plugin-2/#post-16883767)
 * Hey, I checked with our webhost, they asked me to try with different versions
   of php/some other unrelated changes. Nothing worked, but having since had other
   issues with their hosting setup its almost certainly them – moving when we find
   time.
   Thanks for your help!
 *  Plugin Author [Aurovrata Venet](https://wordpress.org/support/users/aurovrata/)
 * (@aurovrata)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/fatal-error-when-using-plugin-2/#post-16885706)
 * Ok, thanks for letting me know. What is the hosting provider you’re using? I 
   use DigitalOcean and have been very happy with them.

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

The topic ‘“Fatal error” when using plugin’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/cf7-google-map.svg)
 * [Contact Form 7 extension for Google Map fields](https://wordpress.org/plugins/cf7-google-map/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cf7-google-map/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cf7-google-map/)
 * [Active Topics](https://wordpress.org/support/plugin/cf7-google-map/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cf7-google-map/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cf7-google-map/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Aurovrata Venet](https://wordpress.org/support/users/aurovrata/)
 * Last activity: [2 years, 10 months ago](https://wordpress.org/support/topic/fatal-error-when-using-plugin-2/#post-16885706)
 * Status: resolved