moove_gdpr_get_key_name(); $gdpr_key = $gdpr_default_content->gdpr_get_activation_key( $option_key ); if ( $gdpr_key && isset( $gdpr_key['key'] ) && isset( $gdpr_key['activation'] ) ) : $license_manager = new Moove_GDPR_License_Manager(); $validate_license = $license_manager->validate_license( $gdpr_key['key'], 'gdpr', 'deactivate' ); if ( $validate_license && isset( $validate_license['valid'] ) && true === $validate_license['valid'] ) : update_option( $option_key, array( 'key' => $gdpr_key['key'], 'deactivation' => strtotime( 'now' ), ) ); endif; endif; endif; } catch ( Exception $e ) { echo esc_html( $e->getMessage() ); } } /** * Loading Text Domain - for translations & localizations */ add_action( 'plugins_loaded', 'moove_gdpr_load_textdomain' ); /** * Loading text domain */ function moove_gdpr_load_textdomain() { load_plugin_textdomain( 'gdpr-cookie-compliance', false, basename( dirname( __FILE__ ) ) . '/languages' ); } /** * Loading Core files after all the plugins are loaded! */ add_action( 'plugins_loaded', 'gdpr_cookie_compliance_load_libs' ); /** * Star rating on the plugin listing page */ if ( ! function_exists( 'gdpr_cookie_add_plugin_meta_links' ) ) { /** * Meta links visible in plugins page * * @param array $meta_fields Meta fields. * @param string $file Plugin path. */ function gdpr_cookie_add_plugin_meta_links( $meta_fields, $file ) { if ( plugin_basename( __FILE__ ) === $file ) : $plugin_url = 'https://wordpress.org/support/plugin/gdpr-cookie-compliance/reviews/?rate=5#new-post'; $meta_fields[] = " " . "" . "" . "" . "" . "" . ''; endif; return $meta_fields; } } add_filter( 'plugin_row_meta', 'gdpr_cookie_add_plugin_meta_links', 10, 2 ); /** * Loading assets */ function gdpr_cookie_compliance_load_libs() { if ( current_user_can( 'edit_posts' ) && isset( $_GET['elementor-preview'] ) && intval( $_GET['elementor-preview'] ) ) : // phpcs:ignore /** * Prevent loading the GDPR plugin in Elementor previews */ else : /** * Database Controller */ include_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR . 'class-moove-gdpr-db-controller.php'; /** * View */ include_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'class-gdpr-view.php'; /** * Modules View */ include_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'class-gdpr-modules-view.php'; /** * Modules */ include_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'class-gdpr-modules.php'; /** * Content */ include_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'class-moove-gdpr-content.php'; /** * Options page */ include_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'class-moove-gdpr-options.php'; /** * Controllers */ include_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR . 'class-moove-gdpr-controller.php'; include_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR . 'class-moove-gdpr-license-manager.php'; include_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR . 'class-moove-gdpr-review.php'; include_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR . 'class-moove-gdpr-cache-purge.php'; /** * Custom Functions */ include_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'gdpr-functions.php'; /** * Actions */ include_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'class-moove-gdpr-actions.php'; endif; }