Jack
Forum Replies Created
-
Hello,
Has this bug been fixed?Is there any possible workaround for the short term? My website is live, and something like 90% of my users are mobile, plus it’s a popular feature to filter with a slider.
Perhaps a quick javascript workaround?
Thank you.- This reply was modified 2 years, 11 months ago by Jack.
Something like this:
<?php // Define a function to retrieve data from the database function get_data_from_database($query) { // Perform your database query here // ... // For the sake of this example, let's assume we fetched some data from the database $data = /* result of your database query */; return $data; } // Define a function to retrieve cached data or fetch it from the database function get_data($query) { // Generate a unique cache key based on the query parameters $cache_key = 'data_query_' . md5(serialize($query)); // Try to retrieve the data from the cache $cached_data = wp_cache_get($cache_key, 'my_cache_group'); // If the data is found in the cache, return it if ($cached_data !== false) { return $cached_data; } // If the data is not in the cache, fetch it from the database $data = get_data_from_database($query); // Store the data in the cache wp_cache_set($cache_key, $data, 'my_cache_group', 3600); return $data; } // Example usage $query1 = array('param1' => 'value1', 'param2' => 'value2'); $result1 = get_data($query1); // Fetches data from the database and caches it $result2 = get_data($query1); // Retrieves data from the cache, avoiding the database query $query2 = array('param1' => 'value1', 'param2' => 'value3'); $result3 = get_data($query2); // Fetches data from the database because the query parameters are different ?>The Member Directory page is built with the use of Ajax JavaScript calls
and can’t be cached as a HTML page by a WP caching plugin.The caching plug-in I’m using (W3 Total Cache) has a Database query cache, and most cache plug-ins also have the Object cache.
Perhaps que query results could be cached using an object cache.I think it would make sense because many of the queries are the same so some sort of caching would improve performance and reduce load on the server.
Thank you.
Hello,
Through the use of hooks I’ve removed the chance for my clients to be added to the wp_um_metadata table since clients aren’t listed anywhere.
function avoid_clients_directory_on_updated_usermeta($meta_id, $object_id, $meta_key, $_meta_value){ ... if ( $is_client ) { remove_action( 'updated_user_meta', array( $member_directory_meta_this, 'on_update_usermeta' ), 10 ); } } function avoid_clients_directory_on_added_usermeta($meta_id, $object_id, $meta_key, $_meta_value){ ... if ( $is_client ) remove_action( 'added_user_meta', array( $member_directory_meta_this, 'on_update_usermeta' ), 10 ); ... } function avoid_client_members_for_directory() { add_action( 'updated_user_meta', 'avoid_clients_directory_on_updated_usermeta' , 9, 4 ); add_action( 'added_user_meta', 'avoid_clients_directory_on_added_usermeta' , 9, 4 ); } add_action( 'plugins_loaded', 'avoid_client_members_for_directory' );And I’ve manual deleted client records from the table too which made it much smaller.
I think it made a small difference, however the query to list selects from the table wp_users which contains all users including clients which might be slowing down the query.
Thank you.- This reply was modified 2 years, 11 months ago by Jack.
Hello,
I have those options enabled however it still takes ~4 seconds to load a directory. The directory only lists users with a specific user role, however all users regardless of the role are added to the table um_metadata, which might be why the query is so slow.
Is the um_metadata table strictly used for the directory listing? If so, I’ll try to add some hook actions to prevent client registrations from being added to the table. That way only professional registrations are added and the table gets smaller.
Thank you.Is there anyway to speed up the database query to fetch the memebers?
Thanks.
Forum: Plugins
In reply to: [Action Scheduler] actions not writing to outputsI figured it out.
I had setup to run wp-cron.php every minute with wp cron disabled in wp-config.php. And I forgot to set the user I was running wp-cron.php as to the new daemon after migrating to a new stack, so it didn’t have permission to create and edit files.
The inconsistent behaviour was due to Action Scheduler either opting for WP CRON or using its Async Request instead randomly, Async Requests didn’t have the permission error because they were using the correct daemon to execute the jobs
Thank you
Forum: Developing with WordPress
In reply to: Action Scheduler cron jobs not writing to outputsI figured it out.
I had setup to run wp-cron.php every minute with wp cron disabled in wp-config.php. And I forgot to set the user I was running wp-cron.php as to the new daemon after migrating to a new stack, so it didn’t have permission to create and edit files.
The inconsistent behaviour was due to Action Scheduler either opting for WP CRON or using its Async Request instead randomly, Async Requests didn’t have the permission error because they were using the correct daemon to execute the jobs
Thank you
- This reply was modified 2 years, 12 months ago by Jack.
Forum: Plugins
In reply to: [Action Scheduler] actions not writing to outputsHello,
An update, I’ve found that this jobs only fail to write to fies when the action is executed with WP Cron instead of Async Request by Action Scheduler.
It seems since I turned off WP Cron usingdefine('DISABLE_WP_CRON', true);and created a custom wp-cron.php caller, the actions called with WP Cron still work but cause this strange behaviour.Is there any way to make use all Action Scheduler actions run using Async Request instead of WP Cron?
Thank you.
Forum: Developing with WordPress
In reply to: Action Scheduler cron jobs not writing to outputsHello @t-p ,
While the issue does pertain to the Action Scheduler plug-in, it is a necessary plug-in for anyone know schedules many one time cron jobs in WordPress. I have experience with this as I’ve tried the native WordPress cron job scheduler and it fail most times when calling it so I thought it would be in the interest of everyone using WordPress.
And, the plug-in is a free plug-in with no profit. It’s more of an open source library than a plug-in.
thank you
- This reply was modified 2 years, 12 months ago by Jack.
Forum: Plugins
In reply to: [Subscriptions for WooCommerce] Recurring payments for Paid Membership ProThe outdated stripe gateway plugin seems to have cause the issue. It’s solved now.
Thank you.
Forum: Plugins
In reply to: [Subscriptions for WooCommerce] Recurring payments for Paid Membership ProHello,
I believe the issue was with an outdated version of the Stripe Woocommerce Plugin, it didn’t have a function that this plugin was calling for.
I’ll check if tomorrow it withdraws money from my card correctly when I make another recurring payment.
Thank you
Forum: Plugins
In reply to: [Subscriptions for WooCommerce] Recurring payments for Paid Membership ProA /v1/sources GET request is made to the Stripe webhook, but it doesn’t make the payment request.
Forum: Plugins
In reply to: [Subscriptions for WooCommerce] Recurring payments for Paid Membership ProHello,
Is there a way to test recurring payments without having to wait 24 hours?
This issue is urgent, and support needs a staging website but I don’t have one.
Thank you.