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 micropub.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
// Compatibility Functions with Newer WordPress Versions.
require_once MICROPUB_PLUGIN_DIR . 'includes/compat-functions.php';

if ( \class_exists( \IndieAuth\IndieAuth::class ) ) {
if ( \defined( 'INDIEAUTH_PLUGIN_VERSION' ) ) {
\add_action( 'plugins_loaded', array( Micropub::get_instance(), 'init' ) );
} else {
\add_action( 'admin_notices', __NAMESPACE__ . '\indieauth_not_installed_notice' );
Expand Down
4 changes: 4 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ These configuration options can be enabled by adding them to your wp-config.php:

Project and support maintained on GitHub at [indieweb/wordpress-micropub](https://github.com/indieweb/wordpress-micropub).

### Unreleased

* Detect the IndieAuth plugin via the `INDIEAUTH_PLUGIN_VERSION` constant instead of a class check, which avoids coupling to IndieAuth's class names (indieweb/wordpress-indieauth#319) and requires IndieAuth 4.7.0 or later

### 2.5.1

* Fix error responses for failed post inserts and updates, returning the proper HTTP status code instead of a success response
Expand Down
3 changes: 2 additions & 1 deletion tests/phpunit/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
define( 'WP_TESTS_PHPUNIT_POLYFILLS_PATH', $_phpunit_polyfills_path );
}

require __DIR__ . '/includes/class-indieauth-plugin.php';
// Simulate an active IndieAuth plugin (4.7.0+ defines this constant).
define( 'INDIEAUTH_PLUGIN_VERSION', '4.7.0' );

define( 'DIR_MEDIATESTDATA', __DIR__ . '/data' );

Expand Down
6 changes: 0 additions & 6 deletions tests/phpunit/includes/class-indieauth-plugin.php

This file was deleted.