updated plugin Gitium
version 1.2.1
This commit is contained in:
@ -1,26 +1,58 @@
|
||||
<?php
|
||||
/* Copyright 2014-2016 Presslabs SRL <ping@presslabs.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License, version 2, as
|
||||
published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
/**
|
||||
* Gitium provides automatic git version control and deployment for
|
||||
* your plugins and themes integrated into wp-admin.
|
||||
*
|
||||
* Copyright (C) 2014-2025 PRESSINFRA SRL <ping@presslabs.com>
|
||||
*
|
||||
* Gitium is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* any later version.
|
||||
*
|
||||
* Gitium is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Gitium. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @package Gitium
|
||||
*/
|
||||
|
||||
header( 'Content-Type: text/html' );
|
||||
define( 'SHORTINIT', true );
|
||||
//$wordpress_loader = $_SERVER['DOCUMENT_ROOT'] . '/wp-load.php';
|
||||
$wordpress_loader = filter_input(INPUT_SERVER, 'DOCUMENT_ROOT', FILTER_SANITIZE_FULL_SPECIAL_CHARS) . '/wp-load.php';
|
||||
|
||||
require_once $wordpress_loader;
|
||||
$current_dir = __DIR__;
|
||||
|
||||
// Define an array of possible WordPress root locations
|
||||
$try_wp_roots = [
|
||||
getenv('DOCUMENT_ROOT'),
|
||||
filter_input(INPUT_SERVER, 'DOCUMENT_ROOT', FILTER_SANITIZE_FULL_SPECIAL_CHARS),
|
||||
realpath($current_dir . '/../../../../../'),
|
||||
realpath($current_dir . '/../../../../'),
|
||||
realpath($current_dir . '/../../../'), // Typical WordPress structure
|
||||
realpath($current_dir . '/../../'), // Alternative structure
|
||||
realpath($current_dir . '/../'), // Closer parent directory
|
||||
$current_dir, // Fallback to current directory
|
||||
];
|
||||
|
||||
$wordpress_loader = null;
|
||||
|
||||
foreach ($try_wp_roots as $root) {
|
||||
if ($root && file_exists($root . '/wp-load.php')) {
|
||||
$wordpress_loader = $root . '/wp-load.php';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($wordpress_loader) {
|
||||
require_once $wordpress_loader;
|
||||
} else {
|
||||
die('Error: Unable to locate wp-load.php. Please verify your WordPress installation.');
|
||||
}
|
||||
|
||||
require_once __DIR__ . '/functions.php';
|
||||
require_once __DIR__ . '/inc/class-git-wrapper.php';
|
||||
|
||||
|
Reference in New Issue
Block a user