Skip to content

Commit

Permalink
Merge branch 'master' into lazyloading-styles-with-has
Browse files Browse the repository at this point in the history
  • Loading branch information
nk-o committed Sep 26, 2023
2 parents 656b724 + 275c01b commit c2d6ef5
Show file tree
Hide file tree
Showing 8 changed files with 8,184 additions and 23,530 deletions.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"wp-coding-standards/wpcs": "^2.3",
"phpcompatibility/phpcompatibility-wp": "^2.1",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7",
"php-stubs/wordpress-stubs": "^6.2",
"php-stubs/wordpress-tests-stubs": "^6.2",
"php-stubs/wordpress-stubs": "^6.3",
"php-stubs/wordpress-tests-stubs": "^6.3",
"spatie/phpunit-watcher": "^1.23",
"yoast/phpunit-polyfills": "^1.0"
"yoast/phpunit-polyfills": "^1.1"
},
"scripts": {
"lint": "phpcs --standard=phpcs.xml.dist",
Expand Down
240 changes: 120 additions & 120 deletions composer.lock

Large diffs are not rendered by default.

31,321 changes: 7,917 additions & 23,404 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
"postinstall": "composer install"
},
"devDependencies": {
"@playwright/test": "^1.35.1",
"@wordpress/e2e-test-utils-playwright": "^0.3.0",
"@wordpress/env": "^8.2.0",
"@playwright/test": "^1.37.0",
"@wordpress/e2e-test-utils-playwright": "^0.7.0",
"@wordpress/env": "^8.5.0",
"@babel/node": "^7.16.8",
"@babel/plugin-proposal-object-rest-spread": "^7.16.7",
"@babel/plugin-transform-react-jsx": "^7.16.7",
Expand Down
3 changes: 3 additions & 0 deletions src/class-visual-portfolio.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@ private function include_dependencies() {
require_once $this->plugin_path . 'classes/3rd/plugins/class-vc.php';
require_once $this->plugin_path . 'classes/3rd/plugins/class-wp-rocket.php';
require_once $this->plugin_path . 'classes/3rd/plugins/class-wpml.php';
require_once $this->plugin_path . 'classes/3rd/plugins/class-rank-math.php';
require_once $this->plugin_path . 'classes/3rd/plugins/class-yoast.php';
require_once $this->plugin_path . 'classes/3rd/plugins/class-all-in-one-seo.php';
require_once $this->plugin_path . 'classes/3rd/themes/class-avada.php';
require_once $this->plugin_path . 'classes/3rd/themes/class-enfold.php';
require_once $this->plugin_path . 'classes/3rd/themes/class-thrive-architect.php';
Expand Down
44 changes: 44 additions & 0 deletions src/classes/3rd/plugins/class-all-in-one-seo.php
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();
49 changes: 49 additions & 0 deletions src/classes/3rd/plugins/class-rank-math.php
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();
45 changes: 45 additions & 0 deletions src/classes/3rd/plugins/class-yoast.php
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();

0 comments on commit c2d6ef5

Please sign in to comment.