Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions inc/admin-pages/class-list-admin-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
// Exit if accessed directly
defined('ABSPATH') || exit;

use WP_List_Table;

/**
* Abstract class that makes it easy to create new admin pages.
*/
Expand Down
15 changes: 2 additions & 13 deletions inc/class-dashboard-statistics.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
*
* @since 2.0.0
*/
class Dashboard_Statistics implements \WP_Ultimo\Interfaces\Singleton {

use \WP_Ultimo\Traits\Singleton;
class Dashboard_Statistics {

/**
* The initial date of the statistics.
Expand All @@ -49,12 +47,11 @@ class Dashboard_Statistics implements \WP_Ultimo\Interfaces\Singleton {
protected $types = [];

/**
* Loads the hooks we need for dismissing notices
* Constructor.
*
* @since 2.0.0
*
* @param array $args With the start_date, end_date and the data type functions.
* @return void.
*/
public function __construct($args = []) {

Expand All @@ -67,14 +64,6 @@ public function __construct($args = []) {
}
}

/**
* Runs on singleton instantiation.
*
* @since 2.0.0
* @return void.
*/
public function init(): void {}

/**
* Main function to call the get data functions based on the array of types.
*
Expand Down
7 changes: 5 additions & 2 deletions inc/class-user-switching.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@
use \WP_Ultimo\Traits\Singleton;

/**
* Constructor for the User_Switching.
* Initialize the singleton.
*
* @since 2.0.0
* @return void
*/
public function __construct() {
public function init(): void {

add_action('plugins_loaded', [$this, 'register_forms']);
}
Expand Down Expand Up @@ -122,7 +125,7 @@
if ( ! $this->check_user_switching_is_activated()) {
return wu_get_form_url('install_user_switching');
} else {
$link = \user_switching::switch_to_url($user);

Check failure on line 128 in inc/class-user-switching.php

View workflow job for this annotation

GitHub Actions / Code Quality Checks

Call to static method switch_to_url() on an unknown class user_switching.

return $link;
}
Expand Down
5 changes: 0 additions & 5 deletions inc/class-wp-ultimo.php
Original file line number Diff line number Diff line change
Expand Up @@ -568,11 +568,6 @@ function () {
}
);

/*
* Dashboard Statistics
*/
\WP_Ultimo\Dashboard_Statistics::get_instance();

/*
* Network Plugins/Themes usage columns
*/
Expand Down
5 changes: 3 additions & 2 deletions inc/ui/class-jumper.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,12 @@ class Jumper {
protected $transient_key = 'wu-jumper-menu-list';

/**
* Element construct.
* Initialize the singleton.
*
* @since 2.0.0
* @return void
*/
public function __construct() {
public function init(): void {

add_action('init', [$this, 'add_settings'], 20);

Expand Down
9 changes: 5 additions & 4 deletions inc/ui/class-template-switching-element.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ public function setup_preview(): void {
*
* @since 2.0.4
*
* @return json|\WP_Error Switch template response.
* @return void
*/
public function switch_template() {

Expand All @@ -274,7 +274,8 @@ public function switch_template() {
$template_id = wu_request('template_id', '');

if ( ! $template_id) {
return new \WP_Error('template_id_required', __('You need to provide a valid template to duplicate.', 'ultimate-multisite'));
wp_send_json_error(new \WP_Error('template_id_required', __('You need to provide a valid template to duplicate.', 'ultimate-multisite')));
return;
}

$switch = \WP_Ultimo\Helpers\Site_Duplicator::override_site($template_id, $this->site->get_id());
Expand All @@ -283,7 +284,7 @@ public function switch_template() {
* Allow plugin developers to hook functions after a user or super admin switches the site template
*
* @since 1.9.8
* @param integer Site ID
* @param int $id Site ID
* @return void
*/
do_action('wu_after_switch_template', $this->site->get_id());
Expand Down Expand Up @@ -319,7 +320,7 @@ public function switch_template() {
public function output($atts, $content = null): void {

if ($this->site) {
$filter_template_limits = new \WP_Ultimo\Limits\Site_Template_Limits();
$filter_template_limits = \WP_Ultimo\Limits\Site_Template_Limits::get_instance();

$atts['products'] = $this->products;

Expand Down
5 changes: 3 additions & 2 deletions inc/ui/class-toolbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ class Toolbox {
use \WP_Ultimo\Traits\Singleton;

/**
* Element construct.
* Initialize the singleton.
*
* @since 2.0.0
* @return void
*/
public function __construct() {
public function init(): void {

add_action('init', [$this, 'load_toolbox']);
}
Expand Down
5 changes: 3 additions & 2 deletions inc/ui/class-tours.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ class Tours {
protected $tours = [];

/**
* Element construct.
* Initialize the singleton.
*
* @since 2.0.0
* @return void
*/
public function __construct() {
public function init(): void {

add_action('wp_ajax_wu_mark_tour_as_finished', [$this, 'mark_as_finished']);

Expand Down
Loading
Loading