Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Shadow Terms plugin for WordPress

Copyright 2022-2025 by Happy Prime and contributors
Copyright 2022-2026 by Happy Prime and contributors

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
17 changes: 16 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,24 @@
"type": "wordpress-plugin",
"license": "GPL-2.0-or-later",
"minimum-stability": "stable",
"repositories": [
{
"type": "package",
"package": {
"name": "phpcompatibility/php-compatibility",
"type": "phpcodesniffer-standard",
"version": "9.99.9",
"source": {
"url": "https://github.com/PHPCompatibility/PHPCompatibility.git",
"type": "git",
"reference": "9f7142356b5674164a6f6dbe12a7a1bcc632db21"
}
}
}
],
"require-dev": {
"happyprime/coding-standards": "*",
"phpcompatibility/php-compatibility": "dev-develop as 9.99.99"
"phpcompatibility/php-compatibility": "9.99.9"
},
"scripts": {
"phpcs": "vendor/bin/phpcs",
Expand Down
469 changes: 220 additions & 249 deletions composer.lock

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions includes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

namespace ShadowTerms\API;

if ( ! defined( 'ABSPATH' ) ) {
exit;
}

/**
* Retrieve a post's shadow taxonomy slug.
*
Expand Down
4 changes: 4 additions & 0 deletions includes/sync.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

namespace ShadowTerms\Sync;

if ( ! defined( 'ABSPATH' ) ) {
exit;
}

add_action( 'wp_after_insert_post', __NAMESPACE__ . '\sync_shadow_taxonomies', 10, 4 );
add_action( 'deleted_post', __NAMESPACE__ . '\delete_term', 10, 2 );

Expand Down
4 changes: 4 additions & 0 deletions includes/taxonomy.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@

use ShadowTerms\API;

if ( ! defined( 'ABSPATH' ) ) {
exit;
}

add_action( 'init', __NAMESPACE__ . '\register', 9999 );
add_action( 'rest_api_init', __NAMESPACE__ . '\register_route' );

Expand Down Expand Up @@ -93,7 +97,7 @@
* @param array $args The arguments used to register the taxonomy.
* @param string $post_type The post type this taxonomy is shadowing.
*/
$args = apply_filters( 'shadow_terms_register_taxonomy_args', $args, $post_type );

Check warning on line 100 in includes/taxonomy.php

View workflow job for this annotation

GitHub Actions / call-workflow / test

WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound

Hook names invoked by a theme/plugin should start with the theme/plugin prefix. Found: "shadow_terms_register_taxonomy_args".

\register_taxonomy(
$post_type . '_connect',
Expand Down Expand Up @@ -171,7 +175,7 @@
'no_found_rows' => true,
'update_post_meta_cache' => false,
'update_term_meta_cache' => false,
'tax_query' => [

Check warning on line 178 in includes/taxonomy.php

View workflow job for this annotation

GitHub Actions / call-workflow / test

WordPress.DB.SlowDBQuery.slow_db_query_tax_query

Detected usage of tax_query, possible slow query.
[
'taxonomy' => API\get_taxonomy_slug( $post_id ),
'field' => 'term_id',
Expand Down
5 changes: 2 additions & 3 deletions plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@

namespace ShadowTerms;

// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
die;
if ( ! defined( 'ABSPATH' ) ) {
exit;
}

require_once __DIR__ . '/includes/api.php';
Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Contributors: happyprime, jeremyfelt, slocker, philcable, wpgirl369
Tags: terms, related, content
Requires at least: 5.9
Tested up to: 6.8
Tested up to: 6.9
Stable tag: 1.2.2
License: GPLv2 or later
Requires PHP: 7.4
Expand Down