PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 28.5
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v28.5
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
wordpress-seo / src / plans / application / duplicate-post-manager.php

duplicate-post-manager.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI 28.5, at src/plans/application/duplicate-post-manager.php

52 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 // phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure.
4 namespace Yoast\WP\SEO\Plans\Application;
5
6 use WPSEO_Admin_Utils;
7
8 /**
9 * The Yoast SEO Duplicate Post plugin Manager.
10 */
11 class Duplicate_Post_Manager {
12
13 /**
14 * The Duplicate post main file.
15 *
16 * @var string
17 */
18 public const PLUGIN_FILE = 'duplicate-post/duplicate-post.php';
19
20 /**
21 * Checks if the plugin is installed and activated in WordPress.
22 *
23 * @return bool True when installed and activated.
24 */
25 protected function is_activated() {
26 return \is_plugin_active( self::PLUGIN_FILE );
27 }
28
29 /**
30 * Checks if the plugin is installed in WordPress.
31 *
32 * @return bool True when installed.
33 */
34 protected function is_installed() {
35 return \file_exists( \WP_PLUGIN_DIR . '/' . self::PLUGIN_FILE );
36 }
37
38 /**
39 * Gets the duplicate post plans page params
40 *
41 * @return array<string|bool> The list of params.
42 */
43 public function get_params() {
44 return [
45 'isInstalled' => $this->is_installed(),
46 'isActivated' => $this->is_activated(),
47 'installationUrl' => \html_entity_decode( WPSEO_Admin_Utils::get_install_url( self::PLUGIN_FILE ) ),
48 'activationUrl' => \html_entity_decode( WPSEO_Admin_Utils::get_activation_url( self::PLUGIN_FILE ) ),
49 ];
50 }
51 }
52