Skip to content

A module that handles checking a WordPress installation to see if it is a fresh install and to fetch the estimated installation date.

Notifications You must be signed in to change notification settings

newfold-labs/wp-module-install-checker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WordPress Install Checker Module

A module that handles checking a WordPress installation to see if it is a fresh install and to fetch the estimated installation date.

This module uses the Newfold Module Loader to register new references into the dependency injection container. Only meant for use in Newfold brand plugins.

Module Responsibilities

  • Provides a way to check if a WordPress install is fresh, meaning no posts, pages, or users were created manually.
  • Provides a way to get the creation/installation date for a WordPress site.

Critical Paths

  • Ensure that a newly created site that hasn't been touched passes the isFreshInstallation() check.
  • Ensure that a newly created site with WooCommerce installed passes the isFreshInstallation() check.

Installation

1. Add the Newfold Satis to your composer.json.

composer config repositories.newfold composer https://newfold-labs.github.io/satis

2. Require the newfold-labs/wp-module-install-checker package.

composer require newfold-labs/wp-module-install-checker

Usage

<?php

use function NewfoldLabs\WP\ModuleLoader\container;

/**
* Returns a boolean indicating whether this is a fresh WordPress installation.
*/
$isFreshInstall = container()->get('isFreshInstallation');

/**
 * Returns a Unix timestamp representing the site creation date.
 */
$installationDate = container()->get('installationDate');

/**
 * Returns an InstallChecker class instance.
 */
 $installChecker = container()->get('installChecker');

About

A module that handles checking a WordPress installation to see if it is a fresh install and to fetch the estimated installation date.

Topics

Resources

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages