Create and publish new Post via Python and the Wordpress REST API. This Tutorial shows all what you have to do, to publish new content with Python and Wordpr. I have a python program that is essentially a quiz, I was wondering if there is anyway to make this program run on a Wordpress page. Alexander Davison 65,446 Points Alexander Davison. Alexander Davison 65,446 Points March 4, 2017 8:24pm.
Hello,
Similar to this user’s request, I was hoping to find an example of your plugin using Python so a user can authenticate my software on their computer (unless there’s a safer way to do this). I’m not sure which address to get or how to find if a license is valid. I looked for docs here and here, but didn’t see any. I am using Python’s Requests library.Thank you!
- This topic was modified 1 year, 2 months ago by .
Python Xmlrpc
Hi everyone,
If you want to validate a key using this tool in Python, use the following method.
import requests
- This reply was modified 9 months, 2 weeks ago by .
Nice snippet @processzip I wish i had seen that before i made my wrapper lol.
I added your snippet with attribution in my pylicensemanager which is opensource.
The the code has an option to generate uuid and to send that back in json response too. We just need the plugin to accept this by default and consider it valid on the validate or activate vs invalid if its activating/validating on the same uuid vs failing saying already registered.
feel free to submit pull requests
https://gitlab.com/mikeramsey/pylicensemanager
https://pypi.org/project/pylicensemanager/@drazenbebic Where do i put the filters and hooks for this?
https://www.licensemanager.at/docs/tutorials-how-to/additional-rest-api-validation/
https://www.licensemanager.at/docs/tutorials-how-to/modifying-the-rest-api-response/Also is there any documentation for the upcoming v3 api? If so please let me know would like to update the library to fully support all methods and would be nice if we can add public key signed messages which can be verified client side to confirm the response is coming from our url and signed by our public key.
Ive tried to setup the plugin and use the python requests script with the API but none of it seems to be working and i keep getting ‘There has been a critical error with your website’ when i manually use the links that im requesting using the API.
can you provide the the scripts you use with the api keys removed and example to shown. If the wordpress is showing a 500 error its possible the PHP is wrong though vs the api.
Did you add stuff into your child theme’s functions.php? If so first off your going to want to probably comment out or remove it and make sure the wordpress is not showing errors when curling the domain api.
Heres minimal example Python script. You can load in like Pycharm and run easily to test retrieving a single license key.
This should work assuming you have created a License Key and setup your rest API keys and their active and valid.
Edit the edit section with your information as applicable then run it
https://pastebin.com/pihY7Ry4Should look something like the below when valid key is run.
https://imgur.com/a/kNC04LTOnce you have confirmed the API is working then I recommend going back and trying to work with the fancy filters. I got hung up on trying to make it all work before gradually working up to what I wanted.
Only thing really left is getting it to save the uuid and nice_name from the device into the license meta. The Validate does not check if expired inactive so best option I found was to validate based off the license key full details from the retrieve license details base and add my logic from there.
Hopefully that helps you @willwinter
@mikeramsey869 I was using the script above mentioned by @processzip but ive also just tried yours and for some reason im getting the same result with the ‘critical error’ message, all ive done is install my theme and customise it and its necessary plugins, installed the license manager plugin, and created a testkey and some API credentials but it doesnt want to work, ive also tried changing the theme and disabling other plugins to see if there is some conflict but it still doesnt want to work, the only thing ive done is edit the wp-config to add define(‘LMFWC_PLUGIN_SECRET’, ‘secret.txt’); and define(‘LMFWC_PLUGIN_SECRET’, ‘defuse.txt’); aswell as a few lines to turn on debugging to see if i can see what is going wrong but that didnt work either. Im not having much luck with this plugin unfortunately, im going to keep trying to fix it but if you can give any help that would be great. am i right in how i setup the plugin; fresh install of wordpress, installed my theme, installed license manager, created a key, created api keys and then im trying to run your script using my creds and website. theres no further setting up with permalinks or anything else that needs configuring?
I then get emails through of a critical error/technical issue such as this: https://i.snipboard.io/QYRf6B.jpg
Ive spoken to EasyWP support and let them see about the issue they had some technicians at it for an hour and resulted in this: https://i.snipboard.io/67tBfu.jpg