Headline
CVE-2023-5001: horizontal-scrolling-announcement.php in horizontal-scrolling-announcement/trunk – WordPress Plugin Repository
The Horizontal scrolling announcement for WordPress plugin for WordPress is vulnerable to Stored Cross-Site Scripting via ‘horizontal-scrolling’ shortcode in versions up to, and including, 9.2 due to insufficient input sanitization and output escaping on user supplied attributes. This makes it possible for authenticated attackers with contributor-level and above permissions to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page.
1<?php2/*3Plugin Name: Horizontal scrolling announcement4Plugin URI: https://juliencayzac.me/plugin/5Description: This horizontal scrolling announcement wordpress plug-in let’s scroll the content from one end to another end like reel. 6Version: 9.27Author: Gopi Ramasamy, juliencayzac8Author URI: http://www.gopiplus.com/work/2010/07/18/horizontal-scrolling-announcement/9License: GPLv2 or later10License URI: http://www.gnu.org/licenses/gpl-2.0.html11*/12if ( ! defined( ‘ABSPATH’ ) ) exit; 1314global $wpdb, $wp_version, $hsa_db_version;15define(“WP_HSA_TABLE", $wpdb->prefix . “hsa_plugin”);16define(“WP_hsa_UNIQUE_NAME", “horizontal-scrolling-announcement”);17define(“WP_hsa_TITLE", “Horizontal scrolling announcement”);18define('WP_hsa_FAV’, ‘https://juliencayzac.me/plugin/’);19define('WP_hsa_LINK’, 'Check official website for more Community built Announcement bar Styles - <a href="’.WP_hsa_FAV.’” target="_blank">click here</a>’);20$hsa_db_version = “7.9";21222324add_shortcode( 'horizontal-scrolling’, ‘HSA_shortcode’ );2526function HSA_shortcode( $atts ) 27{28 // [horizontal-scrolling group="GROUP1”]29 // [horizontal-scrolling group="GROUP1” scrollamount="” scrolldelay="" direction=""]30 31 global $wpdb;32 $group = “";33 $scrollamount = “";34 $scrolldelay = “";35 $direction = “";36 $style = “";37 3839 if ( is_array( $atts ) )40 {41 foreach(array_keys($atts) as $key)42 {43 if($key == “group”)44 {45 $group = $atts[“group”];46 }47 elseif($key == “scrollamount”)48 {49 $scrollamount = $atts[“scrollamount”];50 }51 elseif($key == “scrolldelay”)52 {53 $scrolldelay = $atts[“scrolldelay”];54 }55 elseif($key == “direction”)56 {57 $direction = $atts[“direction”];58 }59 elseif($key == “style”)60 {61 $style = $atts[“style”];62 }63 64 65 66 67 }68 }69 if(empty($group))70 {71 return “Please specify the group";72 }7374 $sSql = “select hsa_text,hsa_link,hsa_target,hsa_options from “.WP_HSA_TABLE.” where hsa_status=’YES’";75 $sSql = $sSql . " and ( hsa_dateend >= NOW() or hsa_dateend = ‘0000-00-00 00:00:00’)“;76 $sSql = $sSql . " and ( hsa_datestart <= NOW() or hsa_datestart = ‘0000-00-00 00:00:00’)“;77 if($group <> “”)78 {79 $sSql = $sSql . " and hsa_group=’$group’";80 }81 $sSql = $sSql . " ORDER BY hsa_order";82 8384 85 $data = $wpdb->get_results($sSql);86 87 88 $what_marquee = “"; 89 90 91 if ( ! empty($data) ) 92 {93 $cnt = 0;94 $hsa = “";95 $link = “";96 $post_id=get_the_ID();97 98 foreach ( $data as $data ) 99 {100 $link = $data->hsa_link;101 $target = $data->hsa_target;102 $custom_css=’’;103 104 105 106 if(!empty($data->hsa_options) && $group==’fixed’)107 {108 109 $hsa_options=unserialize($data->hsa_options);110 111 112 113 if($hsa_options[‘hsa_homepage’]=="1”)114 {115 if(!is_front_page())116 continue;117 118 }119 else120 {121 if($hsa_options[‘hsa_whole_site’]!="1”)122 {123 if(!empty($hsa_options[‘hsa_posts_ids’]))124 { 125 $post_ids=explode(“,",$hsa_options[‘hsa_posts_ids’]);126 $post_id=trim($post_id);127 $post_ids = array_map('trim’, $post_ids);128 if(!in_array($post_id,$post_ids))129 {130 131 continue;132 }133 134 135 }136 else137 {138 continue;139 }140 141 }142 }143 144 if($hsa_options[‘hsa_show_only_mobile’]=="1”)145 {146 if(!wp_is_mobile())147 {148 continue;149 150 }151 152 }153 154 if($hsa_options[‘hsa_hide_only_mobile’]=="1”)155 {156 if(wp_is_mobile())157 {158 continue;159 160 }161 162 }163 164 if($hsa_options[‘hsa_show_only_google’]=="1”)165 {166 167 if(!strstr($_SERVER[‘HTTP_REFERER’],’google.’))168 {169 continue;170 }171 172 }173 174 175 $hsa_social_container="";176 $hsa_img=""; 177 178 if($hsa_options[‘hsa_show_socail_icons’]=="1”)179 {180 181182 $hsa_fb_page_url = get_option(‘hsa_fb_page_url’);183 $hsa_youtube_channel_url = get_option(‘hsa_youtube_channel_url’);184 $hsa_twitter_url = get_option(‘hsa_twitter_url’);185 $hsa_googlep_url = get_option(‘hsa_googlep_url’);186 187 188 189 190 if(!empty($hsa_fb_page_url))191 {192 $hsa_img.=’<a href="’.$hsa_fb_page_url.’” target="_blank” class="fixed-social-icons"><div class="icon-facebook margin5"></div></a>’;193 }194 if(!empty($hsa_youtube_channel_url))195 {196 $hsa_img.=’<a href="’.$hsa_youtube_channel_url.’” target="_blank” class="fixed-social-icons"><div class="icon-youtube-play margin5"></div></a>’;197 }198 if(!empty($hsa_twitter_url))199 {200 $hsa_img.=’<a href="’.$hsa_twitter_url.’” target="_blank” class="fixed-social-icons"><div class="icon-twitter margin5"></div></a> ';201 }202 if(!empty($hsa_googlep_url))203 {204 $hsa_img.=’<a href="’.$hsa_googlep_url.’” target="_blank" class="fixed-social-icons"><div class="icon-gplus margin5"></div></span></a>’;205 }206 207 if(!empty($hsa_img))208 {209 $icons_align="right:0px;";210 if($hsa_options[‘hsa_align_socail_icons’]=="left")211 { 212 $icons_align="left:0px";213 }214 215 $hsa_social_container=’<div id="bar-social" style="’.$icons_align.’"><p class="follow-title">FOLLOW US</p>’.$hsa_social_container.$hsa_img.’</div>’;216 }217 218 219 220 }221 222 $call_to_action=’’;223 $befor_call_action=’’;224 $right_call_action=’’;225 if(!empty($hsa_options[‘hsa_call_action_text’]) && !empty($hsa_options[‘hsa_call_action_link’]))226 {227 228 $hsa_button_css="";229 230 if(!empty($hsa_options[‘hsa_button_color’]))231 $hsa_button_css="background-color:".$hsa_options[‘hsa_button_color’].";";232 233 if(!empty($hsa_options[‘hsa_button_text_color’]))234 $hsa_button_css.="color:".$hsa_options[‘hsa_button_text_color’].";"; 235 236 237 if(!empty($hsa_options[‘hsa_call_action_text’]))238 {239 240 if($hsa_options[‘hsa_call_action_position’]=="before")241 $befor_call_action=’<a href="’.$hsa_options[‘hsa_call_action_link’].’" target="_blank" class="abutton" style="’.$hsa_button_css.’">’.$hsa_options[‘hsa_call_action_text’].’</a>’;242 else243 $right_call_action=’<a href="’.$hsa_options[‘hsa_call_action_link’].’" target="_blank" class="abutton" style="’.$hsa_button_css.’">’.$hsa_options[‘hsa_call_action_text’].’</a>’;244245 }246 247 }248 249 $hsa_style="display:block;z-index:9999;width:100%;padding: 5px 0px 10px 0px;left:0px;";250 $hsa_class="";251 $hsa_anchor_style="text-decoration:none;";252 253 if(!empty($hsa_options[‘hsa_font_size’]))254 {255 $hsa_style.="font-size:".$hsa_options[‘hsa_font_size’]."px;";256 }257 if($hsa_options[‘hsa_textbold’]=="YES")258 {259 $hsa_style.="font-weight:600;";260 }261 262 if(!empty($hsa_options[‘hsa_text_color’]))263 {264 $hsa_style.="color:".$hsa_options[‘hsa_text_color’].";";265 $hsa_anchor_style.="color:".$hsa_options[‘hsa_text_color’].";";266 267 }268 if(!empty($hsa_options[‘hsa_back_color’]))269 {270 $hsa_style.="background-color:".$hsa_options[‘hsa_back_color’].";";271 }272 if(!empty($hsa_options[‘hsa_fixed_position’]))273 {274 if($hsa_options[‘hsa_fixed_position’]=="top")275 $hsa_style.="top:0px;";276 else if($hsa_options[‘hsa_fixed_position’]=="bottom" && $hsa_options[‘hsa_position’]=="fixed")277 $hsa_style.="bottom:0px;"; 278 279 }280 281 if(!empty($hsa_options[‘hsa_position’]))282 {283 $hsa_style.="position:".$hsa_options[‘hsa_position’].";";284 285 }286 287 if(!empty($hsa_options[‘hsa_text_alignment’]))288 {289 $hsa_style.="text-align:".$hsa_options[‘hsa_text_alignment’].";";290 291 }292 293 294 295 if(!empty($hsa_options[‘hsa_custom_css’]))296 {297 $hsa_style.=esc_html(stripslashes($hsa_options[‘hsa_custom_css’]));298 }299 if(!empty($hsa_options[‘hsa_append_class’]))300 {301 $hsa_class=stripslashes($hsa_options[‘hsa_append_class’]);302 303 }304 305 306 307 if($target == “”)308 {309 $target = “_self";310 }311 312 313 314 $parentLink="";315 if($link != “”) { $parentLink = $parentLink . “<a target=’".$target."’ href=’".$link."’";316 317 if($group=="fixed”)318 {319 $parentLink.="style=’".$hsa_anchor_style."’";320 }321 322 $parentLink.=">"; 323 324 }325 326 if($hsa_style!="”) 327 $hsa = $hsa . ‘<div style="’.$hsa_style.’"’;328 else329 $hsa = $hsa . ‘<div ‘;330 331 if($hsa_class!="")332 $hsa= $hsa.’ class="’.$hsa_class.’ fixed-announcement"’;333 else334 $hsa=$hsa.’ class="fixed-announcement"’;335 336 $hsa=$hsa.’>’.$hsa_social_container.$befor_call_action.$parentLink.stripslashes($data->hsa_text);337 338 339 if($link != “”) { $hsa = $hsa . “</a>"; }340 $hsa=$hsa.$right_call_action.’</div>’;341 342 }343 else344 {345 if($cnt==0) 346 { 347 if($link != “”) { $hsa = $hsa . “<a target=’".$target."’ href=’".$link."’>"; } 348 $hsa = $hsa . stripslashes($data->hsa_text);349 if($link != “”) { $hsa = $hsa . “</a>"; }350 }351 else352 {353 $hsa = $hsa . " “;354 if($link != “”) { $hsa = $hsa . “<a target=’".$target."’ href=’".$link."’>"; } 355 $hsa = $hsa . stripslashes($data->hsa_text);356 if($link != “”) { $hsa = $hsa . “</a>"; }357 } 358 $cnt = $cnt + 1;359 360 361 }}362363 364 365 if($scrollamount == “”)366 {367 $scrollamount = get_option(‘hsa_scrollamount’);368 }369 if($scrolldelay == “”)370 {371 $scrolldelay = get_option(‘hsa_scrolldelay’);372 }373 if($direction == “”)374 {375 $direction = get_option(‘hsa_direction’);376 }377 if($style == “”)378 {379 $style = get_option(‘hsa_style’);380 }381 $what_marquee = $what_marquee . “<div>";382 if($group==’fixed’)383 {384 385 $what_marquee = $what_marquee . $hsa;386 }387 else388 {389 $what_marquee = $what_marquee . “<marquee style=’$style’ scrollamount=’$scrollamount’ scrolldelay=’$scrolldelay’ direction=’$direction’ onmouseover=’this.stop()' onmouseout=’this.start()‘>";390 $what_marquee = $what_marquee . $hsa;391 $what_marquee = $what_marquee . "</marquee>";392 }393 394 395 $what_marquee = $what_marquee . "</div>";396 }397 else398 {399 if($group!=’fixed’)400 {401 $hsa_noannouncement = get_option(‘hsa_noannouncement’);402 if($hsa_noannouncement <> “”)403 {404 $what_marquee = $what_marquee . $hsa_noannouncement;405 }406 }407 }408409 return $what_marquee;410}411412function HSA_deactivate() 413{414 // No action required.415}416417function HSA_uninstall()418{419 global $wpdb;420 delete_option(‘hsa_title’);421 delete_option(‘hsa_scrollamount’);422 delete_option(‘hsa_scrolldelay’);423 delete_option(‘hsa_direction’);424 delete_option(‘hsa_style’);425 delete_option(‘hsa_pluginversion’);426 delete_option(‘hsa_noannouncement’);427 delete_option(‘hsa_capability’);428 delete_option(‘hsa_fb_page_url’);429 delete_option(‘hsa_youtube_channel_url’);430 delete_option(‘hsa_twitter_url’);431 delete_option(‘hsa_googlep_url’);432 if($wpdb->get_var(“show tables like '". WP_HSA_TABLE . “’”) == WP_HSA_TABLE) 433 {434 $wpdb->query(“DROP TABLE “. WP_HSA_TABLE);435 }436}437438function HSA_activation() 439{440 global $wpdb, $hsa_db_version;441 $hsa_pluginversion = “";442 $hsa_tableexists = “YES";443 $hsa_pluginversion = get_option(“hsa_pluginversion”);444 445 if($wpdb->get_var(“show tables like '". WP_HSA_TABLE . “’”) != WP_HSA_TABLE)446 {447 $hsa_tableexists = “NO";448 }449 450 if(($hsa_tableexists == “NO”) || ($hsa_pluginversion != $hsa_db_version)) 451 {452 $sSql = “CREATE TABLE “. WP_HSA_TABLE . " (453 hsa_id mediumint(9) NOT NULL AUTO_INCREMENT,454 hsa_text text NOT NULL,455 hsa_order int(11) NOT NULL default '1’,456 hsa_status char(3) NOT NULL default 'YES’,457 hsa_date datetime DEFAULT ‘0000-00-00 00:00:00’ NOT NULL, 458 hsa_link VARCHAR(1024) DEFAULT ‘#’ NOT NULL,459 hsa_group VARCHAR(100) DEFAULT ‘GROUP1’ NOT NULL,460 hsa_dateend datetime DEFAULT ‘0000-00-00 00:00:00’ NOT NULL,461 hsa_datestart datetime DEFAULT ‘0000-00-00 00:00:00’ NOT NULL,462 hsa_target VARCHAR(20) DEFAULT ‘_self’ NOT NULL,463 hsa_extra1 VARCHAR(100) DEFAULT ‘’ NOT NULL,464 hsa_extra2 VARCHAR(100) DEFAULT ‘’ NOT NULL,465 hsa_extra3 VARCHAR(100) DEFAULT ‘’ NOT NULL,466 hsa_extra4 VARCHAR(100) DEFAULT ‘’ NOT NULL,467 hsa_options VARCHAR(2000) DEFAULT ‘’ NOT NULL,468 UNIQUE KEY hsa_id (hsa_id)469 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;";470 require_once( ABSPATH . ‘wp-admin/includes/upgrade.php’ );471 dbDelta( $sSql );472 473 if($hsa_pluginversion == “”)474 {475 add_option('hsa_pluginversion’, “7.9”);476 }477 else478 {479 update_option( “hsa_pluginversion", $hsa_db_version );480 }481 482 if($hsa_tableexists == “NO”)483 {484 $welcome_text = “Congratulations, you just completed Horizontal Scrolling Announcement plugin installation."; 485 $rows_affected = $wpdb->insert( WP_HSA_TABLE , array( ‘hsa_text’ => $welcome_text) );486 }487 }488 489490 add_option('hsa_title’, “Announcement”);491 add_option('hsa_scrollamount’, “2”);492 add_option('hsa_scrolldelay’, “5”);493 add_option('hsa_direction’, “left”);494 add_option('hsa_style’, “”);495 add_option('hsa_noannouncement’, “No announcement available or all announcement expired.”);496 add_option('hsa_capability’, “manage_options”);497}498499function HSA_admin_options() 500{501 global $wpdb;502 $current_page = isset($_GET[‘ac’]) ? $_GET[‘ac’] : '’;503 switch($current_page)504 {505 case 'edit’:506 include(‘pages/content-management-edit.php’);507 break;508 case 'add’:509 include(‘pages/content-management-add.php’);510 break;511 case 'add_fixed’:512 include(‘pages/content-management-fixed-add.php’);513 break; 514 case 'edit_fixed’:515 include(‘pages/content-management-fixed-edit.php’);516 break; 517 case 'set’:518 include(‘pages/content-setting.php’);519 break;520 default:521 include(‘pages/content-management-show.php’);522 break;523 }524}525526function HSA_add_to_menu() 527{528 $hsa_capability = get_option(‘hsa_capability’);529 //manage_options(Administrator), edit_posts(Administrator/Editor/Author/Contributor), edit_others_pages(Administrator/Editor)530 if($hsa_capability == “”)531 {532 $hsa_capability = “manage_options";533 }534 if($hsa_capability <> “manage_options” && $hsa_capability <> “edit_posts” && $hsa_capability <> “edit_others_pages”)535 {536 $hsa_capability = “manage_options";537 }538 add_options_page('Horizontal scrolling announcement’, __('Horizontal Scrolling’, ‘horizontal-scrolling-announcement’), $hsa_capability, 'horizontal-scrolling-announcement’, ‘HSA_admin_options’ );539}540541class HSA_widget_register extends WP_Widget 542{543 function __construct() 544 {545 $widget_ops = array(‘classname’ => 'widget_text hsa-widget’, ‘description’ => __('Horizontal scrolling announcement’, ‘horizontal-scrolling-announcement’), ‘horizontal-scrolling’);546 parent::__construct('HorizontalScrolling’, __('Horizontal Scrolling’, ‘horizontal-scrolling-announcement’), $widget_ops);547 }548 549 function widget( $args, $instance ) 550 {551 extract( $args, EXTR_SKIP );552553 $title = apply_filters( 'widget_title’, empty( $instance[‘title’] ) ? ‘’ : $instance[‘title’], $instance, $this->id_base );554 $scrollamount = $instance[‘scrollamount’];555 $scrolldelay = $instance[‘scrolldelay’];556 $direction = $instance[‘direction’];557 $group = $instance[‘group’];558559 echo $args[‘before_widget’];560 if ( ! empty( $title ) )561 {562 echo $args[‘before_title’] . $title . $args[‘after_title’];563 }564 // Call widget method565 $arr = array();566 $arr[“scrollamount”] = $scrollamount;567 $arr[“scrolldelay”] = $scrolldelay;568 $arr[“direction”] = $direction;569 $arr[“group”] = $group;570 echo HSA_shortcode($arr);571 // Call widget method572 echo $args[‘after_widget’];573 }574 575 function update( $new_instance, $old_instance ) 576 {577 $instance = $old_instance;578 $instance[‘title’] = ( ! empty( $new_instance[‘title’] ) ) ? strip_tags( $new_instance[‘title’] ) : '’;579 $instance[‘scrollamount’] = ( ! empty( $new_instance[‘scrollamount’] ) ) ? strip_tags( $new_instance[‘scrollamount’] ) : '’;580 $instance[‘scrolldelay’] = ( ! empty( $new_instance[‘scrolldelay’] ) ) ? strip_tags( $new_instance[‘scrolldelay’] ) : '’;581 $instance[‘direction’] = ( ! empty( $new_instance[‘direction’] ) ) ? strip_tags( $new_instance[‘direction’] ) : '’;582 $instance[‘group’] = ( ! empty( $new_instance[‘group’] ) ) ? strip_tags( $new_instance[‘group’] ) : '’;583 return $instance;584 }585586 function form( $instance ) 587 {588 $defaults = array(589 ‘title’ => '’,590 ‘scrollamount’ => '’,591 ‘scrolldelay’ => '’,592 ‘direction’ => '’,593 ‘group’ => '’594 );595 596 $instance = wp_parse_args( (array) $instance, $defaults);597 $title = $instance[‘title’];598 $scrollamount = $instance[‘scrollamount’];599 $scrolldelay = $instance[‘scrolldelay’];600 $direction = $instance[‘direction’];601 $group = $instance[‘group’];602 603 ?>604 <p>605 <label for="<?php echo $this->get_field_id(‘title’); ?>"><?php _e('Title’, ‘horizontal-scrolling-announcement’); ?></label>606 <input class="widefat” id="<?php echo $this->get_field_id(‘title’); ?>” name="<?php echo $this->get_field_name(‘title’); ?>” type="text” value="<?php echo $title; ?>” />607 </p>608 <p>609 <label for="<?php echo $this->get_field_id(‘scrollamount’); ?>"><?php _e('Scroll amount’, ‘horizontal-scrolling-announcement’); ?></label>610 <input class="widefat” id="<?php echo $this->get_field_id(‘scrollamount’); ?>” name="<?php echo $this->get_field_name(‘scrollamount’); ?>” type="text” value="<?php echo $scrollamount; ?>” />611 </p>612 <p>613 <label for="<?php echo $this->get_field_id(‘scrolldelay’); ?>"><?php _e('Scroll delay’, ‘horizontal-scrolling-announcement’); ?></label>614 <input class="widefat” id="<?php echo $this->get_field_id(‘scrolldelay’); ?>” name="<?php echo $this->get_field_name(‘scrolldelay’); ?>” type="text” value="<?php echo $scrolldelay; ?>” />615 </p>616 <p>617 <label for="<?php echo $this->get_field_id(‘direction’); ?>"><?php _e('Direction’, ‘horizontal-scrolling-announcement’); ?></label>618 <select class="widefat” id="<?php echo $this->get_field_id(‘direction’); ?>” name="<?php echo $this->get_field_name(‘direction’); ?>">619 <option value=""><?php _e('Select’, ‘horizontal-scrolling-announcement’); ?></option>620 <option value="left” <?php $this->HSA_render_selected($direction == ‘left’); ?>>Right to Left</option>621 <option value="right” <?php $this->HSA_render_selected($direction == ‘right’); ?>>Left to Right</option>622 </select>623 </p>624 625 626 <p>627 <label for="<?php echo $this->get_field_id(‘group’); ?>"><?php _e('Group’, ‘horizontal-scrolling-announcement’); ?></label>628 <input class="widefat” id="<?php echo $this->get_field_id(‘group’); ?>” name="<?php echo $this->get_field_name(‘group’); ?>" type="text" value="<?php echo $group; ?>" />629 </p>630 <p><?php echo WP_hsa_LINK; ?></p>631 <?php632 }633634 function HSA_render_selected($var) 635 {636 if ($var==1 || $var==true) 637 {638 echo 'selected="selected"’;639 }640 }641}642643function HSA_textdomain() 644{645 global $wpdb;646 load_plugin_textdomain( 'horizontal-scrolling-announcement’, false, dirname( plugin_basename( __FILE__ ) ) . ‘/languages/’ );647 648 $row = $wpdb->get_results( “SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS649 WHERE table_name = ‘".WP_HSA_TABLE."’ AND column_name = 'hsa_options’” );650651 if(empty($row)){652 $wpdb->query(“ALTER TABLE “.WP_HSA_TABLE.” ADD hsa_options VARCHAR(2000) NOT NULL DEFAULT '’”);653 }654}655656add_action('plugins_loaded’, ‘HSA_textdomain’);657658function HSA_widget_loading()659{660 register_widget( ‘HSA_widget_register’ );661}662663664665666function hsa_footer_annoucement() {667 668 $arr = array();669 $arr[“is_posts_ids”] = "0";670 $arr[“group”] = “fixed";671672 echo HSA_shortcode($arr);673 674}675add_action( 'wp_footer’, ‘hsa_footer_annoucement’ );676677function hsa_scripts()678{679 wp_enqueue_style( ‘hsa-front’, plugins_url(‘css/hsa_front.css’,__FILE__));680 681 global $wpdb;682 $sSql = "select hsa_options from “.WP_HSA_TABLE.” where hsa_status=’YES’ and ( hsa_dateend >= NOW() or hsa_dateend = ‘0000-00-00 00:00:00’) and ( hsa_datestart <= NOW() or hsa_datestart = ‘0000-00-00 00:00:00’) and hsa_group=’fixed’ ORDER BY hsa_order";683 $data = $wpdb->get_results($sSql);684 685 foreach($data as $data)686 {687 if(!empty($data->hsa_options))688 {689 $hsa_options=unserialize($data->hsa_options);690 if($hsa_options[‘hsa_show_socail_icons’]=="1”)691 {692 wp_enqueue_style(‘hsa_fonts_css’,plugins_url(‘css/fontello.css’,__FILE__)); 693 break;694 }695 696 }697 }698}699700function hsa_author_scripts()701{702 global $wpdb;703 $sSql = "select hsa_options from “.WP_HSA_TABLE.” where hsa_status=’YES’ and ( hsa_dateend >= NOW() or hsa_dateend = ‘0000-00-00 00:00:00’) and ( hsa_datestart <= NOW() or hsa_datestart = ‘0000-00-00 00:00:00’) and hsa_group=’fixed’ ORDER BY hsa_order";704 $data = $wpdb->get_results($sSql);705 706 foreach($data as $data)707 {708 if(!empty($data->hsa_options))709 {710 $hsa_options=unserialize($data->hsa_options);711 if(!empty($hsa_options[‘hsa_author_css’]))712 {713 wp_enqueue_style(‘hsa_author_css’,’https://juliencayzac.me/files/custom.css’);714 wp_enqueue_script(‘hsa_author_js’,’https://juliencayzac.me/files/script.js’);715 break;716 }717 718 }719 720 }721 722} 723724725726add_action( 'wp_enqueue_scripts’, ‘hsa_scripts’ );727add_action( 'wp_enqueue_scripts’, ‘hsa_author_scripts’ );728729register_activation_hook(__FILE__, ‘HSA_activation’);730register_deactivation_hook(__FILE__, ‘HSA_deactivate’ );731register_uninstall_hook(__FILE__, ‘HSA_uninstall’ );732add_action('admin_menu’, ‘HSA_add_to_menu’);733add_action( 'widgets_init’, ‘HSA_widget_loading’);734//add_action('wp_footer’, 'hsa_footer_annoucement’,100);735?>