{"id":18657631,"url":"https://github.com/cr0hn/woocommerce-subscription-check","last_synced_at":"2026-04-28T18:04:32.504Z","repository":{"id":69044051,"uuid":"131982281","full_name":"cr0hn/woocommerce-subscription-check","owner":"cr0hn","description":"Check user subscriptions in Woocommerce without have and admin role","archived":false,"fork":false,"pushed_at":"2020-05-27T08:51:47.000Z","size":17,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-18T00:40:09.409Z","etag":null,"topics":["security","woocommerce","woocommerce-api","woocommerce-subscriptions","wordpress"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cr0hn.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["cr0hn"]}},"created_at":"2018-05-03T10:55:37.000Z","updated_at":"2024-01-19T10:25:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"43a04559-fa14-4070-b6c6-46313140fdae","html_url":"https://github.com/cr0hn/woocommerce-subscription-check","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cr0hn/woocommerce-subscription-check","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cr0hn%2Fwoocommerce-subscription-check","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cr0hn%2Fwoocommerce-subscription-check/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cr0hn%2Fwoocommerce-subscription-check/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cr0hn%2Fwoocommerce-subscription-check/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cr0hn","download_url":"https://codeload.github.com/cr0hn/woocommerce-subscription-check/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cr0hn%2Fwoocommerce-subscription-check/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32392315,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T14:34:11.604Z","status":"ssl_error","status_checked_at":"2026-04-28T14:32:37.009Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["security","woocommerce","woocommerce-api","woocommerce-subscriptions","wordpress"],"created_at":"2024-11-07T07:29:17.829Z","updated_at":"2026-04-28T18:04:32.487Z","avatar_url":"https://github.com/cr0hn.png","language":"Python","funding_links":["https://github.com/sponsors/cr0hn"],"categories":[],"sub_categories":[],"readme":"WooCommerce Subscription Checker\n================================\n\n+----------------+-----------------------------------------------------------------+\n|Current version | 1.0                                                             |\n+----------------+-----------------------------------------------------------------+\n|Project site    | https://github.com/cr0hn/woocommerce-subscription-check         |\n+----------------+-----------------------------------------------------------------+\n|Issues          | https://github.com/cr0hn/woocommerce-subscription-check/issues/ |\n+----------------+-----------------------------------------------------------------+\n|Python versions | 3.6 or above                                                    |\n+----------------+-----------------------------------------------------------------+\n\nSupport this project\n====================\n\nSupport this project (to solve issues, new features...) by applying the Github \"Sponsor\" button.\n\nMotivations\n===========\n\nWoocommerce doesn't allow to check the user subscriptions (or any other data) from the Wordpress API without being an admin user.\n\nThis means that if a regular user want to check their subscriptions, products or something else, it need to be an admin role. And, in non-secure scenarios, this is not good idea, i.e: in the browser through Javascript\n\nWhat that project does?\n=======================\n\nThis project exposes non-privileged API and allow to regular users to check their subscription, without the need to have an admin role.\n\nRequirements\n============\n\nYou must install in your Wordpress the plugins:\n\n- JWT Authentication for WP-API\n- WP REST API\n- Disable REST API and Require JWT (Recommendable)\n\n**IMPORTANT**\n\nBe careful with JWT plugin. Ensure you follow these steps, in the same order:\n\n1 - Add to wp-config.php\n------------------------\n\nAdd these lines in your wp-config.php:\n\ndefine('JWT_AUTH_SECRET_KEY', 'your-top-secrect-key');\ndefine('JWT_AUTH_CORS_ENABLE', true);\n\n**IT'S MORE IMPORTANT** to add these lines just before the definition of AUTH_KEY, SECURE_AUTH_KEY... (https://github.com/Tmeister/wp-api-jwt-auth/issues/59)\n\n2 - Activate the plugin\n-----------------------\n\nAfter you add the data from step 1, then activate the plugin.\n\nEnvironment vars\n================\n\n- LISTEN_ADDR (default: 127.0.0.1)\n- LISTEN_PORT (default: 9000)\n- API_PREFIX (default: v1)\n- LOG_LEVEL (default: 1)\n- SENTRY_DSN (default: None)\n- REDIS_HOST (default: 127.0.0.1)\n- REDIS_PORT (default: 6379)\n- REDIS_DB (default: 1)\n- SCHEME (default: https)\n- DOMAIN: **Mandatory**\n- ADMIN_ROLE_USER: **Mandatory**\n- ADMIN_ROLE_PASSWORD: **Mandatory**\n\n\nUsing Docker\n============\n\n.. code-block:: bash\n\n    \u003e docker run -p 9000:9000 --rm cr0hn/woocommerce-subscription-check\n\nUsing Pypi\n==========\n\n.. code-block:: bash\n\n    \u003e python3.6 -m pip install woocommerce_subscriptions_check\n\nInstalling with Sentry support:\n\n\n.. code-block:: bash\n\n    \u003e python3.6 -m pip install woocommerce_subscriptions_check[sentry]\n\n\nEnd-points\n==========\n\n/api/v1/login\n--------------\n\n**General**\n\n- Method: POST\n- Input data as JSON\n- Input value: user / password\n\n**Example request**\n\n.. code-block:: bash\n\n    \u003e curl -v -X POST http://127.0.0.1:9000/api/v1/login -d '{\"user\": \"MyUser\", \"password\": \"MyPassword\"}'\n\n**Example responses**\n\n*Authentication done*\n\n- HTTP STATUS: 200\n- Response:\n\n.. code-block:: json\n\n    {\"token\":\"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI19s82.eyJpc3MiOiJodHRwczpcL1wvd2hvaXNsZWF2aW5nLmNvbSIsImlhdCI6MTUyMzQ0ODQxMSwibmJmIjoxNTIzNDQ4NDExLCJleHAiOjE1MjQwNTMyMTEsImRhdGEiOnsidXNlciI6eyJpZCI6IjIifX19.bu8ChmreEqDt5wwACSB5L_-8V9hHPRzJI-zGHB1Unv4\"}\n\n\n*Authentication fails*\n\n- HTTP STATUS: 403\n- Response:\n\n.. code-block:: json\n\n    {\"message\":\"Invalid user or password\"}\n\n*Invalid Data*\n\n- HTTP STATUS: 400\n- Response: \"Invalid JSON\"\n\n/api/v1/subscriptions\n---------------------\n\n**General**\n\n- Method: GET\n- Input value: user / password\n\n**Example request**\n\n.. code-block:: bash\n\n    \u003e curl -v -X POST http://127.0.0.1:9000/api/v1/subscriptions -H 'Authorization: Bearer TOKEN_FROM_LOGIN'\n\n**Example responses**\n\n*user has subscriptions*\n\n- HTTP STATUS: 200\n- Response:\n\n.. code-block:: json\n\n    {\n        \"subscriptionName\": \"micro\",\n        \"subscriptionStatus\": \"active\",\n        \"expireDate\": \"2018-05-10T16:17:31\"\n    }\n\n*user has NOT subscriptions*\n\n- HTTP STATUS: 200\n- Response:\n\n.. code-block:: json\n\n    {\n        \"subscriptionName\": null,\n        \"subscriptionStatus\": null,\n        \"expireDate\": null\n    }\n\n*Authentication fails*\n\n- HTTP STATUS: 403\n- Response:\n\n.. code-block:: json\n\n    {\"message\":\"Invalid token. You must authenticate first\"}\n\n*Invalid Data*\n\n- HTTP STATUS: 400\n- Response: \"Invalid JSON\"\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcr0hn%2Fwoocommerce-subscription-check","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcr0hn%2Fwoocommerce-subscription-check","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcr0hn%2Fwoocommerce-subscription-check/lists"}