Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 4.1.3 #1052

Merged
merged 9 commits into from
Nov 22, 2024
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
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [4.1.3] - 22 Nov, 2024

### Added

- Add check for the constant `PUBLISHPRESS_FUTURE_FORCE_DEBUG` to force debug mode.

### Fixed

- Fix error on fresh install about missing table (Issue #1051).

## [4.1.2] - 21 Nov, 2024

### Fixed
Expand Down
14 changes: 7 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions lib/vendor/composer/installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'name' => '__root__',
'pretty_version' => 'dev-develop',
'version' => 'dev-develop',
'reference' => '6316fe0a602194d31241ee34f8c415a5ffcf2397',
'reference' => 'e5b0408d1ac208ccb32b81c26e3dd8ebdfb85730',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand All @@ -13,7 +13,7 @@
'__root__' => array(
'pretty_version' => 'dev-develop',
'version' => 'dev-develop',
'reference' => '6316fe0a602194d31241ee34f8c415a5ffcf2397',
'reference' => 'e5b0408d1ac208ccb32b81c26e3dd8ebdfb85730',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand Down
4 changes: 2 additions & 2 deletions post-expirator.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Plugin URI: http://wordpress.org/extend/plugins/post-expirator/
* Description: PublishPress Future allows you to schedule automatic changes to posts, pages and other content types.
* Author: PublishPress
* Version: 4.1.2
* Version: 4.1.3
* Author URI: http://publishpress.com
* Text Domain: post-expirator
* Domain Path: /languages
Expand Down Expand Up @@ -51,7 +51,7 @@
}

if (! defined('PUBLISHPRESS_FUTURE_VERSION')) {
define('PUBLISHPRESS_FUTURE_VERSION', '4.1.2');
define('PUBLISHPRESS_FUTURE_VERSION', '4.1.3');
}

if (! defined('PUBLISHPRESS_FUTURE_PLUGIN_FILE')) {
Expand Down
12 changes: 11 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Requires at least: 6.7
Requires PHP: 7.4
Tested up to: 6.7
License: GPLv2 or later
Stable tag: 4.1.2
Stable tag: 4.1.3

PublishPress Future can make scheduled changes to your content. You can unpublish posts, move posts to a new status, update the categories, and more.

Expand Down Expand Up @@ -173,6 +173,16 @@ Yes, the PublishPress Future plugin allows you to schedule automatic changes to

The full changelog can be found on [GitHub](https://github.com/publishpress/PublishPress-Future/blob/main/CHANGELOG.md).

## [4.1.3] - 22 Nov, 2024

### Added

- Add check for the constant `PUBLISHPRESS_FUTURE_FORCE_DEBUG` to force debug mode.

### Fixed

- Fix error on fresh install about missing table (Issue #1051).

## [4.1.2] - 21 Nov, 2024

### Fixed
Expand Down
16 changes: 14 additions & 2 deletions src/Modules/Expirator/Controllers/ExpirationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
use PublishPress\Future\Core\HookableInterface;
use PublishPress\Future\Framework\InitializableInterface;
use PublishPress\Future\Framework\Logger\LoggerInterface;
use PublishPress\Future\Modules\Expirator\DBTableSchemas\ActionArgsSchema;
use PublishPress\Future\Modules\Expirator\HooksAbstract;
use PublishPress\Future\Modules\Expirator\Interfaces\SchedulerInterface;
use PublishPress\Future\Modules\Expirator\Models\ExpirablePostModel;
use PublishPress\Future\Modules\Expirator\Models\PostTypeDefaultDataModelFactory;
use Throwable;

defined('ABSPATH') or die('Direct access not allowed.');
Expand All @@ -41,6 +41,11 @@ class ExpirationController implements InitializableInterface
*/
private $logger;

/**
* @var ActionArgsSchema
*/
private $actionArgsSchema;

/**
* @param HookableInterface $hooksFacade
* @param SchedulerInterface $scheduler
Expand All @@ -51,12 +56,14 @@ public function __construct(
HookableInterface $hooksFacade,
SchedulerInterface $scheduler,
Closure $expirablePostModelFactory,
LoggerInterface $logger
LoggerInterface $logger,
ActionArgsSchema $actionArgsSchema
) {
$this->hooks = $hooksFacade;
$this->scheduler = $scheduler;
$this->expirablePostModelFactory = $expirablePostModelFactory;
$this->logger = $logger;
$this->actionArgsSchema = $actionArgsSchema;
}

public function initialize()
Expand Down Expand Up @@ -155,6 +162,11 @@ public function autoEnableOnInsertPost($postId, $post, $update)

private function setupFutureActionIfAutoEnabled(int $postId): void
{
// This is needed to avoid errors on fresh install. See issue #1051.
if (! $this->actionArgsSchema->isTableHealthy()) {
return;
}

$postModelFactory = $this->expirablePostModelFactory;
$postModel = $postModelFactory($postId);

Expand Down
3 changes: 2 additions & 1 deletion src/Modules/Expirator/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ private function factoryExpirationController()
$this->hooks,
$this->scheduler,
$this->expirablePostModelFactory,
$this->logger
$this->logger,
$this->actionArgsSchema
);
}

Expand Down
4 changes: 4 additions & 0 deletions src/Modules/Settings/SettingsFacade.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ public function getSettingPreserveData($default = true)
*/
public function getDebugIsEnabled($default = false)
{
if (defined('PUBLISHPRESS_FUTURE_FORCE_DEBUG') && constant('PUBLISHPRESS_FUTURE_FORCE_DEBUG')) {
return true;
}

if (! isset($this->cache['debugIsEnabled'])) {
$this->cache['debugIsEnabled'] = (bool)$this->options->getOption('expirationdateDebug', $default);
}
Expand Down