WordPress.org

Ready to get started?Download WordPress

Forums

Testimonials by Aihrus
broken after update - multiple problems (9 posts)

  1. flowfree_lowri
    Member
    Posted 11 months ago #

    Hi

    I just updated my plugins and now testimonials widget seems to have broken, in many ways!

    My website (under construction): http://www.kayakcoaching.co.uk

    1. the actual testimonials still exist in the database but nothing found at http://www.kayakcoaching.co.uk/testimonal which should show excepts of all

    2. the widget which should show a rotating quote in the bubble at bottom of right-hand sidebar shows nothing in safari

    3. the widget which should show a rotating quote in the bubble at bottom of right-hand sidebar shows either a list of the testimonial authors or 2 quotes at once (which clearly dont both fit in bubble)

    What has happened and how do I fix it?

    Thanks,

    Lowri

    http://wordpress.org/extend/plugins/testimonials-widget/

  2. Michael Cannon
    Member
    Plugin Author

    Posted 11 months ago #

    Lowri,

    I'm really sorry to hear about the troubles. Did you read the FAQ through to http://support.aihr.us/ on the major changes or announcements?

  3. Paxjah
    Member
    Posted 11 months ago #

    Removed and opened a new thread as it's unrelated.

  4. flowfree_lowri
    Member
    Posted 11 months ago #

    Hi Michael,

    I am sorry but I don't see how that page with the changes / announcements helps me. I am very keen to make this plugin work again. If I could regress back to the previous version of the plugin, I would. Is that possible?

    If not, please could you help me to make the plug-in work again?

    Thanks

    Lowri

  5. Michael Cannon
    Member
    Plugin Author

    Posted 11 months ago #

    Lowri, ah, I could finally pull up your website. It looks like you've got a filter running to modify the output of Testimonials Widget.

    That filter needs to be updated to using the latest CSS changes per https://aihrus.zendesk.com/entries/23722573-Major-Changes-Since-2-10-0.

  6. flowfree_lowri
    Member
    Posted 11 months ago #

    OK, I think I have tracked it down. In my theme's functions.php there's the following. I tried to edit it following the guidelines in your link but it's extremely confusing. It's a long time since I've dealt with php and css, and I didn't write any of this code (yours nor the "filter" I apparently have on. If the below code is altered to meet the changes in your update will it work again? Is this the only code to be changed or is it calling other scripts that I need to find?

    /*-----------------------------------------------------------------------------------*/
    /* You can add custom functions below */
    /*-----------------------------------------------------------------------------------*/
    
    add_filter( 'testimonials_widget_testimonial_html', 'my_testimonials_widget_testimonial_html', 10, 5 );
    
    function my_testimonials_widget_testimonial_html( $content, $testimonial, $atts, $is_list = true, $is_first = false, $widget_number = null ) {
    	// do stuff… see Testimonials_Widget::get_testimonial_html for default processing
    	// return $content;
    
    	$char_limit				= ( is_numeric( $atts['char_limit'] ) && 0 <= intval( $atts['char_limit'] ) ) ? intval( $atts['char_limit'] ) : false;
    	$content_more			= apply_filters( 'testimonials_widget_content_more', __( '…', 'testimonials-widget' ) );
    	$do_company				= ( 'true' != $atts['hide_company'] ) && ! empty( $testimonial['testimonial_company'] );
    	$do_content				= ( 'true' != $atts['hide_content'] ) && ! empty( $testimonial['testimonial_content'] );
    	$do_email				= ( 'true' != $atts['hide_email'] ) && ! empty( $testimonial['testimonial_email'] ) && is_email( $testimonial['testimonial_email'] );
    	$do_image				= ( 'true' != $atts['hide_image'] ) && ! empty( $testimonial['testimonial_image'] );
    	$do_source				= ( 'true' != $atts['hide_source'] || 'true' == $atts['hide_author'] ) && ! empty( $testimonial['testimonial_source'] );
    	$do_title				= ( 'true' != $atts['hide_title'] ) && ! empty( $testimonial['testimonial_title'] );
    	$do_url					= ( 'true' != $atts['hide_url'] ) && ! empty( $testimonial['testimonial_url'] );
    	$keep_whitespace		= ( 'true' == $atts['keep_whitespace'] );
    
    	$div_open				= '<div class="testimonialswidget_testimonial';
    
    	if ( $is_list ) {
    		$div_open			.= ' testimonialswidget_testimonial_list';
    	} elseif ( $is_first ) {
    		$div_open			.= ' testimonialswidget_active';
    	} elseif ( ! $is_first ) {
    		$div_open			.= ' testimonialswidget_display_none';
    	}
    
    	$div_open				.= '"><a href="/testimonial">';
    
    	$image					= '';
    	if ( $do_image ) {
    		$image				.= '<span class="testimonialswidget_image">';
    		$image				.= $testimonial['testimonial_image'];
    		$image				.= '</span>';
    	}
    
    	$quote					= '';
    	if ( $do_content ) {
    		$content			= $testimonial['testimonial_content'];
    		$content			= Testimonials_Widget::format_content( $content, $widget_number, $keep_whitespace );
    
    		if ( $char_limit ) {
    			$content		= Testimonials_Widget::testimonials_truncate( $content, $char_limit, ' ', $content_more );
    			$content		= force_balance_tags( $content );
    		}
    
    		$content			= apply_filters( 'testimonials_widget_content', $content, $widget_number, $testimonial, $atts );
    		$content			= make_clickable( $content );
    
    		$quote				= '<q>';
    		$quote				.= $content;
    		$quote				.= '</q>';
    	}
    
    	$cite					= '';
    	$done_url				= false;
    	if ( $do_source && $do_email ) {
    		$cite				.= '<span class="testimonialswidget_author">';
    		$cite				.= '<a href="mailto:' . $testimonial['testimonial_email'] . '">';
    		$cite				.= $testimonial['testimonial_source'];
    		$cite				.= '</a>';
    		$cite				.= '</span>';
    	} elseif ( $do_source && ! $do_company && $do_url ) {
    		$cite				.= '<span class="testimonialswidget_author">';
    		$cite				.= '<a href="' . $testimonial['testimonial_url'] . '">';
    		$cite				.= $testimonial['testimonial_source'];
    		$cite				.= '</a>';
    		$cite				.= '</span>';
    		$done_url			= true;
    	} elseif ( $do_source ) {
    		$cite				.= '<span class="testimonialswidget_author">';
    		$cite				.= $testimonial['testimonial_source'];
    		$cite				.= '</span>';
    	} elseif ( $do_email ) {
    		$cite				.= '<span class="testimonialswidget_email">';
    		$cite				.= make_clickable( $testimonial['testimonial_email'] );
    		$cite				.= '</span>';
    	}
    
    	if ( $do_title && $cite )
    		$cite				.= '<span class="testimonialswidget_join_title"></span>';
    
    	if ( $do_title ) {
    		$cite				.= '<span class="testimonialswidget_title">';
    		$cite				.= $testimonial['testimonial_title'];
    		$cite				.= '</span>';
    	}
    
    	if ( ( $do_company || ( $do_url && ! $done_url ) ) && $cite )
    		$cite				.= '<span class="testimonialswidget_join"></span>';
    
    	if ( $do_company && $do_url ) {
    		$cite				.= '<span class="testimonialswidget_company">';
    		$cite				.= '<a href="' . $testimonial['testimonial_url'] . '">';
    		$cite				.= $testimonial['testimonial_company'];
    		$cite				.= '</a>';
    		$cite				.= '</span>';
    	} elseif ( $do_company ) {
    		$cite				.= '<span class="testimonialswidget_company">';
    		$cite				.= $testimonial['testimonial_company'];
    		$cite				.= '</span>';
    	} elseif ( $do_url && ! $done_url ) {
    		$cite				.= '<span class="testimonialswidget_url">';
    		$cite				.= make_clickable( $testimonial['testimonial_url'] );
    		$cite				.= '</span>';
    	}
    
    	if ( ! empty( $cite ) )
    		$cite				= '<cite>' . $cite . '</cite>';
    
    	$extra					= '';
    	if ( ! empty( $testimonial['testimonial_extra'] ) ) {
    		$extra				.= '<div class="testimonialswidget_extra">';
    		$extra				.= $testimonial['testimonial_extra'];
    		$extra				.= '</div>';
    	}
    
    	$widget_text			= '';
    	if ( ! empty( $atts['widget_text'] ) ) {
    		$widget_text		= '<div class="testimonialswidget_widget_text">';
    		$widget_text		.= $atts['widget_text'];
    		$widget_text		.= '</div>';
    	}
    
    	$div_close				= '</a></div>';
    	$html					= $div_open
    								. $image
    								. $quote
    								. $cite
    								. $extra
    								. $widget_text
    								. $div_close;
    
    	$html					= apply_filters( 'testimonials_widget_get_testimonial_html', $html, $testimonial, $atts, $is_list, $is_first, $widget_number, $div_open, $image, $quote, $cite, $extra, $widget_text, $div_close );
    
    	return $html;
    
    }
    
    // class Eab_Upcoming_Widget2 extends Eab_Widget {
    class Eab_Upcoming_Widget2 extends WP_Widget {
        /**
         * @var		string	$translation_domain	Translation domain
         */
        var $translation_domain = 'eab';
    
    	private $_defaults = array();
    
        function __construct () {
        	$this->_defaults = apply_filters('eab-widgets-upcoming-default_fields', array(
    			'title' => __('Upcoming', $this->translation_domain),
    			'excerpt' => false,
    			'excerpt_words_limit' => false,
    			'thumbnail' => false,
    			'limit' => 5,
    			'dates' => false,
    		));
    		$widget_ops = array('description' => __('Display List of Upcoming Events', $this->translation_domain));
            $control_ops = array('title' => __('Upcoming', $this->translation_domain));
    		parent::WP_Widget( 'incsub_event_upcoming2', __('Upcoming Events - MODIFIED', $this->translation_domain), $widget_ops, $control_ops );
        }
    
        function widget ($args, $instance) {
    		global $wpdb, $current_site, $post, $wiki_tree;
    
    		extract($args);
    
    		$instace = apply_filters('eab-widgets-upcoming-instance_read', $instance, $this);
    		$options = wp_parse_args((array)$instance, $this->_defaults);
    
    		$title = apply_filters('widget_title', empty($instance['title']) ? __('Upcoming', $this->translation_domain) : $instance['title'], $instance, $this->id_base);
    		$query_args = array(
    			'posts_per_page' => $options['limit'],
    		);
    		if ($options['category']) {
    			$query_args['tax_query'] = array(array(
    				'taxonomy' => 'eab_events_category',
    				'field' => 'id',
    				'terms' => (int)$options['category'],
    			));
    		}
    		$_events = Eab_CollectionFactory::get_upcoming_weeks_events(eab_current_time(), $query_args);
    
    		if (is_array($_events) && count($_events) > 0) {
    		?>
    		<?php echo $before_widget; ?>
    
    		<div class="widget_courses_container">
    		<div class="widget_courses">
    
    		<?php echo $before_title . $title . $after_title; ?>
    	            <div id="event-popular">
    			<ul>
    			    <?php
    				foreach ($_events as $_event) {
    					$thumbnail = $excerpt = false;
    					if ($options['thumbnail']) {
    						$raw = wp_get_attachment_image_src(get_post_thumbnail_id($_event->get_id()));
    						$thumbnail = $raw ? @$raw[0] : false;
    					}
    					$excerpt = false;
    					if ($options['excerpt']) {
    						$words = (int)$options['excerpt_words_limit'] ? (int)$options['excerpt_words_limit'] : false;
    						$excerpt = eab_call_template('util_words_limit', $_event->get_excerpt_or_fallback(), $words);
    					}
    			    ?>
    					<li>
    						<a href="<?php print get_permalink($_event->get_id()); ?>" class="<?php print ($_event->get_id() == $post->ID)?'current':''; ?>" >
    							<?php if ($options['thumbnail'] && $thumbnail) { ?>
    								<img src="<?php echo $thumbnail; ?>" /><br />
    							<?php } ?>
    
    							<?php if ($options['dates']) { ?>
    								<div class="date">
    									<?php
    										//echo Eab_Template::get_event_dates($_event); 
    
    										$event = ($_event instanceof Eab_EventModel) ? $_event : new Eab_EventModel($_event);
    										$start_dates = $_event->get_start_dates();
    										if ($start_dates) {
    											foreach ($start_dates as $key => $start) {
    												$start = $event->get_start_timestamp($key);
    												echo date_i18n('M j', $start);
    												break;
    											}
    										}
    									?>
    								</div>
    							<?php } ?>
    
    							<?php print $_event->get_title(); ?>
    						</a>
    
    						<?php if ($options['excerpt'] && $excerpt) { ?>
    							<p><?php echo $excerpt; ?></p>
    						<?php } ?>
    						<?php do_action('eab-widgets-upcoming-after_event', $options, $_event, $this); ?>
    					</li>
    			    <?php
    				}
    			    ?>
    			</ul>
    	            </div>
    
    	        </div>
    	    	</div>
    
    	        <?php echo $after_widget; ?>
    		<?php
    		}
        }
    
        function update ($new_instance, $old_instance) {
    		$instance = $old_instance;
            $new_instance = wp_parse_args((array)$new_instance, $this->_defaults);
    
            $instance['title'] = strip_tags($new_instance['title']);
            $instance['excerpt'] = (int)$new_instance['excerpt'];
            $instance['excerpt_words_limit'] = (int)$new_instance['excerpt_words_limit'];
            $instance['thumbnail'] = (int)$new_instance['thumbnail'];
            $instance['limit'] = (int)$new_instance['limit'];
            $instance['dates'] = (int)$new_instance['dates'];
            $instance['category'] = (int)$new_instance['category'];
    
            $instance = apply_filters('eab-widgets-upcoming-instance_update', $instance, $new_instance, $this);
    
            return $instance;
        }
    
        function form ($instance) {
        	$instance = apply_filters('eab-widgets-upcoming-instance_read', $instance, $this);
    		$options = wp_parse_args((array)$instance, $this->_defaults);
            $options['title'] = strip_tags($instance['title']);	
    
    		$categories = get_terms('eab_events_category');
    	?>
    	<div style="text-align:left">
                <label for="<?php echo $this->get_field_id('title'); ?>" style="line-height:35px;display:block;">
                	<?php _e('Title', $this->translation_domain); ?>:<br />
    				<input class="widefat"
    					id="<?php echo $this->get_field_id('title'); ?>"
    					name="<?php echo $this->get_field_name('title'); ?>"
    					value="<?php echo $options['title']; ?>" type="text" style="width:95%;"
    				/>
                </label>
                <label for="<?php echo $this->get_field_id('dates'); ?>" style="display:block;">
    				<input type="checkbox"
    					id="<?php echo $this->get_field_id('dates'); ?>"
    					name="<?php echo $this->get_field_name('dates'); ?>"
    					value="1" <?php echo ($options['dates'] ? 'checked="checked"' : ''); ?>
    				/>
                	<?php _e('Show dates', $this->translation_domain); ?>
                </label>
                <label for="<?php echo $this->get_field_id('excerpt'); ?>" style="display:block;">
    				<input type="checkbox"
    					id="<?php echo $this->get_field_id('excerpt'); ?>"
    					name="<?php echo $this->get_field_name('excerpt'); ?>"
    					value="1" <?php echo ($options['excerpt'] ? 'checked="checked"' : ''); ?>
    				/>
                	<?php _e('Show excerpt', $this->translation_domain); ?>
                </label>
                 <label for="<?php echo $this->get_field_id('excerpt_words_limit'); ?>" style="display:block; margin-left:1.8em">
                	<?php _e('Limit my excerpt to this many words <small>(<code>0</code> for no limit)</small>:', $this->translation_domain); ?>
    				<input type="text"
    					size="2"
    					id="<?php echo $this->get_field_id('excerpt_words_limit'); ?>"
    					name="<?php echo $this->get_field_name('excerpt_words_limit'); ?>"
    					value="<?php echo (int)$options['excerpt_words_limit']; ?>"
    				/>
                </label>
                <label for="<?php echo $this->get_field_id('thumbnail'); ?>" style="display:block;">
    				<input type="checkbox"
    					id="<?php echo $this->get_field_id('thumbnail'); ?>"
    					name="<?php echo $this->get_field_name('thumbnail'); ?>"
    					value="1" <?php echo ($options['thumbnail'] ? 'checked="checked"' : ''); ?>
    				/>
                	<?php _e('Show thumbnail', $this->translation_domain); ?>
               </label>
               <label for="<?php echo $this->get_field_id('limit'); ?>" style="line-height:35px;display:block;">
                	<?php _e('Limit', $this->translation_domain); ?>:
    				<select id="<?php echo $this->get_field_id('limit'); ?>" name="<?php echo $this->get_field_name('limit'); ?>">
    					<?php for ($i=1; $i<=10; $i++) { ?>
    						<?php $selected = ($i == $options['limit']) ? 'selected="selected"' : ''; ?>
    						<option value="<?php echo $i; ?>" <?php echo $selected;?>><?php echo $i;?></option>
    					<?php } ?>
    				</select>
               </label>
               <label for="<?php echo $this->get_field_id('category'); ?>" style="line-height:35px;display:block;">
                	<?php _e('Only Events from this category', $this->translation_domain); ?>:
    				<select id="<?php echo $this->get_field_id('category'); ?>" name="<?php echo $this->get_field_name('category'); ?>">
    					<option><?php _e('Any', $this->translation_domain);?></option>
    					<?php foreach ($categories as $category) { ?>
    						<?php $selected = ($category->term_id == $options['category']) ? 'selected="selected"' : ''; ?>
    						<option value="<?php echo $category->term_id; ?>" <?php echo $selected;?>><?php echo $category->name;?></option>
    					<?php } ?>
    				</select>
               </label>
               <?php do_action('eab-widgets-upcoming-widget_form', $options, $this); ?>
    	</div>
    	<?php
        }
    }
    register_widget('Eab_Upcoming_Widget2');
    
    /*-----------------------------------------------------------------------------------*/
    /* Don't add any code below here or the sky will fall down */
    /*-----------------------------------------------------------------------------------*/
    ?>
  7. flowfree_lowri
    Member
    Posted 11 months ago #

    If I need to make the alterations please clarify, does testimonialswidget_testimonial_list turn into testimonal-list? Is that the pattern for alteration?

  8. flowfree_lowri
    Member
    Posted 11 months ago #

    thanks in advance for any guidance!

  9. Michael Cannon
    Member
    Plugin Author

    Posted 11 months ago #

    After looking at the changes, I don't think you really need it as all you're looking to do is link to the testimonials page.

    Therefore for add_filter( 'testimonials_widget_testimonial_html', 'my_testimonials_widget_testimonial_html', 10, 5 );, comment it out like so, // add_filter( 'testimonials_widget_testimonial_html', 'my_testimonials_widget_testimonial_html', 10, 5 );

    Then in your widget options, add a widget bottom text of HTML that links to your testimonials page.

Reply

You must log in to post.

About this Plugin

About this Topic