John explains how to do TDD in WordPress
GDPR is a Rube Goldberg contraption that serves no real purpose. Get it off your WordPress install!
GDPR is a European Union law which makes about as much sense as 2 + 2 = 5. Americans DO NOT have to obey GDPR. It is a violation of the 1st Amendment to the United States Constitution. This plugin removes GDPR features from WordPress. LONG LIVE FREE SPEACH!
Get it in the .org plugin repo here.
This is the tale of the incredible vanishing checkbox, on WordPress versions 4.9.6 and 4.9.8.
This annoying checkbox was forced onto every WordPress site in the world as of 4.9.6:
As soon as I saw this monster I started making a plugin to roll it back. It was obvious to me that most sites wouldn’t want this, and that it served absolutely no purpose. It comes from a misunderstanding of the law, and a desire to be clever.
There is no requirement in GDPR for websites to display a check box for cookie use. None, totally false.
Then comes out 4.9.8 which removed the check-box that was just installed!
However! This revert also breaks functionality. Users who aren’t logged in have no way now of knowing that their comment was submitted.
So the situation as of 4.9.8 is that the comment cookie check box came and went, and now everybody’s site is broken.
You can solve the problem by re-activating the comment check box in the admin SETTINGS >> DISCUSSION, but then you’ll still have the checkbox. Or use this plugin to restore functionality to the way it was.
How to find the best WordPress plugins
******** Recommend and install a WordPress plugin *********
I want to install a WordPress plugin, but I’m not sure exactly which one I should use.
Give me a very brief overview of what WordPress plugin(s) I should use, how much it will cost me (if anything), and what functionality it has. I’m not looking for a comprehensive overview of WordPress plugins, I’m looking for a specific plugin and someone who can execute installing it. You don’t need to submit credentials or previous projects, just know how to use the plugin you recommend and be able to install and set up the functionality.
Submit a simple text entry describing what plugin I should use, and you’re contact information. I will provide you with access. This is a guaranteed contest.
Functionality I need:
Using the –env flag in Codeception. Running tests against multiple versions of WordPress.
Suppose you want to run your test suite against multiple environments? Perhaps with different browsers or with different versions of WordPress or PHP? Codeception makes this easy with the –env flag.
This is a plugin I made that rolls back a new feature added to WordPress 4.9. I want to run an acceptance test against the latest version of WordPress, and also against a legacy version of WordPress.
Setup multiple environments
I use an Ubuntu laptop with apache2. Your mileage will vary. When I develop a website, say site.com, I setup my laptop to redirect site.dev to a local directory on my laptop. There I keep a copy of the production site to work on.
On my machine, I setup two distinct WordPress installs, one at http://localhost and the other at http://wp.dev. One running version 4.9 and the other running version 3.9.
In this example, I’ll be running an acceptance test against both versions of WordPress. I’ll need to setup the YML file like this:
I use this command:
bin/codecept run acceptance -vvv --html --env remotehost --env localhost
bin/codecept is the executable [might be wpcept or codecept]
acceptance is the suite
remotehost and localhost are the envs
-vvv very very verbose [one dash]
–html report to html [two dashes]
WordPress Plugin: Change Admin Email Setting Without Outbound Email
As of WordPress 4.9, the administrator cannot change the site admin email without outgoing email setup on the server, and recipient email credentials. This plugin restores the admin’s ability to change this setting without sending a confirmation email.
As a bonus, for developers I’m distributing some BDD Codeception tests with this plugin. The tests are designed to run via the WordPress module from Codeception. To run them, you’ll need composer, selenium, and chrome. To pull the framework, use the instructions here.
When building this, I used TDD / BDD by creating an acceptance test that worked on v3.9 so that I could run the same test against v4.9. This is overkill, but I wanted to show how to run tests against different environments.
I will help you build a WordPress plugin – 100% for free – in exchange for letting me blog about the experience.
I’m John Dee – an expert WordPress plugin developer. I am going to be making 7 WordPress plugins for business stakeholders using my Behavior Driven Development / Test Driven Development method. This is an attempt to write a book on WordPress plugin development. I’m looking for business partners who wish to get involved.
Using BDD / TDD, I can decimate production costs and increase quality for WordPress plugin development. Rough guess, I can reduce costs by 90% at most enterprises.
- A WordPress plugin made for you, which you then own, 100%.
- A development work-flow for your own team to use in the future.
- A comparison of your current work flow to other small and medium sized development teams. [Except any proprietary information]
- You must come up with an IDEA for a WordPress plugin. That’s mostly it.
- You have to pay for programmers. I am a developer – I am an expert programmer who manages other programmers [usually lower skilled, lower paid programmers, but I love working with experts too!]. If you are running an Agile team already, great! If you’re a one man shop, great! If you already have programmers or developers, great! This might be a very large cost, or a very small cost, but I promise it will be cheaper by an exponential factor than you can do on your own. Again, I will receive zero percent of this, and I’m not shilling for someone else. I prefer outsourcers, but if you already employ human beings who know PHP, great let’s use them!
- This is for WordPress plugins! Business scripting [which is perfect for WordPress], PHP APIs in general, WP-API, PHP SPAs with WP backend etc.
- This is for backend plugin development, not frontend theme design. Not content, not hosting – although I’ll throw in development hosting if you want it. I use dev servers on AWS, which are nearly free.
- Assuming this is a business project, you will have to provide for all aspects of your project not specifically related to development. [i.e. if there is a marketing component to your project, you’ll need to manage that.]
- One of the main points I’m trying to develop is the ability to work remotely. All work is done via Skype.
- I will provide development servers. I use
cloud based development servers on Amazon AWS domain with some garbage like ec2-34-197-124-101.compute-1.amazonaws.com The main obstacle to doing WordPress BDD is setting up the frameworks. It’s really hard.
That’s what I bring.
- Code is stored on Github or Bitbucket. If you require a firewall, no problem. I make everything compatible on any site, so I don’t need access to your production servers. You can do that.
- I am doing semi strict TDD / BDD. Programmers DO NOT NEED TO UNDERSTAND TDD IN ADVANCE.
- I’m doing modified pair programming. I monitor the programmers and direct how they write the code. I generally check in every hour with them. This preserves my brain to take a higher level view of the project while the programmer can work doggedly on the smaller scale without worrying about the higher live architecture.
- Toolkit is 100% open source, Codeception with WordPress module [PHPUnit etc.]
Contact John Dee to get involved.
p. (702)748-5491 [call or text]
A feature from the biz perspective
What is a feature?
A feature is any aspect of your software that is useful to you. Anything you can express, that is possible, and that you an afford, can be a feature. A bug is a feature that isn’t useful.
Since we’re talking about development, we’re discussing software features that don’t exist yet, that we’d like to build [or existing features we’d like to make better]. Often we can describe these things with should statements:
- It should email all the clients once a month.
- It should have a setting page in the admin area.
- It should have a custom post type called GPS coordinates for each subscriber.
- It should show a timeline of Civil War battles in the footer area.
The bottom line, at some point you have to have a conception of what you want in your mind. This thing is called a feature, and it’s what you want your developer to build you.
The Domain Name System [DNS] is the system a browser uses to resolve domain names like
generalchicken.net to IP addresses like
18.104.22.168. A server connected to the internet generally has one IP address, usually one main domain, but it can also have many subdomains. For instance, this server hosts the domains generalchicken.net and another blog, messagetothefish.com. Both have the same IP address, but different domain names.
When an HTTP or HTTPS request is sent to the server, the request should include the host header which indicates to the server what domain a resonse is expected from. A browser like Chrome or Firefox does this automatically for the user.
Internally, once the request is received by the server, a web server, like Apache, sends each request to a particular directory, based on what subdomain is named in the host header. From there, a file is activated, and in our case, passed to the PHP parser. For WordPress, it is called
index.php. On most Ubuntu WordPress setups, the main domain root directory is usually set to:
and subdomains go from there:
These are the directories [for their respective domains], which will contain the WordPress root files, especially the index.php, the wp-config.php files, and the other directories like:
Understanding this is important because if you are setting up a local development version of WordPress, you are going to want to be able to set subdomains up. Normally, you’ll have a sepearte
wp-config.php file for each domain, specifying which database the domain points to.
The default setup on Ubuntu, is for the domain
localhost to point to
//var/www/html . Therefore, to access your local WordPress site, open a browser like Chrome, and got to
http://localhost/ and you should get the WordPress install screen.
Another consideration is that most forms of testing work the best when you don’t have any state. That is, the database is either reset to a starting point, or totally scrubbed after each test. If you’re not used to this, you may accidentally delete anything you have on your site, especially if you’re using it for anything.
My personal setup is that I use
http://localhost/ for unit testing, and I have another WordPress install, called
http://laptop.dev/ where I have a database that doesn’t reset.
Directions: Setting up virtual hosts on Ubuntu 16.04 LTS.
|WP Acceptance tests||carries from test to test||assumed headfull JS browser [ie. Selenium with Chrome]||not reset after each test||entire WP application executed with each browser call|
|Stateless acceptance tests||tests run in isolation||assumed headless JS browser [ie. PhantomJS]||reset after each test||entire WP application executed with each browser call|
|WP Unit tests||tests run in isolation||assume no browser or only cURL||reset after each test||WP application NOT executed|
|WP API tests||tests run in isolation||cURL only||reset after each test||WP application is executed|