Title: Collision with plugin Code Snippets
Last modified: June 27, 2023

---

# Collision with plugin Code Snippets

 *  Resolved [adamzatopek](https://wordpress.org/support/users/adamzatopek/)
 * (@adamzatopek)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/collision-with-plugin-code-snippets/)
 * Hello,
   when I’ve installed plugin Code Snippets by Code Snippets Pro (ver 3.4.0)
   and I have your plugin in version 5.3.4. There is colision between these plugins.
   I don’t know where is the problem. I’ve tryed disable all snippets. But only 
   what can I do is disable the plugin. Collision looks like… When i’ve tryed to
   go to example.com/sitemap.xml I have only information about Internal Server Error
   with code 500. But I’ve wanted to find something more. (I’ve disabled all filters,.
   htaccess things etc.). And I’ve used to google to find the solution, but I didn’t
   find nothing.So can you find where is the problem between your plugin and other
   plugin? Thank you very much.

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

 *  Plugin Author [Rolf Allard van Hagen](https://wordpress.org/support/users/ravanh/)
 * (@ravanh)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/collision-with-plugin-code-snippets/#post-16855466)
 * Hi Adam, thanks for reporting. I’ll try to reproduce the issue on a development
   site and let you know…
 *  Plugin Author [Rolf Allard van Hagen](https://wordpress.org/support/users/ravanh/)
 * (@ravanh)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/collision-with-plugin-code-snippets/#post-16855593)
 * UPDATE: indeed there is a fatal error occurring in the Code Snippets plugin when
   requesting a sitemap.
 *     ```wp-block-code
       [28-Jun-2023 17:35:54 UTC] PHP Fatal error:  Uncaught TypeError: Code_Snippets\Frontend::enqueue_highlighting(): Argument #1 ($posts) must be of type array, null given, called in wp-includes/class-wp-hook.php on line 310 and defined in wp-content/plugins/code-snippets/php/front-end/class-frontend.php:130
       Stack trace:
       #0 wp-includes/class-wp-hook.php(310): Code_Snippets\Frontend->enqueue_highlighting()
       #1 wp-includes/plugin.php(256): WP_Hook->apply_filters()
       #2 wp-includes/class-wp-query.php(3505): apply_filters_ref_array()
       #3 wp-includes/class-wp-query.php(3787): WP_Query->get_posts()
       #4 wp-includes/class-wp.php(663): WP_Query->query()
       #5 wp-includes/class-wp.php(783): WP->query_posts()
       #6 wp-includes/functions.php(1334): WP->main()
       #7 wp-blog-header.php(16): wp()
       #8 index.php(17): require('/home/hmkc5789/...')
       #9 {main}
         thrown in wp-content/plugins/code-snippets/php/front-end/class-frontend.php on line 130
       ```
   
 * I tried disabling the option for front-end code highlighting in the Code Snippet
   settings but that did not fix the error.
 * I’ll try to find out more by contacting the Code Snippets developers but in the
   meantime, I do not have a practical fix or work-around for you. I can only advise
   to try another code snippets plugin like WPCode or another XML sitemap plugin…:/
 *  Thread Starter [adamzatopek](https://wordpress.org/support/users/adamzatopek/)
 * (@adamzatopek)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/collision-with-plugin-code-snippets/#post-16857265)
 * Thank you very much for your quick answer. I will wait and I send it this report
   to them.
   Thank you and your plugin is good!
 *  Plugin Author [Rolf Allard van Hagen](https://wordpress.org/support/users/ravanh/)
 * (@ravanh)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/collision-with-plugin-code-snippets/#post-16858056)
 * Hi Adam, I’ve found a temporary work-around but you’ll need to modify a plugin
   file. Here are the steps to do this as safely as possible:
    1. Go to Plugins and see if XML Sitemap & Google News is the latest version 5.3.5,
       if not yet, then **upgrade** it.
    2. Next, **deactivate** the XML Sitemap & Google News plugin.
    3. Then go to **Tools > Plugin File Editor**, select “XML Sitemap & Google News”
       in the dropdown on the top right side and hit the Select button.
    4. Now, under **Plugin Files** on the right side, find and open (click) the file
       models > **functions.public-sitemap.php **
    5. On lines 545 and 551 of that file (near the bottom) you should see `add_filter('
       posts_request', '__return_false' );`
    6. Place two slashes in front of both of them so they will look like `//add_filter('
       posts_request', '__return_false' );`
    7. Hit the Update File button at the bottom.
    8. Go back to Plugins and re-activate the XML Sitemap & Google News plugin.
 * Note: If you get an error after trying to re-activate the plugin at step 7, then
   something went wrong during the modification. Just uninstall the complete plugin
   and re-install it.
 * Let me know 🙂
 *  Thread Starter [adamzatopek](https://wordpress.org/support/users/adamzatopek/)
 * (@adamzatopek)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/collision-with-plugin-code-snippets/#post-16858427)
 * Hello,
   I’ve contacted them there is a [link to topic](https://wordpress.org/support/topic/collision-with-plugin-xml-sitemap-google-news/#post-16857636)
   And they’ve fixed in next version. So everything will be okay. Thank you so much.
 *  Plugin Author [Rolf Allard van Hagen](https://wordpress.org/support/users/ravanh/)
 * (@ravanh)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/collision-with-plugin-code-snippets/#post-16858665)
 * Yes, I had the same answer. Good news 🙂

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

The topic ‘Collision with plugin Code Snippets’ is closed to new replies.

 * ![](https://ps.w.org/xml-sitemap-feed/assets/icon-128x128.png?rev=1112143)
 * [XML Sitemap & Google News](https://wordpress.org/plugins/xml-sitemap-feed/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/xml-sitemap-feed/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/xml-sitemap-feed/)
 * [Active Topics](https://wordpress.org/support/plugin/xml-sitemap-feed/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/xml-sitemap-feed/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/xml-sitemap-feed/reviews/)

## Tags

 * ["internal server error"](https://wordpress.org/support/topic-tag/internal-server-error/)
 * [Collision](https://wordpress.org/support/topic-tag/collision/)

 * 6 replies
 * 2 participants
 * Last reply from: [Rolf Allard van Hagen](https://wordpress.org/support/users/ravanh/)
 * Last activity: [2 years, 11 months ago](https://wordpress.org/support/topic/collision-with-plugin-code-snippets/#post-16858665)
 * Status: resolved