TGMPA / TGM-Plugin-Activation

TGM Plugin Activation is a PHP library that allows you to easily require or recommend plugins for your WordPress themes (and plugins). It allows your users to install, update and even automatically activate plugins in singular or bulk fashion using native WordPress classes, functions and interfaces. You can reference bundled plugins, plugins from the WordPress Plugin Repository or even plugins hosted elsewhere on the internet.
http://tgmpluginactivation.com/
GNU General Public License v2.0
1.75k stars 431 forks source link

PHP 7.3 Compatibility : Use of undefined constant WP_CONTENT_DIR - assumed 'WP_CONTENT_DIR' #789

Closed etwordpress01 closed 4 years ago

etwordpress01 commented 4 years ago

Hi, We have some issues with that plugin. In PHP version 7.3 it display errors

Use of undefined constant WP_CONTENT_DIR - assumed 'WP_CONTENT_DIR'

This line(3361) create the issue in bulk_install funtion $res = $this->fs_connect( array( WP_CONTENT_DIR, WP_PLUGIN_DIR ) );

Can you please resolve this issue as soon as possible

Thanks

jrfnl commented 4 years ago

@etwordpress01 How are you using TGMPA ?

The WP_CONTENT_DIR constant should always be defined, either in the wp-config.php file or via the wp-includes/default-constants.php file which should both be loaded before TGMPA, so I'd like to understand how you are using TGMPA.

Please provide detailed steps on how to reproduce this issue.

etwordpress01 commented 4 years ago

Hi, @jrfnl Thank you for the quick response

We are using TGMP plugin into our premium themes. We are including attached file into WordPress functions.php https://www.dropbox.com/s/uqwu2tpqajsltwh/tgmp.zip?dl=0

We just faced below issues when go to PHP version 7.3

Warning: Use of undefined constant WP_CONTENT_DIR - assumed 'WP_CONTENT_DIR' (this will throw an Error in a future version of PHP) in /home1/houzillo/public_html/projects/doctreat/wp-includes/load.php on line 141

and this constant is being used in only TGMP plugin which is included in theme. I though might be this would be the reason.

Can you please confirm it?

Thanks

Thanks

jrfnl commented 4 years ago

@etwordpress01 Please post code in gists instead as downloads via dropbox. I'm not risking downloading viruses.

Warning: Use of undefined constant WP_CONTENT_DIR - assumed 'WP_CONTENT_DIR' (this will throw an Error in a future version of PHP) in /home1/houzillo/public_html/projects/doctreat/wp-includes/load.php on line 141

Either way, that error does not come from TGMPA, but from the wp-includes/load.php file which is part of WordPress Core. If you are on the latest version of WP, you may want to file a bug in Trac, otherwise: please upgrade your WP install and try again.