Rasso Hilber
Forum Replies Created
-
@delyandelov The underlying library https://github.com/PHPGangsta/GoogleAuthenticator seems to be unmaintained. The last release was in 2016. Seems like you’ll need to fork it, it’s a small fix in the end. Thank you for looking into this!
- This reply was modified 6 months, 3 weeks ago by Rasso Hilber.
Forum: Plugins
In reply to: [Conditional Fields for Contact Form 7] Fix the admin script initializationA bit of investigation showed that I had the issue due to jquery-migrate not being loaded in the theme I was using on the site experiencing the issue with cf7-conditional-fields.
So I would definitely recommend to fix this in the plugin and use the code from the PR.Thanks @gpetrova for passing this along! I just noticed that I had something backwards in my first comment: Of course, the cleanup should also be scheduled if
DISABLE_WP_CRON
was set totrue
(I wrotefalse
above). In fact, it should simply ignore theDISABLE_WP_CRON
constant altogether.As a temporary workaround, users can put this snippet in their
functions.php
:/** * Make sure the sg security cleanup job is being scheduled */ add_action('init', function () { if (!wp_next_scheduled('siteground_security_clear_logs_cron')) { wp_schedule_event(time(), 'daily', 'siteground_security_clear_logs_cron'); } });
This function could still be run if on the plugin page, regardless of the cron job being active:
/** * Delete logs on plugin page if cron is disabled. * * @since 1.0.0 */ public function delete_logs_on_admin_page() { // Delete if we are on plugin page and cron is disabled. if ( isset( $_GET['page'] ) && 'sg-security' === $_GET['page'] && 1 === Helper_Service::is_cron_disabled() ) { $this->delete_old_activity_logs(); } }
Better:
/** * Delete logs on plugin page just to be sure * * @since 1.0.0 */ public function delete_logs_on_admin_page() { // Delete if we are on plugin page if ( isset( $_GET['page'] ) && 'sg-security' === $_GET['page'] ) { $this->delete_old_activity_logs(); } }
- This reply was modified 1 year, 4 months ago by Rasso Hilber.
- This reply was modified 1 year, 4 months ago by Rasso Hilber.
As a temporary workaround I developed this filter callback:
/** * Tells Media Cleaner Pro if an image is in use on any ACF options page * @see https://meowapps.com/media-cleaner/faq/#media-library-method * * @param bool $is_used What WPMC thinks about the attachment * @param int $id The attachment ID */ function check_if_media_is_in_use_on_acf_options_pages(bool $is_used, int $id): bool { $options_pages = acf_get_options_pages(); if (empty($options_pages)) return $is_used; // This is what we will be looking for: $serialized_id = serialize((string) $id); // Look through all options pages foreach ($options_pages as $options_page) { // Get a serialized array of all fields, unformatted $serialized_fields = serialize(get_fields($options_page['post_id'], false) ?: []); // Check if the serialized $id can be found in the serialized fields if (str_contains($serialized_fields, $serialized_id)) return true; } return $is_used; } add_filter('wpmc_check_media', 'check_if_media_is_in_use_on_acf_options_pages', 10, 2);
To support all possible scenarios (single image/file, gallery, repeaters, flexible content,…) I opted to just serialize all fields and check if the serialized version of the
$id
can be found there. Works smoothly!Forum: Plugins
In reply to: [Relevanssi - A Better Search] Add custom text to index for certain postsThanks Mikko! Resolved it manually syncing the meta values, that made Relevanssi pick them up for the mirrors as well.
Forum: Plugins
In reply to: [Relevanssi - A Better Search] Add custom text to index for certain postsThanks for your response! I’ll make sure to open future tickets on the premium support. Hope it’s ok that we finalize this issue here, it might help someone else in the future.
relevanssi_content_to_index
looks interesting. Now the only question remains, how can I get the Relevanssi index data for a post (the data being displayed when clicking “How Relevanssi sees this post”)?Niiice! I have Relevanssi Premium, so I can make use of the
customfield_detail
detection. Will try this out. Thanks for your quick response. Stellar support as always! 🌟Forum: Plugins
In reply to: [Media Cleaner: Clean your WordPress!] Notices in wp-cliHi @tigroumeow , sure I’ve contacted you through the support link. Thanks! 🙂
Ah, didn’t find that when I was looking. Thanks! 🙂
@tigroumeow thank you for your answer! Great to hear you want to implement this.
I can’t find your email address, would you mind pinging me at mail@rassohilber.com?
Forum: Plugins
In reply to: [Media Cleaner: Clean your WordPress!] Notices in wp-cliI think this due to the fact that media cleaner assumes the field is a WP_Post object, but ACF fields can also be registered directly using PHP: https://www.advancedcustomfields.com/resources/register-fields-via-php/
Thanks @lastsplash ! I created an issue over at GH:
Wow @thingalon , that’s such good news!! 🎉 I’ll be sure to check it out end report back over on GitHub.
Thanks so much for listening and reacting so quickly.