Файловый менеджер - Редактировать - /home/tuudkjt/globeasy/wp-includes/ID3/Handlers.tar
Назад
DataSyncHandler.php 0000777 00000004133 15251327637 0010304 0 ustar 00 <?php namespace Rvx\Handlers; class DataSyncHandler { // public function wc_data_exists_in_db(): bool // { // global $wpdb; // $query = " // (SELECT 'product' AS type // FROM {$wpdb->posts} // WHERE post_type = 'product' // LIMIT 1) // UNION ALL // (SELECT 'shop_order' AS type // FROM {$wpdb->posts} // WHERE post_type = 'shop_order' // LIMIT 1) // UNION ALL // (SELECT 'taxonomy' AS type // FROM {$wpdb->term_taxonomy} // WHERE taxonomy IN ('product_cat', 'product_tag') // LIMIT 1) // "; // $results = $wpdb->get_col($query); // return !empty($results); // } public function wc_data_exists_in_db() : bool { global $wpdb; $query = "\n SELECT \n (EXISTS(SELECT 1 FROM {$wpdb->posts} WHERE post_type = 'product' LIMIT 1)) AS has_product,\n (EXISTS(SELECT 1 FROM {$wpdb->posts} WHERE post_type = 'shop_order' LIMIT 1)) AS has_order,\n (EXISTS(SELECT 1 FROM {$wpdb->term_taxonomy} WHERE taxonomy IN ('product_cat', 'product_tag') LIMIT 1)) AS has_taxonomy\n "; $row = $wpdb->get_row($query, ARRAY_A); return \in_array(1, $row, \true); } public function getProductTaxonomies() : array { // Try to get taxonomies via WP API if possible if (post_type_exists('product')) { $taxonomies = get_object_taxonomies('product', 'names'); if (!empty($taxonomies)) { return $taxonomies; } } // Fallback to DB-only method if API fails or WooCommerce is disabled global $wpdb; return $wpdb->get_col("\n SELECT DISTINCT tt.taxonomy\n FROM {$wpdb->term_relationships} tr\n INNER JOIN {$wpdb->term_taxonomy} tt ON tr.term_taxonomy_id = tt.term_taxonomy_id\n INNER JOIN {$wpdb->posts} p ON tr.object_id = p.ID\n WHERE p.post_type = 'product'\n ") ?: []; } } OnboardMenuHandler.php 0000777 00000002232 15251327637 0011005 0 ustar 00 <?php namespace Rvx\Handlers; use Rvx\Handlers\MigrationRollback\SharedMethods; use Rvx\WPDrill\Contracts\InvokableContract; use Rvx\WPDrill\Facades\View; class OnboardMenuHandler implements InvokableContract { public function __invoke() { global $wpdb; $rvxSites = $wpdb->prefix . 'rvx_sites'; $wpdb->query("TRUNCATE TABLE {$rvxSites}"); $sharedMethods = new SharedMethods(); $is_pro_active = $sharedMethods->rvx_is_old_pro_plugin_active(); if ($is_pro_active === \true) { // Old Pro version is detected, let's deactivate $sharedMethods->rvx_deactivate_old_pro_plugin(); // Reload the page once to remove Old Pro plugin's notices if (!isset($_GET['rvx_reloaded'])) { //$url = add_query_arg('rvx_reloaded', '1', $_SERVER['REQUEST_URI']); $url = add_query_arg('', '', $_SERVER['REQUEST_URI']); \header('Location: ' . $url); exit; } } View::output('storeadmin/onboard', ['title' => 'Welcome to WPDrill', 'content' => 'A WordPress Plugin development framework for humans']); } } GoogleReviewsHandler.php 0000777 00000000544 15251327637 0011361 0 ustar 00 <?php namespace Rvx\Handlers; use Rvx\WPDrill\Contracts\InvokableContract; use Rvx\WPDrill\Facades\View; class GoogleReviewsHandler implements InvokableContract { public function __invoke() { View::output('storeadmin/google', ['title' => 'Welcome to WPDrill', 'content' => 'A WordPress Plugin development framework for humans']); } } AllReviewsHandler.php 0000777 00000000540 15251327637 0010651 0 ustar 00 <?php namespace Rvx\Handlers; use Rvx\WPDrill\Contracts\InvokableContract; use Rvx\WPDrill\Facades\View; class AllReviewsHandler implements InvokableContract { public function __invoke() { View::output('storeadmin/index', ['title' => 'Welcome to WPDrill', 'content' => 'A WordPress Plugin development framework for humans']); } } Customize/WidgetCustomizeOutputCSSHandler.php 0000777 00000071264 15251327637 0015511 0 ustar 00 <?php namespace Rvx\Handlers\Customize; class WidgetCustomizeOutputCSSHandler { public function __invoke() : void { if (!did_action('elementor/loaded')) { $this->rvx_load_customizer_output_css(); } } public function rvx_load_customizer_output_css() : void { /* * ReviewX - General Settings */ // Active Rating Stars: [Background Color] //$rvx_general_reviews_active_rating_stars_background_color = get_theme_mod( 'rvx_general_reviews_active_rating_stars_background_color', '#FCCE08'); /* * ReviewX - Reviews Overview */ // Rating out of $rvx_reviews_overview_rating_out_of_text_color = get_theme_mod('rvx_reviews_overview_rating_out_of_text_color', '#424242'); $rvx_reviews_overview_rating_out_of_text_font_size = get_theme_mod('rvx_reviews_overview_rating_out_of_text_font_size', 43.942); // Rating out of Total $rvx_reviews_overview_rating_out_of_total_text_color = get_theme_mod('rvx_reviews_overview_rating_out_of_total_text_color', '#BDBDBD'); $rvx_reviews_overview_rating_out_of_total_text_font_size = get_theme_mod('rvx_reviews_overview_rating_out_of_total_text_font_size', 24); // Rating Badge $rvx_reviews_overview_rating_badge_background_color = get_theme_mod('rvx_reviews_overview_rating_badge_background_color', '#22C55E'); $rvx_reviews_overview_rating_badge_text_color = get_theme_mod('rvx_reviews_overview_rating_badge_text_color', '#FFFFFF'); // Total Reviews Count $rvx_reviews_overview_total_reviews_text_color = get_theme_mod('rvx_reviews_overview_total_reviews_text_color', '#424242'); $rvx_reviews_overview_total_reviews_text_font_size = get_theme_mod('rvx_reviews_overview_total_reviews_text_font_size', 16); // Rating Overview Chart $rvx_reviews_overview_rating_overview_chart_text_color = get_theme_mod('rvx_reviews_overview_rating_overview_chart_text_color', '#424242'); $rvx_reviews_overview_rating_overview_chart_text_font_size = get_theme_mod('rvx_reviews_overview_rating_overview_chart_text_font_size', 14); // Product Recommendation Text $rvx_reviews_overview_product_recommendation_background_color = get_theme_mod('rvx_reviews_overview_product_recommendation_background_color', '#F5F5F5'); $rvx_reviews_overview_product_recommendation_border_color = get_theme_mod('rvx_reviews_overview_product_recommendation_border_color', '#F5F5F5'); $rvx_reviews_overview_product_recommendation_border_radius = get_theme_mod('rvx_reviews_overview_product_recommendation_border_radius', 4); $rvx_reviews_overview_product_recommendation_text_color = get_theme_mod('rvx_reviews_overview_product_recommendation_text_color', '#424242'); $rvx_reviews_overview_product_recommendation_text_font_size = get_theme_mod('rvx_reviews_overview_product_recommendation_text_font_size', 14); // Review Criteria Text $rvx_reviews_overview_review_criteria_text_color = get_theme_mod('rvx_reviews_overview_review_criteria_text_color', '#424242'); $rvx_reviews_overview_review_criteria_text_font_size = get_theme_mod('rvx_reviews_overview_review_criteria_text_font_size', 14); /* * ReviewX - Filter Buttons */ // Filter Button $rvx_filter_button_text_color = get_theme_mod('rvx_filter_button_text_color', '#424242'); $rvx_filter_button_background_color = get_theme_mod('rvx_filter_button_background_color', '#F0F0F1'); $rvx_filter_button_border_color = get_theme_mod('rvx_filter_button_border_color', '#BDBDBD'); $rvx_filter_button_border_radius = get_theme_mod('rvx_filter_button_border_radius', 4); // Filter Dropdown menu $rvx_filter_dropdown_menu_text_color = get_theme_mod('rvx_filter_dropdown_menu_text_color', '#616161'); $rvx_filter_dropdown_menu_background_color = get_theme_mod('rvx_filter_dropdown_menu_background_color', '#FFFFFF'); $rvx_filter_dropdown_menu_border_color = get_theme_mod('rvx_filter_dropdown_menu_border_color', '#FFFFFF'); $rvx_filter_dropdown_menu_border_radius = get_theme_mod('rvx_filter_dropdown_menu_border_radius', 4); $rvx_filter_dropdown_menu_text_font_size = get_theme_mod('rvx_filter_dropdown_menu_text_font_size', 14); // Filter Dropdown [Filter by] $rvx_filter_by_text_color = get_theme_mod('rvx_filter_by_text_color', '#424242'); $rvx_filter_by_text_font_size = get_theme_mod('rvx_filter_by_text_font_size', 16); // Filter Dropdown menu: [Reset filters] button $rvx_filter_reset_button_text_color = get_theme_mod('rvx_filter_reset_button_text_color', '#0043DD'); $rvx_filter_reset_button_background_color = get_theme_mod('rvx_filter_reset_button_background_color', '#FFFFFF'); $rvx_filter_reset_button_border_color = get_theme_mod('rvx_filter_reset_button_border_color', '#FFFFFF'); $rvx_filter_reset_button_border_radius = get_theme_mod('rvx_filter_reset_button_border_radius', 4); // Filter Dropdown menu: [Apply] button $rvx_filter_apply_button_text_color = get_theme_mod('rvx_filter_apply_button_text_color', '#FFFFFF'); $rvx_filter_apply_button_background_color = get_theme_mod('rvx_filter_apply_button_background_color', '#0043DD'); $rvx_filter_apply_button_border_color = get_theme_mod('rvx_filter_apply_button_border_color', '#0043DD'); $rvx_filter_apply_button_border_radius = get_theme_mod('rvx_filter_apply_button_border_radius', 4); // Sort Button $rvx_sort_button_text_color = get_theme_mod('rvx_sort_button_text_color', '#424242'); $rvx_sort_button_background_color = get_theme_mod('rvx_sort_button_background_color', '#F0F0F1'); $rvx_sort_button_border_color = get_theme_mod('rvx_sort_button_border_color', '#BDBDBD'); $rvx_sort_button_border_radius = get_theme_mod('rvx_sort_button_border_radius', 4); // Sort Dropdown menu $rvx_sort_dropdown_menu_text_color = get_theme_mod('rvx_sort_dropdown_menu_text_color', '#616161'); $rvx_sort_dropdown_menu_background_color = get_theme_mod('rvx_sort_dropdown_menu_background_color', '#FFFFFF'); $rvx_sort_dropdown_menu_border_color = get_theme_mod('rvx_sort_dropdown_menu_border_color', '#FFFFFF'); $rvx_sort_dropdown_menu_border_radius = get_theme_mod('rvx_sort_dropdown_menu_border_radius', 4); $rvx_sort_dropdown_menu_text_font_size = get_theme_mod('rvx_sort_dropdown_menu_text_font_size', 14); // Write a Review Button //$rvx_write_review_button_text_color = get_theme_mod('rvx_write_review_button_text_color', '#424242'); //$rvx_write_review_button_background_color = get_theme_mod( 'rvx_write_review_button_background_color', '#BDBDBD'); $rvx_write_review_button_border_color = get_theme_mod('rvx_write_review_button_border_color', '#0043DD'); $rvx_write_review_button_border_radius = get_theme_mod('rvx_write_review_button_border_radius', 4); /* * ReviewX - Review Items */ // Review Items: Card $rvx_reviews_items_card_background_color = get_theme_mod('rvx_reviews_items_card_background_color', '#F5F5F5'); $rvx_reviews_items_card_border_color = get_theme_mod('rvx_reviews_items_card_border_color', '#F5F5F5'); $rvx_reviews_items_card_border_radius = get_theme_mod('rvx_reviews_items_card_border_radius', 6); $rvx_reviews_items_card_inline_padding = get_theme_mod('rvx_reviews_items_card_inline_padding', 8); // Review Items: Reviewer Name $rvx_reviews_items_reviewer_name_text_color = get_theme_mod('rvx_reviews_items_reviewer_name_text_color', '#424242'); $rvx_reviews_items_reviewer_name_text_font_size = get_theme_mod('rvx_reviews_items_reviewer_name_text_font_size', 20); // Review Items: Review Title $rvx_reviews_items_title_text_color = get_theme_mod('rvx_reviews_items_title_text_color', '#424242'); $rvx_reviews_items_title_text_font_size = get_theme_mod('rvx_reviews_items_title_text_font_size', 20); // Review Items: Review Date $rvx_reviews_items_date_text_color = get_theme_mod('rvx_reviews_items_date_text_color', '#757575'); $rvx_reviews_items_date_text_font_size = get_theme_mod('rvx_reviews_items_date_text_font_size', 14); // Review Items: Description $rvx_reviews_items_description_text_color = get_theme_mod('rvx_reviews_items_description_text_color', '#757575'); $rvx_reviews_items_description_text_font_size = get_theme_mod('rvx_reviews_items_description_text_font_size', 14); /* * ReviewX - Review Form */ // Form $rvx_input_form_background_color = get_theme_mod('rvx_input_form_background_color', '#F5F5F5'); // Disabled - already available in ReviewX-> Widget Settings $rvx_input_form_border_color = get_theme_mod('rvx_input_form_border_color', '#F5F5F5'); $rvx_input_form_border_radius = get_theme_mod('rvx_input_form_border_radius', 6); // Form: Title $rvx_input_form_title_text_color = get_theme_mod('rvx_input_form_title_text_color', '#424242'); $rvx_input_form_title_text_font_size = get_theme_mod('rvx_input_form_title_text_font_size', 18); // Form: Product Name $rvx_input_form_product_name_text_color = get_theme_mod('rvx_input_form_product_name_text_color', '#424242'); $rvx_input_form_product_name_text_font_size = get_theme_mod('rvx_input_form_product_name_text_font_size', 18); // Form: Criteria Title $rvx_input_form_criteria_title_text_color = get_theme_mod('rvx_input_form_criteria_title_text_color', '#424242'); $rvx_input_form_criteria_title_text_font_size = get_theme_mod('rvx_input_form_criteria_title_text_font_size', 16); // Form: Review Title $rvx_input_form_review_title_text_color = get_theme_mod('rvx_input_form_review_title_text_color', '#424242'); $rvx_input_form_review_title_text_font_size = get_theme_mod('rvx_input_form_review_title_text_font_size', 16); // Form: Description Title $rvx_input_form_description_title_text_color = get_theme_mod('rvx_input_form_description_title_text_color', '#424242'); $rvx_input_form_description_title_text_font_size = get_theme_mod('rvx_input_form_description_title_text_font_size', 16); // Form: Full Name $rvx_input_form_full_name_text_color = get_theme_mod('rvx_input_form_full_name_text_color', '#424242'); $rvx_input_form_full_name_text_font_size = get_theme_mod('rvx_input_form_full_name_text_font_size', 16); // Form: Email Address $rvx_input_form_email_address_text_color = get_theme_mod('rvx_input_form_email_address_text_color', '#424242'); $rvx_input_form_email_address_text_font_size = get_theme_mod('rvx_input_form_email_address_text_font_size', 16); // Form: Attachment Title $rvx_input_form_attachment_title_text_color = get_theme_mod('rvx_input_form_attachment_title_text_color', '#424242'); $rvx_input_form_attachment_title_text_font_size = get_theme_mod('rvx_input_form_attachment_title_text_font_size', 16); // Form: Mark as Anonymous $rvx_input_form_mark_anonymous_text_color = get_theme_mod('rvx_input_form_mark_anonymous_text_color', '#424242'); $rvx_input_form_mark_anonymous_text_font_size = get_theme_mod('rvx_input_form_mark_anonymous_text_font_size', 16); // Form: Recommended? $rvx_input_form_recommended_text_color = get_theme_mod('rvx_input_form_recommended_text_color', '#424242'); $rvx_input_form_recommended_text_font_size = get_theme_mod('rvx_input_form_recommended_text_font_size', 16); // Form: Submit Review Button //$rvx_submit_review_button_text_color = get_theme_mod('rvx_submit_review_button_text_color', '#FFFFFF'); //$rvx_submit_review_button_background_color = get_theme_mod( 'rvx_submit_review_button_background_color', '#0043DD'); $rvx_submit_review_button_border_color = get_theme_mod('rvx_submit_review_button_border_color', '#0043DD'); $rvx_submit_review_button_border_radius = get_theme_mod('rvx_submit_review_button_border_radius', 6); ?> <style type="text/css"> /* * ReviewX - Reviews Overview */ #rvx-storefront-widget p.rvx-rating-out-of, p.rvx-rating-out-of{ color: <?php echo esc_attr($rvx_reviews_overview_rating_out_of_text_color); ?> !important; font-size: <?php echo esc_attr($rvx_reviews_overview_rating_out_of_text_font_size); ?>px !important; } #rvx-storefront-widget span.rvx-rating-total, span.rvx-rating-total{ color: <?php echo esc_attr($rvx_reviews_overview_rating_out_of_total_text_color); ?> !important; font-size: <?php echo esc_attr($rvx_reviews_overview_rating_out_of_total_text_font_size); ?>px !important; } #rvx-storefront-widget .rvx-rating-badge, .rvx-rating-badge{ background-color: <?php echo esc_attr($rvx_reviews_overview_rating_badge_background_color); ?> !important; color: <?php echo esc_attr($rvx_reviews_overview_rating_badge_text_color); ?> !important; } /* #rvx-storefront-widget .rvx-review-form__star-active, .rvx-review-form__star-active{ fill:<?php //echo esc_attr($rvx_general_reviews_active_rating_stars_background_color); ?>; } #rvx-storefront-widget .rvx-review-form__star-active-half-star, .rvx-review-form__star-active-half-star{ stop-color:<?php //echo esc_attr($rvx_general_reviews_active_rating_stars_background_color); ?>; } #rvx-storefront-widget .rvx-aggregation__rating-icon path, .rvx-aggregation__rating-icon path{ fill:<?php //echo esc_attr($rvx_general_reviews_active_rating_stars_background_color); ?>; } #rvx-storefront-widget .rvx-aggregation__rating-icon, .rvx-aggregation__rating-icon{ fill:<?php //echo esc_attr($rvx_general_reviews_active_rating_stars_background_color); ?>; } */ #rvx-storefront-widget p.rvx-total-review, p.rvx-total-review{ color: <?php echo esc_attr($rvx_reviews_overview_total_reviews_text_color); ?> !important; font-size: <?php echo esc_attr($rvx_reviews_overview_total_reviews_text_font_size); ?>px !important; } #rvx-storefront-widget tr.rvx-aggregation__row td span, tr.rvx-aggregation__row td span{ color: <?php echo esc_attr($rvx_reviews_overview_rating_overview_chart_text_color); ?> !important; font-size: <?php echo esc_attr($rvx_reviews_overview_rating_overview_chart_text_font_size); ?>px !important; } #rvx-storefront-widget .rvx-recommendation-count, .rvx-recommendation-count{ background-color: <?php echo esc_attr($rvx_reviews_overview_product_recommendation_background_color); ?> !important; border:solid 1px <?php echo esc_attr($rvx_reviews_overview_product_recommendation_border_color); ?> !important; border-radius: <?php echo esc_attr($rvx_reviews_overview_product_recommendation_border_radius); ?>px !important; } #rvx-storefront-widget .rvx-recommendation-count p, .rvx-recommendation-count p{ color: <?php echo esc_attr($rvx_reviews_overview_product_recommendation_text_color); ?> !important; font-size: <?php echo esc_attr($rvx_reviews_overview_product_recommendation_text_font_size); ?>px !important; } #rvx-storefront-widget .rvx-recommendation-count svg, .rvx-recommendation-count svg{ width:<?php echo esc_attr($rvx_reviews_overview_product_recommendation_text_font_size); ?>; height:<?php echo esc_attr($rvx_reviews_overview_product_recommendation_text_font_size); ?>; } #rvx-storefront-widget .rvx-aggregation-multicriteria span, .rvx-aggregation-multicriteria span{ color: <?php echo esc_attr($rvx_reviews_overview_review_criteria_text_color); ?> !important; font-size: <?php echo esc_attr($rvx_reviews_overview_review_criteria_text_font_size); ?>px !important; } /* * ReviewX - Filter Buttons */ #rvx-storefront-widget .rvx-review-filter__button, .rvx-review-filter__button{ color: <?php echo esc_attr($rvx_filter_button_text_color); ?> !important; background-color: <?php echo esc_attr($rvx_filter_button_background_color); ?> !important; } #rvx-storefront-widget .rvx-review-filter__button, .rvx-review-filter__button{ border:solid 1px <?php echo esc_attr($rvx_filter_button_border_color); ?> !important; border-radius: <?php echo esc_attr($rvx_filter_button_border_radius); ?>px !important; } #rvx-storefront-widget .rvx-review-filter-wrapper, .rvx-review-filter-wrapper{ color: <?php echo esc_attr($rvx_filter_dropdown_menu_text_color); ?> !important; background-color: <?php echo esc_attr($rvx_filter_dropdown_menu_background_color); ?> !important; border:solid 1px <?php echo esc_attr($rvx_filter_dropdown_menu_border_color); ?> !important; border-radius: <?php echo esc_attr($rvx_filter_dropdown_menu_border_radius); ?>px !important; font-size: <?php echo esc_attr($rvx_filter_dropdown_menu_text_font_size); ?>px !important; } #rvx-storefront-widget .rvx-review-filter-wrapper p.rvx-review-filter-wrapper__title, .rvx-review-filter-wrapper p.rvx-review-filter-wrapper__title{ color: <?php echo esc_attr($rvx_filter_by_text_color); ?> !important; font-size: <?php echo esc_attr($rvx_filter_by_text_font_size); ?>px !important; } #rvx-storefront-widget .rvx-review-filter-wrapper__footer-reset-button, .rvx-review-filter-wrapper__footer-reset-button{ color: <?php echo esc_attr($rvx_filter_reset_button_text_color); ?> !important; background-color: <?php echo esc_attr($rvx_filter_reset_button_background_color); ?> !important; border:solid 1px <?php echo esc_attr($rvx_filter_reset_button_border_color); ?> !important; border-radius: <?php echo esc_attr($rvx_filter_reset_button_border_radius); ?>px !important; } #rvx-storefront-widget .rvx-review-filter-wrapper__footer-save-button, .rvx-review-filter-wrapper__footer-save-button{ color: <?php echo esc_attr($rvx_filter_apply_button_text_color); ?> !important; background-color: <?php echo esc_attr($rvx_filter_apply_button_background_color); ?> !important; border:solid 1px <?php echo esc_attr($rvx_filter_apply_button_border_color); ?> !important; border-radius: <?php echo esc_attr($rvx_filter_apply_button_border_radius); ?>px !important; } #rvx-storefront-widget .rvx-review-sort__button, .rvx-review-sort__button{ color: <?php echo esc_attr($rvx_sort_button_text_color); ?> !important; background-color: <?php echo esc_attr($rvx_sort_button_background_color); ?> !important; border:solid 1px <?php echo esc_attr($rvx_sort_button_border_color); ?> !important; border-radius: <?php echo esc_attr($rvx_sort_button_border_radius); ?>px !important; } #rvx-storefront-widget .rvx-review-sort-wrapper__outer, .rvx-review-sort-wrapper__outer{ color: <?php echo esc_attr($rvx_sort_dropdown_menu_text_color); ?> !important; background-color: <?php echo esc_attr($rvx_sort_dropdown_menu_background_color); ?> !important; border:solid 1px <?php echo esc_attr($rvx_sort_dropdown_menu_border_color); ?> !important; border-radius: <?php echo esc_attr($rvx_sort_dropdown_menu_border_radius); ?>px !important; font-size: <?php echo esc_attr($rvx_sort_dropdown_menu_text_font_size); ?>px !important; } #rvx-storefront-widget .rvx-review-write__button, .rvx-review-write__button{ border:solid 1px <?php echo esc_attr($rvx_write_review_button_border_color); ?> !important; border-radius: <?php echo esc_attr($rvx_write_review_button_border_radius); ?>px !important; } /* * ReviewX - Review Items */ #rvx-storefront-widget .rvx-review-wrapper .rvx-review-card, .rvx-review-wrapper .rvx-review-card{ background-color: <?php echo esc_attr($rvx_reviews_items_card_background_color); ?> !important; border:solid 1px <?php echo esc_attr($rvx_reviews_items_card_border_color); ?> !important; border-radius: <?php echo esc_attr($rvx_reviews_items_card_border_radius); ?>px !important; padding: <?php echo esc_attr($rvx_reviews_items_card_inline_padding); ?>px !important; } #rvx-storefront-widget .rvx-review-wrapper .rvx-review-card .rvx-review-user__name, .rvx-review-wrapper .rvx-review-card .rvx-review-user__name{ color: <?php echo esc_attr($rvx_reviews_items_reviewer_name_text_color); ?> !important; font-size: <?php echo esc_attr($rvx_reviews_items_reviewer_name_text_font_size); ?>px !important; } #rvx-storefront-widget .rvx-review-wrapper .rvx-review-card .rvx-review-info__title, .rvx-review-wrapper .rvx-review-card .rvx-review-info__title{ color: <?php echo esc_attr($rvx_reviews_items_title_text_color); ?> !important; font-size: <?php echo esc_attr($rvx_reviews_items_title_text_font_size); ?>px !important; } #rvx-storefront-widget .rvx-review-wrapper .rvx-review-card .rvx-review-info__date, .rvx-review-wrapper .rvx-review-card .rvx-review-info__date{ color: <?php echo esc_attr($rvx_reviews_items_date_text_color); ?> !important; font-size: <?php echo esc_attr($rvx_reviews_items_date_text_font_size); ?>px !important; } #rvx-storefront-widget .rvx-review-wrapper .rvx-review-card .rvx-review-info__feedback, .rvx-review-wrapper .rvx-review-card .rvx-review-info__feedback{ color: <?php echo esc_attr($rvx_reviews_items_description_text_color); ?> !important; font-size: <?php echo esc_attr($rvx_reviews_items_description_text_font_size); ?>px !important; } /* * ReviewX - Review Form */ #rvx-storefront-widget #rvx-review-form__wrapper, #rvx-review-form__wrapper{ background-color: <?php echo esc_attr($rvx_input_form_background_color); ?> !important; border:solid 1px <?php echo esc_attr($rvx_input_form_border_color); ?> !important; border-radius: <?php echo esc_attr($rvx_input_form_border_radius); ?>px !important; } #rvx-storefront-widget .rvx-review-form__title, .rvx-review-form__title{ color: <?php echo esc_attr($rvx_input_form_title_text_color); ?> !important; font-size: <?php echo esc_attr($rvx_input_form_title_text_font_size); ?>px !important; } #rvx-storefront-widget .rvx-review-form__product--title, .rvx-review-form__product--title{ color: <?php echo esc_attr($rvx_input_form_product_name_text_color); ?> !important; font-size: <?php echo esc_attr($rvx_input_form_product_name_text_font_size); ?>px !important; } #rvx-storefront-widget .rvx-review-form__multicriteria--name, .rvx-review-form__multicriteria--name{ color: <?php echo esc_attr($rvx_input_form_criteria_title_text_color); ?> !important; font-size: <?php echo esc_attr($rvx_input_form_criteria_title_text_font_size); ?>px !important; } #rvx-storefront-widget .rvx-review-form__title--name, .rvx-review-form__title--name{ color: <?php echo esc_attr($rvx_input_form_review_title_text_color); ?> !important; font-size: <?php echo esc_attr($rvx_input_form_review_title_text_font_size); ?>px !important; } #rvx-storefront-widget .rvx-review-form__description-title, .rvx-review-form__description-title{ color: <?php echo esc_attr($rvx_input_form_description_title_text_color); ?> !important; font-size: <?php echo esc_attr($rvx_input_form_description_title_text_font_size); ?>px !important; } #rvx-storefront-widget .rvx-review-form__user--name, .rvx-review-form__user--name{ color: <?php echo esc_attr($rvx_input_form_full_name_text_color); ?> !important; font-size: <?php echo esc_attr($rvx_input_form_full_name_text_font_size); ?>px !important; } #rvx-storefront-widget .rvx-review-form__email--name, .rvx-review-form__email--name{ color: <?php echo esc_attr($rvx_input_form_email_address_text_color); ?> !important; font-size: <?php echo esc_attr($rvx_input_form_email_address_text_font_size); ?>px !important; } #rvx-storefront-widget .rvx-review-form__attachment--name, .rvx-review-form__attachment--name{ color: <?php echo esc_attr($rvx_input_form_attachment_title_text_color); ?> !important; font-size: <?php echo esc_attr($rvx_input_form_attachment_title_text_font_size); ?>px !important; } #rvx-storefront-widget .rvx-review-form__mark-anonymous, .rvx-review-form__mark-anonymous{ color: <?php echo esc_attr($rvx_input_form_mark_anonymous_text_color); ?> !important; font-size: <?php echo esc_attr($rvx_input_form_mark_anonymous_text_font_size); ?>px !important; } #rvx-storefront-widget .rvx-review-form__recommended--name, .rvx-review-form__recommended--name{ color: <?php echo esc_attr($rvx_input_form_recommended_text_color); ?> !important; font-size: <?php echo esc_attr($rvx_input_form_recommended_text_font_size); ?>px !important; } #rvx-storefront-widget .rvx-review-form__submit--button, .rvx-review-form__submit--button{ border:solid 1px <?php echo esc_attr($rvx_submit_review_button_border_color); ?> !important; border-radius: <?php echo esc_attr($rvx_submit_review_button_border_radius); ?>px !important; } </style> <?php } } Customize/WidgetCustomizeOptionsHandler.php 0000777 00000142317 15251327637 0015271 0 ustar 00 <?php namespace Rvx\Handlers\Customize; use WP_Customize_Color_Control; class WidgetCustomizeOptionsHandler { public function __invoke($wp_customize) : void { //if (!did_action('elementor/loaded')) { $this->rvx_customizer_options_data($wp_customize); //} } public static function rvx_customize_preview_js() : void { add_action('customize_preview_init', function () { wp_enqueue_script('reviewx-customize', RVX_CUSTOMIZER_URL . 'assets/js/rvx-customize.js', array('jquery', 'customize-preview'), '', \true); }); } public function rvx_customizer_options_data($wp_customize) : void { // ReviewX Customize options - live preview js $this->rvx_customize_preview_js(); // ReviewX Customize options Data $wp_customize->add_panel('reviewx_form_input', ['title' => __('ReviewX', 'reviewx'), 'description' => __('Customize ReviewX Settings', 'reviewx'), 'priority' => 160]); // Add Section to the Panel [ReviewX -> Reviews Overview Section] /** $wp_customize->add_section('rvx_general_settings_section', array( 'title' => __('General Settings', 'reviewx'), 'panel' => 'reviewx_form_input', 'priority' => 10, )); */ // Add Section to the Panel [ReviewX -> Reviews Overview Section] $wp_customize->add_section('rvx_reviews_overview_section', array('title' => __('Reviews Overview', 'reviewx'), 'panel' => 'reviewx_form_input', 'priority' => 10)); // Add Section to the Panel [ReviewX -> Filter Buttons Section] $wp_customize->add_section('rvx_filter_section', array('title' => __('Filter Buttons', 'reviewx'), 'panel' => 'reviewx_form_input', 'priority' => 10)); // Add Section to the Panel [ReviewX -> Review Items Section] $wp_customize->add_section('rvx_review_items_section', array('title' => __('Review Items', 'reviewx'), 'panel' => 'reviewx_form_input', 'priority' => 10)); // Add Section to the Panel [ReviewX -> Review Form Section] $wp_customize->add_section('rvx_form_section', array('title' => __('Review Form', 'reviewx'), 'panel' => 'reviewx_form_input', 'priority' => 10)); /** * ReviewX - General Settings */ // Active Rating Stars: [Background Color] /** $wp_customize->add_setting('rvx_general_reviews_active_rating_stars_background_color', array( 'default' => '#FCCE08', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', )); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_general_reviews_active_rating_stars_background_color', array( 'label' => __('Active Rating Stars: [Background Color]', 'reviewx'), 'section' => 'rvx_general_settings_section', 'settings' => 'rvx_general_reviews_active_rating_stars_background_color', ))); */ /** * ReviewX - Reviews Overview */ // Rating out of: [Text Color] $wp_customize->add_setting('rvx_reviews_overview_rating_out_of_text_color', array('default' => '#424242', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_reviews_overview_rating_out_of_text_color', array('label' => __('Rating out of: [Text Color]', 'reviewx'), 'section' => 'rvx_reviews_overview_section', 'settings' => 'rvx_reviews_overview_rating_out_of_text_color'))); // Rating out of: [Font Size] $wp_customize->add_setting('rvx_reviews_overview_rating_out_of_text_font_size', array('default' => 43.942, 'sanitize_callback' => 'absint', 'transport' => 'postMessage')); $wp_customize->add_control('rvx_reviews_overview_rating_out_of_text_font_size', array('label' => __('Rating out of: [Font Size]', 'reviewx'), 'section' => 'rvx_reviews_overview_section', 'settings' => 'rvx_reviews_overview_rating_out_of_text_font_size', 'type' => 'range', 'input_attrs' => array('min' => 10, 'max' => 100, 'step' => 1.0))); // Rating out of Total: [Text Color] $wp_customize->add_setting('rvx_reviews_overview_rating_out_of_total_text_color', array('default' => '#BDBDBD', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_reviews_overview_rating_out_of_total_text_color', array('label' => __('Rating out of Total: [Text Color]', 'reviewx'), 'section' => 'rvx_reviews_overview_section', 'settings' => 'rvx_reviews_overview_rating_out_of_total_text_color'))); // Rating out of Total: [Font Size] $wp_customize->add_setting('rvx_reviews_overview_rating_out_of_total_text_font_size', array('default' => 26.365, 'sanitize_callback' => 'absint', 'transport' => 'postMessage')); $wp_customize->add_control('rvx_reviews_overview_rating_out_of_total_text_font_size', array('label' => __('Rating out of Total: [Font Size]', 'reviewx'), 'section' => 'rvx_reviews_overview_section', 'settings' => 'rvx_reviews_overview_rating_out_of_total_text_font_size', 'type' => 'range', 'input_attrs' => array('min' => 10, 'max' => 100, 'step' => 1.0))); // Rating Badge: [Background Color] $wp_customize->add_setting('rvx_reviews_overview_rating_badge_background_color', array('default' => '#22C55E', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_reviews_overview_rating_badge_background_color', array('label' => __('Rating Badge: [Background Color]', 'reviewx'), 'section' => 'rvx_reviews_overview_section', 'settings' => 'rvx_reviews_overview_rating_badge_background_color'))); // Rating Badge: [Text Color] $wp_customize->add_setting('rvx_reviews_overview_rating_badge_text_color', array('default' => '#FFFFFF', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_reviews_overview_rating_badge_text_color', array('label' => __('Rating Badge: [Text Color]', 'reviewx'), 'section' => 'rvx_reviews_overview_section', 'settings' => 'rvx_reviews_overview_rating_badge_text_color'))); // Total Reviews Count: [Text Color] $wp_customize->add_setting('rvx_reviews_overview_total_reviews_text_color', array('default' => '#424242', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_reviews_overview_total_reviews_text_color', array('label' => __('Total Reviews Count: [Text Color]', 'reviewx'), 'section' => 'rvx_reviews_overview_section', 'settings' => 'rvx_reviews_overview_total_reviews_text_color'))); // Total Reviews Count: [Font Size] $wp_customize->add_setting('rvx_reviews_overview_total_reviews_text_font_size', array('default' => 16, 'sanitize_callback' => 'absint', 'transport' => 'postMessage')); $wp_customize->add_control('rvx_reviews_overview_total_reviews_text_font_size', array('label' => __('Total Reviews Count: [Font Size]', 'reviewx'), 'section' => 'rvx_reviews_overview_section', 'settings' => 'rvx_reviews_overview_total_reviews_text_font_size', 'type' => 'range', 'input_attrs' => array('min' => 10, 'max' => 50, 'step' => 1))); // Rating Overview Chart: [Text Color] $wp_customize->add_setting('rvx_reviews_overview_rating_overview_chart_text_color', array('default' => '#424242', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_reviews_overview_rating_overview_chart_text_color', array('label' => __('Rating Overview Chart: [Text Color]', 'reviewx'), 'section' => 'rvx_reviews_overview_section', 'settings' => 'rvx_reviews_overview_rating_overview_chart_text_color'))); // Rating Overview Chart: [Font Size] $wp_customize->add_setting('rvx_reviews_overview_rating_overview_chart_text_font_size', array('default' => 14, 'sanitize_callback' => 'absint', 'transport' => 'postMessage')); $wp_customize->add_control('rvx_reviews_overview_rating_overview_chart_text_font_size', array('label' => __('Rating Overview Chart: [Font Size]', 'reviewx'), 'section' => 'rvx_reviews_overview_section', 'settings' => 'rvx_reviews_overview_rating_overview_chart_text_font_size', 'type' => 'range', 'input_attrs' => array('min' => 10, 'max' => 50, 'step' => 1))); // Product Recommendation: [Background Color] $wp_customize->add_setting('rvx_reviews_overview_product_recommendation_background_color', array('default' => '#F5F5F5', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_reviews_overview_product_recommendation_background_color', array('label' => __('Product Recommendation: [Background Color]', 'reviewx'), 'section' => 'rvx_reviews_overview_section', 'settings' => 'rvx_reviews_overview_product_recommendation_background_color'))); // Product Recommendation: [Border Color] $wp_customize->add_setting('rvx_reviews_overview_product_recommendation_border_color', array('default' => '#F5F5F5', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_reviews_overview_product_recommendation_border_color', array('label' => __('Product Recommendation: [Border Color]', 'reviewx'), 'section' => 'rvx_reviews_overview_section', 'settings' => 'rvx_reviews_overview_product_recommendation_border_color'))); // Product Recommendation: [Border Radius] $wp_customize->add_setting('rvx_reviews_overview_product_recommendation_border_radius', array('default' => 4, 'sanitize_callback' => 'absint', 'transport' => 'postMessage')); $wp_customize->add_control('rvx_reviews_overview_product_recommendation_border_radius', array('label' => __('Product Recommendation: [Border Radius]', 'reviewx'), 'section' => 'rvx_reviews_overview_section', 'settings' => 'rvx_reviews_overview_product_recommendation_border_radius', 'type' => 'range', 'input_attrs' => array('min' => 0, 'max' => 50, 'step' => 1))); // Product Recommendation Text: [Text Color] $wp_customize->add_setting('rvx_reviews_overview_product_recommendation_text_color', array('default' => '#424242', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_reviews_overview_product_recommendation_text_color', array('label' => __('Product Recommendation Text: [Text Color]', 'reviewx'), 'section' => 'rvx_reviews_overview_section', 'settings' => 'rvx_reviews_overview_product_recommendation_text_color'))); // Product Recommendation Text: [Font Size] $wp_customize->add_setting('rvx_reviews_overview_product_recommendation_text_font_size', array('default' => 14, 'sanitize_callback' => 'absint', 'transport' => 'postMessage')); $wp_customize->add_control('rvx_reviews_overview_product_recommendation_text_font_size', array('label' => __('Product Recommendation Text: [Font Size]', 'reviewx'), 'section' => 'rvx_reviews_overview_section', 'settings' => 'rvx_reviews_overview_product_recommendation_text_font_size', 'type' => 'range', 'input_attrs' => array('min' => 10, 'max' => 50, 'step' => 1))); // Review Criteria Text: [Text Color] $wp_customize->add_setting('rvx_reviews_overview_review_criteria_text_color', array('default' => '#424242', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_reviews_overview_review_criteria_text_color', array('label' => __('Review Criteria Text: [Text Color]', 'reviewx'), 'section' => 'rvx_reviews_overview_section', 'settings' => 'rvx_reviews_overview_review_criteria_text_color'))); // Review Criteria Text: [Font Size] $wp_customize->add_setting('rvx_reviews_overview_review_criteria_text_font_size', array('default' => 14, 'sanitize_callback' => 'absint', 'transport' => 'postMessage')); $wp_customize->add_control('rvx_reviews_overview_review_criteria_text_font_size', array('label' => __('Review Criteria Text: [Font Size]', 'reviewx'), 'section' => 'rvx_reviews_overview_section', 'settings' => 'rvx_reviews_overview_review_criteria_text_font_size', 'type' => 'range', 'input_attrs' => array('min' => 10, 'max' => 50, 'step' => 1))); /* * ReviewX - Filter Buttons */ // Filter Button: [Text Color] $wp_customize->add_setting('rvx_filter_button_text_color', array('default' => '#424242', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_filter_button_text_color', array('label' => __('Filter Button: [Text Color]', 'reviewx'), 'section' => 'rvx_filter_section', 'settings' => 'rvx_filter_button_text_color'))); // Filter Button: [Background Color] $wp_customize->add_setting('rvx_filter_button_background_color', array('default' => '#F0F0F1', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_filter_button_background_color', array('label' => __('Filter Button: [Background Color]', 'reviewx'), 'section' => 'rvx_filter_section', 'settings' => 'rvx_filter_button_background_color'))); // Filter Button: [Border Color] $wp_customize->add_setting('rvx_filter_button_border_color', array('default' => '#BDBDBD', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_filter_button_border_color', array('label' => __('Filter Button: [Border Color]', 'reviewx'), 'section' => 'rvx_filter_section', 'settings' => 'rvx_filter_button_border_color'))); // Filter Button: [Border Radius] $wp_customize->add_setting('rvx_filter_button_border_radius', array('default' => 4, 'sanitize_callback' => 'absint', 'transport' => 'postMessage')); $wp_customize->add_control('rvx_filter_button_border_radius', array('label' => __('Filter Button: [Border Radius]', 'reviewx'), 'section' => 'rvx_filter_section', 'settings' => 'rvx_filter_button_border_radius', 'type' => 'range', 'input_attrs' => array('min' => 0, 'max' => 50, 'step' => 1))); // Filter by: [Text Color] $wp_customize->add_setting('rvx_filter_by_text_color', array('default' => '#424242', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_filter_by_text_color', array('label' => __('Filter by: [Text Color]', 'reviewx'), 'section' => 'rvx_filter_section', 'settings' => 'rvx_filter_by_text_color'))); // Filter by: [Font Size] $wp_customize->add_setting('rvx_filter_by_text_font_size', array('default' => 16, 'sanitize_callback' => 'absint', 'transport' => 'postMessage')); $wp_customize->add_control('rvx_filter_by_text_font_size', array('label' => __('Filter by: [Font Size]', 'reviewx'), 'section' => 'rvx_filter_section', 'settings' => 'rvx_filter_by_text_font_size', 'type' => 'range', 'input_attrs' => array('min' => 10, 'max' => 50, 'step' => 1))); // Filter Dropdown Menu: [Text Color] $wp_customize->add_setting('rvx_filter_dropdown_menu_text_color', array('default' => '#616161', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_filter_dropdown_menu_text_color', array('label' => __('Filter Dropdown Menu: [Text Color]', 'reviewx'), 'section' => 'rvx_filter_section', 'settings' => 'rvx_filter_dropdown_menu_text_color'))); // Filter Dropdown Menu: [Background Color] $wp_customize->add_setting('rvx_filter_dropdown_menu_background_color', array('default' => '#FFFFFF', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_filter_dropdown_menu_background_color', array('label' => __('Filter Dropdown Menu: [Background Color]', 'reviewx'), 'section' => 'rvx_filter_section', 'settings' => 'rvx_filter_dropdown_menu_background_color'))); // Filter Dropdown Menu: [Border Color] $wp_customize->add_setting('rvx_filter_dropdown_menu_border_color', array('default' => '#FFFFFF', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_filter_dropdown_menu_border_color', array('label' => __('Filter Dropdown Menu: [Border Color]', 'reviewx'), 'section' => 'rvx_filter_section', 'settings' => 'rvx_filter_dropdown_menu_border_color'))); // Filter Dropdown Menu: [Border Radius] $wp_customize->add_setting('rvx_filter_dropdown_menu_border_radius', array('default' => 4, 'sanitize_callback' => 'absint', 'transport' => 'postMessage')); $wp_customize->add_control('rvx_filter_dropdown_menu_border_radius', array('label' => __('Filter Dropdown Menu: [Border Radius]', 'reviewx'), 'section' => 'rvx_filter_section', 'settings' => 'rvx_filter_dropdown_menu_border_radius', 'type' => 'range', 'input_attrs' => array('min' => 0, 'max' => 50, 'step' => 1))); // Filter Dropdown Menu: [Font Size] $wp_customize->add_setting('rvx_filter_dropdown_menu_text_font_size', array('default' => 14, 'sanitize_callback' => 'absint', 'transport' => 'postMessage')); $wp_customize->add_control('rvx_filter_dropdown_menu_text_font_size', array('label' => __('Filter Dropdown Menu: [Font Size]', 'reviewx'), 'section' => 'rvx_filter_section', 'settings' => 'rvx_filter_dropdown_menu_text_font_size', 'type' => 'range', 'input_attrs' => array('min' => 10, 'max' => 50, 'step' => 1))); // Filter Dropdown Menu: [Reset filters] button - [Text Color] $wp_customize->add_setting('rvx_filter_reset_button_text_color', array('default' => '#0043DD', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_filter_reset_button_text_color', array('label' => __('Reset filters button: [Text Color]', 'reviewx'), 'section' => 'rvx_filter_section', 'settings' => 'rvx_filter_reset_button_text_color'))); // Filter Dropdown Menu: [Reset filters] button - [Background Color] $wp_customize->add_setting('rvx_filter_reset_button_background_color', array('default' => '#FFFFFF', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_filter_reset_button_background_color', array('label' => __('Reset filters button: [Background Color]]', 'reviewx'), 'section' => 'rvx_filter_section', 'settings' => 'rvx_filter_reset_button_background_color'))); // Filter Dropdown Menu: [Reset filters] button - [Border Color] $wp_customize->add_setting('rvx_filter_reset_button_border_color', array('default' => '#FFFFFF', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_filter_reset_button_border_color', array('label' => __('Reset filters button: [Border Color]', 'reviewx'), 'section' => 'rvx_filter_section', 'settings' => 'rvx_filter_reset_button_border_color'))); // Filter Dropdown Menu: [Reset filters] button - [Border Radius] $wp_customize->add_setting('rvx_filter_reset_button_border_radius', array('default' => 4, 'sanitize_callback' => 'absint', 'transport' => 'postMessage')); $wp_customize->add_control('rvx_filter_reset_button_border_radius', array('label' => __('Reset filters button: [Border Radius]', 'reviewx'), 'section' => 'rvx_filter_section', 'settings' => 'rvx_filter_reset_button_border_radius', 'type' => 'range', 'input_attrs' => array('min' => 0, 'max' => 50, 'step' => 1))); // Filter Dropdown Menu: [Apply] button - [Text Color] $wp_customize->add_setting('rvx_filter_apply_button_text_color', array('default' => '#FFFFFF', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_filter_apply_button_text_color', array('label' => __('Apply filters button: [Text Color]', 'reviewx'), 'section' => 'rvx_filter_section', 'settings' => 'rvx_filter_apply_button_text_color'))); // Filter Dropdown Menu: [Apply] button - [Background Color] $wp_customize->add_setting('rvx_filter_apply_button_background_color', array('default' => '#0043DD', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_filter_apply_button_background_color', array('label' => __('Apply filters button: [Background Color]]', 'reviewx'), 'section' => 'rvx_filter_section', 'settings' => 'rvx_filter_apply_button_background_color'))); // Filter Dropdown Menu: [Apply] button - [Border Color] $wp_customize->add_setting('rvx_filter_apply_button_border_color', array('default' => '#0043DD', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_filter_apply_button_border_color', array('label' => __('Apply filters button: [Border Color]', 'reviewx'), 'section' => 'rvx_filter_section', 'settings' => 'rvx_filter_apply_button_border_color'))); // Filter Dropdown Menu: [Apply] button - [Border Radius] $wp_customize->add_setting('rvx_filter_apply_button_border_radius', array('default' => 4, 'sanitize_callback' => 'absint', 'transport' => 'postMessage')); $wp_customize->add_control('rvx_filter_apply_button_border_radius', array('label' => __('Apply filters button: [Border Radius]', 'reviewx'), 'section' => 'rvx_filter_section', 'settings' => 'rvx_filter_apply_button_border_radius', 'type' => 'range', 'input_attrs' => array('min' => 0, 'max' => 50, 'step' => 1))); // Sort Button: [Text Color] $wp_customize->add_setting('rvx_sort_button_text_color', array('default' => '#424242', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_sort_button_text_color', array('label' => __('Sort Button: [Text Color]', 'reviewx'), 'section' => 'rvx_filter_section', 'settings' => 'rvx_sort_button_text_color'))); // Sort Button: [Background Color] $wp_customize->add_setting('rvx_sort_button_background_color', array('default' => '#F0F0F1', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_sort_button_background_color', array('label' => __('Sort Button: [Background Color]', 'reviewx'), 'section' => 'rvx_filter_section', 'settings' => 'rvx_sort_button_background_color'))); // Sort Button: [Border Color] $wp_customize->add_setting('rvx_sort_button_border_color', array('default' => '#BDBDBD', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_sort_button_border_color', array('label' => __('Sort Button: [Border Color]', 'reviewx'), 'section' => 'rvx_filter_section', 'settings' => 'rvx_sort_button_border_color'))); // Sort Button: [Border Radius] $wp_customize->add_setting('rvx_sort_button_border_radius', array('default' => 4, 'sanitize_callback' => 'absint', 'transport' => 'postMessage')); $wp_customize->add_control('rvx_sort_button_border_radius', array('label' => __('Sort Button: [Border Radius]', 'reviewx'), 'section' => 'rvx_filter_section', 'settings' => 'rvx_sort_button_border_radius', 'type' => 'range', 'input_attrs' => array('min' => 0, 'max' => 50, 'step' => 1))); // Sort Dropdown Menu: [Text Color] $wp_customize->add_setting('rvx_sort_dropdown_menu_text_color', array('default' => '#616161', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_sort_dropdown_menu_text_color', array('label' => __('Sort Dropdown Menu: [Text Color]', 'reviewx'), 'section' => 'rvx_filter_section', 'settings' => 'rvx_sort_dropdown_menu_text_color'))); // Sort Dropdown Menu: [Background Color] $wp_customize->add_setting('rvx_sort_dropdown_menu_background_color', array('default' => '#FFFFFF', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_sort_dropdown_menu_background_color', array('label' => __('Sort Dropdown Menu: [Background Color]', 'reviewx'), 'section' => 'rvx_filter_section', 'settings' => 'rvx_sort_dropdown_menu_background_color'))); // Sort Dropdown Menu: [Border Color] $wp_customize->add_setting('rvx_sort_dropdown_menu_border_color', array('default' => '#FFFFFF', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_sort_dropdown_menu_border_color', array('label' => __('Sort Dropdown Menu: [Border Color]', 'reviewx'), 'section' => 'rvx_filter_section', 'settings' => 'rvx_sort_dropdown_menu_border_color'))); // Sort Dropdown Menu: [Border Radius] $wp_customize->add_setting('rvx_sort_dropdown_menu_border_radius', array('default' => 4, 'sanitize_callback' => 'absint', 'transport' => 'postMessage')); $wp_customize->add_control('rvx_sort_dropdown_menu_border_radius', array('label' => __('Sort Dropdown Menu: [Border Radius]', 'reviewx'), 'section' => 'rvx_filter_section', 'settings' => 'rvx_sort_dropdown_menu_border_radius', 'type' => 'range', 'input_attrs' => array('min' => 0, 'max' => 50, 'step' => 1))); // Sort Dropdown Menu: [Font Size] $wp_customize->add_setting('rvx_sort_dropdown_menu_text_font_size', array('default' => 14, 'sanitize_callback' => 'absint', 'transport' => 'postMessage')); $wp_customize->add_control('rvx_sort_dropdown_menu_text_font_size', array('label' => __('Sort Dropdown Menu: [Font Size]', 'reviewx'), 'section' => 'rvx_filter_section', 'settings' => 'rvx_sort_dropdown_menu_text_font_size', 'type' => 'range', 'input_attrs' => array('min' => 10, 'max' => 50, 'step' => 1))); // Write a Review Button: [Text Color] /** $wp_customize->add_setting('rvx_write_review_button_text_color', array( 'default' => '#ffffff', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', )); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_write_review_button_text_color', array( 'label' => __('Write a Review Button: [Text Color]', 'reviewx'), 'section' => 'rvx_filter_section', 'settings' => 'rvx_write_review_button_text_color', ))); // Write a Review Button: [Background Color] $wp_customize->add_setting('rvx_write_review_button_background_color', array( 'default' => '#0043DD', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', )); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_write_review_button_background_color', array( 'label' => __('Write a Review Button: [Background Color]', 'reviewx'), 'section' => 'rvx_filter_section', 'settings' => 'rvx_write_review_button_background_color', ))); */ // Write a Review Button: [Border Color] $wp_customize->add_setting('rvx_write_review_button_border_color', array('default' => '#0043DD', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_write_review_button_border_color', array('label' => __('Write a Review Button: [Border Color]', 'reviewx'), 'section' => 'rvx_filter_section', 'settings' => 'rvx_write_review_button_border_color'))); // Write a Review Button: [Border Radius] $wp_customize->add_setting('rvx_write_review_button_border_radius', array('default' => 4, 'sanitize_callback' => 'absint', 'transport' => 'postMessage')); $wp_customize->add_control('rvx_write_review_button_border_radius', array('label' => __('Write a Review Button: [Border Radius]', 'reviewx'), 'section' => 'rvx_filter_section', 'settings' => 'rvx_write_review_button_border_radius', 'type' => 'range', 'input_attrs' => array('min' => 0, 'max' => 50, 'step' => 1))); /** * ReviewX - Review Items */ // Review Items: Card - [Background Color] $wp_customize->add_setting('rvx_reviews_items_card_background_color', array('default' => '#F5F5F5', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_reviews_items_card_background_color', array('label' => __('Review Items: Card - [Background Color]', 'reviewx'), 'section' => 'rvx_review_items_section', 'settings' => 'rvx_reviews_items_card_background_color'))); // Review Items: Card - [Border Color] $wp_customize->add_setting('rvx_reviews_items_card_border_color', array('default' => '#F5F5F5', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_reviews_items_card_border_color', array('label' => __('Review Card: [Border Color]', 'reviewx'), 'section' => 'rvx_review_items_section', 'settings' => 'rvx_reviews_items_card_border_color'))); // Review Items: Card - [Padding] $wp_customize->add_setting('rvx_reviews_items_card_inline_padding', array('default' => 8, 'sanitize_callback' => 'absint', 'transport' => 'postMessage')); $wp_customize->add_control('rvx_reviews_items_card_inline_padding', array('label' => __('Review Card: [Padding]', 'reviewx'), 'section' => 'rvx_review_items_section', 'settings' => 'rvx_reviews_items_card_inline_padding', 'type' => 'range', 'input_attrs' => array('min' => 4, 'max' => 50, 'step' => 1))); // Review Items: Card - [Border Radius] $wp_customize->add_setting('rvx_reviews_items_card_border_radius', array('default' => 6, 'sanitize_callback' => 'absint', 'transport' => 'postMessage')); $wp_customize->add_control('rvx_reviews_items_card_border_radius', array('label' => __('Review Card: [Border Radius]', 'reviewx'), 'section' => 'rvx_review_items_section', 'settings' => 'rvx_reviews_items_card_border_radius', 'type' => 'range', 'input_attrs' => array('min' => 0, 'max' => 50, 'step' => 1))); // Review Items: Reviewer Name - [Text Color] $wp_customize->add_setting('rvx_reviews_items_reviewer_name_text_color', array('default' => '#424242', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_reviews_items_reviewer_name_text_color', array('label' => __('Reviewer Name: [Text Color]', 'reviewx'), 'section' => 'rvx_review_items_section', 'settings' => 'rvx_reviews_items_reviewer_name_text_color'))); // Review Items: Reviewer Name - [Text Size] $wp_customize->add_setting('rvx_reviews_items_reviewer_name_text_font_size', array('default' => 20, 'sanitize_callback' => 'absint', 'transport' => 'postMessage')); $wp_customize->add_control('rvx_reviews_items_reviewer_name_text_font_size', array('label' => __('Reviewer Name: [Text Size]', 'reviewx'), 'section' => 'rvx_review_items_section', 'settings' => 'rvx_reviews_items_reviewer_name_text_font_size', 'type' => 'range', 'input_attrs' => array('min' => 10, 'max' => 50, 'step' => 1))); // Review Items: Review Title - [Text Color] $wp_customize->add_setting('rvx_reviews_items_title_text_color', array('default' => '#424242', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_reviews_items_title_text_color', array('label' => __('Review Title: [Text Color]', 'reviewx'), 'section' => 'rvx_review_items_section', 'settings' => 'rvx_reviews_items_title_text_color'))); // Review Items: Review Title - [Text Size] $wp_customize->add_setting('rvx_reviews_items_title_text_font_size', array('default' => 20, 'sanitize_callback' => 'absint', 'transport' => 'postMessage')); $wp_customize->add_control('rvx_reviews_items_title_text_font_size', array('label' => __('Review Title: [Text Size]', 'reviewx'), 'section' => 'rvx_review_items_section', 'settings' => 'rvx_reviews_items_title_text_font_size', 'type' => 'range', 'input_attrs' => array('min' => 10, 'max' => 50, 'step' => 1))); // Review Items: Review Date - [Text Color] $wp_customize->add_setting('rvx_reviews_items_date_text_color', array('default' => '#757575', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_reviews_items_date_text_color', array('label' => __('Review Date: [Text Color]', 'reviewx'), 'section' => 'rvx_review_items_section', 'settings' => 'rvx_reviews_items_date_text_color'))); // Review Items: Review Date - [Text Size] $wp_customize->add_setting('rvx_reviews_items_date_text_font_size', array('default' => 14, 'sanitize_callback' => 'absint', 'transport' => 'postMessage')); $wp_customize->add_control('rvx_reviews_items_date_text_font_size', array('label' => __('Review Date: [Text Size]', 'reviewx'), 'section' => 'rvx_review_items_section', 'settings' => 'rvx_reviews_items_date_text_font_size', 'type' => 'range', 'input_attrs' => array('min' => 10, 'max' => 50, 'step' => 1))); // Review Items: Description - [Text Color] $wp_customize->add_setting('rvx_reviews_items_description_text_color', array('default' => '#757575', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_reviews_items_description_text_color', array('label' => __('Review Description: [Text Color]', 'reviewx'), 'section' => 'rvx_review_items_section', 'settings' => 'rvx_reviews_items_description_text_color'))); // Review Items: Description - [Text Size] $wp_customize->add_setting('rvx_reviews_items_description_text_font_size', array('default' => 14, 'sanitize_callback' => 'absint', 'transport' => 'postMessage')); $wp_customize->add_control('rvx_reviews_items_description_text_font_size', array('label' => __('Review Description: [Text Size]', 'reviewx'), 'section' => 'rvx_review_items_section', 'settings' => 'rvx_reviews_items_description_text_font_size', 'type' => 'range', 'input_attrs' => array('min' => 10, 'max' => 50, 'step' => 1))); /** * ReviewX - Review Form */ // Form: Background Color $wp_customize->add_setting('rvx_input_form_background_color', array('default' => '#F5F5F5', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_input_form_background_color', array('label' => __('Form: Background Color', 'reviewx'), 'section' => 'rvx_form_section', 'settings' => 'rvx_input_form_background_color'))); // Form: [Border Color] $wp_customize->add_setting('rvx_input_form_border_color', array('default' => '#F5F5F5', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_input_form_border_color', array('label' => __('Form: [Border Color]', 'reviewx'), 'section' => 'rvx_form_section', 'settings' => 'rvx_input_form_border_color'))); // Form: Border Radius $wp_customize->add_setting('rvx_input_form_border_radius', array('default' => 6, 'sanitize_callback' => 'absint', 'transport' => 'postMessage')); $wp_customize->add_control('rvx_input_form_border_radius', array('label' => __('Form: Border Radius', 'reviewx'), 'section' => 'rvx_form_section', 'settings' => 'rvx_input_form_border_radius', 'type' => 'range', 'input_attrs' => array('min' => 0, 'max' => 50, 'step' => 1))); // Form: Title [Text Color] $wp_customize->add_setting('rvx_input_form_title_text_color', array('default' => '#424242', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_input_form_title_text_color', array('label' => __('Form: Title [Text Color]', 'reviewx'), 'section' => 'rvx_form_section', 'settings' => 'rvx_input_form_title_text_color'))); // Form: Title [Text Size] $wp_customize->add_setting('rvx_input_form_title_text_font_size', array('default' => 18, 'sanitize_callback' => 'absint', 'transport' => 'postMessage')); $wp_customize->add_control('rvx_input_form_title_text_font_size', array('label' => __('Form: Title [Text Size]', 'reviewx'), 'section' => 'rvx_form_section', 'settings' => 'rvx_input_form_title_text_font_size', 'type' => 'range', 'input_attrs' => array('min' => 10, 'max' => 100, 'step' => 1))); // Form: Product Name [Text Color] $wp_customize->add_setting('rvx_input_form_product_name_text_color', array('default' => '#424242', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_input_form_product_name_text_color', array('label' => __('Form: Product Name [Text Color]', 'reviewx'), 'section' => 'rvx_form_section', 'settings' => 'rvx_input_form_product_name_text_color'))); // Form: Product Name [Text Size] $wp_customize->add_setting('rvx_input_form_product_name_text_font_size', array('default' => 18, 'sanitize_callback' => 'absint', 'transport' => 'postMessage')); $wp_customize->add_control('rvx_input_form_product_name_text_font_size', array('label' => __('Form: Product Name [Text Size]', 'reviewx'), 'section' => 'rvx_form_section', 'settings' => 'rvx_input_form_product_name_text_font_size', 'type' => 'range', 'input_attrs' => array('min' => 10, 'max' => 50, 'step' => 1))); // Form: Criteria Title [Text Color] $wp_customize->add_setting('rvx_input_form_criteria_title_text_color', array('default' => '#424242', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_input_form_criteria_title_text_color', array('label' => __('Form: Criteria Title [Text Color]', 'reviewx'), 'section' => 'rvx_form_section', 'settings' => 'rvx_input_form_criteria_title_text_color'))); // Form: Criteria Title [Text Size] $wp_customize->add_setting('rvx_input_form_criteria_title_text_font_size', array('default' => 16, 'sanitize_callback' => 'absint', 'transport' => 'postMessage')); $wp_customize->add_control('rvx_input_form_criteria_title_text_font_size', array('label' => __('Form: Criteria Title [Text Size]', 'reviewx'), 'section' => 'rvx_form_section', 'settings' => 'rvx_input_form_criteria_title_text_font_size', 'type' => 'range', 'input_attrs' => array('min' => 10, 'max' => 50, 'step' => 1))); // Form: Review Title [Text Color] $wp_customize->add_setting('rvx_input_form_review_title_text_color', array('default' => '#424242', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_input_form_review_title_text_color', array('label' => __('Form: Review Title [Text Color]', 'reviewx'), 'section' => 'rvx_form_section', 'settings' => 'rvx_input_form_review_title_text_color'))); // Form: Review Title [Text Size] $wp_customize->add_setting('rvx_input_form_review_title_text_font_size', array('default' => 16, 'sanitize_callback' => 'absint', 'transport' => 'postMessage')); $wp_customize->add_control('rvx_input_form_review_title_text_font_size', array('label' => __('Form: Review Title [Text Size]', 'reviewx'), 'section' => 'rvx_form_section', 'settings' => 'rvx_input_form_review_title_text_font_size', 'type' => 'range', 'input_attrs' => array('min' => 10, 'max' => 50, 'step' => 1))); // Form: Description [Text Color] $wp_customize->add_setting('rvx_input_form_description_title_text_color', array('default' => '#424242', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_input_form_description_title_text_color', array('label' => __('Form: Description [Text Color]', 'reviewx'), 'section' => 'rvx_form_section', 'settings' => 'rvx_input_form_description_title_text_color'))); // Form: Description [Text Size] $wp_customize->add_setting('rvx_input_form_description_title_text_font_size', array('default' => 16, 'sanitize_callback' => 'absint', 'transport' => 'postMessage')); $wp_customize->add_control('rvx_input_form_description_title_text_font_size', array('label' => __('Form: Description [Text Size]', 'reviewx'), 'section' => 'rvx_form_section', 'settings' => 'rvx_input_form_description_title_text_font_size', 'type' => 'range', 'input_attrs' => array('min' => 10, 'max' => 50, 'step' => 1))); // Form: Full Name [Text Color] $wp_customize->add_setting('rvx_input_form_full_name_text_color', array('default' => '#424242', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_input_form_full_name_text_color', array('label' => __('Form: Full Name [Text Color]', 'reviewx'), 'section' => 'rvx_form_section', 'settings' => 'rvx_input_form_full_name_text_color'))); // Form: Full Name [Text Size] $wp_customize->add_setting('rvx_input_form_full_name_text_font_size', array('default' => 16, 'sanitize_callback' => 'absint', 'transport' => 'postMessage')); $wp_customize->add_control('rvx_input_form_full_name_text_font_size', array('label' => __('Form: Full Name [Text Size]', 'reviewx'), 'section' => 'rvx_form_section', 'settings' => 'rvx_input_form_full_name_text_font_size', 'type' => 'range', 'input_attrs' => array('min' => 10, 'max' => 50, 'step' => 1))); // Form: Email Address [Text Color] $wp_customize->add_setting('rvx_input_form_email_address_text_color', array('default' => '#424242', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_input_form_email_address_text_color', array('label' => __('Form: Email Address [Text Color]', 'reviewx'), 'section' => 'rvx_form_section', 'settings' => 'rvx_input_form_email_address_text_color'))); // Form: Email Address [Text Size] $wp_customize->add_setting('rvx_input_form_email_address_text_font_size', array('default' => 16, 'sanitize_callback' => 'absint', 'transport' => 'postMessage')); $wp_customize->add_control('rvx_input_form_email_address_text_font_size', array('label' => __('Form: Email Address [Text Size]', 'reviewx'), 'section' => 'rvx_form_section', 'settings' => 'rvx_input_form_email_address_text_font_size', 'type' => 'range', 'input_attrs' => array('min' => 10, 'max' => 50, 'step' => 1))); // Form: Attachment Title [Text Color] $wp_customize->add_setting('rvx_input_form_attachment_title_text_color', array('default' => '#424242', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_input_form_attachment_title_text_color', array('label' => __('Form: Attachment [Text Color]', 'reviewx'), 'section' => 'rvx_form_section', 'settings' => 'rvx_input_form_attachment_title_text_color'))); // Form: Attachment Title [Text Size] $wp_customize->add_setting('rvx_input_form_attachment_title_text_font_size', array('default' => 16, 'sanitize_callback' => 'absint', 'transport' => 'postMessage')); $wp_customize->add_control('rvx_input_form_attachment_title_text_font_size', array('label' => __('Form: Attachment [Text Size]', 'reviewx'), 'section' => 'rvx_form_section', 'settings' => 'rvx_input_form_attachment_title_text_font_size', 'type' => 'range', 'input_attrs' => array('min' => 10, 'max' => 50, 'step' => 1))); // Form: Mark as Anonymous [Text Color] $wp_customize->add_setting('rvx_input_form_mark_anonymous_text_color', array('default' => '#424242', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_input_form_mark_anonymous_text_color', array('label' => __('Form: Mark as Anonymous [Text Color]', 'reviewx'), 'section' => 'rvx_form_section', 'settings' => 'rvx_input_form_mark_anonymous_text_color'))); // Form: Mark as Anonymous [Text Size] $wp_customize->add_setting('rvx_input_form_mark_anonymous_text_font_size', array('default' => 16, 'sanitize_callback' => 'absint', 'transport' => 'postMessage')); $wp_customize->add_control('rvx_input_form_mark_anonymous_text_font_size', array('label' => __('Form: Mark as Anonymous [Text Size]', 'reviewx'), 'section' => 'rvx_form_section', 'settings' => 'rvx_input_form_mark_anonymous_text_font_size', 'type' => 'range', 'input_attrs' => array('min' => 10, 'max' => 50, 'step' => 1))); // Form: Recommended? [Text Color] $wp_customize->add_setting('rvx_input_form_recommended_text_color', array('default' => '#424242', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_input_form_recommended_text_color', array('label' => __('Form: Recommended? [Text Color]', 'reviewx'), 'section' => 'rvx_form_section', 'settings' => 'rvx_input_form_recommended_text_color'))); // Form: Recommended? [Text Size] $wp_customize->add_setting('rvx_input_form_recommended_text_font_size', array('default' => 16, 'sanitize_callback' => 'absint', 'transport' => 'postMessage')); $wp_customize->add_control('rvx_input_form_recommended_text_font_size', array('label' => __('Form: Recommended? [Text Size]', 'reviewx'), 'section' => 'rvx_form_section', 'settings' => 'rvx_input_form_recommended_text_font_size', 'type' => 'range', 'input_attrs' => array('min' => 10, 'max' => 50, 'step' => 1))); // Form: Submit Review Button [Text Color] /** $wp_customize->add_setting('rvx_submit_review_button_text_color', array( 'default' => '#FFFFFF', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', )); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_submit_review_button_text_color', array( 'label' => __('Submit Review Button: [Text Color]', 'reviewx'), 'section' => 'rvx_form_section', 'settings' => 'rvx_submit_review_button_text_color', ))); // Form: Submit Review Button [Background Color] $wp_customize->add_setting('rvx_submit_review_button_background_color', array( 'default' => '#0043DD', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', )); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_submit_review_button_background_color', array( 'label' => __('Submit Review Button: [Background Color]', 'reviewx'), 'section' => 'rvx_form_section', 'settings' => 'rvx_submit_review_button_background_color', ))); */ // Form: Submit Review Button [Border Color] $wp_customize->add_setting('rvx_submit_review_button_border_color', array('default' => '#0043DD', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage')); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'rvx_submit_review_button_border_color', array('label' => __('Submit Review Button: [Border Color]', 'reviewx'), 'section' => 'rvx_form_section', 'settings' => 'rvx_submit_review_button_border_color'))); // Form: Submit Review Button [Border Radius] $wp_customize->add_setting('rvx_submit_review_button_border_radius', array('default' => 6, 'sanitize_callback' => 'absint', 'transport' => 'postMessage')); $wp_customize->add_control('rvx_submit_review_button_border_radius', array('label' => __('Submit Review Button: [Border Radius]', 'reviewx'), 'section' => 'rvx_form_section', 'settings' => 'rvx_submit_review_button_border_radius', 'type' => 'range', 'input_attrs' => array('min' => 0, 'max' => 50, 'step' => 1))); } } Customize/WCUserDashboardAddReview.php 0000777 00000004041 15251327637 0014033 0 ustar 00 <?php namespace Rvx\Handlers\Customize; use Rvx\Utilities\Helper; use Rvx\WPDrill\Facades\View; class WCUserDashboardAddReview { /** * Renders the RVX review form on the WooCommerce user dashboard. * * This outputs the review form view for the WooCommerce user dashboard. * */ public function renderRvxReviewForm() { $attributes = self::setRvxAttributes(); $formData = $this->formDefaultTextsData(); View::output('storefront/my-account/review-form', ['data' => $attributes, 'formLevelData' => $formData]); return ''; } public function setRvxAttributes() { $user_id = get_current_user_id(); $wpCurrentUser = Helper::getWpCurrentUser(); $user_name = $wpCurrentUser ? $wpCurrentUser->display_name : ''; $attributes = ['userInfo' => ['isLoggedIn' => Helper::loggedIn(), 'id' => $wpCurrentUser ? $wpCurrentUser->ID : null, 'name' => $user_name, 'email' => $wpCurrentUser ? $wpCurrentUser->user_email : '', 'isVerified' => Helper::verifiedCustomer($user_id)], 'domain' => ['baseDomain' => Helper::domainSupport(), 'baseRestUrl' => Helper::getRestAPIurl()]]; return \json_encode($attributes); } public function formDefaultTextsData() { // Define the default values, if no builder is active / available then use the default string / texts $default_values = ['write_a_review' => 'Write a Review', 'text_rating_star_title' => 'Rating', 'text_review_title' => 'Review Title', 'placeholder_review_title' => 'Write Review Title', 'text_review_description' => 'Description', 'placeholder_review_description' => 'Write your description here', 'text_full_name' => 'Full name', 'placeholder_full_name' => 'Full Name', 'text_email_name' => 'Email address', 'placeholder_email_name' => 'Email Address', 'text_attachment_title' => 'Attachment', 'placeholder_upload_photo' => 'Upload Photo / Video', 'text_mark_as_anonymous' => 'Mark as Anonymous', 'text_recommended_title' => 'Recommendation?']; return \json_encode($default_values); } } OrderUpdateHandler.php 0000777 00000001033 15251327637 0011010 0 ustar 00 <?php namespace Rvx\Handlers; use Rvx\Services\OrderService; class OrderUpdateHandler { protected $orderService; public function __construct() { $this->orderService = new OrderService(); } public function __invoke($order_id) { $transient_key = 'order_updated_' . $order_id; if (\false === \get_transient($transient_key)) { \set_transient($transient_key, \true, 30); wp_schedule_single_event(\time() + 5, 'process_order_update', array($order_id)); } } } CommentBoxHandle.php 0000777 00000005315 15251327637 0010472 0 ustar 00 <?php namespace Rvx\Handlers; use Rvx\Utilities\Helper; use Rvx\WPDrill\Facades\View; use Rvx\Form\ReviewFormHelper; class CommentBoxHandle { protected $reviewFormHelper; public function __construct() { $this->reviewFormHelper = new ReviewFormHelper(); } public function __invoke() : void { $attributes = $this->setRvxAttributes(); $formData = $this->reviewFormHelper->builderCustomizedFormTextsData(); $wooVerificationRequired = \get_option('woocommerce_review_rating_verification_required') === 'yes'; $requireSignIn = (bool) \get_option('comment_registration'); $currentUrl = esc_url(add_query_arg([], wp_unslash($_SERVER['REQUEST_URI']))); $this->reviewFormHelper->commentBoxDefaultStyleForCustomPostType(); View::output('storefront/widget/index', ['data' => \json_encode($attributes, \JSON_UNESCAPED_UNICODE), 'formLevelData' => $formData, 'wooVerificationRequired' => $wooVerificationRequired, 'isVerifiedCustomer' => $attributes['userInfo']['isVerified'], 'requireSignIn' => $requireSignIn, 'user_is_logged_in' => $attributes['userInfo']['isLoggedIn'], 'login_url' => wp_login_url($currentUrl), 'register_url' => wp_registration_url(), 'registration_enabled' => (bool) \get_option('users_can_register')]); } private function setRvxAttributes() : array { $wpCurrentUser = Helper::getWpCurrentUser(); $userId = get_current_user_id(); // WooCommerce verification if (\class_exists('WooCommerce') && is_singular('product') && get_post_type() === 'product') { $userInfo['isVerified'] = Helper::verifiedCustomer($userId); } $isVerifiedCustomer = 0; if (\class_exists('WooCommerce') && is_singular('product') && 'product' === get_post_type()) { $isVerifiedCustomer = Helper::verifiedCustomer($userId); } // Post type enable check $enabledPostTypes = $this->reviewFormHelper->rvxEnabledPostTypes(); $currentPostType = \strtolower(get_post_type()); $postTypeEnabled = !empty($enabledPostTypes[$currentPostType]) && \strtolower($enabledPostTypes[$currentPostType]) === $currentPostType; return ['postTypeEnabled' => $postTypeEnabled, 'product' => ['id' => get_the_ID(), 'postType' => $currentPostType], 'userInfo' => ['isLoggedIn' => Helper::loggedIn(), 'id' => $wpCurrentUser ? (int) $wpCurrentUser->ID : 0, 'name' => $wpCurrentUser && $wpCurrentUser->display_name ? $wpCurrentUser->display_name : '', 'email' => $wpCurrentUser && $wpCurrentUser->user_email ? $wpCurrentUser->user_email : '', 'isVerified' => $isVerifiedCustomer], 'domain' => ['baseDomain' => Helper::domainSupport(), 'baseRestUrl' => Helper::getRestAPIurl()]]; } } WcTemplates/WcAccountFormTag.php 0000777 00000000240 15251327637 0012671 0 ustar 00 <?php namespace Rvx\Handlers\WcTemplates; class WcAccountFormTag { public function __invoke() { echo 'enctype="multipart/form-data"'; } } WcTemplates/WoocommerceCustomColumnsHandler.php 0000777 00000000437 15251327637 0016044 0 ustar 00 <?php namespace Rvx\Handlers\WcTemplates; class WoocommerceCustomColumnsHandler { public function __invoke($columns) { $columns['rvx-review'] = __('Review', 'reviewx'); // $columns['rvx-product-image'] = __('Image', 'reviewx'); return $columns; } } WcTemplates/WcOrderTableRvxReviewHandler.php 0000777 00000001156 15251327637 0015227 0 ustar 00 <?php namespace Rvx\Handlers\WcTemplates; class WcOrderTableRvxReviewHandler { public function __invoke($order) { $order_id = $order->get_id(); $items = $order->get_items(); foreach ($items as $item_id => $item) { $product_id = $item->get_product_id(); $button_url = add_query_arg(array('order_id' => $order_id, 'product_id' => $product_id, 'item_id' => $item_id), site_url('/your-custom-template/')); echo '<a href="' . esc_url($button_url) . '" class="woocommerce-button button">' . __('View Details', 'your-text-domain') . '</a>'; } } } WcTemplates/WcEditAccountForm.php 0000777 00000001546 15251327637 0013055 0 ustar 00 <?php namespace Rvx\Handlers\WcTemplates; class WcEditAccountForm { public function __invoke() { $user_id = get_current_user_id(); $attachment_id = \get_user_meta($user_id, "rvx_image", \true); if ($attachment_id) { $original_image_url = wp_get_attachment_url($attachment_id); } if (!empty($original_image_url)) { echo '<img src="' . esc_url($original_image_url) . '" width="70px" height="70px" alt="user image">'; } ?> <p class="woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide"> <label for="image"><?php esc_html_e("Image", "woocommerce"); ?></label> <input type="file" class="woocommerce-Input" name="image" accept="image/x-png,image/gif,image/jpeg"> </p> <?php } } WcTemplates/WcSendEmailPermissionHandler.php 0000777 00000000445 15251327637 0015234 0 ustar 00 <?php namespace Rvx\Handlers\WcTemplates; class WcSendEmailPermissionHandler { public function __invoke($fields) { $fields['order']['consent_email_subscription'] = ['type' => 'checkbox', 'label' => __('I want to subscribe email', 'reviewx')]; return $fields; } } WcTemplates/WcAccountDetails.php 0000777 00000002771 15251327637 0012732 0 ustar 00 <?php namespace Rvx\Handlers\WcTemplates; use Rvx\Api\UserApi; use Rvx\Utilities\Auth\Client; class WcAccountDetails { public function __invoke($user_id) { if (isset($_FILES["image"]) && $_FILES["image"]["error"] == \UPLOAD_ERR_OK) { require_once ABSPATH . "wp-admin/includes/image.php"; $attachment_id = media_handle_upload("image", 0); if (!\is_wp_error($attachment_id)) { \error_log("da3333" . \print_r([$user_id, $attachment_id], \true)); \update_user_meta($user_id, "rvx_image", $attachment_id); $this->userDataForm(); } } } function userDataForm() { $user_id = get_current_user_id(); $user_info = get_userdata($user_id); $attachment_id = \get_user_meta($user_id, "rvx_image", \true); $original_image_url = $attachment_id ? wp_get_attachment_url($attachment_id) : get_avatar_url($user_id); $data = ["name" => $user_info->first_name . " " . $user_info->last_name, "email" => $user_info->user_email, "avatar" => $original_image_url, "city" => \get_user_meta($user_id, "billing_city", \true) ?? "", "phone" => \get_user_meta($user_id, "billing_phone", \true) ?? "", "address" => \get_user_meta($user_id, "billing_address_1", \true) ?? "", "country" => \get_user_meta($user_id, "billing_country", \true) ?? "", "status" => 1]; $uid = Client::getUid() . "-" . $user_id; $response = (new UserApi())->editAccountUpdate($data, $uid); } } WcTemplates/WcAccountDetailsError.php 0000777 00000000640 15251327637 0013735 0 ustar 00 <?php namespace Rvx\Handlers\WcTemplates; class WcAccountDetailsError { public function __invoke($args) { // if ( // isset($_FILES["image"]) && // $_FILES["image"]["error"] != UPLOAD_ERR_OK // ) { // $args->add( // "image_error", // __("Please provide a valid image", "woocommerce") // ); // } } } WcTemplates/WoocommerceLocateTemplateHandler.php 0000777 00000000567 15251327637 0016140 0 ustar 00 <?php namespace Rvx\Handlers\WcTemplates; class WoocommerceLocateTemplateHandler { public function __invoke($template, $template_name, $template_path) { $plugin_path = RVX_DIR_PATH . 'woocommerce/'; if (\file_exists($plugin_path . $template_name)) { $template = $plugin_path . $template_name; } return $template; } } WcTemplates/WcOrderTableProductImageHandler.php 0000777 00000001241 15251327637 0015644 0 ustar 00 <?php namespace Rvx\Handlers\WcTemplates; class WcOrderTableProductImageHandler { public function __invoke($order) { $items = $order->get_items(); foreach ($items as $item_id => $item) { $product_id = $item->get_product_id(); $product = wc_get_product($product_id); if ($product) { $image_url = wp_get_attachment_image_url($product->get_image_id(), 'thumbnail'); if ($image_url) { echo '<img src="' . esc_url($image_url) . '" alt="' . esc_attr($product->get_name()) . '" style="width:50px; height:50px;" />'; } } } } } RichSchema/WoocommerceRichSchemaHandler.php 0000777 00000006613 15251327637 0015017 0 ustar 00 <?php namespace Rvx\Handlers\RichSchema; use Rvx\Services\SettingService; use Rvx\WC_Product; /** * Handles rich schema markup for WooCommerce single product pages. */ class WoocommerceRichSchemaHandler { /** * Adds or modifies structured data for WooCommerce product schema. * * @param array $markup Existing WooCommerce schema data. * @param WC_Product $product WooCommerce product object. * @return array */ public function __invoke($markup, $product) : array { // Ensure we are on a single product page and in frontend. if (is_admin() || !\function_exists('is_product') || !\is_product()) { return $markup; } if (!$product instanceof WC_Product) { return $markup; } // Temporarily remove Divi filter $divi_callback = 'et_theme_builder_wc_set_review_metadata'; $divi_removed = \false; if (\function_exists('has_filter')) { $priority = \has_filter('get_comment_metadata', $divi_callback); if ($priority !== \false) { remove_filter('get_comment_metadata', $divi_callback, (int) $priority); $divi_removed = \true; } } // Allow disabling via settings. $settings = (new SettingService())->getReviewSettings('product'); if (!empty($settings['reviews']['product_schema']) && $settings['reviews']['product_schema'] == 1) { if (!empty($markup['aggregateRating'])) { unset($markup['aggregateRating']); } if (!empty($markup['review'])) { unset($markup['review']); } return $markup; } // Get product rating data. // $averageRating = (float) $product->get_average_rating(); // $reviewCount = (int) $product->get_review_count(); $reviewCount = 0; $averageRating = 0.0; $reviewItems = []; // Fetch all approved reviews. $reviews = get_comments(['post_id' => $product->get_id(), 'status' => 'approve', 'type' => 'review']); if (!empty($reviews)) { foreach ($reviews as $review) { if (!empty($review->comment_parent)) { continue; // Skip replies } $rating = \get_comment_meta($review->comment_ID, 'rating', \true); $ratingValue = $rating !== '' ? (float) $rating : null; if ($ratingValue !== null) { $reviewCount++; $averageRating += $ratingValue; $reviewItems[] = ['@type' => 'Review', 'author' => ['@type' => 'Person', 'name' => $review->comment_author], 'reviewRating' => ['@type' => 'Rating', 'ratingValue' => $ratingValue], 'datePublished' => get_comment_date('c', $review), 'reviewBody' => $review->comment_content]; } } } if ($reviewCount > 0 && $averageRating > 0) { $trueAverage = \round($averageRating / $reviewCount, 2); $markup['aggregateRating'] = ['@type' => 'AggregateRating', 'ratingValue' => $trueAverage, 'reviewCount' => $reviewCount]; $markup['review'] = $reviewItems; } // Restore Divi filter if ($divi_removed) { add_filter('get_comment_metadata', $divi_callback, $priority ?? 10, 4); } return $markup; } } AllHandler.php 0000777 00000000544 15251327637 0007310 0 ustar 00 <?php namespace Rvx\Handlers; use Rvx\WPDrill\Contracts\InvokableContract; use Rvx\WPDrill\Facades\View; class AllHandler implements InvokableContract { public function __invoke() { View::output('storefront/widget/index', ['title' => 'Welcome dfgsdfg sdfsdf', 'content' => 'A WordPress Plugin development framework for humans']); } } OrderCreateHandler.php 0000777 00000010753 15251327637 0011002 0 ustar 00 <?php namespace Rvx\Handlers; use Rvx\Api\UserApi; use Rvx\Api\OrderApi; use Rvx\Utilities\TransactionManager; use Rvx\WPDrill\Response; use Rvx\Utilities\Helper; use Rvx\Utilities\Auth\Client; use Exception; class OrderCreateHandler { public function __invoke($order_id) { try { $order = wc_get_order($order_id); if (!$order) { return \false; } // WP Operation: Mark as new order. This MUST happen regardless of SaaS success. \update_post_meta($order_id, '_rvx_is_new_order', \true); // SaaS Operation: Attempt sync, but don't roll back WP if it fails. $payload = $this->prepareData($order); $orderResponse = (new OrderApi())->create($payload); if ($orderResponse->getStatusCode() === Response::HTTP_OK) { $customers = $this->customerPayload($order); (new UserApi())->create($customers); } else { \error_log("Order Sync Failed for ID {$order_id}: " . $orderResponse->getBody()); } return \true; } catch (Exception $e) { \error_log("OrderCreateHandler Exception: " . $e->getMessage()); return \false; } } public function prepareData($order) { $order_id = $order->get_id(); global $wpdb; $query = $wpdb->prepare("SELECT date_paid, date_completed FROM {$wpdb->prefix}wc_order_stats WHERE order_id = %d", $order_id); $wpWcOrderStats = $wpdb->get_row($query); $paid_at = $wpWcOrderStats && $wpWcOrderStats->date_paid ? \wp_date('Y-m-d H:i:s', \strtotime($wpWcOrderStats->date_paid)) : null; $date_created = $order->get_date_created(); $created_at = $date_created ? \wp_date('Y-m-d H:i:s', $date_created->getTimestamp()) : \wp_date('Y-m-d H:i:s'); $date_modified = $order->get_date_modified(); $updated_at = $date_modified ? \wp_date('Y-m-d H:i:s', $date_modified->getTimestamp()) : \wp_date('Y-m-d H:i:s'); return ['order' => ["wp_id" => (int) $order->get_id(), "customer_wp_unique_id" => Client::getUid() . '-' . (int) $order->get_customer_id(), "subtotal" => (double) $order->get_subtotal(), "tax" => (double) $order->get_total_tax(), "total" => (double) $order->get_total(), "status" => Helper::orderStatus($order->get_status()), "delivered_at" => null, "review_request_email_sent_at" => null, "review_reminder_email_sent_at" => null, "photo_review_email_sent_at" => null, "paid_at" => $paid_at, "created_at" => $created_at, "updated_at" => $updated_at], 'order_items' => $this->orderItems($order, $wpWcOrderStats)]; } public function orderItems($order, $wpWcOrderStats = null) { global $wpdb; $items_data = []; $order_items = $order->get_items(); if (!$wpWcOrderStats) { $order_id = $order->get_id(); $query = $wpdb->prepare("SELECT date_paid, date_completed FROM {$wpdb->prefix}wc_order_stats WHERE order_id = %d", $order_id); $wpWcOrderStats = $wpdb->get_row($query); } $fulfillment_status = Helper::orderItemStatus($order->get_status()) ?? null; $fulfilled_at = $wpWcOrderStats && $wpWcOrderStats->date_completed ? \wp_date('Y-m-d H:i:s', \strtotime($wpWcOrderStats->date_completed)) : null; foreach ($order_items as $order_item) { $product = $order_item->get_product(); $item_data = ["wp_id" => (int) $order_item->get_id(), "wp_unique_id" => Client::getUid() . '-' . (int) $order_item->get_id(), "product_wp_unique_id" => Client::getUid() . '-' . (int) $product->get_id(), "review_id" => null, "site_id" => Client::getSiteId(), "name" => $product->get_name(), "quantity" => $order_item->get_quantity(), "price" => (double) $product->get_price(), "reviewed_at" => null, "fulfillment_status" => $fulfillment_status, "fulfilled_at" => $fulfilled_at]; $items_data[] = $item_data; } return $items_data; } public function customerPayload($order) { $customer_id = $order->get_customer_id(); // if ($customer_id === 0) { // return []; // } return ['wp_id' => $customer_id, 'name' => $order->get_billing_first_name() . ' ' . $order->get_billing_last_name(), 'email' => $order->get_billing_email(), 'city' => $order->get_billing_city() ?? '', 'phone' => $order->get_billing_phone() ?? '', 'address' => $order->get_billing_address_1() ?? '', 'country' => $order->get_billing_country() ?? '', 'status' => 1]; } } ProductCategory/CategoryProductDeleteHandler.php 0000777 00000001145 15251327637 0016155 0 ustar 00 <?php namespace Rvx\ProductCategory\Handlers; use Rvx\Api\CategoryApi; use Rvx\Utilities\Auth\Client; use Rvx\WPDrill\Response; class CategoryProductDeleteHandler { public function __invoke($term_id) { $term = \get_term($term_id); $category_id = $term_id; $child_id = $term->parent; $uid = Client::getUid() . '-' . $term->term_id; $response = (new CategoryApi())->remove($uid); if ($response->getStatusCode() !== Response::HTTP_OK) { \error_log("Category Not Update" . $response->getStatusCode()); return \false; } } } PluginActivatedHandler.php 0000777 00000005754 15251327637 0011673 0 ustar 00 <?php namespace Rvx\Handlers; use Rvx\Api\AuthApi; use Rvx\CPT\CptHelper; use Rvx\Services\Api\LoginService; use Rvx\Services\DataSyncService; use Rvx\WPDrill\Contracts\InvokableContract; use Rvx\WPDrill\DB\Migration\Migrator; use Rvx\Services\CacheServices; use Exception; class PluginActivatedHandler implements InvokableContract { private Migrator $migrator; private DataSyncService $dataSyncService; private CacheServices $cacheServices; private LoginService $loginService; public function __construct(Migrator $migrator) { $this->migrator = $migrator; $this->dataSyncService = new DataSyncService(); $this->cacheServices = new CacheServices(); $this->loginService = new LoginService(); } public function __invoke() { add_action('activated_plugin', function ($plugin) { if (RVX_DIR_NAME . '/reviewx.php' !== $plugin) { return; } global $wpdb; // Initialize tables and reset sync flag (new \Rvx\Handlers\RvxInit\LoadReviewxCreateSiteTable())->init(); \set_transient('rvx_reset_sync_flag', \true, 300); // 5 mins TTL $this->migrator->run(); $rvxSites = $wpdb->prefix . 'rvx_sites'; $uid = $wpdb->get_var("SELECT uid FROM {$rvxSites} ORDER BY id DESC LIMIT 1"); if ($uid) { // Mark as not synced initially $wpdb->update($rvxSites, ['is_saas_sync' => 0], ['uid' => $uid], ['%d'], ['%s']); try { // Attempt SaaS activation (new AuthApi())->changePluginStatus(['site_uid' => $uid, 'status' => 1, 'plugin_version' => \defined('RVX_VERSION') ? RVX_VERSION : 'unknown', 'wp_version' => get_bloginfo('version')]); // Start initial sync $dataResponse = $this->dataSyncService->dataSync('login', 'product'); if ($dataResponse) { \sleep(1); $enabled_post_types = (new CptHelper())->usedCPTOnSync('used'); unset($enabled_post_types['product']); foreach ($enabled_post_types as $post_type) { $this->dataSyncService->dataSync('login', $post_type); } } } catch (Exception $e) { // Clean up if AuthApi fails $wpdb->query("TRUNCATE TABLE {$rvxSites}"); if (\defined('WP_DEBUG') || WP_DEBUG) { \error_log('[ReviewX] Activation warning: AuthApi connection failed - ' . $e->getMessage()); } } } // Always clean cache and redirect, even if UID or API failed $this->cacheServices->removeCache(); $this->loginService->resetPostMeta(); wp_safe_redirect(admin_url('admin.php?page=reviewx')); exit; }, 15, 1); } } Product/ProductImportHandler.php 0000777 00000010173 15251327637 0013032 0 ustar 00 <?php namespace Rvx\Handlers\Product; use Rvx\Api\ProductApi; use Rvx\WPDrill\Response; class ProductImportHandler { public function __invoke($product, $data) { $payload = $this->prepareData($product); $response = (new ProductApi())->create($payload); if ($response->getStatusCode() !== Response::HTTP_OK) { \error_log("Imported product not import" . $response->getStatusCode()); return \false; } } public function prepareData($product) { $product_id = $product->get_id(); $images = wp_get_attachment_image_src($product_id, 'full'); return [ "wp_id" => $product->get_id(), "title" => $product->get_name(), "url" => get_permalink($product->get_id()), "description" => $product->get_short_description(), "price" => isset($_POST['_regular_price']) ? (float) sanitize_text_field($_POST['_regular_price']) : (float) $product->get_regular_price(), "discounted_price" => (float) sanitize_text_field($product->get_sale_price()) ?? 0, "slug" => $product->get_slug(), "image" => $images ? $images[0] : '', "status" => $this->productStatus($product->get_status()), "post_type" => 'product', // Hardcoded due to import issue "total_reviews" => (int) $product->get_review_count(), "avg_rating" => (float) $product->get_average_rating(), "stars" => ["one" => 0, "two" => 0, "three" => 0, "four" => 0, "five" => 0], "one_stars" => 0, "two_stars" => 0, "three_stars" => 0, "four_stars" => 0, "five_stars" => 0, "category_wp_unique_ids" => $this->productCategory($product), ]; } public function productStatus($status) { switch ($status) { case 'publish': return 1; case 'trash': return 2; default: return 3; } } public function productCategory($product) { $product_categories = $product->get_category_ids(); $parent_category_ids = array(); foreach ($product_categories as $category_id) { $category = \get_term($category_id, 'product_cat'); if ($category && $category->parent == 0) { $parent_category_ids[] = \Rvx\Utilities\Auth\Client::getUid() . '-' . $category_id; } } if (empty($parent_category_ids)) { $parent_category_ids[] = \Rvx\Utilities\Auth\Client::getUid() . '-' . '1'; return $parent_category_ids; } return $parent_category_ids; } public function customPost($post) { $image_url = get_the_post_thumbnail_url($post->ID, 'full'); $data = ["wp_id" => $post->ID, "title" => $post->post_title, "url" => get_permalink($post->ID), "description" => $post->post_excerpt, "price" => 0, "discounted_price" => 0, "slug" => $post->post_name, "image" => '', "status" => $this->productStatus($post->post_status), "post_type" => get_post_type($post->ID), "total_reviews" => (int) get_comments_number($post->ID) ?? 0, "avg_rating" => 0.0, "stars" => ["one" => 0, "two" => 0, "three" => 0, "four" => 0, "five" => 0], "one_stars" => 0, "two_stars" => 0, "three_stars" => 0, "four_stars" => 0, "five_stars" => 0, "category_wp_unique_ids" => [\Rvx\Utilities\Auth\Client::getUid() . '-' . 0]]; return $data; } public function getPostCategoryIds($post_ids) { if (empty($post_ids)) { \error_log("No valid post ID provided."); return []; } if (empty($category_ids)) { \error_log("No categories found for post ID: " . $post_ids); return []; } $parent_category_ids = []; foreach ($category_ids as $category_id) { $parent_category_ids[] = \Rvx\Utilities\Auth\Client::getUid() . '-' . $category_id; } if ($parent_category_ids) { return $parent_category_ids; } return $parent_category_ids[] = \Rvx\Utilities\Auth\Client::getUid() . '-' . 0; } } Product/ProductUntrashHandler.php 0000777 00000001706 15251327637 0013206 0 ustar 00 <?php namespace Rvx\Handlers\Product; use Rvx\Api\ProductApi; use Rvx\CPT\CptHelper; use Rvx\Utilities\Auth\Client; use Rvx\WPDrill\Response; class ProductUntrashHandler { protected $cptHelper; public function __construct() { $this->cptHelper = new CptHelper(); } public function __invoke($product_id) { // Define the target post types $enabled_post_types = $this->cptHelper->usedCPT('used'); $post = get_post($product_id); $post_type = $post->post_type; $post_id = $post->ID; if (!isset($enabled_post_types[$post_type])) { return; } $uniqueId = Client::getUid() . '-' . $post_id; $response = (new ProductApi())->trashToRestoreWpProduct($uniqueId); if ($response->getStatusCode() !== Response::HTTP_OK) { \error_log($post_type . " restore fails! --> " . $response->getStatusCode()); return \false; } } } DiscountHandler.php 0000777 00000000541 15251327637 0010365 0 ustar 00 <?php namespace Rvx\Handlers; use Rvx\WPDrill\Contracts\InvokableContract; use Rvx\WPDrill\Facades\View; class DiscountHandler implements InvokableContract { public function __invoke() { View::output('storeadmin/discount', ['title' => 'Welcome to WPDrill', 'content' => 'A WordPress Plugin development framework for humans']); } } PluginDeactivatedHandler.php 0000777 00000003002 15251327637 0012164 0 ustar 00 <?php namespace Rvx\Handlers; use Rvx\Api\AuthApi; use Rvx\WPDrill\Contracts\InvokableContract; use Exception; class PluginDeactivatedHandler implements InvokableContract { public function __invoke() : void { global $wpdb; $rvxSites = $wpdb->prefix . 'rvx_sites'; $uid = $wpdb->get_var("SELECT uid FROM {$rvxSites} ORDER BY id DESC LIMIT 1"); if ($uid) { // Change rvx_sites table is_saas_sync to 0 $wpdb->update($rvxSites, ['is_saas_sync' => 0], ['uid' => $uid], ['%d'], ['%s']); // Mark sync flag locally \set_transient('rvx_reset_sync_flag', \true); try { // Attempt API call — skip gracefully on failure (new AuthApi())->changePluginStatus(['site_uid' => $uid, 'status' => 0, 'plugin_version' => \defined('RVX_VERSION') ? RVX_VERSION : 'unknown', 'wp_version' => get_bloginfo('version')]); } catch (Exception $e) { // Log quietly instead of breaking plugin disable process if (\defined('WP_DEBUG') || WP_DEBUG) { \error_log('[ReviewX] PluginDeactivatedHandler: API call failed - ' . $e->getMessage()); } // continue silently } } // Always clean up local data, regardless of API status (new \Rvx\Services\CacheServices())->removeCache(); (new \Rvx\Services\Api\LoginService())->resetPostMeta(); // Continue plugin deactivation return; } } VerifiedUserHandler.php 0000777 00000000457 15251327637 0011177 0 ustar 00 <?php namespace Rvx\Handlers; class VerifiedUserHandler { public function __construct() { } public function __invoke($order_id) { $order = wc_get_order($order_id); $user_id = $order->get_user_id(); \update_user_meta($user_id, 'is_verified', 'yes'); } } PluginLoadedHandler.php 0000777 00000000412 15251327637 0011141 0 ustar 00 <?php namespace Rvx\Handlers; use Rvx\WPDrill\Contracts\InvokableContract; class PluginLoadedHandler implements InvokableContract { public function __invoke() { //file_put_contents(REVIEWX_DIR_PATH . 'plugin.txt', 'Plugin Deactivated 1!'); } } GeneralSettingHandler.php 0000777 00000000547 15251327637 0011516 0 ustar 00 <?php namespace Rvx\Handlers; use Rvx\WPDrill\Contracts\InvokableContract; use Rvx\WPDrill\Facades\View; class GeneralSettingHandler implements InvokableContract { public function __invoke() { View::output('storeadmin/settings', ['title' => 'Welcome to WPDrill', 'content' => 'A WordPress Plugin development framework for humans']); } } ImportProductHandler.php 0000777 00000007003 15251327637 0011410 0 ustar 00 <?php namespace Rvx\Handlers; class ImportProductHandler { public function __invoke($new_status, $old_status, $product) { if ($new_status == 'publish' && $old_status != 'publish') { $product = get_post($product->ID); if ($product->post_type === 'product') { switch ($new_status) { case 'publish': $currentProduct = wc_get_product($product->ID); $payload = $this->prepareImportedData($currentProduct); $this->appendToJsonl($payload, 'imported_product.jsonl'); (new \Rvx\Handlers\ImportProductHandler())->productJsonlFileRead(); break; } } } } public function appendToJsonl($payload, $file_name = 'imported_product.jsonl') { $file_path = RVX_DIR_PATH . $file_name; $json_data = \json_encode($payload) . \PHP_EOL; $file_handle = \fopen($file_path, 'a'); if ($file_handle) { \fwrite($file_handle, $json_data); \fclose($file_handle); } } public function prepareImportedData($product) { $data = ['rid' => 'rid://Product/' . $product->ID, 'wp_id' => $product->get_id(), 'title' => $product->get_name(), 'url' => get_permalink($product->get_id()), 'description' => $product->get_short_description(), 'slug' => $product->get_slug(), 'image' => wp_get_attachment_url($product->get_image_id()), 'status' => $this->productStatus($product->get_status()), 'post_type' => 'product', 'total_reviews' => 0, 'price' => $product->get_price() ?? 0, 'avg_rating' => 0.0, "stars" => ["one" => 0, "two" => 0, "three" => 0, "four" => 0, "five" => 0], "one_stars" => 0, "two_stars" => 0, "three_stars" => 0, "four_stars" => 0, "five_stars" => 0, "category_wp_unique_ids" => $this->getProductCategories($product)]; return $data; } public function productPrepareForSync($product) { return \array_merge((array) $product, ["category_wp_unique_ids" => $this->getProductCategories($product->wp_id)]); } public function getProductCategories($product_id) { $terms = wp_get_post_terms($product_id, 'product_cat'); $categories = []; if (!empty($terms) && !\is_wp_error($terms)) { foreach ($terms as $term) { $categories[] = \Rvx\Utilities\Auth\Client::getUid() . '-' . $term->term_id; } } return $categories; } public function productStatus($status) { switch ($status) { case 'publish': return 1; case 'trash': return 2; default: return 3; } } public function productJsonlFileRead() { $url = RVX_DIR_PATH . 'imported_product.jsonl'; $payload = []; if (!\file_exists($url)) { return; } $fp = @\fopen($url, "r"); if ($fp) { while (($buffer = \fgets($fp)) !== \false) { $result = \json_decode($buffer); $payload = $this->productPrepareForSync($result); $this->appendToJsonl($payload, 'product_sync.jsonl'); \error_log("Json" . \print_r($result, \true)); // if (!isset($result['rid'])) { // return; // } } if (!\feof($fp)) { echo "Error: unexpected fgets() fail\n"; } \fclose($fp); } } } TaxonomyHandler.php 0000777 00000013306 15251327637 0010416 0 ustar 00 <?php namespace Rvx\Handlers; use Exception; use Rvx\Api\CategoryApi; use Rvx\Utilities\Auth\Client; use Rvx\WPDrill\Response; class TaxonomyHandler { public function getPostTypesByTermId(int $term_id) : array { $term = \get_term($term_id); if (!$term || \is_wp_error($term)) { return []; } // Get the taxonomy of the term $taxonomy = $term->taxonomy; // Get all post types associated with this taxonomy $taxonomy_object = \get_taxonomy($taxonomy); if (!$taxonomy_object || \is_wp_error($taxonomy_object)) { return []; } return (array) $taxonomy_object->object_type; } public function getPostTypesByTaxonomy(string $taxonomy) : array { if (!$taxonomy || \is_wp_error($taxonomy)) { return []; } // Get all post types associated with this taxonomy $taxonomy_object = \get_taxonomy($taxonomy); if (!$taxonomy_object || \is_wp_error($taxonomy_object)) { return []; } return (array) $taxonomy_object->object_type; } public function getTerm(int $term_id, string $taxonomy = '') { $term = \get_term($term_id, $taxonomy); return !$term || \is_wp_error($term) ? null : $term; } public function getTaxonomyByTermIdFromDB($term_id, $wpdb) { // Ensure $term_id is a valid integer if (!\is_int($term_id)) { return \false; } // Query to fetch the taxonomy names for the given term ID $query = "\n SELECT tt.taxonomy\n FROM {$wpdb->prefix}term_taxonomy tt\n WHERE tt.term_id = %d\n "; // Prepare the query and execute $results = $wpdb->get_results($wpdb->prepare($query, $term_id)); if (empty($results)) { return \false; // No taxonomies found for this term ID } // Array to store taxonomy information $taxonomy_array = []; // Loop through results and fetch taxonomy labels and other info foreach ($results as $row) { $taxonomy_data = \get_taxonomy($row->taxonomy); // Use WordPress function to get taxonomy details if ($taxonomy_data) { $taxonomy_array[] = ['taxonomy' => $row->taxonomy, 'label' => $taxonomy_data->labels->name, 'hierarchical' => $taxonomy_data->hierarchical]; } } return $taxonomy_array; } public function getAllDescendants(int $parent_id, string $taxonomy) : array { $descendants = []; $this->collectDescendants($parent_id, $taxonomy, $descendants); return $descendants; } protected function collectDescendants(int $parent_id, string $taxonomy, array &$descendants, int $current_level = 1) : void { $children = get_terms(['taxonomy' => $taxonomy, 'parent' => $parent_id, 'hide_empty' => \false, 'fields' => 'all']); if (\is_wp_error($children) || empty($children)) { return; } foreach ($children as $child) { $descendants[] = ['term' => $child, 'level' => $current_level]; $this->collectDescendants($child->term_id, $taxonomy, $descendants, $current_level + 1); } } public function hasChildren(int $term_id, string $taxonomy) : bool { $children = get_terms(['taxonomy' => $taxonomy, 'parent' => $term_id, 'hide_empty' => \false, 'fields' => 'ids', 'number' => 1]); return !\is_wp_error($children) && !empty($children); } public function isParentTerm(int $term_id, string $taxonomy = '') : bool { $term = $this->getTerm($term_id, $taxonomy); return $term ? $term->parent === 0 : \false; } public function getChildTerms(int $parent_id, string $taxonomy) : array { $children = get_terms(['taxonomy' => $taxonomy, 'parent' => $parent_id, 'hide_empty' => \false, 'fields' => 'all']); if (\is_wp_error($children)) { return []; } $child_terms = []; foreach ($children as $child) { $child_terms[] = ['term' => $child, 'children' => $this->getChildTerms($child->term_id, $taxonomy)]; } return $child_terms; } public function termParentChanged(int $term_id, string $taxonomy) : bool { // Requires implementation of previous state tracking // Example using transients: $previous_parent = \get_transient("term_{$term_id}_previous_parent"); $current_term = $this->getTerm($term_id, $taxonomy); return $previous_parent !== \false && $current_term && $previous_parent != $current_term->parent; } public function hadChildrenBeforeUpdate(int $term_id, string $taxonomy) : bool { $transient_key = "term_{$term_id}_had_children"; $had_children = \get_transient($transient_key); \delete_transient($transient_key); return $had_children === 'yes'; } public function syncTermUpdate($term) { try { $payload = ['wp_id' => $term->term_id, 'title' => $term->name, 'slug' => $term->slug, 'taxonomy' => $term->taxonomy, 'description' => $term->description, 'parent_wp_unique_id' => $term->parent > 0 ? Client::getUid() . '-' . $term->parent : null, 'updated_at' => current_time('mysql')]; $uid = Client::getUid() . '-' . $term->term_id; $response = (new CategoryApi())->update($payload, $uid); if ($response->getStatusCode() !== Response::HTTP_OK) { throw new Exception("API status: " . $response->getStatusCode()); } } catch (Exception $e) { \error_log("Update failed for term {$term->term_id}: " . $e->getMessage()); return \false; } } } OrderDeleteHandler.php 0000777 00000001137 15251327637 0010775 0 ustar 00 <?php namespace Rvx\Handlers; use Rvx\Api\OrderApi; use Rvx\Utilities\Auth\Client; use Rvx\WPDrill\Response; class OrderDeleteHandler { public function __construct() { } public function __invoke($order_id) { $order = wc_get_order($order_id); if (!$order) { return; } $uid = Client::getUid() . '-' . $order_id; $response = (new OrderApi())->delete($uid); if ($response->getStatusCode() !== Response::HTTP_OK) { \error_log('Delete insert' . $response->getStatusCode()); return \false; } } } MigrationRollback/RollbackPrompt.php 0000777 00000017673 15251327637 0013653 0 ustar 00 <?php namespace Rvx\Handlers\MigrationRollback; use Rvx\Services\SettingService; class RollbackPrompt { // Constructor public function __construct() { } // Entry point for the rollback process public function rvx_retrieve_sass_plugin_reviews_meta_updater() { echo '<h3>Rollback started.</h3>'; // Rollback options data $this->rvx_retrieve_saas_plugin_options_data(); echo 'Options data rollback completed.<br>'; // Rollback multi-criteria reviews $reviews_data = $this->rvx_retrieve_saas_plugin_criterias_reviews_converter(); echo 'Multi-criteria data rollback completed.<br>'; // Rollback attachments for reviews $this->rvx_retrieve_saas_plugin_reviews_attachments_data_converter($reviews_data); echo 'Reviews attachments data rollback completed.<br>'; echo '<h3>Rollback done.</h3><br>'; } // Handles the rollback of plugin options data public function rvx_retrieve_saas_plugin_options_data() { $settings_data = (array) (new SettingService())->getSettingsData()['setting'] ?? []; // If settings data is an array, extract and update widget/review settings if (\is_array($settings_data)) { $widget_settings = $settings_data['widget_settings'] ?? []; $review_settings = $settings_data['review_settings']['reviews'] ?? []; $this->update_widget_settings($widget_settings); $this->update_review_settings($review_settings); } $sharedMethods = new \Rvx\Handlers\MigrationRollback\SharedMethods(); // Convert multi-criteria data if available if (isset($existing_data['reviews']['multicriteria'])) { $oldCriteriaData = $sharedMethods->rvxRollbackReverseReviewCriteriaConverter($existing_data['reviews']['multicriteria']); if ($sharedMethods->key_exists('_rx_option_review_criteria')) { \update_option('_rx_option_allow_multi_criteria', $oldCriteriaData['_rx_option_allow_multi_criteria']); \update_option('_rx_option_review_criteria', $oldCriteriaData['_rx_option_review_criteria']); } return $oldCriteriaData; } return \true; } // Updates widget-related settings private function update_widget_settings($widget_settings) { if (isset($widget_settings['brand_color_code'])) { \update_option('_rx_option_color_theme', $widget_settings['brand_color_code']); } if (isset($widget_settings['star_color_code'])) { \update_option('_rx_option_star_color', $widget_settings['star_color_code']); } if (isset($widget_settings['button_font_color_code'])) { \update_option('_rx_option_button_font_color', $widget_settings['button_font_color_code']); } } // Updates review-related settings private function update_review_settings($review_settings) { $map = ['enable_likes_dislikes' => '_rx_option_allow_like_dislike', 'photo_reviews_allowed' => '_rx_option_allow_img', 'video_reviews_allowed' => '_rx_option_allow_video', 'anonymous_reviews_allowed' => '_rx_option_allow_anonymouse', 'allow_multiple_reviews' => '_rx_option_allow_multiple_review']; // Update each mapped setting foreach ($map as $key => $option) { if (isset($review_settings[$key])) { \update_option($option, $review_settings[$key]); } } // Handle boolean values for auto-approve and schema settings if (isset($review_settings['auto_approve_reviews'])) { \update_option('_rx_option_disable_auto_approval', !$review_settings['auto_approve_reviews']); } if (isset($review_settings['product_schema'])) { \update_option('_rx_option_disable_richschema', !$review_settings['product_schema']); } } // Handles rollback for multi-criteria reviews public function rvx_retrieve_saas_plugin_criterias_reviews_converter() { $reviews_with_meta = $this->rvx_retrieve_saas_plugin_reviews_data(); if (empty($reviews_with_meta)) { return []; } $existingOldData = \get_option('_rx_option_review_criteria'); $oldCriteria = \is_string($existingOldData) ? maybe_unserialize($existingOldData) : []; if (empty($oldCriteria)) { return []; } // Process and convert each review's criteria foreach ($reviews_with_meta as $comment_id => $review_data) { $criterias = $review_data['meta_data']['rvx_criterias'] ?? null; if (\is_array($criterias)) { $converted_criterias = $this->rvx_convert_criterias_to_serialized_format($criterias, $oldCriteria); \update_comment_meta($comment_id, 'rvx_criterias', $converted_criterias); } } return $reviews_with_meta; } // Retrieves reviews with their metadata public function rvx_retrieve_saas_plugin_reviews_data() { global $wpdb; $meta_key = 'rvx_review_version'; $meta_value = 'v2'; $query = $wpdb->prepare("SELECT comment_id FROM {$wpdb->commentmeta} WHERE meta_key = %s AND meta_value = %s", $meta_key, $meta_value); $comment_ids = $wpdb->get_col($query); if (empty($comment_ids)) { return []; } $placeholders = \implode(',', \array_fill(0, \count($comment_ids), '%d')); $query = $wpdb->prepare("SELECT * FROM {$wpdb->comments} WHERE comment_ID IN ({$placeholders})", $comment_ids); $reviews_data = $wpdb->get_results($query, ARRAY_A); $query = $wpdb->prepare("SELECT comment_id, meta_key, meta_value FROM {$wpdb->commentmeta} WHERE comment_id IN ({$placeholders})", $comment_ids); $meta_data = $wpdb->get_results($query, ARRAY_A); $reviews_with_meta = []; foreach ($reviews_data as $review) { $comment_id = $review['comment_ID']; $reviews_with_meta[$comment_id] = ['review_data' => $review, 'meta_data' => []]; } foreach ($meta_data as $meta) { $comment_id = $meta['comment_id']; if (isset($reviews_with_meta[$comment_id])) { $reviews_with_meta[$comment_id]['meta_data'][$meta['meta_key']] = maybe_unserialize($meta['meta_value']); } } return $reviews_with_meta; } // Converts criteria data into serialized format private function rvx_convert_criterias_to_serialized_format($criterias, $oldCriteria) { $key_base = 'ctr_h8S'; $serialized_array = []; $index = 7; foreach ($criterias as $key => $value) { $serialized_key = $key_base . $index++; $serialized_array[$serialized_key] = (string) $value; } return maybe_serialize($serialized_array); } // Converts review attachments to match the required rollback format public function rvx_retrieve_saas_plugin_reviews_attachments_data_converter($reviews_data) { if (!\is_array($reviews_data)) { return; } foreach ($reviews_data as $review_data) { $comment_id = $review_data['review_data']['comment_ID'] ?? null; $attachments = $review_data['meta_data']['reviewx_attachments'] ?? null; if (\is_array($attachments)) { $attachment_data = []; foreach ($attachments as $attachment_url) { if (\is_string($attachment_url)) { $attachment_id = attachment_url_to_postid($attachment_url); if ($attachment_id) { $attachment_data[] = $attachment_id; } } } if (!empty($attachment_data)) { $attachment_data_collection = ['images' => $attachment_data]; \update_comment_meta($comment_id, 'reviewx_attachments', $attachment_data_collection); } } } } } MigrationRollback/RollbackMenuHandler.php 0000777 00000005173 15251327640 0014556 0 ustar 00 <?php namespace Rvx\Handlers\MigrationRollback; use Rvx\WPDrill\Contracts\InvokableContract; use Rvx\WPDrill\Facades\View; class RollbackMenuHandler implements InvokableContract { public function __invoke() { $sharedMethods = new \Rvx\Handlers\MigrationRollback\SharedMethods(); $rollbackPrompt = new \Rvx\Handlers\MigrationRollback\RollbackPrompt(); echo '<div class="wrap p-6 bg-gray-100 rounded-lg shadow-md">'; View::output('storeadmin/rollback', ['title' => 'Rollback to ReviewX v1', 'content' => 'Revert to the previous version with ease and restore functionality seamlessly.', 'page_url' => $_SERVER['REQUEST_URI']]); if (isset($_GET['rollback_start'])) { $is_pro_active = $sharedMethods->rvx_is_old_pro_plugin_active(); if ($is_pro_active === \false) { //$sharedMethods->rvx_activate_old_pro_plugin(); // Activate v1 Pro } $rollbackPrompt->rvx_retrieve_sass_plugin_reviews_meta_updater(); // Start data rollback echo <<<HTML <div class="p-4 bg-white rounded-lg shadow-md"> <h2 class="text-lg font-bold text-gray-800 mb-2">Your data has been successfully rolled back to the previous version.</h2> <p class="text-gray-600">Thank you for your patience!</p> <h3 class="text-md font-semibold text-gray-800 mt-4">Next Steps:</h3> <ul class="list-disc list-inside text-gray-600"> <li><strong>Must do:</strong> Please make sure to <b>delete ReviewX v2</b> and and <b>reinstall ReviewX v1</b> plugin.</li> <li><strong>Pro user:</strong> If you used the Pro version, please it activate it to access the premium features.</li> <li><strong>Download:</strong> ReviewX v1 plugin is available here, <a target="_blank" href="https://downloads.wordpress.org/plugin/reviewx.1.6.30.zip" class="text-blue-600 hover:underline">Download v1</a>.</li> </ul> <h3 class="text-md font-semibold text-gray-800 mt-4">Need Assistance?</h3> <p class="text-gray-600"> Our support team is here to help. <a target="_blank" href="https://reviewx.io/support/" class="text-blue-600 hover:underline">Contact Support</a> or email us at <a href="mailto:support@reviewx.io" class="text-blue-600 hover:underline">support@reviewx.io</a>. </p> </div> HTML; } // Remove the query parameter without reloading echo <<<JS <script> document.addEventListener("DOMContentLoaded", function() { const url = new URL(window.location.href); url.searchParams.delete("rollback_start"); history.replaceState(null, "", url); }); </script> JS; echo '</div>'; } } MigrationRollback/SharedMethods.php 0000777 00000013601 15251327640 0013427 0 ustar 00 <?php namespace Rvx\Handlers\MigrationRollback; class SharedMethods { public function rvx_is_old_pro_plugin_active() { // Check for the older ReviewX Pro versions $pro_version = \defined('REVIEWX_PRO_VERSION') ? REVIEWX_PRO_VERSION : null; if ($pro_version !== null) { return \true; } else { return \false; } } public function rvx_activate_old_pro_plugin() { // Ensure WordPress functions are available if (!\function_exists('Rvx\\get_plugins') || !\function_exists('Rvx\\activate_plugin')) { return; // Exit if WordPress is not fully loaded } // Retrieve all installed plugins $plugins = get_plugins(); $found_plugin = ''; // Search for the ReviewX Pro plugin foreach ($plugins as $plugin_path => $plugin_data) { if (\strpos($plugin_path, 'reviewx-pro') !== \false && \defined('WP_PLUGIN_DIR') && \file_exists(WP_PLUGIN_DIR . '/' . $plugin_path)) { $plugin_file = WP_PLUGIN_DIR . '/' . $plugin_path; // Check if the file contains a unique identifier $plugin_content = \file_get_contents($plugin_file); if (\strpos($plugin_content, 'REVIEWX_PRO_VERSION') !== \false) { $found_plugin = $plugin_path; break; } } } // Activate the plugin if it is found and not already active if ($found_plugin && !is_plugin_active($found_plugin)) { $result = activate_plugin($found_plugin); if (\is_wp_error($result)) { // Optionally, handle errors if activation fails } else { // Optionally, display an admin notice for successful activation } } else { // Optionally, display a notice if the plugin is not found } } public function rvx_deactivate_old_pro_plugin() { if (!\function_exists('Rvx\\get_plugins') || !\function_exists('Rvx\\deactivate_plugins')) { return; // Exit if WordPress is not fully loaded } // Retrieve all installed plugins $plugins = get_plugins(); $found_plugin = ''; // Search for the ReviewX Pro plugin foreach ($plugins as $plugin_path => $plugin_data) { if (\strpos($plugin_path, 'reviewx-pro') !== \false && \defined('WP_PLUGIN_DIR') && \file_exists(WP_PLUGIN_DIR . '/' . $plugin_path)) { $plugin_file = WP_PLUGIN_DIR . '/' . $plugin_path; $plugin_content = \file_get_contents($plugin_file); if (\strpos($plugin_content, 'REVIEWX_PRO_VERSION') !== \false) { $found_plugin = $plugin_path; break; } } } // Deactivate the plugin if it is found and not already deactive if ($found_plugin && is_plugin_active($found_plugin)) { $result = deactivate_plugins($found_plugin); if (\is_wp_error($result)) { // Optionally, handle errors if deactivation fails } else { // Optionally, display an admin notice for successful deactivation } } else { // Optionally, display a notice if the plugin is not found } } public function rvxOldReviewCriteriaConverter() { $data = \get_option('_rx_option_review_criteria'); $keys = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"]; $criterias = []; $i = 0; foreach ($data as $key => $name) { if (isset($keys[$i])) { $criterias[] = ["key" => $keys[$i], "name" => $name]; } $i++; } $multicrtriaEnableorDisable = \get_option('_rx_option_allow_multi_criteria'); $newCriteria = ["enable" => $multicrtriaEnableorDisable == 1 ? \true : \false, "criterias" => $criterias]; return $newCriteria; } public function rvxRollbackReverseReviewCriteriaConverter($newCriteria) { // Initialize old criteria structure $oldCriteria = []; // Retrieve existing criteria from the database $existingOldData = \get_option('_rx_option_review_criteria'); if ($existingOldData) { $oldCriteria = maybe_unserialize($existingOldData); // Deserialize existing criteria } // Find the highest number in old criteria keys (ctr_h8S7, ctr_h8S8, etc.) $highestNumber = 0; foreach ($oldCriteria as $key => $value) { if (\preg_match('/ctr_h8S(\\d+)/', $key, $matches)) { $highestNumber = \max($highestNumber, (int) $matches[1]); // Track the highest number } } // Merge old and new criteria $seenValues = \array_flip($oldCriteria); // Store old criteria values for fast lookup $mergedCriteria = $oldCriteria; // Start with old criteria // Assign new keys for unique new criteria foreach ($newCriteria['criterias'] as $criteria) { if (isset($criteria['name']) && !isset($seenValues[$criteria['name']])) { $highestNumber++; // Increment key number $newKey = 'ctr_h8S' . $highestNumber; $mergedCriteria[$newKey] = $criteria['name']; $seenValues[$criteria['name']] = \true; // Mark as seen } } // Build updated data structure $updatedData = [ '_rx_option_allow_multi_criteria' => $newCriteria['enable'] ? 1 : 0, // Boolean as integer '_rx_option_review_criteria' => $mergedCriteria, ]; return $updatedData; } public function key_exists($option_name) { $option_value = \get_option($option_name); return $option_value !== \false; } } MigrationRollback/ReviewXChecker.php 0000777 00000002720 15251327640 0013553 0 ustar 00 <?php namespace Rvx\Handlers\MigrationRollback; class ReviewXChecker { /** * Check if ReviewX v1 (free) plugin database data exists. * * @return bool */ public static function isReviewXExists() : bool { global $wpdb; // Define option name for ReviewX free version $option_name = '_rx_option_review_criteria'; // Check if the option exists in the wp_options table $option_exists = $wpdb->get_var($wpdb->prepare("SELECT option_name FROM {$wpdb->options} WHERE option_name = %s LIMIT 1", $option_name)); return !empty($option_exists); } /** * Check if ReviewX v2 SaaS plugin database data exists. * * @return bool */ public static function isReviewXSaasExists() : bool { global $wpdb; // Define option name for ReviewX SaaS version $option_name = '_rvx_settings_data'; $option_name_latest = '_rvx_settings_product'; // Check if the option exists in the wp_options table $option_exists = $wpdb->get_var($wpdb->prepare("SELECT option_name FROM {$wpdb->options} WHERE option_name = %s LIMIT 1", $option_name)); if (empty($option_exists)) { // Check if the option exists in the wp_options table $option_exists = $wpdb->get_var($wpdb->prepare("SELECT option_name FROM {$wpdb->options} WHERE option_name = %s LIMIT 1", $option_name_latest)); } return !empty($option_exists); } } MigrationRollback/MigrationPrompt.php 0000777 00000013717 15251327640 0014040 0 ustar 00 <?php namespace Rvx\Handlers\MigrationRollback; use Rvx\Services\SettingService; class MigrationPrompt { public function rvx_retrieve_old_plugin_options_data() { $data = []; $sharedMethods = new \Rvx\Handlers\MigrationRollback\SharedMethods(); // Options to retrieve if ($sharedMethods->key_exists('_rx_option_review_criteria')) { $data['multicriteria'] = $sharedMethods->rvxOldReviewCriteriaConverter(); } if ($sharedMethods->key_exists('_rx_option_allow_like_dislike')) { $data['enable_likes_dislikes']['enabled'] = \get_option('_rx_option_allow_like_dislike'); $data['enable_likes_dislikes']['options']['allow_dislikes'] = \get_option('_rx_option_allow_like_dislike'); } if ($sharedMethods->key_exists('_rx_option_color_theme')) { $data['brand_color_code'] = \get_option('_rx_option_color_theme'); } if ($sharedMethods->key_exists('_rx_option_allow_img')) { $data['photo_reviews_allowed'] = \get_option('_rx_option_allow_img'); } if ($sharedMethods->key_exists('_rx_option_allow_share_review')) { $data['allow_review_sharing'] = \get_option('_rx_option_allow_share_review'); } if ($sharedMethods->key_exists('_rx_option_disable_auto_approval')) { $data['auto_approve_reviews'] = \get_option('_rx_option_disable_auto_approval'); } if ($sharedMethods->key_exists('_rx_option_allow_review_title')) { $data['allow_review_titles'] = \get_option('_rx_option_allow_review_title'); } if ($sharedMethods->key_exists('_rx_option_allow_reviewer_name_censor')) { $data['censor_reviewer_name'] = \get_option('_rx_option_allow_reviewer_name_censor'); } if ($sharedMethods->key_exists('_rx_option_disable_richschema')) { $data['product_schema'] = \get_option('_rx_option_disable_richschema'); } if ($sharedMethods->key_exists('_rx_option_allow_video')) { $data['video_reviews_allowed'] = \get_option('_rx_option_allow_video'); } if ($sharedMethods->key_exists('_rx_option_allow_multiple_review')) { $data['allow_multiple_reviews'] = \get_option('_rx_option_allow_multiple_review'); } if ($sharedMethods->key_exists('_rx_option_allow_anonymouse')) { $data['anonymous_reviews_allowed'] = \get_option('_rx_option_allow_anonymouse'); } if ($sharedMethods->key_exists('_rx_option_allow_recaptcha')) { $data['recaptcha']['enabled'] = \get_option('_rx_option_allow_recaptcha'); } if ($sharedMethods->key_exists('_rx_option_recaptcha_site_key')) { $data['recaptcha']['site_key'] = \get_option('_rx_option_recaptcha_site_key'); } if ($sharedMethods->key_exists('_rx_option_recaptcha_secret_key')) { $data['recaptcha']['secret_key'] = \get_option('_rx_option_recaptcha_secret_key'); } if ($sharedMethods->key_exists('_rx_option_disable_richschema')) { $data['product_schema'] = \get_option('_rx_option_disable_richschema'); } if ($sharedMethods->key_exists('_rx_option_review_per_page')) { $data['per_page_reviews'] = \get_option('_rx_option_review_per_page'); } if ($sharedMethods->key_exists('_rx_option_allow_recommendation')) { $data['allow_recommendations'] = \get_option('_rx_option_allow_recommendation'); } if ($sharedMethods->key_exists('_rx_option_filter_recent')) { $data['filter_and_sort_options']['recent'] = \get_option('_rx_option_filter_recent'); } if ($sharedMethods->key_exists('_rx_option_filter_photo')) { $data['filter_and_sort_options']['photo'] = \get_option('_rx_option_filter_photo'); } if (empty($data)) { return \false; } return $data; } public function rvx_retrieve_saas_plugin_options_data() { $settings = (array) (new SettingService())->getSettingsData()['setting'] ?? []; $saasOptions = ['display_badges' => $settings['widget_settings']['display_badges'], 'outline' => $settings['widget_settings']['outline'], 'brand_color_code' => $settings['widget_settings']['brand_color_code'], 'star_color_code' => $settings['widget_settings']['star_color_code'], 'button_font_color_code' => $settings['widget_settings']['button_font_color_code'], 'filter_and_sort_options' => $settings['widget_settings']['filter_and_sort_options'], 'verified_customer_only' => $settings['review_settings']['reviews']['review_submission_policy']['options']['verified_customer'], 'review_eligibility' => $settings['review_settings']['reviews']['review_eligibility'], 'auto_approve_reviews' => $settings['review_settings']['reviews']['auto_approve_reviews'], 'show_reviewer_name' => $settings['review_settings']['reviews']['show_reviewer_name'], 'censor_reviewer_name' => $settings['review_settings']['reviews']['censor_reviewer_name'], 'show_reviewer_country' => $settings['review_settings']['reviews']['show_reviewer_country'], 'enable_likes_dislikes' => $settings['review_settings']['reviews']['enable_likes_dislikes'], 'allow_review_sharing' => $settings['review_settings']['reviews']['allow_review_sharing'], 'allow_review_titles' => $settings['review_settings']['reviews']['allow_review_titles'], 'photo_reviews_allowed' => $settings['review_settings']['reviews']['photo_reviews_allowed'], 'video_reviews_allowed' => $settings['review_settings']['reviews']['video_reviews_allowed'], 'allow_recommendations' => $settings['review_settings']['reviews']['allow_recommendations'], 'anonymous_reviews_allowed' => $settings['review_settings']['reviews']['anonymous_reviews_allowed'], 'multicriteria' => $settings['review_settings']['reviews']['multicriteria'], 'product_schema' => $settings['review_settings']['reviews']['product_schema'], 'recaptcha' => $settings['review_settings']['reviews']['recaptcha']]; return $saasOptions; } } MigrationRollback/UpgradeDBSettings.php 0000777 00000002523 15251327640 0014214 0 ustar 00 <?php namespace Rvx\Handlers\MigrationRollback; use Rvx\Rest\Controllers\DataSyncController; use Rvx\Utilities\Auth\Client; class UpgradeDBSettings { protected $dataSyncController; // Option name used as a flag to indicate the upgrade has run. public function __construct() { $this->dataSyncController = new DataSyncController(); $this->run_upgrade(); } /** * Run the upgrade routine if it hasn't already been executed. */ public function run_upgrade() { if (!Client::getSync()) { return; } if (\get_option('_rvx_db_upgrade_216', \false) === \true) { return; } // Retrieve the current settings. $product_settings = \get_option('_rvx_settings_product'); $widget_settings = \get_option('_rvx_settings_widget'); $cpt_settings = \get_option('_rvx_cpt_settings'); // If any of the required options are missing, run upgrade logic. if (\false === $product_settings || \false === $widget_settings || \false === $cpt_settings) { // Initialize default settings if they are not available. $this->dataSyncController->updateSettingsOnSync(); } // Mark the upgrade routine as completed so it doesn't run again. \update_option('_rvx_db_upgrade_216', \true); } } OrderBulkStatusChangedHandler.php 0000777 00000001122 15251327640 0013132 0 ustar 00 <?php namespace Rvx\Handlers; use Rvx\Services\OrderService; class OrderBulkStatusChangedHandler { protected $orderService; public function __construct() { $this->orderService = new OrderService(); } public function __invoke($redirect_to, $action, $order_ids) { if ($action === 'mark_complete') { $data = []; foreach ($order_ids as $order_id) { $data['order_wp_unique_ids'] = $order_id; } \error_log("Return Data" . \print_r($data, \true)); } return $redirect_to; } } WChooks/StorefrontReviewLinkClickScroll.php 0000777 00000006576 15251327640 0015156 0 ustar 00 <?php namespace Rvx\Handlers\WChooks; use Rvx\CPT\CptHelper; class StorefrontReviewLinkClickScroll { protected $cptHelper; public function __construct() { $this->cptHelper = new CptHelper(); } public function addScrollScript() { global $post; // Check if $post is available before accessing properties if (!isset($post) || !\is_object($post) && !is_admin()) { return; } // Define the target post types $enabled_post_types = $this->cptHelper->enabledCPT(); $post_type = $post->post_type ?? ''; if (!isset($enabled_post_types[$post_type])) { return; } // Check if WooCommerce is active and we are on a product page if (\function_exists('Rvx\\wc_get_product') && 'product' === $post_type) { ?> <script> document.addEventListener('DOMContentLoaded', function () { document.querySelectorAll('.woocommerce-review-link').forEach(function (link) { link.addEventListener('click', function (e) { e.preventDefault(); // Prevent default link behavior // Scroll to the reviews tab const reviewsTab = document.getElementById('tab-title-reviews'); if (reviewsTab) { reviewsTab.scrollIntoView({ behavior: 'smooth', block: 'start' }); // Smooth scroll // Open the tab if not already active if (!reviewsTab.classList.contains('active')) { const tabLink = reviewsTab.querySelector('a'); if (tabLink) { tabLink.click(); // Trigger the tab opening } } } }); }); }); </script> <?php } if ('product' !== $post_type) { ?> <script> document.addEventListener('DOMContentLoaded', function () { document.querySelectorAll('.comments-link').forEach(function (link) { link.addEventListener('click', function (e) { e.preventDefault(); // Prevent default link behavior // Scroll to the reviews tab const reviewsTab = document.getElementById('rvx-storefront-widget--aggregation__summary'); if (reviewsTab) { reviewsTab.scrollIntoView({ behavior: 'smooth', block: 'start' }); // Smooth scroll // Open the tab if not already active if (!reviewsTab.classList.contains('active')) { const tabLink = reviewsTab.querySelector('a'); if (tabLink) { tabLink.click(); // Trigger the tab opening } } } }); }); }); </script> <?php } } } StoreFrontReviewDataHandller.php 0000777 00000001156 15251327640 0013027 0 ustar 00 <?php namespace Rvx\Handlers; use Rvx\Api\WpApi; use Rvx\WPDrill\Contracts\InvokableContract; use Rvx\WPDrill\Facades\View; class StoreFrontReviewDataHandller implements InvokableContract { protected WpApi $wpApi; /** * */ public function __construct() { $this->wpApi = new WpApi(); } public function __invoke() { View::output('storefront/reviews', ['title' => 'Welcome Deshboard review', 'content' => 'A WordPress Plugin development framework for humans', 'response' => $this->wpApi->get('/reviews')]); } public function storefrontTest($data) { } } WoocommerceCommentStatusChangeHandler.php 0000777 00000003061 15251327640 0014703 0 ustar 00 <?php namespace Rvx\Handlers; use Rvx\Api\ReviewsApi; use Rvx\Utilities\Auth\Client; class WoocommerceCommentStatusChangeHandler { public function __invoke($comment_id, $status) { $screen = \get_current_screen(); if ($screen instanceof \Rvx\Handlers\WP_Screen || $screen->id == "edit-comments") { $this->prepareData($comment_id, $status); } if (wp_doing_ajax()) { $this->prepareData($comment_id, $status); } } public function prepareData($comment_id, $status) { $comment = get_comment($comment_id); $post_type = get_post_type($comment->comment_post_ID); if ($post_type) { $data = []; switch ($status) { case "approve": $data["status"] = 1; (new ReviewsApi())->visibilityReviewData($data, Client::getUid() . "-" . $comment_id); break; case "hold": $data["status"] = 4; (new ReviewsApi())->visibilityReviewData($data, Client::getUid() . "-" . $comment_id); break; case "spam": $data["status"] = 5; (new ReviewsApi())->visibilityReviewData($data, Client::getUid() . "-" . $comment_id); break; case "1": $data["status"] = 1; (new ReviewsApi())->visibilityReviewData($data, Client::getUid() . "-" . $comment_id); break; } } } } IsAlreadySyncSucess.php 0000777 00000001153 15251327640 0011171 0 ustar 00 <?php namespace Rvx\Handlers; class IsAlreadySyncSucess { public function resetSyncFlag() { add_action('admin_footer', function () { if (!\get_transient('rvx_reset_sync_flag')) { return; } ?> <script> try { localStorage.setItem('isAlreadySyncSuccess', 'false'); } catch (e) { console.warn('ReviewX: Unable to access localStorage'); } </script> <?php \delete_transient('rvx_reset_sync_flag'); }); } } DashboardMenuHandler.php 0000777 00000000546 15251327640 0011310 0 ustar 00 <?php namespace Rvx\Handlers; use Rvx\WPDrill\Contracts\InvokableContract; use Rvx\WPDrill\Facades\View; class DashboardMenuHandler implements InvokableContract { public function __invoke() { View::output('storeadmin/dashboard', ['title' => 'Welcome Deshboard', 'content' => 'A WordPress Plugin development framework for humans']); } } BulkAction/CustomBulkActionsForReviewsHandler.php 0000777 00000004725 15251327640 0016257 0 ustar 00 <?php namespace Rvx\Handlers\BulkAction; use Rvx\Api\ReviewsApi; use Rvx\Utilities\Auth\Client; use Rvx\Services\CacheServices; class CustomBulkActionsForReviewsHandler { protected $cacheServices; public function __construct() { $this->cacheServices = new CacheServices(); } public function __invoke() { $screen = \get_current_screen(); // Ensure we are on the 'edit-comments' screen if (!$screen instanceof \Rvx\Handlers\BulkAction\WP_Screen || $screen->id !== 'edit-comments') { return; } // Validate request parameters if (empty($_REQUEST['action']) || empty($_REQUEST['delete_comments'])) { return; } $action = sanitize_text_field($_REQUEST['action']); $comment_ids = \array_map('intval', (array) $_REQUEST['delete_comments']); // Define valid actions $valid_actions = ['approve', 'unapprove', 'spam', 'trash', 'unspam', 'restore']; if (!\in_array($action, $valid_actions, \true)) { return; } $data = []; $reviewApi = new ReviewsApi(); // Process actions switch ($action) { case 'approve': $data['status'] = 1; $data['review_wp_unique_ids'] = $this->modifiyIds($comment_ids); $reviewApi->reviewBulkUpdate($data); break; case 'unapprove': $data['status'] = 2; $data['review_wp_unique_ids'] = $this->modifiyIds($comment_ids); $reviewApi->reviewBulkUpdate($data); break; case 'spam': $data['status'] = 3; $data['review_wp_unique_ids'] = $this->modifiyIds($comment_ids); $reviewApi->reviewBulkUpdate($data); break; case 'trash': $data['review_wp_unique_ids'] = $this->modifiyIds($comment_ids); $reviewApi->reviewBulkTrash($data); break; case 'unspam': case 'restore': $data['status'] = 1; $data['review_wp_unique_ids'] = $this->modifiyIds($comment_ids); $reviewApi->reviewBulkTrash($data); break; } $this->cacheServices->removeCache(); } public function modifiyIds($comment_ids) { return \array_map(function ($id) { return Client::getUid() . '-' . $id; }, $comment_ids); } } BulkAction/RegisterBulkActionsForReviewsHandler.php 0000777 00000004710 15251327640 0016563 0 ustar 00 <?php namespace Rvx\Handlers\BulkAction; use Rvx\Services\CacheServices; class RegisterBulkActionsForReviewsHandler { protected $cacheServices; public function __construct() { $this->cacheServices = new CacheServices(); } public function __invoke($new_status, $old_status, $comment) { $screen = \get_current_screen(); if ($screen->id !== 'edit-comments') { return; } if (isset($_REQUEST['action']) && $_REQUEST['action'] != -1) { $doaction = $_REQUEST['action']; } elseif (isset($_REQUEST['action2']) && $_REQUEST['action2'] != -1) { $doaction = $_REQUEST['action2']; } else { return; } // Check if we are in the comments admin page if (!isset($_REQUEST['comment'])) { return; } $comment_ids = $_REQUEST['comment']; // Process each bulk action if ($doaction === 'approve') { foreach ($comment_ids as $comment_id) { // Approve the comment wp_set_comment_status($comment_id, 'approve'); } $redirect_to = add_query_arg('bulk_approved_comments', \count($comment_ids), wp_get_referer()); wp_safe_redirect($redirect_to); exit; } if ($doaction === 'unapprove') { foreach ($comment_ids as $comment_id) { // Unapprove the comment wp_set_comment_status($comment_id, 'hold'); } $redirect_to = add_query_arg('bulk_unapproved_comments', \count($comment_ids), wp_get_referer()); wp_safe_redirect($redirect_to); exit; } if ($doaction === 'spam') { foreach ($comment_ids as $comment_id) { // Mark the comment as spam wp_spam_comment($comment_id); } $redirect_to = add_query_arg('bulk_spam_comments', \count($comment_ids), wp_get_referer()); wp_safe_redirect($redirect_to); exit; } if ($doaction === 'trash') { foreach ($comment_ids as $comment_id) { // Move the comment to trash wp_trash_comment($comment_id); } $redirect_to = add_query_arg('bulk_trash_comments', \count($comment_ids), wp_get_referer()); wp_safe_redirect($redirect_to); exit; } $this->cacheServices->removeCache(); } } WooReviewTableHandler.php 0000777 00000007340 15251327640 0011471 0 ustar 00 <?php namespace Rvx\Handlers; use Exception; use Rvx\Api\ReviewsApi; use Rvx\Utilities\Auth\Client; use Rvx\Services\CacheServices; use WP_Screen; class WooReviewTableHandler { protected $cacheServices; public function __construct() { $this->cacheServices = new CacheServices(); } public function __invoke($new_status, $old_status, $comment) { $comment_id = $comment->comment_ID; $this->handleAction($new_status, $old_status, $comment_id); } public function handleAction($new_status, $old_status, $comment_id) { $wpUniqueId = $this->getWpUniqueId($comment_id); switch (\true) { case $this->isMoveToTrash($new_status, $old_status): $this->moveToTrash($wpUniqueId); break; case $this->isRestoreFromTrash($new_status, $old_status): $this->restoreFromTrash($wpUniqueId, $new_status); break; default: $this->changeVisibility($new_status, $old_status, $wpUniqueId); break; } $comment = get_comment($comment_id); if ($comment && $comment->comment_post_ID) { \Rvx\CPT\CptAverageRating::update_average_rating($comment->comment_post_ID); } $this->cacheServices->removeCache(); } /** * Generate the unique ID for a WordPress comment. */ private function getWpUniqueId($comment_id) { return Client::getUid() . "-" . $comment_id; } /** * Check if the transition is moving to Trash from approved, unapproved, or spam. */ private function isMoveToTrash($new_status, $old_status) { return $new_status === "trash"; } /** * Check if the transition is restoring from Trash to approved or unapproved. */ private function isRestoreFromTrash($new_status, $old_status) { return $old_status === "trash"; } /** * Move a review to Trash. */ private function moveToTrash($wpUniqueId) : void { try { $data = ["WpUniqueId" => $wpUniqueId]; (new ReviewsApi())->reviewMoveToTrash($data); } catch (Exception $e) { \error_log("Move to trash : " . \print_r($e->getMessage(), \true)); } } /** * Restore a review from Trash to a given status. */ private function restoreFromTrash($wpUniqueId, $new_status) { try { $statusMap = ["approved" => 1, "unapproved" => 2, "hold" => 4, "pending" => 4, "spam" => 5]; $status = isset($statusMap[$new_status]) ? $statusMap[$new_status] : 1; // Default to published if unknown (new ReviewsApi())->restoreReview($wpUniqueId, $status); } catch (Exception $e) { \error_log("Restored Form trash " . \print_r($e->getMessage(), \true)); } } /** * Mark a review as spam. */ private function changeVisibility($new_status, $old_status, $wpUniqueId) { try { $statusMap = [ "approved" => 1, // WordPress default "published" => 1, "unapproved" => 2, // WordPress default "unpublished" => 2, "pending" => 4, "hold" => 4, "spam" => 5, "trash" => 3, "delete" => 3, ]; if (!isset($statusMap[$new_status])) { return; } $status = $statusMap[$new_status]; (new ReviewsApi())->visibilityReviewData(["status" => $status], $wpUniqueId); } catch (Exception $e) { \error_log("Change Visibility: " . \print_r($e->getMessage(), \true)); } } } ReviewReminderEmailHandler.php 0000777 00000000562 15251327640 0012471 0 ustar 00 <?php namespace Rvx\Handlers; use Rvx\WPDrill\Contracts\InvokableContract; use Rvx\WPDrill\Facades\View; class ReviewReminderEmailHandler implements InvokableContract { public function __invoke() { View::output('storeadmin/reviewReminder', ['title' => 'Welcome to WPDrill', 'content' => 'A WordPress Plugin development framework for humans']); } } CommentStatusHandler.php 0000777 00000000321 15251327640 0011371 0 ustar 00 <?php namespace Rvx\Handlers; class CommentStatusHandler { public function __invoke($comment_id) { $comments = get_comment($comment_id); \error_log("Comment id" . $comments); } } RvxInit/LoadReviewxCreateSiteTable.php 0000777 00000003520 15251327640 0014046 0 ustar 00 <?php namespace Rvx\Handlers\RvxInit; class LoadReviewxCreateSiteTable { /** * Invokes the process to ensure the table exists. */ public function init() { if (!$this->is_table_exists()) { $this->create_table(); } } /** * Checks if the table exists in the database. * * @return bool True if the table exists, false otherwise. */ private function is_table_exists() { global $wpdb; $table_name = $this->get_table_name(); return $wpdb->get_var($wpdb->prepare("SHOW TABLES LIKE %s", $table_name)) === $table_name; } /** * Creates the database table if it does not exist. */ private function create_table() { global $wpdb; $table_name = $this->get_table_name(); $charset_collate = $wpdb->get_charset_collate(); $sql = "CREATE TABLE {$table_name} (\n id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,\n name VARCHAR(255) NOT NULL,\n site_id INT(11) NOT NULL,\n uid VARCHAR(32) NOT NULL,\n domain VARCHAR(255) NOT NULL,\n url VARCHAR(255) NOT NULL,\n locale CHAR(10) NOT NULL,\n email VARCHAR(100) NOT NULL,\n secret VARCHAR(100) NOT NULL,\n is_saas_sync TINYINT(1) DEFAULT 0,\n created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\n updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,\n PRIMARY KEY (id)\n ) {$charset_collate};"; require_once ABSPATH . 'wp-admin/includes/upgrade.php'; dbDelta($sql); } /** * Returns the table name. * * @return string Fully qualified table name. */ private function get_table_name() { global $wpdb; return $wpdb->prefix . 'rvx_sites'; } } RvxInit/ReviewXoldPluginDeactivateHandler.php 0000777 00000001102 15251327640 0015425 0 ustar 00 <?php namespace Rvx\Handlers\RvxInit; class ReviewXoldPluginDeactivateHandler { /** * Handle the deactivation of the old ReviewX Pro plugin. * * This checks if the old ReviewX Pro plugin is active and deactivates it. */ public function __invoke() { $reviewxProPath = 'reviewx-pro/reviewx-pro.php'; // Path to the plugin to deactivate // Check if the plugin is active if (is_plugin_active($reviewxProPath)) { deactivate_plugins($reviewxProPath); // Deactivate the plugin } } } RvxInit/ResetProductMetaHandler.php 0000777 00000000341 15251327640 0013422 0 ustar 00 <?php namespace Rvx\Handlers\RvxInit; use Rvx\Services\Api\LoginService; class ResetProductMetaHandler { public function __invoke($upgrader_object, $options) { (new LoginService())->resetPostMeta(); } } RvxInit/UpgradeReviewxDeactiveProHandler.php 0000777 00000003222 15251327640 0015260 0 ustar 00 <?php namespace Rvx\Handlers\RvxInit; use Rvx\Api\AuthApi; class UpgradeReviewxDeactiveProHandler { public function __invoke($upgrader_object, $options) { if ($options['type'] === 'plugin' && isset($options['plugins'])) { // Your plugin's main file $reviewxFilePath = plugin_basename(__FILE__); // Check if your plugin is being updated if (\in_array($reviewxFilePath, $options['plugins'], \true)) { $reviewxProDeactive = 'reviewx-pro/reviewx-pro.php'; // Path to the plugin to deactivate // Check if the target plugin is active if (is_plugin_active($reviewxProDeactive)) { deactivate_plugins($reviewxProDeactive); // Deactivate the plugin } } $response = wp_remote_get("https://api.wordpress.org/plugins/info/1.0/reviewx.json"); if (!\is_wp_error($response)) { $plugin_data = \json_decode(wp_remote_retrieve_body($response)); if ($plugin_data && isset($plugin_data->version)) { global $wpdb; $rvxSites = $wpdb->prefix . 'rvx_sites'; $uid = $wpdb->get_var("SELECT uid FROM {$rvxSites} ORDER BY id DESC LIMIT 1"); $plugin_version = $plugin_data->version; if ($uid) { (new AuthApi())->changePluginStatus(['site_uid' => $uid, 'status' => 1, 'plugin_version' => $plugin_version ?? RVX_VERSION, 'wp_version' => get_bloginfo('version')]); } } } } } } RvxInit/PageBuilderHandler.php 0000777 00000000346 15251327640 0012360 0 ustar 00 <?php namespace Rvx\Handlers\RvxInit; class PageBuilderHandler { public function __invoke() { if (\class_exists('\\Elementor\\Plugin')) { \Rvx\Elementor\Classes\Starter::instance(); } } } ProductStatusHandler.php 0000777 00000001525 15251327640 0011416 0 ustar 00 <?php namespace Rvx\Handlers; class ProductStatusHandler { public function __construct() { } public function __invoke($new_status, $old_status, $post) { if ($post->post_type === 'product') { // Check if the new status is 'publish' or 'publish' if (($new_status === 'publish' || $new_status === 'pending') && $old_status !== 'publish') { // Product is being published // Your custom code for product publishing here echo "Product with ID {$post->ID} published."; } elseif ($new_status === 'draft' && $old_status === 'publish') { // Product is being unpublished // Your custom code for product unpublishing here echo "Product with ID {$post->ID} unpublished."; } } } } UserDeleteHandler.php 0000777 00000001033 15251327640 0010625 0 ustar 00 <?php namespace Rvx\Handlers; use Rvx\Api\UserApi; use Rvx\Utilities\Auth\Client; use Rvx\WPDrill\Response; class UserDeleteHandler { public function __construct() { } public function __invoke($user_id) { $id = Client::getUid() . '-' . $user_id; $response = (new UserApi())->remove($id); \error_log("Response" . $response->getStatusCode()); if ($response->getStatusCode() !== Response::HTTP_OK) { \error_log("user Not Delete"); return \false; } } } CategoryDeleteHandler.php 0000777 00000006067 15251327640 0011500 0 ustar 00 <?php namespace Rvx\Handlers; use Exception; use Rvx\Api\CategoryApi; use Rvx\Utilities\Auth\Client; use Rvx\CPT\CptHelper; use Rvx\WPDrill\Response; class CategoryDeleteHandler { protected $cptHelper; protected $taxonomyHandler; protected $dataSyncHandler; public function __construct() { $this->cptHelper = new CptHelper(); $this->taxonomyHandler = new \Rvx\Handlers\TaxonomyHandler(); $this->dataSyncHandler = new \Rvx\Handlers\DataSyncHandler(); } public function deleteHandler($term_id, $tt_id, $taxonomy, $deleted_term, $object_ids) { $enabled_post_types = $this->cptHelper->usedCPT('used'); $related_post_types = $this->taxonomyHandler->getPostTypesByTaxonomy($taxonomy); if (empty(\array_intersect(\array_keys($enabled_post_types), $related_post_types))) { return; } $product_related_taxonomies = $this->dataSyncHandler->getProductTaxonomies(); // Only proceed if it is a taxonomy object of 'product' post type if (empty(\array_intersect([$taxonomy], $product_related_taxonomies))) { return; } $this->syncTermDelete($term_id); // if ($this->taxonomyHandler->termParentChanged($term, $taxonomy)) { // $this->handleHierarchyUpdates($deleted_term); // } } protected function syncTermDelete($term_id) { try { $uid = Client::getUid() . '-' . $term_id; $response = (new CategoryApi())->remove($uid); if ($response->getStatusCode() !== Response::HTTP_OK) { throw new Exception("API status: " . $response->getStatusCode()); } } catch (Exception $e) { \error_log("Update failed for term {$term_id}: " . $e->getMessage()); return \false; } } protected function handleHierarchyUpdates($term) { // Case 1: Term became a parent if ($this->taxonomyHandler->isParentTerm($term->term_id, $term->term_taxonomy)) { $this->handleNewParentTerm($term); } elseif ($this->taxonomyHandler->hadChildrenBeforeUpdate($term->term_id, $term->term_taxonomy)) { $this->handleFormerParentTerm($term); } // Case 3: Term with children moved in hierarchy if ($this->taxonomyHandler->hasChildren($term->term_id, $term->term_taxonomy)) { $this->updateAllDescendants($term); } } protected function handleNewParentTerm($term) { // error_log("Term {$term->term_id} is now a parent"); // Add specific new parent logic here } protected function handleFormerParentTerm($term) { // error_log("Term {$term->term_id} was a parent but is now a child"); // Add specific former parent logic here } protected function updateAllDescendants($term) { $descendants = $this->taxonomyHandler->getAllDescendants($term->term_id, $term->term_taxonomy); foreach ($descendants as $descendant) { $this->taxonomyHandler->syncTermUpdate($descendant['term']); } } } ReplyCommentHandler.php 0000777 00000001547 15251327640 0011214 0 ustar 00 <?php namespace Rvx\Handlers; use Rvx\Api\ReviewsApi; use Rvx\Utilities\Auth\Client; use Rvx\Services\CacheServices; class ReplyCommentHandler { protected $cacheServices; public function __construct() { $this->cacheServices = new CacheServices(); } public function __invoke($comment_id, $comment_approved, $commentdata) { if ($commentdata['comment_parent'] > 0) { $parent_comment = get_comment($commentdata['comment_parent']); if ($parent_comment) { $wpUniqueId = Client::getUid() . '-' . $parent_comment->comment_ID; $replies = ['reply' => $commentdata['comment_content'], 'wp_id' => $parent_comment->comment_ID]; (new ReviewsApi())->commentReply($replies, $wpUniqueId); $this->cacheServices->removeCache(); } } } } ProductDeleteHandler.php 0000777 00000002045 15251327640 0011333 0 ustar 00 <?php namespace Rvx\Handlers; use Rvx\Api\ProductApi; use Rvx\CPT\CptHelper; use Rvx\Utilities\Auth\Client; use Rvx\WPDrill\Response; use Rvx\Services\CacheServices; class ProductDeleteHandler { protected $cptHelper; protected $cacheServices; public function __construct() { $this->cptHelper = new CptHelper(); $this->cacheServices = new CacheServices(); } public function __invoke($product_id) { // Define the target post types $enabled_post_types = $this->cptHelper->usedCPT('used'); $post = get_post($product_id); $post_type = $post->post_type; if (!isset($enabled_post_types[$post_type])) { return; } $uid = Client::getUid() . '-' . $product_id; $response = (new ProductApi())->remove($uid); if ($response->getStatusCode() !== Response::HTTP_OK) { \error_log($post_type . " delete fails! --> " . $response->getStatusCode()); return \false; } $this->cacheServices->removeCache(); } } CptReviewsHandler.php 0000777 00000000411 15251327640 0010656 0 ustar 00 <?php namespace Rvx\Handlers; use Rvx\WPDrill\Contracts\InvokableContract; use Rvx\WPDrill\Facades\View; class CptReviewsHandler implements InvokableContract { public function __invoke() { View::output('storeadmin/cpt', ['cpt' => "cpt"]); } } ImportExpotHandler.php 0000777 00000000551 15251327640 0011062 0 ustar 00 <?php namespace Rvx\Handlers; use Rvx\WPDrill\Contracts\InvokableContract; use Rvx\WPDrill\Facades\View; class ImportExpotHandler implements InvokableContract { public function __invoke() { View::output('storeadmin/import-export', ['title' => 'Welcome to WPDrill', 'content' => 'A WordPress Plugin development framework for humans']); } } CategorySync.php 0000777 00000004434 15251327640 0007710 0 ustar 00 <?php namespace Rvx\Handlers; use Rvx\Api\CategoryApi; use Rvx\Utilities\Auth\Client; use Rvx\WPDrill\Contracts\InvokableContract; use Rvx\WPDrill\Response; class CategorySync implements InvokableContract { public function __invoke() { $this->scheduleProductChunkProcessing(); $this->categoryGat(); } public function categoryGat() { $chunkSize = 20; $offset = \get_option('category_chunk_offset', 0); $products = $this->getProductsChunk($offset, $chunkSize); $modyFiedCategories = []; foreach ($products as $category) { $modyFiedCategories[] = $this->processCategories($category); } $this->catSync($modyFiedCategories); $totalProducts = $offset + \count($products); \update_option('total_catagory_count', $totalProducts); \error_log('Total Category=: ' . $totalProducts); \update_option('category_chunk_offset', $offset + $chunkSize); \error_log('Chunk size=: ' . $offset); if (\count($products) < $chunkSize) { \delete_option('category_chunk_offset'); } } public function processCategories($category) { if (!empty($category)) { return ['wp_id' => (int) $category->term_id, 'title' => $category->name, 'slug' => $category->slug, 'description' => $category->description ?? '', 'taxonomy' => 'product_cat', "parent_id" => null, 'parent_wp_unique_id' => null]; } } private function getProductsChunk($offset, $limit) { global $wpdb; $query = $wpdb->prepare("\n SELECT *\n FROM {$wpdb->terms}\n LIMIT %d OFFSET %d\n ", $limit, $offset); return $wpdb->get_results($query); } public function catSync($payload) { if (!Client::getSync()) { $response = (new CategoryApi())->dataSync(['categories' => $payload]); if ($response->getStatusCode() !== Response::HTTP_OK) { \error_log("Sync Category not inserted: " . $response); return \false; } } } public function scheduleProductChunkProcessing() { if (!wp_next_scheduled('category_sync_event')) { wp_schedule_event(\time(), 'hourly', 'category_sync_event'); } } } Notice/ReviewxAdminNoticeHandler.php 0000777 00000002354 15251327640 0013560 0 ustar 00 <?php namespace Rvx\Handlers\Notice; use Rvx\WPDrill\Facades\View; class ReviewxAdminNoticeHandler { public function adminNoticeHandler() { // Check if notice is temporarily dismissed $dismissUntil = \get_option('rvx_admin_deal_notice_until', 0); if ($dismissUntil && \time() < $dismissUntil) { return; } // Generate nonce for AJAX $nonce = wp_create_nonce('rvx_dismiss_notice_nonce'); // Render the notice View::output('storeadmin/notice/notice', ['nonce' => $nonce]); } public function rvx_admin_deal_notice_until() { // Verify nonce if (!isset($_POST['nonce']) || !wp_verify_nonce($_POST['nonce'], 'rvx_dismiss_notice_nonce')) { wp_send_json_error(['message' => 'Invalid nonce.']); } // Get duration $duration = $_POST['duration']; if (\is_numeric($duration)) { $timestamp = \strtotime("+{$duration} days"); \update_option('rvx_admin_deal_notice_until', $timestamp); } else { wp_send_json_error(['message' => 'Invalid duration.']); } // Return success wp_send_json_success(['message' => 'Notice dismissed successfully.']); } } StoreFrontHandller.php 0000777 00000001047 15251327640 0011052 0 ustar 00 <?php namespace Rvx\Handlers; use Rvx\Api\WpApi; use Rvx\WPDrill\Contracts\InvokableContract; use Rvx\WPDrill\Facades\View; class StoreFrontHandller implements InvokableContract { protected WpApi $wpApi; /** * */ public function __construct() { $this->wpApi = new WpApi(); } public function __invoke() { View::output('storefront/widgets', ['title' => 'Welcome Deshboard', 'content' => 'A WordPress Plugin development framework for humans', 'response' => $this->wpApi->get('/reviews')]); } } CategoryCreateHandler.php 0000777 00000006712 15251327640 0011476 0 ustar 00 <?php namespace Rvx\Handlers; use Exception; use Rvx\Api\CategoryApi; use Rvx\Utilities\Auth\Client; use Rvx\CPT\CptHelper; use Rvx\WPDrill\Response; class CategoryCreateHandler { protected $cptHelper; protected $taxonomyHandler; protected $dataSyncHandler; public function __construct() { $this->cptHelper = new CptHelper(); $this->taxonomyHandler = new \Rvx\Handlers\TaxonomyHandler(); $this->dataSyncHandler = new \Rvx\Handlers\DataSyncHandler(); } public function __invoke($term_id) { $enabled_post_types = $this->cptHelper->usedCPT('used'); $related_post_types = $this->taxonomyHandler->getPostTypesByTermId($term_id); if (empty(\array_intersect(\array_keys($enabled_post_types), $related_post_types))) { return; } global $wpdb; $taxonomy = $this->taxonomyHandler->getTaxonomyByTermIdFromDB($term_id, $wpdb); $this_taxonomy_name = $taxonomy[0]['taxonomy'] ?? ''; $product_related_taxonomies = $this->dataSyncHandler->getProductTaxonomies(); // Only proceed if it is a taxonomy object of 'product' post type if (empty(\array_intersect([$this_taxonomy_name], $product_related_taxonomies))) { return; } $term = $this->taxonomyHandler->getTerm($term_id, $this_taxonomy_name); if (!$term) { return; } $this->syncTermCreate($term); // if ($this->taxonomyHandler->termParentChanged($term_id, $this_taxonomy_name)) { // $this->handleHierarchyUpdates($term); // } } protected function syncTermCreate($term) { try { $payload = ['wp_id' => $term->term_id, 'title' => $term->name, 'slug' => $term->slug, 'taxonomy' => $term->taxonomy, 'description' => $term->description, 'parent_wp_unique_id' => Client::getUid() . '-' . $term->parent ?? null]; $response = (new CategoryApi())->create($payload); if ($response->getStatusCode() !== Response::HTTP_OK) { throw new Exception("API status: " . $response->getStatusCode()); } } catch (Exception $e) { \error_log("Update failed for term {$term->term_id}: " . $e->getMessage()); return \false; } } protected function handleHierarchyUpdates($term) { // Case 1: Term became a parent if ($this->taxonomyHandler->isParentTerm($term->term_id, $term->taxonomy)) { $this->handleNewParentTerm($term); } elseif ($this->taxonomyHandler->hadChildrenBeforeUpdate($term->term_id, $term->taxonomy)) { $this->handleFormerParentTerm($term); } // Case 3: Term with children moved in hierarchy if ($this->taxonomyHandler->hasChildren($term->term_id, $term->taxonomy)) { $this->updateAllDescendants($term); } } protected function handleNewParentTerm($term) { "Term {$term->term_id} is now a parent"; // Add specific new parent logic here } protected function handleFormerParentTerm($term) { // error_log("Term {$term->term_id} was a parent but is now a child"); // Add specific former parent logic here } protected function updateAllDescendants($term) { $descendants = $this->taxonomyHandler->getAllDescendants($term->term_id, $term->taxonomy); foreach ($descendants as $descendant) { $this->syncTermUpdate($descendant['term']); } } } PublicReviewHandler.php 0000777 00000000305 15251327640 0011165 0 ustar 00 <?php namespace Rvx\Handlers; class PublicReviewHandler { public function __construct() { } public function __invoke($product_id) { // dd($product_id); } } WooCommerceReviewEditForm.php 0000777 00000003011 15251327640 0012317 0 ustar 00 <?php namespace Rvx\Handlers; use Rvx\Services\ReviewService; use Rvx\Utilities\Auth\Client; use Rvx\Services\CacheServices; class WooCommerceReviewEditForm { protected $cacheServices; public function __construct() { $this->cacheServices = new CacheServices(); } public function __invoke($id, $data) { $updatedData = $this->prepareData($id, $data); $reviewService = new ReviewService(); $reviewService->updateWooReview($updatedData, $data); $this->cacheServices->removeCache(); } public function prepareData($id, $data) { $post_id = $data['comment_post_ID']; // $post_type = get_post_type($post_id); // Retrieve the rating. $rating = (float) \round(\get_comment_meta($id, 'rating', \true), 2); // if ($post_type === 'product') { // // For products, round up to the nearest whole number. // $rating = ceil((float) $rating); // } else { // // For other post types, round to two decimal places. // $rating = (float) round($rating, 2); // } return ['wp_id' => $id, 'wp_post_id' => $post_id, 'comment_approved' => $data['comment_approved'], 'rating' => $rating, 'reviewer_email' => $data['comment_author_email'], 'reviewer_name' => $data['comment_author'], 'feedback' => $data['comment_content'], 'date' => current_time('mysql', \true), 'customer_id' => $data['user_id'], 'wp_unique_id' => Client::getUid() . '-' . $id, 'woocommerce_update' => \true]; } } ProductHandler.php 0000777 00000012560 15251327640 0010213 0 ustar 00 <?php namespace Rvx\Handlers; use Rvx\Api\ProductApi; use Rvx\WPDrill\Response; class ProductHandler { public function __invoke($new_status, $old_status, $product) { if ($new_status == 'publish' && $old_status != 'publish') { $post = get_post($product->ID); if ($post->post_type === 'product') { switch ($new_status) { case 'publish': $currentProduct = wc_get_product($product->ID); $payload = $this->prepareData($currentProduct); $response = (new ProductApi())->create($payload); if ($response->getStatusCode() !== Response::HTTP_OK) { \error_log("Product Not insert" . $response->getStatusCode()); return \false; } break; } } else { $payload = $this->customPost($post); \error_log("Custom post" . \print_r($payload, \true)); $response = (new ProductApi())->create($payload); if ($response->getStatusCode() !== Response::HTTP_OK) { \error_log("Cpt Not insert" . $response); return \false; } } } } public function prepareData($currentProduct) { $images = wp_get_attachment_image_src($currentProduct->image_id, 'full'); $title = $currentProduct->get_name(); return [ "wp_id" => $currentProduct->get_id(), "title" => isset($title) ? \htmlspecialchars($title, \ENT_QUOTES, 'UTF-8') : null, "url" => get_permalink($currentProduct->get_id()), "description" => isset($currentProduct->short_description) ? \htmlspecialchars($currentProduct->short_description, \ENT_QUOTES, 'UTF-8') : null, "price" => isset($_POST['_regular_price']) ? (float) sanitize_text_field($_POST['_regular_price']) : 0, "discounted_price" => isset($_POST['_sale_price']) ? (float) sanitize_text_field($_POST['_sale_price']) : 0, "slug" => $currentProduct->get_slug(), "image" => $images[0] ?? '', "status" => $this->productStatus($currentProduct->get_status()), "post_type" => 'product', //get_post_type() code not use because import product issue "total_reviews" => (int) $currentProduct->get_review_count(), "avg_rating" => (float) $currentProduct->get_average_rating(), "stars" => ["one" => 0, "two" => 0, "three" => 0, "four" => 0, "five" => 0], "one_stars" => 0, "two_stars" => 0, "three_stars" => 0, "four_stars" => 0, "five_stars" => 0, "category_wp_unique_ids" => $this->productCategory($currentProduct), ]; } public function productStatus($status) { switch ($status) { case 'publish': return 1; case 'trash': return 2; default: return 3; } } public function productCategory($product) { $product_categories = $product->get_category_ids(); $parent_category_ids = array(); foreach ($product_categories as $category_id) { $category = \get_term($category_id, 'product_cat'); if ($category && $category->parent == 0) { $parent_category_ids[] = \Rvx\Utilities\Auth\Client::getUid() . '-' . $category_id; } } if (empty($parent_category_ids)) { $parent_category_ids[] = \Rvx\Utilities\Auth\Client::getUid() . '-' . '1'; return $parent_category_ids; } return $parent_category_ids; } public function customPost($post) { $image_url = get_the_post_thumbnail_url($post->ID, 'full'); $data = ["wp_id" => $post->ID, "title" => isset($post->post_title) ? \htmlspecialchars($post->post_title, \ENT_QUOTES, 'UTF-8') : null, "url" => get_permalink($post->ID), "description" => isset($post->post_excerpt) ? \htmlspecialchars($post->post_excerpt, \ENT_QUOTES, 'UTF-8') : null, "price" => 0, "discounted_price" => 0, "slug" => $post->post_name, "image" => $image_url ?? '', "status" => $this->productStatus($post->post_status), "post_type" => get_post_type($post->ID), "total_reviews" => (int) get_comments_number($post->ID) ?? 0, "avg_rating" => 0.0, "stars" => ["one" => 0, "two" => 0, "three" => 0, "four" => 0, "five" => 0], "one_stars" => 0, "two_stars" => 0, "three_stars" => 0, "four_stars" => 0, "five_stars" => 0, "category_wp_unique_ids" => [\Rvx\Utilities\Auth\Client::getUid() . '-' . 0]]; return $data; } public function getPostCategoryIds($post_ids) { if (empty($post_ids)) { \error_log("No valid post ID provided."); return []; } if (empty($category_ids)) { \error_log("No categories found for post ID: " . $post_ids); return []; } $parent_category_ids = []; foreach ($category_ids as $category_id) { $parent_category_ids[] = \Rvx\Utilities\Auth\Client::getUid() . '-' . $category_id; } if ($parent_category_ids) { return $parent_category_ids; } return $parent_category_ids[] = \Rvx\Utilities\Auth\Client::getUid() . '-' . 0; } } UserHandler.php 0000777 00000002045 15251327640 0007506 0 ustar 00 <?php namespace Rvx\Handlers; use Rvx\Api\UserApi; use Rvx\WPDrill\Response; class UserHandler { public function __construct() { } public function __invoke($user_id) { $user = get_userdata($user_id); $data = [ 'wp_id' => $user->ID, 'name' => $user->first_name . ' ' . $user->last_name, 'email' => $user->user_email, // 'display_name' => $user->display_name, // 'role' => $user->roles, 'avatar' => get_avatar_url($user->ID), 'city' => \get_user_meta($user->ID, 'billing_city', \true) ?? '', 'phone' => \get_user_meta($user->ID, 'billing_phone', \true) ?? '', 'address' => \get_user_meta($user->ID, 'billing_address_1', \true) ?? '', 'country' => \get_user_meta($user->ID, 'billing_country', \true) ?? '', 'status' => 1, ]; $response = (new UserApi())->create($data); if ($response->getStatusCode() !== Response::HTTP_OK) { return \false; } } } CouponCreateHandler.php 0000777 00000000344 15251327640 0011157 0 ustar 00 <?php namespace Rvx\Handlers; use Rvx\WPDrill\Contracts\InvokableContract; class CouponCreateHandler implements InvokableContract { public function __invoke($coupon) { \error_log('copon id' . $coupon); } } PluginUninstallerHandler.php 0000777 00000002351 15251327640 0012247 0 ustar 00 <?php namespace Rvx\Handlers; use Rvx\Api\AuthApi; use Exception; class PluginUninstallerHandler { public static function handleUninstall() { global $wpdb; $rvxSites = $wpdb->prefix . 'rvx_sites'; $uid = $wpdb->get_var("SELECT uid FROM {$rvxSites} ORDER BY id DESC LIMIT 1"); if ($uid) { try { // Try to inform the API about uninstall (new AuthApi())->changePluginStatus(['site_uid' => $uid, 'status' => 2, 'plugin_version' => \defined('RVX_VERSION') ? RVX_VERSION : 'unknown', 'wp_version' => get_bloginfo('version')]); } catch (Exception $e) { // If API fails, do not interrupt uninstall if (\defined('WP_DEBUG') && WP_DEBUG) { \error_log('[ReviewX] PluginUninstallerHandler: API call failed - ' . $e->getMessage()); } // continue silently } } // Always clean up local data, regardless of API status $wpdb->query("TRUNCATE TABLE {$rvxSites}"); (new \Rvx\Services\CacheServices())->removeCache(); (new \Rvx\Services\Api\LoginService())->resetPostMeta(); // Continue uninstall cleanly return \true; } } CategoryUpdateHandler.php 0000777 00000007124 15251327640 0011513 0 ustar 00 <?php namespace Rvx\Handlers; use Exception; use Rvx\Api\CategoryApi; use Rvx\Utilities\Auth\Client; use Rvx\CPT\CptHelper; use Rvx\WPDrill\Response; class CategoryUpdateHandler { protected $cptHelper; protected $taxonomyHandler; protected $dataSyncHandler; public function __construct() { $this->cptHelper = new CptHelper(); $this->taxonomyHandler = new \Rvx\Handlers\TaxonomyHandler(); $this->dataSyncHandler = new \Rvx\Handlers\DataSyncHandler(); } public function __invoke($term_id) { $enabled_post_types = $this->cptHelper->usedCPT('used'); $related_post_types = $this->taxonomyHandler->getPostTypesByTermId($term_id); if (empty(\array_intersect(\array_keys($enabled_post_types), $related_post_types))) { return; } global $wpdb; $taxonomy = $this->taxonomyHandler->getTaxonomyByTermIdFromDB($term_id, $wpdb); $this_taxonomy_name = $taxonomy[0]['taxonomy'] ?? ''; $product_related_taxonomies = $this->dataSyncHandler->getProductTaxonomies(); // Only proceed if it is a taxonomy object of 'product' post type if (empty(\array_intersect([$this_taxonomy_name], $product_related_taxonomies))) { return; } $term = $this->taxonomyHandler->getTerm($term_id, $this_taxonomy_name); if (!$term) { return; } $this->syncTermUpdate($term); // if ($this->taxonomyHandler->termParentChanged($term_id, $this_taxonomy_name)) { // $this->handleHierarchyUpdates($term); // } } protected function syncTermUpdate($term) { try { $payload = ['wp_id' => $term->term_id, 'title' => $term->name, 'slug' => $term->slug, 'taxonomy' => $term->taxonomy, 'description' => $term->description, 'parent_wp_unique_id' => $term->parent > 0 ? Client::getUid() . '-' . $term->parent : null, 'updated_at' => current_time('mysql')]; $uid = Client::getUid() . '-' . $term->term_id; $response = (new CategoryApi())->update($payload, $uid); if ($response->getStatusCode() !== Response::HTTP_OK) { throw new Exception("API status: " . $response->getStatusCode()); } } catch (Exception $e) { \error_log("Update failed for term {$term->term_id}: " . $e->getMessage()); return \false; } } protected function handleHierarchyUpdates($term) { // Case 1: Term became a parent if ($this->taxonomyHandler->isParentTerm($term->term_id, $term->taxonomy)) { $this->handleNewParentTerm($term); } elseif ($this->taxonomyHandler->hadChildrenBeforeUpdate($term->term_id, $term->taxonomy)) { $this->handleFormerParentTerm($term); } // Case 3: Term with children moved in hierarchy if ($this->taxonomyHandler->hasChildren($term->term_id, $term->taxonomy)) { $this->updateAllDescendants($term); } } protected function handleNewParentTerm($term) { // error_log("Term {$term->term_id} is now a parent"); // Add specific new parent logic here } protected function handleFormerParentTerm($term) { // error_log("Term {$term->term_id} was a parent but is now a child"); // Add specific former parent logic here } protected function updateAllDescendants($term) { $descendants = $this->taxonomyHandler->getAllDescendants($term->term_id, $term->taxonomy); foreach ($descendants as $descendant) { $this->syncTermUpdate($descendant['term']); } } } UserUpdateHandler.php 0000777 00000002465 15251327640 0010657 0 ustar 00 <?php namespace Rvx\Handlers; use Rvx\Api\UserApi; use Rvx\Utilities\Auth\Client; use Rvx\WPDrill\Response; class UserUpdateHandler { public function __construct() { } public function __invoke($user_id) { global $pagenow, $current_screen; if (is_admin() && isset($current_screen->id) && $current_screen->id === 'profile') { $user = get_userdata($user_id); $attachment_id = \get_user_meta($user_id, 'image', \true); $original_image_url = $attachment_id ? wp_get_attachment_url($attachment_id) : get_avatar_url($user_id); $data = ['name' => $user->first_name . ' ' . $user->last_name, 'email' => $user->user_email, 'phone' => \get_user_meta($user->ID, 'billing_phone', \true) ?? '', 'address' => \get_user_meta($user->ID, 'billing_address_1', \true) ?? '', 'city' => \get_user_meta($user->ID, 'billing_city', \true) ?? '', 'country' => \get_user_meta($user->ID, 'billing_country', \true) ?? '', 'avatar' => get_avatar_url($user->ID), 'status' => 1]; $id = Client::getUid() . '-' . $user_id; \error_log($id . \print_r($data, \true)); $response = (new UserApi())->update($data, $id); if ($response->getStatusCode() !== Response::HTTP_OK) { return \false; } } } } WoocommerceSettingsSaveHandler.php 0000777 00000004603 15251327640 0013411 0 ustar 00 <?php namespace Rvx\Handlers; use Rvx\Services\SettingService; use Rvx\Utilities\Helper; use Throwable; use Rvx\WPDrill\Response; class WoocommerceSettingsSaveHandler { public function wooProductSaveHandler() { // Isset specific fields $isset_label = isset($_POST['woocommerce_review_rating_verification_label']) ? \true : \false; $isset_required = isset($_POST['woocommerce_review_rating_verification_required']) ? \true : \false; $modifiedReviewsettings = $this->prepareData($isset_label, $isset_required); try { $response = (new SettingService())->saveApiReviewSettings($modifiedReviewsettings); if ($response->getStatusCode() === Response::HTTP_OK) { $review_settings = $response->getApiData()['review_settings']; $post_type = 'product'; (new SettingService())->updateReviewSettings($review_settings, $post_type); } if ($response->getStatusCode() !== Response::HTTP_OK) { \error_log('API response - NOT OK: ' . \print_r($response->getApiData()['review_settings'], \true)); return Helper::rvxApi(['error' => "WC Settings Fail"])->fails('WC Settings Fail', $response->getStatusCode()); } return Helper::saasResponse($response); } catch (Throwable $e) { return Helper::rvxApi(['error' => $e->getMessage()])->fails('Review settings saved failed', $e->getCode()); } } private function prepareData($isset_label, $isset_required) { // Retrieve the existing review settings $review_settings = (array) (new SettingService())->getReviewSettings('product')['reviews']; $review_settings['show_verified_badge'] = $isset_label ? \true : \false; $wcReviewSubmissionPolicy = $isset_required ? \true : \false; $isAnyone = \true; $isOnlyVerified = \false; if ($wcReviewSubmissionPolicy) { $isAnyone = \false; $isOnlyVerified = \true; } $review_settings['review_submission_policy']['options']['anyone'] = $isAnyone; $review_settings['review_submission_policy']['options']['verified_customer'] = $isOnlyVerified; // $review_settings['recaptcha']['secret_key'] = null; // true if verified only [If for some reason data doesn't save, uncomment this and try] return $review_settings; } } OrderUpdateProcessHandler.php 0000777 00000000511 15251327640 0012341 0 ustar 00 <?php namespace Rvx\Handlers; use Rvx\Services\OrderService; class OrderUpdateProcessHandler { protected $orderService; public function __construct() { $this->orderService = new OrderService(); } public function __invoke($order_id) { $this->orderService->updateOrder($order_id); } } ProductUpdateHandler.php 0000777 00000004127 15251327640 0011356 0 ustar 00 <?php namespace Rvx\Handlers; use Rvx\Api\ProductApi; use Rvx\Utilities\Auth\Client; use Rvx\WPDrill\Response; class ProductUpdateHandler { public function __invoke($product_id) { $product = wc_get_product($product_id); $payload = $this->updateData($product); $uid = Client::getUid() . '-' . $product_id; $response = (new ProductApi())->update($payload, $uid); if ($response->getStatusCode() !== Response::HTTP_OK) { \error_log("Data Not Update " . \print_r($response, \true)); return \false; } } public function updateData($product) { $images = wp_get_attachment_image_src($product->image_id, 'full'); $title = $product->get_name(); return ['wp_id' => $product->get_id(), 'title' => isset($title) ? \htmlspecialchars($title, \ENT_QUOTES, 'UTF-8') : null, 'url' => get_permalink($product->get_id()), 'description' => isset($product->short_description) ? \htmlspecialchars($product->short_description, \ENT_QUOTES, 'UTF-8') : null, 'price' => (float) $product->regular_price, 'discounted_price' => (float) $product->price, 'slug' => $product->get_slug(), 'post_type' => get_post_type(), 'image' => $images[0] ?? null, 'status' => $this->productStatus($product->get_status()), "category_wp_unique_ids" => $this->productCategory($product)]; } public function productCategory($product) { $product_categories = $product->get_category_ids(); $parent_category_ids = array(); foreach ($product_categories as $category_id) { $category = \get_term($category_id, 'product_cat'); if ($category && $category->parent == 0) { $parent_category_ids[] = Client::getUid() . '-' . $category_id; } } return $parent_category_ids; } public function productStatus($status) { switch ($status) { case 'publish': return 1; case 'trash': return 2; case 'draft': return 3; default: return 4; } } } OrderStatusChangedHandler.php 0000777 00000014041 15251327640 0012320 0 ustar 00 <?php namespace Rvx\Handlers; use Rvx\Api\OrderApi; use Rvx\Utilities\Auth\Client; use Rvx\Utilities\Helper; use Rvx\Utilities\TransactionManager; use Rvx\WPDrill\Response; class OrderStatusChangedHandler { public function __invoke($order_id, $old_status, $new_status, $order) { if (isset($_GET['page']) && $_GET['page'] === 'wc-orders' && $_GET['action'] === 'edit') { $is_new_order = \get_post_meta($order_id, '_is_new_order', \true); if ($is_new_order) { // Remove the flag to allow future status changes to trigger this hook \delete_post_meta($order_id, '_rvx_is_new_order'); return; } $payload = $this->prepareData($order, $new_status, $old_status); $uid = Client::getUid() . '-' . $order_id; // WP Operation: Save meta locally. This must happen. $this->orderDataSave($order_id, $payload); // SaaS Operation: Attempt sync, but don't block return. $response = (new OrderApi())->changeStatus($payload, $uid); if ($response->getStatusCode() !== Response::HTTP_OK) { \error_log("Order Status Change Sync Failed for ID {$order_id}: " . $response->getBody()); } } if (isset($_GET['page']) && $_GET['page'] === 'wc-orders') { $payload = $this->bulkOrderPrepare($order_id, $old_status, $new_status, $order); // WP Operation: Save meta locally. $this->orderDataSave($order_id, $payload); // SaaS Operation: Attempt sync. $response = (new OrderApi())->changeBulkStatus($payload); if ($response->getStatusCode() !== Response::HTTP_OK) { \error_log("Bulk Order Status Sync Failed: " . $response->getBody()); } } } public function bulkOrderPrepare($order_id, $old_status, $new_status, $order) { return ['status' => Helper::orderStatus($new_status), 'order_wp_unique_ids' => [Client::getUid() . '-' . $order_id]]; } public function prepareData($order, $new_status, $old_status) : array { $orderStatusToTimestampKey = $this->orderStatusToTimestampKey($new_status); $current_time = \wp_date('Y-m-d H:i:s'); $date_created = $order->get_date_created(); $created_at = $date_created ? \wp_date('Y-m-d H:i:s', $date_created->getTimestamp()) : null; $date_modified = $order->get_date_modified(); $updated_at = $date_modified ? \wp_date('Y-m-d H:i:s', $date_modified->getTimestamp()) : \wp_date('Y-m-d H:i:s'); $order_state = $this->wooOrderState($order, $new_status, $old_status); $orderStatusData = ["status" => Helper::orderStatus($new_status), "paid_at" => $order_state['paid_at'] ?? null]; if ($orderStatusToTimestampKey !== 'any') { $orderStatusData[$orderStatusToTimestampKey] = $current_time; } $orderData = ["wp_id" => (int) $order->get_id(), "customer_wp_unique_id" => Client::getUid() . '-' . (int) $order->get_customer_id(), "subtotal" => (float) $order->get_subtotal(), "tax" => (float) $order->get_total_tax(), "total" => (float) $order->get_total(), 'created_at' => $created_at, 'updated_at' => $updated_at]; $modifiedOrder = \array_merge($orderData, $orderStatusData); return ['order' => $modifiedOrder, 'order_items' => $this->orderItems($order, $orderStatusToTimestampKey, $orderStatusData, $new_status, $old_status)]; } public function wooOrderState($order, $new_status, $old_status) { global $wpdb; $order_id = $order->get_id(); $query = $wpdb->prepare("SELECT date_paid, date_completed FROM {$wpdb->prefix}wc_order_stats WHERE order_id = %d", $order_id); $wpWcOrderStats = $wpdb->get_row($query); $fulfilled_at = $wpWcOrderStats && $wpWcOrderStats->date_completed ? \wp_date('Y-m-d H:i:s', \strtotime($wpWcOrderStats->date_completed)) : null; $paid_at = $wpWcOrderStats && $wpWcOrderStats->date_paid ? \wp_date('Y-m-d H:i:s', \strtotime($wpWcOrderStats->date_paid)) : null; if ($new_status === 'completed' && !$fulfilled_at) { $fulfilled_at = \wp_date('Y-m-d H:i:s'); } if ($new_status === 'processing' && !$paid_at) { $paid_at = \wp_date('Y-m-d H:i:s'); } return ['fulfillment_status' => Helper::orderItemStatus($new_status) ?? null, 'fulfilled_at' => $fulfilled_at, 'paid_at' => $paid_at]; } public function orderItems($order, $orderStatusToTimestampKey, $orderStatusData, $new_status, $old_status) : array { $data = $this->wooOrderState($order, $new_status, $old_status); $items_data = []; $order_items = $order->get_items(); foreach ($order_items as $order_item) { $product = $order_item->get_product(); if ($product) { $item_data = ["wp_unique_id" => Client::getUid() . '-' . (int) $order_item->get_id(), 'fulfillment_status' => $data['fulfillment_status'] ?? null, 'fulfilled_at' => $data['fulfilled_at'] ?? null]; $items_data[] = $item_data; } } return $items_data; } public function orderStatusToTimestampKey($newStatus) : string { $statusMap = ['processing' => 'processing_at', 'pending' => 'pending_payment_at', 'on-hold' => 'on_hold_at', 'completed' => 'completed_at', 'cancelled' => 'cancelled_at', 'refunded' => 'refunded_at', 'failed' => 'failed_at', 'checkout-draft' => 'draft_at']; if (!$statusMap[$newStatus]) { return 'any'; } return $statusMap[$newStatus]; } public function orderDataSave($order_id, $data) { $order_meta = Helper::arrayGet($data, 'order'); $order_item = Helper::arrayGet($data, 'order_items'); if (!$order_id) { return; } $order = wc_get_order($order_id); if (!$order) { return; } $order->update_meta_data('_rvx_order_value', $order_meta); $order->update_meta_data('_rvx_order_item_value', $order_item); $order->save(); } } HookManager.php 0000777 00000001153 15251327640 0007464 0 ustar 00 <?php namespace Rvx\Handlers; class HookManager { protected static $action; protected static $imported_products = []; public static function setAction($value) { self::$action = $value; } public static function getAction() { return self::$action; } public static function addImportedProduct($product) { self::$imported_products[] = $product; } public static function getImportedProducts() { return self::$imported_products; } public static function clearImportedProducts() { self::$imported_products = []; } }
| ver. 1.6 |
Github
|
.
| PHP 8.1.34 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка