<?php
/**
 * Copyright (C) 2014-2025 ServMask Inc.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Attribution: This code is part of the All-in-One WP Migration plugin, developed by ServMask Inc.
 *
 * MODIFIED: All update/telemetry/phone-home functionality has been surgically removed.
 *           All methods return empty values or do nothing. No external HTTP requests are made.
 *           Core export/import/backup/restore functionality remains 100% intact.
 */

if ( ! defined( 'ABSPATH' ) ) {
	die( 'Kangaroos cannot jump here' );
}

class Ai1wm_Updater {

	/**
	 * Retrieve plugin installer pages from WordPress Plugins API.
	 * 
	 * MODIFIED: Returns original result without any modifications.
	 * All update/telemetry functionality removed.
	 *
	 * @param  mixed        $result
	 * @param  string       $action
	 * @param  array|object $args
	 * @return mixed
	 */
	public static function plugins_api( $result, $action = null, $args = null ) {
		// Return original result - no modifications, no external calls
		return $result;
	}

	/**
	 * Update WordPress plugin list page.
	 * 
	 * MODIFIED: Returns original transient without any modifications.
	 * No update checks or plugin list modifications.
	 *
	 * @param  object $transient
	 * @return object
	 */
	public static function update_plugins( $transient ) {
		global $wp_version;

		// Creating default object from empty value
		if ( ! is_object( $transient ) ) {
			$transient = (object) array();
		}

		// Return original transient - no updates added
		return $transient;
	}

	/**
	 * Check for extension updates
	 * 
	 * MODIFIED: Completely disabled. Does nothing, makes no external calls.
	 * Returns true to maintain compatibility with any calling code.
	 *
	 * @return boolean
	 */
	public static function check_for_updates() {
		// Do nothing - no external HTTP requests, no update checks
		return true;
	}

	/**
	 * Add "Check for updates" link
	 * 
	 * MODIFIED: Returns original plugin meta without any "Check for updates" links.
	 * No update-related UI elements added.
	 *
	 * @param  array  $plugin_meta An array of the plugin's metadata, including the version, author, author URI, and plugin URI
	 * @param  string $plugin_file Path to the plugin file relative to the plugins directory
	 * @return array
	 */
	public static function plugin_row_meta( $plugin_meta, $plugin_file ) {
		// Return original plugin meta - no "Check for updates" links
		return $plugin_meta;
	}
}
