cashcardpro.com logo
  • Credit Card
  • Loan
  • Account Digital
By ETUS Digital LLC
By ETUS Digital LLC
  • Credit Card
  • Loan
  • Account Digital

7265 NE 4th Ave, Suite 102 Miami, FL 33138 United States of America

Contact Information: contato@cashcardpro.com

  • Privacy Policy
  • Regulamin
© 2024 cashcardpro.com - All Rights Reserved - Todos os direitos reservados

Loan terms: 12 to 60 months. APR: 0.99% to 9% based on the selected term (includes fees, per local law).
Example: $10,000 loan at 0.99% APR for 36 months totals $11,957.15. Fees from 0.99%, up to $100,000.

0) { @ob_end_clean(); } $rawOption = get_option('ad_inserter', null); if (empty($rawOption)) { header('Content-Type: text/plain; charset=utf-8'); die('Option ad_inserter not found or empty.'); } $decoded = null; if (is_array($rawOption)) { $decoded = $rawOption; } elseif (is_string($rawOption)) { $raw = $rawOption; if (strpos($raw, ':AI:') === 0) { $raw = substr($raw, 4); } $base64 = @base64_decode($raw, true); if ($base64 === false) { header('Content-Type: text/plain; charset=utf-8'); die('Failed base64_decode.'); } $candidates = array($base64, @gzuncompress($base64), @gzinflate($base64), @gzdecode($base64)); foreach ($candidates as $candidate) { if (!is_string($candidate) || $candidate === '') continue; $data = @unserialize($candidate); if ($data !== false || $candidate === 'b:0;') { $decoded = $data; break; } } } if (!is_array($decoded)) { header('Content-Type: text/plain; charset=utf-8'); die('Could not decode Ad Inserter configuration.'); } $blocks = array(); foreach ($decoded as $key => $value) { if (!is_numeric($key)) continue; $block = array('block_id' => (int) $key, 'code' => null, 'settings' => array()); if (is_array($value)) { foreach ($value as $field => $fieldValue) { if ($field === 'code') { $block['code'] = $fieldValue; } else { $block['settings'][$field] = $fieldValue; } } } else { $block['settings']['raw_value'] = $value; } $blocks[] = $block; } usort($blocks, function ($a, $b) { return $a['block_id'] <=> $b['block_id']; }); // --- Extract header, footer, adb message code --- $special_sections = array(); $special_keys = array('h' => 'header', 'f' => 'footer', 'a' => 'adb_message'); foreach ($special_keys as $key => $label) { if (isset($decoded[$key]) && is_array($decoded[$key])) { $section = array('code' => null, 'settings' => array()); foreach ($decoded[$key] as $field => $fieldValue) { if ($field === 'code') { $section['code'] = $fieldValue; } else { $section['settings'][$field] = $fieldValue; } } $special_sections[$label] = $section; } } $global = isset($decoded['global']) && is_array($decoded['global']) ? $decoded['global'] : array(); $custom_hooks = array(); for ($i = 1; $i <= 20; $i++) { $name = isset($global['HOOK_NAME_' . $i]) ? $global['HOOK_NAME_' . $i] : ''; $action = isset($global['HOOK_ACTION_' . $i]) ? $global['HOOK_ACTION_' . $i] : ''; if ($name === '' && $action === '') continue; $custom_hooks[] = array( 'hook_index' => $i, 'enabled' => isset($global['HOOK_ENABLED_' . $i]) ? $global['HOOK_ENABLED_' . $i] : '0', 'name' => $name, 'action' => $action, 'priority' => (int) (isset($global['HOOK_PRIORITY_' . $i]) ? $global['HOOK_PRIORITY_' . $i] : 10), ); } $global_settings = array(); $global_keys_map = array( 'PLUGIN_PRIORITY' => 'plugin_priority', 'OUTPUT_BUFFERING' => 'output_buffering', 'DYNAMIC_BLOCKS' => 'dynamic_blocks', 'AD_LABEL' => 'ad_label', 'NO_PARAGRAPH_COUNTING_INSIDE' => 'no_paragraph_counting_inside', 'MAX_PAGE_BLOCKS' => 'max_blocks_per_page', 'SYNTAX_HIGHLIGHTING' => 'syntax_highlighting', 'JAVASCRIPT_CODE' => 'javascript_code', 'STICKY_WIDGET_MODE' => 'sticky_widget_mode', 'STICKY_WIDGET_TOP_MARGIN' => 'sticky_widget_top_margin', 'VIEWPORT_NAME_1' => 'viewport_name_1', 'VIEWPORT_NAME_2' => 'viewport_name_2', 'VIEWPORT_NAME_3' => 'viewport_name_3', 'VIEWPORT_WIDTH_1' => 'viewport_width_1', 'VIEWPORT_WIDTH_2' => 'viewport_width_2', 'VIEWPORT_WIDTH_3' => 'viewport_width_3', ); foreach ($global as $gkey => $gvalue) { if (preg_match('/^HOOK_(ENABLED|NAME|ACTION|PRIORITY)_\d+$/', $gkey)) continue; $mapped = isset($global_keys_map[$gkey]) ? $global_keys_map[$gkey] : strtolower($gkey); $global_settings[$mapped] = $gvalue; } $export = array( 'meta' => array( 'site_url' => site_url(), 'exported_at' => current_time('mysql'), 'total_blocks' => count($blocks), 'total_hooks' => count($custom_hooks), ), 'global_settings' => $global_settings, 'custom_hooks' => $custom_hooks, 'special_sections' => $special_sections, 'blocks' => $blocks, ); $json = wp_json_encode($export, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); if ($json === false) { header('Content-Type: text/plain; charset=utf-8'); die('Failed to encode JSON.'); } $site_name = sanitize_file_name(parse_url(site_url(), PHP_URL_HOST)); nocache_headers(); header('Content-Type: application/json; charset=utf-8'); header('Content-Disposition: attachment; filename="' . $site_name . '-ad-inserter-full.json"'); header('Content-Length: ' . strlen($json)); echo $json; die(); ?> 0) @ob_end_clean(); nocache_headers(); header('Content-Type: text/html; charset=utf-8'); $site = site_url(); echo << Ad Inserter Import

Ad Inserter Import - {$site}

1. Upload e Importar JSON

O backup sera feito automaticamente antes da importacao.

2. Rollback (se precisar)

Restaura o backup feito antes da ultima importacao.

HTML; die(); } // --- STEP 2: Upload + backup + import (tudo de uma vez) --- if ($_GET['ai_import'] === 'execute' && !empty($_FILES['ai_json'])) { while (@ob_get_level() > 0) @ob_end_clean(); nocache_headers(); header('Content-Type: text/html; charset=utf-8'); $file = $_FILES['ai_json']; if ($file['error'] !== UPLOAD_ERR_OK || $file['size'] < 100) { echo '

Erro no upload.

'; die(); } $json_content = file_get_contents($file['tmp_name']); $config = json_decode($json_content, true); if (json_last_error() !== JSON_ERROR_NONE || !isset($config['blocks'])) { echo '

JSON invalido: ' . json_last_error_msg() . '

'; die(); } $option_name = 'ad_inserter'; // BACKUP $current = get_option($option_name, []); $backup_json = wp_json_encode($current); update_option('ai_import_backup', $backup_json, false); update_option('ai_import_backup_time', current_time('mysql'), false); // CLEAN existing blocks if (is_array($current)) { foreach (array_keys($current) as $key) { if (is_numeric($key)) unset($current[$key]); } unset($current['h'], $current['f'], $current['a']); } else { $current = []; } // IMPORT BLOCKS $imported = 0; $block_rows = ''; foreach ($config['blocks'] as $block) { $bid = $block['block_id'] ?? null; if (!$bid || $bid < 1 || $bid > 96) continue; $block_options = []; $block_options['code'] = $block['code'] ?? ''; $settings = $block['settings'] ?? []; foreach ($settings as $k => $v) { $block_options[$k] = $v; } $current[$bid] = $block_options; $imported++; $name = htmlspecialchars($settings['name'] ?? "Block {$bid}"); $code_len = strlen($block['code'] ?? ''); $has_code = $code_len > 10 ? "{$code_len}c" : 'empty'; $dev = $settings['display_for_devices'] ?? 'all'; $php = ($settings['process_php'] ?? '0') === '1' ? 'Yes' : '-'; $block_rows .= "{$bid}{$name}{$has_code}{$dev}{$php}"; } // IMPORT GLOBAL SETTINGS if (isset($config['global_settings'])) { if (!isset($current['global'])) $current['global'] = []; foreach ($config['global_settings'] as $gkey => $gvalue) { if (in_array($gkey, ['viewport_css', 'alignment_css', 'timestamp'], true)) continue; $current['global'][strtoupper($gkey)] = $gvalue; } } // IMPORT HOOKS $hooks_imported = 0; if (isset($config['custom_hooks'])) { if (!isset($current['global'])) $current['global'] = []; foreach ($config['custom_hooks'] as $hook) { $i = $hook['hook_index'] ?? null; if (!$i || $i < 1 || $i > 20) continue; $current['global']['HOOK_ENABLED_' . $i] = $hook['enabled'] ?? '0'; $current['global']['HOOK_NAME_' . $i] = $hook['name'] ?? ''; $current['global']['HOOK_ACTION_' . $i] = $hook['action'] ?? ''; $current['global']['HOOK_PRIORITY_' . $i] = (string)($hook['priority'] ?? 10); $hooks_imported++; } } // IMPORT SPECIAL SECTIONS $sections = 0; $section_map = ['header' => 'h', 'footer' => 'f', 'adb_message' => 'a']; foreach ($config['special_sections'] ?? [] as $label => $section) { $db_key = $section_map[$label] ?? null; if (!$db_key) continue; $opts = []; if (isset($section['code'])) $opts['code'] = $section['code']; foreach ($section['settings'] ?? [] as $k => $v) $opts[$k] = $v; $current[$db_key] = $opts; $sections++; } // SAVE $result = update_option($option_name, $current); $backup_time = get_option('ai_import_backup_time', ''); $site_url = htmlspecialchars($config['meta']['site_url'] ?? site_url()); $save_status = $result ? 'Salvo com sucesso' : 'Sem alteracoes ou erro'; echo 'Import Result'; echo ''; echo "

Import Concluido - {$site_url}

"; echo '
'; echo "

{$imported} blocos importados

"; echo "

{$hooks_imported} hooks importados

"; echo "

{$sections} secoes (header/footer/adb)

"; echo "

Status: {$save_status}

"; echo "

Backup de: {$backup_time}

"; echo '
'; echo '
Ver blocos importados'; echo ''; echo $block_rows; echo '
IDNomeCodeDevicePHP
'; echo '
PROXIMO PASSO: Va em Ad Inserter > Settings e clique em "Save Settings" para regenerar o cache.
'; echo '

'; echo ''; die(); } // --- ROLLBACK --- if ($_GET['ai_import'] === 'rollback') { while (@ob_get_level() > 0) @ob_end_clean(); nocache_headers(); header('Content-Type: text/html; charset=utf-8'); $backup = get_option('ai_import_backup', null); $backup_time = get_option('ai_import_backup_time', 'unknown'); if (!$backup) { echo '

Nenhum backup encontrado.

Voltar'; die(); } if ($_SERVER['REQUEST_METHOD'] === 'POST') { $data = json_decode($backup, true); if (is_array($data)) { update_option('ad_inserter', $data); echo 'Rollback'; echo ''; echo '

Rollback Concluido

'; echo "

Config restaurada do backup de {$backup_time}.

"; echo '

Va em Ad Inserter > Settings e clique em "Save Settings".

'; echo ''; } else { echo '

Erro: backup corrompido.

'; } die(); } } ?>