-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpeprodev-ups.php
99 lines (90 loc) · 4.84 KB
/
peprodev-ups.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<?php
/*
Plugin Name: PeproDev Ultimate Profile Solutions
Description: One of the most Advanced and *The Ultimate Profile Solutions* for WordPress. FREE OF ANY CHARGE, UNLIMITED and OPEN-SOURCE FOREVER!
Contributors: amirhpcom, peprodev, blackswanlab
Tags: profile-builder, user-dashboard, login-registration, otp-login
Author: Pepro Dev. Group
Author URI: https://pepro.dev/
Plugin URI: https://pepro.dev/ups
Version: 7.4.8
Requires at least: 5.0
Tested up to: 6.7.1
Requires PHP: 7.2
WC tested up to: 9.4.2
Text Domain: peprodev-ups
Domain Path: /languages
Copyright: (c) Pepro Dev. Group, All rights reserved.
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
* @Last modified by: amirhp-com <its@amirhp.com>
* @Last modified time: 2024/11/24 12:15:22
*/
defined("ABSPATH") or die("PeproDev Ultimate Profile Solutions :: Unauthorized Access! (https://pepro.dev/)");
if (!class_exists("PeproDevUPS")) {
class PeproDevUPS {
public $td = "peprodev-ups";
public $version = "7.4.8";
public function __construct() {
define("PEPRODEVUPS", $this->version);
define("PEPRODEV_UPS_FILE", __FILE__);
add_filter("load_textdomain_mofile", function ($m, $d) {
if ($this->td == $d && "fa_IR" == get_locale()) { return plugin_dir_path(__FILE__) . "languages/{$d}-fa_IR.mo"; }
return $m;
}, 10, 2);
load_plugin_textdomain("peprodev-ups", false, dirname(plugin_basename(__FILE__)) . "/languages/");
load_plugin_textdomain("wpserveur-hide-login", false, dirname(plugin_basename(__FILE__)) . "/languages/");
require_once plugin_dir_path(__FILE__) . "/core/main.php";
require_once plugin_dir_path(__FILE__) . "/profile/profile.php";
require_once plugin_dir_path(__FILE__) . "/login/login.php";
add_action("plugin_row_meta", array($this, "plugin_row_meta"), 10, 4);
add_filter("plugin_action_links", array($this, "plugin_action_links"), 10, 2);
add_action("before_woocommerce_init", [$this, "add_hpos_support"]);
add_filter("rocket_cache_reject_uri", array($this, "rocket_add_profile_exclude_pages"));
register_deactivation_hook(__FILE__, function () {
update_option("peprodevups_alert_viewed_yet", "");
});
register_activation_hook(__FILE__, function () {
add_filter("rocket_cache_reject_uri", array($this, "rocket_add_profile_exclude_pages"));
if (function_exists("flush_rocket_htaccess")) {
flush_rocket_htaccess(); // Update the WP Rocket rules on the .htaccess.
rocket_generate_config_file(); // Regenerate the config file.
}
});
}
// wp-rocket
public function rocket_add_profile_exclude_pages($urls) {
$profile_page = get_option("PeproDevUPS_Core___profile-profile-dash-page", false);
if ($profile_page) $urls[] = wp_parse_url(get_permalink($profile_page), PHP_URL_PATH);
return $urls;
}
public function add_hpos_support() {
if (class_exists(\Automattic\WooCommerce\Utilities\FeaturesUtil::class)) {
\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility('custom_order_tables', __FILE__, true);
}
}
public function plugin_row_meta($links_array, $plugin_file_name, $plugin_data, $status) {
if (strpos($plugin_file_name, basename(__FILE__))) {
$links_array[] = "<a href='mailto:support@pepro.dev?subject=PeproProfile-v.{$this->version}'>" . __("Support", "peprodev-ups") . "</a>";
$links_array[] = "<a href='https://pepro.dev/ups'>" . __('Documentation', "peprodev-ups") . "</a>";
$links_array[] = "<a href='" . admin_url("?pepro_ups_force_db_create=1") . "'>" . __('Update Database Structure', "peprodev-ups") . "</a>";
}
return $links_array;
}
public function plugin_action_links($actions, $plugin_file) {
if (plugin_basename(__FILE__) == $plugin_file) {
$actions["peprodev-profile"] = "<a href='" . admin_url("admin.php?page=pepro§ion=home") . "'>" . __("Settings", "peprodev-ups") . "</a>";
}
return $actions;
}
}
add_action("plugins_loaded", function () {
load_plugin_textdomain("peprodev-ups", false, dirname(plugin_basename(__FILE__)) . "/languages/");
load_plugin_textdomain("wpserveur-hide-login", false, dirname(plugin_basename(__FILE__)) . "/languages/");
global $PeproDevUPS;
$PeproDevUPS = new PeproDevUPS();
});
}
/*##################################################
Lead Developer: [amirhp-com](https://amirhp.com/)
##################################################*/