Fatal Error after Update
-
Hello,
after update to 3.4.1 the it produced a fatal error. I have deactivated it and cant r-activate it now. wordpress stopp it because of the fatal error.
-
Create class-webi-custom-widget.php in the plugin root.
Place here –<?php
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Webi_Custom_Widget' ) ) {
/**
* Custom widget to display the online active users count.
*
* @package Online_Active_Users
*/
class Webi_Custom_Widget extends WP_Widget {
/**
* Constructor.
*/
public function __construct() {
parent::__construct(
'webi_custom_widget',
__( 'WP Online Active User', 'online-active-users' ),
array( 'description' => __( 'Display Online Active Users.', 'online-active-users' ) )
);
}
/**
* Front-end display.
*
* @param array $args Widget arguments.
* @param array $instance Saved widget settings.
*/
public function widget( $args, $instance ) {
echo $args['before_widget'];
if ( ! empty( $instance['title'] ) ) {
echo $args['before_title'] . apply_filters( 'widget_title', $instance['title'] ) . $args['after_title'];
}
if ( isset( $GLOBALS['wpoau_plugin'] ) && $GLOBALS['wpoau_plugin'] instanceof Webi_Active_User ) {
$active_users_count = $GLOBALS['wpoau_plugin']->wpoau_online_users( 'count' );
} else {
$wpoau_plugin = new Webi_Active_User();
$active_users_count = $wpoau_plugin->wpoau_online_users( 'count' );
}
echo '<div class="webi-widget-content">';
echo '<p>' . esc_html__( 'Online Active Users:', 'online-active-users' ) . ' <strong>' . absint( $active_users_count ) . '</strong></p>';
echo '</div>';
echo $args['after_widget'];
}
/**
* Back-end widget form.
*
* @param array $instance Widget settings.
*/
public function form( $instance ) {
$title = ! empty( $instance['title'] ) ? $instance['title'] : __( 'Active Users', 'online-active-users' );
?>
<p>
<label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_html_e( 'Title:', 'online-active-users' ); ?></label>
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>">
</p>
<?php
}
/**
* Save widget settings.
*
* @param array $new_instance New settings.
* @param array $old_instance Old settings.
* @return array
*/
public function update( $new_instance, $old_instance ) {
$instance = array();
$instance['title'] = ( ! empty( $new_instance['title'] ) ) ? sanitize_text_field( $new_instance['title'] ) : '';
return $instance;
}
}
}Thank you @crashbone and @cyberdaemon for reporting this issue. I will check it, fix it, and release the update in the next plugin version.
I’ve already fixed it)))
@cyberdaemon Thanks, its working for me, too.
Hello, I am not happy with the current situation: my WordPress v7.0.3 is no longer available and I could no longer log in as an administrator either. The reason for this is that I updated Online Active Users v3.4.0 to v3.4.1 and have to restore the website using a backup from my hosting provider. I have now reverted to v3.4.0 and am waiting for a working update version. Kind regards, from the Netherlands
-
This reply was modified 1 day ago by
eranedwebbeheerder.
I got same fatal error after updated to 3.4.1 and now rollback to v3.4.0, waiting for next release to fix
-
This reply was modified 1 day ago by
You must be logged in to reply to this topic.