Jump to content

Recommended Posts

@Karinne Cyphers I've pushed up 1.5.52 which attempts to fix the change that PHP 7.3 made to preg_*, where hyphens need to be escaped if not at the end of a character set in an expression. Not able to test on my side, so please could you update and let me know if it runs? Thanks!

Share this post


Link to post
Share on other sites

Unfortunately, Using 1.5.52 created a number of issues for us.  We did downgrade our servers to PHP 7.2.x and for us, using 1.5.51 generates far fewer errors.  With 52 we were having an issue where the headers weren't being set and our cookies we use for different forms weren't being set.

Share this post


Link to post
Share on other sites

Hi @Mike Rockett

I'm moving WP site to PW where I have such URLs with Cyrillic characters 

2018/11/16/обухівських-школярів-навчать-писати/

and actualy it doesn't work. I have turned on debug mode and it says that there is no match.  

Also, I have tried to use Wildcards like

Source 
{year:num}/{month:num}/{date}/{title:segment}
Destination
[template=archive-item,archive_url=/{year}/{month}/{date}/{title}/]]

In the archive-item template, I have field archive_url that contain full URL in the format '/2018/11/16/обухівських-школярів-навчать-писати/'.

Have I missed something?

Thanks. 

Share this post


Link to post
Share on other sites

@wbmnfktr @Mike Rockett Thanks, but I'm not sure that you understand me correctly.

On PW site I don't want to use UTF8 name, but I have such URLs on the old site and I want to make a redirect from URLs like '2018/11/16/обухівських-школярів-навчать-писати/' to some destination page.

Currently, I tracked down that it's relative to urldecode/urlencode. 

For example, I have such jumplink

818805764_FireShotCapture016-JumplinksProcessWire_-http___obukhiv.test_admin_setup_jumplinks_entity_.png.05f69c74b3b2f92ca0580086db7168cf.png

Here is the output of Jumplink debug mode

1996786726_FireShotCapture017--http___obukhiv.test_4000_D182D0B5D181D182.png.74d4ffb4767c77cbb265551263507bee.png

617614397_FireShotCapture018--http___obukhiv.test_4000_D182D0B5D181D182.png.d3691c8df9cb8c08f0fff7d27797c614.png

 

As you can see "request" is not urldecoded, but we are trying match decoded string.

If I change this code on line 204 https://gitlab.com/rockettpw/seo/jumplinks-one/blob/master/ProcessJumplinks.module.php#L204

$this->request = ltrim(@$_SERVER['REQUEST_URI'], '/');

to

$this->request = urldecode(ltrim(@$_SERVER['REQUEST_URI'], '/'));

I get such output

874305864_FireShotCapture019--http___obukhiv.test_4000_D182D0B5D181D182.png.acde5f0327ada612a6b3c28fdcc6bc95.png

1162875510_FireShotCapture021--http___obukhiv.test_4000_D182D0B5D181D182.png.802a63b3a86d8afb391b91db114a15e8.png

-------------

The next issue is that I can't get wildcards to work with Cyrillic characters

1737388865_FireShotCapture022--http___obukhiv.test_4000_2014_06_18_D183D187D0BDD196-D188D0.thumb.png.69c5a923c58c747b343a746ed12be314.png

 

Share this post


Link to post
Share on other sites

It's weird. I have managed to get it working with German umlauts, but not with cyrillic characters.

I guess the culprit is not line 204, but further below:

$input = iconv('utf-8', 'us-ascii//TRANSLIT', $input);

I've tried to implement the fix suggested here, but it still didn't work... (1st user-contributed note).

Share this post


Link to post
Share on other sites

Hi everyone! Does anyone know if it's possible to map a source url taking into account optional string at the end? For example:

Source -> Destination

example.com/es/this-is-a-nice-url -> example.com/es/this-is-a-nice-url

example.com/es/this-is-a-nice-url-1 -> example.com/posts/this-is-a-nice-url

example.com/es/this-is-a-nice-url-2 -> example.com/posts/this-is-a-nice-url

 

Making the "-1" or "-2" optional.

Share this post


Link to post
Share on other sites
On 3/23/2019 at 4:10 PM, dragan said:

It's weird. I have managed to get it working with German umlauts, but not with cyrillic characters.

I guess the culprit is not line 204, but further below:


$input = iconv('utf-8', 'us-ascii//TRANSLIT', $input);

I've tried to implement the fix suggested here, but it still didn't work... (1st user-contributed note).

These regex expressions don't not match Cyrillic characters

https://gitlab.com/rockettpw/seo/jumplinks-one/blob/master/ProcessJumplinks.module.php#L94

https://gitlab.com/rockettpw/seo/jumplinks-one/blob/master/ProcessJumplinks.module.php#L95

https://gitlab.com/rockettpw/seo/jumplinks-one/blob/master/ProcessJumplinks.module.php#L98

https://gitlab.com/rockettpw/seo/jumplinks-one/blob/master/ProcessJumplinks.module.php#L99

They should be changed to something like

[\wа-я]+/ig

 

Share this post


Link to post
Share on other sites
6 hours ago, elabx said:

Hi everyone! Does anyone know if it's possible to map a source url taking into account optional string at the end? For example:

Source -> Destination

example.com/es/this-is-a-nice-url -> example.com/es/this-is-a-nice-url

example.com/es/this-is-a-nice-url-1 -> example.com/posts/this-is-a-nice-url

example.com/es/this-is-a-nice-url-2 -> example.com/posts/this-is-a-nice-url

 

Making the "-1" or "-2" optional.

 

Not tested

content/{path}/some-url[-{num}]

Share this post


Link to post
Share on other sites
4 hours ago, Zeka said:

Not tested


content/{path}/some-url[-{num}]

Didn't work unfortunately 😞

Share this post


Link to post
Share on other sites

Feature request, Mike. I know you're busy so just putting it out there.

I am logging 404 hits to a site that get's a ton of spam links. An old SEO spam issue which I am cleaning up.

Anyway, I notice that the jumplinks database table was becoming huge and had bloated to thousands of enties making the database itself very large.

That better house-keeping is my responsibility but wondered if a feature might be useful to optionally auto-delete these over a certain threshold. Or possibly send an email or notification that the logs were becoming quite big etc.

 

Share this post


Link to post
Share on other sites
On 4/10/2019 at 6:45 PM, elabx said:

Hi everyone! Does anyone know if it's possible to map a source url taking into account optional string at the end? For example:

Source -> Destination

example.com/es/this-is-a-nice-url -> example.com/es/this-is-a-nice-url

example.com/es/this-is-a-nice-url-1 -> example.com/posts/this-is-a-nice-url

example.com/es/this-is-a-nice-url-2 -> example.com/posts/this-is-a-nice-url

 

Making the "-1" or "-2" optional.

Unfortunately, this isn't built in as a feature, but I'm thinking the non-capture feature might work for you. Not tested, but try using <[-]{1}[\d*]> at the end of the source.

On 4/13/2019 at 2:31 PM, Peter Knight said:

Feature request, Mike. I know you're busy so just putting it out there.

I am logging 404 hits to a site that get's a ton of spam links. An old SEO spam issue which I am cleaning up.

Anyway, I notice that the jumplinks database table was becoming huge and had bloated to thousands of enties making the database itself very large.

That better house-keeping is my responsibility but wondered if a feature might be useful to optionally auto-delete these over a certain threshold. Or possibly send an email or notification that the logs were becoming quite big etc.

 

Thanks Peter – I recall wanting to do this for v2, where you choose how many you'd like to retain in the log.

I think I'm gonna need to find some time to finish v2. Will likely need to make a few changes here and there (not up to speed with all the new core-dev) before I proceed with the frontend work that's still due. 

  • Like 2

Share this post


Link to post
Share on other sites

Just a note on unicode support: this is vastly improved in v2, once rule 16b is in use. Not planning on bringing it to v1, unfortunately.

Share this post


Link to post
Share on other sites

Hey Mike,

is there anything the community could do to support you with v2? The new version is highly anticipated 🙂

  • Like 1

Share this post


Link to post
Share on other sites

Thanks for the reply @Mike Rockett!

In a completely different scneario, I am trying this as source: 

[propiedades]/detalle_propiedad/1363/some-segment[/][?b=1]

(As destination it's a plain url)

So that it would match:

  • detalle_propiedad/1363/casa-en-preventa-colonia-maya?b=1
  • detalle_propiedad/1363/casa-en-preventa-colonia-maya/?b=1
  • propiedades/detalle_propiedad/1363/casa-en-preventa-colonia-maya/?b=1

Does anyone know if I am correct in this assumption?

EDIT: Solved it with two jumplinks like this:

  • {segments}/{num:num}/{segment}/?b=1
  • {segments}/{num:num}/{segment}?b=1

I also think there might be something the community could do to help? Funding? "Crowdfunding"? Though maybe Mike's slammed with client work or sth and that's it haha

Share this post


Link to post
Share on other sites
On 4/17/2019 at 1:20 AM, elabx said:

I also think there might be something the community could do to help? Funding? "Crowdfunding"? Though maybe Mike's slammed with client work or sth and that's it haha

Under normal circumstances, contributions to OSS help out with continued development – issue on my side is exactly that: slammed with work. With that said, there are several public holidays coming up (four-day weeks for two/three weeks), so I think I can slot in some time to get things going here and at maybe even put up a testing version of sorts next month. Further on down the line, when it's stable, we'd definitely need to look at getting someone onboard to assist with maintenance.

  • Like 1

Share this post


Link to post
Share on other sites

Hi Mike, the update 1.5.53->1.5.54 with the PW "Upgrades" plugin does not work (worked before). It re-installes the old version.

Share this post


Link to post
Share on other sites

Hey @Mike Rockett – just wondering if you could add this module to Packagist as well? Would make installing via Composer nice and easy 🙂

Again setting type as pw-module and adding wireframe-framework/processwire-composer-installer as a dependency would be perfect. Thanks in advance for considering!

Share this post


Link to post
Share on other sites

Hi everyone,

I oversaw a site migration recently. A large part of the legacy site's URL structure changed and we installed Jumplinks to manage all the redirects.

Since the launch I've been monitoring 404s in Google Analytics and we appear to getting quite a few (around 40 per week). What's odd is that the affected URLs all have jumplinks in places, and when I test them the redirects work perfectly fine. 

I can't see why Analytics would be picking these up but I'm quite concerned- if anyone as any insight it would be greatly appreciated.

Best

Harry

 

Screenshot 2019-07-11 at 14.05.23.png

Screenshot 2019-07-11 at 14.06.22.png

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By joshua
      This module is (yet another) way for implementing a cookie management solution.
      Of course there are several other possibilities:
      - https://processwire.com/talk/topic/22920-klaro-cookie-consent-manager/
      - https://github.com/webmanufaktur/CookieManagementBanner
      - https://github.com/johannesdachsel/cookiemonster
      - https://www.oiljs.org/
      - ... and so on ...
      In this module you can configure which kind of cookie categories you want to manage:

      You can also enable the support for respecting the Do-Not-Track (DNT) header to don't annoy users, who already decided for all their browsing experience.
      Currently there are four possible cookie groups:
      - Necessary (always enabled)
      - Statistics
      - Marketing
      - External Media
      All groups can be renamed, so feel free to use other cookie group names. I just haven't found a way to implement a "repeater like" field as configurable module field ...
      When you want to load specific scripts ( like Google Analytics, Google Maps, ...) only after the user's content to this specific category of cookies, just use the following script syntax:
      <script type="text/plain" data-type="text/javascript" data-category="statistics" data-src="/path/to/your/statistic/script.js"></script> <script type="text/plain" data-type="text/javascript" data-category="marketing" data-src="/path/to/your/mareketing/script.js"></script> <script type="text/plain" data-type="text/javascript" data-category="external_media" data-src="/path/to/your/external-media/script.js"></script> <script type="text/plain" data-type="text/javascript" data-category="marketing">console.log("Inline scripts are also working!");</script> The type has to be "optin" to get recognized by PrivacyWire, the data-attributes are giving hints, how the script shall be loaded, if the data-category is within the cookie consents of the user. These scripts are loaded asynchronously after the user made the decision.
      If you want to give the users the possibility to change their consent, you can use the following Textformatter:
      [[privacywire-choose-cookies]] It's planned to add also other Textformatters to opt-out of specific cookie groups or delete the whole consent cookie.
      You can also add a custom link to output the banner again with a link / button with following class:
      <a href="#" class="privacywire-show-options">Show Cookie Options</a> <button class="privacywire-show-options">Show Cookie Options</button> This module is still in development, but we already use it on several production websites.
      You find it here: PrivacyWire Git Repo
      Download as .zip
      I would love to hear your feedback 🙂
      CHANGELOG
      0.1.1 Debugging: fixed error during uninstall 0.1.0 Added new detection of async scripts for W3C Validation 0.0.6 CSS-Debugging for hiding unused buttons, added ProCache support for the JavaScript tag 0.0.5 Multi-language support included completely (also in TextFormatter). Added possibility to async load other assets (e.g. <img type="optin" data-category="marketing" data-src="https://via.placeholder.com/300x300">) 0.0.4 Added possibility to add an imprint link to the banner 0.0.3 Multi-language support for module config (still in development) 0.0.2 First release 0.0.1 Early development
    • By bernhard
      --- Please use RockFinder3 ---
    • By MoritzLost
      Cacheable Placeholders
      This module allows you to have pieces of dynamic content inside cached output. This aims to solve the common problem of having a mostly cacheable site, but with pieces of dynamic output here and there.  Consider this simple example, where you want to output a custom greeting to the current user:
      <h1>Good morning, <?= ucfirst($user->name) ?></h1> This snippet means you can't use the template cache (at least for logged-in users), because each user has a different name. Even if 99% of your output is static, you can only cache the pieces that you know won't include this personal greeting. A more common example would be CSRF tokens for HTML forms - those need to be unique by definition, so you can't cache the form wholesale.
      This module solves this problem by introducing cacheable placeholders - small placeholder tokens that get replaced during every request. The replacement is done inside a Page::render hook so it runs during every request, even if the response is served from the template cache. So you can use something like this:
      <h1>Good morning, {{{greeting}}}</h1> Replacement tokens are defined with a callback function that produces the appropriate output and added to the module through a simple hook:
      // site/ready.php wire()->addHookAfter('CachePlaceholders::getTokens', function (HookEvent $e) { $tokens = $e->return; $tokens['greeting'] = [ 'callback' => function (array $tokenData) { return ucfirst(wire('user')->name); } ]; $e->return = $tokens; }); Tokens can also include parameters that are parsed and passed to the callback function. There are more fully annotated examples and step-by-step instructions in the README on Github!
      Features
      A simple and fast token parser that calls the appropriate callback and runs automatically. Tokens may include multiple named or positional parameters, as well as multi-value parameters. A manual mode that allows you to replace tokens in custom pieces of cached content (useful if you're using the $cache API). Some built-in tokens for common use-cases: CSRF-Tokens, replacing values from superglobals and producing random hexadecimal strings. The token format is completely customizable, all delimiters can be changed to avoid collisions with existing tag parsers or template languages. Links
      Github Repository & documentation Module directory (pending approval) If you are interested in learning more, the README is very extensive, with more usage examples, code samples and usage instructions!
    • By Craig
      I've been using Fathom Analytics for a while now and on a growing number of sites, so thought it was about time there was a PW module for it.
      WayFathomAnalytics
      WayFathomAnalytics is a group of modules which will allow you to view your Fathom Analytics dashboard in the PW admin panel and (optionally) automatically add and configure the tracking code on front-end pages.
      Links
      GitHub Readme & documentation Download Zip Modules directory Module settings screenshot What is Fathom Analytics?
      Fathom Analytics is a simple, privacy-focused website analytics tool for bloggers and businesses.

      Stop scrolling through pages of reports and collecting gobs of personal data about your visitors, both of which you probably don't need. Fathom is a simple and private website analytics platform that lets you focus on what's important: your business.
      Privacy focused Fast-loading dashboards, all data is on a single screen Easy to get what you need, no training required Unlimited email reports Private or public dashboard sharing Cookie notices not required (it doesn't use cookies or collect personal data) Displays: top content, top referrers, top goals and more
    • By daniels
      This is a lightweight alternative to other newsletter & newsletter-subscription modules.
      You can find the Module in the Modules directory and on Github
      It can subscribe, update, unsubscribe & delete a user in a list in Mailchimp with MailChimp API 3.0. It does not provide any forms or validation, so you can feel free to use your own. To protect your users, it does not save any user data in logs or sends them to an admin.
      This module fits your needs if you...
      ...use Mailchimp as your newsletter / email-automation tool ...want to let users subscribe to your newsletter on your website ...want to use your own form, validation and messages (with or without the wire forms) ...don't want any personal user data saved in any way in your ProcessWire environment (cf. EU data regulation terms) ...like to subscribe, update, unsubscribe or delete users to/from different lists ...like the Mailchimp UI for creating / sending / reviewing email campaigns *I have only tested it with PHP 7.x so far, so use on owners risk
      EDIT:
      Since 0.0.4, instructions and changelog can be found in the README only. You can find it here  🙂
      If you have questions or like to contribute, just post a reply or create an issue or pr on github, thanks!
×
×
  • Create New...