{"id":238647,"date":"2025-06-30T12:43:51","date_gmt":"2025-06-30T12:43:51","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/restrict-admin-login-by-country-grc\/"},"modified":"2026-02-20T12:22:03","modified_gmt":"2026-02-20T12:22:03","slug":"restrict-admin-login-by-country-grc","status":"publish","type":"plugin","link":"https:\/\/mk.wordpress.org\/plugins\/restrict-admin-login-by-country-grc\/","author":13210680,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.6","stable_tag":"1.6","tested":"7.0","requires":"5.0","requires_php":"7.4","requires_plugins":null,"header_name":"Restrict Admin Login by Country - GRC","header_author":"GRC","header_description":"Blocks admin\/shop_manager\/editor\/author logins from countries other than the allowed list. Uses ipinfo.io for IP detection and restcountries.com for a dynamic country list.","assets_banners_color":"","last_updated":"2026-02-20 12:22:03","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"","header_author_uri":"","rating":0,"author_block_rating":0,"active_installs":10,"downloads":478,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.5":{"tag":"1.5","author":"robertutzu","date":"2026-02-20 12:12:57"},"1.6":{"tag":"1.6","author":"robertutzu","date":"2026-02-20 12:22:03"}},"upgrade_notice":{"1.5":"<p>Strongly recommended: Security improvements, input sanitization, and full compatibility with WordPress Plugin Check standards.<\/p>"},"ratings":[],"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":3320070,"resolution":"128x128","location":"assets","locale":""},"icon-256x256.png":{"filename":"icon-256x256.png","revision":3320070,"resolution":"256x256","location":"assets","locale":""}},"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.5","1.6"],"block_files":[],"assets_screenshots":[],"screenshots":{"1":"Settings page with country selection.","2":"Example of a restricted login error message."},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[3816,19870,4124,232904,600],"plugin_category":[49,54],"plugin_contributors":[162797],"plugin_business_model":[],"class_list":["post-238647","plugin","type-plugin","status-publish","hentry","plugin_tags-admin-login","plugin_tags-country-restriction","plugin_tags-geolocation","plugin_tags-ipinfo","plugin_tags-security","plugin_category-maps-and-location","plugin_category-security-and-spam-protection","plugin_contributors-robertutzu","plugin_committers-robertutzu"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/restrict-admin-login-by-country-grc\/assets\/icon-128x128.png?rev=3320070","icon_2x":"https:\/\/ps.w.org\/restrict-admin-login-by-country-grc\/assets\/icon-256x256.png?rev=3320070","generated":false},"screenshots":[],"raw_content":"<!--section=description-->\n<p>This plugin protects your WordPress login area by restricting access to specific countries based on geolocation. It is especially useful for hardening security for roles such as administrator, shop manager, editor, and author.<\/p>\n\n<p><strong>Features:<\/strong><\/p>\n\n<ul>\n<li>Restricts logins for admin, shop manager, editor, and author roles based on IP geolocation.  <\/li>\n<li>Automatically whitelists the country where the plugin was first activated.  <\/li>\n<li>Settings page to manually select allowed countries.  <\/li>\n<li>Dynamically fetches a list of countries via a public API.  <\/li>\n<li>Lightweight and easy to configure.<\/li>\n<\/ul>\n\n<p>Powered by <a href=\"https:\/\/ipinfo.io\">ipinfo.io<\/a> for IP geolocation detection.<\/p>\n\n<h3>External Services<\/h3>\n\n<p>This plugin relies on two external services to function properly. These services are used to identify user locations and provide country data for configuration purposes.<\/p>\n\n<h3>1. ipinfo.io<\/h3>\n\n<p><strong>What is the service used for?<\/strong><br \/>\n- Used to determine the geolocation (specifically, the country) of an IP address attempting to log in.<br \/>\n- Ensures that only users from allowed countries can log in as administrator, shop manager, editor, or author.<\/p>\n\n<p><strong>What data is sent and when?<\/strong><br \/>\n- The plugin sends the IP address of the user attempting to log in to <code>ipinfo.io<\/code> at the time of login.<br \/>\n- This is done in real time to determine the user's country and enforce access rules.<\/p>\n\n<p><strong>Service Provider:<\/strong><br \/>\n- Website: <a href=\"https:\/\/ipinfo.io\">https:\/\/ipinfo.io<\/a><br \/>\n- Terms of Service: <a href=\"https:\/\/ipinfo.io\/terms\">https:\/\/ipinfo.io\/terms<\/a><br \/>\n- Privacy Policy: <a href=\"https:\/\/ipinfo.io\/privacy-policy\">https:\/\/ipinfo.io\/privacy-policy<\/a><\/p>\n\n\n\n<h3>2. restcountries.com<\/h3>\n\n<p><strong>What is the service used for?<\/strong><br \/>\n- Used to dynamically fetch the list of countries (with country codes and names) displayed in the plugin settings.<br \/>\n- Allows users to easily select which countries should be allowed for admin login access.<\/p>\n\n<p><strong>What data is sent and when?<\/strong><br \/>\n- No user data is sent.<br \/>\n- The plugin performs a GET request to <code>https:\/\/restcountries.com\/v3.1\/all?fields=cca2,name<\/code> to fetch a list of country codes and names during plugin settings initialization.<\/p>\n\n<p><strong>Service Provider:<\/strong><br \/>\n- Website: <a href=\"https:\/\/restcountries.com\">https:\/\/restcountries.com<\/a><br \/>\n- API Documentation: <a href=\"https:\/\/restcountries.com\/#api-endpoints-v3-all\">https:\/\/restcountries.com\/#api-endpoints-v3-all<\/a><br \/>\n- No specific privacy policy is published, as this is a public API that does not handle user-specific data.<\/p>\n\n<h3>License<\/h3>\n\n<p>This plugin is licensed under the GPLv2 or later. See <a href=\"https:\/\/www.gnu.org\/licenses\/gpl-2.0.html\">https:\/\/www.gnu.org\/licenses\/gpl-2.0.html<\/a> for details.<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Upload the plugin files to the <code>\/wp-content\/plugins\/restrict-country-login<\/code> directory, or install it via the WordPress Plugins screen.  <\/li>\n<li>Activate the plugin through the \u2018Plugins\u2019 screen in WordPress.  <\/li>\n<li>Navigate to <strong>Settings \u2192 Restrict Country Login<\/strong> to configure the allowed countries.  <\/li>\n<li>Save your settings.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id=\"what%20happens%20if%20the%20plugin%20cannot%20detect%20the%20user%E2%80%99s%20country%3F\"><h3>What happens if the plugin cannot detect the user\u2019s country?<\/h3><\/dt>\n<dd><p>If geolocation fails, the login will be blocked and the user will receive an error message.<\/p><\/dd>\n<dt id=\"can%20i%20remove%20the%20country%20where%20the%20plugin%20was%20first%20installed%3F\"><h3>Can I remove the country where the plugin was first installed?<\/h3><\/dt>\n<dd><p>No. For security and fail-safe reasons, login access from the original install country is always allowed.<\/p><\/dd>\n<dt id=\"which%20user%20roles%20are%20affected%20by%20the%20restriction%3F\"><h3>Which user roles are affected by the restriction?<\/h3><\/dt>\n<dd><p>Only users with the roles <strong>administrator<\/strong>, <strong>shop manager<\/strong>, <strong>editor<\/strong>, and <strong>author<\/strong> are restricted by country. Other roles remain unaffected.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.6 \u2013 2026-02-20<\/h4>\n\n<ul>\n<li>Added button settings.  <\/li>\n<\/ul>\n\n<h4>1.5 \u2013 2025-06-13<\/h4>\n\n<ul>\n<li>Added sanitization to <code>register_setting()<\/code> for WordPress Plugin Check compliance.  <\/li>\n<li>Escaped all output on the settings page.  <\/li>\n<li>Fixed missing text domains for translation.  <\/li>\n<li>Validated and sanitized IP addresses from <code>$_SERVER<\/code>.  <\/li>\n<li>Prevented removal of the installer's original country from the allowed list.<\/li>\n<\/ul>\n\n<h4>1.4<\/h4>\n\n<ul>\n<li>Fail-safe: always allow login from the original install country, regardless of settings.<\/li>\n<\/ul>\n\n<h4>1.3<\/h4>\n\n<ul>\n<li>Integrated dynamic country list via a public JSON API.<\/li>\n<\/ul>\n\n<h4>1.2<\/h4>\n\n<ul>\n<li>Added settings page to configure allowed countries.<\/li>\n<\/ul>\n\n<h4>1.1<\/h4>\n\n<ul>\n<li>Made restrictions dynamic instead of hardcoded for Romania (RO).  <\/li>\n<li>Improved error handling for IP detection.<\/li>\n<\/ul>\n\n<h4>1.0<\/h4>\n\n<ul>\n<li>Initial release.  <\/li>\n<li>Restricted admin\/shop_manager\/editor\/author login access to Romania (RO) only.<\/li>\n<\/ul>","raw_excerpt":"Restrict admin, shop manager, editor, and author logins based on the user\u2019s country. Automatically blocks access from non-authorized locations.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/mk.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/238647","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mk.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/mk.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/mk.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=238647"}],"author":[{"embeddable":true,"href":"https:\/\/mk.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/robertutzu"}],"wp:attachment":[{"href":"https:\/\/mk.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=238647"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/mk.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=238647"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/mk.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=238647"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/mk.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=238647"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/mk.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=238647"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/mk.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=238647"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}