Skip to content

Commit

Permalink
Merge pull request #11 from a2hosting/A2OPT-724
Browse files Browse the repository at this point in the history
A2OPT-724 and A2OPT-724 add cli regenerate_salts remove_conf_backups
  • Loading branch information
jrtaylor-com authored Oct 24, 2023
2 parents 7179b7b + a3d2684 commit 2b89d20
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion core/A2_Optimized_CLI.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,17 @@ public function enable($args, $assoc_args) {
}

break;
case 'regenerate_salts':
$optimizations->regenerate_wpconfig_salts();

return WP_CLI::success(esc_html__( $site_type . ' salts have been regenerated.', 'a2-optimized-wp' ));

break;
case 'remove_conf_backups':
$optimizations->enable_wpconfig_cleanup();

return WP_CLI::success(esc_html__( $site_type . ' config backups are scheduled to be removed.', 'a2-optimized-wp' ));
break;
}
}

Expand Down Expand Up @@ -284,6 +295,12 @@ public function disable($args, $assoc_args) {

return WP_CLI::success(esc_html__( $site_type . ' Bcrypt passwords disabled.', 'a2-optimized-wp' ));

break;
case 'remove_conf_backups':
$optimizations->disable_wpconfig_cleanup();

return WP_CLI::success(esc_html__( $site_type . ' No longer removing config backups.', 'a2-optimized-wp' ));

break;
}
}
Expand Down Expand Up @@ -339,6 +356,7 @@ public function is_active($args, $assoc_args) {
$specialMapping = array(
'lock_plugins' => 'lock_editing',
'bcrypt' => 'a2_bcrypt_passwords',
'remove_conf_backups' => 'a2_wpconfig_cleanup',
);

if (count($args) > 0) {
Expand All @@ -349,7 +367,7 @@ public function is_active($args, $assoc_args) {
if (array_key_exists($slug, $specialMapping)) {
$name = $specialMapping[$slug];
}
$stat = $optimizations->is_active($name, TRUE);
$stat = $optimizations->is_active($name, FALSE);
$return[$slug] = $stat;
}
}
Expand Down

0 comments on commit 2b89d20

Please sign in to comment.