/
var
/
www
/
vhosts
/
ihelp.ro
/
ajutam.ro
/
wp-content
/
plugins
/
give
/
includes
/
/var/www/vhosts/ihelp.ro/ajutam.ro/wp-content/plugins/give/includes
mkdir
upload
Name
Size
Mode
Actions
admin/
-
0755
rm
api/
-
0755
rm
database/
-
0755
rm
deprecated/
-
0755
rm
donors/
-
0755
rm
emails/
-
0755
rm
forms/
-
0755
rm
frontend/
-
0755
rm
gateways/
-
0755
rm
libraries/
-
0755
rm
payments/
-
0755
rm
actions.php
9723
0644
edit
dl
rm
ajax-functions.php
20842
0644
edit
dl
rm
class-give-async-process.php
1177
0644
edit
dl
rm
class-give-background-updater.php
13110
0644
edit
dl
rm
class-give-cache-setting.php
6402
0644
edit
dl
rm
class-give-cache.php
18186
0644
edit
dl
rm
class-give-cli-commands.php
33154
0644
edit
dl
rm
class-give-comment.php
17386
0644
edit
dl
rm
class-give-cron.php
5157
0644
edit
dl
rm
class-give-donate-form.php
24078
0644
edit
dl
rm
class-give-donor.php
41007
0644
edit
dl
rm
class-give-email-access.php
8503
0644
edit
dl
rm
class-give-license-handler.php
27610
0644
edit
dl
rm
class-give-logging.php
7492
0644
edit
dl
rm
class-give-readme-parser.php
1259
0644
edit
dl
rm
class-give-roles.php
10783
0644
edit
dl
rm
class-give-scripts.php
25159
0644
edit
dl
rm
class-give-session.php
15164
0644
edit
dl
rm
class-give-stats.php
12049
0644
edit
dl
rm
class-give-template-loader.php
3638
0644
edit
dl
rm
class-give-tooltips.php
4670
0644
edit
dl
rm
class-give-translation.php
8466
0644
edit
dl
rm
class-notices.php
19401
0644
edit
dl
rm
country-functions.php
77972
0644
edit
dl
rm
currencies-list.php
48937
0644
edit
dl
rm
currency-functions.php
11784
0644
edit
dl
rm
error-tracking.php
2996
0644
edit
dl
rm
filters.php
8946
0644
edit
dl
rm
formatting.php
25206
0644
edit
dl
rm
install.php
16535
0644
edit
dl
rm
login-register.php
10578
0644
edit
dl
rm
misc-functions.php
113297
0644
edit
dl
rm
plugin-compatibility.php
3247
0644
edit
dl
rm
post-types.php
18224
0644
edit
dl
rm
price-functions.php
2895
0644
edit
dl
rm
process-donation.php
47979
0644
edit
dl
rm
setting-functions.php
4461
0644
edit
dl
rm
shortcodes.php
29823
0644
edit
dl
rm
template-functions.php
13292
0644
edit
dl
rm
user-functions.php
16145
0644
edit
dl
rm
Edit:
/var/www/vhosts/ihelp.ro/ajutam.ro/wp-content/plugins/give/includes/class-give-cache-setting.php
(6402B)
<?php /** * Class for managing plugin settings cache * * Note: only use for internal purpose. * * @package Give * @subpackage Classes/Give_Cache_Setting * @copyright Copyright (c) 2018, GiveWP * @license https://opensource.org/licenses/gpl-license GNU Public License * @since 2.4.0 */ // Exit if accessed directly. if ( ! defined( 'ABSPATH' ) ) { exit; } /** * Class Give_Cache_Setting */ class Give_Cache_Setting { /** * Instance. * * @since 2.4.0 * @access private * @var Give_Cache_Setting */ private static $instance; /** * Cache key. * * @since 2.4.0 * @access private * @var string */ private $cache_key = 'giveAllOptions'; /** * Cache group. * * @since 2.4.0 * @access private * @var string */ private $cache_group = 'give-options'; /** * Array of cached settings * * @since 2.4.0 * @access private * @var array */ private $settings = [ 'give_settings' => [], 'give_version' => '', 'give_completed_upgrades' => [], 'give_doing_upgrade' => [], 'give_paused_batches' => [], 'give_install_pages_created' => '', 'give_show_db_upgrade_complete_notice' => '', 'give_addon_last_activated' => '', 'currencies' => [], 'gateways' => [], ]; /** * Array of cached setting db option names * * @since 2.4.0 * @access private * @var array */ private $db_option_ids = [ 'give_settings', 'give_version', 'give_completed_upgrades', 'give_doing_upgrade', 'give_install_pages_created', 'give_show_db_upgrade_complete_notice', 'give_addon_last_activated', 'give_paused_batches', ]; /** * Array of cached setting option names * * @since 2.4.0 * @access private * @var array */ private static $all_option_ids; /** * Singleton pattern. * * @since 2.4.0 * @access private */ private function __construct() { } /** * Get instance. * * @since 2.4.0 * @access public * @return Give_Cache_Setting */ public static function get_instance() { if ( null === static::$instance ) { self::$instance = new static(); self::$instance->setup(); } return self::$instance; } /** * Setup * * @since 2.4.0 * @access private */ private function setup() { self::$all_option_ids = array_keys( $this->settings ); $this->load_plugin_settings(); add_action( 'added_option', [ $this, 'reload_plugin_settings' ] ); add_action( 'updated_option', [ $this, 'reload_plugin_settings' ] ); add_action( 'deleted_option', [ $this, 'reload_plugin_settings' ] ); add_action( 'give_init', [ $this, 'setup_currencies_list' ], 11 ); add_action( 'give_init', [ $this, 'setup_gateways_list' ], 11 ); } /** * Load plugin settings * * @since 2.4.0 * @access private */ private function load_plugin_settings() { global $wpdb; /** * Fire the filter * * This filter can be used if admin facing any caching issue. * This is a switch to enable or disable setting cache. * Thus filter can be removed in future. * * @since 2.4.1 */ if ( ! apply_filters( 'give_disable_setting_cache', false ) ) { $cache = wp_cache_get( $this->cache_key, $this->cache_group ); // Load options from cache. if ( ! empty( $cache ) ) { $this->settings = $cache; return; } } $db_option_ids = '\'' . implode( '\',\'', $this->db_option_ids ) . '\''; $sql = "SELECT option_name, option_value FROM $wpdb->options WHERE option_name IN ({$db_option_ids}) "; $results = $wpdb->get_results( $sql ); if ( ! empty( $results ) ) { /* @var stdClass $result */ foreach ( $results as $result ) { $this->settings[ $result->option_name ] = maybe_unserialize( $result->option_value ); } wp_cache_set( $this->cache_key, $this->settings, $this->cache_group ); } } /** * Reload option when add, update or delete * * Note: only for internal logic * * @since 2.4.0 * * @param $option_name */ public function reload_plugin_settings( $option_name ) { // Bailout. if ( ! in_array( $option_name, $this->db_option_ids ) ) { return; } wp_cache_delete( $this->cache_key, $this->cache_group ); $this->load_plugin_settings(); } /** * Setup currencies list * * @since 2.4.0 * @since 2.9.6 Replaced require_once with require to support multiple calls. */ public function setup_currencies_list() { $currencies = require GIVE_PLUGIN_DIR . 'includes/currencies-list.php'; /** * Filter the supported currency list * * @since 2.4.0 */ $currencies = apply_filters( 'give_register_currency', $currencies ); $this->settings['currencies'] = $currencies; } /** * Setup gateway list * * Note: use give_get_enabled_payment_gateways function to get list of registered gateway. * * @since 2.4.0 * @since 2.15.0 Set payment gateway checkout label to admin defined payment gateway checkout label. */ public function setup_gateways_list() { // Default, built-in gateways $gateways = [ 'manual' => [ 'admin_label' => __( 'Test Donation', 'give' ), 'checkout_label' => __( 'Test Donation', 'give' ), ], 'offline' => [ 'admin_label' => esc_attr__( 'Offline Donation', 'give' ), 'checkout_label' => esc_attr__( 'Offline Donation', 'give' ), ], ]; /** * Filter the supported gateways list * * @since 2.4.0 */ $gateways = apply_filters( 'give_register_gateway', $gateways ); $this->settings['gateways'] = $gateways; } /** * Get option * * @since 2.4.0 * @access public * * @param $option_name * @param bool $default * * @return mixed */ public static function get_option( $option_name, $default = false ) { $value = $default; if ( in_array( $option_name, self::$all_option_ids ) ) { $value = ! empty( self::$instance->settings[ $option_name ] ) ? self::$instance->settings[ $option_name ] : $default; } return $value; } /** * Get plugin settings * * @since 2.4.0 * @access public */ public static function get_settings() { /** * Filter the plugin setting */ return (array) apply_filters( 'give_get_settings', self::get_option( 'give_settings', [] ) ); } } Give_Cache_Setting::get_instance();
Save
cmd:
run