aubreypwd / wpkickstart Goto Github PK
View Code? Open in Web Editor NEWA great way to kickstart a new WordPress plugin or project.
A great way to kickstart a new WordPress plugin or project.
Because I've been working with https://github.com/WebDevStudios/oops-wp a lot more I think I would be more inclined to probably use that to spin up new things going forward, or at least take a more holistic approach...
So because of my recent developments with that, and our official use of it at WebDevStudios, I may be closing wpkickstart out!
[14-Oct-2017 19:23:43 UTC] PHP Fatal error: Uncaught Error: Class 'aubreypwd\CampDavid\Shared' not found in /app/public/wp-content/plugins/camp-david/includes/class-app.php:132
Stack trace:
#0 /app/public/wp-content/plugins/camp-david/includes/class-app.php(76): aubreypwd\CampDavid\App->attach()
#1 /app/public/wp-content/plugins/camp-david/camp-david.php(42): aubreypwd\CampDavid\App->__construct('/app/public/wp-...')
#2 /app/public/wp-content/plugins/camp-david/camp-david.php(59): aubreypwd\CampDavid\app()
#3 /app/public/wp-admin/includes/plugin.php(560): include_once('/app/public/wp-...')
#4 /app/public/wp-admin/plugins.php(42): activate_plugin('camp-david/camp...', 'http://campdavi...', false)
#5 {main}
thrown in /app/public/wp-content/plugins/camp-david/includes/class-app.php on line 132
[14-Oct-2017 19:23:43 UTC] PHP Fatal error: Uncaught Error: Class 'aubreypwd\CampDavid\Shared' not found in /app/public/wp-content/plugins/camp-david/includes/class-app.php:132
Stack trace:
#0 /app/public/wp-content/plugins/camp-david/includes/class-app.php(76): aubreypwd\CampDavid\App->attach()
#1 /app/public/wp-content/plugins/camp-david/camp-david.php(42): aubreypwd\CampDavid\App->__construct('/app/public/wp-...')
#2 /app/public/wp-content/plugins/camp-david/camp-david.php(59): aubreypwd\CampDavid\app()
#3 /app/public/wp-admin/includes/plugin.php(1882): include('/app/public/wp-...')
#4 /app/public/wp-admin/plugins.php(164): plugin_sandbox_scrape('camp-david/camp...')
#5 {main}
thrown in /app/public/wp-content/plugins/camp-david/includes/class-app.php on line 132
[14-Oct-2017 19:23:43 UTC] PHP Fatal error: Uncaught Error: Class 'aubreypwd\CampDavid\Shared' not found in /app/public/wp-content/plugins/camp-david/includes/class-app.php:132
Stack trace:
#0 /app/public/wp-content/plugins/camp-david/includes/class-app.php(76): aubreypwd\CampDavid\App->attach()
#1 /app/public/wp-content/plugins/camp-david/camp-david.php(42): aubreypwd\CampDavid\App->__construct('/app/public/wp-...')
#2 /app/public/wp-content/plugins/camp-david/camp-david.php(59): aubreypwd\CampDavid\app()
#3 /app/public/wp-admin/includes/plugin.php(1882): include('/app/public/wp-...')
#4 /app/public/wp-admin/plugins.php(164): plugin_sandbox_scrape('camp-david/camp...')
#5 {main}
thrown in /app/public/wp-content/plugins/camp-david/includes/class-app.php on line 132
The includes/
folder in this structure really only have to do with the App now. We need to also make this backwards compatible a bit, so that we still load includes (enhance autoloader more lol).
Right now all composer packages are installed in /vendor
. But features can have their own composer package dependancies and those don't need to go in /vendor
at the root. E.g.:
In this example one of the features has it's own composer dependances.
Let's make sure the root composer.json
also installs those by looping through the folders looking for composer.json
and running pre/post install/update commands in those folders too.
https://github.com/aubreypwd/wp-plugin-boilerplate/blob/master/plugin-name.php#L24
Putting $app
out in the global space does in fact make it global (not to the namespace). What that ends up doing is colliding with other plugins built on this structure. It needs to go in a static variable in the app()
function. Or, it needs to be unique.
$app
as static var in app()
The second task above is so that you can use the below method to get to the app object:
global $app;
$app->thing->action();
Classes in features/
should have a run method. The App
class should run these automatically when they are attached to the base app.
I think this would just be a sub-module for the wiki?
composer update
With 2.2.0
and all the things we've done tests may not be working, let's beef those up!
Here, if you create a class like, Edit_Posts
you have to create a file like class-edit_posts.php
which should be class-edit-posts.php
.
$file = 'class-' . strtolower( str_replace( '_', '-', end( $parts ) ) ) . '.php';
...is better.
Right now we load a component library, let's work on making components individually installable. But also make the wpkickstart-components
just be an easy JSON library of where they are?
I don't know if cli does an interactive mode, but would be cool to install the plugin, activate it (as is), and run wp kickstart
and it start asking you for replacements to make.
replace.php
methodThis was an idea given to me by a coworker, e.g.:
feature-name/
assets/
js/
css/
class-feature-name.php
vendor/
The idea is that the folder feature-name
could be moved around to other plugins using this same platform. E.g. bug-spray
could be easily added to another project just by copying the folder (which has all it's things) to the plugin on another projects and loaded into the class-app.php
and run it's hooks/etc.
Maybe hooks could be auto loaded now which would do all the things.
I, simply, should be able to write SASS. And when I save it a .css version of it is made so I can enque it.
Writing ES6 takes a great deal of work to get it to work in ES5 browers, etc. I know there are ways to write ES6 code and transpile it down to ES5 for other browsers. Let's make it really easy to write ES6 yet enqueue ES5 versions of it.
Details to come after I get a solution in place, but basically in constructs calling app() gets a max-depth issue.
The way you are supposed to build features/components out is that each component should work somewhat independent of one another. Pulling in another component into another creates a dependencies between the two.
So the way I've been doing it is that there is always a conductor of sorts that connects all the components together and is usually the base feature class that does it, and this is usually what builds out the main feature of the component....
E.g. in a component called example
it's class-example.php
that does the conducting and uses the various other components creating a dependency with most other components.
All this said, I'd like a way to identify it as so somehow. Idea(s):
components/conductor/class-conductor.php
The attachment would look like:
new Conductor()
This doesn't make sense actually because you could have many conductors, maybe we do:
components/
and features/
folders. features/
do the conducting (maybe name conductors/
?) and use the components/
which have less dependencies.I LIKE THIS!
Will have impact on #7
Why make the user attach a service, we can auto-attach these.
The autoloader needs to be even smarter.
If I make a e.g. new Class()
that isn't attached to App
I should be able to do it. Only detected feature classes and detected includes (which usually only have to do with the app infrastructure) are autoloaded from App.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.