Simon Barnett
Forum Replies Created
-
Hi Donncha,
Many thanks for your reply. My client is resolving this with another developer now, so I won’t be able to test the solution, but I’ll take note of your suggestion for future reference.
Thanks again,
SimonThanks Mortelking.
This was a client request ie. they and their website users were experiencing the issue, so it wasn’t just happening in my browser.
I was able to replicate the issue, and can confirm that it is not browser related or browser-specific, especially seeing as the issue does not occur when WP Super Cache caching is disabled, so this is an issue with WP Super Cache.
Forum: Plugins
In reply to: [Download Manager] Recoverable fatal errorNoted, Jan.
Forum: Plugins
In reply to: [Download Manager] Recoverable fatal errorHi Nayeem, thanks, yes I tried disabling all other plugins, republishing the file post-type using another file post template (default), and the error remained.
However when I created another post it worked:
https://siliconmountain.co.za/cop/download/test-2/Forum: Reviews
In reply to: [CRM: Contact Management Simplified - UkuuPeople] Holding thumbsI will attend to this, I promise, Nathan. Deadline on right now.
It’s happening to me too. I narrowed down 32 plugins to this one.
Naturally it was the last one, seeing as the name begins with a “Y”.
..had to laugh.Could it be any of these?
class-install-deactivate.php
public function tinymce_fix($init) { $init['wpautop'] = false; return $init; }
wysiwyg.php
static function value( $new, $old, $post_id, $field ) { if($field['raw']) { $meta = $new; } else if( $field['clone'] ) { $meta = array_map( 'wpautop', $new ); } else { $meta = wpautop( $new ); } return $meta; }
Forum: Fixing WordPress
In reply to: Where to submit malware samples?Not here
I know, which is why I’m asking where.
Forum: Fixing WordPress
In reply to: How to find the source of a potentially malicious file?I decided not to contact them. Once I knew it was from BackupBuddy it was a much lower priority than finding the actual exploit on the server.
Forum: Fixing WordPress
In reply to: How to find the source of a potentially malicious file?Thanks Steve.. posted that as you were posting your response. I’m pretty sure now that it is BackupBuddy. I’m going to contact iThemes now to make sure, but that line is present in a fresh copy of the latest version. Will update here if there’s anything more to add after that. Otherwise thanks again!
Forum: Fixing WordPress
In reply to: How to find the source of a potentially malicious file?I did a search for the term “settings_backup” using String Locator plugin and it seems the file is being generated by BackupBuddy. The string is located at:
/wp-content/plugins/backupbuddy/classes/housekeeping.php// TODO: Added Aug 8, 2016. Remove this section after a while. // Begin removal of botches storage location. $existing_backups = glob( ABSPATH . 'settings_backup-*.php' ); if ( ! is_array( $existing_backups ) ) { $existing_backups = array(); } foreach( $existing_backups as $existing_backup ) { @unlink( $existing_backup ); } // End removal.
Ok, I guess it’s slightly slow because it’s running multiple queries.
Any way around that? With this, or another method?Seeing as the scope attribute was already being used to query the date, I created a custom search attribute instead.
It works, although seems a little slow to query, and I still need to add All Day events.
In functions.php
/* Hook timeperiod search attribute into default search filter */ function timeperiod_search($searches, $array){ if( !empty($array['timeperiod']) ){ $searches['timeperiod'] = $array['timeperiod']; } return $searches; } add_filter('em_events_get_default_search','timeperiod_search',1,2); /* Filter Conditions */ function timeperiod_conditions($conditions, $args){ if( !empty($args['timeperiod'])) { $timeperiodval = $args['timeperiod']; if ($timeperiodval == "Morning") { $period_start_time = "06:00:00"; $period_end_time = "12:00:00"; } elseif ($timeperiodval == "Afternoon") { $period_start_time = "12:00:00"; $period_end_time = "18:00:00"; } elseif ($timeperiodval == "Evening") { $period_start_time = "18:00:00"; $period_end_time = "06:00:00"; } $conditions['timeperiod'] = " (event_start_time BETWEEN CAST('$period_start_time' AS TIME) AND CAST('$period_end_time' AS TIME))"; } return $conditions; } add_filter( 'em_events_build_sql_conditions', 'timeperiod_conditions',1,2);
In events-list.php template file:
<?php $args = apply_filters('em_content_events_args', $args); if( get_option('dbem_css_evlist') ) echo "<div class='css-events-list'>"; $args['timeperiod'] = 'Morning'; echo "<h2>Morning</h2>"; echo EM_Events::output( $args ); $args['timeperiod'] = 'Afternoon'; echo "<h2>Afternoon</h2>"; echo EM_Events::output( $args ); $args['timeperiod'] = 'Evening'; echo "<h2>Evening</h2>"; echo EM_Events::output( $args ); if( get_option('dbem_css_evlist') ) echo "</div>";
Each time someone does a search – filtered by date and category – they should get the following results in the AJAX container:
All Day Events
4 events, filtered by chosen criteriaMorning Events
4 events, filtered by chosen criteriaAfternoon Events
4 events, filtered by chosen criteriaEvening Events
4 events, filtered by chosen criteriaCurrently I have the filtering working fine, (as per my staging site). I just need to split the results into the 4 time periods now. Your suggestion of creating a custom scope (or rather 4 custom scopes) sounds like what I was after.
I think perhaps using the custom scopes in template tags or the object::command structure (my own terminology.. hope that’s correct) may be better than using the scopes in a shortcode for reasons outlined below, as far as I understand things.
If I understand correctly, this is what the plugin is doing:
————————
[event_search_form ajax=”1″]
Shortcode on WordPress page.
▼
events-search.php ?? modified /templates/search/scope.php
Template file called by event_search shortcode.
$args from plugin settings.
▼
<div class=”em-search-ajax“></div>
Results container populated by search form results.
▼
events-list.php
Template file used in search results.
▼
Plugin settings: event list formatting————————
So it’s the events-list.php which needs to be modified to output four scope-based loops instead of one. Or alternatively a filter function can be used.
————————
So working through the available options, all using custom scopes except for the last one:
1. Shortcodes in WordPress page template
Not really an option because AJAX is being used.2. Shortcodes in events-list.php template file
Could have been an option, but it doesn’t work. I can create custom scopes, one for each time period, and put them into [events_list] shortcodes. But if I use the shortcodes in the events-list.php template file I get a white screen. I think the shortcode fetches the template file, so you end up with an infinite loop.3. Shortcodes in filter function
So as far as I understand the only remaining option that can use a shortcode – albeit via do_shortcode() – is a filter in functions.php, probably em_event_output.4. Template tag or object::command (with args) in filter function
But if I’m using the filter then I may as well use template tags like em_events( $args), or an object::command like EM_Events::output( $args ) instead of shortcodes.5. EM_Events::output($args) in events-list.php template file
Lastly, if we’re using template tags or object::command instead of shortcodes, there’s another option available: using those in the events-list.php template file.6. Four time-based wp_query loops in filter function
Just listing this because it’s a possible method. Only use WordPress (non EM) functions to build the loops. Custom scopes not needed in this case.————————
Option 1 doesn’t work
Option 2 doesn’t work
Option 3 seems slightly excessive
Option 4 would probably be most versatile and robust
Option 5 seems simplest
Option 6 not necessaryHopefully I’ve explained my requirements well.
Are these all the available options, or are there others which are potentially better?
Is my assessment of the suitability of option 4 and 5 correct?Thanks for the help, Calmin_nwl
Thanks Calmin_nwl, That sounds like a good approach.
The site I’m building is heavily based around the AJAX search form (staging site here).
What’s the best place to put the shortcodes so that they will be used in the results container: .em-search-ajax?
I think the shortcode calls the events-list.php plugin template file, so they can’t be used in there.. just creates an infinite loop.
So maybe.. a filter function?
<script> jQuery(document).ready(function($){ $('.em-search-submit').submit(); }); </script>
..did the trick : )