--- a/secure-copy-content-protection/admin/partials/secure-copy-content-protection-admin-display.php
+++ b/secure-copy-content-protection/admin/partials/secure-copy-content-protection-admin-display.php
@@ -99,31 +99,32 @@
$tooltip_bg_image_position = (isset($data["styles"]["tooltip_bg_image_position"]) && $data["styles"]["tooltip_bg_image_position"] != '') ? $data["styles"]["tooltip_bg_image_position"] : "center center";
$sccp_message_vars = array(
- '%%user_first_name%%' => esc_html__("User's First Name", 'secure-copy-content-protection'),
- '%%user_last_name%%' => esc_html__("User's Last Name", 'secure-copy-content-protection'),
- '%%user_wordpress_email%%' => esc_html__("User's WordPress profile email", 'secure-copy-content-protection'),
- '%%user_display_name%%' => esc_html__("User's Display Name", 'secure-copy-content-protection'),
- '%%user_nickname%%' => esc_html__("User's Nickname", 'secure-copy-content-protection'),
- '%%user_wordpress_roles%%' => esc_html__("User's Wordpress Roles", 'secure-copy-content-protection'),
- '%%user_id%%' => esc_html__("User's ID", 'secure-copy-content-protection'),
- '%%user_registered%%' => esc_html__("User's Registered", 'secure-copy-content-protection'),
- '%%admin_email%%' => esc_html__("Admin Email", 'secure-copy-content-protection'),
- '%%post_author_nickname%%' => esc_html__("Post Author Nickname", 'secure-copy-content-protection'),
- '%%post_author_email%%' => esc_html__("Post Author Email", 'secure-copy-content-protection'),
- '%%post_author_display_name%%' => esc_html__("Post Author Display Name", 'secure-copy-content-protection'),
- '%%post_author_first_name%%' => esc_html__("Post Author First Name", 'secure-copy-content-protection'),
- '%%post_author_last_name%%' => esc_html__("Post Author Last Name", 'secure-copy-content-protection'),
- '%%post_author_website_url%%' => esc_html__("Post Author Website URL", 'secure-copy-content-protection'),
- '%%post_author_roles%%' => esc_html__("Post Author Roles", 'secure-copy-content-protection'),
- '%%post_id%%' => esc_html__("Post ID", 'secure-copy-content-protection'),
- '%%post_title%%' => esc_html__("Post Title", 'secure-copy-content-protection'),
- '%%current_user_ip%%' => esc_html__("User's IP address", 'secure-copy-content-protection'),
- '%%current_date%%' => esc_html__("Current Date", 'secure-copy-content-protection'),
- '%%current_time%%' => esc_html__("Current Time", 'secure-copy-content-protection'),
- '%%current_day%%' => esc_html__("Current Day", 'secure-copy-content-protection'),
- '%%current_month%%' => esc_html__("Current Month", 'secure-copy-content-protection'),
- '%%current_page_title%%' => esc_html__("Current Page Title", 'secure-copy-content-protection'),
- '%%site_title%%' => esc_html__("Site Title", 'secure-copy-content-protection'),
+ '%%user_first_name%%' => esc_html__("User's First Name", 'secure-copy-content-protection'),
+ '%%user_last_name%%' => esc_html__("User's Last Name", 'secure-copy-content-protection'),
+ '%%user_wordpress_email%%' => esc_html__("User's WordPress profile email", 'secure-copy-content-protection'),
+ '%%user_display_name%%' => esc_html__("User's Display Name", 'secure-copy-content-protection'),
+ '%%user_nickname%%' => esc_html__("User's Nickname", 'secure-copy-content-protection'),
+ '%%user_wordpress_roles%%' => esc_html__("User's Wordpress Roles", 'secure-copy-content-protection'),
+ '%%user_id%%' => esc_html__("User's ID", 'secure-copy-content-protection'),
+ '%%user_registered%%' => esc_html__("User's Registered", 'secure-copy-content-protection'),
+ '%%admin_email%%' => esc_html__("Admin Email", 'secure-copy-content-protection'),
+ '%%post_author_nickname%%' => esc_html__("Post Author Nickname", 'secure-copy-content-protection'),
+ '%%post_author_email%%' => esc_html__("Post Author Email", 'secure-copy-content-protection'),
+ '%%post_author_display_name%%' => esc_html__("Post Author Display Name", 'secure-copy-content-protection'),
+ '%%post_author_first_name%%' => esc_html__("Post Author First Name", 'secure-copy-content-protection'),
+ '%%post_author_last_name%%' => esc_html__("Post Author Last Name", 'secure-copy-content-protection'),
+ '%%post_author_website_url%%' => esc_html__("Post Author Website URL", 'secure-copy-content-protection'),
+ '%%post_author_roles%%' => esc_html__("Post Author Roles", 'secure-copy-content-protection'),
+ '%%post_id%%' => esc_html__("Post ID", 'secure-copy-content-protection'),
+ '%%post_title%%' => esc_html__("Post Title", 'secure-copy-content-protection'),
+ '%%current_user_ip%%' => esc_html__("User's IP address", 'secure-copy-content-protection'),
+ '%%current_date%%' => esc_html__("Current Date", 'secure-copy-content-protection'),
+ '%%current_time%%' => esc_html__("Current Time", 'secure-copy-content-protection'),
+ '%%current_day%%' => esc_html__("Current Day", 'secure-copy-content-protection'),
+ '%%current_month%%' => esc_html__("Current Month", 'secure-copy-content-protection'),
+ '%%current_page_title%%' => esc_html__("Current Page Title", 'secure-copy-content-protection'),
+ '%%site_title%%' => esc_html__("Site Title", 'secure-copy-content-protection'),
+ '%%site_description%%' => esc_html__("Site Description", 'secure-copy-content-protection'),
);
$sccp_message_vars_html = $this->ays_sccp_generate_message_vars_html( $sccp_message_vars );
--- a/secure-copy-content-protection/admin/partials/settings/secure-copy-content-protection-settings.php
+++ b/secure-copy-content-protection/admin/partials/settings/secure-copy-content-protection-settings.php
@@ -749,6 +749,15 @@
</p>
<p class="vmessage">
<strong>
+ <input type="text" onClick="this.setSelectionRange(0, this.value.length)" readonly value="%%site_description%%" />
+ </strong>
+ <span> - </span>
+ <span style="font-size:18px;">
+ <?php echo esc_attr( __( "The description of the website.", 'secure-copy-content-protection') ); ?>
+ </span>
+ </p>
+ <p class="vmessage">
+ <strong>
<input type="text" onClick="this.setSelectionRange(0, this.value.length)" readonly value="%%current_user_ip%%" />
</strong>
<span> - </span>
--- a/secure-copy-content-protection/includes/lists/class-secure-copy-content-protection-results-list-table.php
+++ b/secure-copy-content-protection/includes/lists/class-secure-copy-content-protection-results-list-table.php
@@ -334,31 +334,43 @@
$other_info = !empty($item['other_info']) ? json_decode($item['other_info']) : array();
switch ( $column_name ) {
case 'subscribe_id':
+ return intval( $item[$column_name] );
+ break;
case 'user_ip':
- case 'subscribe_email':
case 'user_name':
+ case 'user_address':
+ return esc_html( $item[$column_name] );
+ break;
+ case 'subscribe_email':
+ return esc_html( sanitize_email( $item[$column_name] ) );
+ break;
case 'vote_date':
+ return esc_html( $item[$column_name] );
+ break;
case 'unread':
- case 'user_address':
- return $item[$column_name];
+ return intval( $item[$column_name] );
break;
case 'user_id':
- $display_name = (isset(get_user_by('ID', $item[$column_name])->display_name) && get_user_by('ID', $item[$column_name])->display_name != null) ? sanitize_text_field( get_user_by('ID', $item[$column_name])->display_name ) : 'Deleted User';
+ if ( $item[$column_name] > 0 ) {
+ $user = get_user_by( 'ID', intval( $item[$column_name] ) );
+ $display_name = $user && $user->display_name
+ ? esc_html( $user->display_name )
+ : esc_html__( 'Deleted User', 'secure-copy-content-protection' );
- return $item[$column_name] > 0 ? $display_name : __("Guest", 'secure-copy-content-protection');
- break;
+ return $display_name;
+ }
+ return esc_html__( 'Guest', 'secure-copy-content-protection' );
+ break;
case 'user_roles':
- $user_meta = get_userdata($item['user_id']);
- $user_roles = isset($user_meta) && $user_meta ? $user_meta->roles : false;
- $role = "";
- if ( $user_roles && !is_null( $user_roles ) && is_array($user_roles) ) {
- $role = count($user_roles) > 1 ? implode(", ", $user_roles) : implode("", $user_roles);
- }
-
- return $role;
+ $user_meta = get_userdata( intval( $item['user_id'] ) );
+ $user_roles = $user_meta && is_array( $user_meta->roles ) ? $user_meta->roles : array();
+
+ $roles = ! empty( $user_roles ) ? implode( ', ', $user_roles ) : '';
+
+ return esc_html( $roles );
break;
default:
- return print_r($item, true); //Show the whole array for troubleshooting purposes
+ return esc_html( print_r( $item, true ) );
}
}
--- a/secure-copy-content-protection/public/class-secure-copy-content-protection-public.php
+++ b/secure-copy-content-protection/public/class-secure-copy-content-protection-public.php
@@ -551,6 +551,7 @@
$user_ip = '';
}else{
$user_ip = $this->sccp_get_user_ip();
+ $user_ip = filter_var( $user_ip, FILTER_VALIDATE_IP ) ? $user_ip : 'UNKNOWN';
}
$cookie_sub_val = '';
@@ -1355,6 +1356,7 @@
$user_ip = '';
}else{
$user_ip = $this->sccp_get_user_ip();
+ $user_ip = filter_var( $user_ip, FILTER_VALIDATE_IP ) ? $user_ip : 'UNKNOWN';
}
$current_user_ip = $user_ip;
@@ -1379,6 +1381,7 @@
$current_post_id = get_the_ID();
$post_title = get_the_title();
$get_site_title = get_bloginfo('name');
+ $get_site_description = get_bloginfo('description');
if ( ! empty( $post_author_roles ) && $post_author_roles != "" ) {
if ( is_array( $post_author_roles ) ) {
@@ -1387,31 +1390,32 @@
}
$message_data = array(
- 'user_first_name' => $user_first_name,
- 'user_last_name' => $user_last_name,
- 'user_wordpress_email' => $user_email,
- 'user_display_name' => $user_display_name,
- 'user_nickname' => $user_nickname,
- 'user_wordpress_roles' => $user_wordpress_roles,
- 'current_user_ip' => $current_user_ip,
- 'admin_email' => $super_admin_email,
- 'post_author_nickname' => $post_author_nickname,
- 'post_author_email' => $post_author_email,
- 'post_author_display_name' => $post_author_display_name,
- 'post_author_first_name' => $post_author_first_name,
- 'post_author_last_name' => $post_author_last_name,
- 'post_author_website_url' => $post_author_website_url,
- 'post_author_roles' => $post_author_roles,
- 'user_id' => $user_id,
- 'user_registered' => $user_registered,
- 'current_date' => $current_date,
- 'current_time' => $current_time,
- 'current_day' => $current_day,
- 'current_month' => $current_month,
- 'current_page_title' => $current_page_title,
- 'site_title' => $get_site_title,
- 'post_id' => $current_post_id,
- 'post_title' => $post_title,
+ 'user_first_name' => $user_first_name,
+ 'user_last_name' => $user_last_name,
+ 'user_wordpress_email' => $user_email,
+ 'user_display_name' => $user_display_name,
+ 'user_nickname' => $user_nickname,
+ 'user_wordpress_roles' => $user_wordpress_roles,
+ 'current_user_ip' => $current_user_ip,
+ 'admin_email' => $super_admin_email,
+ 'post_author_nickname' => $post_author_nickname,
+ 'post_author_email' => $post_author_email,
+ 'post_author_display_name' => $post_author_display_name,
+ 'post_author_first_name' => $post_author_first_name,
+ 'post_author_last_name' => $post_author_last_name,
+ 'post_author_website_url' => $post_author_website_url,
+ 'post_author_roles' => $post_author_roles,
+ 'user_id' => $user_id,
+ 'user_registered' => $user_registered,
+ 'current_date' => $current_date,
+ 'current_time' => $current_time,
+ 'current_day' => $current_day,
+ 'current_month' => $current_month,
+ 'current_page_title' => $current_page_title,
+ 'site_title' => $get_site_title,
+ 'site_description' => $get_site_description,
+ 'post_id' => $current_post_id,
+ 'post_title' => $post_title,
);
$notf_text = $this->sccp_replace_message_variables($notf_text, $message_data);
@@ -1555,24 +1559,20 @@
}
private function sccp_get_user_ip() {
- $ipaddress = '';
- if (getenv('HTTP_CLIENT_IP')) {
- $ipaddress = getenv('HTTP_CLIENT_IP');
- } else if (getenv('HTTP_X_FORWARDED_FOR')) {
- $ipaddress = getenv('HTTP_X_FORWARDED_FOR');
- } else if (getenv('HTTP_X_FORWARDED')) {
- $ipaddress = getenv('HTTP_X_FORWARDED');
- } else if (getenv('HTTP_FORWARDED_FOR')) {
- $ipaddress = getenv('HTTP_FORWARDED_FOR');
- } else if (getenv('HTTP_FORWARDED')) {
- $ipaddress = getenv('HTTP_FORWARDED');
- } else if (getenv('REMOTE_ADDR')) {
- $ipaddress = getenv('REMOTE_ADDR');
- } else {
- $ipaddress = 'UNKNOWN';
- }
+ $ip = '';
+
+ if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
+ $ip_list = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);
+ $ip = trim($ip_list[0]);
+ } elseif (!empty($_SERVER['REMOTE_ADDR'])) {
+ $ip = $_SERVER['REMOTE_ADDR'];
+ }
+
+ if (filter_var($ip, FILTER_VALIDATE_IP)) {
+ return $ip;
+ }
- return $ipaddress;
+ return 'UNKNOWN';
}
public function ays_add_mailchimp_transaction( $username, $api_key, $list_id, $args ) {
--- a/secure-copy-content-protection/secure-copy-content-protection.php
+++ b/secure-copy-content-protection/secure-copy-content-protection.php
@@ -16,7 +16,7 @@
* Plugin Name: Secure Copy Content Protection
* Plugin URI: https://ays-pro.com/wordpress/secure-copy-content-protection/
* Description: Copy Protection plugin is activated it disables the right click, copy paste, content selection and copy shortcut keys
- * Version: 4.9.8
+ * Version: 4.9.9
* Author: Copy Content Protection Team
* Author URI: https://ays-pro.com/
* License: GPL-2.0+
@@ -35,7 +35,7 @@
* Start at version 1.0.0 and use SemVer - https://semver.org
* Rename this for your plugin and update it as you release new versions.
*/
-define('SCCP_NAME_VERSION', '4.9.8');
+define('SCCP_NAME_VERSION', '4.9.9');
define('SCCP_NAME', 'secure-copy-content-protection');
if (!defined('SCCP_ADMIN_URL')) {
define('SCCP_ADMIN_URL', plugin_dir_url(__FILE__) . 'admin');