whereverpanda
Forum Replies Created
-
Thanks again, Mikko!
Hi Mikko,
It does seem to have solved it thank you so much!
Will this be included in the next release, or would I need to keep a copy of this file and replace it again when you release a new update for the plugin?
Thanks again, for you amazing and quick assistance!
Hi Mikko,
Unfortunately this did not seem to work. Could this be an Oxygen builder issue again?
I have tested with some other random words now and it does indeed give the WordPress error now (after disabling your code again) for words that are in the page content and not part of the Stopwords Candidates list. In fact it seems to give that error for words in the Oxygen page content, but not for words that are put into the Oxygen content with shortcodes (from other plugins like Easy Accordions). So when I used a word in an accordion that isn’t used anywhere else inside the actual Oxygen page content, it will give a result for the page on which that shortcode is embedded.
Here is an example of an error that is not a stopword candidate:
[02-Feb-2021 07:02:12 UTC] PHP Fatal error: Uncaught TypeError: Argument 1 passed to relevanssi_strip_tags() must be of the type string, null given, called in /xxx/xxx/xxx/xxx/wp-content/plugins/relevanssi/lib/excerpts-highlights.php on line 184 and defined in /xxx/xxx/xxx/xxx/wp-content/plugins/relevanssi/lib/utils.php:737 Stack trace: #0 /xxx/xxx/xxx/xxx/wp-content/plugins/relevanssi/lib/excerpts-highlights.php(184): relevanssi_strip_tags(NULL) #1 /xxx/xxx/xxx/xxx/wp-content/plugins/relevanssi/lib/search.php(1006): relevanssi_do_excerpt(Object(stdClass), 'metro', '20', 'words') #2 /xxx/xxx/xxx/xxx/wp-content/plugins/relevanssi/lib/search.php(94): relevanssi_do_query(Object(WP_Query)) #3 /xxx/xxx/xxx/xxx/wp-includes/class-wp-hook.php(287): relevanssi_query(NULL, Object(WP_Query)) #4 /xxx/xxx/xxx/xxx/wp-includes/plugin.php(255): WP_Hook->apply_filters(NULL, Array) #5 /xxx/xxx/xxx/xxx/wp-includes/class-wp-query.php(2951): apply_filters_ref_array('post in /xxx/xxx/xxx/xxx/wp-content/plugins/relevanssi/lib/utils.php on line 737
So is this yet again an Oxygen issue?
Hi Mikko,
I’m not sure if this is what you are looking for, but this is what is in the error_log document in the WordPress root for one one of the search terms that is a stopword candidate (the word ‘network’):
[02-Feb-2021 06:27:42 UTC] PHP Fatal error: Uncaught TypeError: Argument 1 passed to relevanssi_strip_tags() must be of the type string, null given, called in /xxx/xxx/xxx/xxx/wp-content/plugins/relevanssi/lib/excerpts-highlights.php on line 184 and defined in /xxx/xxx/xxx/xxx/wp-content/plugins/relevanssi/lib/utils.php:737 Stack trace: #0 /xxx/xxx/xxx/xxx/wp-content/plugins/relevanssi/lib/excerpts-highlights.php(184): relevanssi_strip_tags(NULL) #1 /xxx/xxx/xxx/xxx/wp-content/plugins/relevanssi/lib/search.php(1006): relevanssi_do_excerpt(Object(stdClass), 'network', '20', 'words') #2 /xxx/xxx/xxx/xxx/wp-content/plugins/relevanssi/lib/search.php(94): relevanssi_do_query(Object(WP_Query)) #3 /xxx/xxx/xxx/xxx/wp-includes/class-wp-hook.php(287): relevanssi_query(NULL, Object(WP_Query)) #4 /xxx/xxx/xxx/xxx/wp-includes/plugin.php(255): WP_Hook->apply_filters(NULL, Array) #5 /xxx/xxx/xxx/xxx/wp-includes/class-wp-query.php(2951): apply_filters_ref_array('po in /xxx/xxx/xxx/xxx/wp-content/plugins/relevanssi/lib/utils.php on line 737
(I just replaced the filepaths with ‘xxx’)
Again, this message might 100% tell me what’s wrong but I’m not savvy with this at all.
Forum: Plugins
In reply to: [Enable Media Replace] User role controlI would like to request this as well. This is a brilliant plugin but having the site say ‘Sorry, you are not allowed to edit this item.’ when they actually can, is not helpful. I need my site to allow people to replace the attachments without renaming them and if the site brings up that message, even though it IS working, is not good.
Do you have any idea how to make it not say ‘Sorry, you are not allowed to edit this item.’ but instead just let it function in the normal way (eg a success message)?
Thanks!
Forum: Plugins
In reply to: [Relevanssi - A Better Search] How to index content within shortcodesAwesome, thank you again Mikko!
Forum: Plugins
In reply to: [Relevanssi - A Better Search] How to index content within shortcodesPlease ignore this post – I disabled and re-enabled the plugin, and it started indexing again properly!!
Hi Mikko,
I don’t know if I’m doing something stupid, but since updating to the newest release, all my settings were reset, and when trying to recreate the settings (I only index pages) it gets 41 results, but indexes none of them.
Wiping out the index... Counting posts... 41 posts found. Indexed 0 posts (total 0), processed 41 / 41. Indexing complete. 41 posts excluded.
Can you possibly assist? My settings are still the same as above. Obviously the snippet is still deactivated.
Also, when adding pages to the ‘Post Exclusion’ field on the ‘Searching’ page, it empties the field again when saving.
Thanks!
- This reply was modified 3 years, 12 months ago by whereverpanda.
- This reply was modified 3 years, 12 months ago by whereverpanda.
Forum: Plugins
In reply to: [Relevanssi - A Better Search] How to index content within shortcodesHi Mikko,
Disabling that snippet seems to have done it. I see none of the ct_section text in any of the excerpts or get any results when searching for it.
Yet again, you have helped SO much.
I’m sure I’ll probably need help again at some point, but once again I thank you from the bottom of my heart.
I also have a test/development site with Oxygen Builder, so if you ever need any testing etc done for this plugin, please just shout. I will do my best to help wherever I can.
But for now, again, thank you. And please enjoy the rest of your Saturday/Weekend!
Forum: Plugins
In reply to: [Relevanssi - A Better Search] How to index content within shortcodesHi Mikko,
Again, thank you so much for your amazing assistance in this.
Unfortunately this does not seem to have have done the trick.
I have replaced the content of the file as you suggested (from within WordPress’s plugin editor).
And just to give some more info, if it helps:
On the Relevanssi ‘Indexing‘ page:
- I still have ‘Custom Fields‘ set to ‘Some‘ with ‘ct_builder_shortcodes‘ in it.
- ‘Index the post excerpt‘ is checked.
- ‘Expand shortcodes when indexing‘ is checked.
On the Relevanssi ‘Excerpts and highlights‘ page:
- I have ‘Create custom search result snippets‘ checked.
- ‘Use custom field content for building excerpts‘ is checked.
I also still have this running in a Code Snippet:
add_filter('relevanssi_custom_field_value', function($values, $field, $post_id) { array_walk_recursive( $values, function ( &$value ) use ( $field, $post_id ) { if ($field === 'ct_builder_shortcodes') { $value = do_shortcode( $value ); } } ); return $values; },10,3);
The reason I’m giving you this, is because it not only shows up when searching for ‘section’ or ‘ct_section’, but it also appears in the excerpt that is displayed on the Search Results page.
Any ideas?
Forum: Plugins
In reply to: [Relevanssi - A Better Search] How to index content within shortcodesHi Mikko,
So since the latest release of Relevanssi, it seems like something has changed with Oxygen builder (since I saw you included some new hooks for it).
Again, I’m not a coder at all, but I need some help if you can. The search still seems to work fine, it indexes all the content from Oxygen and 3rd party plugin shortcodes, HOWEVER, now I see things like this in some of my search results:
[ct_section blah blah blah...
Any idea if this is to do with the snippet you helped me with, and can it be removed from the excerpts and search index? (it actually shows when I search for ‘ct_section’)
Thanks!
Forum: Plugins
In reply to: [Relevanssi - A Better Search] How to index content within shortcodesThis is so strange @mikeingz – because the site I’m working on, searches only pages, and ALL my pages are built using Oxygen and most content use the flex property.
I rebuilt the search index and everything, and when I search the term ‘flex’ I get 3 page results, all of which have the word ‘flexibility’ in its content.
So the solution from @msaari seems to have solved my problem at least (or I hope so, we all know things break overnight for no reason!)
Forum: Plugins
In reply to: [Relevanssi - A Better Search] How to index content within shortcodesYou are awesome, Mikko, thank you!
I will share this on their Facebook group where I was initially directed to the code I used at first.
I think you have just cleared up an issue for lots of people.
Thanks again!!
Forum: Plugins
In reply to: [Relevanssi - A Better Search] How to index content within shortcodesHi Mikko,
Okay – It seems like this worked, which is obviously AMAZING for me. But I really need to know why this worked.
On the documentation where I originally got the following code from:
add_filter('relevanssi_custom_field_value', function($values, $field, $post_id) { array_walk_recursive( $values, function ( &$value ) use ( $field, $post_id ) { if ($field === 'ct_builder_shortcodes') { $value = preg_replace('/\[.*?\]/',' ',$value); } } ); return $values; },10,3);
it said that this is needed, because and this is the quote “If we keep the shortcodes, and someone types some keywords like ‘display’, ‘position’, ‘flex’, most pages will show up in the result because these keywords are often used in the Oxygen shortcodes.”
This is however not happening. It only picks up those types of words if it’s actually on the page (my site only searches pages).
If you have a moment, can you possibly explain this to me like I’m an idiot (which I am when it comes to this)?
Forum: Plugins
In reply to: [Relevanssi - A Better Search] How to index content within shortcodesHi Mikko,
Thank you for your reply. the Easy Accordion shortcode looks something like ths:
[sp_easyaccordion id="123"]
It also has an option to add the shortcode with PHP, which I don’t think will make much of a difference.
I’m sorry, but I have no idea how to debug a function (I’m really just a front end guy) – Can you possibly explain how to do this. I know this is not your job, but I would really appreciate this.
Is this something that can be done with Query Monitor? When I run that, I get the following 2 elements for Easy Accordion:
SELECT * FROM wp_posts WHERE ID = 997 LIMIT 1 WP_Post::get_instance() wp-includes/class-wp-post.php:242 get_post() wp-includes/post.php:780 get_post_status() wp-includes/post.php:898 Easy_Accordion_Free_Shortcode->sp_easy_accordion_shortcode() wp-content/plugins/easy-accordion-free/public/views/class-easy-accordion-free-shortcode.php:92 do_shortcode_tag() wp-includes/shortcodes.php:343 preg_replace_callback() wp-includes/shortcodes.php:343 do_shortcode() wp-includes/shortcodes.php:218 CT_Shortcode->add_shortcode() wp-content/plugins/oxygen/component-framework/components/classes/shortcode.class.php:54 do_shortcode_tag() wp-includes/shortcodes.php:343 preg_replace_callback() wp-includes/shortcodes.php:343 do_shortcode() wp-includes/shortcodes.php:218 CT_Section->add_shortcode() wp-content/plugins/oxygen/component-framework/components/classes/section.class.php:57 do_shortcode_tag() wp-includes/shortcodes.php:343 preg_replace_callback() wp-includes/shortcodes.php:343 do_shortcode() wp-includes/shortcodes.php:218 CT_DIV_Block->add_shortcode() wp-content/plugins/oxygen/component-framework/components/classes/div-block.class.php:47 do_shortcode_tag() wp-includes/shortcodes.php:343 preg_replace_callback() wp-includes/shortcodes.php:343 do_shortcode() wp-includes/shortcodes.php:218 ct_do_shortcode() wp-content/plugins/oxygen/component-framework/component-init.php:5475 CT_Inner_Content->add_shortcode() wp-content/plugins/oxygen/component-framework/components/classes/inner-content.class.php:98 do_shortcode_tag() wp-includes/shortcodes.php:343 preg_replace_callback() wp-includes/shortcodes.php:343 do_shortcode() wp-includes/shortcodes.php:218 ct_do_shortcode() wp-content/plugins/oxygen/component-framework/component-init.php:5475 ct_template_output() wp-content/plugins/oxygen/component-framework/includes/templates.php:22 ct_templates_buffer_start() wp-content/plugins/oxygen/component-framework/includes/templates.php:74 do_action('ct_builder_start') wp-includes/plugin.php:478 oxy_print_cached_css() wp-content/plugins/oxygen/component-framework/component-init.php:1122 do_action('wp_head') wp-includes/plugin.php:478 wp_head() wp-includes/general-template.php:3006
And
SELECT post_id, meta_key, meta_value FROM wp_postmeta WHERE post_id IN (997) ORDER BY meta_id ASC update_meta_cache() wp-includes/meta.php:1061 get_metadata_raw() wp-includes/meta.php:576 get_metadata() wp-includes/meta.php:506 get_post_meta() wp-includes/post.php:2126 Easy_Accordion_Free_Shortcode->sp_easy_accordion_shortcode() wp-content/plugins/easy-accordion-free/public/views/class-easy-accordion-free-shortcode.php:99 do_shortcode_tag() wp-includes/shortcodes.php:343 preg_replace_callback() wp-includes/shortcodes.php:343 do_shortcode() wp-includes/shortcodes.php:218 CT_Shortcode->add_shortcode() wp-content/plugins/oxygen/component-framework/components/classes/shortcode.class.php:54 do_shortcode_tag() wp-includes/shortcodes.php:343 preg_replace_callback() wp-includes/shortcodes.php:343 do_shortcode() wp-includes/shortcodes.php:218 CT_Section->add_shortcode() wp-content/plugins/oxygen/component-framework/components/classes/section.class.php:57 do_shortcode_tag() wp-includes/shortcodes.php:343 preg_replace_callback() wp-includes/shortcodes.php:343 do_shortcode() wp-includes/shortcodes.php:218 CT_DIV_Block->add_shortcode() wp-content/plugins/oxygen/component-framework/components/classes/div-block.class.php:47 do_shortcode_tag() wp-includes/shortcodes.php:343 preg_replace_callback() wp-includes/shortcodes.php:343 do_shortcode() wp-includes/shortcodes.php:218 ct_do_shortcode() wp-content/plugins/oxygen/component-framework/component-init.php:5475 CT_Inner_Content->add_shortcode() wp-content/plugins/oxygen/component-framework/components/classes/inner-content.class.php:98 do_shortcode_tag() wp-includes/shortcodes.php:343 preg_replace_callback() wp-includes/shortcodes.php:343 do_shortcode() wp-includes/shortcodes.php:218 ct_do_shortcode() wp-content/plugins/oxygen/component-framework/component-init.php:5475 ct_template_output() wp-content/plugins/oxygen/component-framework/includes/templates.php:22 ct_templates_buffer_start() wp-content/plugins/oxygen/component-framework/includes/templates.php:74 do_action('ct_builder_start') wp-includes/plugin.php:478 oxy_print_cached_css() wp-content/plugins/oxygen/component-framework/component-init.php:1122 do_action('wp_head') wp-includes/plugin.php:478 wp_head() wp-includes/general-template.php:3006
- This reply was modified 4 years, 1 month ago by whereverpanda.
Thanks man – Much appreciated!