Jump to content
Nico Knoll

MarkupSEO - The all-in-one SEO solution for ProcessWire.

Recommended Posts

I'm pretty sure MarkupSEO is causing issues when viewing form results generated by FormBuilder.

I posted the issue in the Form Builder Support but in case anyone isn't a member (VIP forum), here's the details.

Error on viewing FormBuilder entries

Error: Exception: Unknown Selector operator: '' -- was your selector value properly escaped? (in /home/sites/pretendy-url.com/public_html/wire/core/Selectors.php line 247)

#0 /home/sites/pretendy-url.com/public_html/wire/core/Selectors.php(284): Selectors->create('1.2', '', '')
#1 /home/sites/pretendy-url.com/public_html/wire/core/Selectors.php(81): Selectors->extractString('1.2')
#2 /home/sites/pretendy-url.com/public_html/wire/core/Pages.php(165): Selectors->__construct('1.2')
#3 [internal function]: Pages->___find('1.2', Array)
#4 /home/sites/pretendy-url.com/public_html/wire/core/Wire.php(389): call_user_func_array(Array, Array)
#5 /home/sites/pretendy-url.com/public_html/wire/core/Wire.php(344): Wire->runHooks('find', Array)
#6 /home/sites/pretendy-url.com/public_html/wire/core/Pages.php(260): Wire->__call('find', Array)
#7 /home/sites/pretendy-url.com/public_html/wire/core/Pages.php(260): Pages->find('1.2', Array)
#8 /home/sites/pretend
This error message was shown because you are logged in as a Superuser. Error has been logged. 

Ryan's suggestion

Peter, I've looked at the site with the info you provided and was able to duplicate it there. But importing the form locally and testing here, I can't duplicate it. Unfortunately the debug backtrace error message we've got is truncated for some reason, so we can't see the full picture or pin it to a specific module. However, we can see that the exception is coming from a $pages->find("1.2"); operation. Since I can't duplicate it locally, and because FormBuilder doesn't do any $pages->find(), it's very likely that one of the other modules you've got installed (under Site) is monitoring the "id" property in the URL, thinking it's a page ID. If you can, I would start uninstalling modules one by one and testing your Entries screen, to determine which module it is. It's no doubt got to be an "autoload" module. If I can get FTP or SSH access to the server, I could track it down for you by doing a grep on the site modules directory. 

Uninstalling MarkupSEO makes the FB entries viewable again.

  • Like 1

Share this post


Link to post
Share on other sites

@Nico

Any updates planned to fix the problem when FormBuilder is installed?

I can just uninstall MarkupSEO for the mo but it's a great module. Would love to have it functioning  :rolleyes:

Share this post


Link to post
Share on other sites

I'am trying to validate html5 and get errors on metatags. Is there a solution for this? 

Bad value og:site_name for attribute name on element meta: Keyword og:site_name is not registered. 

Share this post


Link to post
Share on other sites

Could you add this as an issue on github? And what site_name have you defined in the module's settings?

Share this post


Link to post
Share on other sites

@ Nico:

I did some research for validation. Found a solution for html5 tags. Could you take a look at this please?

http://help.simplytestable.com/errors/html-validation/bad-value-w-for-attribute-x-on-element-y-z/bad-value-twittertitle-for-attribute-name-on-element-meta-keyword-twittertitle-is-not-registered/

Swap the name attribute for an otherwise-identical property attribute to create valid syntax

Share this post


Link to post
Share on other sites

I'm pretty sure MarkupSEO is causing issues when viewing form results generated by FormBuilder.

I posted the issue in the Form Builder Support but in case anyone isn't a member (VIP forum), here's the details.

Error on viewing FormBuilder entries

Error: Exception: Unknown Selector operator: '' -- was your selector value properly escaped? (in /home/sites/pretendy-url.com/public_html/wire/core/Selectors.php line 247)

#0 /home/sites/pretendy-url.com/public_html/wire/core/Selectors.php(284): Selectors->create('1.2', '', '')
#1 /home/sites/pretendy-url.com/public_html/wire/core/Selectors.php(81): Selectors->extractString('1.2')
#2 /home/sites/pretendy-url.com/public_html/wire/core/Pages.php(165): Selectors->__construct('1.2')
#3 [internal function]: Pages->___find('1.2', Array)
#4 /home/sites/pretendy-url.com/public_html/wire/core/Wire.php(389): call_user_func_array(Array, Array)
#5 /home/sites/pretendy-url.com/public_html/wire/core/Wire.php(344): Wire->runHooks('find', Array)
#6 /home/sites/pretendy-url.com/public_html/wire/core/Pages.php(260): Wire->__call('find', Array)
#7 /home/sites/pretendy-url.com/public_html/wire/core/Pages.php(260): Pages->find('1.2', Array)
#8 /home/sites/pretend
This error message was shown because you are logged in as a Superuser. Error has been logged. 

Ryan's suggestion

Uninstalling MarkupSEO makes the FB entries viewable again.

I had the same issue with ProcessDatabaseBackups. See the related github issue: https://github.com/NicoKnoll/MarkupSEO/issues/4

Share this post


Link to post
Share on other sites

Nice module :)

It looks like Piwik isn't integrated yet?

Will you write some more documentation and usage tips to the readme file and / or the descriptions?

Share this post


Link to post
Share on other sites

@ Joss: Thx, but validation is now ok!

I changed this line in MarkupSEO.module

$rendered .= '<meta name="'.$name.'" content="'.$content.'">'."\n\r";

into

$rendered .= '<meta property="'.$name.'" content="'.$content.'">'."\n\r";

  • Like 1

Share this post


Link to post
Share on other sites

So I think I'm going to change MarkupSEO back to creating "real" fields. This will allow multilanguage and has some other benefits as this module is used by a lot of you lately.

  • Like 5

Share this post


Link to post
Share on other sites

On my own standard profile I have og type and twitter type as page fields so that I can also add new variations on the fly - especially useful with open graph as there are so many potential content types. 

Share this post


Link to post
Share on other sites

So I think I'm going to change MarkupSEO back to creating "real" fields. This will allow multilanguage and has some other benefits as this module is used by a lot of you lately.

This is a good idea Nico especially also whenyou have lots of pages which use MarkupSEO. And Multilanguage is a must for modern SEO in Asia. Thanks!

  • Like 1

Share this post


Link to post
Share on other sites

Great idea, as that pagelimit was a real showstopper. Is there somewhere a full list of the fields this module generates as i would like  to implement this as a standard into my templates. 

Share this post


Link to post
Share on other sites

At the moment it will create the following fields:

  • seo_tab
  • seo_tab_END
  • seo_title
  • seo_keywords
  • seo_description
  • seo_custom
  • seo_image

Maybe there are one or two fields that will follow.


And it's going to be expandable. So each field starting with seo_ will be interpreted as extension. More to this when the new version is finished

Share this post


Link to post
Share on other sites

Just for interest, the fields I use in my sites are:

Title - for the specific page title

Meta Description (which is also used by og:description and twitter:description)

Meta Author 

Google Profile address

Business G+ profiles (which might be different)

A featured image (that is resized as a square on the template)

Twitter name

Twitter Card (page field)

Open Graph Type (page field)

Both the last two have create new options.

I am also thinking of adding bits for Schema, since those are also relevant to SEO, but obviously, if you added those, then people would have to manually add the relevant reference to their templates.

Share this post


Link to post
Share on other sites

Hmm.... reinstalled this module and got quite a few questions ...

1. In Module settings

1.1  "Include Generator" , what does this setting do ?

1.2  "Do you want to get the generated code included automatically or use hooks in your template files?"

What exactly does this do on automatic setting ?

In manual setting you are expected to add the fields manually in your template or are there any other hooks ?

1.3 The "custom" field does this has any form of safety or does this allow to simply inject anything you like into the template head?

(If it would allow to inject anything this still is only a minor security risk as the person who is setting this needs access to mudule settings and is able to install own custom modules.)

1.4 Maybe a switch for automatic redirect to https would be nice as i just read that Google  starts to prefer HTTPS Pages.

http://googlewebmastercentral.blogspot.de/2014/08/https-as-ranking-signal.html

http://www.golem.de/news/hsts-google-fuehrt-liste-von-reinen-https-seiten-1408-108531.html

http://www.spiegel.de/netzwelt/web/google-belohnt-https-verbindungen-im-ranking-a-984872.html

Just an idea?

2. In page seo settings.

2.1 Warning:

in_array() expects parameter 2 to be array, string given in /home/p4a/domains/009.pw4all.org/public_html/site/modules/MarkupSEO/MarkupSEO.module on line 76

2.2 Maybe an Image field for the image ? But i really have no idea for what reason there is a Image field in SEO settings of a page ?

2.3 Again the custom field , if its only meaned for metas maybe a small repeater woudl do the job better ? Or maybe at least add some Regex filter to stop the average writer from adding  unlimited Javascript into ths page.? 

Edit:

Ist just an idea but i have often seen an underscore added to tab fields like  _seo  and _seo_END so you can see its a tab field on first view  again, just an idea.

Share this post


Link to post
Share on other sites

Hey,

new version is almost finished and is going to be released in an hour I guess.

Most of your issues should be solved in this :)

And the image field is used for open graph and twitter cards.

And I normally do _stuff for tabs to but I thought it might be a little bit better to have the same schema for all of the seo fields that get generated automatically (and it's easier to delete them afterwards)

  • Like 1

Share this post


Link to post
Share on other sites

Update 0.5.0: 

This version is not compatible with further releases (and still beta).

https://github.com/NicoKnoll/MarkupSEO/blob/master/MarkupSEO.module

I did a lot of changes and almost wrote the complete code new. Here are some main changes:

  • Use normal fields instead of custom solution (this allows multilanguage and may prevents some compatibility problems)
  • Added Twitter Cards
  • Added an "Author" option
  • Added a "title format" option (and a way to disable auto include of title)
  • Rewrote most of fields descriptions
  • Custom meta tags have to have a special format now + sanitizer for security (it's self explaining in the module itself)
  • Fixed all issues
  • You have to choose which templates should have a SEO tab instead of excluding now

Let me hear what you think. And merry christmas :)

  • Like 3

Share this post


Link to post
Share on other sites

I would like to do a request. Is it possible to remove the line breaks? 

<title>titel</title><meta name="keywords" content="voorbeeld, voorbeeld, voorbeeld">

<meta name="description" content="Dit is de omschrijving">

<meta name="image" content="">

<meta name="canonical" content="http://www.testpagina/">

<meta name="generator" content="ProcessWire 2.5.3">

<meta name="author" content="">

<meta name="robots" content="index, follow">

<meta name="og:site_name" content="">

<meta name="og:title" content="titel">

<meta name="og:url" content="">

<meta name="og:description" content="Dit is de omschrijving">

<meta name="og:type" content="website">

<meta name="og:image" content="">

<meta name="twitter:card" content="summary">

<meta name="twitter:site" content="@">

<meta name="twitter:title" content="titel">

<meta name="twitter:url" content="">

<meta name="twitter:description" content="Dit is de omschrijving">

<meta name="twitter:image" content="">
  • Like 1

Share this post


Link to post
Share on other sites

Great Work !!!!

Small bug?

Warning: in_array() expects parameter 2 to be array, string given in /home/p4a/domains/009.pw4all.org/public_html/site/modules/MarkupSEO/MarkupSEO.module on line 92

Share this post


Link to post
Share on other sites

About global custom field.

A while ago i had some trouble whith google indexing HTML entities in my meta Descriptions rigth as that.

So when i loocked at google search results i was looking at some ü> and a few other.

I am not sure if this is still an issue as i don't do much SEO right now but if it is i guess we schould use a regex

filter that only allows word characters and a few choosen special chars and simply drops all other.

And again maybe its an option to make the global custom field whithout filter as it can be only edited by an admin.

What i did not test yet was if the global field is overridden by the page based one or if both are concatenated?

About image field in page SEO :

Is there a reason why this is still no Imagefield ? Maybe i missed something ?

About page SEO:

maybe add a field  for a per page Robots setting? This is no must have , but would make it almost feature complete :-)

Google Preview :

What do i have to do to get a google prewiew displayed ?

And again, great work, i love it!!! 

Share this post


Link to post
Share on other sites

Version 0.6.0:

  • Big feature: Google suggestion autocomplete
  • Google preview updates while you type
  • Custom contents only get sanitized now
  • Bugfixes

@NorbertH: This is not an image field because you can't have an image field in the modules config settings page. And I think this is good enough for now. Maybe I change my mind later on :)

@toothpaste: Why no line breaks?

  • Like 2

Share this post


Link to post
Share on other sites

@NorbertH: This is not an image field because you can't have an image field in the modules config settings page. And I think this is good enough for now. Maybe I change my mind later on  :)

Sorry, simply did not know that you cannot have Image fields in module config ...

As Google handles each subpage of a site as a seperate page (you often can see subpages ranking much better than the main page at least at a speciffic topic ) it may be a good Idea to have this image setting in the page speciffic settings  and use the one set on the home page as default maybe? 

Same goes for the Robot settings where user want to exclude certain pages or areas .

@toothpaste: Why no line breaks?

I guess hes is talking about the double linebreaks which look ugly and makes HTML source harder to read.

Personallly i would even prefer to add some tabs before the actual tags to have a propper formating of HTML source :

<head>
​    <title>titel</title><meta name="keywords" content="voorbeeld, voorbeeld, voorbeeld">
 
    <meta name="description" content="Dit is de omschrijving">
    <meta name="image" content="">
    <meta name="canonical" content="[url=http://www.testpagina/]http://www.testpagina/">[/url]
    <meta name="generator" content="ProcessWire 2.5.3">
    <meta name="author" content="">
    <meta name="robots" content="index, follow">
    <meta name="og:site_name" content="">
    <meta name="og:title" content="titel">
    <meta name="og:url" content="">
    <meta name="og:description" content="Dit is de omschrijving">
    <meta name="og:type" content="website">
    <meta name="og:image" content="">
    <meta name="twitter:card" content="summary">
    <meta name="twitter:site" content="@">
    <meta name="twitter:title" content="titel">
    <meta name="twitter:url" content="">
    <meta name="twitter:description" content="Dit is de omschrijving">
    <meta name="twitter:image" content="">
...
</head>
​
 

Last thing i found was a bunch of notices  while saving the page settings:

Notice: Undefined variable: page in [/size]/home/p4a/domains/009.pw4all.org/public_html/site/modules/MarkupSEO/MarkupSEO.module on line [/size]137

Notice: Trying to get property of non-object in [/size]/home/p4a/domains/009.pw4all.org/public_html/site/modules/MarkupSEO/MarkupSEO.module on line [/size]137

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By eelkenet
      Hi! I've created a small Inputfield module called InputfieldFloatRange which allows you to use an HTML5 <input type="range" ../> slider as an InputField. I needed something like this for a project where the client needs to be able to tweak this value more based on 'a feeling' than just entering a boring old number. Maybe more people can use this so I'm hereby releasing it into the wild.  
       
      What is it?
      The missing range slider Inputfield for Processwire. 
      What does it do?
      This module extends InputfieldFloat and allows you to use HTML5 range sliders for number fields in your templates.
      It includes a visible and editable value field, to override/tweak the value if required.  
      Features
      Min/max values Precision (number of decimals) Steps (Read more) Manual override of the selected value (will still adhere to the rules above) Usage
      Clone / zip repo Install FieldtypeFloatRange, this automatically installs the Inputfield Create new field of type `Float (range)` or convert an existing `Float`, `Integer` or `Text` field. To render the field's value simply echo `$page->field` Demo
      A field with Min=0, Max=1, Step=0.2, Precision=2

      Field with settings Min=0, Max=200, Step=0.25, Precision=2

       
      Todo
      Make the display-field's size configurable (will use the Input Size field setting)  Hopefully become redundant If it's usable for others I'll add it to the Modules list  
      Changelog
      v002
      - Fix issue where setting the step value to an empty value created problem with validation
      - Make the display-field optional 
      v001
      - Initial release
       
      Thanks!
       
       
    • By Robin S
      Another little admin helper module...
      Template Field Widths
      Adds a "Field widths" field to Edit Template that allows you to quickly set the widths of inputfields in the template.

      Why?
      When setting up a new template or trying out different field layouts I find it a bit slow and tedious to have to open each field individually in a modal just to set the width. This module speeds up the process.
      Installation
      Install the Template Field Widths module.
      Config options
      You can set the default presentation of the "Field widths" field to collapsed or open. Field widths entered into the Template Field Widths inputfield are only applied if the Edit Template form is submitted with the Template Field Widths inputfield in an opened state. "Collapsed" is the recommended setting if you think you might also use core inputs for setting field widths in a template context. You can choose Name or Label as the primary identifier shown for the field. The unchosen alternative will become the title attribute shown on hover. You can choose to show the original field width next to the template context field width.  
      https://github.com/Toutouwai/TemplateFieldWidths
      https://modules.processwire.com/modules/template-field-widths/
    • By adrian
      Tracy Debugger for ProcessWire
      The ultimate “swiss army knife” debugging and development tool for the ProcessWire CMF/CMS

       
      Integrates and extends Nette's Tracy debugging tool and adds 35+ custom tools designed for effective ProcessWire debugging and lightning fast development
      The most comprehensive set of instructions and examples is available at: https://adrianbj.github.io/TracyDebugger
      Modules Directory: http://modules.processwire.com/modules/tracy-debugger/
      Github: https://github.com/adrianbj/TracyDebugger
      A big thanks to @tpr for introducing me to Tracy and for the idea for this module and for significant feedback, testing, and feature suggestions.
    • By adrian
      This module allows you to automatically rename file (including image) uploads according to a configurable format
      This module lets you define as many rules as you need to determine how uploaded files will be named and you can have different rules for different pages, templates, fields, and file extensions, or one rule for all uploads. Renaming works for files uploaded via the admin interface and also via the API, including images added from remote URLs.   Github: https://github.com/adrianbj/CustomUploadNames
      Modules Directory: http://modules.processwire.com/modules/process-custom-upload-names/
      Renaming Rules
      The module config allows you to set an unlimited number of Rename Rules. You can define rules to specific fields, templates, pages, and file extensions. If a rule option is left blank, the rule with be applied to all fields/templates/pages/extensions. Leave Filename Format blank to prevent renaming for a specific field/template/page combo, overriding a more general rule. Rules are processed in order, so put more specific rules before more general ones. You can drag to change the order of rules as needed. The following variables can be used in the filename format: $page, $template, $field, and $file. For some of these (eg. $field->description), if they haven't been filled out and saved prior to uploading the image, renaming won't occur on upload, but will happen on page save (could be an issue if image has already been inserted into RTE/HTML field before page save). Some examples: $page->title mysite-{$template->name}-images $field->label $file->description {$page->name}-{$file->filesize}-kb prefix-[Y-m-d_H-i-s]-suffix (anything inside square brackets is is considered to be a PHP date format for the current date/time) randstring[n] (where n is the number of characters you want in the string) ### (custom number mask, eg. 001 if more than one image with same name on a page. This is an enhanced version of the automatic addition of numbers if required) If 'Rename on Save' is checked files will be renamed again each time a page is saved (admin or front-end via API). WARNING: this setting will break any direct links to the old filename, which is particularly relevant for images inserted into RTE/HTML fields. The Filename Format can be defined using plain text and PW $page variable, for example: mysite-{$page->path} You can preserve the uploaded filename for certain rules. This will allow you to set a general renaming rule for your entire site, but then add a rule for a specific page/template/field that does not rename the uploaded file. Just simply build the rule, but leave the Filename Format field empty. You can specify an optional character limit (to nearest whole word) for the length of the filename - useful if you are using $page->path, $path->name etc and have very long page names - eg. news articles, publication titles etc. NOTE - if you are using ProcessWire's webp features, be sure to use the useSrcExt because if you have jpg and png files on the same page and your rename rules result in the same name, you need to maintain the src extension so they are kept as separate files.
      $config->webpOptions = array(     'useSrcExt' => false, // Use source file extension in webp filename? (file.jpg.webp rather than file.webp) ); Acknowledgments
      The module config settings make use of code from Pete's EmailToPage module and the renaming function is based on this code from Ryan: http://processwire.com/talk/topic/3299-ability-to-define-convention-for-image-and-file-upload-names/?p=32623 (also see this post for his thoughts on file renaming and why it is the lazy way out - worth a read before deciding to use this module). 
       
       
      NOTE:
      This should not be needed on most sites, but I work with lots of sites that host PDFs and photos/vectors that are available for download and I have always renamed the files on upload because clients will often upload files with horrible meaningless filenames like:
      Final ReportV6 web version for John Feb 23.PDF

×
×
  • Create New...