HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux wordpress-ubuntu-s-2vcpu-4gb-fra1-01 5.4.0-169-generic #187-Ubuntu SMP Thu Nov 23 14:52:28 UTC 2023 x86_64
User: root (0)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/lipovac/wp-content/plugins/the-events-calendar/common/src/Tribe/Abstract_Deactivation.php
<?php

abstract class Tribe__Abstract_Deactivation {
	protected $network = false;

	public function __construct( $network ) {
		$this->network = (bool) $network;
	}

	/**
	 * Tell WordPress to flush rewrite rules.
	 * Since our post types are already registered,
	 * we delete the option and let WP regenerate it
	 * on the next page load.
	 */
	protected function flush_rewrite_rules() {
		delete_option( 'rewrite_rules' );
	}

	/**
	 * Deactivate the plugin. This should not remove data.
	 * It's job is to remove run-time traces of the plugin.
	 *
	 * @return void
	 */
	public function deactivate() {
		if ( is_multisite() && $this->network ) {
			$this->multisite_deactivate();
		} else {
			$this->blog_deactivate();
		}
	}

	/**
	 * Run the deactivation script on every blog for a multisite install
	 *
	 * @return void
	 */
	protected function multisite_deactivate() {
		/** @var wpdb $wpdb */
		global $wpdb;
		$site = get_current_site();
		$blog_ids = $wpdb->get_col( $wpdb->prepare( "SELECT blog_id FROM {$wpdb->blogs} WHERE site_id=%d", $site->id ) );
		$large = wp_is_large_network();
		foreach ( $blog_ids as $blog ) {
			tribe_set_time_limit( 30 );
			switch_to_blog( $blog );
			$large ? $this->short_blog_deactivate() : $this->blog_deactivate();
			restore_current_blog();
		}
	}

	/**
	 * The deactivation routine for a single blog
	 *
	 * @return void
	 */
	abstract protected function blog_deactivate();


	/**
	 * An abridged version that is less DB intensive for use on large networks.
	 *
	 * @see wp_is_large_network() and the 'wp_is_large_network' filter
	 *
	 * @return void
	 */
	protected function short_blog_deactivate() {
		$this->blog_deactivate();
	}
}