-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathextended-content-analysis-yoastseo.php
65 lines (44 loc) · 2.11 KB
/
extended-content-analysis-yoastseo.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
<?php
/**
* @link http://www.ressourcenmangel.de/
* @since 1.0.0
* @package extended-content-analysis-yoastseo
*
* @wordpress-plugin
* Plugin Name: Extended Content Analysis for YOAST SEO
* Plugin URI: https://github.com/Basbee
* Description: Plugin extends the "Content Analysis" Features of YOAST SEO while it fetches the complete Post or Page content manually and even gets the data out of layout building tools like Enfolds Avia Layout Builder.
* Version: 1.0.0
* Author: Sebastian Kulahs
* Author URI: https://github.com/Basbee
* Text Domain: extended-content-analysis-yoastseo
*/
// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
die;
}
// manually require plugin.php in order to use is_plugin_active
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
/*
* Check if YOAST SEO Plugin is installed and activated
*/
if ( !is_plugin_active( 'wordpress-seo/wp-seo.php' ) ) {
/*
* display message if YOAST SEO is not activated
*/
function extend_content_yoast_admin_notices() {
echo '<div class="updated"><p>YOAST SEO Plugin ( min v.3.0 ) must be activated in order to get <strong>"Extended Content Analysis for YOAST SEO"</strong> work correctly.</p></div>';
}
add_action('admin_notices', 'extend_content_yoast_admin_notices');
} else{
/*
* Register scripts - add child theme javascripts to admin area only
*/
function extend_content_yoast_scripts() {
wp_register_script( 'extend-content-analysis', plugins_url( '/admin/js/extend-content-yoast.js', __FILE__ ) );
wp_enqueue_script( 'extend-content-analysis', plugins_url( '/admin/js/extend-content-yoast.js', __FILE__ ), array('yoast-seo'), '1.0.0', true );
// register var pluginsUrl for usage in JS files
wp_localize_script('extend-content-analysis', 'extendContentYoastScript', array('pluginsUrl' => plugins_url('', __FILE__),));
}
add_action('admin_enqueue_scripts', 'extend_content_yoast_scripts');
}