\

Classes

Wms7_Black_List_Table Description: Creates a blacklist table for frontend.
Wms7_Browser Description: Parses user-agent to get the names: browser, platform, operating system.
Wms7_Core Description: Plugin core. Registers site visits. Other service functions.
Wms7_Cron Description: Controles the cron events of the site.
Wms7_List_Table Description: Creates a site visit custom table.
Wms7_Widget Description: Creates widget - counter site visits.

Constants

FS_CHMOD_FILE

FS_CHMOD_FILE = 420 & ~umask()

Specifies the permissions for files. (by default = 0644)

How to set this constant: <?php define( "FS_CHMOD_FILE", ( 0644 & ~ umask() ) ); ?>

Defined only in the admin panel when connected: wp-admin/includes/file.php

where ( 0644 & ~ umask() ) is:

the '&' (ampersand) is the 'And' bitwise operator,

the '~' (tilde) is the 'Not' bitwise operator,

the umask() function returns the current umask

WMS7_PLUGIN_DIR

WMS7_PLUGIN_DIR = WP_PLUGIN_DIR . "/" . WMS7_PLUGIN_NAME

Contains the path to the main plugin file.

Serves for receiving plugin data by function get_plugin_data().

WMS7_PLUGIN_NAME

WMS7_PLUGIN_NAME = trim(dirname(plugin_basename(__FILE__)), "/")

Formed from the name of the plugin directory.

WMS7_PLUGIN_URL

WMS7_PLUGIN_URL = WP_PLUGIN_URL . "/" . WMS7_PLUGIN_NAME

Contains the url to the main plugin file.

Serves to work on the client side in module wms7-backend.js

Functions

wms7_activation()

wms7_activation() 

Performed when the plugin is activation.

During activation, creates two tables in the database:

{$wpdb->prefix}watchman_site

{$wpdb->prefix}watchman_site_countries

wms7_agent_del_from_file()

wms7_agent_del_from_file(string  $user_agent) 

Delete user_agent in file htaccess.

Parameters

string $user_agent

User agent of browser.

wms7_agent_ins_to_file()

wms7_agent_ins_to_file(string  $user_agent) 

Insert user_agent into file htaccess.

Parameters

string $user_agent

Robot name.

wms7_attack_analyzer()

wms7_attack_analyzer(string  $_log, string  $page_visit, string  $_http_user_agent, string  $user_ip) 

Analyzes the nature of the visit to the site in order to detect an attack.

Parameters

string $_log

Login of visitor.

string $page_visit

Visitor visit page.

string $_http_user_agent

User agent of visitor.

string $user_ip

User IP of visitor.

wms7_black_list_tbl()

wms7_black_list_tbl() 

Creates a table of blacklisted users.

wms7_block_visitor()

wms7_block_visitor(string  $ban_notes, boolean  $ban_user_agent) : array

Creates an array of visitor blocking data for subsequent transfer to the DB.

Parameters

string $ban_notes

Ban notes.

boolean $ban_user_agent

Ban user agent.

Returns

array —

In format json.

wms7_check_debug_log()

wms7_check_debug_log() 

Check file debug.log - empty or not. If not empty, the button debug_log lights up.

wms7_class_set_state_check()

wms7_class_set_state_check(object  $matches) : \object.

Classes to be restored need to implement __set_state() function.

If they don't have it, we will convert to stdClass object.

Parameters

object $matches

Matches.

Returns

\object.

wms7_clear_debug_log()

wms7_clear_debug_log() 

Clear file debug.log

wms7_complete()

wms7_complete() 

Parse the line-buffer backwards to see if we have a constant or function or variable.

wms7_complete_add()

wms7_complete_add(string  $string) : array

Parse the line-buffer backwards to see if we have a constant or function or variable.

Parameters

string $string

Name of constant or function or variable.

Returns

array —

Returns array of possible matches.

wms7_console()

wms7_console(string  $str_head) 

Commands Management Console PHP and WordPress.

Parameters

string $str_head

Head of pop-up window.

wms7_console_error()

wms7_console_error(string  $error) 

Error output in json format.

Parameters

string $error

Message of error.

wms7_console_error_handler()

wms7_console_error_handler(integer  $errno, string  $errorstr) 

Console error handler.

Parameters

integer $errno

Number of error.

string $errorstr

Message of error.

wms7_count_rows()

wms7_count_rows() : \number.

Obtain the number of all visits records.

Returns

\number.

wms7_country_name()

wms7_country_name(string  $country_code) : string

Retrieve information of country of visitor.

Parameters

string $country_code

Country code.

Returns

string —

User country name.

wms7_create_graph_stat()

wms7_create_graph_stat(string  $where) : array

Creates graph statistic of visits.

Parameters

string $where

Login result (0, 1, 2, 3).

Returns

array

wms7_create_table_stat()

wms7_create_table_stat(string  $where) : array

Create table statistic of visits.

Parameters

string $where

Login result (0, 1, 2, 3).

Returns

array

wms7_create_tables()

wms7_create_tables() : \boolean.

Create tables: watchman_site, watchman_site_countries.

Returns

\boolean.

wms7_deactivation()

wms7_deactivation() 

Performed when the plugin is deactivation.

Delete cron events: wms7_truncate, wms7_htaccess

wms7_debug_log()

wms7_debug_log(string  $str_head) 

Window error viewer PHP and WordPress on site.

Parameters

string $str_head

Head of pop-up window.

wms7_delete_csv()

wms7_delete_csv() 

Delete old export file of selected items black list table.

wms7_display_comment_recaptcha()

wms7_display_comment_recaptcha() 

Display comment recaptcha.

wms7_display_login_captcha()

wms7_display_login_captcha() 

Display login captcha.

wms7_display_register_captcha()

wms7_display_register_captcha() 

Display register captcha.

wms7_enqueue_scripts_backend()

wms7_enqueue_scripts_backend() 

Includes script and style files for the backend.

wms7_enqueue_scripts_frontend()

wms7_enqueue_scripts_frontend() 

Includes script and style files for the frontend.

wms7_file_editor()

wms7_file_editor(string  $str_head) 

File editor for: index.php robots.txt .htaccess wp-config.php

Parameters

string $str_head

Head of pop-up window.

wms7_flds_csv()

wms7_flds_csv() : string

Select fields main table of plugin for export.

Returns

string

wms7_frontend_recaptcha_script()

wms7_frontend_recaptcha_script() 

Frontend recaptcha script.

wms7_geobytes()

wms7_geobytes(string  $user_ip) : array

Retrieve ip information from the provider Geobytes.

Parameters

string $user_ip

User ip.

Returns

array —

In format json.

wms7_get_plain()

wms7_get_plain(string  $str, string  $boundary) : \string.

Parse of mail parts.

Parameters

string $str

Mail body.

string $boundary

Boundary.

Returns

\string.

wms7_imap_list()

wms7_imap_list(string  $mailbox_item) : string

Forms a table of all mailbox folders for Settins page plugin.

Parameters

string $mailbox_item

Mailbox item.

Returns

string

wms7_imap_list_decode()

wms7_imap_list_decode(string  $list) : \array.

Decode imap list.

Parameters

string $list

IMAP list.

Returns

\array.

wms7_ip_api()

wms7_ip_api(string  $user_ip) : array

Retrieve ip information from the provider IP_API.

Parameters

string $user_ip

User ip.

Returns

array —

In format json.

wms7_ip_del_from_file()

wms7_ip_del_from_file(string  $user_ip) 

Delete IP from file htaccess.

Parameters

string $user_ip

User ip.

wms7_ip_info()

wms7_ip_info(string  $user_ip) : array

Retrieve ip information from the provider IP_info.

Parameters

string $user_ip

User ip.

Returns

array —

In format json.

wms7_ip_ins_to_file()

wms7_ip_ins_to_file(string  $user_ip) 

Insert IP into file htaccess.

Parameters

string $user_ip

User ip.

wms7_languages()

wms7_languages() 

Localization of plugin.

wms7_lat_lon_save()

wms7_lat_lon_save() 

Selects data about the geolocation of the visitor for subsequent saving in the database.

wms7_load_widget()

wms7_load_widget() 

Register widget - counter site visits.

wms7_login_recaptcha_script()

wms7_login_recaptcha_script() 

Login recaptcha script.

wms7_mail()

wms7_mail(string  $str_head) 

Control site mailboxes at : this site, Gmail.com, Yahoo.com, Mail.ru, Yandex.ru

Parameters

string $str_head

Head of pop-up window.

wms7_mail_body()

wms7_mail_body(string  $msgno) : array

Receives the body of e-mail.

Parameters

string $msgno

Number of e-mail into mailbox.

Returns

array

wms7_mail_connection()

wms7_mail_connection() : object

Created for mail box connection to IMAP server.

Returns

object

wms7_mail_delete()

wms7_mail_delete() 

Move mail to trash or delete.

wms7_mail_folder_name()

wms7_mail_folder_name(string  $folder_num) : array

Receives Name of mail folder.

Parameters

string $folder_num

Number of folder mail box.

Returns

array

wms7_mail_header()

wms7_mail_header(string  $msgno) : array

Receives information about a mailing from its header.

Parameters

string $msgno

Number of e-mail into mailbox.

Returns

array

wms7_mail_inbox()

wms7_mail_inbox() : \array.

Receives overview of the message header information.

Returns

\array.

wms7_mail_inbox_connection()

wms7_mail_inbox_connection() : \object.

Mail inbox connection.

Returns

\object.

wms7_mail_move()

wms7_mail_move() 

Mail move to folder.

wms7_mail_new()

wms7_mail_new(string  $str_head, string  $draft) 

Creates pop-up window for mail new or draft.

Parameters

string $str_head

Head of modal window.

string $draft

Letter - answer or draft.

wms7_mail_parts()

wms7_mail_parts(string  $object, string  $parts) : \array.

Receives mail parts.

Parameters

string $object

object of mail.

string $parts

parts of mail.

Returns

\array.

wms7_mail_save_to_draft()

wms7_mail_save_to_draft() 

Mail save to folder Draft.

wms7_mail_search()

wms7_mail_search() : \array.

Mail search in box.

Returns

\array.

wms7_mail_send()

wms7_mail_send() 

Send mail.

wms7_mail_unseen()

wms7_mail_unseen() : \number.

Receives mail inbox unseen.

Returns

\number.

wms7_mail_view()

wms7_mail_view(string  $str_head) 

Create pop-up window for mail view.

Parameters

string $str_head

Head of pop-up window.

wms7_mailbox_selector()

wms7_mailbox_selector() : \array.

Receives the number of mail messages in each folder.

Returns

\array.

wms7_msg_smtp()

wms7_msg_smtp(string  $msg) : string

Checking the connection to the servers SMTP.

Parameters

string $msg

Sends a message to the admin about on the website.

Returns

string —

Ok or error.

wms7_output_csv()

wms7_output_csv() 

Export selected data of main table of plugin to external file.

wms7_parse_code()

wms7_parse_code(object  $code) : \integer.

See: http://jan.kneschke.de/projects/php-shell Return int 0 if a executable statement is in the session buffer, non-zero otherwise.

Parameters

object $code

Code for parse.

Throws

\Exception

Variable \'%s\' is not set.

\Exception

Variable \'%s\' is not a class.

\Exception

Variable %s (Class '%s') doesn't have a method named '%s'.

\Exception

Variable \'%s\' is not set.

\Exception

Variable \'%s\' is not a class.

\Exception

Variable %s (Class '%s') doesn't have a method named '%s'.

\Exception

Variable \'%s\' is not a array'.

\Exception

Class \'%s\' doesn\'t exist.

\Exception

Class '%s' doesn't have a method named '%s'.

Returns

\integer.

wms7_parse_user_agent()

wms7_parse_user_agent(string  $user_agent) : array

Parsing User Agent to extract data: name browser, name platform, name operating system.

Parameters

string $user_agent

User Agent of visitor.

Returns

array

wms7_query()

wms7_query() 

Main function to build console.

wms7_reload()

wms7_reload() 

Reload environment of console.

wms7_save_geolocation()

wms7_save_geolocation(string  $data) 

Saves previously selected geolocation data of the visitor to the database.

Parameters

string $data

Data of geolocation or error message.

wms7_save_htaccess()

wms7_save_htaccess(string  $file_content) 

Save file htaccess.

Parameters

string $file_content

File content.

wms7_save_index_php()

wms7_save_index_php(string  $file_content) 

Save file index.php.

Parameters

string $file_content

File content.

wms7_save_robots_txt()

wms7_save_robots_txt(string  $file_content) 

Save file robots.txt.

Parameters

string $file_content

File content.

wms7_save_variables()

wms7_save_variables(array  $existing, array  $current, array  $ignore) 

Saves newly defined variables to session.

Parameters

array $existing

existing.

array $current

current.

array $ignore

ignore.

wms7_save_wp_config()

wms7_save_wp_config(string  $file_content) 

Save file wp_config.php.

Parameters

string $file_content

File content.

wms7_send_backend()

wms7_send_backend(string  $data) 

Serves to send information to the client browser (backend of site).

Parameters

string $data

Number of visits records and mails inbox unseen.

wms7_send_frontend()

wms7_send_frontend(string  $data) 

Serves to send information to the client browser (frontend of site).

Parameters

string $data

Number of visits records.

wms7_sql_countries()

wms7_sql_countries() : string

Populate the data in table prefix_watchman_site_countries.

Returns

string

wms7_sse_backend()

wms7_sse_backend() 

Check to send information to the client browser (backend of site).

wms7_sse_frontend()

wms7_sse_frontend() 

Check to send information to the client browser (frontend of site).

wms7_stat()

wms7_stat(string  $str_head) 

Displays statistics of site visits in various presentation formats.

Parameters

string $str_head

Head of pop-up window.

wms7_sx_geo()

wms7_sx_geo(string  $user_ip) : array

Retrieve ip information from the provider SxGeo.

Parameters

string $user_ip

User ip.

Returns

array —

In format json.

wms7_verify_comment_captcha()

wms7_verify_comment_captcha(string  $commentdata) : array

Verify comment captcha.

Parameters

string $commentdata

Comment data.

Returns

array

wms7_verify_login_captcha()

wms7_verify_login_captcha(string  $user, string  $password) : array

Verify login captcha.

Parameters

string $user

User login.

string $password

User password.

Returns

array

wms7_verify_lostpassword_captcha()

wms7_verify_lostpassword_captcha() : array

Verify lostpassword captcha.

Returns

array

wms7_verify_registration_captcha()

wms7_verify_registration_captcha(string  $errors, string  $sanitized_user_login, string  $user_email) : array

Verify registration captcha.

Parameters

string $errors

Errors.

string $sanitized_user_login

User login.

string $user_email

User email.

Returns

array

wms7_who_is()

wms7_who_is(string  $user_ip, string  $provider_who_is) : \array.

Select name of WHO-IS provider.

Parameters

string $user_ip

User ip.

string $provider_who_is

Name of who is provider.

Returns

\array.

wms7_widget_counter()

wms7_widget_counter() : \string.

Creates the number of visits to different categories of visitors and different time.

Returns

\string.

wms7_win_popup()

wms7_win_popup() 

A pop-up window starts on the main page of the plugin with an indication of the purpose of the action:

File editor "index.php".
File editor "robots.txt".
File editor ".htaccess".
File editor "wp-config.php".
Control wp-cron tasks.
Displays statistics of site visits in various presentation formats.
Control site mailboxes at : this site, Gmail.com, Yahoo.com, Mail.ru, Yandex.ru
Commands Management Console PHP and WordPress.
Window error viewer PHP and WordPress on site.

wms7_wp_cron()

wms7_wp_cron(string  $str_head) 

Control wp-cron tasks.

Parameters

string $str_head

Head of pop-up window.

wms7_wp_debug_change()

wms7_wp_debug_change(boolean  $wp_debug) 

Change settings debug_log in wp_config.php.

Parameters

boolean $wp_debug

True or False.