From 6cd25725e0a29297f4e374a0d9f60bd021ae0bda Mon Sep 17 00:00:00 2001 From: asus Date: Thu, 4 Apr 2024 14:28:06 +0200 Subject: [PATCH] removed all nocache headers --- plugins/cipf_plugin/php/_utils_redirections.php | 11 +++-------- plugins/cipf_plugin/php/partners_form.php | 9 --------- plugins/cipf_plugin/plgntls_class.php | 2 +- 3 files changed, 4 insertions(+), 18 deletions(-) diff --git a/plugins/cipf_plugin/php/_utils_redirections.php b/plugins/cipf_plugin/php/_utils_redirections.php index ac785d3..cb38b7c 100644 --- a/plugins/cipf_plugin/php/_utils_redirections.php +++ b/plugins/cipf_plugin/php/_utils_redirections.php @@ -17,10 +17,6 @@ if (!defined('ABSPATH')) { function redirect_home_CIPF(){ Plgntls::debug_infos(); - // Set up nocache headers before redirecting : https://developer.wordpress.org/reference/functions/wp_safe_redirect/#user-contributed-notes - // i dont really know what it does, but it creates a warning sometimes : 'PHP Warning: Cannot modify - header information headers already sent in /var/www/html/wp-includes/pluggable.php' - //nocache_headers(); - wp_redirect(home_url(), 301); exit; } @@ -36,9 +32,6 @@ function redirect_prof_command_CIPF(){ Plgntls::debug_infos(); $slug_command_card = Cipf::SLUG_COMMAND_CARD; - // Set up nocache headers before redirecting : https://developer.wordpress.org/reference/functions/wp_safe_redirect/#user-contributed-notes - nocache_headers(); - wp_redirect(home_url($slug_command_card), 301); exit; } @@ -62,7 +55,9 @@ function redirection_profil_CIPF(){ $current_user_id = get_current_user_id(); // Set up nocache headers before redirecting : https://developer.wordpress.org/reference/functions/wp_safe_redirect/#user-contributed-notes - nocache_headers(); + // i dont really know what it does, but it creates a warning sometimes : 'PHP Warning: Cannot modify - header information headers already sent in /var/www/html/wp-includes/pluggable.php' + //nocache_headers(); + if (!is_user_logged_in()) { redirect_home_CIPF(); diff --git a/plugins/cipf_plugin/php/partners_form.php b/plugins/cipf_plugin/php/partners_form.php index 96b05c5..aec38bd 100644 --- a/plugins/cipf_plugin/php/partners_form.php +++ b/plugins/cipf_plugin/php/partners_form.php @@ -95,13 +95,4 @@ add_action('template_redirect', 'partner_form_creation_page_CIPF'); - - - - - - - - - ?> diff --git a/plugins/cipf_plugin/plgntls_class.php b/plugins/cipf_plugin/plgntls_class.php index 8fb488a..2951d25 100644 --- a/plugins/cipf_plugin/plgntls_class.php +++ b/plugins/cipf_plugin/plgntls_class.php @@ -56,7 +56,7 @@ class Plgntls { * 2 : output everything * */ - private static $_DEBUG_INFOS = 0; + private static $_DEBUG_INFOS = 2; private static $_instance_count = 0; private static $_adding_count = 0;