/home/mojo9353/neve.cool/wp-content/plugins/complianz-gdpr/functions.php
if (!function_exists('cmplz_create_webp')){
function cmplz_create_webp($file, $new_src) {
switch ( $file ) {
case strpos( $file, '.jpeg' )!==false:
case strpos( $file, '.jpg' )!==false:
$ext = array(".jpeg", '.jpg');
break;
case strpos( $file, 'png' )!==false:
$ext = '.png';
break;
default:
return $new_src;
}
//@todo: new filename is returned by save, so can be used for output instead of brute force extension replace.
$webp_file = str_replace( $ext, ".webp", $file );
$webp_new_src = str_replace( $ext, ".webp", $new_src );
$image = wp_get_image_editor($file);
$result = $image->save($webp_file, 'image/webp');
if ( is_wp_error( $result ) ) {
return $new_src;
}
return file_exists($webp_file) ? $webp_new_src : $new_src;
}
}
if ( ! function_exists( 'cmplz_used_cookies' ) ) {
function cmplz_used_cookies() {
$services_template = cmplz_get_template( 'cookiepolicy/services.php' );
$cookies_row = cmplz_get_template( 'cookiepolicy/cookies_row.php' );
$purpose_row = cmplz_get_template( 'cookiepolicy/purpose_row.php' );
$language = substr( get_locale(), 0, 2 );
$args = array(
'language' => $language,
'showOnPolicy' => true,
'hideEmpty' => true,
'ignored' => false
);
/home/mojo9353/neve.cool/wp-content/plugins/complianz-gdpr/functions.php
$new_src = cmplz_default_placeholder();
} else {
//remove current file
if ( file_exists( $file ) ) {
unlink( $file );
}
//in case the server prevents deletion, we check it again.
if ( ! file_exists( $file ) ) {
copy( $tmpfile, $file );
}
}
if ( is_string( $tmpfile ) && file_exists( $tmpfile ) ) {
unlink( $tmpfile );
} // must unlink afterwards
if ( file_exists( $file ) ) {
try {
$new_src = cmplz_create_webp( $file, $new_src );
} catch ( Exception $e ) {
if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
error_log( $e->getMessage() );
}
}
}
if ( ! file_exists( $file ) ) {
return cmplz_default_placeholder();
}
return $new_src;
}
}
//if (!function_exists('cmplz_create_webp')){
// function cmplz_create_webp($file, $new_src) {
// //check webp availability
// if (
// !function_exists('imagecreatefromjpeg') ||
/home/mojo9353/neve.cool/wp-content/plugins/complianz-gdpr/integrations/services/youtube.php
$youtube_id = cmplz_youtube_get_video_id_from_series($src);
cmplz_set_transient( "cmplz_youtube_videoseries_video_id_$series_id", $youtube_id, WEEK_IN_SECONDS );
}
} else{
$youtube_id = cmplz_youtube_get_video_id_from_series($src);
}
}
/**
* The highest resolution of youtube thumbnail is the maxres, but it does not
* always exist. In that case, we take the hq thumb
* To lower the number of file exists checks, we cache the result.
*
* */
$new_src = cmplz_get_transient( "cmplz_youtube_image_$youtube_id" );
if ( ! $new_src || ! cmplz_file_exists_on_url( $new_src ) ) {
$new_src = "https://img.youtube.com/vi/$youtube_id/maxresdefault.jpg";
if ( ! cmplz_remote_file_exists( $new_src ) ) {
$new_src = "https://img.youtube.com/vi/$youtube_id/hqdefault.jpg";
}
$new_src = cmplz_download_to_site( $new_src, 'youtube' . $youtube_id );
cmplz_set_transient( "cmplz_youtube_image_$youtube_id", $new_src, WEEK_IN_SECONDS );
}
}
return $new_src;
}
add_filter( 'cmplz_placeholder_youtube', 'cmplz_youtube_placeholder', 10, 2 );
/home/mojo9353/neve.cool/wp-includes/class-wp-hook.php
$this->iterations[ $nesting_level ] = $this->priorities;
$num_args = count( $args );
do {
$this->current_priority[ $nesting_level ] = current( $this->iterations[ $nesting_level ] );
$priority = $this->current_priority[ $nesting_level ];
foreach ( $this->callbacks[ $priority ] as $the_ ) {
if ( ! $this->doing_action ) {
$args[0] = $value;
}
// Avoid the array_slice() if possible.
if ( 0 === $the_['accepted_args'] ) {
$value = call_user_func( $the_['function'] );
} elseif ( $the_['accepted_args'] >= $num_args ) {
$value = call_user_func_array( $the_['function'], $args );
} else {
$value = call_user_func_array( $the_['function'], array_slice( $args, 0, $the_['accepted_args'] ) );
}
}
} while ( false !== next( $this->iterations[ $nesting_level ] ) );
unset( $this->iterations[ $nesting_level ] );
unset( $this->current_priority[ $nesting_level ] );
--$this->nesting_level;
return $value;
}
/**
* Calls the callback functions that have been added to an action hook.
*
* @since 4.7.0
*
* @param array $args Parameters to pass to the callback functions.
/home/mojo9353/neve.cool/wp-includes/plugin.php
$all_args = func_get_args(); // phpcs:ignore PHPCompatibility.FunctionUse.ArgumentFunctionsReportCurrentValue.NeedsInspection
_wp_call_all_hook( $all_args );
}
if ( ! isset( $wp_filter[ $hook_name ] ) ) {
if ( isset( $wp_filter['all'] ) ) {
array_pop( $wp_current_filter );
}
return $value;
}
if ( ! isset( $wp_filter['all'] ) ) {
$wp_current_filter[] = $hook_name;
}
// Pass the value to WP_Hook.
array_unshift( $args, $value );
$filtered = $wp_filter[ $hook_name ]->apply_filters( $value, $args );
array_pop( $wp_current_filter );
return $filtered;
}
/**
* Calls the callback functions that have been added to a filter hook, specifying arguments in an array.
*
* @since 3.0.0
*
* @see apply_filters() This function is identical, but the arguments passed to the
* functions hooked to `$hook_name` are supplied using an array.
*
* @global WP_Hook[] $wp_filter Stores all of the filters and actions.
* @global int[] $wp_filters Stores the number of times each filter was triggered.
* @global string[] $wp_current_filter Stores the list of current filters with the current one last.
*
* @param string $hook_name The name of the filter hook.
* @param array $args The arguments supplied to the functions hooked to `$hook_name`.
/home/mojo9353/neve.cool/wp-content/plugins/complianz-gdpr/functions.php
}
}
if ( ! function_exists( 'cmplz_placeholder' ) ) {
/**
* Get placeholder for any type of blocked content
*
* @param bool|string $type
* @param string $src
*
* @return string url
*
* @since 2.1.0
*/
function cmplz_placeholder( $type = false, $src = '' ) {
if ( ! $type ) {
$type = cmplz_get_service_by_src( $src );
}
$new_src = cmplz_default_placeholder( $type );
$new_src = apply_filters( "cmplz_placeholder_$type", $new_src, $src );
$new_src = apply_filters( 'cmplz_placeholder', $new_src, $type, $src );
return $new_src;
}
}
if ( ! function_exists( 'cmplz_count_socialmedia' ) ) {
/**
* count the number of social media used on the site
*
* @return int
*/
function cmplz_count_socialmedia() {
$sm = cmplz_get_option( 'socialmedia_on_site' );
if ( ! $sm ) {
return 0;
}
if ( ! is_array( $sm ) ) {
return 1;
}
/home/mojo9353/neve.cool/wp-content/plugins/complianz-gdpr/class-cookie-blocker.php
$is_video = $this->is_video( $iframe_src );
$service_name = $this->sanitize_service_name($tag['name']);
$new = $total_match;
$new = preg_replace( '~<iframe\\s~i', '<iframe data-cmplz-target="'.apply_filters('cmplz_data_target', 'src', $total_match).'" data-src-cmplz="' . $iframe_src . '" ', $new , 1 ); // make sure we replace it only once
//remove lazy loading for iframes, as it is breaking on activation
$new = str_replace('loading="lazy"', 'data-deferlazy="1"', $new );
//check if we can skip blocking this array if a specific string is included
if ( cmplz_strpos_arr($total_match, $whitelisted_script_tags) ) continue;
//we insert video/no-video class for specific video styling
$video_class = $is_video ? 'cmplz-video' : 'cmplz-no-video';
$video_class = apply_filters( 'cmplz_video_class', $video_class );
$new = $this->replace_src( $new, apply_filters( 'cmplz_source_placeholder', 'about:blank' ) );
$new = $this->add_class( $new, 'iframe', "cmplz-iframe cmplz-iframe-styles $video_class " );
$new = $this->add_data( $new, 'iframe', 'service', $service_name );
$new = $this->add_data( $new, 'iframe', 'category', $tag['category'] );
if ( cmplz_use_placeholder( $iframe_src ) ) {
$placeholder = cmplz_placeholder($tag['placeholder'], $iframe_src );
$new = $this->add_class( $new, 'iframe', "cmplz-placeholder-element" );
$new = $this->add_data( $new, 'iframe', 'placeholder-image', $placeholder );
//allow for integrations to override html
$new = apply_filters( 'cmplz_iframe_html', $new );
//make sure there is a parent element which contains this iframe only, to attach the placeholder to
if ( ! $is_video
&& ! $this->no_div( $iframe_src )
) {
$new = '<div class="cmplz-placeholder-parent">' . $new . '</div>';
}
}
$output = str_replace( $total_match, $new, $output );
}
}
}
/**
* specific classic wp video shortcode integration
*/
/home/mojo9353/neve.cool/wp-content/plugins/complianz-gdpr/class-cookie-blocker.php
$whitelisted_script_tags = array_merge($flat, $whitelisted_script_tags );
}
return $whitelisted_script_tags;
}
/**
* Apply the mixed content fixer.
*
* @since 1.0
*
* @access public
*
*/
public function filter_buffer( $buffer ) {
if ( cmplz_is_amp() ) {
$buffer = apply_filters( 'cmplz_cookieblocker_amp', $buffer );
} else {
$buffer = $this->replace_tags( $buffer );
}
return $buffer;
}
/**
* Start buffering the output
*
* @since 1.0
*
* @access public
*
*/
public function start_buffer() {
/**
* Don't activate the cookie blocker is AMP is active, but the AMP integration is not enabled
* This problem only occurs for manually included iframes, not for WP generated embeds
*/
/home/mojo9353/neve.cool/wp-includes/functions.php
if ( wp_is_block_theme() ) {
$submenu['themes.php'][] = array( $menu_name, 'edit_theme_options', 'widgets.php' );
} else {
$submenu['themes.php'][8] = array( $menu_name, 'edit_theme_options', 'widgets.php' );
}
ksort( $submenu['themes.php'], SORT_NUMERIC );
}
/**
* Flushes all output buffers for PHP 5.2.
*
* Make sure all output buffers are flushed before our singletons are destroyed.
*
* @since 2.2.0
*/
function wp_ob_end_flush_all() {
$levels = ob_get_level();
for ( $i = 0; $i < $levels; $i++ ) {
ob_end_flush();
}
}
/**
* Loads custom DB error or display WordPress DB error.
*
* If a file exists in the wp-content directory named db-error.php, then it will
* be loaded instead of displaying the WordPress DB error. If it is not found,
* then the WordPress DB error will be displayed instead.
*
* The WordPress DB error sets the HTTP status header to 500 to try to prevent
* search engines from caching the message. Custom DB messages should do the
* same.
*
* This function was backported to WordPress 2.3.2, but originally was added
* in WordPress 2.5.0.
*
* @since 2.3.2
*
* @global wpdb $wpdb WordPress database abstraction object.
/home/mojo9353/neve.cool/wp-includes/class-wp-hook.php
$this->iterations[ $nesting_level ] = $this->priorities;
$num_args = count( $args );
do {
$this->current_priority[ $nesting_level ] = current( $this->iterations[ $nesting_level ] );
$priority = $this->current_priority[ $nesting_level ];
foreach ( $this->callbacks[ $priority ] as $the_ ) {
if ( ! $this->doing_action ) {
$args[0] = $value;
}
// Avoid the array_slice() if possible.
if ( 0 === $the_['accepted_args'] ) {
$value = call_user_func( $the_['function'] );
} elseif ( $the_['accepted_args'] >= $num_args ) {
$value = call_user_func_array( $the_['function'], $args );
} else {
$value = call_user_func_array( $the_['function'], array_slice( $args, 0, $the_['accepted_args'] ) );
}
}
} while ( false !== next( $this->iterations[ $nesting_level ] ) );
unset( $this->iterations[ $nesting_level ] );
unset( $this->current_priority[ $nesting_level ] );
--$this->nesting_level;
return $value;
}
/**
* Calls the callback functions that have been added to an action hook.
*
* @since 4.7.0
*
* @param array $args Parameters to pass to the callback functions.
/home/mojo9353/neve.cool/wp-includes/class-wp-hook.php
} while ( false !== next( $this->iterations[ $nesting_level ] ) );
unset( $this->iterations[ $nesting_level ] );
unset( $this->current_priority[ $nesting_level ] );
--$this->nesting_level;
return $value;
}
/**
* Calls the callback functions that have been added to an action hook.
*
* @since 4.7.0
*
* @param array $args Parameters to pass to the callback functions.
*/
public function do_action( $args ) {
$this->doing_action = true;
$this->apply_filters( '', $args );
// If there are recursive calls to the current action, we haven't finished it until we get to the last one.
if ( ! $this->nesting_level ) {
$this->doing_action = false;
}
}
/**
* Processes the functions hooked into the 'all' hook.
*
* @since 4.7.0
*
* @param array $args Arguments to pass to the hook callbacks. Passed by reference.
*/
public function do_all_hook( &$args ) {
$nesting_level = $this->nesting_level++;
$this->iterations[ $nesting_level ] = $this->priorities;
do {
$priority = current( $this->iterations[ $nesting_level ] );
/home/mojo9353/neve.cool/wp-includes/plugin.php
if ( ! isset( $wp_filter[ $hook_name ] ) ) {
if ( isset( $wp_filter['all'] ) ) {
array_pop( $wp_current_filter );
}
return;
}
if ( ! isset( $wp_filter['all'] ) ) {
$wp_current_filter[] = $hook_name;
}
if ( empty( $arg ) ) {
$arg[] = '';
} elseif ( is_array( $arg[0] ) && 1 === count( $arg[0] ) && isset( $arg[0][0] ) && is_object( $arg[0][0] ) ) {
// Backward compatibility for PHP4-style passing of `array( &$this )` as action `$arg`.
$arg[0] = $arg[0][0];
}
$wp_filter[ $hook_name ]->do_action( $arg );
array_pop( $wp_current_filter );
}
/**
* Calls the callback functions that have been added to an action hook, specifying arguments in an array.
*
* @since 2.1.0
*
* @see do_action() This function is identical, but the arguments passed to the
* functions hooked to `$hook_name` are supplied using an array.
*
* @global WP_Hook[] $wp_filter Stores all of the filters and actions.
* @global int[] $wp_actions Stores the number of times each action was triggered.
* @global string[] $wp_current_filter Stores the list of current filters with the current one last.
*
* @param string $hook_name The name of the action to be executed.
* @param array $args The arguments supplied to the functions hooked to `$hook_name`.
*/
function do_action_ref_array( $hook_name, $args ) {
/home/mojo9353/neve.cool/wp-includes/load.php
$_COOKIE = add_magic_quotes( $_COOKIE );
$_SERVER = add_magic_quotes( $_SERVER );
// Force REQUEST to be GET + POST.
$_REQUEST = array_merge( $_GET, $_POST );
}
/**
* Runs just before PHP shuts down execution.
*
* @since 1.2.0
* @access private
*/
function shutdown_action_hook() {
/**
* Fires just before PHP shuts down execution.
*
* @since 1.2.0
*/
do_action( 'shutdown' );
wp_cache_close();
}
/**
* Clones an object.
*
* @since 2.7.0
* @deprecated 3.2.0
*
* @param object $input_object The object to clone.
* @return object The cloned object.
*/
function wp_clone( $input_object ) {
// Use parens for clone to accommodate PHP 4. See #17880.
return clone( $input_object );
}
/**
* Determines whether the current request is for the login screen.