Remove Debug Code for version

This commit is contained in:
Josh Knapp 2025-04-22 13:46:42 -07:00
parent db1d5f8945
commit e94ef7b84b

View File

@ -48,11 +48,6 @@ function fwembed_check_for_updates() {
if ($response) { if ($response) {
$release_info = json_decode($response); $release_info = json_decode($response);
// Update debug info with latest version
$debug_data['latest_version'] = $release_info->tag_name ?? 'Not found';
$debug_data['response'] = substr(print_r($release_info, true), 0, 1000);
update_option('fwembed_update_debug', $debug_data);
// Get latest version from tag name // Get latest version from tag name
$latest_version = $release_info->tag_name; $latest_version = $release_info->tag_name;
@ -96,8 +91,8 @@ function fwembed_check_for_updates() {
'package' => $download_url, 'package' => $download_url,
'icons' => [], 'icons' => [],
'banners' => [], 'banners' => [],
'tested' => '6.4.2', 'tested' => '6.8',
'requires' => '5.0', 'requires' => '6.2',
'compatibility' => new stdClass(), 'compatibility' => new stdClass(),
]; ];
@ -108,23 +103,6 @@ function fwembed_check_for_updates() {
} }
add_action('admin_init', 'fwembed_check_for_updates'); add_action('admin_init', 'fwembed_check_for_updates');
// Add admin notice for debugging
add_action('admin_notices', function() {
if (current_user_can('manage_options')) {
$debug = get_option('fwembed_update_debug', []);
echo '<div class="notice notice-info is-dismissible"><p>Update Debug: Current: ' .
esc_html($debug['current_version'] ?? 'N/A') . ', Latest: ' .
esc_html($debug['latest_version'] ?? 'N/A') . '</p>';
// Detailed debug info with query param
if (isset($_GET['fwembed_debug'])) {
echo '<pre>' . esc_html(print_r($debug, true)) . '</pre>';
}
echo '</div>';
}
});
// Add plugin information for the details popup/changelog // Add plugin information for the details popup/changelog
add_filter('plugins_api', function($result, $action, $args) { add_filter('plugins_api', function($result, $action, $args) {