Completed
Push — develop ( 7f1301...799090 )
by
unknown
17:22
created

GravityView_Plugin_Hooks_All_In_One_SEO   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 57
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 57
rs 10
c 0
b 0
f 0
wmc 4
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A skip_shortcode_processing() 0 7 3
1
<?php
2
/**
3
 * Add All In One SEO scripts and styles to GravityView no-conflict list
4
 *
5
 * @file      class-gravityview-plugin-hooks-all-in-one-seo.php
6
 * @since     2.10.3
7
 * @license   GPL2+
8
 * @author    GravityView <[email protected]>
9
 * @link      http://gravityview.co
10
 * @copyright Copyright 2021, Katz Web Services, Inc.
11
 *
12
 * @package   GravityView
13
 */
14
15
/**
16
 * @inheritDoc
17
 * @since 2.10.3
18
 */
19
class GravityView_Plugin_Hooks_All_In_One_SEO extends GravityView_Plugin_and_Theme_Hooks {
20
21
	/**
22
	 * @inheritDoc
23
	 * @since 2.10.3
24
	 */
25
	protected $constant_name = 'AIOSEO_FILE';
26
27
	protected $style_handles = array(
28
		'aioseo-app-style',
29
		'aioseo-common',
30
		'aioseo-post-settings-metabox',
31
		'aioseo-vendors',
32
	);
33
34
	/**
35
	 * @inheritDoc
36
	 * @since 2.10.3
37
	 */
38
	protected $script_handles = array(
39
		'aioseo-app',
40
		'aioseo-common',
41
		'aioseo-link-format',
42
		'aioseo-post-settings-metabox',
43
		'aioseo-vendors',
44
	);
45
46
	/**
47
	 * @inheritDoc
48
	 * @since 2.10.3
49
	 */
50
	public function __construct() {
51
		parent::__construct();
52
53
		add_filter( 'pre_do_shortcode_tag', array( $this, 'skip_shortcode_processing' ), 10, 4 );
54
	}
55
56
	/**
57
	 * Prevent AIO SEO from processing GV shortcode
58
	 *
59
	 * @since 2.10.3
60
	 *
61
	 * @see   do_shortcode_tag();
62
	 *
63
	 * @param string       $shortcode_tag Shortcode name
64
	 * @param false|string $return        Short-circuit return value: false or the value to replace the shortcode with
0 ignored issues
show
Bug introduced by
There is no parameter named $return. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
65
	 *
66
	 * @return false|string
67
	 */
68
	public function skip_shortcode_processing( $result, $shortcode_tag ) {
69
		if ( 'gravityview' === $shortcode_tag && preg_match( '/AIOSEO/', json_encode( debug_backtrace() ) ) ) {
70
			return '';
71
		}
72
73
		return $result;
74
	}
75
}
76
77
new GravityView_Plugin_Hooks_All_In_One_SEO;
78