| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin Name: SweepPress: Website Cleanup and Optimization |
| 4 |
* Plugin URI: https://sweep.press/ |
| 5 |
* Description: Remove various old, unused, or obsolete data from the WordPress website database and optimize the database for the best website performance. |
| 6 |
* Author: Milan Petrovic |
| 7 |
* Author URI: https://www.dev4press.com/ |
| 8 |
* Text Domain: sweeppress |
| 9 |
* Version: 3.2 |
| 10 |
* Requires at least: 5.8 |
| 11 |
* Tested up to: 6.6 |
| 12 |
* Requires PHP: 7.4 |
| 13 |
* License: GPLv3 or later |
| 14 |
* License URI: https://www.gnu.org/licenses/gpl-3.0.html |
| 15 |
* |
| 16 |
* @package SweepPress |
| 17 |
* |
| 18 |
* == Copyright == |
| 19 |
* Copyright 2008 - 2024 Milan Petrovic (email: support@dev4press.com) |
| 20 |
* |
| 21 |
* This program is free software: you can redistribute it and/or modify |
| 22 |
* it under the terms of the GNU General Public License as published by |
| 23 |
* the Free Software Foundation, either version 3 of the License, or |
| 24 |
* (at your option) any later version. |
| 25 |
* |
| 26 |
* This program is distributed in the hope that it will be useful, |
| 27 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 28 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 29 |
* GNU General Public License for more details. |
| 30 |
* |
| 31 |
* You should have received a copy of the GNU General Public License |
| 32 |
* along with this program. If not, see <http://www.gnu.org/licenses/> |
| 33 |
*/ |
| 34 |
|
| 35 |
use Dev4Press\Plugin\SweepPress\Meta\Monitor; |
| 36 |
use Dev4Press\v49\WordPress; |
| 37 |
|
| 38 |
const SWEEPPRESS_FILE = __FILE__; |
| 39 |
|
| 40 |
$sweeppress_dirname_basic = dirname( SWEEPPRESS_FILE ) . '/'; |
| 41 |
$sweeppress_urlname_basic = plugins_url( '/', SWEEPPRESS_FILE ); |
| 42 |
|
| 43 |
define( 'SWEEPPRESS_PATH', $sweeppress_dirname_basic ); |
| 44 |
define( 'SWEEPPRESS_URL', $sweeppress_urlname_basic ); |
| 45 |
define( 'SWEEPPRESS_D4PLIB_PATH', $sweeppress_dirname_basic . 'd4plib/' ); |
| 46 |
define( 'SWEEPPRESS_D4PLIB_URL', $sweeppress_urlname_basic . 'd4plib/' ); |
| 47 |
|
| 48 |
if ( ! defined( 'SWEEPPRESS_SIMULATION' ) ) { |
| 49 |
define( 'SWEEPPRESS_SIMULATION', false ); |
| 50 |
} |
| 51 |
|
| 52 |
if ( ! defined( 'SWEEPPRESS_SWEEPERS_ALLOW_DB' ) ) { |
| 53 |
define( 'SWEEPPRESS_SWEEPERS_ALLOW_DB', true ); |
| 54 |
} |
| 55 |
|
| 56 |
if ( ! defined( 'SWEEPPRESS_MULTISITE_LIMIT_COUNT' ) ) { |
| 57 |
define( 'SWEEPPRESS_MULTISITE_LIMIT_COUNT', 2048 ); |
| 58 |
} |
| 59 |
|
| 60 |
if ( ! defined( 'SWEEPPRESS_METADATA_MONITOR' ) ) { |
| 61 |
define( 'SWEEPPRESS_METADATA_MONITOR', 'off' ); |
| 62 |
} |
| 63 |
|
| 64 |
require_once SWEEPPRESS_D4PLIB_PATH . 'core.php'; |
| 65 |
|
| 66 |
require_once SWEEPPRESS_PATH . 'core/autoload.php'; |
| 67 |
require_once SWEEPPRESS_PATH . 'core/bridge.php'; |
| 68 |
require_once SWEEPPRESS_PATH . 'core/functions.php'; |
| 69 |
|
| 70 |
if ( SWEEPPRESS_METADATA_MONITOR !== 'off' ) { |
| 71 |
Monitor::instance(); |
| 72 |
} |
| 73 |
|
| 74 |
sweeppress(); |
| 75 |
sweeppress_settings(); |
| 76 |
|
| 77 |
if ( WordPress::instance()->is_admin() ) { |
| 78 |
sweeppress_ajax(); |
| 79 |
sweeppress_admin(); |
| 80 |
} |
| 81 |
|