-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8503e36
commit 40b5e35
Showing
16 changed files
with
578 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_size = 2 | ||
indent_style = space | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
indent_size = 4 | ||
indent_style = space | ||
trim_trailing_whitespace = false | ||
|
||
[*.php] | ||
indent_size = 4 | ||
indent_style = tab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"name": "[composer_vendor]/[composer_name]", | ||
"description": "[plugin_description]", | ||
"type": "wordpress-plugin", | ||
"keywords": ["wordpress", "plugin"], | ||
"homepage": "[plugin_url]", | ||
"license": "GPL-2.0+", | ||
"require": { | ||
"composer/installers": "~1.0", | ||
"php": ">=5.6" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "*@stable", | ||
"10up/wp_mock": "@dev" | ||
}, | ||
"authors": [], | ||
"support": { | ||
"issues": "", | ||
"source": "" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"[autoload_psr_4]": "lib/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"[autoload_tests_psr_4]": "tests/" | ||
} | ||
}, | ||
"minimum-stability": "stable", | ||
"config": { | ||
"sort-packages": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<?php // Silence is golden. |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
/** | ||
* Fired during plugin activation | ||
* | ||
* @link [plugin_url] | ||
* | ||
* @package [vendor_name] | ||
* @since [plugin_initial_version] | ||
*/ | ||
|
||
namespace [namespace]; | ||
|
||
/** | ||
* Fired during plugin activation. | ||
* | ||
* This class defines all code necessary to run during the plugin's activation. | ||
* | ||
* @since [plugin_initial_version] | ||
*/ | ||
class Activator { | ||
|
||
/** | ||
* Summary. (use period) | ||
* | ||
* Description. (use period) | ||
* | ||
* @since [plugin_initial_version] | ||
*/ | ||
public static function activate() { | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
/** | ||
* Fired during plugin deactivation | ||
* | ||
* @link [plugin_url] | ||
* | ||
* @package [vendor_name] | ||
* @since [plugin_initial_version] | ||
*/ | ||
|
||
namespace [namespace]; | ||
|
||
/** | ||
* Fired during plugin deactivation. | ||
* | ||
* This class defines all code necessary to run during the plugin's deactivation. | ||
* | ||
* @since [plugin_initial_version] | ||
*/ | ||
class Deactivator { | ||
|
||
/** | ||
* Summary. (use period) | ||
* | ||
* Description. (use period) | ||
* | ||
* @since [plugin_initial_version] | ||
*/ | ||
public static function deactivate() { | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<?php | ||
|
||
/** | ||
* Define the internationalization functionality | ||
* | ||
* Loads and defines the internationalization files for this plugin | ||
* so that it is ready for translation. | ||
* | ||
* @link [plugin_url] | ||
* | ||
* @package [vendor_name] | ||
* @since [plugin_initial_version] | ||
*/ | ||
|
||
namespace [namespace]; | ||
|
||
/** | ||
* Define the internationalization functionality. | ||
* | ||
* Loads and defines the internationalization files for this plugin | ||
* so that it is ready for translation. | ||
* | ||
* @since [plugin_initial_version] | ||
*/ | ||
class I18n { | ||
|
||
/** | ||
* The domain specified for this plugin. | ||
* | ||
* @since [plugin_initial_version] | ||
* @access private | ||
* @var string $domain The domain identifier for this plugin. | ||
*/ | ||
private $domain; | ||
|
||
/** | ||
* Load the plugin text domain for translation. | ||
* | ||
* @since [plugin_initial_version] | ||
*/ | ||
public function load_plugin_textdomain() { | ||
\load_plugin_textdomain( | ||
$this->domain, | ||
false, | ||
dirname( dirname( \plugin_basename( __FILE__ ) ) ) . '/languages/' | ||
); | ||
} | ||
|
||
/** | ||
* Set the domain equal to that of the specified domain. | ||
* | ||
* @since [plugin_initial_version] | ||
* | ||
* @param string $domain The domain that represents the locale of this plugin. | ||
*/ | ||
public function set_domain( $domain ) { | ||
$this->domain = $domain; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
<?php | ||
|
||
/** | ||
* The file that defines the core plugin class | ||
* | ||
* A class definition that includes attributes and functions used across both | ||
* the public-facing side of the site and the dashboard. | ||
* | ||
* @link [plugin_url] | ||
* | ||
* @package [vendor_name] | ||
* @since [plugin_initial_version] | ||
*/ | ||
|
||
namespace [namespace]; | ||
|
||
/** | ||
* The core plugin class. | ||
* | ||
* This is used to define internationalization, dashboard-specific hooks, and | ||
* public-facing site hooks. | ||
* | ||
* Also maintains the unique identifier of this plugin as well as the current | ||
* version of the plugin. | ||
* | ||
* @since [plugin_initial_version] | ||
*/ | ||
class Plugin { | ||
|
||
/** | ||
* The unique identifier of this plugin. | ||
* | ||
* @since [plugin_initial_version] | ||
* @access protected | ||
* @var string $pluginname The string used to uniquely identify this | ||
* plugin. | ||
*/ | ||
protected $name; | ||
|
||
/** | ||
* The current version of the plugin. | ||
* | ||
* @since [plugin_initial_version] | ||
* @access protected | ||
* @var string $version The current version of the plugin. | ||
*/ | ||
protected $version; | ||
|
||
/** | ||
* Define the core functionality of the plugin. | ||
* | ||
* Create an instance of the loader which will be used to register the hooks | ||
* with WordPress. | ||
* | ||
* @since [plugin_initial_version] | ||
* | ||
* @param string $name The plugin identifier. | ||
* @param string $version Current version of the plugin. | ||
*/ | ||
public function __construct( $name, $version ) { | ||
$this->name = $name; | ||
$this->version = $version; | ||
} | ||
|
||
/** | ||
* Run the loader to execute all the hooks with WordPress. | ||
* | ||
* Load the dependencies, define the locale, and set the hooks for the | ||
* Dashboard and the public-facing side of the site. | ||
* | ||
* @since [plugin_initial_version] | ||
*/ | ||
public function run() { | ||
$this->set_locale(); | ||
} | ||
|
||
/** | ||
* The name of the plugin used to uniquely identify it within the context of | ||
* WordPress and to define internationalization functionality. | ||
* | ||
* @since [plugin_initial_version] | ||
* | ||
* @return string The name of the plugin. | ||
*/ | ||
public function get_plugin_name() { | ||
return $this->name; | ||
} | ||
|
||
/** | ||
* Returns the version number of the plugin. | ||
* | ||
* @since [plugin_initial_version] | ||
* | ||
* @return string The version number of the plugin. | ||
*/ | ||
public function get_version() { | ||
return $this->version; | ||
} | ||
|
||
/** | ||
* Define the locale for this plugin for internationalization. | ||
* | ||
* Uses the I18n class in order to set the domain and to register the hook | ||
* with WordPress. | ||
* | ||
* @since [plugin_initial_version] | ||
* @access private | ||
*/ | ||
private function set_locale() { | ||
$plugin_i18n = new I18n(); | ||
$plugin_i18n->set_domain( $this->get_plugin_name() ); | ||
$plugin_i18n->load_plugin_textdomain(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<?php // Silence is golden. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0"?> | ||
<ruleset name="wp-seed-plugin"> | ||
<description>WP-Seed Plugin standards for WordPress.</description> | ||
|
||
<exclude-pattern>*/phpunit.xml*</exclude-pattern> | ||
<exclude-pattern>*/languages/*</exclude-pattern> | ||
<exclude-pattern>*/tests/*</exclude-pattern> | ||
|
||
<exclude-pattern>*/node_modules/*</exclude-pattern> | ||
<exclude-pattern>*/vendor/*</exclude-pattern> | ||
|
||
<!-- Yoda conditions, we must ignore --> | ||
<rule ref="WordPress.PHP.YodaConditions.NotYoda"> | ||
<severity>0</severity> | ||
</rule> | ||
|
||
<!-- Ignore lowercase filenames --> | ||
<rule ref="Generic.Files.LowercasedFilename.NotFound"> | ||
<severity>0</severity> | ||
</rule> | ||
|
||
<rule ref="WordPress-Extra" /> | ||
</ruleset> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<phpunit | ||
bootstrap="test/phpunit/bootstrap.php" | ||
backupGlobals="false" | ||
colors="true" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
> | ||
<testsuites> | ||
<testsuite> | ||
<directory suffix=".test.php">./test/phpunit/</directory> | ||
</testsuite> | ||
</testsuites> | ||
<filter> | ||
<blacklist> | ||
<directory suffix=".php">./vendor/</directory> | ||
</blacklist> | ||
</filter> | ||
</phpunit> |
Oops, something went wrong.