forked from Yoast/yoast-acf-analysis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
yoast-acf-analysis.php
executable file
·71 lines (63 loc) · 2.27 KB
/
yoast-acf-analysis.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
<?php
/**
* ACF Content Analysis for Yoast SEO plugin.
*
* @package YoastACFAnalysis
*
* @wordpress-plugin
* Plugin Name: ACF Content Analysis for Yoast SEO
* Plugin URI: https://wordpress.org/plugins/acf-content-analysis-for-yoast-seo/
* Description: Ensure that Yoast SEO analyzes all Advanced Custom Fields 4 and 5 content including Flexible Content and Repeaters.
* Version: 2.4.1
* Author: Thomas Kräftner, ViktorFroberg, marol87, pekz0r, angrycreative, Team Yoast
* Author URI: http://angrycreative.se
* License: GPL v3
* Text Domain: acf-content-analysis-for-yoast-seo
* Domain Path: /languages/
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! defined( 'AC_SEO_ACF_ANALYSIS_PLUGIN_PATH' ) ) {
define( 'AC_SEO_ACF_ANALYSIS_PLUGIN_SLUG', 'ac-yoast-seo-acf-content-analysis' );
define( 'AC_SEO_ACF_ANALYSIS_PLUGIN_FILE', __FILE__ );
define( 'AC_SEO_ACF_ANALYSIS_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
define( 'AC_SEO_ACF_ANALYSIS_PLUGIN_URL', plugins_url( '', __FILE__ ) . '/' );
define( 'AC_SEO_ACF_ANALYSIS_PLUGIN_NAME', untrailingslashit( plugin_basename( __FILE__ ) ) );
}
$yoast_acf_autoload_file = '/vendor/autoload.php';
if ( is_file( AC_SEO_ACF_ANALYSIS_PLUGIN_PATH . $yoast_acf_autoload_file ) ) {
require AC_SEO_ACF_ANALYSIS_PLUGIN_PATH . $yoast_acf_autoload_file;
}
/**
* Triggers a message whenever the class is missing.
*/
if ( ! class_exists( 'AC_Yoast_SEO_ACF_Content_Analysis' ) ) {
add_action( 'admin_notices', 'yoast_acf_report_missing_acf' );
}
else {
$ac_yoast_seo_acf_analysis = new AC_Yoast_SEO_ACF_Content_Analysis();
$ac_yoast_seo_acf_analysis->init();
}
/**
* Show admin notice when ACF is missing.
*/
function yoast_acf_report_missing_acf() {
echo '<div class="error"><p>';
printf(
/* translators: %1$s resolves to ACF Content Analysis for Yoast SEO */
esc_html__( '%1$s could not be loaded because of missing files.', 'acf-content-analysis-for-yoast-seo' ),
'ACF Content Analysis for Yoast SEO'
);
echo '</p></div>';
}
/* ********************* DEPRECATED FUNCTIONS ********************* */
/**
* Loads translations.
*
* @deprecated 2.0.1
* @codeCoverageIgnore
*/
function yoast_acf_analysis_load_textdomain() {
// As we require WordPress 4.6 and higher, we don't need to load the translation files manually anymore.
}