first
This commit is contained in:
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Yoast\WP\SEO\Conditionals\Third_Party;
|
||||
|
||||
use Yoast\WP\SEO\Conditionals\Conditional;
|
||||
|
||||
/**
|
||||
* Conditional that is met when the Elementor plugin is installed and activated.
|
||||
*/
|
||||
class Elementor_Activated_Conditional implements Conditional {
|
||||
|
||||
/**
|
||||
* Checks if the Elementor plugins is installed and activated.
|
||||
*
|
||||
* @return bool `true` when the Elementor plugin is installed and activated.
|
||||
*/
|
||||
public function is_met() {
|
||||
return \defined( 'ELEMENTOR__FILE__' );
|
||||
}
|
||||
}
|
39
wp-content/plugins/wordpress-seo/src/conditionals/third-party/elementor-edit-conditional.php
vendored
Normal file
39
wp-content/plugins/wordpress-seo/src/conditionals/third-party/elementor-edit-conditional.php
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace Yoast\WP\SEO\Conditionals\Third_Party;
|
||||
|
||||
use Yoast\WP\SEO\Conditionals\Conditional;
|
||||
|
||||
/**
|
||||
* Conditional that is only met when on an Elementor edit page or when the current
|
||||
* request is an ajax request for saving our post meta data.
|
||||
*/
|
||||
class Elementor_Edit_Conditional implements Conditional {
|
||||
|
||||
/**
|
||||
* Returns whether this conditional is met.
|
||||
*
|
||||
* @return bool Whether the conditional is met.
|
||||
*/
|
||||
public function is_met() {
|
||||
global $pagenow;
|
||||
|
||||
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: We are not processing form information.
|
||||
if ( isset( $_GET['action'] ) && \is_string( $_GET['action'] ) ) {
|
||||
// phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Reason: We are not processing form information, We are only strictly comparing.
|
||||
$get_action = \wp_unslash( $_GET['action'] );
|
||||
if ( $pagenow === 'post.php' && $get_action === 'elementor' ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:ignore WordPress.Security.NonceVerification.Missing -- Reason: We are not processing form information.
|
||||
if ( isset( $_POST['action'] ) && \is_string( $_POST['action'] ) ) {
|
||||
// phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Reason: We are not processing form information, We are only strictly comparing.
|
||||
$post_action = \wp_unslash( $_POST['action'] );
|
||||
return \wp_doing_ajax() && $post_action === 'wpseo_elementor_save';
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Yoast\WP\SEO\Conditionals\Third_Party;
|
||||
|
||||
use Yoast\WP\SEO\Conditionals\Conditional;
|
||||
|
||||
/**
|
||||
* Conditional that is only met when Jetpack_Boost exists.
|
||||
*/
|
||||
class Jetpack_Boost_Active_Conditional implements Conditional {
|
||||
|
||||
/**
|
||||
* Returns `true` when the Jetpack_Boost class exists within this WordPress installation.
|
||||
*
|
||||
* @return bool `true` when the Jetpack_Boost class exists within this WordPress installation.
|
||||
*/
|
||||
public function is_met() {
|
||||
return \class_exists( '\Automattic\Jetpack_Boost\Jetpack_Boost', false );
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace Yoast\WP\SEO\Conditionals\Third_Party;
|
||||
|
||||
use Automattic\Jetpack_Boost\Lib\Premium_Features;
|
||||
use Yoast\WP\SEO\Conditionals\Conditional;
|
||||
|
||||
/**
|
||||
* Conditional that is met when Jetpack Boost is not installed, activated or premium.
|
||||
*/
|
||||
class Jetpack_Boost_Not_Premium_Conditional implements Conditional {
|
||||
|
||||
/**
|
||||
* Whether Jetpack Boost is not premium.
|
||||
*
|
||||
* @return bool Whether Jetpack Boost is not premium.
|
||||
*/
|
||||
public function is_met() {
|
||||
return ! $this->is_premium();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves, if available, if Jetpack Boost has priority feature available.
|
||||
*
|
||||
* @return bool Whether Jetpack Boost is premium.
|
||||
*/
|
||||
private function is_premium() {
|
||||
if ( \class_exists( '\Automattic\Jetpack_Boost\Lib\Premium_Features', false ) ) {
|
||||
return Premium_Features::has_feature(
|
||||
Premium_Features::PRIORITY_SUPPORT
|
||||
);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
20
wp-content/plugins/wordpress-seo/src/conditionals/third-party/polylang-conditional.php
vendored
Normal file
20
wp-content/plugins/wordpress-seo/src/conditionals/third-party/polylang-conditional.php
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Yoast\WP\SEO\Conditionals\Third_Party;
|
||||
|
||||
use Yoast\WP\SEO\Conditionals\Conditional;
|
||||
|
||||
/**
|
||||
* Conditional that is only met when the Polylang plugin is active.
|
||||
*/
|
||||
class Polylang_Conditional implements Conditional {
|
||||
|
||||
/**
|
||||
* Checks whether the Polylang plugin is installed and active.
|
||||
*
|
||||
* @return bool Whether Polylang is installed and active.
|
||||
*/
|
||||
public function is_met() {
|
||||
return \defined( 'POLYLANG_FILE' );
|
||||
}
|
||||
}
|
20
wp-content/plugins/wordpress-seo/src/conditionals/third-party/translatepress-conditional.php
vendored
Normal file
20
wp-content/plugins/wordpress-seo/src/conditionals/third-party/translatepress-conditional.php
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Yoast\WP\SEO\Conditionals\Third_Party;
|
||||
|
||||
use Yoast\WP\SEO\Conditionals\Conditional;
|
||||
|
||||
/**
|
||||
* Conditional that is only met when the TranslatePress plugin is active.
|
||||
*/
|
||||
class TranslatePress_Conditional implements Conditional {
|
||||
|
||||
/**
|
||||
* Checks whether the TranslatePress plugin is active.
|
||||
*
|
||||
* @return bool Whether the TranslatePress plugin is active.
|
||||
*/
|
||||
public function is_met() {
|
||||
return \class_exists( 'TRP_Translate_Press' );
|
||||
}
|
||||
}
|
24
wp-content/plugins/wordpress-seo/src/conditionals/third-party/w3-total-cache-conditional.php
vendored
Normal file
24
wp-content/plugins/wordpress-seo/src/conditionals/third-party/w3-total-cache-conditional.php
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Yoast\WP\SEO\Conditionals\Third_Party;
|
||||
|
||||
use Yoast\WP\SEO\Conditionals\Conditional;
|
||||
|
||||
/**
|
||||
* Conditional that is only met when in the admin.
|
||||
*/
|
||||
class W3_Total_Cache_Conditional implements Conditional {
|
||||
|
||||
/**
|
||||
* Returns whether or not this conditional is met.
|
||||
*
|
||||
* @return bool Whether or not the conditional is met.
|
||||
*/
|
||||
public function is_met() {
|
||||
if ( ! \defined( 'W3TC_DIR' ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return \function_exists( 'w3tc_objectcache_flush' );
|
||||
}
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace Yoast\WP\SEO\Conditionals\Third_Party;
|
||||
|
||||
use Yoast\WP\SEO\Conditionals\Conditional;
|
||||
use Yoast\WP\SEO\Helpers\Wordproof_Helper;
|
||||
|
||||
/**
|
||||
* Conditional that is met when the WordProof integration is toggled on.
|
||||
*/
|
||||
class Wordproof_Integration_Active_Conditional implements Conditional {
|
||||
|
||||
/**
|
||||
* The WordProof helper.
|
||||
*
|
||||
* @var Wordproof_Helper
|
||||
*/
|
||||
private $wordproof;
|
||||
|
||||
/**
|
||||
* WordProof integration active constructor.
|
||||
*
|
||||
* @param Wordproof_Helper $wordproof The options helper.
|
||||
*/
|
||||
public function __construct( Wordproof_Helper $wordproof ) {
|
||||
$this->wordproof = $wordproof;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether or not the WordProof Timestamp plugin is active.
|
||||
*
|
||||
* @return bool Whether or not the WordProof Timestamp plugin is active.
|
||||
*/
|
||||
public function is_met() {
|
||||
return $this->wordproof->integration_is_active();
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Yoast\WP\SEO\Conditionals\Third_Party;
|
||||
|
||||
use Yoast\WP\SEO\Conditionals\Conditional;
|
||||
|
||||
/**
|
||||
* Conditional that is met when the WordProof Timestamp plugin is inactive.
|
||||
*/
|
||||
class Wordproof_Plugin_Inactive_Conditional implements Conditional {
|
||||
|
||||
/**
|
||||
* Returns whether or not the WordProof Timestamp plugin is active.
|
||||
*
|
||||
* @return bool Whether or not the WordProof Timestamp plugin is active.
|
||||
*/
|
||||
public function is_met() {
|
||||
return ! \defined( 'WORDPROOF_VERSION' );
|
||||
}
|
||||
}
|
20
wp-content/plugins/wordpress-seo/src/conditionals/third-party/wpml-conditional.php
vendored
Normal file
20
wp-content/plugins/wordpress-seo/src/conditionals/third-party/wpml-conditional.php
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Yoast\WP\SEO\Conditionals\Third_Party;
|
||||
|
||||
use Yoast\WP\SEO\Conditionals\Conditional;
|
||||
|
||||
/**
|
||||
* Conditional that is only met when WPML is active.
|
||||
*/
|
||||
class WPML_Conditional implements Conditional {
|
||||
|
||||
/**
|
||||
* Returns whether or not this conditional is met.
|
||||
*
|
||||
* @return bool Whether or not the conditional is met.
|
||||
*/
|
||||
public function is_met() {
|
||||
return \defined( 'WPML_PLUGIN_FILE' );
|
||||
}
|
||||
}
|
28
wp-content/plugins/wordpress-seo/src/conditionals/third-party/wpml-wpseo-conditional.php
vendored
Normal file
28
wp-content/plugins/wordpress-seo/src/conditionals/third-party/wpml-wpseo-conditional.php
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Yoast\WP\SEO\Conditionals\Third_Party;
|
||||
|
||||
use Yoast\WP\SEO\Conditionals\Conditional;
|
||||
|
||||
/**
|
||||
* Conditional that is met when the Yoast SEO Multilingual plugin,
|
||||
* a glue plugin developed by and for WPML, is active.
|
||||
*/
|
||||
class WPML_WPSEO_Conditional implements Conditional {
|
||||
|
||||
/**
|
||||
* Path to the Yoast SEO Multilingual plugin file.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
const PATH_TO_WPML_WPSEO_PLUGIN_FILE = 'wp-seo-multilingual/plugin.php';
|
||||
|
||||
/**
|
||||
* Returns whether or not the Yoast SEO Multilingual plugin is active.
|
||||
*
|
||||
* @return bool Whether or not the Yoast SEO Multilingual plugin is active.
|
||||
*/
|
||||
public function is_met() {
|
||||
return \is_plugin_active( self::PATH_TO_WPML_WPSEO_PLUGIN_FILE );
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user