-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into lazyloading-styles-with-has
- Loading branch information
Showing
8 changed files
with
8,184 additions
and
23,530 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
/** | ||
* All In One SEO Plugin. | ||
* | ||
* @package @@plugin_name | ||
*/ | ||
|
||
if ( ! defined( 'ABSPATH' ) ) { | ||
exit; | ||
} | ||
|
||
/** | ||
* Class Visual_Portfolio_3rd_All_In_One_Seo | ||
*/ | ||
class Visual_Portfolio_3rd_All_In_One_Seo { | ||
/** | ||
* Visual_Portfolio_3rd_All_In_One_Seo constructor. | ||
*/ | ||
public function __construct() { | ||
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound | ||
if ( in_array( 'all-in-one-seo-pack/all_in_one_seo_pack.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ), true ) ) { | ||
// Fixed canonical links. | ||
add_filter( 'aioseo_canonical_url', array( $this, 'canonical' ) ); | ||
} | ||
} | ||
|
||
/** | ||
* Optimize url by supported GET variables: vp_page, vp_filter, vp_sort and vp_search. | ||
* | ||
* @param string $canonical - Not optimized URL. | ||
* @return string | ||
*/ | ||
public function canonical( $canonical ) { | ||
// phpcs:ignore WordPress.Security.NonceVerification.Recommended | ||
foreach ( $_GET as $key => $value ) { | ||
if ( 'vp_page' === $key || 'vp_filter' === $key || 'vp_sort' === $key || 'vp_search' === $key ) { | ||
// phpcs:ignore WordPress.Security.NonceVerification.Recommended | ||
$canonical = add_query_arg( array_map( 'sanitize_text_field', wp_unslash( array( $key => $value ) ) ), $canonical ); | ||
} | ||
} | ||
return $canonical; | ||
} | ||
} | ||
new Visual_Portfolio_3rd_All_In_One_Seo(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
/** | ||
* Rank Math SEO Plugin. | ||
* | ||
* @package @@plugin_name | ||
*/ | ||
|
||
if ( ! defined( 'ABSPATH' ) ) { | ||
exit; | ||
} | ||
|
||
/** | ||
* Class Visual_Portfolio_3rd_Rank_Math | ||
*/ | ||
class Visual_Portfolio_3rd_Rank_Math { | ||
/** | ||
* Visual_Portfolio_3rd_Rank_Math constructor. | ||
*/ | ||
public function __construct() { | ||
if ( ! function_exists( 'is_plugin_active' ) ) { | ||
require_once ABSPATH . 'wp-admin/includes/plugin.php'; | ||
} | ||
|
||
if ( ! class_exists( 'RankMath' ) || ! is_plugin_active( 'seo-by-rank-math/rank-math.php' ) ) { | ||
return; | ||
} | ||
|
||
// Fixed canonical links. | ||
add_filter( 'rank_math/frontend/canonical', array( $this, 'canonical' ) ); | ||
} | ||
|
||
/** | ||
* Optimize url by supported GET variables: vp_page, vp_filter, vp_sort and vp_search. | ||
* | ||
* @param string $canonical - Not optimized URL. | ||
* @return string | ||
*/ | ||
public function canonical( $canonical ) { | ||
// phpcs:ignore WordPress.Security.NonceVerification.Recommended | ||
foreach ( $_GET as $key => $value ) { | ||
if ( 'vp_page' === $key || 'vp_filter' === $key || 'vp_sort' === $key || 'vp_search' === $key ) { | ||
// phpcs:ignore WordPress.Security.NonceVerification.Recommended | ||
$canonical = add_query_arg( array_map( 'sanitize_text_field', wp_unslash( array( $key => $value ) ) ), $canonical ); | ||
} | ||
} | ||
return $canonical; | ||
} | ||
} | ||
new Visual_Portfolio_3rd_Rank_Math(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
/** | ||
* Yoast SEO Plugin. | ||
* | ||
* @package @@plugin_name | ||
*/ | ||
|
||
if ( ! defined( 'ABSPATH' ) ) { | ||
exit; | ||
} | ||
|
||
/** | ||
* Class Visual_Portfolio_3rd_Yoast | ||
*/ | ||
class Visual_Portfolio_3rd_Yoast { | ||
/** | ||
* Visual_Portfolio_3rd_Yoast constructor. | ||
*/ | ||
public function __construct() { | ||
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound | ||
if ( in_array( 'wordpress-seo/wp-seo.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ), true ) ) { | ||
// Fixed canonical links. | ||
add_filter( 'wpseo_canonical', array( $this, 'canonical' ), 12, 2 ); | ||
} | ||
} | ||
|
||
/** | ||
* Optimize url by supported GET variables: vp_page, vp_filter, vp_sort and vp_search. | ||
* | ||
* @param string $canonical - Not optimized URL. | ||
* @param string $presentation - The indexable presentation. | ||
* @return string | ||
*/ | ||
public function canonical( $canonical, $presentation = null ) { | ||
// phpcs:ignore WordPress.Security.NonceVerification.Recommended | ||
foreach ( $_GET as $key => $value ) { | ||
if ( 'vp_page' === $key || 'vp_filter' === $key || 'vp_sort' === $key || 'vp_search' === $key ) { | ||
// phpcs:ignore WordPress.Security.NonceVerification.Recommended | ||
$canonical = add_query_arg( array_map( 'sanitize_text_field', wp_unslash( array( $key => $value ) ) ), $canonical ); | ||
} | ||
} | ||
return $canonical; | ||
} | ||
} | ||
new Visual_Portfolio_3rd_Yoast(); |