From 0607337f6b0e59566c2433a83fb5f9158345c89b Mon Sep 17 00:00:00 2001 From: Alexander Schlarb Date: Fri, 16 Mar 2018 15:40:35 +0100 Subject: [PATCH] Also check in the WordPress base directory for the PG4WP files --- pg4wp/db.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pg4wp/db.php b/pg4wp/db.php index 6f55375..798e715 100644 --- a/pg4wp/db.php +++ b/pg4wp/db.php @@ -25,11 +25,15 @@ define( 'PG4WP_INSECURE', false); // 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')) 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'); +else if( file_exists( ABSPATH.'/pg4wp')) + define( 'PG4WP_ROOT', ABSPATH.'/pg4wp'); +else + die('PG4WP file directory not found'); // Here happens all the magic require_once( PG4WP_ROOT.'/core.php');