Plugin Directory

Changeset 3274255


Ignore:
Timestamp:
04/16/2025 07:42:00 AM (9 months ago)
Author:
Annubis
Message:

update to wp 6.8

Location:
simple-xml-sitemap-generator/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • simple-xml-sitemap-generator/trunk/index.php

    r3206771 r3274255  
    1 <?php 
     1<?php
    22/*
    33Plugin Name: Simple XML Sitemap Generator
     
    88Author URI: http://www.chefblogger.me
    99Requires at least: 3.5
    10 Tested up to: 6.7.1
     10Tested up to: 6.8
    1111Text Domain: simple-xml-sitemap-generator
    1212Domain Path: /languages
     
    1515include 'conf.php';
    1616
     17
    1718//mehrsprachigkeit
    18 function my_plugin_initsimplexmlsitemapgenerator() {
    19   load_plugin_textdomain( 'simple-xml-sitemap-generator', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
     19function my_plugin_initsimplexmlsitemapgenerator()
     20{
     21  load_plugin_textdomain('simple-xml-sitemap-generator', false, dirname(plugin_basename(__FILE__)) . '/languages');
    2022}
    2123add_action('init', 'my_plugin_initsimplexmlsitemapgenerator');
     
    2527add_filter('wp_sitemaps_enabled', '__return_false');
    2628
     29
    2730/* Coding start */
    28 function sg_create_sitemap() {
     31function sg_create_sitemap()
     32{
    2933  $postsForSitemap = get_posts(array(
    3034    'numberposts' => -1,
    3135    'orderby' => 'modified',
    32     'post_type'  => array('post','page','product'),
     36    'post_type'  => array('post', 'page', 'product'),
    3337    'order'    => 'DESC'
    3438  ));
     
    4044
    4145  $xmlpost_id = get_the_ID();
    42   $xmlpost_id_check = nl2br(get_post_meta($xmlpost_id,'sitemap',true));
     46  $xmlpost_id_check = nl2br(get_post_meta($xmlpost_id, 'sitemap', true));
    4347
    44   foreach($postsForSitemap as $post) {
     48  foreach ($postsForSitemap as $post) {
    4549    setup_postdata($post);
    4650
     
    4852
    4953    $xml_textid = $post->ID;
    50     $xml_custom_field = nl2br(get_post_meta($xml_textid,'sitemap',true));
     54    $xml_custom_field = nl2br(get_post_meta($xml_textid, 'sitemap', true));
    5155
    5256    // score wert
    53     $xml_sitemapscore = nl2br(get_post_meta($xml_textid,'sitemapscore',true));
     57    $xml_sitemapscore = nl2br(get_post_meta($xml_textid, 'sitemapscore', true));
    5458
    55     if (is_numeric($xml_sitemapscore))
    56     {
     59    if (is_numeric($xml_sitemapscore)) {
    5760      $xml_kontrolle_ob_zahl = '1';
    58     }
    59     else
    60     {
     61    } else {
    6162      $xml_kontrolle_ob_zahl = '0';
    6263    }
     
    6465
    6566
    66     if ($xml_custom_field == 'no')
    67     {
     67    if ($xml_custom_field == 'no') {
     68    } else {
    6869
     70      if ($xml_kontrolle_ob_zahl == '1') {
     71        $sitemap .= '<url>' .
     72          '<loc>' . get_permalink($post->ID) . '</loc>' .
     73          '<lastmod>' . $postdate[0] . '</lastmod>' .
     74          '<changefreq>daily</changefreq>' .
     75          '<priority>' . $xml_sitemapscore . '</priority>' .
     76          /* '<postid>'. $xml_textid . '</postid>'. */
     77          /* '<smap>'. $xml_custom_field . '</smap>'. */
     78          '</url>';
     79      } else {
     80
     81        $sitemap .= '<url>' .
     82          '<loc>' . get_permalink($post->ID) . '</loc>' .
     83          '<lastmod>' . $postdate[0] . '</lastmod>' .
     84          '<changefreq>daily</changefreq>' .
     85          '<priority>0.8</priority>' .
     86          /* '<postid>'. $xml_textid . '</postid>'. */
     87          /* '<smap>'. $xml_custom_field . '</smap>'. */
     88          '</url>';
     89      }
    6990    }
    70     else
    71     {
    72 
    73       if ($xml_kontrolle_ob_zahl == '1')
    74       {
    75         $sitemap .= '<url>'.
    76         '<loc>'. get_permalink($post->ID) .'</loc>'.
    77         '<lastmod>'. $postdate[0] . '</lastmod>'.
    78         '<changefreq>daily</changefreq>'.
    79         '<priority>'. $xml_sitemapscore . '</priority>'.
    80         /* '<postid>'. $xml_textid . '</postid>'. */
    81         /* '<smap>'. $xml_custom_field . '</smap>'. */
    82       '</url>';
    83       }
    84       else
    85       {
    86 
    87             $sitemap .= '<url>'.
    88               '<loc>'. get_permalink($post->ID) .'</loc>'.
    89               '<lastmod>'. $postdate[0] . '</lastmod>'.
    90               '<changefreq>daily</changefreq>'.
    91               '<priority>0.8</priority>'.
    92               /* '<postid>'. $xml_textid . '</postid>'. */
    93               /* '<smap>'. $xml_custom_field . '</smap>'. */
    94             '</url>';
    95       }
     91  }
    9692
    9793
     94  /* ADD WP Kategorie */
     95  $sxmlsg_kategorien_view = get_option('sxmlsg_kategorien');
     96
     97  if ($sxmlsg_kategorien_view == 'Ja') {
     98
     99    $now = time();
     100    $sxmlsg_kategorien_datum = date("Y-m-d", $now);
     101
     102    $categories = get_categories(array(
     103      'orderby' => 'name',
     104      'order'   => 'ASC'
     105    ));
     106
     107
     108    foreach ($categories as $category) {
     109
     110
     111      $sitemap .= '<url>' .
     112        '<loc>' . get_category_link($category->term_id) . '</loc>' .
     113        '<lastmod>' . $sxmlsg_kategorien_datum . '</lastmod>' .
     114        '<changefreq>daily</changefreq>' .
     115        '<priority>0.8</priority>' .
     116        '</url>';
    98117    }
    99118
    100119
    101120
    102   }
    103    
    104    
    105 /* ADD WP Kategorie */
    106 $sxmlsg_kategorien_view = get_option('sxmlsg_kategorien');
    107    
    108 if ($sxmlsg_kategorien_view == 'Ja') {
    109    
    110 $now = time();
    111 $sxmlsg_kategorien_datum = date("Y-m-d",$now); 
    112    
    113 $categories = get_categories( array(
    114     'orderby' => 'name',
    115     'order'   => 'ASC'
    116 ) );
    117  
    118    
    119 foreach( $categories as $category ) {
    120    
    121    
    122     $sitemap .= '<url>'.
    123       '<loc>'. get_category_link( $category->term_id ) .'</loc>'.
    124       '<lastmod>'. $sxmlsg_kategorien_datum .'</lastmod>'.
    125       '<changefreq>daily</changefreq>'.
    126       '<priority>0.8</priority>'.
    127     '</url>';
    128    
    129 }
    130    
    131    
    132    
    133    
    134    
    135 /* 
     121
     122
     123    /* 
    136124<url>
    137125    <loc>$sxmlsg_kategorien_link</loc>
     
    141129</url>
    142130*/
     131  }
    143132
    144133
    145    
    146 }
    147    
    148        
    149    
     134
    150135
    151136  $sitemap .= '</urlset>';
     
    158143add_action("publish_page", "sg_create_sitemap");
    159144/* Ok that's all */
    160 ?>
  • simple-xml-sitemap-generator/trunk/readme.txt

    r3206771 r3274255  
    55Version: 2.3
    66Requires at least: 3.0.1
    7 Tested up to: 6.7.1
     7Tested up to: 6.8
    88Stable tag: 2.3
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
    1111
    12 add a sitemap to your wordpress website
     12add a sitemap to your wordpress website.
    1313
    1414== Description ==
     
    6464= 2.2 =
    6565* now you can add your own sitemap priority value to posts, pages or products.
    66 
    6766= 2.1 =
    6867* now you can exclude certain posts or pages or woocommerce produts from the xml sitemap.
    69 
    7068= 2.0 =
    7169* multilingual ( engl & german) - if you whant a other language - please contact me
Note: See TracChangeset for help on using the changeset viewer.