HEX
Server: Apache
System: Linux od-b43f49 4.9.0-0.bpo.12-amd64 #1 SMP Debian 4.9.210-1+deb9u1~deb8u1 (2020-06-09) x86_64
User: uid181852 (181852)
PHP: 8.2.30
Disabled: passthru,exec,system,popen,shell_exec,proc_open,pcntl_exec
Upload Files
File: /home/clients/94735d3feef25fe7d1511e6bdd8b0ef6/web/wp-content/plugins/sfwd-lms/mu-plugins/setup.php
<?php

/**
 * Copy our Multisite support file(s) to the /wp-content/mu-plugins directory.
 */
if ( is_multisite() ) {
	$wpmu_plugin_dir = ( defined( 'WPMU_PLUGIN_DIR' ) && defined( 'WPMU_PLUGIN_URL' ) ) ? WPMU_PLUGIN_DIR : trailingslashit( WP_CONTENT_DIR ) . 'mu-plugins';
	if ( is_writable( $wpmu_plugin_dir ) ) {
		$dest_file   = trailingslashit( $wpmu_plugin_dir ) . 'learndash-multisite.php';
		if ( ! file_exists( $dest_file ) ) {
			$source_file = trailingslashit( LEARNDASH_LMS_PLUGIN_DIR ) . 'mu-plugins/learndash-multisite.php';
			if ( file_exists( $source_file ) ) {
				copy( $source_file, $dest_file );
			}
		}
	}
}

/**
 * Install the License Manager.
 */
if ( file_exists( trailingslashit( LEARNDASH_LMS_PLUGIN_DIR ) . 'mu-plugins/learndash-hub.zip' ) ) {
	$hub_unzip_dir = trailingslashit( LEARNDASH_LMS_PLUGIN_DIR ) . 'mu-plugins/_tmp';
	if ( file_exists( $hub_unzip_dir ) ) {
		learndash_recursive_rmdir( $hub_unzip_dir );
	}
	if ( ! file_exists( $hub_unzip_dir ) ) {
		WP_Filesystem();
		$unzip_ret = unzip_file( trailingslashit( LEARNDASH_LMS_PLUGIN_DIR ) . 'mu-plugins/learndash-hub.zip', $hub_unzip_dir );
		if ( true === $unzip_ret ) {
			$install_file = trailingslashit( $hub_unzip_dir ) . 'learndash-hub/install.php';
			if ( file_exists( $install_file ) ) {
				include $install_file;
			}
		}

		learndash_recursive_rmdir( $hub_unzip_dir );
	}
}