Effortless QR Code Generator is a WordPress plugin that allows you to create QR codes using a simple shortcode. It supports both client-side JavaScript rendering and server-side PHP rendering.
[effortless_qrcode url="https://example.com"] to generate QR codesurl – The URL to encode (required)size – Size in pixels (default: 150, min: 100, max: 500)color_dark – Dark color in hex format (default: #000000)color_light – Light color in hex format (default: #ffffff)render – Rendering mode: “client” or “server” (default: client)ecc – Error correction level: L, M, Q, H (default: M)alt – Alt text for accessibility (server rendering only)class – Additional CSS class (server rendering only)data – Arbitrary data to encode (plain text, WiFi, vCard, etc.). When set, overrides url and disables linklink – Wrap QR code in a clickable link: “yes” or “no” (default: no). Only works with URL content, ignored when data is usedtitle – Tooltip text shown on hovertarget – Link target attribute: “_blank”, “_self”, etc. (default: _blank)Basic usage (client-side):
[effortless_qrcode url=”https://example.com”]
Server-side rendering:
[effortless_qrcode url=”https://example.com” render=”server”]
With custom size and colors:
[effortless_qrcode url=”https://example.com” size=”200″ color_dark=”#0073aa”]
Server-side with high error correction:
[effortless_qrcode url=”https://example.com” render=”server” ecc=”H” alt=”Scan me”]
Third-party plugins and themes can generate QR codes programmatically using the Effortless_QRCode_Native class.
Basic Usage:
';
}
}
?>
With Custom Options:
Display in a Template:
Effortless_QRCode_Native::generate_png( $data, $size, $color_dark, $color_light, $ecc, $margin )
Generates a QR code PNG image and saves it to the WordPress uploads folder.
Parameters:
$data (string) – Required. The data to encode (URL, text, etc.)$size (int) – Optional. Image size in pixels. Default: 150$color_dark (string) – Optional. Hex color for dark modules. Default: ‘#000000’$color_light (string) – Optional. Hex color for light modules. Default: ‘#ffffff’$ecc (string) – Optional. Error correction level (L, M, Q, H). Default: ‘M’$margin (int) – Optional. Quiet zone margin in modules. Default: 4Returns:
Array on success with keys:
* url – Public URL to the generated PNG image
* path – Server filesystem path to the PNG file
* debug – Debug information string
Returns false on failure.
Notes:
wp-content/uploads/effortless-qrcodes/Higher error correction allows the QR code to be read even if partially damaged or obscured.
This plugin does not collect, store, or transmit any personal data. QR codes are generated locally (either in the browser or on your server).