403Webshell
Server IP : 62.173.141.34  /  Your IP : 216.73.217.113
Web Server : Apache/2.4.63 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/3.0.2
System : Linux server7.msonline.ru 5.15.0-179-generic #189-Ubuntu SMP Tue May 5 18:20:56 UTC 2026 x86_64
User : izihss ( 1005)
PHP Version : 7.4.33
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,exec,system,passthru,shell_exec,proc_open,popen
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/izihss/web/izihss.ru/public_html/wp-content/plugins/wpms_vcdv/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/izihss/web/izihss.ru/public_html/wp-content/plugins/wpms_vcdv/wpms_vcdv.php
<?php

/*
Plugin Name: Views Counter & Date Views
Plugin URI: http://prmv.ru/wpms_vcdv/
Description: Плагин отображает количество просмотров страниц/записей и их дату последнего обновления (разработано специально для ООО "М-Сервис", г.Минусинск).
Version: 1.2
Author: Shamil Pirumov
Author URI: http://prmv.ru/
*/

add_action('wp_head', 'wpms_postviews');

function insertCounter($content) {
	if(is_single() || is_page() && !is_home() && !is_front_page() ) {
        $content.='<div class="wpms_vcdv">Просмотров: '.get_post_meta(get_the_ID(),'views',true).'. Обновлено: '.get_the_modified_date().'</div>';
	}
	return $content;
}

function wpms_postviews() {

/* ------------ Настройки -------------- */
$meta_key       = 'views';  // Ключ мета поля, куда будет записываться количество просмотров.
$who_count      = 0;            // Чьи посещения считать? 0 - Всех. 1 - Только гостей. 2 - Только зарегистрированных пользователей.
$exclude_bots   = 0;            // Исключить ботов, роботов, пауков и прочую нечесть :)? 0 - нет, пусть тоже считаются. 1 - да, исключить из подсчета.

global $user_ID, $post;
	//if(is_singular()) {
		$id = (int)$post->ID;
		static $post_views = false;
		if($post_views) return true; // чтобы 1 раз за поток
		$post_views = (int)get_post_meta($id,$meta_key, true);
		$should_count = false;
		switch( (int)$who_count ) {
			case 0: $should_count = true;
				break;
			case 1:
				if( (int)$user_ID == 0 )
					$should_count = true;
				break;
			case 2:
				if( (int)$user_ID > 0 )
					$should_count = true;
				break;
		}
		if( (int)$exclude_bots==1 && $should_count ){
			$useragent = $_SERVER['HTTP_USER_AGENT'];
			$notbot = "Mozilla|Opera|Chrome|Safari|Firefox|Netscape";
			$bot = "Bot/|robot|Slurp/|yahoo"; //Яндекс иногда как Mozilla представляется
			if ( !preg_match("/$notbot/i", $useragent) || preg_match("!$bot!i", $useragent) )
				$should_count = false;
		}

		if($should_count){
			if( !update_post_meta($id, $meta_key, ($post_views+1)) ) add_post_meta($id, $meta_key, 1, true);
		}
	//}
	return true;
}
add_filter('the_content', 'insertCounter');

Youez - 2016 - github.com/yon3zu
LinuXploit