| Name | Size | Mode | Actions |
|---|---|---|---|
| ArrayUtil.php | 3139 | 0644 | editdlrm |
| BlocksUtil.php | 2415 | 0644 | editdlrm |
| COTMigrationUtil.php | 6182 | 0644 | editdlrm |
| DatabaseUtil.php | 16483 | 0644 | editdlrm |
| FilesystemUtil.php | 7811 | 0644 | editdlrm |
| HtmlSanitizer.php | 3171 | 0644 | editdlrm |
| LegacyRestApiStub.php | 6807 | 0644 | editdlrm |
| PluginInstaller.php | 14347 | 0644 | editdlrm |
| ProductUtil.php | 1192 | 0644 | editdlrm |
| Types.php | 2020 | 0644 | editdlrm |
| URL.php | 13419 | 0644 | editdlrm |
| URLException.php | 191 | 0644 | editdlrm |
| Users.php | 9701 | 0644 | editdlrm |
| WebhookUtil.php | 5497 | 0644 | editdlrm |
/home/techb158/balacoffee.com/wp-content/plugins/woocommerce/src/Internal/Utilities/WebhookUtil.php (5497B)
' . esc_html( $text ) . '
'; } if ( ! $at_least_one_user_with_webhooks ) { return; } $webhooks_settings_url = esc_url_raw( admin_url( 'admin.php?page=wc-settings&tab=advanced§ion=webhooks' ) ); // This block of code is copied from WordPress' users.php. // phpcs:disable WooCommerce.Commenting.CommentHooks, WordPress.DB.PreparedSQL.NotPrepared $users_have_content = (bool) apply_filters( 'users_have_additional_content', false, $userids ); if ( ! $users_have_content ) { if ( $wpdb->get_var( "SELECT ID FROM {$wpdb->posts} WHERE post_author IN( " . implode( ',', $userids ) . ' ) LIMIT 1' ) ) { $users_have_content = true; } elseif ( $wpdb->get_var( "SELECT link_id FROM {$wpdb->links} WHERE link_owner IN( " . implode( ',', $userids ) . ' ) LIMIT 1' ) ) { $users_have_content = true; } } // phpcs:enable WooCommerce.Commenting.CommentHooks, WordPress.DB.PreparedSQL.NotPrepared if ( $users_have_content ) { $text = __( 'If the "Delete all content" option is selected, the affected WooCommerce webhooks will not be deleted and will be attributed to user id 0.' . wp_kses_post( $text ) . '
'; } /** * Get the ids of the webhooks assigned to a given user. * * @param int $user_id User id. * @return int[] Array of webhook ids. */ private function get_webhook_ids_for_user( int $user_id ): array { $data_store = \WC_Data_Store::load( 'webhook' ); return $data_store->search_webhooks( array( 'user_id' => $user_id, ) ); } /** * Gets the count of webhooks that are configured to use the Legacy REST API to compose their payloads. * * @param bool $clear_cache If true, the previously cached value of the count will be discarded if it exists. * * @return int */ public function get_legacy_webhooks_count( bool $clear_cache = false ): int { global $wpdb; $cache_key = WC_Cache_Helper::get_cache_prefix( 'webhooks' ) . 'legacy_count'; if ( $clear_cache ) { wp_cache_delete( $cache_key, 'webhooks' ); } $count = wp_cache_get( $cache_key, 'webhooks' ); if ( false === $count ) { $count = absint( $wpdb->get_var( "SELECT count( webhook_id ) FROM {$wpdb->prefix}wc_webhooks WHERE `api_version` < 1;" ) ); wp_cache_add( $cache_key, $count, 'webhooks' ); } return $count; } }