| Server IP : 80.74.154.100 / Your IP : 216.73.217.0 Web Server : Apache System : Linux marissa.metanet.ch 4.18.0-553.141.2.lve.el7h.x86_64 #1 SMP Wed Jul 8 17:20:31 UTC 2026 x86_64 User : onlineadmin ( 10487) PHP Version : 8.5.7 Disable Function : opcache_get_status MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/httpd/vhosts/comeonline.ch/httpdocs/wp-content/plugins/wpsso/lib/abstract/ |
Upload File : |
<?php
/*
* License: GPLv3
* License URI: https://www.gnu.org/licenses/gpl.txt
* Copyright 2014-2026 Jean-Sebastien Morisset (https://surniaulula.com/)
*/
if ( ! defined( 'ABSPATH' ) ) {
die( 'These aren\'t the droids you\'re looking for.' );
}
if ( ! class_exists( 'SucomAbstractAddOn' ) ) {
require_once dirname( __FILE__ ) . '/com/add-on.php'; // SucomAbstractAddOn class.
}
if ( ! class_exists( 'WpssoAbstractAddOn' ) ) {
abstract class WpssoAbstractAddOn extends SucomAbstractAddOn {
protected $p; // Wpsso class object.
protected $ext = ''; // Add-on lowercase classname.
protected $p_ext = ''; // Add-on lowercase acronym.
protected $cf = array(); // Add-on config array.
public $reg; // Add-on register class object.
/*
* Called from the child class as parent::__construct( __FILE__, __CLASS__ ).
*/
public function __construct( $plugin_file, $classname ) {
$plugin_dir = trailingslashit( dirname( $plugin_file ) );
$config_class = $classname . 'Config';
$register_class = $classname . 'Register';
$this->ext = strtolower( $classname );
$this->p_ext = str_replace( 'wpsso', '', $this->ext );
require_once $plugin_dir . '/lib/config.php';
$config_class::set_constants( $plugin_file );
$config_class::require_libs( $plugin_file ); // Includes the register.php class library.
$this->cf =& $config_class::$cf;
$this->reg = new $register_class(); // Activate, deactivate, uninstall hooks.
$this->add_hooks( $plugin_file );
}
protected function add_hooks( $plugin_file ) {
/*
* WPSSO filter hooks.
*/
add_filter( 'wpsso_get_config', array( $this, 'get_config' ), 10, 1 );
add_filter( 'wpsso_get_avail', array( $this, 'get_avail' ), 10, 1 );
/*
* WPSSO action hooks.
*/
foreach ( array(
'init_textdomain' => 0,
'init_objects_preloader' => 0,
'init_objects' => 0,
'init_check_options' => 0,
) as $method => $args_num ) {
if ( method_exists( $this, $method ) ) {
add_action( 'wpsso_' . $method, array( $this, $method ), 10, $args_num );
}
}
/*
* The SucomAbstractAddOn->init_plugin_notices() method adds toolbar notices for any missing requirements.
*/
add_action( 'wpsso_init_plugin', array( $this, 'init_plugin_notices' ), 100, 0 );
/*
* If SucomAbstractAddOn->init_plugin_notices() is not executed, then show any missing requirements using
* the standard WordPress admin notices action.
*/
add_action( 'all_admin_notices', array( $this, 'show_admin_notices' ), 100, 0 );
/*
* Declare compatibility with WooCommerce features.
*/
if ( ! empty( $this->cf[ 'plugin' ][ $this->ext ][ 'wc_compat' ] ) ) {
$wc_compat = $this->cf[ 'plugin' ][ $this->ext ][ 'wc_compat' ];
add_action( 'before_woocommerce_init', function () use ( $plugin_file, $wc_compat ) {
if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) {
foreach ( $wc_compat as $feature ) {
\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( $feature, $plugin_file, true );
}
}
}, 10, 0 );
}
}
}
}