Title: Fatal error in plugin
Last modified: April 22, 2022

---

# Fatal error in plugin

 *  Resolved [pend00](https://wordpress.org/support/users/pend00/)
 * (@pend00)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/fatal-error-in-plugin-3/)
 * Hi!
    Recently (not sure if it’s after the latest update or anything else) the
   plugin crashes the post-page it’s in. I’m getting this error `Fatal error: Uncaught
   ArgumentCountError: Too few arguments to function crp_exclude_post_ids(), 2 passed
   in /var/www/godotshaders.com/public_html/wp-includes/class-wp-hook.php on line
   307 and exactly 3 expected in /var/www/godotshaders.com/public_html/wp-content/
   plugins/contextual-related-posts/includes/modules/exclusions.php:23 Stack trace:#
   0 /var/www/godotshaders.com/public_html/wp-includes/class-wp-hook.php(307): crp_exclude_post_ids(
   Array, Array) #1 /var/www/godotshaders.com/public_html/wp-includes/plugin.php(
   189): WP_Hook->apply_filters(Array, Array) #2 /var/www/godotshaders.com/public_html/
   wp-content/plugins/contextual-related-posts/includes/main-query.php(428): apply_filters('
   crp_exclude_pos...', Array, Array) #3 /var/www/godotshaders.com/public_html/wp-
   content/plugins/code-snippets/php/snippet-ops.php(469) : eval()'d code(22): get_crp_posts_id(
   Array) #4 /var/www/godotshaders.com/public_html/wp-includes/class-wp-hook.php(
   307): related_shaders_after_shader('') #5 /var/www/godotshaders.com/public_html/
   wp-includes/cl in /var/www/godotshaders.com/public_html/wp-content/plugins/contextual-
   related-posts/includes/modules/exclusions.php on line 23`
 * Any idea what this might be?

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

 *  Plugin Author [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/fatal-error-in-plugin-3/#post-15581603)
 * [@pend00](https://wordpress.org/support/users/pend00/)
 * I think this is because of the old implementation of get_crp_posts_id in your
   snippet.
 * Can you paste here what that snippet is?
 * Also, in the snippet if you replace that with get_crp_posts, does it work?
 *  [cowshase](https://wordpress.org/support/users/cowshase/)
 * (@cowshase)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/fatal-error-in-plugin-3/#post-15582044)
 * This is a bug in the plugin. In line 428 of main-query.php, change
 *  `$exclude_post_ids = apply_filters( 'crp_exclude_post_ids', $exclude_post_ids,
   $args );`
 * to
 *  `$exclude_post_ids = apply_filters( 'crp_exclude_post_ids', $exclude_post_ids,
   $args, $source_post );`
 *  Plugin Author [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/fatal-error-in-plugin-3/#post-15582482)
 * [@cowshase](https://wordpress.org/support/users/cowshase/)
 * I’ll fix this in the next version, but I will also be deprecating crp_get_posts_id
 *  Plugin Author [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/fatal-error-in-plugin-3/#post-15582603)
 * I’ve released a beta version which should fix this error.
 * [https://github.com/WebberZone/contextual-related-posts/releases/tag/v3.2.1-beta1](https://github.com/WebberZone/contextual-related-posts/releases/tag/v3.2.1-beta1)
 *  Plugin Author [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/fatal-error-in-plugin-3/#post-15583972)
 * I’ve pushed through v3.2.1
 *  Thread Starter [pend00](https://wordpress.org/support/users/pend00/)
 * (@pend00)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/fatal-error-in-plugin-3/#post-15584283)
 * [@ajay](https://wordpress.org/support/users/ajay/) I’ve changed `get_crp_posts_id`
   to `get_crp_posts` and updated the plugin and everything works as expected now.
   Thank you!
 *  Plugin Author [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/fatal-error-in-plugin-3/#post-15584842)
 * [@pend00](https://wordpress.org/support/users/pend00/)
 * Thank you for confirming

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

The topic ‘Fatal error in plugin’ is closed to new replies.

 * ![](https://ps.w.org/contextual-related-posts/assets/icon-256x256.png?rev=2985705)
 * [Contextual Related Posts](https://wordpress.org/plugins/contextual-related-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contextual-related-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contextual-related-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/contextual-related-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contextual-related-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contextual-related-posts/reviews/)

 * 7 replies
 * 3 participants
 * Last reply from: [Ajay](https://wordpress.org/support/users/ajay/)
 * Last activity: [4 years, 1 month ago](https://wordpress.org/support/topic/fatal-error-in-plugin-3/#post-15584842)
 * Status: resolved