Jump to content

PWaddict

Members
  • Posts

    908
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by PWaddict

  1. On 5/20/2021 at 10:47 AM, gebeer said:

    I took @bcartier's code from this post and made a configurable module from it.

    change-default-frontend-lang.png.a23bdeaf2a364995919ce3605bfeaa0a.png

    You can find the module attached.

    I can confirm that the redirection to a non-default language works on PW 3.0.172

    DefaultFrontendLanguage.zip 1.35 kB · 259 downloads

    I just installed the module on PW 3.0.229 and I chose the alt language as default but there is no redirect.

    EDIT: I had to do few more things to actually work:

    1. Add a page name to the default language on the Home page
    2. On Languages Support - Page Names module at "Default language homepage URL is same as root URL?" select "No - Root URL performs a redirect to: /name/"
    • Like 1
  2. 10 hours ago, strandoo said:

    By the way, are you getting 2 emails sent for every form submission?

    No, I'm getting just 1 email.

    I've only changed the 203 and 211 lines and everything seems to properly work. Thanks for the help.

    • Like 1
  3. @strandoo I changed the 211 line and now it works but if I try to submit the form without checking the reCAPTCHA I'm getting the error "InputfieldRecaptcha" instead of the "Failed reCAPTCHA input test" as it should be due to the following hook:

     $wire->addHookBefore('SimpleContactForm::processValidation', function(HookEvent $event) {
    
       $form = $event->arguments(0);
       $recaptcha = $form->get('recaptcha');
    
       // add error if not pass the reCaptcha test
       if (!$this->input->post->{'g-recaptcha-response'}) { // attach an error to the field
         $recaptcha->error(__('Failed reCAPTCHA input test')); // it will be displayed along the field
       }
    
    });

     

  4. @strandoo I replaced $form->getErrors() with $form->getErrorInputfields() on lines 203 and 245 but now I'm always getting SPAM error when I'm trying to fill a form (even without filling the honeypot field) and on the logs I'm getting this: [FAILURE] Number of fields does not match. IP: 127.0.0.1

  5. 20 hours ago, cwsoft said:

    Maybe an update to the FrontendForms module from Jürgen may be an option, as it comes with lots of spam protection features out of the box.

    Currently I can't try it cause it requires at least PHP 8. I'm still using PHP 7.4 as I don't want to update yet without testing all modules to make sure everything works properly.

    @strandoo so far we are the only ones that mentioned this issue and I notice that we both use your reCAPTCHA solution. Have you tested the form without the reCAPTCHA?

  6. On 6/14/2023 at 8:11 AM, cwsoft said:

    How many failed trials were in the logs before the success message appeared? Only one failed, than success? That would be strange. 

    Yes, only one failed and then 1 second later success!

    10 minutes ago, strandoo said:

    But this is happening with my own tests, so it's probably not so much clever spammers as much as something broken with recent PW updates. Any idea where this might be failing?

    I didn't thought about the PW updates. On January, I've upgraded the one site I'm using this module from 3.0.165 to 3.0.210 but the frequent spam started on April if I remember correctly. No idea what is causing this issue. Don't forget that this is an abandoned module 😞

  7. Lately, I'm getting lot of SPAM. I checked the log and even it detects the SPAM as FAILURE like "Honeypot field was filled" or  "Number of fields does not match" then 1 second later there is a SUCCESS.

    Here is a log of "Honeypot field was filled":

    23 hours ago
    2023-06-13 07:38:44	[SUCCESS] Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5042.0 Safari/537.36, 37.212.202.92, myemail@mysite.com
    
    23 hours ago
    2023-06-13 07:38:43	[FAILURE] Honeypot field was filled. IP: 37.212.202.92

    Here is a log of "Number of fields does not match":

    13 minutes ago
    2023-06-14 06:24:52	[SUCCESS] Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.53 Safari/537.36, 176.124.220.43, myemail@mysite.com
    
    13 minutes ago
    2023-06-14 06:24:51	[FAILURE] Number of fields does not match. IP: 176.124.220.43

    I'm also using reCAPTCHA but it seems that spammers have found a way to pass all these...

  8. 3 hours ago, wbmnfktr said:

    Look into Aliases in Google Mail - they should do the trick as well.
    There is a nice guide about it over on ImprovMX.

    Yes I know about the aliases but I don't prefer that method because:

    If your recipient uses Outlook or another mail service, they might see something like, "From yourname@gmail.com on behalf of othername@otherdomain.com."

    Your recipients might also see your original @gmail.com address if you:

    • Set up an out of office reply
    • Create a filter with automated response
    • Have a full mailbox, and your recipient gets notified

    Info taken from the Google.

    • Like 1
  9. You can use your free Gmail account with the free module WireMailSmtp by @horst 

    First make sure you have enabled 2-Step Verification on your Google account. Then create an App password (you gonna need it for WireMailSmtp). Check the screenshot below:

    image.thumb.png.c763b3c0af7089e434c1afc847df8ac1.png

    Next on WireMailSmtp settings make sure to add the following:

    Local Hostname: yourdomain.com
    SMTP Hostname: smtp.gmail.com
    SMTP Port: 587
    SMTP User: youremail@gmail.com
    SMTP Password: the app password you created on Google account (NOT your Google password)
    Use START-TLS: Checked
    Select a crypto method for TLS: STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT
    Sender Email Address: youremail@gmail.com
    Sender Name: Your Name

    I tested the above few months ago and worked fine with a free Gmail account, then I bought Google Workspace so I can use my custom domain instead of @gmail.com.

     

    • Like 3
  10. 3 hours ago, bernhard said:

    Hey @PWaddict thx for the report. I had a look and you just need to install RockFrontend to make it work. Not sure if we really need that dependency just for this single feature but as a quickfix that is what you can do 😉 

    Since it wasn't working, I've uninstalled AdminStyleRock and followed the instructions from here. You should mention somewhere on AdminStyleRock module or it's page that specific field to work requires the RockFrontend module to prevent confusion.

    • Like 1
  11. Hi @bernhard installed Less module and then AdminStyleRock but when I submit the "Primary Color" field I'm getting the following fatal error:

    Fatal Error: Uncaught Error: Call to a member function forceRecompile() on null in C:\laragon\www\mysite\site\modules\AdminStyleRock\AdminStyleRock.module.php:168
    
    #0 C:\laragon\www\mysite\site\modules\AdminStyleRock\AdminStyleRock.module.php(123): AdminStyleRock->iframe(Object(InputfieldWrapper))
    #1 C:\laragon\www\mysite\wire\core\Modules.php(4112): AdminStyleRock->getModuleConfigInputfields(Object(InputfieldWrapper))
    #2 C:\laragon\www\mysite\wire\core\Wire.php(419): Modules->___getModuleConfigInputfields('AdminStyleRock', Object(InputfieldForm))
    #3 C:\laragon\www\mysite\wire\core\WireHooks.php(952): Wire->_callMethod('___getModuleCon...', Array)
    #4 C:\laragon\www\mysite\wire\core\Wire.php(484): WireHooks->runHooks(Object(Modules), 'getModuleConfig...', Array)
    #5 C:\laragon\www\mysite\wire\modules\Process\ProcessModule\ProcessModule.module(1680): Wire->__call('getModuleConfig.. (line 168 of C:\laragon\www\mysite\site\modules\AdminStyleRock\AdminStyleRock.module.php)

     

  12. Hello and happy new year!

    Today, I decided to upgrade a site to 3.0.210 from 3.0.165 and so far I noticed one issue. The following hook doesn't work properly (worked fine on 3.0.165). It changes the text but it won't let the non-superuser to delete the page. Pressing the button redirects the page https://mysite.test/admin/page/edit/?id=11293 to https://mysite.test/admin/page/edit/?id=11293&s=1&c=1 

    /**
     * Rename "Move to Trash" text on Delete tab's button
     *
     */
    $wire->addHookBefore('InputfieldButton::render', function(HookEvent $event) {
    
      if ($event->object->id != "submit_delete") return;
      if ($this->wire('user')->isSuperuser() == false) $event->object->value = "Hello World";
    
    });

     

  13. Thank you for the hint. Here is what I did and it seems it does the job.

    $wire->addHookBefore('WireMail::send', function(HookEvent $event) {
    
      $WireMail = $event->object;
    
      if(!$WireMail->bodyHTML && $WireMail->body) {
        $forcehtml = nl2br($WireMail->body); // nl2br — Inserts HTML line breaks before all newlines in a string
        $WireMail->bodyHTML($forcehtml);
      }
    
    });

     

    • Like 1
×
×
  • Create New...