Prep Plugin for release on WordPress.org
Escape everything that should be escaped. Add nonce checks where needed. Sanitize all inputs. Apply Code style changes across the codebase. Correct many deprecation notices. Optimize load order of many filters.
This commit is contained in:
@ -9,8 +9,6 @@
|
||||
|
||||
namespace WP_Ultimo\UI;
|
||||
|
||||
use WP_Ultimo\UI\Base_Element;
|
||||
|
||||
// Exit if accessed directly
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
@ -46,6 +44,8 @@ class Site_Maintenance_Element extends Base_Element {
|
||||
*/
|
||||
protected $public = true;
|
||||
|
||||
private \WP_Ultimo\Models\Site $site;
|
||||
|
||||
/**
|
||||
* Initializes the singleton.
|
||||
*
|
||||
@ -209,12 +209,12 @@ class Site_Maintenance_Element extends Base_Element {
|
||||
*/
|
||||
public function setup(): void {
|
||||
|
||||
$this->site = WP_Ultimo()->currents->get_site();
|
||||
$site = WP_Ultimo()->currents->get_site();
|
||||
|
||||
if ( ! $this->site || ! $this->site->is_customer_allowed()) {
|
||||
if ( ! $site || ! $site->is_customer_allowed()) {
|
||||
$this->set_display(false);
|
||||
|
||||
return;
|
||||
} else {
|
||||
$this->site = $site;
|
||||
}
|
||||
}
|
||||
|
||||
@ -237,7 +237,7 @@ class Site_Maintenance_Element extends Base_Element {
|
||||
*/
|
||||
public function register_scripts(): void {
|
||||
|
||||
wp_register_script('wu-site-maintenance', wu_get_asset('site-maintenance.js', 'js'), ['jquery', 'wu-functions'], wu_get_version());
|
||||
wp_register_script('wu-site-maintenance', wu_get_asset('site-maintenance.js', 'js'), ['jquery', 'wu-functions'], wu_get_version(), true);
|
||||
|
||||
wp_localize_script(
|
||||
'wu-site-maintenance',
|
||||
|
Reference in New Issue
Block a user