Skip to content
Open
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
6 changes: 3 additions & 3 deletions inc/spbc-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@ function spbc_admin_init()
add_filter('manage_users_columns', 'spbc_users_list_pass_check_column');
add_action('wp_ajax_spbc_check_pass_leak', [UsersPassCheckHandler::class, 'checkPassLeak']);
}

// Sync disallow file edit setting with FileEditorDisabler
FileEditorDisabler::syncDisallowFileEditBySettings($spbc->settings);
}

/**
Expand Down Expand Up @@ -977,9 +980,6 @@ function spbc_set_malware_scan_warns()

$triggers_has_dangerous = DBTriggerService::countTriggersStorage();

//// Sync disallow file edit setting with FileEditorDisabler
FileEditorDisabler::syncDisallowFileEditBySettings($spbc->settings, $critical_count);

$spbc->data['display_scanner_warnings'] = array(
'critical' => $critical_count,
'signatures' => $signatures_count,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,9 @@ protected function needToShow()
{
global $spbc, $pagenow;

$no_wpconfig_error = !defined('SPBC_WPCONFIG_ERROR') || !constant('SPBC_WPCONFIG_ERROR');
return (
isset($spbc->settings['misc_disable_file_editor']) &&
$spbc->settings['misc_disable_file_editor'] == 2 &&
$no_wpconfig_error &&
is_admin() &&
$pagenow === 'index.php' &&
current_user_can('administrator') &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@ public function __construct(AdminBannersHandler $banners_handler)
protected function needToShow()
{
global $spbc;
$no_wpconfig_error = !defined('SPBC_WPCONFIG_ERROR') || !constant('SPBC_WPCONFIG_ERROR');

return (
isset($spbc->settings['misc_disable_file_editor']) &&
$spbc->settings['misc_disable_file_editor'] == 2 &&
$no_wpconfig_error &&
is_admin() &&
isset($_GET['page']) && $_GET['page'] === 'spbc' &&
current_user_can('administrator') &&
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use CleantalkSP\SpbctWP\AdminBannersModule\AdminBanners\AdminBannerWrongKey;
use CleantalkSP\SpbctWP\AdminBannersModule\AdminBanners\AdminBannerEmptyKey;
use CleantalkSP\SpbctWP\AdminBannersModule\AdminBanners\AdminBannerCriticalFilesWarning;
use CleantalkSP\SpbctWP\AdminBannersModule\AdminBanners\AdminBannerWpConfigError;
use CleantalkSP\SpbctWP\AdminBannersModule\AdminBanners\AdminBannerFileEditorDashboard;
use CleantalkSP\SpbctWP\AdminBannersModule\AdminBanners\AdminBannerFileEditorSettings;
use CleantalkSP\SpbctWP\AdminBannersModule\AdminBanners\AdminBannerPassLeak;
Expand Down Expand Up @@ -68,7 +67,6 @@ public function __construct(State $spbc)
AdminBannerEmptyKey::class,
AdminBannerReview::class,
AdminBannerCriticalFilesWarning::class,
AdminBannerWpConfigError::class,
AdminBannerFileEditorDashboard::class,
AdminBannerFileEditorSettings::class,
AdminBannerPassLeak::class,
Expand Down
4 changes: 0 additions & 4 deletions lib/CleantalkSP/SpbctWP/Deactivator.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,6 @@ public static function deactivation($network, $do_log_on_errors = false)
// Removing the role of an external technical specialist
remove_role('tech_freelancer');

// Deleting the block with the constant DISALLOW_FILE_EDIT from wp-config.php when deactivating
$file_editor_settings = ['misc_disable_file_editor' => 0];
\CleantalkSP\SpbctWP\FileEditorDisabler\FileEditorDisabler::syncDisallowFileEditBySettings($file_editor_settings);

return self::$deactivation_result;
}

Expand Down
Loading