Title: Version 2.0 Problems admin pages
Last modified: August 22, 2016

---

# Version 2.0 Problems admin pages

 *  Resolved [Monteloon](https://wordpress.org/support/users/monteloon/)
 * (@monteloon)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/version-20-problems-admin-pages/)
 * Hello!
 * Not working toggle switch.
 * > [View post on imgur.com](https://imgur.com/F0Bwn0f)
 * [https://wordpress.org/plugins/wp-ulike/](https://wordpress.org/plugins/wp-ulike/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [Andy Nguyen](https://wordpress.org/support/users/milunice259/)
 * (@milunice259)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/version-20-problems-admin-pages/#post-5751557)
 * I have the same problem after I updated the plugin. Please help!
    I can’t toggle
   to expand or collapse anything in the editing page.
 *  Plugin Author [Alimir](https://wordpress.org/support/users/alimir/)
 * (@alimir)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/version-20-problems-admin-pages/#post-5751592)
 * Hi,
    Thanks for your feedback. This is a simple problem from “statistics.js” 
   file. Before the next update, please replace the following codes with current“
   admin/classes/class-charts.php” file:
 *     ```
       <?php
       if ( ! class_exists( 'wp_ulike_stats' ) ) {
   
       	class wp_ulike_stats{
       		private $wpdb;
   
       		/**
       		 * Constructor
       		 */
       		public function __construct()
       		{
       			global $wpdb;
       			$this->wpdb = $wpdb;
       			add_action('admin_enqueue_scripts', array($this,'enqueue_script'));
       		}
   
       		/**
       		 * Add chart scripts files + Creating Localize Objects
       		 *
       		 * @author       	Alimir
       		 * @since           2.0
       		 * @updated         2.0.1
       		 * @return			Void
       		 */
       		public function enqueue_script($hook)
       		{
       			if ( 'wp-ulike_page_wp-ulike-statistics' != $hook ) {
       				return;
       			}
       			wp_register_script('wp_ulike_chart', plugins_url( 'js/chart.min.js' , __FILE__ ), array('jquery'), null, true);
       			wp_enqueue_script('wp_ulike_chart');
       			wp_register_script('wp_ulike_stats', plugins_url( 'js/statistics.js' , __FILE__ ), array('jquery'), null, true);
       			wp_enqueue_script('wp_ulike_stats');
       			wp_localize_script( 'wp_ulike_stats', 'wp_ulike_statistics', array(
       				'posts_date_labels' => $this->posts_dataset('label'),
       				'comments_date_labels' => $this->comments_dataset('label'),
       				'activities_date_labels' => $this->activities_dataset('label'),
       				'posts_dataset' => $this->posts_dataset('dataset'),
       				'comments_dataset' => $this->comments_dataset('dataset'),
       				'activities_dataset' => $this->activities_dataset('dataset')
       			));
       			wp_enqueue_script('postbox');
       		}
   
       		/**
       		 * Get The Posts Data Set
       		 *
       		 * @author       	Alimir
       		 * @since           2.0
       		 * @return			JSON Array
       		 */
       		public function posts_dataset($type){
       			$return_type = $type != 'dataset' ? 'new_date_time' : 'count_date_time';
       			$return_val = $this->select_data('ulike');
       			foreach($return_val as $val){
       				$newarray[] = $val->$return_type;
       			}
       			return json_encode($newarray);
       		}
   
       		/**
       		 * Get The Comments Data Set
       		 *
       		 * @author       	Alimir
       		 * @since           2.0
       		 * @return			JSON Array
       		 */
       		public function comments_dataset($type){
       			$return_type = $type != 'dataset' ? 'new_date_time' : 'count_date_time';
       			$return_val = $this->select_data('ulike_comments');
       			foreach($return_val as $val){
       				$newarray[] = $val->$return_type;
       			}
       			return json_encode($newarray);
       		}
   
       		/**
       		 * Get The Activities Data Set
       		 *
       		 * @author       	Alimir
       		 * @since           2.0
       		 * @return			JSON Array
       		 */
       		public function activities_dataset($type){
       			$return_type = $type != 'dataset' ? 'new_date_time' : 'count_date_time';
       			$return_val = $this->select_data('ulike_activities');
       			foreach($return_val as $val){
       				$newarray[] = $val->$return_type;
       			}
       			return json_encode($newarray);
       		}
   
       		/**
       		 * Get The Logs Data From Tables
       		 *
       		 * @author       	Alimir
       		 * @since           2.0
       		 * @return			String
       		 */
       		public function select_data($table){
       			$return_val = $this->wpdb->get_results(
       			"
       			SELECT DATE(date_time) AS new_date_time, count(date_time) AS count_date_time
       			FROM ".$this->wpdb->prefix."$table
       			GROUP BY new_date_time DESC LIMIT 20
       			");
       			return $return_val;
       		}
   
       		/**
       		 * Get The Summary Of Like Data
       		 *
       		 * @author       	Alimir
       		 * @since           2.0
       		 * @return			Integer
       		 */
       		public function get_data_date($table,$time){
       			if($time == 'today')
       			$where_val = "DATE(date_time) = DATE(NOW())";
       			else if($time == 'yesterday')
       			$where_val = "DATE(date_time) = DATE(subdate(current_date, 1))";
       			else if($time == 'week')
       			$where_val = "week(DATE(date_time)) = week(DATE(NOW()))";
       			else
       			$where_val = "month(DATE(date_time)) = month(DATE(NOW()))";
   
       			$return_val = $this->wpdb->get_var(
       			"
       			SELECT COUNT(*)
       			FROM ".$this->wpdb->prefix."$table
       			WHERE $where_val
       			");
       			return $return_val;
       		}
   
       		/**
       		 * Get The Sum Of All Likes
       		 *
       		 * @author       	Alimir
       		 * @since           2.0
       		 * @return			Integer
       		 */
       		public function get_all_data_date($table,$name){
       			$return_val = $this->wpdb->get_var(
       			"
       			SELECT SUM(meta_value)
       			FROM ".$this->wpdb->prefix."$table
       			WHERE meta_key LIKE '$name'
       			");
       			return $return_val;
       		}
   
       	}
   
       	//create global variable
       	global $wp_ulike_stats;
       	$wp_ulike_stats = new wp_ulike_stats();
   
       }
       ```
   
 *  Thread Starter [Monteloon](https://wordpress.org/support/users/monteloon/)
 * (@monteloon)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/version-20-problems-admin-pages/#post-5751594)
 * Thanks you.
 *  [Andy Nguyen](https://wordpress.org/support/users/milunice259/)
 * (@milunice259)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/version-20-problems-admin-pages/#post-5751614)
 * thanks you
 *  [Mickaël Gris](https://wordpress.org/support/users/mgris/)
 * (@mgris)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/version-20-problems-admin-pages/#post-5751644)
 * Thanks you!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Version 2.0 Problems admin pages’ is closed to new replies.

 * ![](https://ps.w.org/wp-ulike/assets/icon.svg?rev=2453069)
 * [WP ULike – Like & Dislike Buttons for Engagement and Feedback](https://wordpress.org/plugins/wp-ulike/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-ulike/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-ulike/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-ulike/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-ulike/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-ulike/reviews/)

 * 5 replies
 * 4 participants
 * Last reply from: [Mickaël Gris](https://wordpress.org/support/users/mgris/)
 * Last activity: [11 years, 4 months ago](https://wordpress.org/support/topic/version-20-problems-admin-pages/#post-5751644)
 * Status: resolved