src/Activators/Updater.php
/**
     * Check if we need to upgrade the table name to add the wp_ prefix
     *
     * @return Updater
     */
Check if we need to upgrade the table name to add the wp_ prefix
@return Updater
Check if we need to upgrade the table name to add the wp_ prefix @return Updater
private function updateTableNames()
    {
        global $wpdb;
        $moloniAPI = $wpdb->prefix . 'moloni_api';
        $moloniAPIConfig = $wpdb->prefix . 'moloni_api_config';
        $query = $wpdb->prepare('SHOW TABLES LIKE %s', 'moloni_api');
        if ($wpdb->get_var($query) === 'moloni_api') {
            $renameQuery = 'RENAME TABLE %s TO %s ;';
            $wpdb->query(sprintf($renameQuery, 'moloni_api', $moloniAPI));
            $wpdb->query(sprintf($renameQuery, 'moloni_api_config', $moloniAPIConfig));
        }
        return $this;
    }
private function updateTableNames ( ) { global $ wpdb ; $ moloniAPI = $ wpdb -> prefix . 'moloni_api' ; $ moloniAPIConfig = $ wpdb -> prefix . 'moloni_api_config' ; $ query = $ wpdb -> prepare ( 'SHOW TABLES LIKE %s' , 'moloni_api' ) ; if ( $ wpdb -> get_var ( $ query ) === 'moloni_api' ) { $ renameQuery = 'RENAME TABLE %s TO %s ;' ; $ wpdb -> query ( sprintf ( $ renameQuery , 'moloni_api' , $ moloniAPI ) ) ; $ wpdb -> query ( sprintf ( $ renameQuery , 'moloni_api_config' , $ moloniAPIConfig ) ) ; } return $ this ; }
Check if we need to upgrade the table name to add the wp_ prefix
 @return Updater
Check if we need to upgrade the table name to add the wp_ prefix @return Updater
// If we still have the old table names, lets update them