# master-addons/3.1.9/inc/classes/upgrades/upgrade-3.1.4.php

Master Addons for Elementor – Elementor Addons, Widgets, Mega Menu Builder, Popup Builder, Widget Builder &amp; Template Kits, version 3.1.9. 33 lines.

- Page: https://pluginprobe.com/plugins/master-addons/3.1.9/code/inc/classes/upgrades/upgrade-3.1.4.php
- Raw: https://pluginprobe.com/plugins/master-addons/3.1.9/raw/inc/classes/upgrades/upgrade-3.1.4.php
- Modified: 2026-06-18T08:41:30+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/master-addons/3.1.9/code/inc/classes/upgrades/upgrade-3.1.4.php#L10-L20`.

```php
<?php
/**
 * Upgrade routine for 3.1.4.
 *
 * Renames legacy ma_* popup data to the jltma_* prefix:
 *   - custom table {$prefix}ma_popups -> {$prefix}jltma_popups
 *   - option        ma_popup_settings -> jltma_popup_settings
 *
 * Idempotent: safe if the legacy names are already absent.
 */

if (!defined('ABSPATH')) {
	exit;
}

global $wpdb;

$old_table  = $wpdb->prefix . 'ma_popups';
$new_table  = $wpdb->prefix . 'jltma_popups';
$old_exists = $wpdb->get_var($wpdb->prepare('SHOW TABLES LIKE %s', $old_table));
$new_exists = $wpdb->get_var($wpdb->prepare('SHOW TABLES LIKE %s', $new_table));

if ($old_exists === $old_table && $new_exists !== $new_table) {
	// Identifiers cannot be bound; both names are server-generated (prefix + literal), not user input.
	$wpdb->query("RENAME TABLE `{$old_table}` TO `{$new_table}`");
}

$legacy_settings = get_option('ma_popup_settings', null);
if (null !== $legacy_settings && false === get_option('jltma_popup_settings', false)) {
	update_option('jltma_popup_settings', $legacy_settings);
	delete_option('ma_popup_settings');
}

```
