Compare commits

..

No commits in common. "bd6e3f2d60b7ad0e1890b4e842a9f0aae4578ad2" and "6913a0ca8fa4d22df3ddb2820eeb8adb73c792ac" have entirely different histories.

7 changed files with 10 additions and 64 deletions

View File

@ -1,17 +0,0 @@
<?php
namespace PluginNamespace;
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
class Install {
private static $db_updates = array(
'1.1.0' => array(
'dh_update_110_options',
),
);
}

View File

@ -6,7 +6,7 @@ if ( ! defined( 'ABSPATH' ) ) {
exit;
}
class AdminSettings {
class Settings {
/**
* Class constructor.
@ -93,4 +93,4 @@ class AdminSettings {
}
new AdminSettings();
new Settings();

View File

@ -1,18 +0,0 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Update something in the database
*
* @since 1.1.0
*
* @return void
*/
function dh_update_110_options() {
global $wpdb;
// do the thing here to update the database
}

View File

@ -26,11 +26,9 @@
},
"autoload": {
"psr-4": {
"PluginNamespace\\Admin\\": "admin/",
"PluginNamespace\\": "includes/"
},
"classmap": [
"admin/",
"includes/"
]
},

View File

@ -11,12 +11,6 @@ if ( ! defined( 'ABSPATH' ) ) {
class App {
/** @var string */
public $version = '1.0.0';
/** @var string */
public $db_version = '1.0.0';
/** @var \PluginNamespace\App */
public static $instance;
@ -42,7 +36,7 @@ class App {
* @return void
*/
public static function plugin_deactivation(): void {
error_log( 'Deactivation hook invoked.' );
//
}
/**
@ -112,9 +106,7 @@ class App {
* @return void
*/
public function scaffold_plugin(): void {
if ( is_admin() ) {
add_action( 'admin_menu', array( $this, 'add_admin_menu' ) );
}
add_action( 'admin_menu', array( $this, 'add_admin_menu' ) );
}
/**
@ -151,7 +143,7 @@ class App {
public function includes(): void {
// Files to include on the admin.
if ( is_admin() ) {
require_once NMSP_PLUGIN_BASE_DIR . '/admin/class-adminsettings.php';
require_once NMSP_PLUGIN_BASE_DIR . '/admin/class-settings.php';
}
//

View File

@ -10,7 +10,7 @@ use eftec\bladeone\BladeOne;
* @author Plugin Author
* @copyright GPL v2
* @license https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html
*
*
* @wordpress-plugin
* Plugin Name: Boilerplate Plugin v2
* Description: Your plugin description.
@ -20,7 +20,7 @@ use eftec\bladeone\BladeOne;
* Update URI: https://example.com/my-plugin/
* Version: 1.0.0
* Requires at least: 5.2
* Requires PHP: 7.3.0
* Requires PHP: 7.2
* Author: Plugin Author
* Author URI: https://plugin-author.com
* Text Domain: nmsp-plugin-name-text-domain
@ -37,14 +37,9 @@ if ( ! defined( 'ABSPATH' ) ) {
* Start at version 1.0.0 and use SemVer - https://semver.org
* Rename this for your plugin and update it as you release new versions.
*/
if ( ! defined( 'PLUGIN_NAME_VERSION' ) ) {
define( 'PLUGIN_NAME_VERSION', '1.0.0' );
}
if ( ! defined('NMSP_PLUGIN_BASE_DIR') ) {
define( 'NMSP_PLUGIN_BASE_DIR', __DIR__ );
}
define( 'PLUGIN_NAME_VERSION', '1.0.0' );
define( 'NMSP_PLUGIN_BASE_DIR', __DIR__ );
require_once __DIR__ . '/vendor/autoload.php';
require_once __DIR__ . '/bootstrap.php';
@ -59,6 +54,5 @@ $blade = new BladeOne( __DIR__ . '/templates', __DIR__ . '/cache/blade', $mode )
register_activation_hook( __FILE__, array( App::class, 'plugin_activation' ) );
register_deactivation_hook( __FILE__, array( App::class, 'plugin_deactivation' ) );
register_uninstall_hook( __DIR__ . '/uninstall.php', 'run_uninstaller' );
nmsp_plugin_app()->load_blade( $blade );

View File

@ -9,7 +9,4 @@ if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
exit;
}
function run_uninstaller() {
// Put logic here to undo things when this plugin is uninstalled.
error_log( 'Uninstall hook activated for plugin at ' . __DIR__ );
}
// Put logic here to undo things when this plugin is uninstalled.