Version 4.1: Cloudfare blocks the request to the feedmanager in NopCommerce 4.1 making the plugin listing page inaccessible

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
4 years ago
Looks like NopCommerce has recently implemented the CloudFare DDoS protection which is blocking the request to the feedmanager made by all the web applications running with version 4.1.
This has been reported and discussed in this thread by multiple store owners.
So, if the nop core team could please either stop this page from going through cloudflares proxy or provided the workaround then it will be great for all of the concerned store owners/developers.
And I am aware of the fix being implemented for version 4.2. I have found the work item for the request here
4 years ago
We are very sorry, but there is a problem with the plugins page in the nopCommerce 4.10. It's really depend on DDos protection. We'll try to fix this situation if it possible.

Until the problem is not resolved, you can use two options to work around this situation:

1. If you need to configure an already installed plugin, you can use the following addresses in your store:

/Admin/Payment/Methods

/Admin/Widget/List

/Admin/Tax/Providers

/Admin/Shipping/Providers


2. If you need to install a new plugin, then you will have to make changes to the source code and rebuild the project. On this case you need to replace the code of the OfficialFeedManager.GetAllPlugins method with the following
try
{
  //pageSize parameter is currently ignored by official site (set to 15)
  var xmlDoc = GetDocument("category={0}&version={1}&price={2}&pageIndex={3}&pageSize={4}&searchTerm={5}",
    categoryId, versionId, price, pageIndex, pageSize, WebUtility.UrlEncode(searchTerm));

  var list = xmlDoc.SelectNodes(@"//extensions/extension").Cast<XmlNode>().Select(node => new OfficialFeedPlugin
  {
    Name = ElText(node, @"name"),
    Url = ElText(node, @"url"),
    PictureUrl = ElText(node, @"picture"),
    Category = ElText(node, @"category"),
    SupportedVersions = ElText(node, @"versions"),
    Price = ElText(node, @"price")
  }).ToList();

  var totalRecords = int.Parse(ElText(xmlDoc.SelectNodes(@"//totalRecords")[0], @"value"));

  return new PagedList<OfficialFeedPlugin>(list, pageIndex, pageSize, totalRecords);
}
catch
{
  return new PagedList<OfficialFeedPlugin>(new List<OfficialFeedPlugin>(), pageIndex, pageSize, 0);
}
4 years ago
Hi
The fix above is not working on my site. The code in OfficialFeedManager.GetAllPlugins method is never called the site is crashed before this.

Br
Tommy
4 years ago
TCH wrote:

The fix above is not working on my site. The code in OfficialFeedManager.GetAllPlugins method is never called the site is crashed before this.

Are you sure you are getting the 503 - Service Unavailable error error and is the version of your NopCOmmerce instance 4.2? The issue you are facing may be different than this.
4 years ago
sanju.dahal741 wrote:

The fix above is not working on my site. The code in OfficialFeedManager.GetAllPlugins method is never called the site is crashed before this.

Are you sure you are getting the 503 - Service Unavailable error error and is the version of your NopCOmmerce instance 4.2? The issue you are facing may be different than this.


Hi
It´s 4.1, my 4.2 sites are running fine.
The fix is from the above post if you want to install a new plugin in 4.10.

Br
Tommy
4 years ago
Hey,

We are also facing this issue with many projects. In 4.10 projects, plugins page is getting crashed and there is no way to get it back until we upload our modified DLLs on server after commenting code.

In 4.20 it is not a big issue because local plugins page is separate and we are able to load it.

This type of code even in previous versions is not good. The problem is with GetDocument method in OfficialFeedManager.cs because WebRequest is not able to redirect 301 to new URL which has changed after new nopCommerce deployment.

Also, you should use HttpWebRequest instead of System.Net.WebRequest class.

Thank you,
Atul
4 years ago
TCH wrote:
Hi
The fix above is not working on my site. The code in OfficialFeedManager.GetAllPlugins method is never called the site is crashed before this.

Br
Tommy


You need to comment out line no.: 355 of PrepareOfficialFeedPluginSearchModel inside PreparePluginsConfigurationModel method in PluginModelFactory.cs file and nop-tab for OfficialFeed in Plugin's list view page at \Areas\Admin\Views\Plugin\List.cshtml. Just these 2 changes and it should work for your 4.1 versions.
4 years ago
sandeepnchaudhary wrote:
Hi
The fix above is not working on my site. The code in OfficialFeedManager.GetAllPlugins method is never called the site is crashed before this.

Br
Tommy

You need to comment out line no.: 355 of PrepareOfficialFeedPluginSearchModel inside PreparePluginsConfigurationModel method in PluginModelFactory.cs file and nop-tab for OfficialFeed in Plugin's list view page at \Areas\Admin\Views\Plugin\List.cshtml. Just these 2 changes and it should work for your 4.1 versions.


Thank you that did it :-)
4 years ago
Hi
we are having the same problem
4 years ago
@nopcommerce team, what is the status on a permanent fix??
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.