Nawawi Jamili
Forum Replies Created
-
Forum: Plugins
In reply to: [Docket Cache - Object Cache Accelerator] Flush Cache On UpdateHi,
You can call “wp_cache_flush” function:
wp_cache_flush();
or if using wp-cli, from command line:
wp cache flush
The current version doesn’t have a hook to flush the cache, btw you can try beta version here:
https://docketcache.com/devtest/docket-cache-21.02.06-dev3.zipand call
docketcache/action/flushcache/object
action hook:do_action('docketcache/action/flushcache/object');
to flush the cache.
Thanks.
Forum: Reviews
In reply to: [Docket Cache - Object Cache Accelerator] Fast as luck!thanks.
Forum: Plugins
In reply to: [Docket Cache - Object Cache Accelerator] WooCommerce update 403 ForbiddenAs you can see, this issue “WooCommerce update 403 Forbidden” is not related to Docket Cache. WooCommerce site can’t parse the data.
Server: nginx Date: Thu, 03 Jun 2021 05:51:35 GMT Content-Type: application/json; charset=UTF-8 Content-Length: 98 Connection: close X-Robots-Tag: noindex Link: <https://woocommerce.com/wp-json/>; rel="https://api.w.org/" X-Content-Type-Options: nosniff Access-Control-Expose-Headers: X-WP-Total, X-WP-TotalPages, Link Access-Control-Allow-Headers: Authorization, X-WP-Nonce, Content-Disposition, Content-MD5, Content-Type Expires: Wed, 11 Jan 1984 05:00:00 GMT Cache-Control: no-cache, must-revalidate, max-age=0 X-RateLimit-Limit: 300 X-RateLimit-Remaining: 298 X-RateLimit-Reset: 1622700000 Allow: POST X-Woo-Signature: a3ec34b9bb1f35b2bc8a61a5ef21124c863a8eb4 Content-Encoding: gzip X-rq: arn1 89 77 3174 Age: 0 X-Cache: pass {"code":"invalid_request","message":"Could not parse the request.","data":{"status":403}}
That all I can help.
Thanks.
Forum: Plugins
In reply to: [Docket Cache - Object Cache Accelerator] WooCommerce update 403 Forbiddenyou can try,
go to line 59-60 and find this code
// TODO: Check response signatures on certain endpoints. return wp_safe_remote_request( $url, $args );
replace with
// TODO: Check response signatures on certain endpoints. $response = wp_safe_remote_request( $url, $args ); file_put_contents(WP_CONTENT_DIR.'/WOODEBUG.txt',__METHOD__."\n".$url."\n".print_r($args,1)."\n"."\n".print_r($response,1)."\n", FILE_APPEND); return $response;
Forum: Plugins
In reply to: [Docket Cache - Object Cache Accelerator] WooCommerce update 403 Forbidden1. Open file wp-content/plugins/woocommerce/includes/admin/helper/class-wc-helper-api.php using Plugin Editor.
Plugins -> Plugin Editor.
– Select plugin to edit: WooCommerce
– And select includes -> admin -> helper -> class-wc-helper-api.php
– Go to line 47 you can see this code:if ( ! empty( $args['authenticated'] ) ) { if ( ! self::_authenticate( $url, $args ) ) { return new WP_Error( 'authentication', 'Authentication failed.' ); } }
– Insert this code:
file_put_contents(WP_CONTENT_DIR.'/WOODEBUG.txt',__METHOD__."\n".$url."\n".print_r($args,1)."\n", FILE_APPEND);
– before this code
return new WP_Error( 'authentication', 'Authentication failed.' );
– It should look like this:
file_put_contents(WP_CONTENT_DIR.'/WOODEBUG.txt',__METHOD__."\n".$url."\n".print_r($args,1)."\n", FILE_APPEND); return new WP_Error( 'authentication', 'Authentication failed.' );
2. Before means the original code, After means edited code.
3. If an error happens wp-content/WOODEBUG.txt should have the debug info, like this:
WC_Helper_API::request https://woocommerce.com/wp-json/helper/1.0/subscriptions Array ( [authenticated] => 1 [method] => GET ) WC_Helper_API::request https://woocommerce.com/wp-json/helper/1.0/update-check Array ( [body] => {"products":[]} [authenticated] => 1 [method] => POST )
This debug info is prove that the issue is from WooCommerce not from Docket Cache.
4. Yes.
Thanks.
Forum: Plugins
In reply to: [Docket Cache - Object Cache Accelerator] WooCommerce update 403 ForbiddenHi, after debugging, it seems the issue is from WooCommerce, it failed to authenticate if a product is empty and assuming it related to the subscription.
File: wp-content/plugins/woocommerce/includes/admin/helper/class-wc-helper-api.php
Method: WC_Helper_API::request()
Line: 44To debug, insert this code in WC_Helper_API::request()
Code:
file_put_contents(WP_CONTENT_DIR.'/WOODEBUG.txt', __METHOD__."\n".$url."\n".print_r($args,1)."\n", FILE_APPEND);
Before:
public static function request( $endpoint, $args = array() ) { $url = self::url( $endpoint ); if ( ! empty( $args['authenticated'] ) ) { if ( ! self::_authenticate( $url, $args ) ) { return new WP_Error( 'authentication', 'Authentication failed.' ); } } /** * Allow developers to filter the request args passed to wp_safe_remote_request(). * Useful to remove sslverify when working on a local api dev environment. */ $args = apply_filters( 'woocommerce_helper_api_request_args', $args, $endpoint ); // TODO: Check response signatures on certain endpoints. return wp_safe_remote_request( $url, $args ); }
After:
public static function request( $endpoint, $args = array() ) { $url = self::url( $endpoint ); if ( ! empty( $args['authenticated'] ) ) { if ( ! self::_authenticate( $url, $args ) ) { file_put_contents(WP_CONTENT_DIR.'/WOODEBUG.txt', __METHOD__."\n".$url."\n".print_r($args,1)."\n", FILE_APPEND); return new WP_Error( 'authentication', 'Authentication failed.' ); } } /** * Allow developers to filter the request args passed to wp_safe_remote_request(). * Useful to remove sslverify when working on a local api dev environment. */ $args = apply_filters( 'woocommerce_helper_api_request_args', $args, $endpoint ); // TODO: Check response signatures on certain endpoints. return wp_safe_remote_request( $url, $args ); }
wp-content/WOODEBUG.txt will shown content like below, if authentication failed:
WC_Helper_API::request https://woocommerce.com/wp-json/helper/1.0/subscriptions Array ( [authenticated] => 1 [method] => GET ) WC_Helper_API::request https://woocommerce.com/wp-json/helper/1.0/update-check Array ( [body] => {"products":[]} [authenticated] => 1 [method] => POST )
To debug without Docket Cache activated. Install and activate Transient Manager, and remove _woocommerce_helper_updates.
Thanks.
Forum: Plugins
In reply to: [Docket Cache - Object Cache Accelerator] WooCommerce update 403 Forbidden@kotyarashop noted with thanks.
Forum: Plugins
In reply to: [Docket Cache - Object Cache Accelerator] WooCommerce update 403 ForbiddenHi @kotyarashop,
Thanks for the report. I will try to replicate the issue and update once found the solutions.
Meanwhile, if you enabled “Configuration -> Limit WP-Admin HTTP Requests” or “Configuration -> HTTP Request Expect header tweaks”, please try to disable it and see if that can solve this issue.
Thanks.
noted with thanks.
Hi,
If you don’t mind, you can refer to the modified version here: https://github.com/nawawi/ultimate-social-media-icons
Thanks.
Forum: Reviews
In reply to: [Docket Cache - Object Cache Accelerator] Best and the firstthank you.
Forum: Plugins
In reply to: [Hyper Cache] PHP WarningHi there,
You can try to fix yourself while waiting for the author to respond or do the updates.
Before:
function hyper_cache_header($value) { header('X-Hyper-Cache: ' . $value, false); }
After:
function hyper_cache_header($value) { if (!headers_sent()) { header('X-Hyper-Cache: ' . $value, false); } }
File: wp-content/plugins/hyper-cache/advanced-cache.php
Line: 217On the hyper cache panel, click save to overwrite the wp-content/advanced-cache.php file.
Hope this will help.
Thanks.
Forum: Reviews
In reply to: [Docket Cache - Object Cache Accelerator] Powerful Pluginthank you.
Forum: Reviews
In reply to: [Docket Cache - Object Cache Accelerator] Works out of the boxThank you.
Forum: Reviews
In reply to: [Docket Cache - Object Cache Accelerator] Molto buonoThank you.