Also check in the WordPress base directory for the PG4WP files

This commit is contained in:
Alexander Schlarb
2018-03-16 15:40:35 +01:00
parent 06884bd732
commit 0607337f6b

View File

@ -25,11 +25,15 @@ define( 'PG4WP_LOG_ERRORS', true);
define( 'PG4WP_INSECURE', false); define( 'PG4WP_INSECURE', false);
// This defines the directory where PG4WP files are loaded from // This defines the directory where PG4WP files are loaded from
// 2 places checked : wp-content and wp-content/plugins // 3 places checked : wp-content, wp-content/plugins and the base directory
if( file_exists( ABSPATH.'/wp-content/pg4wp')) if( file_exists( ABSPATH.'/wp-content/pg4wp'))
define( 'PG4WP_ROOT', ABSPATH.'/wp-content/pg4wp'); define( 'PG4WP_ROOT', ABSPATH.'/wp-content/pg4wp');
else else if( file_exists( ABSPATH.'/wp-content/plugins/pg4wp'))
define( 'PG4WP_ROOT', ABSPATH.'/wp-content/plugins/pg4wp'); define( 'PG4WP_ROOT', ABSPATH.'/wp-content/plugins/pg4wp');
else if( file_exists( ABSPATH.'/pg4wp'))
define( 'PG4WP_ROOT', ABSPATH.'/pg4wp');
else
die('PG4WP file directory not found');
// Here happens all the magic // Here happens all the magic
require_once( PG4WP_ROOT.'/core.php'); require_once( PG4WP_ROOT.'/core.php');