| 1 |
<?php |
| 2 |
/** |
| 3 |
* @link https://compressx.io |
| 4 |
* @since 0.9.1 |
| 5 |
* |
| 6 |
* @wordpress-plugin |
| 7 |
* Plugin Name: CompressX |
| 8 |
* Description: Convert JPG and PNG images to WebP and AVIF, compress WebP and AVIF. |
| 9 |
* Version: 0.9.13 |
| 10 |
* Author: WPvivid Team |
| 11 |
* Author URI: https://compressx.io |
| 12 |
* License: GPL-3.0+ |
| 13 |
* License URI: http://www.gnu.org/copyleft/gpl.html |
| 14 |
**/ |
| 15 |
|
| 16 |
// If this file is called directly, abort. |
| 17 |
if ( ! defined( 'WPINC' ) ) |
| 18 |
{ |
| 19 |
die; |
| 20 |
} |
| 21 |
|
| 22 |
define( 'COMPRESSX_VERSION', '0.9.13' ); |
| 23 |
|
| 24 |
define( 'COMPRESSX_SLUG', 'CompressX' ); |
| 25 |
define( 'COMPRESSX_NAME', plugin_basename( __FILE__ ) ); |
| 26 |
define( 'COMPRESSX_URL', plugins_url( '', __FILE__ ) ); |
| 27 |
define( 'COMPRESSX_DIR', dirname( __FILE__ ) ); |
| 28 |
|
| 29 |
if ( isset( $compressx ) && is_a( $compressx, 'CompressX' ) ) |
| 30 |
{ |
| 31 |
return; |
| 32 |
} |
| 33 |
|
| 34 |
function compressx_actvation_action() |
| 35 |
{ |
| 36 |
include_once COMPRESSX_DIR . '/includes/class-compressx-default-folder.php'; |
| 37 |
$dir=new CompressX_default_folder(); |
| 38 |
$dir->create_uploads_dir(); |
| 39 |
|
| 40 |
include_once COMPRESSX_DIR . '/includes/class-compressx-webp-rewrite.php'; |
| 41 |
|
| 42 |
$rewrite=new CompressX_Webp_Rewrite(); |
| 43 |
$rewrite->create_rewrite_rules(); |
| 44 |
} |
| 45 |
|
| 46 |
function compressx_deactivation_action() |
| 47 |
{ |
| 48 |
include_once COMPRESSX_DIR . '/includes/class-compressx-webp-rewrite.php'; |
| 49 |
|
| 50 |
$rewrite=new CompressX_Webp_Rewrite(); |
| 51 |
|
| 52 |
$rewrite->remove_rewrite_rule(); |
| 53 |
} |
| 54 |
|
| 55 |
register_activation_hook(__FILE__, 'compressx_actvation_action'); |
| 56 |
register_deactivation_hook(__FILE__, 'compressx_deactivation_action'); |
| 57 |
require plugin_dir_path( __FILE__ ) . 'includes/class-compressx.php'; |
| 58 |
|
| 59 |
function run_compressx() |
| 60 |
{ |
| 61 |
$compressx = new CompressX(); |
| 62 |
$GLOBALS['compressx'] = $compressx; |
| 63 |
} |
| 64 |
run_compressx(); |