set_plugin_constants();
// Composer autoloader.
require_once PT_OCDI_PATH . 'vendor/autoload.php';
// Instantiate the main plugin class *Singleton*.
$pt_one_click_demo_import = OCDI\OneClickDemoImport::get_instance();
// Register WP CLI commands
if ( defined( 'WP_CLI' ) && WP_CLI ) {
WP_CLI::add_command( 'ocdi list', array( 'OCDI\WPCLICommands', 'list_predefined' ) );
WP_CLI::add_command( 'ocdi import', array( 'OCDI\WPCLICommands', 'import' ) );
}
}
}
/**
* Display an admin error notice when PHP is older the version 5.3.2.
* Hook it to the 'admin_notices' action.
*/
public function old_php_admin_error_notice() {
$message = sprintf( esc_html__( 'The %2$sOne Click Demo Import%3$s plugin requires %2$sPHP 5.3.2+%3$s to run properly. Please contact your hosting company and ask them to update the PHP version of your site to at least PHP 5.3.2.%4$s Your current version of PHP: %2$s%1$s%3$s', 'pt-ocdi' ), phpversion(), '', '', '
' );
printf( '
%1$s