gdpr-cookie-compliance
Last commit date
controllers
5 years ago
dist
5 years ago
gdpr-modules
5 years ago
languages
5 years ago
views
5 years ago
class-gdpr-modules-view.php
5 years ago
class-gdpr-modules.php
5 years ago
class-gdpr-view.php
5 years ago
class-moove-gdpr-actions.php
5 years ago
class-moove-gdpr-content.php
5 years ago
class-moove-gdpr-options.php
5 years ago
gdpr-functions.php
5 years ago
moove-gdpr.php
5 years ago
readme.txt
5 years ago
moove-gdpr.php
167 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Contributors: MooveAgency |
| 4 | * Plugin Name: GDPR Cookie Compliance (CCPA, PIPEDA ready) |
| 5 | * Plugin URI: https://wordpress.org/plugins/gdpr-cookie-compliance/ |
| 6 | * Description: Our plugin is useful in preparing your site for the following data protection and privacy regulations: GDPR, PIPEDA, CCPA, AAP, LGPD and others. |
| 7 | * Version: 4.4.8 |
| 8 | * Author: Moove Agency |
| 9 | * Domain Path: /languages |
| 10 | * Author URI: https://www.mooveagency.com |
| 11 | * License: GPLv2 |
| 12 | * Text Domain: gdpr-cookie-compliance |
| 13 | * |
| 14 | * @package gdpr-cookie-compliance |
| 15 | */ |
| 16 | |
| 17 | if ( ! defined( 'ABSPATH' ) ) { |
| 18 | exit; |
| 19 | } // Exit if accessed directly |
| 20 | |
| 21 | define( 'MOOVE_GDPR_VERSION', '4.4.8' ); |
| 22 | if ( ! defined( 'MOOVE_SHOP_URL' ) ) : |
| 23 | define( 'MOOVE_SHOP_URL', 'https://shop.mooveagency.com' ); |
| 24 | endif; |
| 25 | |
| 26 | register_activation_hook( __FILE__, 'moove_gdpr_activate' ); |
| 27 | register_deactivation_hook( __FILE__, 'moove_gdpr_deactivate' ); |
| 28 | |
| 29 | /** |
| 30 | * Functions on plugin activation, create relevant pages and defaults for settings page. |
| 31 | */ |
| 32 | function moove_gdpr_activate() { |
| 33 | |
| 34 | } |
| 35 | |
| 36 | /** |
| 37 | * Function on plugin deactivation. It removes the pages created before. |
| 38 | */ |
| 39 | function moove_gdpr_deactivate() { |
| 40 | try { |
| 41 | if ( class_exists( 'Moove_GDPR_License_Manager' ) ) : |
| 42 | $gdpr_default_content = new Moove_GDPR_Content(); |
| 43 | $option_key = $gdpr_default_content->moove_gdpr_get_key_name(); |
| 44 | $gdpr_key = function_exists( 'get_site_option' ) ? get_site_option( $option_key ) : get_option( $option_key ); |
| 45 | |
| 46 | if ( $gdpr_key && isset( $gdpr_key['key'] ) && isset( $gdpr_key['activation'] ) ) : |
| 47 | $license_manager = new Moove_GDPR_License_Manager(); |
| 48 | $validate_license = $license_manager->validate_license( $gdpr_key['key'], 'gdpr', 'deactivate' ); |
| 49 | if ( $validate_license && isset( $validate_license['valid'] ) && true === $validate_license['valid'] ) : |
| 50 | if ( function_exists( 'update_site_option' ) ) : |
| 51 | update_site_option( |
| 52 | $option_key, |
| 53 | array( |
| 54 | 'key' => $gdpr_key['key'], |
| 55 | 'deactivation' => strtotime( 'now' ), |
| 56 | ) |
| 57 | ); |
| 58 | else : |
| 59 | update_option( |
| 60 | $option_key, |
| 61 | array( |
| 62 | 'key' => $gdpr_key['key'], |
| 63 | 'deactivation' => strtotime( 'now' ), |
| 64 | ) |
| 65 | ); |
| 66 | endif; |
| 67 | endif; |
| 68 | endif; |
| 69 | endif; |
| 70 | } catch (Exception $e) { |
| 71 | |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | /** |
| 76 | * Loading Text Domain - for translations & localizations |
| 77 | */ |
| 78 | add_action( 'plugins_loaded', 'moove_gdpr_load_textdomain' ); |
| 79 | /** |
| 80 | * Loading text domain |
| 81 | */ |
| 82 | function moove_gdpr_load_textdomain() { |
| 83 | load_plugin_textdomain( 'gdpr-cookie-compliance', false, basename( dirname( __FILE__ ) ) . '/languages' ); |
| 84 | } |
| 85 | |
| 86 | /** |
| 87 | * Loading Core files after all the plugins are loaded! |
| 88 | */ |
| 89 | add_action( 'plugins_loaded', 'gdpr_cookie_compliance_load_libs' ); |
| 90 | |
| 91 | /** |
| 92 | * Star rating on the plugin listing page |
| 93 | */ |
| 94 | if ( ! function_exists( 'gdpr_cookie_add_plugin_meta_links' ) ) { |
| 95 | /** |
| 96 | * Meta links visible in plugins page |
| 97 | * |
| 98 | * @param array $meta_fields Meta fields. |
| 99 | * @param string $file Plugin path. |
| 100 | */ |
| 101 | function gdpr_cookie_add_plugin_meta_links( $meta_fields, $file ) { |
| 102 | if ( plugin_basename( __FILE__ ) === $file ) : |
| 103 | $plugin_url = 'https://wordpress.org/support/plugin/gdpr-cookie-compliance/reviews/?rate=5#new-post'; |
| 104 | $meta_fields[] = "<a href='" . esc_url( $plugin_url ) . "' target='_blank' title='" . esc_html__( 'Rate', 'gdpr-cookie-compliance' ) . "'> |
| 105 | <i class='gdpr-plugin-star-rating'>" |
| 106 | . "<svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-star'><polygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'/></svg>" |
| 107 | . "<svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-star'><polygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'/></svg>" |
| 108 | . "<svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-star'><polygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'/></svg>" |
| 109 | . "<svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-star'><polygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'/></svg>" |
| 110 | . "<svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-star'><polygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'/></svg>" |
| 111 | . '</i></a>'; |
| 112 | |
| 113 | endif; |
| 114 | return $meta_fields; |
| 115 | } |
| 116 | } |
| 117 | add_filter( 'plugin_row_meta', 'gdpr_cookie_add_plugin_meta_links', 10, 2 ); |
| 118 | /** |
| 119 | * Loading assets |
| 120 | */ |
| 121 | function gdpr_cookie_compliance_load_libs() { |
| 122 | /** |
| 123 | * Database Controller |
| 124 | */ |
| 125 | include_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR . 'class-moove-gdpr-db-controller.php'; |
| 126 | |
| 127 | /** |
| 128 | * View |
| 129 | */ |
| 130 | include_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'class-gdpr-view.php'; |
| 131 | |
| 132 | /** |
| 133 | * Modules View |
| 134 | */ |
| 135 | include_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'class-gdpr-modules-view.php'; |
| 136 | /** |
| 137 | * Modules |
| 138 | */ |
| 139 | include_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'class-gdpr-modules.php'; |
| 140 | |
| 141 | /** |
| 142 | * Content |
| 143 | */ |
| 144 | include_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'class-moove-gdpr-content.php'; |
| 145 | |
| 146 | /** |
| 147 | * Options page |
| 148 | */ |
| 149 | include_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'class-moove-gdpr-options.php'; |
| 150 | |
| 151 | /** |
| 152 | * Controllers |
| 153 | */ |
| 154 | include_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR . 'class-moove-gdpr-controller.php'; |
| 155 | include_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR . 'class-moove-gdpr-license-manager.php'; |
| 156 | |
| 157 | /** |
| 158 | * Actions |
| 159 | */ |
| 160 | include_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'class-moove-gdpr-actions.php'; |
| 161 | |
| 162 | /** |
| 163 | * Custom Functions |
| 164 | */ |
| 165 | include_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'gdpr-functions.php'; |
| 166 | } |
| 167 |