• Resolved adamzatopek

    (@adamzatopek)


    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)
  • Hi Adam, thanks for reporting. I’ll try to reproduce the issue on a development site and let you know…

    UPDATE: indeed there is a fatal error occurring in the Code Snippets plugin when requesting a sitemap.

    [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

    (@adamzatopek)

    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!

    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

    (@adamzatopek)

    Hello,
    I’ve contacted them there is a link to topic
    And they’ve fixed in next version. So everything will be okay.
    Thank you so much.

    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.