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

Fix issue where coming soon isn't respecting mm_coming_soon #24

Merged
merged 24 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
e4e2f1e
Use Node 18
wpscholar Jan 17, 2024
c01e449
Change upgrade routine to make sure it runs with the new released ver…
wpscholar Jan 17, 2024
e024693
Add an isComingSoonActive function for internal use
wpscholar Jan 17, 2024
17fe09f
JS lint for webpack config
wpscholar Jan 17, 2024
08fab57
Remove now defunct option_name
wpscholar Jan 17, 2024
6d69ba0
Bump version
wpscholar Jan 17, 2024
f5f93a2
Clean up scripts
wpscholar Jan 17, 2024
138047a
Update JS dependencies
wpscholar Jan 17, 2024
f200637
Update build files
wpscholar Jan 17, 2024
68e1675
Clean up logic for pre-publish modal
wpscholar Jan 17, 2024
32befd6
Update service to use real booleans when getting and setting options
wpscholar Jan 17, 2024
39d57d6
Remove now defunct option_name
wpscholar Jan 17, 2024
86d5ad0
Code formatting
wpscholar Jan 17, 2024
a2bca0b
Clean up logic for checking if coming soon is active
wpscholar Jan 17, 2024
8540ece
Add JetPack under construction logic
wpscholar Jan 17, 2024
9549e6d
Add logic to set a default value for nfd_coming_soon and to sync that…
wpscholar Jan 17, 2024
cc432b3
Code formatting and general cleanup. Notably, we're running the initi…
wpscholar Jan 17, 2024
c735333
update test
circlecube Jan 17, 2024
a1c7267
remove confusing comment
circlecube Jan 17, 2024
ce5351f
use quotes when setting value via cli in test
circlecube Jan 17, 2024
ea5d17a
Revert "use quotes when setting value via cli in test"
circlecube Jan 17, 2024
6932948
Revert "remove confusing comment"
circlecube Jan 17, 2024
e47be47
Revert "update test"
circlecube Jan 17, 2024
7c2a2aa
remove unnecessary axe
circlecube Jan 17, 2024
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 .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v16
v18
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ Coming Soon functionality for WordPress.

// Set a value - scoped to comingsoon index
$nfd_module_container->set('comingsoon', [
'option_name' => 'mm_coming_soon',
'admin_screen_id' => 'app',
'admin_app_url' => admin_url( 'admin.php?page=app#/home' ),
'template_h1' => __('Coming Soon!', 'text-domain'),
Expand Down
75 changes: 38 additions & 37 deletions bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,27 +1,33 @@
<?php

use NewfoldLabs\WP\ModuleLoader\Container;
use NewfoldLabs\WP\Module\ComingSoon\ComingSoon;
use NewfoldLabs\WP\Module\ComingSoon\Service;
use function NewfoldLabs\WP\ModuleLoader\register;
use NewfoldLabs\WP\ModuleLoader\Container;
use WP_Forge\UpgradeHandler\UpgradeHandler;

use function NewfoldLabs\WP\ModuleLoader\register;

// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
return;
}

// Do not allow multiple copies of the module to be active
// Do not allow multiple copies of the module to be activated.
if ( defined( 'NFD_COMING_SOON_MODULE_VERSION' ) ) {
return;
}

define( 'NFD_COMING_SOON_MODULE_VERSION', '1.1.14' );
define( 'NFD_COMING_SOON_MODULE_VERSION', '1.1.16' );

require __DIR__ . '/includes/functions.php';

if ( function_exists( 'is_admin' ) && is_admin() ) {
$old_coming_soon_module_version = get_option( 'nfd_coming_soon_module_version' );

// Allow the initial upgrade routine to run on the front-end, but only once.
if ( ! $old_coming_soon_module_version || is_admin() ) {
$upgrade_handler = new UpgradeHandler(
__DIR__ . '/upgrades',
get_option( 'nfd_coming_soon_module_version' ),
$old_coming_soon_module_version,
NFD_DATA_MODULE_VERSION
);

Expand All @@ -31,37 +37,32 @@
}
}

/**
* Register the coming soon module
*/
if ( function_exists( 'add_action' ) ) {

add_action(
'plugins_loaded',
function () {
// Register the module
add_action(
'plugins_loaded',
function () {

register(
array(
'name' => 'coming-soon',
'label' => __( 'Coming Soon', 'newfold-module-coming-soon' ),
'callback' => function ( Container $container ) {
if ( ! defined( 'NFD_COMING_SOON_BUILD_DIR' ) && defined( 'NFD_COMING_SOON_MODULE_VERSION' ) ) {
define( 'NFD_COMING_SOON_BUILD_DIR', __DIR__ . '/build/' . NFD_COMING_SOON_MODULE_VERSION );
}
if ( ! defined( 'NFD_COMING_SOON_BUILD_URL' ) && defined( 'NFD_COMING_SOON_MODULE_VERSION' ) ) {
define( 'NFD_COMING_SOON_BUILD_URL', $container->plugin()->url . 'vendor/newfold-labs/wp-module-coming-soon/build/' . NFD_COMING_SOON_MODULE_VERSION );
}
$container->set( 'comingSoon', $container->service( function () {
return new Service();
}) );
return new ComingSoon( $container );
},
'isActive' => true,
'isHidden' => true,
)
);
register(
array(
'name' => 'coming-soon',
'label' => __( 'Coming Soon', 'newfold-module-coming-soon' ),
'callback' => function ( Container $container ) {
if ( ! defined( 'NFD_COMING_SOON_BUILD_DIR' ) && defined( 'NFD_COMING_SOON_MODULE_VERSION' ) ) {
define( 'NFD_COMING_SOON_BUILD_DIR', __DIR__ . '/build/' . NFD_COMING_SOON_MODULE_VERSION );
}
if ( ! defined( 'NFD_COMING_SOON_BUILD_URL' ) && defined( 'NFD_COMING_SOON_MODULE_VERSION' ) ) {
define( 'NFD_COMING_SOON_BUILD_URL', $container->plugin()->url . 'vendor/newfold-labs/wp-module-coming-soon/build/' . NFD_COMING_SOON_MODULE_VERSION );
}
$container->set( 'comingSoon', $container->service( function () {
return new Service();
} ) );

}
);
return new ComingSoon( $container );
},
'isActive' => true,
'isHidden' => true,
)
);

}
}
);
1 change: 0 additions & 1 deletion build/0.0.1/coming-soon.css

This file was deleted.

1 change: 0 additions & 1 deletion build/0.0.1/coming-soon.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-components', 'wp-data', 'wp-dom-ready', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '13d2f9050a5557fafa9d');
<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-components', 'wp-data', 'wp-dom-ready', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '7e3b27b25aa9f85ecd4a');
Loading
Loading