Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2010
    Posts
    265
    Plugin Contributions
    1

    Default Google Recaptcha v3 deprecated constructor

    ZC 1.5.7 PHP 7.4
    I just got done installing Numinix's Google recaptcha v3, and it seems to be working fine, but my log folder is filling up fast with this error:

    [03-Jun-2022 08:59:26 America/Boise] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; NuminixRecaptchaV3Observer has a deprecated constructor in /home1/redsauto/public_html/includes/classes/observers/class.nmx_recaptcha_v3.php on line 6
    Here is the entire code from class.nmx_recaptcha_v3.php:

    Code:
    <?php
    /**
     * Observer class used to verify request token upon requests
     *
     */
    class NuminixRecaptchaV3Observer extends base 
    {
        function NuminixRecaptchaV3Observer() {
            global $zco_notifier, $nmxRecaptcha;
            
            $zco_notifier->attach($this, $nmxRecaptcha->get_notifiers_to_check());
        }
    	
        function update(&$class, $eventID, $paramsArray) {
            global $error, $nmxRecaptcha;
            
            if(!$nmxRecaptcha->is_enable()) return $error;
            
            $valid = false;
            if(isset($_POST['g-recaptcha-response']) && !empty($_POST['g-recaptcha-response'])){
                $valid = $nmxRecaptcha->validate_recaptcha($_POST['g-recaptcha-response'], $nmxRecaptcha->get_notifier_message_class($eventID));
            }
            
            if(!$valid) $error = true;
            
            return $error;
        }
    }
    I know I need to modify lines 6, and 8 to change the constructor, but I am a mechanic, not a php master, so I am not exactly sure what to change it to that will make php happy.

  2. #2
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,683
    Plugin Contributions
    123

    Default Re: Google Recaptcha v3 deprecated constructor

    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  3. #3
    Join Date
    Apr 2010
    Posts
    265
    Plugin Contributions
    1

    Default Re: Google Recaptcha v3 deprecated constructor

    Thank you. That seems to have worked. Hopefully the spam from the contact form stops now.

 

 

Similar Threads

  1. Google Recaptcha v3
    By Carbonless in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 5 Jan 2022, 01:53 PM
  2. v157 ups has a deprecated constructor
    By Cpt Tom in forum Addon Shipping Modules
    Replies: 3
    Last Post: 31 Dec 2020, 08:41 PM
  3. v156 Google reCaptcha
    By rensing in forum All Other Contributions/Addons
    Replies: 4
    Last Post: 29 Apr 2020, 04:59 PM
  4. Google NEW (2014 version) reCAPTCHA 2.0
    By marcopolo in forum General Questions
    Replies: 0
    Last Post: 14 Jun 2015, 06:54 PM
  5. v150 Installing old Google ReCaptcha addon - ZC1.50
    By Miff in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 28 Feb 2012, 07:37 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR