Hi All

Multiple sitemap

multiple_sitemap

Drupal Version 7.x

Git clone Branch

git clone --branch 7.x-1.x https://git.drupal.org/sandbox/Jitujain/2805199.git multiple_sitemap

Why Multiple xml sitemap

https://moz.com/blog/multiple-xml-sitemaps-increased-indexation-and-traffic

Generate multiple sitemap

This module allows you to create multiple sitemaps for your project. Sometimes we need to categorize our sitemap into the different section for better understandings.This module creates one index xml sitemap file and other as sub-files. We submit only index file to search engines.The Index file contains sub-files links.

Please review and give your suggestion.

Comments

Jitujain created an issue. See original summary.

nishantsinghal’s picture

Assigned: Unassigned » nishantsinghal
nishantsinghal’s picture

Assigned: nishantsinghal » Unassigned
jitujain’s picture

Issue summary: View changes
PA robot’s picture

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

saveva’s picture

Hello Jitendra (@jitujain).

I did a code review without installing the plugin and you have to fix a few things:

1. README.txt does not adhere to the guidelines for internal documentation
2. Your module is missing a hook_help implementation.
3. Your module includes some functions that violate the naming conventions for functions:
- function max_custom_sitemap_get_content_types_links($node_type = NULL)
- function max_custom_sitemap_get_internal_sitemap_links()
- function max_custom_sitemap_get_all_menu_links()
- etc.

All function names should start with your module name multiple_sitemap_your_function, see https://www.drupal.org/node/318#naming

Regards.

uh

jitujain’s picture

Thanks @avevas
I have fixed.

saveva’s picture

Status: Needs review » Needs work

Hi Jitujain.

Thanks. I did an installation to see what happens and there's a problem with your sitemap generation. You should not include internal Drupal tokens as references that are meant to be substituted. <nolink> should not appear. While <front> obviously gets its path alias other tokens won't. Submitting invalid value with sitemaps is not a good idea. You have to work on functions like this one: multiple_sitemap_get_menu_links.

Regards.
uh

P.S. A small update: You should include a link to the configuration in the .info file

And to help others I place here the findings according to the manual review template:

Individual user account
Yes: Follows the guidelines for individual user accounts.
No duplication
Check: Does not cause module duplication and/or fragmentation.
Master Branch
Yes: Follows the guidelines for master branch.
Licensing
Yes: Follows the licensing requirements.
3rd party assets/code
Yes: Follows the guidelines for 3rd party assets/code.
README.txt/README.md
Yes: Follows the guidelines for in-project documentation and/or the README Template.
Code long/complex enough for review
Yes: Follows the guidelines for project length and complexity.
Secure code
Should be reviewed by somebody else.
Coding style & Drupal API usage
List of identified issues in no particular order:
  1. (*) Sitemap urls need to validate better to avoid 404 Errors for sitemaps @see above in this post
  2. (+) Place configure link in .info file
  3. Display README.md or README.txt in admin/help
  4. (*) Please check if this module isn't offering what you try to implement: https://www.drupal.org/project/xmlsitemap_nodetype

The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.

jitujain’s picture

Hi Saveva

Thanks for reviewing module.

I have fixed whatever comments you did for menu links.
xmlsitemap_nodetype This module only provides the sitemap for only content types not for menu and vocabs.It has dependency on xmlsitemapmodule.It also not provide the functionality of multiple sitemap which my main moto.

Thanks!

jitujain’s picture

Status: Needs work » Needs review
saveva’s picture

Status: Needs review » Needs work

Hi @jitujain.

I've checked your code and your solution does not work at all, probably you implemented by mistake this line:

$query->condition('menu_name', $type, '<>');

But there's more to it, now you won't get paths like <front> included at all and that's a valid one. An improvement could look like this:

function multiple_sitemap_get_menu_links($menus = array()) {

  $menu_links = array();
  $i = 0;

  if (!empty($menus)) {
    foreach ($menus as $menu) {
      $type = $menu->menu_type;
      $menuvalues = menu_load_links($type);
      if (!empty($menuvalues)) {
        foreach ($menuvalues as $key => $menuvalue) {
          if (!$menuvalue['hidden']) {          
            $path = drupal_get_path_alias($menuvalue['link_path']);
            $path = url($path, array('absolute' => TRUE));
            if (!preg_match( "/(\<)(.*?)(\>)/", urldecode($path))) {            
              $menu_links[$i]['link'] = $path;
              $menu_links[$i]['priority'] = $menu->priority;
              $menu_links[$i]['changefreq'] = $menu->changefreq;
              $i++;
            }
          }
        }
      }
    }
  }
  return $menu_links;
}

Regards.
uh

jabastin arul’s picture

Please review your code on "https://pareview.sh" site. We found some issue in your code. Here I have attached the link for your error code.

https://pareview.sh/node/18

jitujain’s picture

Hi saveva

Thanks for reviewing and suggestion.
I think my code is working and i am not getting any error or mistake.By this implementation we will get all pattern type links.
For example 'node/%', '', but we not need this type of urls.So excluding for all these type url i have changed the implementation.If you will get any error please paste the error , i will look into this.

Thanks!

jitujain’s picture

Thanks Jabastin Arul

jitujain’s picture

Status: Needs work » Needs review
klausi’s picture

Category: Feature request » Bug report
Issue tags: -PAreview: review bonus

Removing review bonus tag, you have not listed any reviews in the issue summary? Make sure to read https://www.drupal.org/node/1975228 again.

klausi’s picture

Category: Bug report » Task

Oops, project applications are tasks.

visabhishek’s picture

Title: Multiple sitemap » [D7]Multiple sitemap
PA robot’s picture

Status: Needs review » Needs work

There are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpsgitdrupalorgsandboxJitujain2805199git

I'm a robot and this is an automated message from Project Applications Scraper.

PA robot’s picture

Status: Needs work » Closed (won't fix)

Closing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).

I'm a robot and this is an automated message from Project Applications Scraper.

jitujain’s picture

Status: Closed (won't fix) » Needs review
fadonascimento’s picture

Hi @Jitujain

Automatic Review
There are some issues about Drupal coding standards

Please fix it and run again the automatic review:
https://pareview.sh/node/18/repeat

Manual Review

I didn't found any issues , below are my manual review

Individual user account
[Yes: Follows / No: Does not follow] the guidelines for individual user accounts.
No duplication
[Yes: Does not cause / No: Causes] module duplication and/or fragmentation.
Master Branch
[Yes: Follows / No: Does not follow] the guidelines for master branch.
Licensing
[Yes: Follows / No: Does not follow] the licensing requirements.
3rd party assets/code
[Yes: Follows / No: Does not follow] the guidelines for 3rd party assets/code.
README.txt/README.md
[Yes: Follows / No: Does not follow] the guidelines for in-project documentation and/or the README Template.
Code long/complex enough for review
[Yes: Follows / No: Does not follow] the guidelines for project length and complexity.

Just a recommendation
I think, you should avoid concatenating strings in db queries, You can assign to variable instead of using directly.
For example in file includes/multiple_sitemap.db.inc

$query = db_select('multiple_sitemap_' . $record_type, 'ms');

Other line:

 ->fields(array(
            'target_ms_id' => $ms_target_id,
            $record_type . '_type' => $subrecord['name'],
            'priority' => $subrecord['priority'],
            'changefreq' => $subrecord['changefreq'],
          ))

It's not a blocker, just a tip.

jitujain’s picture

Thanks @fadonascimento

fadonascimento’s picture

Hi @Jitujain,

Your module is very useful, congratulations. I hope to see it as project soon.

fadonascimento’s picture

I will update the status for this issue, but I think you should consider the recommendations about Drupal coding standards.

fadonascimento’s picture

Status: Needs review » Reviewed & tested by the community
jitujain’s picture

HI @fadonascimento
Thank you very much
I have fixed Drupal coding standards after your reviewing the code. Again thanks a lot.

jitujain’s picture

Hi @klausi
All the bugs have been fixed and it is in RTBC.Please have a look.

Thanks!

avpaderno’s picture

Assigned: Unassigned » avpaderno
Status: Reviewed & tested by the community » Fixed

Thank you for your contribution!

I updated your account so you can opt into security advisory coverage now.

Here are some recommended readings to help with excellent maintainership:

You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!

Thank you, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

Thanks go the dedicated reviewer(s) as well.

avpaderno’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.