REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 1.75 KB
Close
/home/nshryvcy/himaltourism.com/wp-content/plugins/facebook-for-woocommerce/includes/Jobs/CleanupSkyvergeFrameworkJobOptions.php
Text
Base64
<?php declare( strict_types=1 ); namespace WooCommerce\Facebook\Jobs; use WooCommerce\Facebook\Utilities\Heartbeat; defined( 'ABSPATH' ) || exit; /** * Class CleanupSkyvergeFrameworkJobOptions * * Responsible for cleaning up old completed and failed background sync jobs from SkyVerge background job system. * Each job is represented by a row in wp_options table, and these can accumulate over time. * * Note - this is closely coupled to the SkyVerge background job system, and is essentially a patch to improve it. * * @see BackgroundJobHandler * * @since 2.6.0 */ class CleanupSkyvergeFrameworkJobOptions { /** * Add hooks. */ public function init() { // Register our cleanup routine to run regularly. add_action( Heartbeat::DAILY, [ $this, 'clean_up_old_completed_options' ] ); } /** * Delete old completed/failed product sync job rows from options table. * * Logic and database query are adapted from SV_WP_Background_Job_Handler::get_jobs(). * * @see BackgroundJobHandler * @see Products\Sync\Background */ public function clean_up_old_completed_options() { global $wpdb; /** * Query notes: * - Matching product sync job only (Products\Sync\Background class). * - Matching "completed" or "failed" status by sniffing json option value. * - Order by lowest id, to delete older rows first. * - Limit number of rows (periodic task will eventually remove all). * Using `get_results` so we can limit number of items; `delete` doesn't allow this. */ $wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name LIKE 'wc_facebook_background_product_sync_job_%' AND ( option_value LIKE '%\"status\":\"completed\"%' OR option_value LIKE '%\"status\":\"failed\"%' ) ORDER BY option_id ASC LIMIT 500" ); } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 7
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
AbstractChainedJob.php
1.05 KB
lrw-r--r--
2025-01-05 05:33:50
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CleanupSkyvergeFrameworkJobOptions.php
1.75 KB
lrw-r--r--
2025-01-05 05:33:50
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
DeleteProductsFromFBCatalog.php
3.12 KB
lrw-r--r--
2025-01-05 05:33:50
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
GenerateProductFeed.php
4.01 KB
lrw-r--r--
2025-01-05 05:33:50
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
JobManager.php
1.23 KB
lrw-r--r--
2025-01-05 05:33:50
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
LoggingTrait.php
610 B
lrw-r--r--
2025-01-05 05:33:50
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ResetAllProductsFBSettings.php
2.85 KB
lrw-r--r--
2025-01-05 05:33:50
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).