Giter Site home page Giter Site logo

oddoneout / bwp-google-xml-sitemaps Goto Github PK

View Code? Open in Web Editor NEW
19.0 19.0 11.0 1.38 MB

WordPress plugin that helps generate XML Sitemaps for your website/blog.

Home Page: http://betterwp.net/wordpress-plugins/google-xml-sitemaps/

PHP 95.76% CSS 0.10% JavaScript 2.75% XSLT 1.39%

bwp-google-xml-sitemaps's People

Contributors

kminh avatar oddoneout avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

bwp-google-xml-sitemaps's Issues

XSLT stylesheet not working correctly

Check cases that might affect the stylesheet:

  • WordPress address and Site address are different
  • Https is being used

Original issue: The sitemap appears to be blank but is still actually generated correctly. This seems to occur only in Firefox, when an addon called Vimperator is active (so this is actually an invalid bug).

Git cloning plugin as a submodule, and then composer update gives the error

sudo composer update

You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug
Loading composer repositories with package information Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
- The requested package kminh/bwp-framework could not be found in any version, there may be a typo in the package name.

Potential causes:

Read https://getcomposer.org/doc/articles/troubleshooting.md for further common problems.

Query Optimization

Hello!

This isn't so much an issue as just something to think about...

For sites that have lots of posts (say over 3 million) sitemap generation get increasing slow. From what I can tell its from the LIMIT usage with an offset in the query. I was looking into a way to modify the query to remove the offset in the LIMIT clause and keep track of your place in the posts via the where clause as you cycle.

ex. WHERE ... p.ID > last post id from previous cycle...

I've been looking through the source code and it seems like that is going to be a fairly difficult optimization to make. Do you have any suggestions?

Feature request: robots.txt extras

Hi,

Quick feature request. I like the fact that bwp-google-xml-sitemaps add multisite sitemaps to robots.txt if a physical file is not there, but at the same time I need to throttle Bing.

A simple text box with a snippet to add to all virtual sitemaps would go along way.

Enable Images for custom sitemaps

Hi,
If I want to have the image tags appear in my custom sitemaps, I need to modify your xml.php file located:
/wp-content/plugins/bwp-google-xml-sitemaps/src/sitemap/xml.php

and remove both conditions checking for:
if ($this->provider->is_image_allowed())

Indeed, I did not find a way thru the admin panel to let the app know that I want images also on the custom sitemaps.

Once I remove the condition checking in xml.php it all works fine. But certainly there should be a way to do so without modifying your code.

thanks!

Load-balanced environments not supported

In SSL-terminating load-balanced environments, bwp-google-xml-sitemaps fails with the following error:

BWP Google XML Sitemaps Error: sitemapindex.xml does not have any item. Please make sure that you have at least one sitemap enabled in BWP Sitemaps >> XML Sitemaps >> Sitemaps to generate.

This is because of a discrepancy in URL scheme:

  • Initial sitemap request comes in on HTTPS.
  • Load-balancer terminates SSL and forwards request to content server over HTTP.
  • WP_HOME is set to HTTPS.
  • BWP detects difference in scheme and fails -- BWP_Sitemaps_Sitemap_Provider::is_url_valid() returns false.

I suggest removing the lines following // url must use the current scheme in bwp-google-xml-sitemaps/src/sitemap/provider/provider.php (or reverting d3b58be) to remove this restriction.

Alternate solutions:

  • Somehow make use of WordPress' set_url_scheme() to normalize URLs before comparing. We register a filter for this action in order to get WordPress to support our situation.
  • Add a hook to allow overriding.
  • Make the check optional depending on configuration.
  • Add a check to see if $_SERVER['HTTP_X_FORWARDED_PROTO'] is "https" when determining $is_ssl.

Errors on PHP log about database

Hello, I have these errors on log every day:

[17-Jan-2018 19:09:00 UTC] WordPress database error Lock wait timeout exceeded; try restarting transaction for query UPDATE wp_optionsSEToption_value= 'a:2:{s:8:\"messages\";a:25:{i:0;a:3:{s:7:\"message\";s:67:\"Pinged <em>Google</em> with <em>sitemapindex.xml</em> successfully!\";s:4:\"type\";s:7:\"success\";s:8:\"datetime\";s:19:\"2018-01-17 15:07:42\";}i:1;a:3:{s:7:\"message\";s:65:\"Pinged <em>Bing</em> with <em>sitemapindex.xml</em> successfully!\";s:4:\"type\";s:7:\"success\";s:8:\"datetime\";s:19:\"2018-01-17 15:07:42\";}i:2;a:3:{s:7:\"message\";s:66:\"Successfully served a cached version of <em>sitemapindex.xml</em>.\";s:4:\"type\";s:7:\"success\";s:8:\"datetime\";s:19:\"2018-01-17 15:07:43\";}i:3;a:3:{s:7:\"message\";s:67:\"Pinged <em>Google</em> with <em>sitemapindex.xml</em> successfully!\";s:4:\"type\";s:7:\"success\";s:8:\"datetime\";s:19:\"2018-01-17 16:00:05\";}i:4;a:3:{s:7:\"message\";s:65:\"Pinged <em>Bing</em> with <em>sitemapindex.xml</em> successfully!\";s:4:\"type\";s:7:\"success\";s:8:\"datetime\";s:19:\"2018-01-17 16:00:05\";}i:5;a:3:{s:7:\"message\";s:66:\"Successfully served a cached version of <em>sitemapindex.xml</em>.\";s:4:\"type\";s:7:\"success\";s:8:\"datetime\";s:19:\"2018-01-17 16:00:05\";}i:6;a:3:{s:7:\"message\";s:77:\"Successfully generated <em>site.xml</em> using module file <em>site.php</em>.\";s:4:\"type\";s:7:\"success\";s:8:\"datetime\";s:19:\"2018-01-17 16:44:58\";}i:7;a:3:{s:7:\"message\";s:67:\"Pinged <em>Google</em> with <em>sitemapindex.xml</em> successfully!\";s:4:\"type\";s:7:\"success\";s:8:\"datetime\";s:19:\"2018-01-17 17:02:03\";}i:8;a:3:{s:7:\"message\";s:65:\"Pinged <em>Bing</em> with <em>sitemapindex.xml</em> successfully!\";s:4:\"type\";s:7:\"success\";s:8:\"datetime\";s:19:\"2018-01-17 17:02:03\";}i:9;a:3:{s:7:\"message\";s:66:\"Successfully served a cached version of <em>sitemapindex.xml</em>.\";s:4:\"type\";s:7:\"success\";s:8:\"datetime\";s:19:\"2018-01-17 17:02:04\";}i:10;a:3:{s:7:\"message\";s:93:\"Successfully generated <em>sitemapindex.xml</em> using module file <em>sitemapindex.php</em>.\";s:4:\"type\";s:7:\"success\";s:8:\"datetime\";s:19:\"2018-01-17 17:09:55\";}i:11;a:3:{s:7:\"message\";s:66:\"Successfully served a cached version of <em>sitemapindex.xml</em>.\";s:4:\"type\";s:7:\"success\";s:8:\"datetime\";s:19:\"2018-01-17 17:10:08\";}i:12;a:3:{s:7:\"message\";s:66:\"Successfully served a cached version of <em>sitemapindex.xml</em>.\";s:4:\"type\";s:7:\"success\";s:8:\"datetime\";s:19:\"2018-01-17 17:10:09\";}i:13;a:3:{s:7:\"message\";s:67:\"Pinged <em>Google</em> with <em>sitemapindex.xml</em> successfully!\";s:4:\"type\";s:7:\"success\";s:8:\"datetime\";s:19:\"2018-01-17 19:00:07\";}i:14;a:3:{s:7:\"message\";s:65:\"Pinged <em>Bing</em> with <em>sitemapindex.xml</em> successfully!\";s:4:\"type\";s:7:\"success\";s:8:\"datetime\";s:19:\"2018-01-17 19:00:07\";}i:15;a:3:{s:7:\"message\";s:67:\"Pinged <em>Google</em> with <em>sitemapindex.xml</em> successfully!\";s:4:\"type\";s:7:\"success\";s:8:\"datetime\";s:19:\"2018-01-17 19:00:10\";}i:16;a:3:{s:7:\"message\";s:65:\"Pinged <em>Bing</em> with <em>sitemapindex.xml</em> successfully!\";s:4:\"type\";s:7:\"success\";s:8:\"datetime\";s:19:\"2018-01-17 19:00:10\";}i:17;a:3:{s:7:\"message\";s:67:\"Pinged <em>Google</em> with <em>sitemapindex.xml</em> successfully!\";s:4:\"type\";s:7:\"success\";s:8:\"datetime\";s:19:\"2018-01-17 19:00:13\";}i:18;a:3:{s:7:\"message\";s:65:\"Pinged <em>Bing</em> with <em>sitemapindex.xml</em> successfully!\";s:4:\"type\";s:7:\"success\";s:8:\"datetime\";s:19:\"2018-01-17 19:00:13\";}i:19;a:3:{s:7:\"message\";s:67:\"Pinged <em>Google</em> with <em>sitemapindex.xml</em> successfully!\";s:4:\"type\";s:7:\"success\";s:8:\"datetime\";s:19:\"2018-01-17 19:00:15\";}i:20;a:3:{s:7:\"message\";s:65:\"Pinged <em>Bing</em> with <em>sitemapindex.xml</em> successfully!\";s:4:\"type\";s:7:\"success\";s:8:\"datetime\";s:19:\"2018-01-17 19:00:15\";}i:21;a:3:{s:7:\"message\";s:67:\"Pinged <em>Google</em> with <em>sitemapindex.xml</em> successfully!\";s:4:\"type\";s:7:\"success\";s:8:\"datetime\";s:19:\"2018-01-17 19:00:21\";}i:22;a:3:{s:7:\"message\";s:65:\"Pinged <em>Bing</em> with <em>sitemapindex.xml</em> successfully!\";s:4:\"type\";s:7:\"success\";s:8:\"datetime\";s:19:\"2018-01-17 19:00:21\";}i:23;a:3:{s:7:\"message\";s:66:\"Successfully served a cached version of <em>sitemapindex.xml</em>.\";s:4:\"type\";s:7:\"success\";s:8:\"datetime\";s:19:\"2018-01-17 19:00:22\";}i:24;a:3:{s:7:\"message\";s:66:\"Successfully served a cached version of <em>sitemapindex.xml</em>.\";s:4:\"type\";s:7:\"success\";s:8:\"datetime\";s:19:\"2018-01-17 19:08:09\";}}s:8:\"sitemaps\";a:7:{i:0;a:2:{s:4:\"slug\";s:12:\"sitemapindex\";s:8:\"datetime\";s:19:\"2018-01-17 17:09:55\";}i:1;a:2:{s:4:\"slug\";s:4:\"site\";s:8:\"datetime\";s:19:\"2018-01-17 16:44:58\";}i:2;a:2:{s:4:\"slug\";s:4:\"page\";s:8:\"datetime\";s:19:\"2018-01-16 15:25:39\";}i:3;a:2:{s:4:\"slug\";s:10:\"post_part3\";s:8:\"datetime\";s:19:\"2018-01-17 11:26:39\";}i:4;a:2:{s:4:\"slug\";s:10:\"post_part1\";s:8:\"datetime\";s:19:\"2018-01-17 13:34:16\";}i:5;a:2:{s:4:\"slug\";s:10:\"post_part2\";s:8:\"datetime\";s:19:\"2018-01-17 04:48:24\";}i:6;a:2:{s:4:\"slug\";s:10:\"post_part4\";s:8:\"datetime\";s:19:\"2018-01-17 04:46:54\";}}}' WHEREoption_name = 'bwp_gxs_log' fatta da require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array, WP_Hook->do_action, WP_Hook->apply_filters, BWP_Sitemaps->request_sitemap, BWP_Sitemaps->_load_sitemap_module, BWP_Sitemaps->_load_sitemap_from_cache, BWP_Sitemaps->commit_logs, BWP_WP_Bridge->__call, update_option

so, is it related to pinging ? and what shoud I do?

Thanks

Improve support for cache plugins

Some possible improvements:

  • Auto adding exclusion rules to cache plugins' settings
  • Auto flushing when cache plugins flush the cache
  • ...

Make it more obvious to manually generate sitemap

  • Refactor logging functionality
  • Show all sitemaps under "BWP Sitemaps > XML Sitemaps > Your Sitemaps" instead of just generated sitemaps with a "Last generated on" column. (move to 2.0.0)
  • Show a button to generate the sitemapindex when no sitemap has been generated yet, under Generated Sitemaps. Move the "Clear All Logs" button to "Sitemap Stats" and allow it to clear generator's log only, keeping all sitemap logs.

PHP Warning Strict: Declaration of BWP_GXS_MODULE_INDEX::build_data() should be compatible with that of BWP_GXS_MODULE::build_data()

The declaration of BWP_GXS_MODULE_INDEX::build_data() doesn't match BWP_GXS_MODULE::build_data().

URL: http://example.co.uk/sitemapindex.xml
Referrer: http://example.co.uk/wp-admin/options-general.php?page=bwp_gxs_stats
Error(E_STRICT): Declaration of BWP_GXS_MODULE_INDEX::build_data() should be compatible with that of BWP_GXS_MODULE::build_data()
Source: /var/sites/g/example.co.uk/public_html/wp-content/plugins/bwp-google-xml-sitemaps/includes/modules/sitemapindex.php [162]

Trace:
#1 /var/sites/g/example.co.uk/public_html/index.php:17 - require('/var/si...')
#2 /var/sites/g/example.co.uk/public_html/wp-blog-header.php:14 - wp()
#3 /var/sites/g/example.co.uk/public_html/wp-includes/functions.php:775 - WP->main('')
#4 /var/sites/g/example.co.uk/public_html/wp-includes/class-wp.php:522 - WP->parse_request('')
#5 /var/sites/g/example.co.uk/public_html/wp-includes/class-wp.php:307 - do_action_ref_array('parse_r...', Array)
#6 /var/sites/g/example.co.uk/public_html/wp-includes/plugin.php:484 - call_user_func_array(Array, Array)
#7 [internal call] - BWP_SIMPLE_GXS->request_sitemap(WP)
#8 /var/sites/g/example.co.uk/public_html/wp-content/plugins/bwp-google-xml-sitemaps/includes/class-bwp-simple-gxs.php:1246 - BWP_SIMPLE_GXS->load_module('sitemap...', '')
#9 /var/sites/g/example.co.uk/public_html/wp-content/plugins/bwp-google-xml-sitemaps/includes/class-bwp-simple-gxs.php:1449 - BWP_SIMPLE_GXS::load_module()

WordPress 3.5.1
PHP 5.3.10
Better WordPress Google XML Sitemaps Plugin 1.2.1

Split Google News sitemap (to allow more than 1000 posts)

Currently only one news sitemap is generated and is limited to 1000 posts (correct, as google suggests).
So, if you have more than a 1000 posts in the last 48 hours they are ignored.

It should be also splited to parts as the normal post sitemap is.

Doesn't check for message_logger to exist before logging

Got this fatal error:

[15-Feb-2017 14:12:52 UTC] PHP Fatal error:  Uncaught Error: Call to a member function log() on null in PATH_HERE/plugins/bwp-google-xml-sitemaps/src/class-bwp-gxs.php:2545
Stack trace:
#0 PATH_HERE/plugins/bwp-google-xml-sitemaps/src/class-bwp-gxs.php(2573): BWP_Sitemaps->_log_message_item('Pinged <em>Goog...', 'success')
#1 PATH_HERE/plugins/bwp-google-xml-sitemaps/src/class-bwp-gxs.php(2603): BWP_Sitemaps->log_message('Pinged <em>Goog...', 'success')
#2 PATH_HERE/plugins/bwp-google-xml-sitemaps/src/class-bwp-gxs.php(3961): BWP_Sitemaps->log_success('Pinged <em>Goog...')
#3 /srv/users/serverpilot/apps/veracruzanos/public/wp-includes/class-wp-hook.php(298): BWP_Sitemaps->ping(Object(WP_Post))
#4 /srv/users/serverpilot/apps/veracruzanos/public/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters('', Array)
#5 /srv/users/serverpilot/apps/veracruzanos/publi in PATH_HERE/plugins/bwp-google-xml-sitemaps/src/class-bwp-gxs.php on line 2545

In function _log_message_item there's a call to an object before checking it exists:

$this->message_logger->log($item);

maybe this could prevent the error? (I haven't tested)

if(isset($this->message_logger))
    $this->message_logger->log($item);

how to avoid filter_sitemap_item for external page ( provider.php )

hello.

external page is intented for external url, so it should be avoid "filter_sitemap_item"
( /bwp-google-xml-sitemaps/src/sitemap/provider/provider.php )

usually, external page must be not working this version.

but i have solution.

provider.php <--

public function get_items()
{
	if( $this->module->requested == 'external' ){
		return	$this->module->get_data();
	} else {
		return array_values(
			array_filter(
				$this->module->get_data(),
				array($this, 'filter_sitemap_item')
			)
		);
	}
}

i hope version upgrade include my source.

Ability to include/exclude sitemap items in admin pages

Add featured image to the Google News Sitemap

Hi,
Google News allow to specify image in the Sitemap because sometimes happen that the indexed article has wrong image. In my case the images linked to the article in Google News are the author's avatars.

In this article Google suggest to introduce "images" tag before the "" tag for solving the problem.

http://support.google.com/news/publisher/bin/answer.py?hl=en&answer=185541

I modify your plugin for supporting this feature and the result is this:

http://www.capn3m0.org/post_google_news.xml

Thanks if this "little patch" will be included in the next revision.

Here my modded version

http://www.capn3m0.org/files/bwp-google-xml-sitemaps.zip

and the post about this fix:

http://www.capn3m0.org/fix-immagini-nella-sitemap-google-news.html

Br

capn3m0

Related:

Solves:

Add support for multilang plugin

Splitting sitemaps resulting in empty part.

Hi,

I've enabled the 'split post based sitemaps' feature on a large site (6000+ posts). I'm finding that the last sitemap generated is always empty, in this case when using a 1000 split limit post_part6.xml is empty. This results in google webmaster tools not being able to validate the sitemapindex. I've tried changing the split limits but the same issue occurs. No errors appear in the sitemap logs but the following appears when trying to view the last sitemap:

BWP Google XML Sitemaps Error: post_part3.xml does not have any item. There are no public Post. Enable/disable sitemaps via BWP Sitemaps >> XML Sitemaps.

Thanks

Suggestions for documentation Custom Modules

Hi,
I followed your documentation carefully and was successful in creating custom modules but here 2 suggestions:

  • your folder structure has changed since you wrote the docs. The modules folder has changed location
  • you don't really explain the full steps on how to create a parent custom module: I tried and failed. So I went with a child of post.
  • it was not obvious for me that you had to refresh the cache after creating a custom module.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.