PluginProbe ʕ •ᴥ•ʔ
Really Simple Security – Simple and Performant Security (formerly Really Simple SSL) / 9.5.11
Really Simple Security – Simple and Performant Security (formerly Really Simple SSL) v9.5.11
9.5.11 9.5.10.1 9.5.10 trunk 9.4.0 9.4.1 9.4.2 9.4.3 9.5.0 9.5.0.1 9.5.0.2 9.5.1 9.5.2 9.5.2.2 9.5.2.3 9.5.3 9.5.3.1 9.5.3.2 9.5.4 9.5.5 9.5.6 9.5.7 9.5.8 9.5.9
really-simple-ssl / security / deactivate-integration.php
really-simple-ssl / security Last commit date
includes 4 weeks ago server 4 weeks ago tests 4 weeks ago wordpress 4 weeks ago class-rsssl-htaccess-file-manager.php 4 weeks ago cron.php 4 weeks ago deactivate-integration.php 4 weeks ago firewall-manager.php 4 weeks ago functions.php 4 weeks ago index.php 4 weeks ago integrations.php 4 weeks ago notices.php 4 weeks ago security.php 4 weeks ago sync-settings.php 4 weeks ago tests.php 4 weeks ago
deactivate-integration.php
54 lines
1 <?php
2 defined('ABSPATH') or die();
3 /**
4 * If a plugin is deactivated, add to deactivated list.
5 * @param string $field_id
6 * @param mixed $new_value
7 * @param mixed $prev_value
8 * @param string $type
9 *
10 * @return void
11 */
12 function rsssl_handle_integration_deactivation($field_id, $new_value, $prev_value, $type){
13 if (!rsssl_user_can_manage()) {
14 return;
15 }
16 if ($new_value !== $prev_value && $new_value === 0 ){
17 //check if this field id exists in the list of plugins
18 global $rsssl_integrations_list;
19 foreach ( $rsssl_integrations_list as $plugin => $plugin_data ) {
20 if (
21 isset($plugin_data['has_deactivation']) &&
22 $plugin_data['has_deactivation'] &&
23 isset($plugin_data['option_id']) &&
24 $plugin_data['option_id'] === $field_id
25 ) {
26 //add to deactivated list
27 $current_list = get_option('rsssl_deactivate_list', []);
28 if ( !in_array($plugin, $current_list)) {
29 $current_list[] = $plugin;
30 update_option('rsssl_deactivate_list', $current_list, false);
31 }
32 }
33 }
34 }
35 }
36 add_action( "rsssl_after_save_field", "rsssl_handle_integration_deactivation", 10, 4 );
37
38 /**
39 * Remove a plugin from the deactivation list if deactivation procedure was completed
40 * @param string $plugin
41 *
42 * @return void
43 */
44 function rsssl_remove_from_deactivation_list($plugin){
45 if (!rsssl_user_can_manage()) {
46 return;
47 }
48 $deactivate_list = get_option('rsssl_deactivate_list', []);
49 if ( in_array($plugin, $deactivate_list )) {
50 $index = array_search($plugin, $deactivate_list);
51 unset($deactivate_list[$index]);
52 update_option('rsssl_deactivate_list', $deactivate_list, false );
53 }
54 }