| 1 |
<?php |
| 2 |
|
| 3 |
if ( ! defined( 'ABSPATH' ) ) exit; |
| 4 |
|
| 5 |
if ( class_exists( 'MeowPro_CDEGN_Core' ) && class_exists( 'Meow_CDEGN_Core' ) ) { |
| 6 |
|
| 7 |
function cdegn_thanks_admin_notices() { |
| 8 |
$message = esc_html__( 'Thanks for installing the Pro version of Code Engine :) However, the free version is still enabled. Please disable or uninstall it.', 'code-engine' ); |
| 9 |
echo '<div class="error"><p>' . esc_html( $message ) . '</p></div>'; |
| 10 |
} |
| 11 |
|
| 12 |
add_action( 'admin_notices', 'cdegn_thanks_admin_notices' ); |
| 13 |
return; |
| 14 |
} |
| 15 |
|
| 16 |
spl_autoload_register(function ( $class ) { |
| 17 |
$necessary = true; |
| 18 |
$file = null; |
| 19 |
if ( strpos( $class, 'Meow_CDEGN_Snippets' ) !== false ) { |
| 20 |
$file = CDEGN_PATH . '/classes/snippets/' . str_replace( 'meow_cdegn_snippets_', '', strtolower( $class ) ) . '.php'; |
| 21 |
} |
| 22 |
else if ( strpos( $class, 'Meow_CDEGN_Models' ) !== false ) { |
| 23 |
$file = CDEGN_PATH . '/classes/models/' . str_replace( 'meow_cdegn_models_', '', strtolower( $class ) ) . '.php'; |
| 24 |
} |
| 25 |
else if ( strpos( $class, 'Meow_CDEGN' ) !== false ) { |
| 26 |
$file = CDEGN_PATH . '/classes/' . str_replace( 'meow_cdegn_', '', strtolower( $class ) ) . '.php'; |
| 27 |
} |
| 28 |
else if ( strpos( $class, 'MeowPro_CDEGN' ) !== false ) { |
| 29 |
$necessary = false; |
| 30 |
$file = CDEGN_PATH . '/premium/' . str_replace( 'meowpro_cdegn_', '', strtolower( $class ) ) . '.php'; |
| 31 |
} |
| 32 |
if ( $file ) { |
| 33 |
if ( !$necessary && !file_exists( $file ) ) { |
| 34 |
return; |
| 35 |
} |
| 36 |
require( $file ); |
| 37 |
} |
| 38 |
}); |
| 39 |
|
| 40 |
global $cdegn_core; |
| 41 |
$cdegn_core = new Meow_CDEGN_Core(); |
| 42 |
|
| 43 |
?> |
| 44 |
|