Post by leeburgess » Sat Aug 04, 2018 3:38 pm

Oc 3.0.2.0

Error in Google sitemap
When running it says

This page contains the following errors:
error on line 1 at column 14: Extra content at the end of the document
Below is a rendering of the page up to the first error.

How do I resolve this please?

New member

Posts

Joined
Sat Sep 16, 2017 3:19 am

Post by straightlight » Sat Aug 04, 2018 8:25 pm

URL / route name unprovided. Forum rules.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Opencart.com Administrator / Quality Assurance Analyst / Programmer


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by leeburgess » Sat Aug 04, 2018 8:34 pm

index.php?route=extension/feed/google_sitemap

New member

Posts

Joined
Sat Sep 16, 2017 3:19 am

Post by straightlight » Sun Aug 05, 2018 5:14 am


The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Opencart.com Administrator / Quality Assurance Analyst / Programmer


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by leeburgess » Sun Aug 05, 2018 5:14 am

Just me with this error then?

New member

Posts

Joined
Sat Sep 16, 2017 3:19 am

Post by straightlight » Sun Aug 05, 2018 5:42 am

No … if a prior solution has been provided and pointed out on another topic, it is not necessarily because you are the only one encountering this issue.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Opencart.com Administrator / Quality Assurance Analyst / Programmer


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by leeburgess » Sun Aug 05, 2018 7:46 pm

Done the above and still the same.

New member

Posts

Joined
Sat Sep 16, 2017 3:19 am

Post by straightlight » Sun Aug 05, 2018 8:49 pm

Error / Server access logs?

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Opencart.com Administrator / Quality Assurance Analyst / Programmer


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by leeburgess » Mon Aug 06, 2018 1:10 am

I did :) error says
This page contains the following errors:
error on line 1 at column 14: Extra content at the end of the document
Below is a rendering of the page up to the first error.
Notice
straightlight wrote:
Sun Aug 05, 2018 8:49 pm
Error / Server access logs?

New member

Posts

Joined
Sat Sep 16, 2017 3:19 am

Post by leeburgess » Mon Aug 06, 2018 1:16 am

In error logs I have
2018-08-05 17:12:48 - PHP Notice: getimagesize(): Read error! in /home/******/public_html/catalog/model/tool/image.php on line 14

New member

Posts

Joined
Sat Sep 16, 2017 3:19 am

Post by straightlight » Mon Aug 06, 2018 1:18 am

See this post: viewtopic.php?t=149445 . The issue you are encountering has nothing to do with google sitemap. However, the provided solution prior is also a patch for the XML output aside from your enquiry in this case.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Opencart.com Administrator / Quality Assurance Analyst / Programmer


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by leeburgess » Mon Aug 06, 2018 3:15 am

Thank you :) how can I find the missing image as have over 5000 products.
straightlight wrote:
Mon Aug 06, 2018 1:18 am
See this post: viewtopic.php?t=149445 . The issue you are encountering has nothing to do with google sitemap. However, the provided solution prior is also a patch for the XML output aside from your enquiry in this case.

New member

Posts

Joined
Sat Sep 16, 2017 3:19 am

Post by straightlight » Mon Aug 06, 2018 3:25 am

You can always submit a new service request to get this done as a custom job due to high quantity of images.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Opencart.com Administrator / Quality Assurance Analyst / Programmer


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by paulfeakins » Mon Aug 06, 2018 6:15 pm

leeburgess wrote:
Mon Aug 06, 2018 3:15 am
how can I find the missing image as have over 5000 products
If you'd like to get in touch I think we have a similar script somewhere, or post on the Commercial Support forum.

For quick, professional OpenCart support please email info@antropy.co.uk


User avatar
Expert Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - Reigate, Surrey, United Kingdom

Post by straightlight » Mon Aug 06, 2018 9:19 pm

A little tweak I found when resizing new images from now on. Let's see if this baby tool will work nicely. In system/library/image.php file,

find:

Code: Select all

if ($this->mime == 'image/gif') {
				$this->image = imagecreatefromgif($file);
			} elseif ($this->mime == 'image/png') {
				$this->image = imagecreatefrompng($file);
			} elseif ($this->mime == 'image/jpeg') {
				$this->image = imagecreatefromjpeg($file);
			}
add below:

Code: Select all

$ext = strtolower(pathinfo($file, PATHINFO_EXTENSION));
			
			if ($ext === 'jpg') {
				$ext = 'jpeg';
			}
			
			$gd_function = 'imagecreatefrom' . $ext;
			
			if (function_exists($gd_function) && @$gd_function($file) === FALSE) {
				$log = new Log('error.log');
				
				$log->write('Error: Bad image file: ' . $file . ' ' . $gd_function . '!');
			}
This will output the resized image errors in the admin - > systems - > maintenance - > error logs page. :)

Source: https://stackoverflow.com/questions/993 ... -or-broken

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Opencart.com Administrator / Quality Assurance Analyst / Programmer


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by straightlight » Mon Aug 06, 2018 9:22 pm

Minor code fixed on the above.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Opencart.com Administrator / Quality Assurance Analyst / Programmer


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by straightlight » Mon Aug 06, 2018 11:07 pm

Another way to do this would be from the catalog/model/tool/image.php file,

find:

Code: Select all

$image_new = str_replace(' ', '%20', $image_new);  // fix bug when attach image on email (gmail.com). it is automatic changing space " " to +
add above:

Code: Select all

if ($this->getBadGDImage(DIR_IMAGE, $image_new)) {
			$this->log->write('Error: Bad image file: ' . htmlspecialchars_decode(DIR_IMAGE . $image_new));
		}
Then, at the bottom of the file,

replace:

Code: Select all

    }
}
with:

Code: Select all

protected function getBadGDImage($path, $image) {
		$results = array();
		
		$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path));

		$allFiles = array_filter(iterator_to_array($iterator), function($file) {
			return $file->isFile();
		});

		foreach ($allFiles as $key => $files) {
			$key = str_replace('\\', '/', $key);
			
			$path_exploded = explode('/', trim($key));
			
			if (strstr($path_exploded[sizeof($path_exploded)- 1], '.')) {
				$mime_type = mime_content_type($key);
				
				$file = $path_exploded[sizeof($path_exploded) - 1];
				
				$path_defined = sizeof($path_exploded) - 1;
				
				$path_slice = array_slice($path_exploded, 0, $path_defined);
				
				$location = implode('/', $path_slice);
				
				if ($location == $path && $file == $image) {
					switch ($mime_type) {
						case "image/jpg":
						case "image/jpeg":
							$im = imagecreatefromjpeg($location . '/' . $file);
							break;
						case "image/png":
							$im = imagecreatefrompng($location . '/' . $file);
							break;
						case "image/gif":
							$im = imagecreatefromgif($location . '/' . $file);
							break;
					}
						
					if (!$im) {
						$results[] = array('location'				=> $location,
										   'file'					=> $file,
										  );
					}
				}
			}
		}
		
		return (array)$results;
	}
}
As for the admin/model/tool/image.php file,

find:

Code: Select all

if ($this->request->server['HTTPS']) {
follow the previous steps above from the catalog/model/tool/image.php steps. This should work as intended.

This should also output the bad images to the OC logs.

Same source (and re-worked).

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Opencart.com Administrator / Quality Assurance Analyst / Programmer


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by leeburgess » Thu Aug 01, 2019 8:43 pm

Sadly cannot get this to work

New member

Posts

Joined
Sat Sep 16, 2017 3:19 am

Post by straightlight » Fri Aug 02, 2019 6:58 pm

leeburgess wrote:
Thu Aug 01, 2019 8:43 pm
Sadly cannot get this to work
No details provided. Forum rules.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Opencart.com Administrator / Quality Assurance Analyst / Programmer


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by leeburgess » Fri Aug 02, 2019 9:46 pm

straightlight wrote:
Fri Aug 02, 2019 6:58 pm
leeburgess wrote:
Thu Aug 01, 2019 8:43 pm
Sadly cannot get this to work
No details provided. Forum rules.
I have no corrupt images now but Google sitemap says

This page contains the following errors:
error on line 1 at column 14: Extra content at the end of the document
Below is a rendering of the page up to the first error.

New member

Posts

Joined
Sat Sep 16, 2017 3:19 am
Who is online

Users browsing this forum: No registered users and 19 guests