WebDevStudios / oops-wp

A collection of abstract classes, interfaces, and traits to promote object-oriented programming practices in WordPress.
57 stars 9 forks source link

Add abstract class to define a main plugin class. #9

Closed jmichaelward closed 5 years ago

jmichaelward commented 5 years ago

In the OOPS-WP workflow, a basic plugin would have the following components:

  1. A main plugin bootstrap file: some-plugin-file.php
  2. A namespaced src/ directory with a main plugin file in root, e.g., src/SomePlugin.php
  3. Subdirectories for the various components of the plugin. For example, the plugin might register some post types and taxonomies, and may have a service to register those types under src/Content.

Following this structure, the abstract plugin would, in fact, be an extension of the ServiceRegistrar class, but we could additionally define an interface for that plugin class and, in the future, determine some methods that we think every plugin would require.

To satisfy completion of this task, a PR should include an abstract Plugin class and an interface for that class that defines a contract for a WordPress plugin.

jmichaelward commented 5 years ago

Completed and merged into develop. Closing out.