James W
Forum Replies Created
-
I updated to php 7.4 from 7.2 and the error disappeared. Seems odd because it should be a syntax error in both versions, but maybe they use different libraries.
Forum: Plugins
In reply to: [Relevanssi - A Better Search] Theme my login plugin breaks resultI’ve been holding off updating theme my login since version 6.3.12 because of this bug. It only seems to affect Relevanssi, and not normal wordpress search.
I did some testing with v6.4.9 and found that this is caused by pre_get_posts() in class-theme-my-login.php. Relevanssi search works again as soon as I comment out the following lines:
// Get TML pages $pages = get_posts( array( 'post_type' => 'page', 'post_status' => 'any', 'meta_key' => '_tml_action', 'posts_per_page' => -1 ) ); // Get the page IDs $pages = wp_list_pluck( $pages, 'ID' ); // Get any currently exclude posts $excludes = (array) $query->get( 'post__not_in' ); // Merge the excludes $excludes = array_merge( $excludes, $pages ); // Set the excludes $query->set( 'post__not_in', $excludes );
The pre_get_posts function seems to add a bunch of pages (133 of them on my site) to the post__not_in query variable, and nothing is returned in Relevanssi search results. Without the block of code above, post__not_in is empty and search works normally.
For now, I’m going to have to comment out pre_get_posts() until this plays nicely with Relevanssi.
Edit: With a bit more digging, I found that with Relevanssi enabled, the get_posts function used by Theme My Login returns what appears to be every published object. But with Relevanssi disabled, get_posts only returns 6 pages. Those pages are the ones used by the Theme My Login for login/logout/profile/etc and shouldn’t appear in search. How can we make the two plugins work together?
Edit2: I just found https://www.relevanssi.com/knowledge-base/query_posts/ which seems to point to a problem with WordPress?
Forum: Plugins
In reply to: [Cloudflare] CloudFlare login panel not showing upI was getting a 403 error with /wp-content/plugins/cloudflare/config.js?ver=3.1.1 and it turned out to be overprotective htaccess rules. Reloaded the page and it’s worked since, even with the previous htaccess file restored.