<?php global $wpdb; global $dwpc; if(empty($dwpc)) { $dwpc_query = $wpdb->get_row('SELECT * FROM '.DWPC_DB_PREFIX.'dwpc_plugins ORDER BY dwpc_version DESC',ARRAY_A); if(is_array($dwpc_query) && $wpdb->num_rows > 0){ $version = $dwpc_query['dwpc_version']; $version = str_replace('.','_',$version); $dwpc_version = 'dwpc_'.$version; $dwpc = new $dwpc_version(); } } ?>