Kirby SEO - Serp preview field for the panel


#61

did not solve anything.


#62

Would be helpful to have the error message you get for the highlighted line?


#63

@texnixe @carstengrimm

I had the same problem when I updated to PHP 7.1 and set it to array works.

I’ve updated the repo: https://github.com/jenstornell/kirby-seo/blob/master/seo.php


#64

Hi, i just finished my install and everything works except a visual thing.
When previewing the search, if the title or text used as fallbacks contain one ’ or various ', the preview is not working.

For example with a title named "Test’ ", the plugin returns this.
Sorry for the screencap but for some reason part of the double quotes turn into this:

<div class="seo" data-seo-controller="{&quot;values&quot;:{&quot;sitename&quot;:&quot;blog name&quot;,&quot;pagename&quot;:&quot;Test" ","content":"hello"},"title":{"field":"","template":"{{pagename}}","prefix":"","suffix":"="" on="" blog="" name","backup":"{{pagename}}","fallback":"{{pagename}}","full":"{{pagename}}="" {{sitename}}","full-replaced":"test'="" name"},"description":{"field":"","template":"{{content}}","backup":"{{content}}","fallback":"{{content}}","full":"{{content}}","full-replaced":"hello","prefix":"","suffix":"","limit":155},"url":{"edit":"http:\="" \="" kirby.sites.dev\="" panel\="" pages\="" blog\="" test\="" url","preview":"kirby.sites.dev\="" test"}}'=""> 

Each ’ seems to be replaced by " which breaks the data-seo-controller attribute content. I don’t know what could create something like this so I need your help. I’m using Kirby 2.4.1.


#65

plugin broke with 2.5.0

Undefined index: scheme in file /plugins/seo/core/core.php on line 290

#66

I bet it’s related to this issue: https://github.com/getkirby/kirby/issues/588

If $page->url() is not a full url, I guess it will fail.


#67

are you gonna fix it?
we have stuck on 0.5 for so long and i implemented serp preview on a few projects and would be annoying to either revert everything or not being able to update.


#68

No. It’s not really an issue in the plugin, it was Kirby 2.5.0. Therefor a fix in the plugin would be a hack.

But you can now fix it by upgrading Kirby again or as a workaround set the site url in config.php.

Why there has been no update since 0.5 is because of this problem. I got tired of breaking my multi language site with Kirby SEO for an unknown reason.

https://github.com/getkirby/panel/issues/943

But I agree that a new version soon would be nice. The same goes for a few other of the plugins, like Revisions, Reveal etc.


#69

2.5.1 seems to work yes.


#70

I had a bit of time to come back to my initial problem. Having ’ or " in the text and title broke the Json in data-seo-controller.

Dirty/rapid fix in core.php, getvalues function:

// Get values
public static function getValues($array, $arrays) {
	if( isset( $arrays ) ) {
		foreach( $arrays as $item ) {
			foreach( $item['values'] as $key => $value ) {
				//$array['values'][$key] = (string)$value; <- original code
				$array['values'][$key] = str_replace('&quot;', "\"", str_replace("'", "&#39;", (string)$value));
			}
		}
	}
	return $array;
}

Hope it helps, thanks for the great plugin @jenstornell.


#71

Thanks! A new release for Kirby SEO is still not around the corner, sorry. But I have plans in the future for a complete rewrite and maybe your code could be useful at that point.


#72

@Thomasorus There is a pull request that fixes this problem, already waiting to be incorporated into the code. The fix is very simple - less than one line - so if you can’t wait, you can just view it in GitHub, and copy it directly into your code.

@jenstornell This is one of my most favourite plugins for Kirby. I have noticed that some pull requests have been in the queue for a while, and this makes me concerned that you might have given up on further development. Please, please tell me that this is not true! :cry:


#73

You are right, it has been a while. The reason I stopped working on it was because of a multi language Kirby bug. Maybe it has been fixed now, I have not tested it yet: Really strange behavior that makes Kirby save to wrong content file

Now there is a development going in with Kirby 3. You can buy to get more information about that with https://getkirby.com/next

I can’t tell you anything on what it will be, but the changes are so big that I need a complete rewrite of Kirby SEO, which I had already planned because of the ugly code. It might not be good news but instead of building two plugins from scratch I will wait until Kirby 3 is released and build the plugin from scratch to that version only.

If you still want some progress with the current version you can add pull requests and also write comments on each others pull requests if they work or not and I can just approve them.

Anyway, if I get the time, I should be able to start over with the new plugin before Kirby 3 but that will be to clean up the plugin core and nothing around the field itself.

I expect the new version to be released in the mid or late 2018.


#74

Very happy to hear that Kirby SEO will continue to live a long and prosperous life, @jenstornell! Thank you for your continuing work - it’s truly appreciated.

The plugin, ‘as-is’ - coupled with a couple of the fixes already submitted - is already extremely useful, and helpful in making users understand how important ‘title’ and ‘description’ are - and how to compose better ones.

I’ll certainly keep using it, and if I come across anything that I can ‘fix’, I certainly will.

Once again, thank you for your great work - it’s truly appreciated!


#75

When using this plugin, I find that the ‘Title’ field is often unnecessary in the Panel. Is there a way to totally hide the Title field - rather than just make it ‘readonly’, but still showing?


#76

You mean the panel title field? You can just remove it from the blueprint. It’s no longer required.

https://github.com/getkirby/kirby/issues/277