- Fix namespace in includes/Multisite/class-multisite.php from WP_Plugin_Starter_Template_For_AI_Coding\Multisite to WPALLSTARS\PluginStarterTemplate\Multisite so autoloader can resolve the class correctly (critical: breaks multisite autoloading) - Fix XSS in admin/js/admin-scripts.js showNotice(): replace HTML string interpolation with safe jQuery DOM API (.text() + .addClass()) - Fix XSS in admin/js/update-source-selector.js showMessage(): replace .html(message) with .text(message) to prevent admin-side XSS - Fix tab indentation in includes/Admin/class-admin.php (3 comment lines using tabs replaced with 4-space project standard) Closes #19
69 lines
1.7 KiB
PHP
69 lines
1.7 KiB
PHP
<?php
|
|
/**
|
|
* Multisite Class
|
|
*
|
|
* This is a placeholder file for multisite-specific functionality.
|
|
* Extend this file or create additional classes in this directory
|
|
* to implement multisite features for your plugin.
|
|
*
|
|
* @package WPALLSTARS\PluginStarterTemplate
|
|
*/
|
|
|
|
namespace WPALLSTARS\PluginStarterTemplate\Multisite;
|
|
|
|
// Exit if accessed directly.
|
|
if ( ! defined( 'ABSPATH' ) ) {
|
|
exit;
|
|
}
|
|
|
|
/**
|
|
* Class Multisite
|
|
*
|
|
* Base class for multisite-specific functionality.
|
|
*/
|
|
class Multisite {
|
|
|
|
/**
|
|
* Constructor.
|
|
*/
|
|
public function __construct() {
|
|
// This is just a placeholder class.
|
|
// Add your multisite-specific initialization here.
|
|
}
|
|
|
|
/**
|
|
* Initialize hooks.
|
|
*/
|
|
public function initialize_hooks() {
|
|
add_action( 'network_admin_menu', array( $this, 'add_network_menu' ) );
|
|
}
|
|
|
|
/**
|
|
* Add network admin menu.
|
|
*/
|
|
public function add_network_menu() {
|
|
// This is a placeholder method.
|
|
// In a real implementation, you would add network admin menu items here.
|
|
}
|
|
|
|
/**
|
|
* Example method for multisite functionality.
|
|
*
|
|
* @return bool Always returns true.
|
|
*/
|
|
public function is_multisite_compatible() {
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* Example method to get all sites in the network.
|
|
*
|
|
* @return array An array of sites or an empty array if not in multisite.
|
|
*/
|
|
public function get_network_sites() {
|
|
// This is just a placeholder method.
|
|
// In a real implementation, you might use get_sites() or a custom query.
|
|
return function_exists( 'get_sites' ) ? get_sites( array( 'public' => 1 ) ) : array();
|
|
}
|
|
}
|