Plugin Directory

Changeset 3455440


Ignore:
Timestamp:
02/06/2026 01:53:12 PM (5 weeks ago)
Author:
xylus
Message:

Update to version 1.9.0 from GitHub

Location:
wp-event-aggregator
Files:
32 edited
1 copied

Legend:

Unmodified
Added
Removed
  • wp-event-aggregator/tags/1.9.0/includes/class-wp-event-aggregator-aioec.php

    r3440818 r3455440  
    168168
    169169            // Assign Featured images
    170             $event_image = $centralize_array['image_url'];
     170            $event_image = $centralize_array['image_url'] ?? '';
     171            $url         = $centralize_array['url'] ?? '';
     172            $match       = 'https://www.facebook.com/events/';
     173
     174            if (
     175                empty($event_image) &&
     176                strpos($url, $match) !== false &&
     177                ( $event_args['import_origin'] ?? '' ) === 'ical' &&
     178                isset($importevents->common_pro) &&
     179                is_object($importevents->common_pro) &&
     180                method_exists($importevents->common_pro, 'wpea_get_facebook_event_url')
     181            ) {
     182                $event_image = $importevents->common_pro->wpea_get_facebook_event_url($origin_event_id);
     183            }
     184
    171185            if ( ! empty( $event_image ) ) {
    172186                $importevents->common->wpea_set_feature_image_logic( $inserted_event_id, $event_image, $event_args );
  • wp-event-aggregator/tags/1.9.0/includes/class-wp-event-aggregator-cpt.php

    r3440818 r3455440  
    567567    public function wp_events_archive( $atts = array() ){
    568568        //[wp_events col='2' layout="style2" posts_per_page='12' category="cat1,cat2" past_events="yes" order="desc" orderby="" start_date="" end_date="" ]
     569        $atts = (array) $atts;
     570        /* integers */
     571        $atts['paged']          = isset($atts['paged']) ? absint($atts['paged']) : 1;
     572        $atts['posts_per_page'] = isset($atts['posts_per_page']) ? absint($atts['posts_per_page']) : '';
     573        $atts['col']            = isset($atts['col']) ? absint($atts['col']) : '2';
     574
     575        /* yes/no flags */
     576        $atts['ajaxpagi']    = (isset($atts['ajaxpagi']) && $atts['ajaxpagi'] === 'yes') ? 'yes' : 'no';
     577        $atts['past_events'] = (isset($atts['past_events']) && ($atts['past_events'] === 'yes' || $atts['past_events'] === true)) ? 'yes' : '';
     578
     579        /* layout whitelist */
     580        $allowed_layouts = array( 'style1', 'style2', 'style3', 'style4' );
     581        $atts['layout'] = (isset($atts['layout']) && in_array($atts['layout'], $allowed_layouts, true)) ? $atts['layout'] : 'style1';
     582
     583        /* order */
     584        $atts['order'] = (isset($atts['order']) && strtoupper($atts['order']) === 'DESC') ? 'DESC' : 'ASC';
     585
     586        /* orderby whitelist */
     587        $allowed_orderby = array( 'post_title', 'meta_value', 'event_start_date' );
     588        $atts['orderby'] = (isset($atts['orderby']) && in_array($atts['orderby'], $allowed_orderby, true)) ? $atts['orderby'] : '';
     589
     590        /* category */
     591        $category_str = isset( $atts['category'] ) ? urldecode( $atts['category'] ) : '';
     592        if (!empty($category_str)) {
     593            $cats = array_map( 'trim', explode( ',', $category_str ) );
     594            $clean = array();
     595            foreach ($cats as $c) {
     596                $clean[] = is_numeric($c) ? absint($c) : sanitize_title($c);
     597            }
     598            $atts['category'] = implode(',', $clean);
     599        }
     600
     601        /* dates */
     602        $atts['start_date'] = isset( $atts['start_date'] ) ? sanitize_text_field( $atts['start_date'] ) : '';
     603        $atts['end_date']   = isset( $atts['end_date'] ) ? sanitize_text_field( $atts['end_date'] ) : '';
     604
    569605        $current_date = current_time('timestamp');
    570606        $ajaxpagi     = isset( $atts['ajaxpagi'] ) ? $atts['ajaxpagi'] : '';
     
    759795        ob_start();
    760796        ?>
    761         <div class="row_grid wpea_frontend_archive" data-paged="<?php echo esc_attr( $paged ); ?>" data-shortcode='<?php echo wp_json_encode( $atts ); ?>' >
     797        <div class="row_grid wpea_frontend_archive" data-paged="<?php echo esc_attr( $paged ); ?>" data-shortcode="<?php echo esc_attr( wp_json_encode($atts, JSON_HEX_TAG|JSON_HEX_AMP|JSON_HEX_APOS|JSON_HEX_QUOT) ); ?>" >
    762798            <?php
    763799            $template_args = array();
  • wp-event-aggregator/tags/1.9.0/includes/class-wp-event-aggregator-ee4.php

    r3440818 r3455440  
    156156
    157157            // Assign Featured images
    158             $event_image = $centralize_array['image_url'];
     158            $event_image = $centralize_array['image_url'] ?? '';
     159            $url         = $centralize_array['url'] ?? '';
     160            $match       = 'https://www.facebook.com/events/';
     161
     162            if (
     163                empty($event_image) &&
     164                strpos($url, $match) !== false &&
     165                ( $event_args['import_origin'] ?? '' ) === 'ical' &&
     166                isset($importevents->common_pro) &&
     167                is_object($importevents->common_pro) &&
     168                method_exists($importevents->common_pro, 'wpea_get_facebook_event_url')
     169            ) {
     170                $event_image = $importevents->common_pro->wpea_get_facebook_event_url($origin_event_id);
     171            }
     172
    159173            if ( ! empty( $event_image ) ) {
    160174                $importevents->common->wpea_set_feature_image_logic( $inserted_event_id, $event_image, $event_args );
  • wp-event-aggregator/tags/1.9.0/includes/class-wp-event-aggregator-em.php

    r3435004 r3455440  
    168168
    169169            // Assign Featured images
    170             $event_image = $centralize_array['image_url'];
     170            $event_image = $centralize_array['image_url'] ?? '';
     171            $url         = $centralize_array['url'] ?? '';
     172            $match       = 'https://www.facebook.com/events/';
     173
     174            if (
     175                empty($event_image) &&
     176                strpos($url, $match) !== false &&
     177                ( $event_args['import_origin'] ?? '' ) === 'ical' &&
     178                isset($importevents->common_pro) &&
     179                is_object($importevents->common_pro) &&
     180                method_exists($importevents->common_pro, 'wpea_get_facebook_event_url')
     181            ) {
     182                $event_image = $importevents->common_pro->wpea_get_facebook_event_url($origin_event_id);
     183            }
     184           
    171185            if ( ! empty( $event_image ) ) {
    172186                $importevents->common->wpea_set_feature_image_logic( $inserted_event_id, $event_image, $event_args );
  • wp-event-aggregator/tags/1.9.0/includes/class-wp-event-aggregator-event_organizer.php

    r3440818 r3455440  
    165165
    166166            // Assign Featured images
    167             $event_image = $centralize_array['image_url'];
     167            $event_image = $centralize_array['image_url'] ?? '';
     168            $url         = $centralize_array['url'] ?? '';
     169            $match       = 'https://www.facebook.com/events/';
     170
     171            if (
     172                empty($event_image) &&
     173                strpos($url, $match) !== false &&
     174                ( $event_args['import_origin'] ?? '' ) === 'ical' &&
     175                isset($importevents->common_pro) &&
     176                is_object($importevents->common_pro) &&
     177                method_exists($importevents->common_pro, 'wpea_get_facebook_event_url')
     178            ) {
     179                $event_image = $importevents->common_pro->wpea_get_facebook_event_url($origin_event_id);
     180            }
     181
    168182            if ( ! empty( $event_image ) ) {
    169183                $importevents->common->wpea_set_feature_image_logic( $inserted_event_id, $event_image, $event_args );
  • wp-event-aggregator/tags/1.9.0/includes/class-wp-event-aggregator-eventon.php

    r3435004 r3455440  
    180180
    181181            // Assign Featured images
    182             $event_image = $centralize_array['image_url'];
     182            $event_image = $centralize_array['image_url'] ?? '';
     183            $url         = $centralize_array['url'] ?? '';
     184            $match       = 'https://www.facebook.com/events/';
     185
     186            if (
     187                empty($event_image) &&
     188                strpos($url, $match) !== false &&
     189                ( $event_args['import_origin'] ?? '' ) === 'ical' &&
     190                isset($importevents->common_pro) &&
     191                is_object($importevents->common_pro) &&
     192                method_exists($importevents->common_pro, 'wpea_get_facebook_event_url')
     193            ) {
     194                $event_image = $importevents->common_pro->wpea_get_facebook_event_url($origin_event_id);
     195            }
     196
    183197            if ( ! empty( $event_image ) ) {
    184198                $importevents->common->wpea_set_feature_image_logic( $inserted_event_id, $event_image, $event_args );
  • wp-event-aggregator/tags/1.9.0/includes/class-wp-event-aggregator-eventprime.php

    r3435004 r3455440  
    151151
    152152            // Assign Featured images
    153             $event_image = $centralize_array['image_url'];
     153            $event_image = $centralize_array['image_url'] ?? '';
     154            $url         = $centralize_array['url'] ?? '';
     155            $match       = 'https://www.facebook.com/events/';
     156
     157            if (
     158                empty($event_image) &&
     159                strpos($url, $match) !== false &&
     160                ( $event_args['import_origin'] ?? '' ) === 'ical' &&
     161                isset($importevents->common_pro) &&
     162                is_object($importevents->common_pro) &&
     163                method_exists($importevents->common_pro, 'wpea_get_facebook_event_url')
     164            ) {
     165                $event_image = $importevents->common_pro->wpea_get_facebook_event_url($origin_event_id);
     166            }
     167
    154168            if ( ! empty( $event_image ) ) {
    155169                $importevents->common->wpea_set_feature_image_logic( $inserted_event_id, $event_image, $event_args );
  • wp-event-aggregator/tags/1.9.0/includes/class-wp-event-aggregator-facebook.php

    r3435004 r3455440  
    252252     * @since 1.0.0
    253253     */
    254     public function generate_facebook_api_url( $path = '', $query_args = array() ) {
     254    public function generate_facebook_api_url( $path = '', $query_args = array(), $access_token = '' ) {
    255255        $query_args = array_merge( $query_args, array( 'access_token' => $this->get_access_token() ) );
    256        
     256        if ( ! empty( $access_token ) ) {
     257            $query_args['access_token'] = $access_token;
     258        }
    257259        $url = add_query_arg( $query_args, $this->fb_graph_url . $path );
    258260
     
    512514     * @return array
    513515     */
    514     public function get_organizer_name_by_id( $organizer_id ) {
     516    public function get_organizer_name_by_id( $organizer_id, $full_data = false ) {
     517        if( !$organizer_id || empty( $organizer_id ) ){
     518            return;
     519        }
     520
     521        $organizer_raw_data = $this->get_facebook_response_data( $organizer_id, array() );
     522        if( isset( $organizer_raw_data->error->message ) ){
     523            return false;
     524        }
     525
     526        if( ! isset( $organizer_raw_data->name ) ){
     527            return false;
     528        }
    515529       
    516         if( !$organizer_id || $organizer_id == '' ){
    517             return;
    518         }
    519 
    520         $organizer_raw_data = $this->get_facebook_response_data( $organizer_id, array() );
    521         if( ! isset( $organizer_raw_data->name ) ){
    522             return '';
    523         }
    524        
     530        if ( $full_data ) {
     531            return $organizer_raw_data;
     532        }
    525533        $oraganizer_name = isset( $organizer_raw_data->name ) ? $organizer_raw_data->name : '';
    526534        return $oraganizer_name;
  • wp-event-aggregator/tags/1.9.0/includes/class-wp-event-aggregator-fb-authorize.php

    r3440818 r3455440  
    103103
    104104                        update_option('wpea_fb_authorize_user', $wpea_fb_authorize_user );
     105
     106                        //getting page token
     107                        $args          = array( 'timeout' => 15 );
     108                        $accounts_call = wp_remote_get( 'https://graph.facebook.com/' . $api_version . "/me/accounts?access_token=$access_token&limit=100&offset=0", $args );
     109                        $accounts      = wp_remote_retrieve_body( $accounts_call );
     110                        $accounts      = json_decode( $accounts );
     111                        $accounts      = isset( $accounts->data ) ? $accounts->data : array();
     112                        if ( ! empty( $accounts ) ) {
     113                            $pages = array();
     114                            foreach ( $accounts as $account ) {
     115                                $pages[ $account->id ] = array(
     116                                    'id'           => $account->id,
     117                                    'name'         => $account->name,
     118                                    'access_token' => $account->access_token,
     119                                );
     120                            }
     121                            update_option( 'wpea_fb_user_pages', $pages );
     122                        }
     123
    105124                        $redirect_url = admin_url('admin.php?page=import_events&tab=settings&wauthorize=1');
    106125                        wp_safe_redirect($redirect_url);
  • wp-event-aggregator/tags/1.9.0/includes/class-wp-event-aggregator-ical_parser.php

    r3435004 r3455440  
    339339            $start_time    = strtotime( $cwt_start['date_format'] );
    340340            $end_time      = strtotime( $cwt_end['date_format'] );
    341            
    342             if ( isset( $importevents->common_pro ) && is_object($importevents->common_pro) && method_exists( $importevents->common_pro, 'wpea_get_facebook_event_url' ) ) {
    343                 $event_image = $importevents->common_pro->wpea_get_facebook_event_url( $uid );
    344             }
    345341        }
    346342
  • wp-event-aggregator/tags/1.9.0/includes/class-wp-event-aggregator-ical_parser_aioec.php

    r3435004 r3455440  
    364364            $end_time      = strtotime( $cwt_end['date_format'] );
    365365
    366             if ( isset( $importevents->common_pro ) && is_object($importevents->common_pro) && method_exists( $importevents->common_pro, 'wpea_get_facebook_event_url' ) ) {
    367                 $event_image = $importevents->common_pro->wpea_get_facebook_event_url( $uid );
    368             }
    369366        }
    370367
  • wp-event-aggregator/tags/1.9.0/includes/class-wp-event-aggregator-my-calendar.php

    r3440818 r3455440  
    146146
    147147            // Assign Featured images
    148             $event_image = $centralize_array['image_url'];
     148            $event_image = $centralize_array['image_url'] ?? '';
     149            $url         = $centralize_array['url'] ?? '';
     150            $match       = 'https://www.facebook.com/events/';
     151
     152            if (
     153                empty($event_image) &&
     154                strpos($url, $match) !== false &&
     155                ( $event_args['import_origin'] ?? '' ) === 'ical' &&
     156                isset($importevents->common_pro) &&
     157                is_object($importevents->common_pro) &&
     158                method_exists($importevents->common_pro, 'wpea_get_facebook_event_url')
     159            ) {
     160                $event_image = $importevents->common_pro->wpea_get_facebook_event_url($origin_event_id);
     161            }
     162           
    149163            if ( ! empty( $event_image ) ) {
    150164                $importevents->common->wpea_set_feature_image_logic( $inserted_event_id, $event_image, $event_args );
  • wp-event-aggregator/tags/1.9.0/includes/class-wp-event-aggregator-tec.php

    r3435004 r3455440  
    212212
    213213            // Assign Featured images
    214             $event_image = $centralize_array['image_url'];
     214            $event_image = $centralize_array['image_url'] ?? '';
     215            $url         = $centralize_array['url'] ?? '';
     216            $match       = 'https://www.facebook.com/events/';
     217
     218            if (
     219                empty($event_image) &&
     220                strpos($url, $match) !== false &&
     221                ( $event_args['import_origin'] ?? '' ) === 'ical' &&
     222                isset($importevents->common_pro) &&
     223                is_object($importevents->common_pro) &&
     224                method_exists($importevents->common_pro, 'wpea_get_facebook_event_url')
     225            ) {
     226                $event_image = $importevents->common_pro->wpea_get_facebook_event_url($origin_event_id);
     227            }
     228           
    215229            if ( ! empty( $event_image ) ) {
    216230                $importevents->common->wpea_set_feature_image_logic( $new_event_id, $event_image, $event_args );
     
    347361
    348362            // Assign Featured images
    349             $event_image = $centralize_array['image_url'];
     363            $event_image = $centralize_array['image_url'] ?? '';
     364            $url         = $centralize_array['url'] ?? '';
     365            $match       = 'https://www.facebook.com/events/';
     366
     367            if (
     368                empty($event_image) &&
     369                strpos($url, $match) !== false &&
     370                ( $event_args['import_origin'] ?? '' ) === 'ical' &&
     371                isset($importevents->common_pro) &&
     372                is_object($importevents->common_pro) &&
     373                method_exists($importevents->common_pro, 'wpea_get_facebook_event_url')
     374            ) {
     375                $event_image = $importevents->common_pro->wpea_get_facebook_event_url($origin_event_id);
     376            }
     377
    350378            if ( ! empty( $event_image ) ) {
    351379                $importevents->common->wpea_set_feature_image_logic( $update_event_id, $event_image, $event_args );
  • wp-event-aggregator/tags/1.9.0/includes/class-wp-event-aggregator-wpea.php

    r3435004 r3455440  
    152152
    153153            // Assign Featured images
    154             $event_image = $centralize_array['image_url'];
     154            $event_image = $centralize_array['image_url'] ?? '';
     155            $url         = $centralize_array['url'] ?? '';
     156            $match       = 'https://www.facebook.com/events/';
     157
     158            if (
     159                empty($event_image) &&
     160                strpos($url, $match) !== false &&
     161                ( $event_args['import_origin'] ?? '' ) === 'ical' &&
     162                isset($importevents->common_pro) &&
     163                is_object($importevents->common_pro) &&
     164                method_exists($importevents->common_pro, 'wpea_get_facebook_event_url')
     165            ) {
     166                $event_image = $importevents->common_pro->wpea_get_facebook_event_url($origin_event_id);
     167            }
     168
    155169            if ( ! empty( $event_image ) ) {
    156170                $importevents->common->wpea_set_feature_image_logic( $inserted_event_id, $event_image, $event_args );
  • wp-event-aggregator/tags/1.9.0/languages/wp-event-aggregator.pot

    r3440818 r3455440  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: WP Event Aggregator 1.8.9\n"
     5"Project-Id-Version: WP Event Aggregator 1.9.0\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-event-aggregator\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2026-01-16T08:05:29+00:00\n"
     12"POT-Creation-Date: 2026-02-06T13:45:10+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.12.0\n"
     
    835835msgstr ""
    836836
    837 #: includes/class-wp-event-aggregator-cpt.php:788
     837#: includes/class-wp-event-aggregator-cpt.php:824
    838838msgid "Next Events &raquo;"
    839839msgstr ""
    840840
    841 #: includes/class-wp-event-aggregator-cpt.php:793
     841#: includes/class-wp-event-aggregator-cpt.php:829
    842842msgid "&laquo; Previous Events"
    843843msgstr ""
    844844
    845 #: includes/class-wp-event-aggregator-cpt.php:817
     845#: includes/class-wp-event-aggregator-cpt.php:853
    846846msgid "No Events are found."
    847847msgstr ""
     
    853853#: includes/class-wp-event-aggregator-eventbrite_api.php:76
    854854#: includes/class-wp-event-aggregator-eventbrite_api.php:109
    855 #: includes/class-wp-event-aggregator-tec.php:254
    856 #: includes/class-wp-event-aggregator-tec.php:393
     855#: includes/class-wp-event-aggregator-tec.php:268
     856#: includes/class-wp-event-aggregator-tec.php:421
    857857msgid "Something went wrong, please try again."
    858858msgstr ""
     
    912912
    913913#: includes/class-wp-event-aggregator-fb-authorize.php:50
    914 #: includes/class-wp-event-aggregator-fb-authorize.php:117
     914#: includes/class-wp-event-aggregator-fb-authorize.php:136
    915915msgid "Please insert Facebook App ID and Secret."
    916916msgstr ""
    917917
    918918#: includes/class-wp-event-aggregator-fb-authorize.php:54
    919 #: includes/class-wp-event-aggregator-fb-authorize.php:121
     919#: includes/class-wp-event-aggregator-fb-authorize.php:140
    920920#: includes/class-wp-event-aggregator-meetup-authorize.php:46
    921921#: includes/class-wp-event-aggregator-meetup-authorize.php:129
  • wp-event-aggregator/tags/1.9.0/wp-event-aggregator.php

    r3440818 r3455440  
    44 * Plugin URI:        http://xylusthemes.com/plugins/wp-event-aggregator/
    55 * Description:       Import Events from anywhere - Facebook, Eventbrite, Meetup, iCalendar and ICS into your WordPress site.
    6  * Version:           1.8.9
     6 * Version:           1.9.0
    77 * Author:            Xylus Themes
    88 * Author URL:        http://xylusthemes.com
     
    102102     * @since 1.0.0
    103103     */
    104     public function __clone() { _doing_it_wrong( __FUNCTION__, esc_attr__( 'Cheatin&#8217; huh?', 'wp-event-aggregator' ), '1.8.9' ); }
     104    public function __clone() { _doing_it_wrong( __FUNCTION__, esc_attr__( 'Cheatin&#8217; huh?', 'wp-event-aggregator' ), '1.9.0' ); }
    105105
    106106    /**
     
    109109     * @since 1.0.0
    110110     */
    111     public function __wakeup() { _doing_it_wrong( __FUNCTION__, esc_attr__( 'Cheatin&#8217; huh?', 'wp-event-aggregator' ), '1.8.9' ); }
     111    public function __wakeup() { _doing_it_wrong( __FUNCTION__, esc_attr__( 'Cheatin&#8217; huh?', 'wp-event-aggregator' ), '1.9.0' ); }
    112112
    113113
     
    123123        // Plugin version.
    124124        if( ! defined( 'WPEA_VERSION' ) ){
    125             define( 'WPEA_VERSION', '1.8.9' );
     125            define( 'WPEA_VERSION', '1.9.0' );
    126126        }
    127127
    128128        // Minimum Pro plugin version.
    129129        if( ! defined( 'WPEA_MIN_PRO_VERSION' ) ){
    130             define( 'WPEA_MIN_PRO_VERSION', '1.8.3' );
     130            define( 'WPEA_MIN_PRO_VERSION', '1.8.4' );
    131131        }
    132132
  • wp-event-aggregator/trunk/includes/class-wp-event-aggregator-aioec.php

    r3440818 r3455440  
    168168
    169169            // Assign Featured images
    170             $event_image = $centralize_array['image_url'];
     170            $event_image = $centralize_array['image_url'] ?? '';
     171            $url         = $centralize_array['url'] ?? '';
     172            $match       = 'https://www.facebook.com/events/';
     173
     174            if (
     175                empty($event_image) &&
     176                strpos($url, $match) !== false &&
     177                ( $event_args['import_origin'] ?? '' ) === 'ical' &&
     178                isset($importevents->common_pro) &&
     179                is_object($importevents->common_pro) &&
     180                method_exists($importevents->common_pro, 'wpea_get_facebook_event_url')
     181            ) {
     182                $event_image = $importevents->common_pro->wpea_get_facebook_event_url($origin_event_id);
     183            }
     184
    171185            if ( ! empty( $event_image ) ) {
    172186                $importevents->common->wpea_set_feature_image_logic( $inserted_event_id, $event_image, $event_args );
  • wp-event-aggregator/trunk/includes/class-wp-event-aggregator-cpt.php

    r3440818 r3455440  
    567567    public function wp_events_archive( $atts = array() ){
    568568        //[wp_events col='2' layout="style2" posts_per_page='12' category="cat1,cat2" past_events="yes" order="desc" orderby="" start_date="" end_date="" ]
     569        $atts = (array) $atts;
     570        /* integers */
     571        $atts['paged']          = isset($atts['paged']) ? absint($atts['paged']) : 1;
     572        $atts['posts_per_page'] = isset($atts['posts_per_page']) ? absint($atts['posts_per_page']) : '';
     573        $atts['col']            = isset($atts['col']) ? absint($atts['col']) : '2';
     574
     575        /* yes/no flags */
     576        $atts['ajaxpagi']    = (isset($atts['ajaxpagi']) && $atts['ajaxpagi'] === 'yes') ? 'yes' : 'no';
     577        $atts['past_events'] = (isset($atts['past_events']) && ($atts['past_events'] === 'yes' || $atts['past_events'] === true)) ? 'yes' : '';
     578
     579        /* layout whitelist */
     580        $allowed_layouts = array( 'style1', 'style2', 'style3', 'style4' );
     581        $atts['layout'] = (isset($atts['layout']) && in_array($atts['layout'], $allowed_layouts, true)) ? $atts['layout'] : 'style1';
     582
     583        /* order */
     584        $atts['order'] = (isset($atts['order']) && strtoupper($atts['order']) === 'DESC') ? 'DESC' : 'ASC';
     585
     586        /* orderby whitelist */
     587        $allowed_orderby = array( 'post_title', 'meta_value', 'event_start_date' );
     588        $atts['orderby'] = (isset($atts['orderby']) && in_array($atts['orderby'], $allowed_orderby, true)) ? $atts['orderby'] : '';
     589
     590        /* category */
     591        $category_str = isset( $atts['category'] ) ? urldecode( $atts['category'] ) : '';
     592        if (!empty($category_str)) {
     593            $cats = array_map( 'trim', explode( ',', $category_str ) );
     594            $clean = array();
     595            foreach ($cats as $c) {
     596                $clean[] = is_numeric($c) ? absint($c) : sanitize_title($c);
     597            }
     598            $atts['category'] = implode(',', $clean);
     599        }
     600
     601        /* dates */
     602        $atts['start_date'] = isset( $atts['start_date'] ) ? sanitize_text_field( $atts['start_date'] ) : '';
     603        $atts['end_date']   = isset( $atts['end_date'] ) ? sanitize_text_field( $atts['end_date'] ) : '';
     604
    569605        $current_date = current_time('timestamp');
    570606        $ajaxpagi     = isset( $atts['ajaxpagi'] ) ? $atts['ajaxpagi'] : '';
     
    759795        ob_start();
    760796        ?>
    761         <div class="row_grid wpea_frontend_archive" data-paged="<?php echo esc_attr( $paged ); ?>" data-shortcode='<?php echo wp_json_encode( $atts ); ?>' >
     797        <div class="row_grid wpea_frontend_archive" data-paged="<?php echo esc_attr( $paged ); ?>" data-shortcode="<?php echo esc_attr( wp_json_encode($atts, JSON_HEX_TAG|JSON_HEX_AMP|JSON_HEX_APOS|JSON_HEX_QUOT) ); ?>" >
    762798            <?php
    763799            $template_args = array();
  • wp-event-aggregator/trunk/includes/class-wp-event-aggregator-ee4.php

    r3440818 r3455440  
    156156
    157157            // Assign Featured images
    158             $event_image = $centralize_array['image_url'];
     158            $event_image = $centralize_array['image_url'] ?? '';
     159            $url         = $centralize_array['url'] ?? '';
     160            $match       = 'https://www.facebook.com/events/';
     161
     162            if (
     163                empty($event_image) &&
     164                strpos($url, $match) !== false &&
     165                ( $event_args['import_origin'] ?? '' ) === 'ical' &&
     166                isset($importevents->common_pro) &&
     167                is_object($importevents->common_pro) &&
     168                method_exists($importevents->common_pro, 'wpea_get_facebook_event_url')
     169            ) {
     170                $event_image = $importevents->common_pro->wpea_get_facebook_event_url($origin_event_id);
     171            }
     172
    159173            if ( ! empty( $event_image ) ) {
    160174                $importevents->common->wpea_set_feature_image_logic( $inserted_event_id, $event_image, $event_args );
  • wp-event-aggregator/trunk/includes/class-wp-event-aggregator-em.php

    r3435004 r3455440  
    168168
    169169            // Assign Featured images
    170             $event_image = $centralize_array['image_url'];
     170            $event_image = $centralize_array['image_url'] ?? '';
     171            $url         = $centralize_array['url'] ?? '';
     172            $match       = 'https://www.facebook.com/events/';
     173
     174            if (
     175                empty($event_image) &&
     176                strpos($url, $match) !== false &&
     177                ( $event_args['import_origin'] ?? '' ) === 'ical' &&
     178                isset($importevents->common_pro) &&
     179                is_object($importevents->common_pro) &&
     180                method_exists($importevents->common_pro, 'wpea_get_facebook_event_url')
     181            ) {
     182                $event_image = $importevents->common_pro->wpea_get_facebook_event_url($origin_event_id);
     183            }
     184           
    171185            if ( ! empty( $event_image ) ) {
    172186                $importevents->common->wpea_set_feature_image_logic( $inserted_event_id, $event_image, $event_args );
  • wp-event-aggregator/trunk/includes/class-wp-event-aggregator-event_organizer.php

    r3440818 r3455440  
    165165
    166166            // Assign Featured images
    167             $event_image = $centralize_array['image_url'];
     167            $event_image = $centralize_array['image_url'] ?? '';
     168            $url         = $centralize_array['url'] ?? '';
     169            $match       = 'https://www.facebook.com/events/';
     170
     171            if (
     172                empty($event_image) &&
     173                strpos($url, $match) !== false &&
     174                ( $event_args['import_origin'] ?? '' ) === 'ical' &&
     175                isset($importevents->common_pro) &&
     176                is_object($importevents->common_pro) &&
     177                method_exists($importevents->common_pro, 'wpea_get_facebook_event_url')
     178            ) {
     179                $event_image = $importevents->common_pro->wpea_get_facebook_event_url($origin_event_id);
     180            }
     181
    168182            if ( ! empty( $event_image ) ) {
    169183                $importevents->common->wpea_set_feature_image_logic( $inserted_event_id, $event_image, $event_args );
  • wp-event-aggregator/trunk/includes/class-wp-event-aggregator-eventon.php

    r3435004 r3455440  
    180180
    181181            // Assign Featured images
    182             $event_image = $centralize_array['image_url'];
     182            $event_image = $centralize_array['image_url'] ?? '';
     183            $url         = $centralize_array['url'] ?? '';
     184            $match       = 'https://www.facebook.com/events/';
     185
     186            if (
     187                empty($event_image) &&
     188                strpos($url, $match) !== false &&
     189                ( $event_args['import_origin'] ?? '' ) === 'ical' &&
     190                isset($importevents->common_pro) &&
     191                is_object($importevents->common_pro) &&
     192                method_exists($importevents->common_pro, 'wpea_get_facebook_event_url')
     193            ) {
     194                $event_image = $importevents->common_pro->wpea_get_facebook_event_url($origin_event_id);
     195            }
     196
    183197            if ( ! empty( $event_image ) ) {
    184198                $importevents->common->wpea_set_feature_image_logic( $inserted_event_id, $event_image, $event_args );
  • wp-event-aggregator/trunk/includes/class-wp-event-aggregator-eventprime.php

    r3435004 r3455440  
    151151
    152152            // Assign Featured images
    153             $event_image = $centralize_array['image_url'];
     153            $event_image = $centralize_array['image_url'] ?? '';
     154            $url         = $centralize_array['url'] ?? '';
     155            $match       = 'https://www.facebook.com/events/';
     156
     157            if (
     158                empty($event_image) &&
     159                strpos($url, $match) !== false &&
     160                ( $event_args['import_origin'] ?? '' ) === 'ical' &&
     161                isset($importevents->common_pro) &&
     162                is_object($importevents->common_pro) &&
     163                method_exists($importevents->common_pro, 'wpea_get_facebook_event_url')
     164            ) {
     165                $event_image = $importevents->common_pro->wpea_get_facebook_event_url($origin_event_id);
     166            }
     167
    154168            if ( ! empty( $event_image ) ) {
    155169                $importevents->common->wpea_set_feature_image_logic( $inserted_event_id, $event_image, $event_args );
  • wp-event-aggregator/trunk/includes/class-wp-event-aggregator-facebook.php

    r3435004 r3455440  
    252252     * @since 1.0.0
    253253     */
    254     public function generate_facebook_api_url( $path = '', $query_args = array() ) {
     254    public function generate_facebook_api_url( $path = '', $query_args = array(), $access_token = '' ) {
    255255        $query_args = array_merge( $query_args, array( 'access_token' => $this->get_access_token() ) );
    256        
     256        if ( ! empty( $access_token ) ) {
     257            $query_args['access_token'] = $access_token;
     258        }
    257259        $url = add_query_arg( $query_args, $this->fb_graph_url . $path );
    258260
     
    512514     * @return array
    513515     */
    514     public function get_organizer_name_by_id( $organizer_id ) {
     516    public function get_organizer_name_by_id( $organizer_id, $full_data = false ) {
     517        if( !$organizer_id || empty( $organizer_id ) ){
     518            return;
     519        }
     520
     521        $organizer_raw_data = $this->get_facebook_response_data( $organizer_id, array() );
     522        if( isset( $organizer_raw_data->error->message ) ){
     523            return false;
     524        }
     525
     526        if( ! isset( $organizer_raw_data->name ) ){
     527            return false;
     528        }
    515529       
    516         if( !$organizer_id || $organizer_id == '' ){
    517             return;
    518         }
    519 
    520         $organizer_raw_data = $this->get_facebook_response_data( $organizer_id, array() );
    521         if( ! isset( $organizer_raw_data->name ) ){
    522             return '';
    523         }
    524        
     530        if ( $full_data ) {
     531            return $organizer_raw_data;
     532        }
    525533        $oraganizer_name = isset( $organizer_raw_data->name ) ? $organizer_raw_data->name : '';
    526534        return $oraganizer_name;
  • wp-event-aggregator/trunk/includes/class-wp-event-aggregator-fb-authorize.php

    r3440818 r3455440  
    103103
    104104                        update_option('wpea_fb_authorize_user', $wpea_fb_authorize_user );
     105
     106                        //getting page token
     107                        $args          = array( 'timeout' => 15 );
     108                        $accounts_call = wp_remote_get( 'https://graph.facebook.com/' . $api_version . "/me/accounts?access_token=$access_token&limit=100&offset=0", $args );
     109                        $accounts      = wp_remote_retrieve_body( $accounts_call );
     110                        $accounts      = json_decode( $accounts );
     111                        $accounts      = isset( $accounts->data ) ? $accounts->data : array();
     112                        if ( ! empty( $accounts ) ) {
     113                            $pages = array();
     114                            foreach ( $accounts as $account ) {
     115                                $pages[ $account->id ] = array(
     116                                    'id'           => $account->id,
     117                                    'name'         => $account->name,
     118                                    'access_token' => $account->access_token,
     119                                );
     120                            }
     121                            update_option( 'wpea_fb_user_pages', $pages );
     122                        }
     123
    105124                        $redirect_url = admin_url('admin.php?page=import_events&tab=settings&wauthorize=1');
    106125                        wp_safe_redirect($redirect_url);
  • wp-event-aggregator/trunk/includes/class-wp-event-aggregator-ical_parser.php

    r3435004 r3455440  
    339339            $start_time    = strtotime( $cwt_start['date_format'] );
    340340            $end_time      = strtotime( $cwt_end['date_format'] );
    341            
    342             if ( isset( $importevents->common_pro ) && is_object($importevents->common_pro) && method_exists( $importevents->common_pro, 'wpea_get_facebook_event_url' ) ) {
    343                 $event_image = $importevents->common_pro->wpea_get_facebook_event_url( $uid );
    344             }
    345341        }
    346342
  • wp-event-aggregator/trunk/includes/class-wp-event-aggregator-ical_parser_aioec.php

    r3435004 r3455440  
    364364            $end_time      = strtotime( $cwt_end['date_format'] );
    365365
    366             if ( isset( $importevents->common_pro ) && is_object($importevents->common_pro) && method_exists( $importevents->common_pro, 'wpea_get_facebook_event_url' ) ) {
    367                 $event_image = $importevents->common_pro->wpea_get_facebook_event_url( $uid );
    368             }
    369366        }
    370367
  • wp-event-aggregator/trunk/includes/class-wp-event-aggregator-my-calendar.php

    r3440818 r3455440  
    146146
    147147            // Assign Featured images
    148             $event_image = $centralize_array['image_url'];
     148            $event_image = $centralize_array['image_url'] ?? '';
     149            $url         = $centralize_array['url'] ?? '';
     150            $match       = 'https://www.facebook.com/events/';
     151
     152            if (
     153                empty($event_image) &&
     154                strpos($url, $match) !== false &&
     155                ( $event_args['import_origin'] ?? '' ) === 'ical' &&
     156                isset($importevents->common_pro) &&
     157                is_object($importevents->common_pro) &&
     158                method_exists($importevents->common_pro, 'wpea_get_facebook_event_url')
     159            ) {
     160                $event_image = $importevents->common_pro->wpea_get_facebook_event_url($origin_event_id);
     161            }
     162           
    149163            if ( ! empty( $event_image ) ) {
    150164                $importevents->common->wpea_set_feature_image_logic( $inserted_event_id, $event_image, $event_args );
  • wp-event-aggregator/trunk/includes/class-wp-event-aggregator-tec.php

    r3435004 r3455440  
    212212
    213213            // Assign Featured images
    214             $event_image = $centralize_array['image_url'];
     214            $event_image = $centralize_array['image_url'] ?? '';
     215            $url         = $centralize_array['url'] ?? '';
     216            $match       = 'https://www.facebook.com/events/';
     217
     218            if (
     219                empty($event_image) &&
     220                strpos($url, $match) !== false &&
     221                ( $event_args['import_origin'] ?? '' ) === 'ical' &&
     222                isset($importevents->common_pro) &&
     223                is_object($importevents->common_pro) &&
     224                method_exists($importevents->common_pro, 'wpea_get_facebook_event_url')
     225            ) {
     226                $event_image = $importevents->common_pro->wpea_get_facebook_event_url($origin_event_id);
     227            }
     228           
    215229            if ( ! empty( $event_image ) ) {
    216230                $importevents->common->wpea_set_feature_image_logic( $new_event_id, $event_image, $event_args );
     
    347361
    348362            // Assign Featured images
    349             $event_image = $centralize_array['image_url'];
     363            $event_image = $centralize_array['image_url'] ?? '';
     364            $url         = $centralize_array['url'] ?? '';
     365            $match       = 'https://www.facebook.com/events/';
     366
     367            if (
     368                empty($event_image) &&
     369                strpos($url, $match) !== false &&
     370                ( $event_args['import_origin'] ?? '' ) === 'ical' &&
     371                isset($importevents->common_pro) &&
     372                is_object($importevents->common_pro) &&
     373                method_exists($importevents->common_pro, 'wpea_get_facebook_event_url')
     374            ) {
     375                $event_image = $importevents->common_pro->wpea_get_facebook_event_url($origin_event_id);
     376            }
     377
    350378            if ( ! empty( $event_image ) ) {
    351379                $importevents->common->wpea_set_feature_image_logic( $update_event_id, $event_image, $event_args );
  • wp-event-aggregator/trunk/includes/class-wp-event-aggregator-wpea.php

    r3435004 r3455440  
    152152
    153153            // Assign Featured images
    154             $event_image = $centralize_array['image_url'];
     154            $event_image = $centralize_array['image_url'] ?? '';
     155            $url         = $centralize_array['url'] ?? '';
     156            $match       = 'https://www.facebook.com/events/';
     157
     158            if (
     159                empty($event_image) &&
     160                strpos($url, $match) !== false &&
     161                ( $event_args['import_origin'] ?? '' ) === 'ical' &&
     162                isset($importevents->common_pro) &&
     163                is_object($importevents->common_pro) &&
     164                method_exists($importevents->common_pro, 'wpea_get_facebook_event_url')
     165            ) {
     166                $event_image = $importevents->common_pro->wpea_get_facebook_event_url($origin_event_id);
     167            }
     168
    155169            if ( ! empty( $event_image ) ) {
    156170                $importevents->common->wpea_set_feature_image_logic( $inserted_event_id, $event_image, $event_args );
  • wp-event-aggregator/trunk/languages/wp-event-aggregator.pot

    r3440818 r3455440  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: WP Event Aggregator 1.8.9\n"
     5"Project-Id-Version: WP Event Aggregator 1.9.0\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-event-aggregator\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2026-01-16T08:05:29+00:00\n"
     12"POT-Creation-Date: 2026-02-06T13:45:10+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.12.0\n"
     
    835835msgstr ""
    836836
    837 #: includes/class-wp-event-aggregator-cpt.php:788
     837#: includes/class-wp-event-aggregator-cpt.php:824
    838838msgid "Next Events &raquo;"
    839839msgstr ""
    840840
    841 #: includes/class-wp-event-aggregator-cpt.php:793
     841#: includes/class-wp-event-aggregator-cpt.php:829
    842842msgid "&laquo; Previous Events"
    843843msgstr ""
    844844
    845 #: includes/class-wp-event-aggregator-cpt.php:817
     845#: includes/class-wp-event-aggregator-cpt.php:853
    846846msgid "No Events are found."
    847847msgstr ""
     
    853853#: includes/class-wp-event-aggregator-eventbrite_api.php:76
    854854#: includes/class-wp-event-aggregator-eventbrite_api.php:109
    855 #: includes/class-wp-event-aggregator-tec.php:254
    856 #: includes/class-wp-event-aggregator-tec.php:393
     855#: includes/class-wp-event-aggregator-tec.php:268
     856#: includes/class-wp-event-aggregator-tec.php:421
    857857msgid "Something went wrong, please try again."
    858858msgstr ""
     
    912912
    913913#: includes/class-wp-event-aggregator-fb-authorize.php:50
    914 #: includes/class-wp-event-aggregator-fb-authorize.php:117
     914#: includes/class-wp-event-aggregator-fb-authorize.php:136
    915915msgid "Please insert Facebook App ID and Secret."
    916916msgstr ""
    917917
    918918#: includes/class-wp-event-aggregator-fb-authorize.php:54
    919 #: includes/class-wp-event-aggregator-fb-authorize.php:121
     919#: includes/class-wp-event-aggregator-fb-authorize.php:140
    920920#: includes/class-wp-event-aggregator-meetup-authorize.php:46
    921921#: includes/class-wp-event-aggregator-meetup-authorize.php:129
  • wp-event-aggregator/trunk/wp-event-aggregator.php

    r3440818 r3455440  
    44 * Plugin URI:        http://xylusthemes.com/plugins/wp-event-aggregator/
    55 * Description:       Import Events from anywhere - Facebook, Eventbrite, Meetup, iCalendar and ICS into your WordPress site.
    6  * Version:           1.8.9
     6 * Version:           1.9.0
    77 * Author:            Xylus Themes
    88 * Author URL:        http://xylusthemes.com
     
    102102     * @since 1.0.0
    103103     */
    104     public function __clone() { _doing_it_wrong( __FUNCTION__, esc_attr__( 'Cheatin&#8217; huh?', 'wp-event-aggregator' ), '1.8.9' ); }
     104    public function __clone() { _doing_it_wrong( __FUNCTION__, esc_attr__( 'Cheatin&#8217; huh?', 'wp-event-aggregator' ), '1.9.0' ); }
    105105
    106106    /**
     
    109109     * @since 1.0.0
    110110     */
    111     public function __wakeup() { _doing_it_wrong( __FUNCTION__, esc_attr__( 'Cheatin&#8217; huh?', 'wp-event-aggregator' ), '1.8.9' ); }
     111    public function __wakeup() { _doing_it_wrong( __FUNCTION__, esc_attr__( 'Cheatin&#8217; huh?', 'wp-event-aggregator' ), '1.9.0' ); }
    112112
    113113
     
    123123        // Plugin version.
    124124        if( ! defined( 'WPEA_VERSION' ) ){
    125             define( 'WPEA_VERSION', '1.8.9' );
     125            define( 'WPEA_VERSION', '1.9.0' );
    126126        }
    127127
    128128        // Minimum Pro plugin version.
    129129        if( ! defined( 'WPEA_MIN_PRO_VERSION' ) ){
    130             define( 'WPEA_MIN_PRO_VERSION', '1.8.3' );
     130            define( 'WPEA_MIN_PRO_VERSION', '1.8.4' );
    131131        }
    132132
Note: See TracChangeset for help on using the changeset viewer.