This is a step by step instruction on how to test the REST API of Wordpress 4.4 with ALEX
- Install PHP and MySQL, e.g. via XAMPP, LAMPP etc
- Install Wordpress 4.4
- Setup Wordpress using the admin account (see table)
- Make sure Wordpress is accessible under http://localhost/wordpress
- In the backend of Wordpress:
- Create the users as shown in the table except the admin
- Install plugin: WP API 2.0 for the REST API
- Install plugin: Basic Auth to allow authentication via HTTP header
- Install plugin: Disable Check Comment Flood to prevent HTTP 429 errors on too many comments
- Delete the default post "Hello Wold" from all posts
- Delete the default page
- Delete the default comment
- Use the default theme TwentyFifteen
|username||password||role||base64 encoded username:password|
The base64 encoded combination of username and password is only required for modelling new symbols that require authentication.
- Start ALEX under a different port than 8000
- Login as a user
- Create a new project with the url http://localhost/wordpress/wp-json/wp/v2
- Import symbols from the wordpress-symbols.json
- Start learning, use symbol reset as reset symbol
Our tests with Wordpress have been executed on a computer with an quad core Intel Core i5-4670k CPU @3.40GHz, 16GB RAM and a Solid-State-Drive. It took us approximately two hours to model the symbols, which includes the familiarization with the REST API.
Wordpress has been learned with four algorithms, which are the L*, DHC, Discrimination Tree and the TTT. For each test, an equivalence oracle has been chosen that randomly creates membership queries within a predefined length. Here, we set it up to create 50 MQs with a minimum length of 25, a maximum length of 50 to approximate an equivalence query.
We modeled 19 symbols for logging in with different user roles and doing actions like creating, updating and deleting posts and handling comments. The final hypothesis has 31 states, which can be seen here.
If you are interested in numbers, here are the statistics of how well different algorithms performed on the specified system. Note that the L* algorithm didn't even terminate after more than a day, so we terminated it manually.
|DHC||4h 8min 15s||22||94104||13832||2|
|DT||2h 20min 42s||31||160850||8569||12|
|TTT||1h 31min 18s||31||109906||15322||16|
- As soon as you delete the database of ALEX or reset all counters, make sure to reset Wordpress database to its defaults, too. You can do that with the plugin Wordpress Database Reset
- For good results while learning, use the TTT algorithm in combination with the random word eq oracle (minLength=1, maxLength=50, randomWords=50)
- In the example hypothesis in the file wordpress-hypothesis.svg only symbols related to posts and users have been used.