Skip to content

Commit

Permalink
Code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
UCjatamayo committed Dec 19, 2024
1 parent 7bb2f1f commit 3a18817
Show file tree
Hide file tree
Showing 152 changed files with 1,086 additions and 847 deletions.
1 change: 1 addition & 0 deletions src/addons/Cookiebot_Addons.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

class Cookiebot_Addons {


/**
* @var Dependency_Container
*/
Expand Down
7 changes: 4 additions & 3 deletions src/addons/config/Settings_Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
use function cybot\cookiebot\lib\include_view;

class Settings_Config {

/**
* @var Settings_Service_Interface
*/
Expand Down Expand Up @@ -83,11 +84,11 @@ public function load() {
* @since 1.3.0
*/
public function add_submenu() {
if( Cookiebot_Frame::is_cb_frame_type() !== 'empty' ) {
if ( Cookiebot_Frame::is_cb_frame_type() !== 'empty' ) {
add_submenu_page(
'cookiebot',
esc_html__('Plugins', 'cookiebot'),
esc_html__('Plugins', 'cookiebot'),
esc_html__( 'Plugins', 'cookiebot' ),
esc_html__( 'Plugins', 'cookiebot' ),
'manage_options',
'cookiebot-addons',
array(
Expand Down
7 changes: 4 additions & 3 deletions src/addons/controller/Plugin_Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
class Plugin_Controller {



/**
* @var Settings_Service_Interface
*/
Expand Down Expand Up @@ -69,9 +70,9 @@ function () {
/** @var Base_Cookiebot_Addon $addon */
foreach ( $this->settings_service->get_active_addons() as $addon ) {
if ( ! $addon->cookie_consent->are_cookie_states_accepted( $addon->get_cookie_types() )
|| cookiebot_addons_enabled_cache_plugin() ) {
|| cookiebot_addons_enabled_cache_plugin() ) {
$addon->load_addon_configuration();
$addons_enabled_counter++;
++$addons_enabled_counter;
}
}

Expand All @@ -90,7 +91,7 @@ function () {
* @since 1.3.0
*/
public function run_buffer_output_manipulations() {
/**
/**
* @var $buffer_output Buffer_Output_Interface
*/
$buffer_output = $this->settings_service->container->get( 'Buffer_Output_Interface' );
Expand Down
3 changes: 2 additions & 1 deletion src/addons/controller/addons/Base_Cookiebot_Addon.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

abstract class Base_Cookiebot_Addon {


use Class_Constant_Override_Validator_Trait;
use Extra_Information_Trait;

Expand Down Expand Up @@ -151,7 +152,7 @@ final public function get_installed_version() {
);

if ( $alternative_version_addon_instance->is_addon_installed() &&
version_compare( $alternative_version_addon_instance->get_version(), $version_string, '<=' ) ) {
version_compare( $alternative_version_addon_instance->get_version(), $version_string, '<=' ) ) {
return $alternative_version_addon_instance;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

abstract class Base_Cookiebot_Other_Addon extends Base_Cookiebot_Addon {


/**
* @return bool
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

abstract class Base_Cookiebot_Plugin_Addon extends Base_Cookiebot_Addon {


const PLUGIN_FILE_PATH = '';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

abstract class Base_Cookiebot_Theme_Addon extends Base_Cookiebot_Addon {


/**
* @return bool
*/
Expand Down
3 changes: 2 additions & 1 deletion src/addons/controller/addons/add_to_any/Add_To_Any.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

class Add_To_Any extends Base_Cookiebot_Plugin_Addon {


const ADDON_NAME = 'addToAny Share Buttons';
const DEFAULT_PLACEHOLDER_CONTENT = 'Please accept [renew_consent]%cookie_types[/renew_consent] cookies to enable Social Share buttons.';
const OPTION_NAME = 'add_to_any';
Expand Down Expand Up @@ -93,7 +94,7 @@ public function get_extra_information() {
/**
* Display a placeholder on elements with "addtoany_share_save_container" class name.
*
* @param string $content
* @param string $content
*
* @return string
*/
Expand Down
1 change: 1 addition & 0 deletions src/addons/controller/addons/addthis/Addthis.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

class Addthis extends Base_Cookiebot_Plugin_Addon {


const ADDON_NAME = 'WordPress Share Buttons Plugin – AddThis';
const OPTION_NAME = 'addthis';
const DEFAULT_COOKIE_TYPES = array( 'marketing', 'statistics' );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

class CAOS_Host_Analyticsjs_Local extends Base_Cookiebot_Plugin_Addon {


const ADDON_NAME = 'Complete Analytics Optimization Suite (CAOS)';
const OPTION_NAME = 'caos_host_analyticsjs_local';
const DEFAULT_COOKIE_TYPES = array( 'statistics' );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

class CAOS_Host_Analyticsjs_Local_Version_1_97 extends Base_Cookiebot_Plugin_Addon {


const ADDON_NAME = 'Complete Analytics Optimization Suite (CAOS) 1.97';
const OPTION_NAME = 'caos_host_analyticsjs_local';
const DEFAULT_COOKIE_TYPES = array( 'statistics' );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

class CAOS_Host_Analyticsjs_Local_Version_4_2_6 extends Base_Cookiebot_Plugin_Addon {


const ADDON_NAME = 'Complete Analytics Optimization Suite (CAOS) 4.2.6';
const OPTION_NAME = 'caos_host_analyticsjs_local';
const DEFAULT_COOKIE_TYPES = array( 'statistics' );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

class Custom_Facebook_Feed extends Base_Cookiebot_Plugin_Addon {


const ADDON_NAME = 'Custom Facebook Feed';
const OPTION_NAME = 'custom_facebook_feed';
const PLUGIN_FILE_PATH = 'custom-facebook-feed/custom-facebook-feed.php';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@

class Custom_Facebook_Feed_Version_2_17_1 extends Base_Cookiebot_Plugin_Addon {


const ADDON_NAME = 'Custom Facebook Feed (<= 2.17.1)';
const OPTION_NAME = 'custom_facebook_feed';
const PLUGIN_FILE_PATH = 'custom-facebook-feed/custom-facebook-feed.php';
const DEFAULT_COOKIE_TYPES = array( 'marketing' );
const DEFAULT_PLACEHOLDER_CONTENT = 'Please accept [renew_consent]%cookie_types[/renew_consent] cookies to watch this video.';
const SVN_URL_BASE_PATH = 'https://plugins.svn.wordpress.org/custom-facebook-feed/tags/2.17.1/';
const SVN_URL_DEFAULT_SUB_PATH = 'custom-facebook-feed.php';

/**
* Manipulate the scripts if they are loaded.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

class Custom_Facebook_Feed_Pro extends Base_Cookiebot_Plugin_Addon {


const ADDON_NAME = 'Custom Facebook Feed Pro';
const OPTION_NAME = 'custom_facebook_feed_pro';
const PLUGIN_FILE_PATH = 'custom-facebook-feed-pro/custom-facebook-feed.php';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

class Embed_Autocorrect extends Base_Cookiebot_Other_Addon {


const ADDON_NAME = 'Embed autocorrect';
const OPTION_NAME = 'embed_autocorrect';
const DEFAULT_COOKIE_TYPES = array( 'marketing', 'statistics' );
Expand Down
1 change: 1 addition & 0 deletions src/addons/controller/addons/enfold/Enfold.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

class Enfold extends Base_Cookiebot_Theme_Addon {


const ADDON_NAME = 'Enfold';
const OPTION_NAME = 'enfold';
const DEFAULT_PLACEHOLDER_CONTENT = 'Please accept [renew_consent]%cookie_types[/renew_consent] cookies to enable Google Services.';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

class Enhanced_Ecommerce_For_WooCommerce_Store extends Base_Cookiebot_Plugin_Addon {


const ADDON_NAME = 'Enhanced Ecommerce Google Analytics Plugin for WooCommerce';
const DEFAULT_PLACEHOLDER_CONTENT = 'Please accept [renew_consent]%cookie_types[/renew_consent] cookies to enable Social Share buttons.';
const OPTION_NAME = 'enhanced_ecommerce_for_woocommerce_store';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

class Facebook_For_Woocommerce extends Base_Cookiebot_Plugin_Addon {


const ADDON_NAME = 'Facebook For WooCommerce';
const DEFAULT_PLACEHOLDER_CONTENT = 'Please accept [renew_consent]%cookie_types[/renew_consent] cookies to enable facebook shopping feature.';
const OPTION_NAME = 'facebook_for_woocommerce';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use cybot\cookiebot\addons\controller\addons\Base_Cookiebot_Plugin_Addon;

class Ga_Google_Analytics extends Base_Cookiebot_Plugin_Addon {

const ADDON_NAME = 'GA Google Analytics';
const OPTION_NAME = 'ga_google_analytics';
const PLUGIN_FILE_PATH = 'ga-google-analytics/ga-google-analytics.php';
Expand Down
3 changes: 2 additions & 1 deletion src/addons/controller/addons/gadwp/Gadwp.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@


class Gadwp extends Base_Cookiebot_Plugin_Addon {

const ADDON_NAME = 'Google Analytics Dashboard for WP by ExactMetrics';
const OPTION_NAME = 'gadwp';
const PLUGIN_FILE_PATH = 'google-analytics-dashboard-for-wp/gadwp.php';
Expand Down Expand Up @@ -61,7 +62,7 @@ public function load_addon_configuration() {

add_filter(
'exactmetrics_tracking_analytics_script_attributes',
function( $atts ) {
function ( $atts ) {
$atts['type'] = 'text/plain';
$atts['data-cookieconsent'] = cookiebot_addons_output_cookie_types( $this->get_cookie_types() );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use cybot\cookiebot\addons\controller\addons\Base_Cookiebot_Plugin_Addon;

class Google_Analyticator extends Base_Cookiebot_Plugin_Addon {

const ADDON_NAME = 'Google Analyticator';
const OPTION_NAME = 'google_analyticator';
const PLUGIN_FILE_PATH = 'google-analyticator/google-analyticator.php';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use cybot\cookiebot\addons\controller\addons\Base_Cookiebot_Plugin_Addon;

class Google_Analytics extends Base_Cookiebot_Plugin_Addon {

const ADDON_NAME = 'Google Analytics'; // @TODO is this even the correct name for this plugin?
const OPTION_NAME = 'google_analytics';
const PLUGIN_FILE_PATH = 'googleanalytics/googleanalytics.php';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use cybot\cookiebot\addons\controller\addons\Base_Cookiebot_Plugin_Addon;

class Google_Analytics_Plus extends Base_Cookiebot_Plugin_Addon {

const ADDON_NAME = 'Google Analytics +';
const OPTION_NAME = 'google_analytics_plus';
const PLUGIN_FILE_PATH = 'google-analytics-async/google-analytics-async.php';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

class Google_Site_Kit extends Base_Cookiebot_Plugin_Addon {


const ADDON_NAME = 'Google Site Kit';
const OPTION_NAME = 'google_site_kit';
const DEFAULT_COOKIE_TYPES = array( 'marketing', 'statistics' );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

class Hubspot_Leadin extends Base_Cookiebot_Plugin_Addon {


const ADDON_NAME = 'HubSpot - Free Marketing Plugin for WordPress';
const DEFAULT_PLACEHOLDER_CONTENT = 'Please accept [renew_consent]%cookie_types[/renew_consent] cookies to enable tracking.';
const OPTION_NAME = 'hubspot_leadin';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

class Hubspot_Tracking_Code extends Base_Cookiebot_Plugin_Addon {


const ADDON_NAME = 'Hubspot Tracking Code';
const DEFAULT_PLACEHOLDER_CONTENT = 'Please accept [renew_consent]%cookie_types[/renew_consent] cookies to enable tracking.';
const OPTION_NAME = 'hubspot_tracking_code';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

class Instagram_Feed extends Base_Cookiebot_Plugin_Addon {


const ADDON_NAME = 'Instagram feed';
const DEFAULT_PLACEHOLDER_CONTENT = 'Please accept [renew_consent]%cookie_types[/renew_consent] cookies to enable instagram feed.';
const OPTION_NAME = 'instagram_feed';
Expand Down
1 change: 1 addition & 0 deletions src/addons/controller/addons/jetpack/Jetpack.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

class Jetpack extends Base_Cookiebot_Plugin_Addon {


const ADDON_NAME = 'Jetpack';
const DEFAULT_PLACEHOLDER_CONTENT = 'Please accept [renew_consent]%cookie_types[/renew_consent] cookies to enable tracking.';
const OPTION_NAME = 'jetpack';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

abstract class Base_Jetpack_Widget {


use Class_Constant_Override_Validator_Trait;
use Extra_Information_Trait;

Expand Down Expand Up @@ -214,5 +215,6 @@ abstract public function load_configuration();
* @param string $view
* @param string $widget
*/
public function cookie_consent_div( $view, $widget ) {}
public function cookie_consent_div( $view, $widget ) {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use function cybot\cookiebot\lib\cookiebot_addons_cookieconsent_optout;

class Facebook_Jetpack_Widget extends Base_Jetpack_Widget {

const LABEL = 'Facebook';
const WIDGET_OPTION_NAME = 'facebook';
const DEFAULT_PLACEHOLDER = 'Please accept [renew_consent]%cookie_types[/renew_consent] cookies to see facebook widget.';
Expand Down Expand Up @@ -71,5 +72,4 @@ public function get_extra_information() {
__( 'Facebook widget.', 'cookiebot' ),
);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use function cybot\cookiebot\lib\cookiebot_addons_manipulate_script;

class Goodreads_Jetpack_Widget extends Base_Jetpack_Widget {

const LABEL = 'Goodreads';
const WIDGET_OPTION_NAME = 'goodreads';
const DEFAULT_PLACEHOLDER = 'Please accept [renew_consent]%cookie_types[/renew_consent] cookies to watch goodreads.';
Expand Down Expand Up @@ -118,5 +119,4 @@ public function cookie_consent_div( $view, $widget ) {
</div>';
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

class Google_Maps_Jetpack_Widget extends Base_Jetpack_Widget {


const LABEL = 'Google Maps';
const WIDGET_OPTION_NAME = 'google_maps';
const DEFAULT_PLACEHOLDER = 'Please accept [renew_consent]%cookie_types[/renew_consent] cookies to enable google maps.';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

class Googleplus_Badge_Jetpack_Widget extends Base_Jetpack_Widget {


const LABEL = 'Google Plus Badge';
const WIDGET_OPTION_NAME = 'googleplus_badge';
const DEFAULT_PLACEHOLDER = 'Please accept [renew_consent]%cookie_types[/renew_consent] cookies to enable google plus badge.';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

class Twitter_Timeline_Jetpack_Widget extends Base_Jetpack_Widget {


const LABEL = 'Twitter timeline';
const WIDGET_OPTION_NAME = 'twitter_timeline';
const DEFAULT_PLACEHOLDER = 'Please accept [renew_consent]%cookie_types[/renew_consent] cookies to watch this twitterline.';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use function cybot\cookiebot\lib\cookiebot_addons_remove_class_action;

class Visitor_Cookies_Jetpack_Widget extends Base_Jetpack_Widget {

const LABEL = 'Visitor cookies';
const WIDGET_OPTION_NAME = 'visitor_cookies';
const DEFAULT_PLACEHOLDER = 'Please accept [renew_consent]%cookie_types[/renew_consent] cookies to watch this video.';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

class Litespeed_Cache extends Base_Cookiebot_Plugin_Addon {


const ADDON_NAME = 'Litespeed Cache';
const DEFAULT_PLACEHOLDER_CONTENT = 'This is not used.';
const OPTION_NAME = 'litespeed_cache';
Expand All @@ -30,7 +31,7 @@ public function load_addon_configuration() {
/**
* Exclude scripts from Litespeed cache’s defer JS option.
*
* @param array $excluded_files Array of script URLs to be excluded
* @param array $excluded_files Array of script URLs to be excluded
*
* @return array Extended array script URLs to be excluded
*
Expand Down
Loading

0 comments on commit 3a18817

Please sign in to comment.