{"id":403914,"date":"2026-11-15T05:42:51","date_gmt":"2026-11-15T05:42:51","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/cod-guard-lite\/"},"modified":"2026-11-15T05:42:29","modified_gmt":"2026-11-15T05:42:29","slug":"gihantha-cash-on-delivery-order-protection","status":"publish","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/gihantha-cash-on-delivery-order-protection\/","author":23604163,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"0.1.0","stable_tag":"0.1.0","tested":"7.1.4","requires":"6.2","requires_php":"7.4","requires_plugins":null,"header_name":"Gihantha Cash on Delivery Order Protection","header_author":"Gihantha Kaveen","header_description":"Stop fake and risky Cash on Delivery orders in WooCommerce. Phone validation for every country (extra-strict for Sri Lanka), phone blacklist, repeat-order blocking, COD limits, COD fee and return-rate tracking. Runs fully on your site, no external server.","last_updated":"2026-11-15 05:42:29","external_support_url":"","external_repository_url":"","donate_link":"https:\/\/ko-fi.com\/gihantha","header_plugin_uri":"","header_author_uri":"","rating":0,"author_block_rating":0,"active_installs":0,"downloads":92,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"0.1.0":{"tag":"0.1.0","author":"gihantha","date":"2026-11-15 05:42:29","revision":3802770}},"upgrade_notice":[],"ratings":[],"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":3802770,"resolution":"128x128","location":"assets","locale":"","width":128,"height":128},"icon-256x256.png":{"filename":"icon-256x256.png","revision":3802770,"resolution":"256x256","location":"assets","locale":"","width":256,"height":256}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":3802770,"resolution":"1544x500","location":"assets","locale":"","width":1544,"height":500},"banner-772x250.png":{"filename":"banner-772x250.png","revision":3802770,"resolution":"772x250","location":"assets","locale":"","width":772,"height":250}},"assets_blueprints":{"blueprint.json":{"filename":"blueprint.json","revision":3804836,"resolution":false,"location":"assets","locale":"","contents":"{\"$schema\":\"https:\\\/\\\/playground.wordpress.net\\\/blueprint-schema.json\",\"meta\":{\"title\":\"Gihantha Cash on Delivery Order Protection demo\",\"author\":\"gihantha\"},\"landingPage\":\"\\\/wp-admin\\\/admin.php?page=gihantha-cash-on-delivery-order-protection&tab=dashboard\",\"preferredVersions\":{\"php\":\"8.2\",\"wp\":\"latest\"},\"steps\":[{\"step\":\"login\",\"username\":\"admin\",\"password\":\"password\"},{\"step\":\"installPlugin\",\"pluginData\":{\"resource\":\"wordpress.org\\\/plugins\",\"slug\":\"woocommerce\"},\"options\":{\"activate\":true}},{\"step\":\"installPlugin\",\"pluginData\":{\"resource\":\"wordpress.org\\\/plugins\",\"slug\":\"gihantha-cash-on-delivery-order-protection\"},\"options\":{\"activate\":true}},{\"step\":\"runPHP\",\"code\":\"<?php\\n\\\/\\\/ Live Preview demo data for WordPress Playground. Runs once inside the blueprint after both plugins are active.\\nrequire_once '\\\/wordpress\\\/wp-load.php';\\nwp_set_current_user( 1 );\\n\\n\\\/\\\/ Store basics: Sri Lanka, LKR, no onboarding wizard, store visible.\\nupdate_option( 'woocommerce_default_country', 'LK' );\\nupdate_option( 'woocommerce_currency', 'LKR' );\\nupdate_option( 'woocommerce_price_num_decimals', '0' );\\nupdate_option( 'woocommerce_onboarding_profile', array( 'skipped' => true ) );\\nupdate_option( 'woocommerce_task_list_hidden', 'yes' );\\nupdate_option( 'woocommerce_coming_soon', 'no' );\\nupdate_option( 'woocommerce_cod_settings', array(\\n\\t'enabled'     => 'yes',\\n\\t'title'       => 'Cash on delivery',\\n\\t'description' => 'Pay with cash when your parcel arrives.',\\n) );\\n\\n\\\/\\\/ Free shipping everywhere so the checkout works for any address.\\n$zone = new WC_Shipping_Zone( 0 );\\nif ( ! $zone->get_shipping_methods() ) {\\n\\t$zone->add_shipping_method( 'free_shipping' );\\n}\\n\\n\\\/\\\/ Two products.\\n$ids = array();\\nforeach ( array( array( 'Cotton T-Shirt', 2500 ), array( 'Smartphone X2', 45000 ) ) as $p ) {\\n\\t$prod = new WC_Product_Simple();\\n\\t$prod->set_name( $p[0] );\\n\\t$prod->set_regular_price( (string) $p[1] );\\n\\t$prod->set_status( 'publish' );\\n\\t$ids[] = $prod->save();\\n}\\n$shirt = wc_get_product( $ids[0] );\\n\\n\\\/\\\/ Plugin settings: COD limit and fee so every feature shows up.\\n$s                   = GIHCOB_Settings::defaults();\\n$s['max_cod_amount'] = 30000;\\n$s['cod_fee']        = 150;\\nupdate_option( 'gihcob_settings', $s );\\n\\n\\\/\\\/ name, phone, city, qty, result (delivered|refused|open), days ago\\n$plan = array(\\n\\tarray( 'Kasun Silva', '0771845293', 'Colombo', 2, 'delivered', 20 ),\\n\\tarray( 'Kasun Silva', '0771845293', 'Colombo', 1, 'delivered', 14 ),\\n\\tarray( 'Kasun Silva', '0771845293', 'Colombo', 3, 'delivered', 6 ),\\n\\tarray( 'Dilini Fernando', '0712630481', 'Negombo', 1, 'delivered', 18 ),\\n\\tarray( 'Dilini Fernando', '0712630481', 'Negombo', 2, 'delivered', 9 ),\\n\\tarray( 'Ashan Perera', '0756291847', 'Kurunegala', 2, 'refused', 16 ),\\n\\tarray( 'Ashan Perera', '0756291847', 'Kurunegala', 1, 'refused', 8 ),\\n\\tarray( 'Nadeesha Jayasinghe', '0763384120', 'Kandy', 1, 'delivered', 15 ),\\n\\tarray( 'Nadeesha Jayasinghe', '0763384120', 'Kandy', 1, 'refused', 7 ),\\n\\tarray( 'Ruwan Bandara', '0784417296', 'Galle', 1, 'delivered', 12 ),\\n\\tarray( 'Ishara Gunawardena', '0742268905', 'Matara', 1, 'delivered', 10 ),\\n\\tarray( 'Ishara Gunawardena', '0742268905', 'Matara', 2, 'open', 0.30 ),\\n\\tarray( 'Chamara Herath', '0727790154', 'Anuradhapura', 1, 'open', 0.22 ),\\n\\tarray( 'Ruwan Bandara', '0784417296', 'Galle', 3, 'open', 0.15 ),\\n\\tarray( 'Nadeesha Jayasinghe', '0763384120', 'Kandy', 2, 'open', 0.10 ),\\n\\tarray( 'Tharushi Wickramasinghe', '0705528831', 'Jaffna', 1, 'open', 0.05 ),\\n);\\nforeach ( $plan as $p ) {\\n\\tlist( $name, $phone, $city, $qty, $result, $days ) = $p;\\n\\tlist( $first, $last ) = explode( ' ', $name, 2 );\\n\\t$o    = wc_create_order();\\n\\t$addr = array( 'first_name' => $first, 'last_name' => $last, 'address_1' => '12 Main Street', 'city' => $city, 'postcode' => '10000', 'country' => 'LK', 'phone' => $phone, 'email' => strtolower( $first ) . '@example.com' );\\n\\t$o->set_address( $addr, 'billing' );\\n\\tunset( $addr['email'] );\\n\\t$o->set_address( $addr, 'shipping' );\\n\\t$o->add_product( $shirt, $qty );\\n\\t$o->set_payment_method( 'cod' );\\n\\t$o->set_payment_method_title( 'Cash on delivery' );\\n\\t$o->update_meta_data( '_gihcob_phone', GIHCOB_Phone::normalize( $phone, 'LK' ) );\\n\\t$o->set_date_created( time() - (int) ( $days * DAY_IN_SECONDS ) );\\n\\t$o->calculate_totals();\\n\\t$o->set_status( 'processing' );\\n\\t$o->save();\\n\\tif ( 'delivered' === $result ) {\\n\\t\\t$o->set_status( 'completed' ); \\\/\\\/ The plugin counts completed COD orders as delivered.\\n\\t\\t$o->save();\\n\\t} elseif ( 'refused' === $result ) {\\n\\t\\t$o->set_status( 'cancelled' );\\n\\t\\t$o->save();\\n\\t\\tGIHCOB_Orders::set_result( wc_get_order( $o->get_id() ), 'refused' );\\n\\t}\\n}\\nGIHCOB_DB::set_status( '0784417296', 'trusted', 'Regular customer' );\\nGIHCOB_DB::set_status( '0719904436', 'blocked', 'Fake orders reported by courier' );\\nGIHCOB_DB::set_status( '0752218874', 'blocked', 'Refused 3 parcels last month' );\\nupdate_option( 'gihcob_blocked_count', 14, false );\\n\"}]}"}},"all_blocks":[],"tagged_versions":["0.1.0"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":3802770,"resolution":"1","location":"assets","locale":"","width":1366,"height":900},"screenshot-2.png":{"filename":"screenshot-2.png","revision":3802770,"resolution":"2","location":"assets","locale":"","width":1366,"height":900},"screenshot-3.png":{"filename":"screenshot-3.png","revision":3802770,"resolution":"3","location":"assets","locale":"","width":1366,"height":900},"screenshot-4.png":{"filename":"screenshot-4.png","revision":3802770,"resolution":"4","location":"assets","locale":"","width":1366,"height":1260},"screenshot-5.png":{"filename":"screenshot-5.png","revision":3802770,"resolution":"5","location":"assets","locale":"","width":1366,"height":1070}},"screenshots":{"1":"Dashboard with COD return rate, refused parcels and money saved.","2":"Orders list with the COD Protection column showing each customer's delivery history.","3":"Phone numbers list: block, trust or reset any number.","4":"Settings: phone validation, COD limit, repeat-order window, auto-block and COD fee.","5":"Clear message at checkout when a risky COD order is stopped."}},"plugin_section":[],"plugin_tags":[31179,31178,236038,12891,286],"plugin_category":[45],"plugin_contributors":[292816],"plugin_business_model":[],"class_list":["post-403914","plugin","type-plugin","status-publish","hentry","plugin_tags-cash-on-delivery","plugin_tags-cod","plugin_tags-fake-orders","plugin_tags-fraud","plugin_tags-woocommerce","plugin_category-ecommerce","plugin_contributors-gihantha","plugin_committers-gihantha"],"banners":{"banner":"https:\/\/ps.w.org\/gihantha-cash-on-delivery-order-protection\/assets\/banner-772x250.png?rev=3802770","banner_2x":"https:\/\/ps.w.org\/gihantha-cash-on-delivery-order-protection\/assets\/banner-1544x500.png?rev=3802770","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/gihantha-cash-on-delivery-order-protection\/assets\/icon-128x128.png?rev=3802770","icon_2x":"https:\/\/ps.w.org\/gihantha-cash-on-delivery-order-protection\/assets\/icon-256x256.png?rev=3802770","generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/gihantha-cash-on-delivery-order-protection\/assets\/screenshot-1.png?rev=3802770","caption":"Dashboard with COD return rate, refused parcels and money saved."},{"src":"https:\/\/ps.w.org\/gihantha-cash-on-delivery-order-protection\/assets\/screenshot-2.png?rev=3802770","caption":"Orders list with the COD Protection column showing each customer's delivery history."},{"src":"https:\/\/ps.w.org\/gihantha-cash-on-delivery-order-protection\/assets\/screenshot-3.png?rev=3802770","caption":"Phone numbers list: block, trust or reset any number."},{"src":"https:\/\/ps.w.org\/gihantha-cash-on-delivery-order-protection\/assets\/screenshot-4.png?rev=3802770","caption":"Settings: phone validation, COD limit, repeat-order window, auto-block and COD fee."},{"src":"https:\/\/ps.w.org\/gihantha-cash-on-delivery-order-protection\/assets\/screenshot-5.png?rev=3802770","caption":"Clear message at checkout when a risky COD order is stopped."}],"raw_content":"<!--section=description-->\n<p>Every refused Cash on Delivery parcel costs you twice: the delivery fee and the return fee, plus stock stuck in transit for days.<\/p>\n\n<p><strong>Gihantha Cash on Delivery Order Protection<\/strong> checks every COD order at checkout and keeps a delivered \/ refused history for each phone number, so you can stop bad orders <strong>before<\/strong> you ship them.<\/p>\n\n<p>Works for stores in any country. It was first built in Sri Lanka, where Cash on Delivery is the most popular way to pay online, so Sri Lankan numbers get extra-strict checks. Everything runs on your own site: no sign-up, no API key, no data sent anywhere.<\/p>\n\n<h4>Checkout protection<\/h4>\n\n<ul>\n<li><strong>Phone number validation for every country<\/strong> \u2013 reads each number using the customer's billing country, in any format (+44 7700 900123, 0044\u2026, 07700 900123), and rejects numbers that cannot be real.<\/li>\n<li><strong>Extra-strict Sri Lanka checks<\/strong> \u2013 Sri Lankan numbers must be real mobile numbers (+94 77\u2026, 0094\u2026, 077\u2026). You can allow landlines too.<\/li>\n<li><strong>Fake number detection<\/strong> \u2013 blocks numbers like 0777777777, 0711234567 or +44 7777 777777.<\/li>\n<li><strong>Repeat order blocking<\/strong> \u2013 stops a second COD order from the same number while the first one is still open.<\/li>\n<li><strong>Maximum COD order value<\/strong> \u2013 stop COD orders above an amount you choose.<\/li>\n<li><strong>COD handling fee<\/strong> \u2013 optionally add a fee when the customer chooses COD.<\/li>\n<li><strong>Clear messages<\/strong> \u2013 customers see a friendly explanation, which you can edit.<\/li>\n<\/ul>\n\n<h4>Phone blacklist and trusted list<\/h4>\n\n<ul>\n<li>Block any number from using COD, or mark good customers as trusted so they skip all checks.<\/li>\n<li><strong>Auto-block<\/strong> numbers after a set number of refused parcels (default: 2).<\/li>\n<\/ul>\n\n<h4>Delivery tracking<\/h4>\n\n<ul>\n<li>Mark orders as <strong>delivered<\/strong> or <strong>refused \/ returned<\/strong> from the order screen or with bulk actions on the orders list.<\/li>\n<li>Completed COD orders are counted as delivered automatically.<\/li>\n<li>A <strong>COD Protection column<\/strong> on the orders list shows each customer's history: Good, Risky, Blocked, Trusted or New, with delivered and refused counts.<\/li>\n<\/ul>\n\n<h4>Dashboard<\/h4>\n\n<p>See your COD return rate, delivered and refused parcels, how many risky checkouts were stopped, and an estimate of the money saved.<\/p>\n\n<h4>Compatibility<\/h4>\n\n<ul>\n<li>Works with both the <strong>block checkout<\/strong> and the <strong>classic checkout<\/strong>.<\/li>\n<li>Compatible with WooCommerce <strong>High-Performance Order Storage (HPOS)<\/strong>.<\/li>\n<li>Translation ready.<\/li>\n<\/ul>\n\n<!--section=installation-->\n<ol>\n<li>Make sure WooCommerce is installed and active.<\/li>\n<li>Install Gihantha Cash on Delivery Order Protection from <strong>Plugins &gt; Add New<\/strong>, or upload the <code>gihantha-cash-on-delivery-order-protection<\/code> folder to <code>\/wp-content\/plugins\/<\/code>.<\/li>\n<li>Activate the plugin.<\/li>\n<li>Go to <strong>WooCommerce &gt; COD Protection &gt; Settings<\/strong> and choose your rules.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id=\"does%20it%20send%20customer%20data%20anywhere%3F\"><h3>Does it send customer data anywhere?<\/h3><\/dt>\n<dd><p>No. All data stays in your own WordPress database. The plugin makes no external requests.<\/p><\/dd>\n<dt id=\"does%20it%20work%20outside%20sri%20lanka%3F\"><h3>Does it work outside Sri Lanka?<\/h3><\/dt>\n<dd><p>Yes. Phone numbers are read using the customer's billing country, so +44 7700 900123 and 07700 900123 count as the same customer for the blacklist and the repeat-order check. Numbers from any country must be complete (8 to 15 digits including the country code), and Sri Lankan numbers must also be valid mobile numbers (you can allow landlines in the settings).<\/p>\n\n<p>If you do not want phone validation at all, untick \"Validate phone numbers\". The blacklist, repeat-order blocking, COD limit, COD fee and delivery tracking keep working.<\/p><\/dd>\n<dt id=\"i%20added%20a%20customer%20from%20another%20country%20to%20the%20blacklist.%20how%20should%20i%20type%20the%20number%3F\"><h3>I added a customer from another country to the blacklist. How should I type the number?<\/h3><\/dt>\n<dd><p>Include the country code, for example +44 7700 900123. Numbers without a country code are read as numbers from your store's country.<\/p><\/dd>\n<dt id=\"how%20does%20a%20number%20get%20blocked%20automatically%3F\"><h3>How does a number get blocked automatically?<\/h3><\/dt>\n<dd><p>When you mark an order as refused \/ returned, the refusal is added to that phone number's history. When a number reaches the refusal limit in settings (default 2), it is blocked from using COD.<\/p><\/dd>\n<dt id=\"should%20the%20phone%20field%20be%20required%3F\"><h3>Should the phone field be required?<\/h3><\/dt>\n<dd><p>Yes, we recommend it. In the block checkout, edit the Checkout page, select the Phone field and set it to required. If a customer leaves it empty, COD Protection asks them for a valid mobile number before a COD order can be placed.<\/p><\/dd>\n<dt id=\"a%20good%20customer%20was%20blocked.%20what%20do%20i%20do%3F\"><h3>A good customer was blocked. What do I do?<\/h3><\/dt>\n<dd><p>Go to <strong>WooCommerce &gt; COD Protection &gt; Phone numbers<\/strong> and click <strong>Trust<\/strong> or <strong>Reset<\/strong> next to their number.<\/p><\/dd>\n<dt id=\"does%20it%20work%20with%20the%20block%20checkout%3F\"><h3>Does it work with the block checkout?<\/h3><\/dt>\n<dd><p>Yes. All checks and the COD fee work on both the block and the classic checkout.<\/p><\/dd>\n<dt id=\"what%20happens%20to%20my%20data%20if%20i%20delete%20the%20plugin%3F\"><h3>What happens to my data if I delete the plugin?<\/h3><\/dt>\n<dd><p>Deleting the plugin removes its table and settings. Deactivating keeps them.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>0.1.0<\/h4>\n\n<ul>\n<li>First release.<\/li>\n<\/ul>","raw_excerpt":"Stop fake and risky Cash on Delivery orders in WooCommerce. Phone checks, blacklist, COD limits and return-rate tracking. No external server.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/403914","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=403914"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/gihantha"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=403914"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=403914"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=403914"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=403914"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=403914"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=403914"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}