Forum Replies Created

Viewing 15 replies - 16 through 30 (of 36 total)
  • Thread Starter mattf10

    (@mattf10)

    In fact, isset won’t work since posts are set but null. So instead, add is_null check, making line 317:

    if ( ! is_null( $wp_query->posts ) && 0 < count( $wp_query->posts ) ) {

    I tested with this code, and it no longer throws errors.

    Thanks again.

    • This reply was modified 2 years, 10 months ago by mattf10.
    Thread Starter mattf10

    (@mattf10)

    Hi – I see you made a change to address this in the latest version. However, the new code now generates a different error:

    count(): Parameter must be an array or an object that implements Countable in /wp-content/plugins/otter-blocks /inc/class-registration.php on line 317

    The problem is that $wp_query->posts is not set. So instead of checking the count, please change to isset($wp_query->posts).

    Thanks

    Thread Starter mattf10

    (@mattf10)

    Thanks a lot for the quick fix!

    The error was generated when accessing an author page via the query string, and the author doesn’t exist. For example:

    https://mywebsite.com/?author=333

    Thread Starter mattf10

    (@mattf10)

    Hi – there was an error message in the logs about the catalog:

    Unable to detect valid feed configuration: No catalog ID

    I created a new catalogue and after that, the connection worked.

    Thread Starter mattf10

    (@mattf10)

    Hmm – now it’s working all by itself.

    Thread Starter mattf10

    (@mattf10)

    No, the attacks are not being blocked – that’s the problem. Doesn’t WordFence see repeated attempts (1 per second for 2 hours) as a brute force attack and block the IP at its firewall, same as it does for repeated attempts to access wp-login.php?

    Here is a screen shot of the live traffic from yesterday. Notice that none of the attempts are blocked. Why aren’t they blocked?

    Thanks

    Thread Starter mattf10

    (@mattf10)

    Rules are now updating as normally on both my Dreamhost sites. Thanks!

    Thread Starter mattf10

    (@mattf10)

    Hi – I have removed basic auth so you can have a look at the absolute positioning. Search for “fund” and you’ll see the images display over the title/description.

    Thanks

    Thread Starter mattf10

    (@mattf10)

    The meta fields are available for the individual pages in the places you state. However, they are not available for the archive page, the one that lists all the custom posts (see the url above). This is not a page in the sense that you can see it in the backend under Pages. It’s a WP generated page (like category, or date pages). So there is no way to add the meta data via the backend since it doesn’t appear in Pages, and does not show in bulk meta content editor. Yoast allows you to do this via the backend, and via a filter. I have not found any way to do this with your plugin, which is why I was hoping you have a filter or some other way to add this data. Thanks

    Thread Starter mattf10

    (@mattf10)

    Thanks for coming back to me. The site is a test site, so don’t worry about missing images. The other two are a problem, but not a huge one.

    The main problems are to do with images being the wrong size, and absolutely positioned. For example, if you search for “fund”, you’ll see that the main image is huge (css missing width:100%; on img). For the three products on the left, the image is showing over the description. Problem is absolute positioning in the css. If you could have a look at fixing those, I’d appreciate it.

    Many thanks for your help, and for a great plugin.

    Thread Starter mattf10

    (@mattf10)

    Hmmm. I just regenerated the sitemaps, and this is now working. So must have been an issue when I originally generated them. I will write back if it happens again.

    Thread Starter mattf10

    (@mattf10)

    That worked. I also had to resave Permalinks for the site to pick up the changes.

    Thanks!

    Thread Starter mattf10

    (@mattf10)

    Happy to share my widget code. I’m going to be lazy and post it here.

    /**
     * Upcoming Events Widget Class.
     */
    class my_theme_upcoming_events extends WP_Widget {
    
    	/* Widget setup */
    	public function __construct() {
    		parent::__construct(
    			'my-theme-upcoming-events', // base ID
    			'Upcoming Events', // name
    			array( 'classname' => 'upcoming-events-widget', 'description' => esc_html__('Upcoming Events.', 'mc') )
    		);
    	}
    
    	/* How to display the widget on the screen */
    	public function widget( $args, $controls ) {
    		
    		extract( $args );
    
    		/* Our variables from the widget settings */
    		$title = apply_filters('widget_title', $controls['title'] );
    		$post_count = $controls['post_count'];
    		if ( !$post_count ) $post_count = 3;
    		
    		
    		// setup the basic posts query to find out events
    		$args = array(
    			'post_type' => apply_filters( 'qsot-setting', 'qsot-event', 'core_post_type' ),
    			'post_status' => array( 'publish', 'protected' ),
    			'posts_per_page' => -1,
    			'post_parent__not' => 0,
    			'suppress_filters' => false,
    			// only future events
    			'start_date_after' => date( 'Y-m-d H:i:s' )
    		);
    
    		// aggregate the list of events to render
    		$events = array();
    		if ( class_exists('qsot_frontend_calendar') && method_exists('qsot_frontend_calendar', 'get_all_calendar_events') )
    			$events = qsot_frontend_calendar::get_all_calendar_events( get_posts( $args ) );
    		
    		// if there aren't any events, don't write out any content
    		if ( ! $events )
    			return;		
    			
    		// sort by start date asc
    		usort($events, function ($item1, $item2) {
    			if ($item1['start'] == $item2['start']) return 0;
    			return $item1['start'] < $item2['start'] ? -1 : 1;
    		});
    		
    		?>
    		<li id="text-10" class="widget-container widget_text">
    		<?php
    		if ( $title ) echo $before_title . esc_attr( $title ) . $after_title; ?>
    		
    			<ul>
    			<?php 
    				foreach( $events as $event ) : ?>
    				<li class="mc-rpost clear">
    					<div class="mc-rpost-data">
    						<h4><a href="<?php echo $event['url']; ?>" title="<?php echo $event['title']; ?>"><?php echo $event['title']; ?></a></h4>
    						<p class="meta"><?php echo date('d M Y', strtotime($event['start'])); ?></p>
    					</div>
    				</li>
    				<?php endforeach; ?>
    		
    			</ul>
    		</li>
    		<?php
    	}
    
    	/* Update the widget settings */
    	public function update( $new_controls, $old_controls ) {
    		$controls = $old_controls;
    		$controls['title'] = strip_tags( $new_controls['title'] );
    		$controls['post_count'] = strip_tags( $new_controls['post_count'] );
    
    		return $controls;
    	}
    
    	/* Displays the widget settings controls on the widget panel */
    	public function form( $controls ) {
    
    		/* Set up some default widget settings */
    		$defaults = array( 'title' => '', 'post_count' => 3 );
    		$controls = wp_parse_args( (array) $controls, $defaults ); ?>
    
    		<!-- Widget Title: Text Input -->
    		<p>
    			<label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_html_e('Title:', 'mc'); ?></label>
    			<input id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" value="<?php echo esc_attr( $controls['title'] ); ?>" style="width: 80%;" />
    		</p>
    
    		<!-- Post Quantity: Text Input -->
    		<p>
    			<label for="<?php echo esc_attr( $this->get_field_id( 'post_count' ) ); ?>"><?php esc_html_e('Number of Events:', 'mc'); ?></label>
    			<input id="<?php echo esc_attr( $this->get_field_id( 'post_count' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'post_count' ) ); ?>" value="<?php echo esc_attr( $controls['post_count'] ); ?>" style="width:20%;" />
    		</p>
    
    	<?php
    	}
    }
    • This reply was modified 8 years ago by mattf10.
    Thread Starter mattf10

    (@mattf10)

    Thanks for the reply. Understood that the calendar itself isn’t responsive so I will try one of the above solutions.

    I saw that the demo for fullcalendar.io shows a list view. Is it possible to display the plugin calendar like that, eg by overriding a template?

    If not, I’ve already coded an upcoming events widget, so I could modify that to make my own list.

    I’m having the same issue – unable to save changes to settings.

    No #WAF path defs in my .htaccess. There is no user.ini in the root.

    Nothing in the error logs either.

    Do you have any other ideas? Thanks.

    • This reply was modified 8 years, 3 months ago by mattf10.
Viewing 15 replies - 16 through 30 (of 36 total)