Skip to content

Commit

Permalink
Refactored naming to be one pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisChasm committed Jan 28, 2021
1 parent 1c4a4c8 commit 7c3ce26
Show file tree
Hide file tree
Showing 18 changed files with 115 additions and 113 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ If you are working on a plugin based off our starter plugin run `./includes/admi

You might need to run `composer install` first.

Note: rules for PHPCS are located in the `phpcs.xml` file. We sometimes update the rule list as PHPCS updates. We’ll update the [starter plugin](https://github.com/DiscipleTools/disciple-tools-starter-plugin) `phpcs.xml`, you might want to look there to get the latest version.
Note: rules for PHPCS are located in the `phpcs.xml` file. We sometimes update the rule list as PHPCS updates. We’ll update the [starter plugin](https://github.com/DiscipleTools/disciple-tools-plugin-starter-template) `phpcs.xml`, you might want to look there to get the latest version.

### GitHub and Commits
For new plugins copy our [starter plugin](https://github.com/DiscipleTools/disciple-tools-starter-plugin).
For new plugins copy our [starter plugin](https://github.com/DiscipleTools/disciple-tools-plugin-starter-template).

To commit to the theme or an existing plugin start by creating a fork of the repository. When you are ready, create a pull request into our repo.

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Disciple Tools - Starter Plugin
Disciple Tools - Plugin Starter

Copyright (C) 2018 by various contributors

Expand Down
10 changes: 5 additions & 5 deletions README-SAMPLE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Build Status](https://travis-ci.com/DiscipleTools/disciple-tools-starter-plugin-template.svg?branch=master)](https://travis-ci.com/DiscipleTools/disciple-tools-starter-plugin-template)
[![Build Status](https://travis-ci.com/DiscipleTools/disciple-tools-plugin-starter-template.svg?branch=master)](https://travis-ci.com/DiscipleTools/disciple-tools-plugin-starter-template)

# Disciple Tools - Name

Expand Down Expand Up @@ -38,11 +38,11 @@ Purpose purpose purpose purpose purpose purpose purpose purpose purpose purpose
## Contribution

Contributions welcome. You can report issues and bugs in the
[Issues](https://github.com/DiscipleTools/disciple-tools-starter-plugin-template/issues) section of the repo. You can present ideas
in the [Discussions](https://github.com/DiscipleTools/disciple-tools-starter-plugin-template/discussions) section of the repo. And
code contributions are welcome using the [Pull Request](https://github.com/DiscipleTools/disciple-tools-starter-plugin-template/pulls)
[Issues](https://github.com/DiscipleTools/disciple-tools-plugin-starter-template/issues) section of the repo. You can present ideas
in the [Discussions](https://github.com/DiscipleTools/disciple-tools-plugin-starter-template/discussions) section of the repo. And
code contributions are welcome using the [Pull Request](https://github.com/DiscipleTools/disciple-tools-plugin-starter-template/pulls)
system for git. For a more details on contribution see the
[contribution guidelines](https://github.com/DiscipleTools/disciple-tools-starter-plugin-template/blob/master/CONTRIBUTING.md).
[contribution guidelines](https://github.com/DiscipleTools/disciple-tools-plugin-starter-template/blob/master/CONTRIBUTING.md).


## Screenshots
Expand Down
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![Build Status](https://travis-ci.com/DiscipleTools/disciple-tools-starter-plugin-template.svg?branch=master)](https://travis-ci.com/DiscipleTools/disciple-tools-starter-plugin-template)
[![Build Status](https://travis-ci.com/DiscipleTools/disciple-tools-plugin-starter-template.svg?branch=master)](https://travis-ci.com/DiscipleTools/disciple-tools-plugin-starter-template)

# Disciple Tools - Starter Plugin Template
# Disciple Tools - Plugin Starter Template

__Kick start your Disciple.Tools plugin project with this template!__

Expand Down Expand Up @@ -30,7 +30,7 @@ __This plugin is for developers__ who want to extend the Disciple.Tools system f
1. Wordpress code style requirements. ```phpcs.xml```
1. PHP Code Sniffer support (composer) @use ```/vendor/bin/phpcs``` and ```/vendor/bin/phpcbf```
1. Travis Continuous Integration ([travis-ci.com](https://travis-ci.com)). ```travis.yml```
1. Disciple.Tools Theme presence check. ```dt_starter_plugin()```
1. Disciple.Tools Theme presence check. ```dt_plugin_starter()```
1. Remote upgrade system for ongoing updates outside the Wordpress Directory.
1. Multilingual support. ```/languages``` & ```default.pot```

Expand All @@ -41,6 +41,7 @@ __This plugin is for developers__ who want to extend the Disciple.Tools system f
1. Sample metrics chart, javascript, and REST api.
1. Sample REST api.
1. Sample site-to-site link hooks.
1. Sample custom tile code.

## Recommended

Expand All @@ -50,11 +51,11 @@ __This plugin is for developers__ who want to extend the Disciple.Tools system f
## Contribution

Contributions welcome. You can report issues and bugs in the
[Issues](https://github.com/DiscipleTools/disciple-tools-starter-plugin-template/issues) section of the repo. You can present ideas
in the [Discussions](https://github.com/DiscipleTools/disciple-tools-starter-plugin-template/discussions) section of the repo. And
code contributions are welcome using the [Pull Request](https://github.com/DiscipleTools/disciple-tools-starter-plugin-template/pulls)
[Issues](https://github.com/DiscipleTools/disciple-tools-plugin-starter-template/issues) section of the repo. You can present ideas
in the [Discussions](https://github.com/DiscipleTools/disciple-tools-plugin-starter-template/discussions) section of the repo. And
code contributions are welcome using the [Pull Request](https://github.com/DiscipleTools/disciple-tools-plugin-starter-template/pulls)
system for git. For a more details on contribution see the
[contribution guidelines](https://github.com/DiscipleTools/disciple-tools-starter-plugin-template/blob/master/CONTRIBUTING.md).
[contribution guidelines](https://github.com/DiscipleTools/disciple-tools-plugin-starter-template/blob/master/CONTRIBUTING.md).

## Screenshots

Expand Down
29 changes: 15 additions & 14 deletions admin/admin-menu-and-tabs.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@
if ( ! defined( 'ABSPATH' ) ) { exit; } // Exit if accessed directly

/**
* Class DT_Starter_Plugin_Menu
* Class DT_Plugin_Starter_Menu
*/
class DT_Starter_Plugin_Menu {
class DT_Plugin_Starter_Menu {

public $token = 'dt_starter_plugin';
public $token = 'dt_plugin_starter';

private static $_instance = null;

/**
* DT_Starter_Plugin_Menu Instance
* DT_Plugin_Starter_Menu Instance
*
* Ensures only one instance of DT_Starter_Plugin_Menu is loaded or can be loaded.
* Ensures only one instance of DT_Plugin_Starter_Menu is loaded or can be loaded.
*
* @since 0.1.0
* @static
* @return DT_Starter_Plugin_Menu instance
* @return DT_Plugin_Starter_Menu instance
*/
public static function instance() {
if ( is_null( self::$_instance ) ) {
Expand Down Expand Up @@ -45,7 +45,7 @@ public function __construct() {
*/
public function register_menu() {
add_menu_page( 'Extensions (DT)', 'Extensions (DT)', 'manage_dt', 'dt_extensions', [ $this, 'extensions_menu' ], 'dashicons-admin-generic', 59 );
add_submenu_page( 'dt_extensions', 'Starter Plugin', 'Starter Plugin', 'manage_dt', $this->token, [ $this, 'content' ] );
add_submenu_page( 'dt_extensions', 'Plugin Starter', 'Plugin Starter', 'manage_dt', $this->token, [ $this, 'content' ] );
}

/**
Expand Down Expand Up @@ -73,7 +73,7 @@ public function content() {

?>
<div class="wrap">
<h2>Starter Plugin</h2>
<h2>Plugin Starter</h2>
<h2 class="nav-tab-wrapper">
<a href="<?php echo esc_attr( $link ) . 'general' ?>"
class="nav-tab <?php echo esc_html( ( $tab == 'general' || !isset( $tab ) ) ? 'nav-tab-active' : '' ); ?>">General</a>
Expand All @@ -83,11 +83,11 @@ class="nav-tab <?php echo esc_html( ( $tab == 'general' || !isset( $tab ) ) ? 'n
<?php
switch ($tab) {
case "general":
$object = new DT_Starter_Tab_General();
$object = new DT_Plugin_Starter_Tab_General();
$object->content();
break;
case "second":
$object = new DT_Starter_Tab_Second();
$object = new DT_Plugin_Starter_Tab_Second();
$object->content();
break;
default:
Expand All @@ -100,11 +100,12 @@ class="nav-tab <?php echo esc_html( ( $tab == 'general' || !isset( $tab ) ) ? 'n
<?php
}
}
DT_Plugin_Starter_Menu::instance();

/**
* Class DT_Starter_Tab_General
* Class DT_Plugin_Starter_Tab_General
*/
class DT_Starter_Tab_General {
class DT_Plugin_Starter_Tab_General {
public function content() {
?>
<div class="wrap">
Expand Down Expand Up @@ -179,9 +180,9 @@ public function right_column() {


/**
* Class DT_Starter_Tab_Second
* Class DT_Plugin_Starter_Tab_Second
*/
class DT_Starter_Tab_Second {
class DT_Plugin_Starter_Tab_Second {
public function content() {
?>
<div class="wrap">
Expand Down
6 changes: 3 additions & 3 deletions charts/charts-loader.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
if ( !defined( 'ABSPATH' ) ) { exit; } // Exit if accessed directly.

class DT_Starter_Charts
class DT_Plugin_Starter_Charts
{
private static $_instance = null;
public static function instance(){
Expand All @@ -14,12 +14,12 @@ public static function instance(){
public function __construct(){

require_once( 'one-page-chart-template.php' );
new DT_Starter_Chart_Template();
new DT_Plugin_Starter_Chart_Template();

/**
* @todo add other charts like the pattern above here
*/

} // End __construct
}
DT_Starter_Charts::instance();
DT_Plugin_Starter_Charts::instance();
6 changes: 3 additions & 3 deletions charts/one-page-chart-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
* @todo also rename in charts-loader.php
*/

class DT_Starter_Chart_Template extends DT_Metrics_Chart_Base
class DT_Plugin_Starter_Chart_Template extends DT_Metrics_Chart_Base
{
public $base_slug = 'dt-starter-metrics'; // lowercase
public $base_title = "Starter Plugin Metrics";
public $base_slug = 'dt-plugin-starter-metrics'; // lowercase
public $base_title = "Plugin Starter Metrics";

public $title = 'Template';
public $slug = 'template'; // lowercase
Expand Down
Loading

0 comments on commit 7c3ce26

Please sign in to comment.