dev-master
9999999-dev https://github.com/iubenda/iubenda-cookie-classPHP class for the cookie law solution
MIT
The Requires
- php >=5.2.4
cookie gdpr
PHP class for the cookie law solution
PHP class for the iubenda cookie law solution, (*1)
If you have European users you need to obtain and manage consent for the use of most cookies. The iubenda Cookie Solution is an all-in-one approach developed by iubenda, that helps to make your website GDPR and Cookie Law compliant by integrating with your cookie policy, providing a compliant cookie banner and the blocking management of cookie scripts. The Cookie Solution also allows users to set advertising preferences on-site and within the solution, facilitated the recent-but-widely adopted IAB Europe Transparency & Consent framework., (*2)
Read more about the Cookie Solution here., (*3)
This is the class on which our WordPress and Joomla! and Drupal plugins are based and you can use it to build your own plugin independently for a platform other than those for which we have already developed a dedicated solution., (*4)
This class works with the iubenda Cookie Law Solution and allows you to block the most common widgets and third-party cookies to comply with Cookie Law., (*5)
The class is currently able to detect and automatically block the following scripts:, (*6)
It also allows the manual blocking of all other resources without direct intervention on the actual scripts. Read more about the prior blocking functionality here., (*7)
Here is an example of the PHP class integration:, (*8)
function iubenda_system( $html, $type = 'page' ) { if ( empty( $html ) ) return; require_once( 'iubenda.class.php' ); // separator if ( ! iubendaParser::consent_given() && ! iubendaParser::bot_detected() ) { $iubenda = new iubendaParser( $html, array( 'type' => in_array( $type, array( 'page', 'faster' ), true ) ? $type : 'page' ) ); $html = $iubenda->parse(); } // finished return $html; }
The iubenda_system
method verifies if the page visitor consents to the use of cookies. If they have consented, the script returns the HTML provided as a parameter without taking any action such as parsing/replacing.
Simply copy your method into the PHP document and then call it with the following syntax iubenda_system("contenutohtml");
that will return the code., (*9)
<!--IUB-COOKIE-BLOCK-START-->
and <!--IUB-COOKIE-BLOCK-END-->
These operations take place in accordance with the rules explained in this guide. We suggest that you consult the posts relating to the alteration of script, img and iframe tags., (*10)
This project is licensed under the GPl 3 license., (*11)
PHP class for the cookie law solution
MIT
cookie gdpr