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 Robin S
      Repeater Images
      Adds options to modify Repeater fields to make them convenient for "page-per-image" usage. Using a page-per-image approach allows for additional fields to be associated with each image, to record things such as photographer, date, license, links, etc.
      When Repeater Images is enabled for a Repeater field the module changes the appearance of the Repeater inputfield to be similar (but not identical) to an Images field. The collapsed view shows a thumbnail for each Repeater item, and items can be expanded for field editing.
      Screencast

      Installation
      Install the Repeater Images module.
      Setup
      Create an image field to use in the Repeater field. Recommended settings for the image field are "Maximum files allowed" set to 1 and "Formatted value" set to "Single item (null if empty)". Create a Repeater field. Add the image field to the Repeater. If you want additional fields in the Repeater create and add these also. Repeater Images configuration
      Tick the "Activate Repeater Images for this Repeater field" checkbox. In the "Image field within Repeater" dropdown select the single image field. You must save the Repeater field settings to see any newly added Image fields in the dropdown. Adjust the image thumbnail height if you want (unlike the core Images field there is no slider to change thumbnail height within Page Edit). Note: the depth option for Repeater fields is not compatible with the Repeater Images module.
      Image uploads feature
      There is a checkbox to activate image uploads. This feature allows users to quickly and easily add images to the Repeater Images field by uploading them to an adjacent "upload" field.
      To use this feature you must add the image field selected in the Repeater Images config to the template of the page containing the Repeater Images field - immediately above or below the Repeater Images field would be a good position.
      It's recommended to set the label for this field in template context to "Upload images" or similar, and set the visibility of the field to "Closed" so that it takes up less room when it's not being used. Note that when you drag images to a closed Images field it will automatically open. You don't need to worry about the "Maximum files allowed" setting because the Repeater Images module overrides this for the upload field.
      New Repeater items will be created from the images uploaded to the upload field when the page is saved. The user can add descriptions and tags to the images while they are still in the upload field and these will be retained in the Repeater items. Images are automatically deleted from the upload field when the page is saved.
      Tips
      The "Use accordion mode?" option in the Repeater field settings is useful for keeping the inputfield compact, with only one image item open for editing at a time. The "Repeater item labels" setting determines what is shown in the thumbnail overlay on hover. Example for an image field named "image": {image.basename} ({image.width}x{image.height})  
      https://github.com/Toutouwai/RepeaterImages
      https://modules.processwire.com/modules/repeater-images/
    • By EyeDentify
      Hello There Guys.

      I am in the process of getting into making my first modules for PW and i had a question for you PHP and PW gurus in here.

      I was wondering how i could use an external library, lets say TwitterOAuth in my PW module.
      Link to library
      https://twitteroauth.com/

      Would the code below be correct or how would i go about this:
      <?PHP namespace ProcessWire; /* load the TwitterOAuth library from my Module folder */ require "twitteroauth/autoload.php"; use Abraham\TwitterOAuth\TwitterOAuth; class EyeTwitter extends WireData,TwitterOAuth implements Module { /* vars */ protected $twConnection; /* extend parent TwitterOAuth contructor $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $access_token, $access_token_secret); */ public function myTwitterConnection ($consumer_key, $consumer_secret, $access_token, $access_token_secret) { /* save the connection for use later */ $this->twConnection = TwitterOAuth::__construct($consumer_key, $consumer_secret, $access_token, $access_token_secret); } } ?> Am i on the right trail here or i am barking up the wrong tree?
      I don´t need a complete solution, i just wonder if i am including the external library the right way.
      If not, then give me a few hint´s and i will figure it out.

      Thanks a bunch.

      /EyeDentify
    • By dimitrios
      Hello,
      this module can publish content of a Processwire page on a Facebook page, triggered by saving the Processwire page.
      To set it up, configure the module with a Facebook app ID, secret and a Page ID. Following is additional configuration on Facebook for developers:
      Minimum Required Facebook App configuration:
      on Settings -> Basics, provide the App Domains, provide the Site URL, on Settings -> Advanced, set the API version (has been tested up to v3.3), add Product: Facebook Login, on Facebook Login -> Settings, set Client OAuth Login: Yes, set Web OAuth Login: Yes, set Enforce HTTPS: Yes, add "http://www.example.com/processwire/page/" to field Valid OAuth Redirect URIs. This module is configurable as follows:
      Templates: posts can take place only for pages with the defined templates. On/Off switch: specify a checkbox field that will not allow the post if checked. Specify a message and/or an image for the post.
      Usage
      edit the desired PW page and save; it will post right after the initial Facebook log in and permission granting. After that, an access token is kept.
       
      Download
      PW module directory: http://modules.processwire.com/modules/auto-fb-post/ Github: https://github.com/kastrind/AutoFbPost   Note: Facebook SDK for PHP is utilized.


    • By kongondo
      FieldtypeRuntimeMarkup and InputfieldRuntimeMarkup
       
      Modules Directory: http://modules.processwire.com/modules/fieldtype-runtime-markup/
      GitHub: https://github.com/kongondo/FieldtypeRuntimeMarkup
      As of 11 May 2019 ProcessWire versions earlier than 3.x are not supported
      This module allows for custom markup to be dynamically (PHP) generated and output within a page's edit screen (in Admin).
       
      The value for the fieldtype is generated at runtime. No data is saved in the database. The accompanying InputfieldRuntimeMarkup is only used to render/display the markup in the page edit screen.
       
      The field's value is accessible from the ProcessWire API in the frontend like any other field, i.e. it has access to $page and $pages.
       
      The module was commissioned/sponsored by @Valan. Although there's certainly other ways to achieve what this module does, it offers a dynamic and flexible alternative to generating your own markup in a page's edit screen whilst also allowing access to that markup in the frontend. Thanks Valan!
       
      Warning/Consideration
      Although access to ProcessWire's Fields' admin pages is only available to Superusers, this Fieldtype will evaluate and run the custom PHP Code entered and saved in the field's settings (Details tab). Utmost care should therefore be taken in making sure your code does not perform any CRUD operations!! (unless of course that's intentional) The value for this fieldtype is generated at runtime and thus no data is stored in the database. This means that you cannot directly query a RuntimeMarkup field from $pages->find(). Usage and API
       
      Backend
      Enter your custom PHP snippet in the Details tab of your field (it is RECOMMENDED though that you use wireRenderFile() instead. See example below). Your code can be as simple or as complicated as you want as long as in the end you return a value that is not an array or an object or anything other than a string/integer.
       
      FieldtypeRuntimeMarkup has access to $page (the current page being edited/viewed) and $pages. 
       
      A very simple example.
      return 'Hello'; Simple example.
      return $page->title; Simple example with markup.
      return '<h2>' . $page->title . '</h2>'; Another simple example with markup.
      $out = '<h1>hello '; $out .= $page->title; $out .= '</h1>'; return $out; A more advanced example.
      $p = $pages->get('/about-us/')->child('sort=random'); return '<p>' . $p->title . '</p>'; An even more complex example.
      $str =''; if($page->name == 'about-us') { $p = $page->children->last(); $str = "<h2><a href='{$p->url}'>{$p->title}</a></h2>"; } else { $str = "<h2><a href='{$page->url}'>{$page->title}</a></h2>"; } return $str; Rather than type your code directly in the Details tab of the field, it is highly recommended that you placed all your code in an external file and call that file using the core wireRenderFile() method. Taking this approach means you will be able to edit your code in your favourite text editor. It also means you will be able to type more text without having to scroll. Editing the file is also easier than editing the field. To use this approach, simply do:
      return wireRenderFile('name-of-file');// file will be in /site/templates/ If using ProcessWire 3.x, you will need to use namespace as follows:
      return ProcessWire\wireRenderFile('name-of-file'); How to access the value of RuntimeMarkup in the frontend (our field is called 'runtime_markup')
       
      Access the field on the current page (just like any other field)
      echo $page->runtime_markup; Access the field on another page
      echo $pages->get('/about-us/')->runtime_markup; Screenshots
       
      Backend
       

       

       
      Frontend
       

×
×
  • Create New...