确保Yoast SEO分析所有高级自定义字段4和5的内容,包括灵活内容和中继器。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

72 lines
2.3 KiB

  1. <?php
  2. /**
  3. * ACF Content Analysis for Yoast SEO plugin.
  4. *
  5. * @package YoastACFAnalysis
  6. *
  7. * @wordpress-plugin
  8. * Plugin Name: ACF Content Analysis for Yoast SEO
  9. * Plugin URI: https://wordpress.org/plugins/acf-content-analysis-for-yoast-seo/
  10. * Description: Ensure that Yoast SEO analyzes all Advanced Custom Fields 5.7+ content including Flexible Content and Repeaters.
  11. * Version: 3.0
  12. * Author: Thomas Kräftner, ViktorFroberg, marol87, pekz0r, angrycreative, Team Yoast
  13. * Author URI: http://angrycreative.se
  14. * License: GPL v3
  15. * Text Domain: acf-content-analysis-for-yoast-seo
  16. * Domain Path: /languages/
  17. */
  18. if ( ! defined( 'ABSPATH' ) ) {
  19. exit;
  20. }
  21. if ( ! defined( 'AC_SEO_ACF_ANALYSIS_PLUGIN_PATH' ) ) {
  22. define( 'AC_SEO_ACF_ANALYSIS_PLUGIN_SLUG', 'ac-yoast-seo-acf-content-analysis' );
  23. define( 'AC_SEO_ACF_ANALYSIS_PLUGIN_FILE', __FILE__ );
  24. define( 'AC_SEO_ACF_ANALYSIS_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
  25. define( 'AC_SEO_ACF_ANALYSIS_PLUGIN_URL', plugins_url( '', __FILE__ ) . '/' );
  26. define( 'AC_SEO_ACF_ANALYSIS_PLUGIN_NAME', untrailingslashit( plugin_basename( __FILE__ ) ) );
  27. }
  28. $yoast_acf_autoload_file = '/vendor/autoload.php';
  29. if ( is_file( AC_SEO_ACF_ANALYSIS_PLUGIN_PATH . $yoast_acf_autoload_file ) ) {
  30. require AC_SEO_ACF_ANALYSIS_PLUGIN_PATH . $yoast_acf_autoload_file;
  31. }
  32. /**
  33. * Triggers a message whenever the class is missing.
  34. */
  35. if ( ! class_exists( 'AC_Yoast_SEO_ACF_Content_Analysis' ) ) {
  36. add_action( 'admin_notices', 'yoast_acf_report_missing_acf' );
  37. }
  38. else {
  39. $ac_yoast_seo_acf_analysis = new AC_Yoast_SEO_ACF_Content_Analysis();
  40. $ac_yoast_seo_acf_analysis->init();
  41. }
  42. /**
  43. * Show admin notice when ACF is missing.
  44. */
  45. function yoast_acf_report_missing_acf() {
  46. echo '<div class="error"><p>';
  47. printf(
  48. /* translators: %1$s resolves to ACF Content Analysis for Yoast SEO */
  49. esc_html__( '%1$s could not be loaded because of missing files.', 'acf-content-analysis-for-yoast-seo' ),
  50. 'ACF Content Analysis for Yoast SEO'
  51. );
  52. echo '</p></div>';
  53. }
  54. /* ********************* DEPRECATED FUNCTIONS ********************* */
  55. /**
  56. * Loads translations.
  57. *
  58. * @deprecated 2.0.1
  59. * @codeCoverageIgnore
  60. */
  61. function yoast_acf_analysis_load_textdomain() {
  62. // As we require WordPress 4.6 and higher, we don't need to load the translation files manually anymore.
  63. }