| 1 |
<?php |
| 2 |
use Imagify\Dependencies\League\Container\Container; |
| 3 |
use Imagify\Plugin; |
| 4 |
|
| 5 |
defined( 'ABSPATH' ) || exit; |
| 6 |
|
| 7 |
if ( file_exists( IMAGIFY_PATH . 'vendor/autoload.php' ) ) { |
| 8 |
require_once IMAGIFY_PATH . 'vendor/autoload.php'; |
| 9 |
} |
| 10 |
|
| 11 |
require_once IMAGIFY_PATH . 'inc/Dependencies/ActionScheduler/action-scheduler.php'; |
| 12 |
|
| 13 |
/** |
| 14 |
* Plugin init. |
| 15 |
* |
| 16 |
* @since 1.0 |
| 17 |
*/ |
| 18 |
function imagify_init() { |
| 19 |
// Nothing to do during autosave. |
| 20 |
if ( defined( 'DOING_AUTOSAVE' ) ) { |
| 21 |
return; |
| 22 |
} |
| 23 |
|
| 24 |
$providers = require_once IMAGIFY_PATH . 'config/providers.php'; |
| 25 |
|
| 26 |
$plugin = new Plugin( |
| 27 |
new Container(), |
| 28 |
array( |
| 29 |
'plugin_path' => IMAGIFY_PATH, |
| 30 |
) |
| 31 |
); |
| 32 |
|
| 33 |
$plugin->init( $providers ); |
| 34 |
} |
| 35 |
add_action( 'plugins_loaded', 'imagify_init' ); |
| 36 |
|