Changeset 3232957
- Timestamp:
- 02/01/2025 05:47:22 AM (14 months ago)
- Location:
- safe-ai-malware-protection-for-wp
- Files:
-
- 119 added
- 3 deleted
- 30 edited
-
tags/1.0.18 (added)
-
tags/1.0.18/.env.example (added)
-
tags/1.0.18/.gitignore (added)
-
tags/1.0.18/LICENSE.txt (added)
-
tags/1.0.18/README.txt (added)
-
tags/1.0.18/admin (added)
-
tags/1.0.18/admin/class-malware-virus-scanner-plugin-admin.php (added)
-
tags/1.0.18/admin/css (added)
-
tags/1.0.18/admin/css/jquery.toast.min.css (added)
-
tags/1.0.18/admin/css/malware-virus-scanner-plugin-admin.css (added)
-
tags/1.0.18/admin/index.php (added)
-
tags/1.0.18/admin/js (added)
-
tags/1.0.18/admin/js/jquery.toast.min.js (added)
-
tags/1.0.18/admin/js/malware-virus-scanner-plugin-admin.js (added)
-
tags/1.0.18/admin/partials (added)
-
tags/1.0.18/admin/partials/malware-virus-scanner-plugin-admin-display.php (added)
-
tags/1.0.18/changelog.txt (added)
-
tags/1.0.18/composer.json (added)
-
tags/1.0.18/composer.lock (added)
-
tags/1.0.18/helper (added)
-
tags/1.0.18/helper/class-get-plugins.php (added)
-
tags/1.0.18/includes (added)
-
tags/1.0.18/includes/class-deployment-script.php (added)
-
tags/1.0.18/includes/class-malware-virus-scanner-plugin-activator.php (added)
-
tags/1.0.18/includes/class-malware-virus-scanner-plugin-deactivator.php (added)
-
tags/1.0.18/includes/class-malware-virus-scanner-plugin-i18n.php (added)
-
tags/1.0.18/includes/class-malware-virus-scanner-plugin-loader.php (added)
-
tags/1.0.18/includes/class-malware-virus-scanner-plugin.php (added)
-
tags/1.0.18/includes/class-mvsp-ajax.php (added)
-
tags/1.0.18/includes/class-mvsp-check-php.php (added)
-
tags/1.0.18/includes/class-mvsp-encryption.php (added)
-
tags/1.0.18/includes/class-mvsp-export-db.php (added)
-
tags/1.0.18/includes/class-mvsp-generate-token.php (added)
-
tags/1.0.18/includes/class-mvsp-pclzip.php (added)
-
tags/1.0.18/includes/class-mvsp-register-menu.php (added)
-
tags/1.0.18/includes/class-mvsp-rest-api.php (added)
-
tags/1.0.18/includes/class-mvsp-templates.php (added)
-
tags/1.0.18/includes/class-mvsp-theme-lists.php (added)
-
tags/1.0.18/includes/class-mvsp-wp-info.php (added)
-
tags/1.0.18/includes/class-plugins-info.php (added)
-
tags/1.0.18/includes/class-scan-db.php (added)
-
tags/1.0.18/includes/class-store-authorized-token.php (added)
-
tags/1.0.18/includes/class-uploads-scanner.php (added)
-
tags/1.0.18/includes/class-utls.php (added)
-
tags/1.0.18/includes/index.php (added)
-
tags/1.0.18/index.php (added)
-
tags/1.0.18/languages (added)
-
tags/1.0.18/languages/malware-virus-scanner-plugin.pot (added)
-
tags/1.0.18/malware-virus-scanner-plugin.php (added)
-
tags/1.0.18/public (added)
-
tags/1.0.18/public/class-malware-virus-scanner-plugin-public.php (added)
-
tags/1.0.18/public/css (added)
-
tags/1.0.18/public/css/malware-virus-scanner-plugin-public.css (added)
-
tags/1.0.18/public/index.php (added)
-
tags/1.0.18/public/js (added)
-
tags/1.0.18/public/js/malware-virus-scanner-plugin-public.js (added)
-
tags/1.0.18/public/partials (added)
-
tags/1.0.18/public/partials/malware-virus-scanner-plugin-public-display.php (added)
-
tags/1.0.18/uninstall.php (added)
-
tags/1.0.18/vendor (added)
-
tags/1.0.18/vendor/autoload.php (added)
-
tags/1.0.18/vendor/composer (added)
-
tags/1.0.18/vendor/composer/ClassLoader.php (added)
-
tags/1.0.18/vendor/composer/InstalledVersions.php (added)
-
tags/1.0.18/vendor/composer/LICENSE (added)
-
tags/1.0.18/vendor/composer/autoload_classmap.php (added)
-
tags/1.0.18/vendor/composer/autoload_namespaces.php (added)
-
tags/1.0.18/vendor/composer/autoload_psr4.php (added)
-
tags/1.0.18/vendor/composer/autoload_real.php (added)
-
tags/1.0.18/vendor/composer/autoload_static.php (added)
-
tags/1.0.18/vendor/composer/installed.json (added)
-
tags/1.0.18/vendor/composer/installed.php (added)
-
tags/1.0.18/vendor/composer/platform_check.php (added)
-
tags/1.0.18/vendor/firebase (added)
-
tags/1.0.18/vendor/firebase/php-jwt (added)
-
tags/1.0.18/vendor/firebase/php-jwt/CHANGELOG.md (added)
-
tags/1.0.18/vendor/firebase/php-jwt/LICENSE (added)
-
tags/1.0.18/vendor/firebase/php-jwt/README.md (added)
-
tags/1.0.18/vendor/firebase/php-jwt/composer.json (added)
-
tags/1.0.18/vendor/firebase/php-jwt/src (added)
-
tags/1.0.18/vendor/firebase/php-jwt/src/BeforeValidException.php (added)
-
tags/1.0.18/vendor/firebase/php-jwt/src/CachedKeySet.php (added)
-
tags/1.0.18/vendor/firebase/php-jwt/src/ExpiredException.php (added)
-
tags/1.0.18/vendor/firebase/php-jwt/src/JWK.php (added)
-
tags/1.0.18/vendor/firebase/php-jwt/src/JWT.php (added)
-
tags/1.0.18/vendor/firebase/php-jwt/src/JWTExceptionWithPayloadInterface.php (added)
-
tags/1.0.18/vendor/firebase/php-jwt/src/Key.php (added)
-
tags/1.0.18/vendor/firebase/php-jwt/src/SignatureInvalidException.php (added)
-
trunk/README.txt (modified) (3 diffs)
-
trunk/admin/class-malware-virus-scanner-plugin-admin.php (modified) (2 diffs)
-
trunk/admin/partials/malware-virus-scanner-plugin-admin-display.php (modified) (1 diff)
-
trunk/changelog.txt (modified) (1 diff)
-
trunk/composer.json (added)
-
trunk/composer.lock (added)
-
trunk/helper/class-get-plugins.php (modified) (1 diff)
-
trunk/helper/class-mvsp-env.php (deleted)
-
trunk/includes/class-deployment-script.php (modified) (1 diff)
-
trunk/includes/class-malware-virus-scanner-plugin-activator.php (modified) (2 diffs)
-
trunk/includes/class-malware-virus-scanner-plugin-deactivator.php (modified) (2 diffs)
-
trunk/includes/class-malware-virus-scanner-plugin-i18n.php (modified) (2 diffs)
-
trunk/includes/class-malware-virus-scanner-plugin-loader.php (modified) (2 diffs)
-
trunk/includes/class-malware-virus-scanner-plugin.php (modified) (5 diffs)
-
trunk/includes/class-mvsp-ajax.php (modified) (4 diffs)
-
trunk/includes/class-mvsp-check-php.php (modified) (1 diff)
-
trunk/includes/class-mvsp-encryption.php (modified) (1 diff)
-
trunk/includes/class-mvsp-export-db.php (modified) (1 diff)
-
trunk/includes/class-mvsp-generate-token.php (modified) (1 diff)
-
trunk/includes/class-mvsp-register-menu.php (modified) (2 diffs)
-
trunk/includes/class-mvsp-rest-api.php (modified) (31 diffs)
-
trunk/includes/class-mvsp-schedular.php (deleted)
-
trunk/includes/class-mvsp-templates.php (modified) (3 diffs)
-
trunk/includes/class-mvsp-theme-lists.php (modified) (1 diff)
-
trunk/includes/class-mvsp-wp-info.php (modified) (2 diffs)
-
trunk/includes/class-plugins-info.php (modified) (1 diff)
-
trunk/includes/class-scan-db.php (modified) (1 diff)
-
trunk/includes/class-store-authorized-token.php (modified) (1 diff)
-
trunk/includes/class-uploads-scanner.php (modified) (1 diff)
-
trunk/includes/class-utls.php (modified) (1 diff)
-
trunk/libs (deleted)
-
trunk/malware-virus-scanner-plugin.php (modified) (6 diffs)
-
trunk/public/class-malware-virus-scanner-plugin-public.php (modified) (2 diffs)
-
trunk/public/partials/malware-virus-scanner-plugin-public-display.php (modified) (1 diff)
-
trunk/uninstall.php (modified) (1 diff)
-
trunk/vendor (added)
-
trunk/vendor/autoload.php (added)
-
trunk/vendor/composer (added)
-
trunk/vendor/composer/ClassLoader.php (added)
-
trunk/vendor/composer/InstalledVersions.php (added)
-
trunk/vendor/composer/LICENSE (added)
-
trunk/vendor/composer/autoload_classmap.php (added)
-
trunk/vendor/composer/autoload_namespaces.php (added)
-
trunk/vendor/composer/autoload_psr4.php (added)
-
trunk/vendor/composer/autoload_real.php (added)
-
trunk/vendor/composer/autoload_static.php (added)
-
trunk/vendor/composer/installed.json (added)
-
trunk/vendor/composer/installed.php (added)
-
trunk/vendor/composer/platform_check.php (added)
-
trunk/vendor/firebase (added)
-
trunk/vendor/firebase/php-jwt (added)
-
trunk/vendor/firebase/php-jwt/CHANGELOG.md (added)
-
trunk/vendor/firebase/php-jwt/LICENSE (added)
-
trunk/vendor/firebase/php-jwt/README.md (added)
-
trunk/vendor/firebase/php-jwt/composer.json (added)
-
trunk/vendor/firebase/php-jwt/src (added)
-
trunk/vendor/firebase/php-jwt/src/BeforeValidException.php (added)
-
trunk/vendor/firebase/php-jwt/src/CachedKeySet.php (added)
-
trunk/vendor/firebase/php-jwt/src/ExpiredException.php (added)
-
trunk/vendor/firebase/php-jwt/src/JWK.php (added)
-
trunk/vendor/firebase/php-jwt/src/JWT.php (added)
-
trunk/vendor/firebase/php-jwt/src/JWTExceptionWithPayloadInterface.php (added)
-
trunk/vendor/firebase/php-jwt/src/Key.php (added)
-
trunk/vendor/firebase/php-jwt/src/SignatureInvalidException.php (added)
Legend:
- Unmodified
- Added
- Removed
-
safe-ai-malware-protection-for-wp/trunk/README.txt
r3195416 r3232957 1 1 === Safe Ai Malware Protection for WP === 2 Contributors: boomdevs, wpmessiah,enamulwp2 Contributors: boomdevs, enamulwp 3 3 Tags: security,malware,wordpress security,malware Cleaner 4 4 Requires at least: 5.0 5 5 Tested up to: 6.7 6 Stable tag: 1.0.1 76 Stable tag: 1.0.18 7 7 Requires PHP: 7.4 8 8 License: GPLv2 or later … … 68 68 == Support == 69 69 70 If you have any questions, please email us at **[contact@ wpmessiah.com](mailto:contact@wpmessiah.com)**70 If you have any questions, please email us at **[contact@boomdevs.com](mailto:contact@boomdevs.com)** 71 71 72 72 == Screenshots == … … 139 139 = 1.0.17 = 140 140 fix: some minor issues 141 142 = 1.0.18 = 143 Fix: Security issues. -
safe-ai-malware-protection-for-wp/trunk/admin/class-malware-virus-scanner-plugin-admin.php
r3185543 r3232957 4 4 * The admin-specific functionality of the plugin. 5 5 * 6 * @link https:// wpmessiah.com6 * @link https://boomdevs.com 7 7 * @since 1.0.0 8 8 * … … 19 19 * @package Malware_Virus_Scanner_Plugin 20 20 * @subpackage Malware_Virus_Scanner_Plugin/admin 21 * @author BoomDevs <contact@ wpmessiah.com>21 * @author BoomDevs <contact@boomdevs.com> 22 22 */ 23 23 class Malware_Virus_Scanner_Plugin_Admin { -
safe-ai-malware-protection-for-wp/trunk/admin/partials/malware-virus-scanner-plugin-admin-display.php
r3185543 r3232957 6 6 * This file is used to markup the admin-facing aspects of the plugin. 7 7 * 8 * @link https:// wpmessiah.com8 * @link https://boomdevs.com 9 9 * @since 1.0.0 10 10 * -
safe-ai-malware-protection-for-wp/trunk/changelog.txt
r3156881 r3232957 51 51 = 1.0.17 = 52 52 fix: some minor issues 53 54 = 1.0.18 = 55 Fix: Security issues. -
safe-ai-malware-protection-for-wp/trunk/helper/class-get-plugins.php
r3126680 r3232957 1 1 <?php 2 2 if (!defined('ABSPATH')) { 3 die("What you are doing here man."); 4 } 5 3 6 class MVSP_Plugins_Info { 4 7 -
safe-ai-malware-protection-for-wp/trunk/includes/class-deployment-script.php
r3156881 r3232957 1 1 <?php 2 2 if (!defined('ABSPATH')) { 3 die("What you are doing here man."); 4 } 3 5 class MVSP_Deployment_Script { 4 6 public function __construct($dynamicToken, $zip_file_link, $dir_name) { -
safe-ai-malware-protection-for-wp/trunk/includes/class-malware-virus-scanner-plugin-activator.php
r3185543 r3232957 4 4 * Fired during plugin activation 5 5 * 6 * @link https:// wpmessiah.com6 * @link https://boomdevs.com 7 7 * @since 1.0.0 8 8 * … … 19 19 * @package Malware_Virus_Scanner_Plugin 20 20 * @subpackage Malware_Virus_Scanner_Plugin/includes 21 * @author BoomDevs <contact@ wpmessiah.com>21 * @author BoomDevs <contact@boomdevs.com> 22 22 */ 23 23 class Malware_Virus_Scanner_Plugin_Activator { -
safe-ai-malware-protection-for-wp/trunk/includes/class-malware-virus-scanner-plugin-deactivator.php
r3185543 r3232957 4 4 * Fired during plugin deactivation 5 5 * 6 * @link https:// wpmessiah.com6 * @link https://boomdevs.com 7 7 * @since 1.0.0 8 8 * … … 19 19 * @package Malware_Virus_Scanner_Plugin 20 20 * @subpackage Malware_Virus_Scanner_Plugin/includes 21 * @author BoomDevs <contact@ wpmessiah.com>21 * @author BoomDevs <contact@boomdevs.com> 22 22 */ 23 23 class Malware_Virus_Scanner_Plugin_Deactivator { -
safe-ai-malware-protection-for-wp/trunk/includes/class-malware-virus-scanner-plugin-i18n.php
r3185543 r3232957 7 7 * so that it is ready for translation. 8 8 * 9 * @link https:// wpmessiah.com9 * @link https://boomdevs.com 10 10 * @since 1.0.0 11 11 * … … 23 23 * @package Malware_Virus_Scanner_Plugin 24 24 * @subpackage Malware_Virus_Scanner_Plugin/includes 25 * @author BoomDevs <contact@ wpmessiah.com>25 * @author BoomDevs <contact@boomdevs.com> 26 26 */ 27 27 class Malware_Virus_Scanner_Plugin_i18n { -
safe-ai-malware-protection-for-wp/trunk/includes/class-malware-virus-scanner-plugin-loader.php
r3185543 r3232957 4 4 * Register all actions and filters for the plugin 5 5 * 6 * @link https:// wpmessiah.com6 * @link https://boomdevs.com 7 7 * @since 1.0.0 8 8 * … … 20 20 * @package Malware_Virus_Scanner_Plugin 21 21 * @subpackage Malware_Virus_Scanner_Plugin/includes 22 * @author BoomDevs <contact@ wpmessiah.com>22 * @author BoomDevs <contact@boomdevs.com> 23 23 */ 24 24 class Malware_Virus_Scanner_Plugin_Loader { -
safe-ai-malware-protection-for-wp/trunk/includes/class-malware-virus-scanner-plugin.php
r3185543 r3232957 7 7 * public-facing side of the site and the admin area. 8 8 * 9 * @link https:// wpmessiah.com9 * @link https://boomdevs.com 10 10 * @since 1.0.0 11 11 * … … 26 26 * @package Malware_Virus_Scanner_Plugin 27 27 * @subpackage Malware_Virus_Scanner_Plugin/includes 28 * @author BoomDevs <contact@ wpmessiah.com>28 * @author BoomDevs <contact@boomdevs.com> 29 29 */ 30 30 class Malware_Virus_Scanner_Plugin { … … 71 71 $this->version = MVSP_PLUGIN_VERSION; 72 72 } else { 73 $this->version = '1.0.1 7';73 $this->version = '1.0.18'; 74 74 } 75 $this->plugin_name = ' malware-virus-scanner-plugin';75 $this->plugin_name = 'wpsafe-ai-malware-protection'; 76 76 77 77 $this->load_dependencies(); … … 128 128 require_once plugin_dir_path( dirname(__FILE__) ) . 'includes/class-mvsp-register-menu.php'; 129 129 require_once plugin_dir_path( dirname(__FILE__) ) . 'includes/class-mvsp-ajax.php'; 130 require_once plugin_dir_path( dirname(__FILE__) ) . 'includes/class-mvsp-schedular.php';131 130 132 131 $this->loader = new Malware_Virus_Scanner_Plugin_Loader(); … … 169 168 ?> 170 169 <div class="error"> 171 <p><?php echo esc_html__('Error: Authorization error please try again letter', ' malware-virus-scanner-plugin');?></p>170 <p><?php echo esc_html__('Error: Authorization error please try again letter', 'wpsafe-ai-malware-protection');?></p> 172 171 </div> 173 172 <?php -
safe-ai-malware-protection-for-wp/trunk/includes/class-mvsp-ajax.php
r3097987 r3232957 1 1 <?php 2 if (!defined('ABSPATH')) { 3 die("What you are doing here man."); 4 } 5 2 6 require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-store-authorized-token.php'; 3 7 class MVSP_Ajax { … … 15 19 $return = array( 16 20 'status' => false, 17 'message' => esc_html__('Unauthorized user', ' malware-virus-scanner-plugin'),21 'message' => esc_html__('Unauthorized user', 'wpsafe-ai-malware-protection'), 18 22 ); 19 23 … … 37 41 $return = array( 38 42 'status' => false, 39 'message' => esc_html__('Unauthorized user', ' malware-virus-scanner-plugin'),43 'message' => esc_html__('Unauthorized user', 'wpsafe-ai-malware-protection'), 40 44 ); 41 45 … … 56 60 $return = array( 57 61 'status' => false, 58 'message' => esc_html__('Something went wrong', ' malware-virus-scanner-plugin'),62 'message' => esc_html__('Something went wrong', 'wpsafe-ai-malware-protection'), 59 63 ); 60 64 -
safe-ai-malware-protection-for-wp/trunk/includes/class-mvsp-check-php.php
r3076790 r3232957 1 1 <?php 2 2 if (!defined('ABSPATH')) { 3 die("What you are doing here man."); 4 } 3 5 // Check php version for wordpress 4 6 -
safe-ai-malware-protection-for-wp/trunk/includes/class-mvsp-encryption.php
r3076790 r3232957 34 34 return $data; 35 35 } 36 public static function encrypt_file($inputFile, $outputFile, $token) { 37 $data = MVSP_Encryption::download_file($inputFile); 38 $iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length('aes-256-cbc')); 39 $encryptedData = openssl_encrypt($data, 'aes-256-cbc', $token, 0, $iv); 40 file_put_contents($outputFile, $iv . $encryptedData); 41 } 42 36 43 37 public static function decrypt_file($inputFile, $outputFile, $token) { 44 38 $data = file_get_contents($inputFile); -
safe-ai-malware-protection-for-wp/trunk/includes/class-mvsp-export-db.php
r3156881 r3232957 1 1 <?php 2 if (!defined('ABSPATH')) { 3 die("What you are doing here man."); 4 } 5 2 6 require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-mvsp-encryption.php'; 3 // require_once plugin_dir_path( __DIR__ ) . 'libs/updraftplus/updraftplus.php';4 5 7 class MVSP_Export_DB 6 8 { 7 public static function export_db()8 {9 require_once plugin_dir_path(dirname(__FILE__)) . 'libs/updraftplus/updraftplus.php';10 require_once plugin_dir_path(dirname(__FILE__)) . 'libs/updraftplus/backup.php';11 // require_once ABSPATH . 'wp-load.php';12 // global $wpdb;13 // $db_user = DB_USER;14 // $db_pass = DB_PASSWORD;15 // $db_name = DB_NAME;16 // $db_host = DB_HOST;17 18 $exported_db_filename = get_option('mvsp_auth_token');19 $exported_db_filename = substr($exported_db_filename, 0, 40);20 // // Create a connection to the database21 // $mysqli = new mysqli($db_host, $db_user, $db_pass, $db_name);22 23 // // Check the connection24 // if ($mysqli->connect_error) {25 // die('Connection failed: ' . $mysqli->connect_error);26 // }27 28 // // Output file name and path29 // $output_file = $exported_db_filename.'.txt';30 31 // // Open the output file for writing32 // $file = fopen($output_file, 'w');33 34 // // Write the SQL dump header35 // fwrite($file, "-- phpMyAdmin SQL Dump\n");36 // fwrite($file, "-- version 5.2.0\n");37 // fwrite($file, "-- https://www.phpmyadmin.net/\n");38 // fwrite($file, "--\n");39 // fwrite($file, "-- Host: $db_host\n");40 // fwrite($file, "-- Generation Time: " . date("M d, Y \a\\t H:i A") . "\n");41 // fwrite($file, "-- Server version: " . $mysqli->server_info . "\n");42 // fwrite($file, "-- PHP Version: " . phpversion() . "\n\n");43 44 // // Set SQL mode and start transaction45 // fwrite($file, "SET SQL_MODE = \"NO_AUTO_VALUE_ON_ZERO\";\n");46 // fwrite($file, "START TRANSACTION;\n");47 // fwrite($file, "SET time_zone = \"+00:00\";\n\n");48 49 // // Set character set settings50 // fwrite($file, "/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;\n");51 // fwrite($file, "/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;\n");52 // fwrite($file, "/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;\n");53 // fwrite($file, "/*!40101 SET NAMES utf8mb4 */;\n\n");54 55 // // Write database information56 // fwrite($file, "--\n-- Database: `$db_name`\n--\n\n");57 58 // // Iterate through each table and export structure and data59 // $result = $mysqli->query("SHOW TABLES");60 // while ($row = $result->fetch_row()) {61 // $table = $row[0];62 63 // // Export table structure64 // $result_structure = $mysqli->query("SHOW CREATE TABLE $table");65 // $table_structure = $result_structure->fetch_row()[1];66 // fwrite($file, "$table_structure;\n\n");67 68 // // Export table data69 // $result_data = $mysqli->query("SELECT * FROM $table");70 // while ($data_row = $result_data->fetch_assoc()) {71 // $values = array_map([$mysqli, 'real_escape_string'], array_values($data_row));72 // fwrite($file, "INSERT INTO $table VALUES ('" . implode("', '", $values) . "');\n");73 // }74 75 // fwrite($file, "\n");76 // }77 78 // // Close the output file and database connection79 // fclose($file);80 // $mysqli->close();81 82 // $sql_dump_file_path = ABSPATH . $output_file;83 // $sql_dump_content = file_get_contents($sql_dump_file_path);84 85 // // Check if the string exists in the file content86 // if (strpos($sql_dump_content, 'COLLATE=utf8mb4_unicode_520_ci') !== false) {87 // // Perform the replacement88 // $sql_dump_content = str_replace('COLLATE=utf8mb4_unicode_520_ci', 'COLLATE=utf8mb4_unicode_ci', $sql_dump_content);89 // // Write the modified content back to the SQL dump file90 // file_put_contents($sql_dump_file_path, $sql_dump_content);91 // }92 93 // return $output_file;94 95 96 $updraft_backup_obj = new UpdraftPlus_Backup('no', ABSPATH, $exported_db_filename, -1);97 return $updraft_backup_obj->backup_db();98 }99 100 9 public static function get_db_config() 101 10 { -
safe-ai-malware-protection-for-wp/trunk/includes/class-mvsp-generate-token.php
r3076790 r3232957 1 1 <?php 2 if (!defined('ABSPATH')) { 3 die("What you are doing here man."); 4 } 5 2 6 class MVSP_Generate_Token { 3 7 public static function generate_token($string) { -
safe-ai-malware-protection-for-wp/trunk/includes/class-mvsp-register-menu.php
r3097987 r3232957 1 1 <?php 2 if (!defined('ABSPATH')) { 3 die("What you are doing here man."); 4 } 5 2 6 require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-store-authorized-token.php'; 3 7 require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-mvsp-templates.php'; … … 15 19 $menu_slug = 'malware-virus-scanner'; 16 20 $add_site_menu_slug = 'safe-ai-malware-connect'; 17 add_menu_page( esc_html__('WPSafe.AI', ' malware-virus-scanner-plugin'), esc_html__('WPSafe.AI', 'malware-virus-scanner-plugin'), 'read', $add_site_menu_slug, false );18 add_submenu_page( $add_site_menu_slug, esc_html__('Connect site', ' malware-virus-scanner-plugin'), esc_html__('Connect site', 'malware-virus-scanner-plugin'), 'manage_options', $add_site_menu_slug, [$this, 'site_add'] );19 // add_submenu_page( $add_site_menu_slug, esc_html__('Report', ' malware-virus-scanner-plugin'), esc_html__('Report', 'malware-virus-scanner-plugin'), 'manage_options', 'malware-virus-scanner-site-report', [$this, 'site_report'] );21 add_menu_page( esc_html__('WPSafe.AI', 'wpsafe-ai-malware-protection'), esc_html__('WPSafe.AI', 'wpsafe-ai-malware-protection'), 'read', $add_site_menu_slug, false ); 22 add_submenu_page( $add_site_menu_slug, esc_html__('Connect site', 'wpsafe-ai-malware-protection'), esc_html__('Connect site', 'wpsafe-ai-malware-protection'), 'manage_options', $add_site_menu_slug, [$this, 'site_add'] ); 23 // add_submenu_page( $add_site_menu_slug, esc_html__('Report', 'wpsafe-ai-malware-protection'), esc_html__('Report', 'wpsafe-ai-malware-protection'), 'manage_options', 'malware-virus-scanner-site-report', [$this, 'site_report'] ); 20 24 } 21 25 -
safe-ai-malware-protection-for-wp/trunk/includes/class-mvsp-rest-api.php
r3156881 r3232957 1 1 <?php 2 if (!defined('ABSPATH')) { 3 die("What you are doing here man."); 4 } 5 2 6 require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-mvsp-wp-info.php'; 3 7 require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-mvsp-check-php.php'; … … 11 15 require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-plugins-info.php'; 12 16 require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-mvsp-theme-lists.php'; 17 require_once plugin_dir_path(dirname(__FILE__)) . 'helper/class-get-plugins.php'; 18 19 require_once plugin_dir_path(dirname(__FILE__)) . 'vendor/autoload.php'; 20 use Firebase\JWT\JWT; 21 use Firebase\JWT\Key; 13 22 14 23 /** … … 26 35 )); 27 36 28 register_rest_route('mvsp/v1', '/export-db', array(29 'methods' => 'POST',30 'callback' => array($this, 'export_db'),31 // 'permission_callback' => array($this, 'check_user_authenticated'),32 'permission_callback' => '__return_true',33 ));34 35 37 register_rest_route('mvsp/v1', '/delete-exported-db', array( 36 38 'methods' => 'POST', … … 249 251 // 'permission_callback' => '__return_true', 250 252 )); 253 254 register_rest_route('mvsp/v1', '/technical-assessment', array( 255 'methods' => 'POST', 256 'callback' => array($this, 'technical_assessment'), 257 'permission_callback' => array($this, 'check_user_authenticated'), 258 // 'permission_callback' => '__return_true', 259 )); 260 261 register_rest_route('mvsp/v1', '/free-plugins', array( 262 'methods' => 'POST', 263 'callback' => array($this, 'free_plugins'), 264 'permission_callback' => array($this, 'check_user_authenticated'), 265 // 'permission_callback' => '__return_true', 266 )); 267 268 register_rest_route('mvsp/v1', '/premium-plugins', array( 269 'methods' => 'POST', 270 'callback' => array($this, 'premium_plugins'), 271 'permission_callback' => array($this, 'check_user_authenticated'), 272 // 'permission_callback' => '__return_true', 273 )); 274 275 register_rest_route('mvsp/v1', '/free-themes', array( 276 'methods' => 'POST', 277 'callback' => array($this, 'free_themes'), 278 'permission_callback' => array($this, 'check_user_authenticated'), 279 // 'permission_callback' => '__return_true', 280 )); 281 282 register_rest_route('mvsp/v1', '/premium-themes', array( 283 'methods' => 'POST', 284 'callback' => array($this, 'premium_themes'), 285 'permission_callback' => array($this, 'check_user_authenticated'), 286 // 'permission_callback' => '__return_true', 287 )); 251 288 }); 289 } 290 291 // Free themes callback 292 public function free_themes() { 293 if ( ! function_exists( 'themes_api' ) ) { 294 require_once( ABSPATH . 'wp-admin/includes/theme.php' ); 295 } 296 297 $response = [MVSP_Themes_List::themes_list()]; 298 $active_theme = wp_get_theme()->get('Name'); 299 $free_themes_response = []; 300 301 if(count($response[0]['free_themes'])> 0) { 302 foreach($response[0]['free_themes'] as $single_theme){ 303 $request = themes_api('theme_information', array( 304 'slug' => $single_theme['slug'], 305 'fields' => array( 306 'version' => true, 307 ), 308 )); 309 310 $latest_version = null; 311 312 if (!is_wp_error($request)) { 313 $latest_version = $request->version; 314 } 315 316 $free_themes_response[] = array( 317 'name' => $single_theme['Name'], 318 'version' => $single_theme['Version'], 319 'new_version' => $latest_version, 320 'activated' => $active_theme === $single_theme['Name'] 321 ); 322 } 323 } 324 325 return new WP_REST_Response( 326 array( 327 'status' => true, 328 'data' => $free_themes_response 329 ), 200); 330 } 331 332 // Premium themes callback 333 // Free themes callback 334 public function premium_themes() { 335 if ( ! function_exists( 'themes_api' ) ) { 336 require_once( ABSPATH . 'wp-admin/includes/theme.php' ); 337 } 338 339 $response = [MVSP_Themes_List::themes_list()]; 340 $active_theme = wp_get_theme()->get('Name'); 341 $premium_themes_response = []; 342 343 if(count($response[0]['premium_themes'])> 0) { 344 foreach($response[0]['premium_themes'] as $single_theme){ 345 $premium_themes_response[] = array( 346 'name' => $single_theme['Name'], 347 'version' => $single_theme['Version'], 348 'new_version' => null, 349 'activated' => $active_theme === $single_theme['Name'] 350 ); 351 } 352 } 353 354 return new WP_REST_Response( 355 array( 356 'status' => true, 357 'data' => $premium_themes_response 358 ), 200); 359 } 360 361 // Free plugins callback 362 public function free_plugins() { 363 global $wpdb, $wp_rewrite; 364 if ( ! function_exists( 'get_plugins' ) ) { 365 require_once( ABSPATH . 'wp-admin/includes/plugin.php' ); 366 } 367 368 369 $all_plugins = get_plugins(); 370 $plugins_info = MVSP_Plugins_Info::plugins_info($all_plugins); 371 372 373 $response = []; 374 375 if (count($plugins_info) > 0) { 376 foreach ($plugins_info as $single_plugin) { 377 if ($single_plugin->download_link !== null) { 378 $response[] = [ 379 'name' => $single_plugin->Name, 380 'varsion' => $single_plugin->Version, 381 'new_version' => $single_plugin->new_version, 382 'activated' => is_plugin_active($single_plugin->plugin) 383 ]; 384 } 385 } 386 } 387 388 return new WP_REST_Response( 389 array( 390 'status' => true, 391 'data' => $response 392 ), 200 393 ); 394 } 395 396 // Premium plugins handler 397 public function premium_plugins() { 398 global $wpdb, $wp_rewrite; 399 if ( ! function_exists( 'get_plugins' ) ) { 400 require_once( ABSPATH . 'wp-admin/includes/plugin.php' ); 401 } 402 403 404 $all_plugins = get_plugins(); 405 $plugins_info = MVSP_Plugins_Info::plugins_info($all_plugins); 406 407 $response = []; 408 409 if (count($plugins_info) > 0) { 410 $active_plugins = get_option( 'active_plugins' ); 411 412 foreach ($plugins_info as $single_plugin) { 413 if ($single_plugin->download_link === null) { 414 // var_dump($single_plugin); 415 416 $found = false; // Flag to track if the plugin is found 417 418 foreach ( $active_plugins as $plugin ) { 419 if ( strpos( $plugin, $single_plugin->folder_name ) !== false ) { 420 $found = true; 421 } 422 } 423 424 $response[] = array( 425 'name' => $single_plugin->Name, 426 'varsion' => $single_plugin->Version, 427 'new_version' => $single_plugin->new_version, 428 'activated' => $found 429 ); 430 } 431 } 432 } 433 434 return new WP_REST_Response( 435 array( 436 'status' => true, 437 'data' => $response 438 ), 200 439 ); 440 } 441 442 public function technical_assessment() { 443 // Get the list of all installed plugins 444 global $wpdb, $wp_rewrite; 445 446 if ( ! function_exists( 'get_plugins' ) ) { 447 require_once( ABSPATH . 'wp-admin/includes/plugin.php' ); 448 } 449 450 $all_plugins = get_plugins(); 451 452 $response = [ 453 'automatic_update' => true, 454 'free_plugins_updated' => true, 455 'premium_plugins_updated' => true, 456 'disable_search_engine' => false, 457 'file_editing_enabled' => true, 458 'admin_user_exists' => false, 459 'frontend_edit_enabled' => false, 460 'deactivated_plugins' => false, 461 'akismet_plugin_activated' => false, 462 'vulnerabilities' => false, 463 'protect_wp_config' => false, 464 'protect_readme_html' => false, 465 'disable_directory_access' => false, 466 'protect_install_php' => false, 467 'disabled_debug_mode' => false, 468 'deactivated_themes' => false, 469 'protect_upgrade_php' => false, 470 'admin_accounts' => true, 471 'stable_wordpress_version' => false, 472 'wordpress_version_hide' => false, 473 'revision_posts' => false, 474 'user_friendly_permalink' => false, 475 'timezone_settings' => true, 476 'sample_page' => false, 477 'sample_post' => false, 478 'sample_comment' => false 479 ]; 480 481 // Get the list of plugins with auto-update enabled 482 $auto_update_plugins = get_site_option('auto_update_plugins', []); 483 $all_have_auto_update = true; 484 485 foreach ($all_plugins as $plugin_file => $plugin_data) { 486 if (!in_array($plugin_file, $auto_update_plugins)) { 487 $all_have_auto_update = false; 488 } 489 } 490 491 $response['automatic_update'] = $all_have_auto_update; 492 493 // Autometic update end 494 495 // Get premium and free plugins 496 // Load all installed plugins 497 498 $plugins_info = MVSP_Plugins_Info::plugins_info($all_plugins); 499 $updates = get_site_transient('update_plugins'); 500 501 $need_update = []; 502 503 if (!empty($updates->response)) { 504 foreach ($updates->response as $plugin_file => $plugin_data) { 505 $need_update[] = $plugin_data->slug; 506 } 507 } 508 509 510 if (count($plugins_info) > 0) { 511 foreach ($plugins_info as $single_plugin) { 512 // Check if the plugin is premium (no download link) or free 513 if ($single_plugin->download_link === null) { 514 if(in_array($single_plugin->slug, $need_update)) { 515 $response['premium_plugins_updated'] = false; 516 $response['vulnerabilities'] = true; 517 } 518 } else { 519 if(in_array($single_plugin->slug, $need_update)) { 520 $response['free_plugins_updated'] = in_array($single_plugin->slug, $need_update) ? false : true; 521 $response['vulnerabilities'] = true; 522 } 523 } 524 } 525 } 526 527 // Check if file editing is disabled 528 if (defined('DISALLOW_FILE_EDIT') && DISALLOW_FILE_EDIT) { 529 $response['file_editing_enabled'] = false; 530 } 531 532 // Check if an admin user with username 'admin' exists 533 $user = get_user_by('login', 'admin'); 534 535 if ($user && in_array('administrator', $user->roles)) { 536 $response['admin_user_exists'] = true; 537 } 538 539 $blog_public = get_option('blog_public'); 540 541 if ($blog_public === '0') { 542 $response['disable_search_engine'] = true; 543 } 544 545 if (is_admin_bar_showing()) { 546 $response['frontend_edit_enabled'] = true; 547 } 548 549 550 // Get the list of active plugins 551 $active_plugins = get_option('active_plugins'); 552 553 // Check if any plugin is deactivated 554 foreach ($all_plugins as $plugin_file => $plugin_data) { 555 if (!in_array($plugin_file, $active_plugins)) { 556 $response['deactivated_plugins'] = true; 557 break; 558 } 559 } 560 561 if(is_plugin_active('akismet/akismet.php')) { 562 $response['akismet_plugin_activated'] = true; 563 } 564 565 $url = home_url('/wp-config.php'); 566 $headers = get_headers($url); 567 568 if (strpos($headers[0], '403') || strpos($headers[0], '404')) { 569 $response['protect_wp_config'] = true; 570 } 571 572 $url = home_url('/readme.html'); 573 $headers = get_headers($url); 574 575 if (strpos($headers[0], '403') || strpos($headers[0], '404')) { 576 $response['protect_readme_html'] = true; 577 } 578 579 $url = home_url('/install.php'); 580 $headers = get_headers($url); 581 582 if (strpos($headers[0], '403') || strpos($headers[0], '404')) { 583 $response['protect_install_php'] = true; 584 } 585 586 $directory_path = ABSPATH . 'wp-content/uploads'; 587 588 if(!opendir($directory_path)) { 589 $response['disable_directory_access'] = true; 590 } 591 592 $response['disabled_debug_mode'] = defined('WP_DEBUG') && WP_DEBUG === false; 593 594 595 $deactivated_themes = []; 596 $all_themes = wp_get_themes(); 597 $active_theme = wp_get_theme()->get_stylesheet(); 598 599 foreach ($all_themes as $theme_name => $theme_obj) { 600 if ($theme_name !== $active_theme) { 601 $deactivated_themes[] = $theme_obj->get('Name'); 602 } 603 } 604 605 606 if(count($deactivated_themes) > 0) { 607 $response['deactivated_themes'] = true; 608 $response['vulnerabilities'] = true; 609 } 610 611 $url = home_url('/upgrade.php'); 612 $headers = get_headers($url); 613 614 if (strpos($headers[0], '403') || strpos($headers[0], '404')) { 615 $response['protect_upgrade_php'] = true; 616 } 617 618 // Get the installed WordPress version 619 $installed_version = get_bloginfo('version'); 620 621 // Fetch the latest version information from WordPress.org API 622 $latest_version_data = file_get_contents('https://api.wordpress.org/core/version-check/1.7/'); 623 $latest_version_info = json_decode($latest_version_data, true); 624 $latest_stable_version = $latest_version_info['offers'][0]['current']; 625 626 if (version_compare($installed_version, $latest_stable_version, '>=')) { 627 $response['stable_wordpress_version'] = true; 628 } 629 630 $response['wordpress_version_hide'] = !has_action('wp_head', 'wp_generator'); 631 632 // The ID of the post you want to check 633 $post_id = 123; // Replace with the actual post ID 634 635 // SQL query to check for revisions 636 $query = " 637 SELECT COUNT(*) 638 FROM {$wpdb->posts} 639 WHERE post_type = 'revision' 640 "; 641 642 $revision_count = $wpdb->get_var( $wpdb->prepare( $query ) ); 643 if(intval($revision_count) > 0) { 644 $response['revision_posts'] = true; 645 } 646 647 $permalink_structure = $wp_rewrite->permalink_structure; 648 if (strpos($permalink_structure, '%postname%') !== false) { 649 $response['user_friendly_permalink'] = true; 650 } 651 652 // Query for pages with the title 'Sample Page' 653 $args = array( 654 'post_title' => 'Sample Page', 655 'post_type' => 'page', 656 'posts_per_page' => 1 657 ); 658 659 $query = new WP_Query( $args ); 660 661 // Check if the page exists 662 if ( $query->have_posts() ) { 663 $response['sample_page'] = true; 664 } 665 666 $args = array( 667 'post_type' => 'post', // We're looking for posts 668 'post_title' => 'Hello World!', // The default sample post title 669 'posts_per_page' => 1 // Limit to 1 post 670 ); 671 672 $query = new WP_Query( $args ); 673 674 if ( $query->have_posts() ) { 675 $response['sample_post'] = true; 676 } 677 678 $args = array( 679 'post_type' => 'post', // We're looking for comments on posts 680 'number' => 1, // Limit to 1 comment 681 'search' => 'This is a sample comment', // Search for a specific sample comment text 682 ); 683 684 $comments = get_comments( $args ); 685 686 if ( ! empty( $comments ) ) { 687 $response['sample_comment'] = true; 688 } 689 690 return new WP_REST_Response( 691 array( 692 'status' => true, 693 'data' => $response 694 ), 200 695 ); 696 252 697 } 253 698 … … 283 728 array( 284 729 'status' => false, 285 'error' => esc_html__($archive->errorInfo(true), ' malware-virus-scanner-plugin')730 'error' => esc_html__($archive->errorInfo(true), 'wpsafe-ai-malware-protection') 286 731 ), 400); 287 732 } … … 292 737 public static function check_user_authenticated(WP_REST_Request $request){ 293 738 294 $check_env = plugin_dir_path(dirname(__FILE__)) . '.env';295 296 $debug = false;297 if(file_exists($check_env)) {298 $debug = getenv('DEBUG_MODE');299 }300 301 if($debug === true) {302 return true;303 }304 739 305 740 $header = $request->get_headers(); 741 742 // User verify using nonce 743 if (!isset($header['nonce'][0]) || !wp_verify_nonce($header['nonce'][0], 'verify_user_authorized')) { 744 return false; 745 } 746 747 // JWT Authentication with role 748 $auth_header = $request->get_header('authorization'); 749 750 if (!$auth_header) { 751 return false; 752 } 753 306 754 $token = get_option('mvsp_auth_token'); 755 756 // Extract token from "Bearer {token}" 757 list(, $access_token) = explode(' ', $auth_header, 2); 758 759 try { 760 $get_user = JWT::decode($access_token, new Key($token, 'HS256')); 761 } catch (Exception $e) { 762 return false; 763 } 764 765 // Check if the user is an administrator 766 if ($get_user->role !== 'administrator') { 767 return new WP_REST_Response( 768 array('status' => false, 'error' => 'Unauthorized access'), 769 403 770 ); 771 } 772 773 // User verify using token 307 774 if (isset($header['auth_token']) && count($header['auth_token']) > 0 && $header['auth_token'][0] !== '') { 308 775 if ($header['auth_token'][0] === $token) { … … 312 779 return false; 313 780 } 314 315 781 } 316 782 … … 328 794 array( 329 795 'status' => false, 330 'error' =>esc_html__('Authentication failed', ' malware-virus-scanner-plugin')796 'error' =>esc_html__('Authentication failed', 'wpsafe-ai-malware-protection') 331 797 ),401 332 798 ); … … 340 806 array( 341 807 'status' => false, 342 'error' => esc_html__('You don`t have permission.', ' malware-virus-scanner-plugin')808 'error' => esc_html__('You don`t have permission.', 'wpsafe-ai-malware-protection') 343 809 ), 401); 344 810 } 345 811 812 346 813 // Generate hash token for authentication 347 814 $token = get_option('mvsp_auth_token'); … … 353 820 } 354 821 822 // Generate JWT Token with role 823 $payload = [ 824 'iss' => get_site_url(), 825 'iat' => time(), 826 'exp' => time() + 3600, // Token expires in 1 hour 827 'user_id' => $user->ID, 828 'role' => $user_role_member 829 ]; 830 831 $access_token = JWT::encode($payload, $token, 'HS256'); 832 355 833 $response = [ 834 'access_token' => $access_token, 356 835 'token' => $token, 836 'nonce' => wp_create_nonce('verify_user_authorized'), 357 837 'theme_uri' => wp_get_theme(get_option('stylesheet'))->get('ThemeURI'), 358 838 'screenshot_url' => wp_get_theme(get_option('stylesheet'))->get_screenshot(), … … 368 848 } 369 849 370 public function export_db()371 {372 $db_url = MVSP_Export_DB::export_db();373 return new WP_REST_Response(374 array(375 'status' => true,376 'data' => site_url() . '/' . $db_url377 ), 200);378 }379 380 850 public function delete_exported_db(WP_REST_Request $request) { 381 851 $filename = $request->get_param('filename'); … … 387 857 array( 388 858 'status' => true, 389 'message' => esc_html__('Exported sql file deleted successfully.', ' malware-virus-scanner-plugin')859 'message' => esc_html__('Exported sql file deleted successfully.', 'wpsafe-ai-malware-protection') 390 860 ), 200); 391 861 } … … 824 1294 array( 825 1295 'status' => true, 826 'message' => esc_html__('Verified', ' malware-virus-scanner-plugin')1296 'message' => esc_html__('Verified', 'wpsafe-ai-malware-protection') 827 1297 ), 828 1298 200 … … 832 1302 array( 833 1303 'status' => false, 834 'error' => esc_html__('This token not verified.', ' malware-virus-scanner-plugin')1304 'error' => esc_html__('This token not verified.', 'wpsafe-ai-malware-protection') 835 1305 ), 836 1306 400 … … 846 1316 array( 847 1317 'status' => false, 848 'error' => esc_html__('File name is required.', ' malware-virus-scanner-plugin')1318 'error' => esc_html__('File name is required.', 'wpsafe-ai-malware-protection') 849 1319 ), 850 1320 400 … … 858 1328 array( 859 1329 'status' => true, 860 'message' => esc_html__('File is deleted successfully.', ' malware-virus-scanner-plugin')1330 'message' => esc_html__('File is deleted successfully.', 'wpsafe-ai-malware-protection') 861 1331 ), 200); 862 1332 } … … 887 1357 array( 888 1358 'status' => false, 889 'message' => esc_html__('File path is required.', ' malware-virus-scanner-plugin')1359 'message' => esc_html__('File path is required.', 'wpsafe-ai-malware-protection') 890 1360 ), 891 1361 400 … … 899 1369 array( 900 1370 'status' => false, 901 'message' => esc_html__('Directory name is required.', ' malware-virus-scanner-plugin')1371 'message' => esc_html__('Directory name is required.', 'wpsafe-ai-malware-protection') 902 1372 ), 903 1373 400 … … 946 1416 array( 947 1417 'status' => true, 948 'message' => __('Successfully removed the deployment script', ' malware-virus-scanner-plugin')1418 'message' => __('Successfully removed the deployment script', 'wpsafe-ai-malware-protection') 949 1419 ), 200); 950 1420 } … … 954 1424 array( 955 1425 'status' => false, 956 'message' => __('Deployment script not found', ' malware-virus-scanner-plugin')1426 'message' => __('Deployment script not found', 'wpsafe-ai-malware-protection') 957 1427 ), 400); 958 1428 } … … 1108 1578 array( 1109 1579 'status' => false, 1110 'message' => __('Token is not valid', ' malware-virus-scanner-plugin')1580 'message' => __('Token is not valid', 'wpsafe-ai-malware-protection') 1111 1581 ), 400); 1112 1582 } else { … … 1116 1586 array( 1117 1587 'status' => true, 1118 'message' => esc_html__('Site disconnected', ' malware-virus-scanner-plugin')1588 'message' => esc_html__('Site disconnected', 'wpsafe-ai-malware-protection') 1119 1589 ), 200); 1120 1590 } … … 1123 1593 array( 1124 1594 'status' => false, 1125 'message' => __('Token not found', ' malware-virus-scanner-plugin')1595 'message' => __('Token not found', 'wpsafe-ai-malware-protection') 1126 1596 ), 400); 1127 1597 } … … 1340 1810 array( 1341 1811 'status' => false, 1342 'message' => __('Error: Unable to open file.', ' malware-virus-scanner-plugin')1812 'message' => __('Error: Unable to open file.', 'wpsafe-ai-malware-protection') 1343 1813 ), 400); 1344 1814 } else { … … 1348 1818 array( 1349 1819 'status' => false, 1350 'message' => __('Error: Unable to write to file.', ' malware-virus-scanner-plugin')1820 'message' => __('Error: Unable to write to file.', 'wpsafe-ai-malware-protection') 1351 1821 ), 400); 1352 1822 } else { … … 1366 1836 array( 1367 1837 'status' => false, 1368 'message' => __('.htaccess file not found.', ' malware-virus-scanner-plugin')1838 'message' => __('.htaccess file not found.', 'wpsafe-ai-malware-protection') 1369 1839 ), 400); 1370 1840 } … … 1393 1863 array( 1394 1864 'status' => false, 1395 'message' => __('Token is not valid', ' malware-virus-scanner-plugin')1865 'message' => __('Token is not valid', 'wpsafe-ai-malware-protection') 1396 1866 ), 400); 1397 1867 } else { … … 1415 1885 array( 1416 1886 'status' => false, 1417 'message' => __('Please pass token.', ' malware-virus-scanner-plugin')1887 'message' => __('Please pass token.', 'wpsafe-ai-malware-protection') 1418 1888 ), 400); 1419 1889 } … … 1699 2169 array( 1700 2170 'status' => false, 1701 'message' => __('The files variable is either not an array or it is empty.', ' malware-virus-scanner-plugin')2171 'message' => __('The files variable is either not an array or it is empty.', 'wpsafe-ai-malware-protection') 1702 2172 ), 400 1703 2173 ); … … 1726 2196 array( 1727 2197 'status' => false, 1728 'message' => __('Those files does not exist: ' . implode(', ', $files), ' malware-virus-scanner-plugin')2198 'message' => __('Those files does not exist: ' . implode(', ', $files), 'wpsafe-ai-malware-protection') 1729 2199 ), 400 1730 2200 ); … … 1733 2203 array( 1734 2204 'status' => true, 1735 'message' => __('All files are deleted successfully.', ' malware-virus-scanner-plugin')2205 'message' => __('All files are deleted successfully.', 'wpsafe-ai-malware-protection') 1736 2206 ), 200 1737 2207 ); -
safe-ai-malware-protection-for-wp/trunk/includes/class-mvsp-templates.php
r3097987 r3232957 1 1 <?php 2 2 if (!defined('ABSPATH')) { 3 die("What you are doing here man."); 4 } 5 3 6 class MVSP_Templates { 4 7 public static function menu_add_site($authorized, $token) { … … 9 12 <div class="mvsp_title_wrapper title"> 10 13 <h6 class="title"> 11 <?php echo esc_html__('Your site connected', ' malware-virus-scanner-plugin'); ?>14 <?php echo esc_html__('Your site connected', 'wpsafe-ai-malware-protection'); ?> 12 15 </h6> 13 16 <div class="mvsp_button_outter_wrapper"> 14 17 <button type="button" id="disConnectSite" class="disconnect_btn"> 15 <?php echo esc_html__('Disconnect', ' malware-virus-scanner-plugin'); ?>18 <?php echo esc_html__('Disconnect', 'wpsafe-ai-malware-protection'); ?> 16 19 </button> 17 20 <div class="mvsp_loader_wrapper"> … … 21 24 </div> 22 25 <div class="formWrapper"> 23 <div class="mvsp_site_status"><?php echo esc_url(site_url());?> <span class="mvsp_connected"><?php echo esc_html__('Connected', ' malware-virus-scanner-plugin');?></span></div>26 <div class="mvsp_site_status"><?php echo esc_url(site_url());?> <span class="mvsp_connected"><?php echo esc_html__('Connected', 'wpsafe-ai-malware-protection');?></span></div> 24 27 </div> 25 28 <?php else: ?> 26 <h6 class="title"><?php echo esc_html__('Connect your site', ' malware-virus-scanner-plugin'); ?></h6>29 <h6 class="title"><?php echo esc_html__('Connect your site', 'wpsafe-ai-malware-protection'); ?></h6> 27 30 <div class="formWrapper"> 28 <form target="_blank" id="mvspSiteConnectForm" action="<?php echo $app_url;?>/connect" method="get">31 <form target="_blank" id="mvspSiteConnectForm" action="<?php echo esc_url($app_url);?>/connect" method="get"> 29 32 <input type="hidden" name="site" value="<?php echo esc_url(site_url()); ?>" /> 30 33 <input type="hidden" id="mvspToken" name="token" /> 31 <input class="input" id="mvspUserEmail" type="email" name="email" placeholder="<?php echo esc_ html__('Your personal email', 'malware-virus-scanner-plugin'); ?>" value="<?php echo get_option( 'admin_email'); ?>" />34 <input class="input" id="mvspUserEmail" type="email" name="email" placeholder="<?php echo esc_attr__('Your personal email', 'wpsafe-ai-malware-protection'); ?>" value="<?php echo esc_attr( get_option( 'admin_email' ) ); ?>" /> 32 35 <div class="mvsp_button_outter_wrapper"> 33 36 <button type="button" id="mvspConnectSite" class="submitButton"> 34 <?php echo esc_html__('Submit', ' malware-virus-scanner-plugin'); ?>37 <?php echo esc_html__('Submit', 'wpsafe-ai-malware-protection'); ?> 35 38 </button> 36 39 <div class="mvsp_loader_wrapper"> -
safe-ai-malware-protection-for-wp/trunk/includes/class-mvsp-theme-lists.php
r3102680 r3232957 1 1 <?php 2 2 if (!defined('ABSPATH')) { 3 die("What you are doing here man."); 4 } 3 5 class MVSP_Themes_List { 4 6 public static function themes_list() { -
safe-ai-malware-protection-for-wp/trunk/includes/class-mvsp-wp-info.php
r3129170 r3232957 1 1 <?php 2 if (!defined('ABSPATH')) { 3 die("What you are doing here man."); 4 } 2 5 require_once plugin_dir_path(dirname(__FILE__)) . 'helper/class-get-plugins.php'; 3 6 class MVSP_WP_Info { … … 178 181 return $response; 179 182 } 180 181 public function encrypt_file($inputFile, $outputFile, $token)182 {183 $inputData = file_get_contents($inputFile);184 185 // Encrypt the data using AES encryption186 $encryptedData = openssl_encrypt($inputData, 'aes-256-cbc', $token, 0, $token);187 188 // Save the encrypted data to the output file189 file_put_contents($outputFile, $encryptedData);190 191 return $outputFile;192 }193 194 // Function to send the encrypted file to another API195 public static function send_encrypted_file($encryptedFile, $apiEndpoint)196 {197 // Create a Guzzle HTTP client198 $client = new \GuzzleHttp\Client();199 200 try {201 // Send a POST request with the encrypted file202 $response = $client->post($apiEndpoint, [203 'multipart' => [204 [205 'name' => 'encrypted_file',206 'contents' => fopen($encryptedFile, 'r'),207 'filename' => basename($encryptedFile),208 ],209 ],210 ]);211 212 // Print the response from the API213 echo $response->getBody();214 } catch (\Exception $e) {215 // Handle exceptions216 echo 'Error: ' . $e->getMessage();217 }218 }219 183 } -
safe-ai-malware-protection-for-wp/trunk/includes/class-plugins-info.php
r3118027 r3232957 1 1 <?php 2 if (!defined('ABSPATH')) { 3 die("What you are doing here man."); 4 } 2 5 require_once plugin_dir_path(dirname(__FILE__)) . 'helper/class-get-plugins.php'; 3 6 class MVSP_Plugins_List_Info { -
safe-ai-malware-protection-for-wp/trunk/includes/class-scan-db.php
r3076790 r3232957 1 1 <?php 2 if (!defined('ABSPATH')) { 3 die("What you are doing here man."); 4 } 2 5 class MVSP_DB_Scanner { 3 6 -
safe-ai-malware-protection-for-wp/trunk/includes/class-store-authorized-token.php
r3102680 r3232957 1 1 <?php 2 if (!defined('ABSPATH')) { 3 die("What you are doing here man."); 4 } 2 5 require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-mvsp-generate-token.php'; 3 6 class MVSP_Store_Authorized_Token { -
safe-ai-malware-protection-for-wp/trunk/includes/class-uploads-scanner.php
r3076790 r3232957 1 1 <?php 2 if (!defined('ABSPATH')) { 3 die("What you are doing here man."); 4 } 2 5 class MVSP_Uploads_Scanner { 3 6 public static function check_uploads_folder_files() { -
safe-ai-malware-protection-for-wp/trunk/includes/class-utls.php
r3076790 r3232957 1 1 <?php 2 2 if (!defined('ABSPATH')) { 3 die("What you are doing here man."); 4 } 5 3 6 class Translator 4 7 { -
safe-ai-malware-protection-for-wp/trunk/malware-virus-scanner-plugin.php
r3185543 r3232957 9 9 * that starts the plugin. 10 10 * 11 * @link https:// wpmessiah.com11 * @link https://boomdevs.com 12 12 * @since 1.0.2 13 13 * @package Wpsafe_Ai_Malware_Protection … … 17 17 * Plugin URI: https://wpsafe.ai/ 18 18 * Description: WP Safe AI - Stress-Free WordPress Malware Cleaner. 19 * Version: 1.0.1 720 * Author: WP Messiah21 * Author URI: https:// wpmessiah.com/19 * Version: 1.0.18 20 * Author: BoomDevs 21 * Author URI: https://boomdevs.com/ 22 22 * License: GPL-2.0+ 23 23 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt … … 36 36 * Rename this for your plugin and update it as you release new versions. 37 37 */ 38 define( 'MVSP_PLUGIN_VERSION', '1.0.1 7' );38 define( 'MVSP_PLUGIN_VERSION', '1.0.18' ); 39 39 40 40 /** … … 43 43 define( 'MVSP_PATH', plugin_dir_path( __FILE__ ) ); 44 44 define( 'MVSP_URL', plugin_dir_url( __FILE__ ) ); 45 define( 'MVSP_SLUG', ' malware-virus-scanner-plugin' );45 define( 'MVSP_SLUG', 'wpsafe-ai-malware-protection' ); 46 46 define( 'MVSP_SHORT_NAME', 'Safe Ai Malware Protection for WP' ); 47 47 define( 'MVSP_FULL_NAME', 'Safe Ai Malware Protection for WP' ); … … 82 82 require plugin_dir_path( __FILE__ ) . 'includes/class-malware-virus-scanner-plugin.php'; 83 83 84 // Load env file85 require plugin_dir_path( __FILE__ ) . 'helper/class-mvsp-env.php';86 87 84 /** 88 85 * Begins execution of the plugin. … … 99 96 } 100 97 mvsp_malware_virus_scanner_plugin_run(); 101 102 // $plugin_updates = get_plugin_updates();103 // $outdated_plugins_count = count($plugin_updates);104 //105 // var_dump($outdated_plugins_count); -
safe-ai-malware-protection-for-wp/trunk/public/class-malware-virus-scanner-plugin-public.php
r3185543 r3232957 4 4 * The public-facing functionality of the plugin. 5 5 * 6 * @link https:// wpmessiah.com6 * @link https://boomdevs.com 7 7 * @since 1.0.0 8 8 * … … 19 19 * @package Malware_Virus_Scanner_Plugin 20 20 * @subpackage Malware_Virus_Scanner_Plugin/public 21 * @author BoomDevs <contact@ wpmessiah.com>21 * @author BoomDevs <contact@boomdevs.com> 22 22 */ 23 23 class Malware_Virus_Scanner_Plugin_Public { -
safe-ai-malware-protection-for-wp/trunk/public/partials/malware-virus-scanner-plugin-public-display.php
r3185543 r3232957 6 6 * This file is used to markup the public-facing aspects of the plugin. 7 7 * 8 * @link https:// wpmessiah.com8 * @link https://boomdevs.com 9 9 * @since 1.0.0 10 10 * -
safe-ai-malware-protection-for-wp/trunk/uninstall.php
r3185543 r3232957 20 20 * https://github.com/tommcfarlin/WordPress-Plugin-Boilerplate/pull/123#issuecomment-28541913 21 21 * 22 * @link https:// wpmessiah.com22 * @link https://boomdevs.com 23 23 * @since 1.0.0 24 24 *
Note: See TracChangeset
for help on using the changeset viewer.