WordPress.org

Make WordPress Core

Opened 5 weeks ago

Last modified 5 weeks ago

#40285 new defect (bug)

Themes in the Theme Directory should be required to use TGM-Plugin-Activation version of at least 2.6.1

Reported by: beeneeb Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.7.3
Component: Themes Keywords:
Focuses: Cc:

Description

The theme "Emmet Lite" located in the Wordpress Theme Directory uses version 2.5.2 of TGM-Plugin-Activation. Not only is it a security issue, but also causes fatal errors with other plugins that use the latest version of TGM of 2.6.1.

https://wordpress.org/themes/emmet-lite/

To reproduce, install the Emmet Lite theme & then install this plugin:

https://wordpress.org/plugins/our-team-enhanced/

Expected:

No fatal errors

Actual:

Fatal error: Cannot redeclare tgmpa() (previously declared

Change History (2)

#1 @jrf
5 weeks ago

Hi @beeneeb,

Just to clarify: this is not an issue with the TGMPA version being used, there is no conflict between TGMPA 2.4.1+ and higher versions.

This is a "typo" - or rather, search and replace error - made by the theme author who has manually adjusted the code in the TGMPA class.

Around line 1920, you will find a line that should read:
if ( ! function_exists( 'tgmpa' ) ) {

but will have been changed to read:
if ( ! function_exists( 'theme-slug' ) ) {

As they incorrectly changed it, the actual function which is wrapped within that if statement is being redefined causing that error.

Theme authors are advised to download a fresh copy of TGMPA whenever they release and/or upgrade a theme using the Custom TGMPA Generator. The Custom TGMPA Generator will serve them with a customized download of TGMPA which will automagically have done the search & replace for them in the correct way which prevents this issue.

#2 @jcastaneda
5 weeks ago

Hi @beeneeb!

What you can also do is comment on the theme's latest trac ticket and let them know about this issue or even posting on their support forum: https://wordpress.org/support/theme/emmet-lite

Note: See TracTickets for help on using tickets.