Modified JComments to support reCAPTCHA2 and PHP7

Modified JComments to support reCAPTCHA2 and PHP7

By Eugene Sivokon Thursday, 29 December 2016

During latest years the Joomla project has shown its greatest potential and lot of things have been implemented. PHP7 was totally rewritten and show colossal performance. so Joomla 3 works like a rocket with PHP7.

  • Joomla! 3.5 runs on about 60% faster than previous PHP 5.6.x
  • Memory consumption dropped by incredible 75% (!)

Starting from Joomla 3.5 the API was a bit changed and it requires the 3rd party extensions to be patched according the new classes.

JComments has a reputation of the best free comments system for Joomla during years, but actual version 3.0.5 of this cool component was released at August, 01 of 2014. A good while ago. So, if you are using JComments with Joomla 3.6.x in PHP7, then you have to examine error.log of your site where bunch of entries like this will be founded:

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; JCommentsACL has a deprecated constructor in /public_html/components/com_jcomments/classes/acl.php on line 17

The component need to be patched to meet PHP7 standards. It’s needed to replace "JCommentsACL" function at "_construct” as a minimum. Another feature required by many of users is Invisible Captcha support (reCAPTCHA2).

Since there is no official release yet, some fans have executed custom works. Thom Dietrich have patched the component to meet PHP7 requirements. And another fan have implemented ReCaptcha 2 in the version based on previous mentioned fan’s work. As a result, the modified Jcomments 3.0.5 version is available. It support reCAPTCHA2 and works fine with PHP 7.

Summary:

  • Compatible to native Joomla ReCaptcha 2 plugin
  • Some PHP7 issues fixed
  • <h4> tags were replaced to <span> tags in comments

This solution was founded in this thread (Russian Support forum).

You can take this fork from Github:

JComments on Github
Please bear in mind this is unofficial JComments release based on another fork and neither Joomlatune nor component developer is responsible for it.

If you tired from standard design, we can offer nice JComments templates that are available in our products section.

Eugene Sivokon

Executive manager, web developer, and Joomla enthusiast. He has been a part of and worked in many of the major web development roles over his 11 years, taking on various projects. Personal site: eugenesivokon.com

Sign up for our newsletter

Enter your e-mail and subscribe to our newsletter and stay tuned to all news and updates of our templates.