Skip to content

Plugged locations that were sending purge requests even if disabled #168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 19, 2019
Merged
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
19 changes: 19 additions & 0 deletions admin/class-purger.php
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,13 @@ public function check_and_truncate_log_file() {
*/
public function purge_image_on_edit( $attachment_id ) {

// Do not purge if not enabled.
global $nginx_helper_admin;

if ( ! $nginx_helper_admin->options['enable_purge'] ) {
return;
}

$this->log( 'Purging media on edit BEGIN ===' );

if ( wp_attachment_is_image( $attachment_id ) ) {
Expand Down Expand Up @@ -1076,6 +1083,12 @@ public function purge_them_all() {
*/
public function purge_on_term_taxonomy_edited( $term_id, $tt_id, $taxon ) {

global $nginx_helper_admin;

if ( ! $nginx_helper_admin->options['enable_purge'] ) {
return;
}

$this->log( __( 'Term taxonomy edited or deleted', 'nginx-helper' ) );

$term = get_term( $term_id, $taxon );
Expand Down Expand Up @@ -1106,6 +1119,12 @@ public function purge_on_term_taxonomy_edited( $term_id, $tt_id, $taxon ) {
*/
public function purge_on_check_ajax_referer( $action ) {

global $nginx_helper_admin;

if ( ! $nginx_helper_admin->options['enable_purge'] ) {
return;
}

switch ( $action ) {

case 'save-sidebar-widgets':
Expand Down