Changeset 3137890
- Timestamp:
- 08/20/2024 02:28:25 AM (17 months ago)
- Location:
- ryviu
- Files:
-
- 8 edited
-
tags/3.1.25/includes/class-ryviu.php (modified) (1 diff)
-
tags/3.1.25/includes/functions.php (modified) (2 diffs)
-
tags/3.1.25/includes/ryviu-api-controller.php (modified) (5 diffs)
-
tags/3.1.25/ryviu.php (modified) (1 diff)
-
trunk/includes/class-ryviu.php (modified) (1 diff)
-
trunk/includes/functions.php (modified) (2 diffs)
-
trunk/includes/ryviu-api-controller.php (modified) (5 diffs)
-
trunk/ryviu.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
ryviu/tags/3.1.25/includes/class-ryviu.php
r3134663 r3137890 37 37 include_once RYVIU_DIR_PATH . 'includes/functions.php'; 38 38 include_once RYVIU_DIR_PATH . 'includes/woo-hooks.php'; 39 include_once RYVIU_DIR_PATH . 'includes/class-ryviu-hook.php'; 39 40 } 40 41 -
ryviu/tags/3.1.25/includes/functions.php
r3133949 r3137890 225 225 echo "<div class=\"lt-block-reviews\"><questions-answers handle=\"$product_handle\"></questions-answers></div>"; 226 226 } 227 } 228 } 229 230 function ryviu_badge_section(){ 231 $featured_ryviu_data = get_option( 'featured_ryviu_data' ); 232 if($featured_ryviu_data){ 233 echo '<ryviu-feature-extend reviews_badge="1" reviews_data="'.$featured_ryviu_data.'"></ryviu-feature-extend>'; 234 }else{ 235 echo '<ryviu-feature-extend reviews_badge="1"></ryviu-feature-extend>'; 227 236 } 228 237 } … … 762 771 763 772 add_shortcode( 'ryviu_question_and_answer', 'question_and_answer_func' ); 773 774 // Reviews Badge shortcode 775 776 function ryviu_badge_func( $atts ) { 777 778 ob_start(); 779 780 ryviu_badge_section(); 781 782 return ob_get_clean(); 783 } 784 785 add_shortcode( 'ryviu_badge', 'ryviu_badge_func' ); -
ryviu/tags/3.1.25/includes/ryviu-api-controller.php
r3131432 r3137890 32 32 public function __construct(){ 33 33 RyviuApiController::_header(); 34 include_once RYVIU_DIR_PATH . 'includes/common-functions.php'; 34 35 } 35 36 … … 145 146 if($product_id && $meta_key){ 146 147 self::updateProductMetafield($product_id, $meta_key, $meta_value); 147 self::clearWpCache();148 CommonFunctions::clearStoreCache(); 148 149 }else{ 149 150 wp_die( 'Empty product ID or meta key', 'Request Error' ); … … 157 158 158 159 if($settings){ 159 self::updateSettings( 'ryviu_client_settings', json_decode($settings));160 self::clearWpCache();160 CommonFunctions::updateSettings('ryviu_client_settings', json_decode($settings)); 161 CommonFunctions::clearStoreCache(); 161 162 } 162 163 163 164 if($key_id){ 164 self::updateSettings( 'ryviu_user_api_key_id', $key_id);165 self::clearWpCache();165 CommonFunctions::updateSettings('ryviu_user_api_key_id', $key_id); 166 CommonFunctions::clearStoreCache(); 166 167 } 167 168 … … 172 173 } 173 174 174 // Clear Plugin Cache175 176 public static function clearWpCache() {177 178 global $wp_fastest_cache;179 180 if ( function_exists( 'rocket_clean_domain' ) ) { // WP Rocket181 rocket_clean_domain();182 }183 184 if ( function_exists( 'wp_cache_flush' ) ) {185 wp_cache_flush();186 }187 188 // Purge entire WP Rocket cache.189 if (class_exists('\LiteSpeed\Purge')) {190 \LiteSpeed\Purge::purge_all();191 }192 193 if ( function_exists( 'wp_cache_clear_cache' ) ) { // WP Super Cache194 wp_cache_clear_cache();195 }196 197 if ( function_exists( 'w3tc_flush_posts' ) ) { // W3 Total Cache198 w3tc_flush_posts();199 }200 if ( has_action( 'ce_clear_cache' ) ) { // Cache Enabler201 do_action( 'ce_clear_cache' );202 }203 if ( class_exists( 'Breeze_PurgeCache' ) ) { // Breeze204 if ( method_exists( 'Breeze_PurgeCache', 'breeze_cache_flush' ) ) {205 Breeze_PurgeCache::breeze_cache_flush();206 }207 }208 209 if ( class_exists( 'Swift_Performance_Cache' ) ) {210 if ( method_exists( 'Swift_Performance_Cache', 'clear_all_cache' ) ) {211 Swift_Performance_Cache::clear_all_cache();212 }213 }214 215 if ( method_exists( 'WpFastestCache', 'deleteCache' ) && ! empty( $wp_fastest_cache ) ) { // WP Fastest Cache216 $wp_fastest_cache->deleteCache();217 }218 219 if ( class_exists( 'WpeCommon' ) ) { // Autoptimize220 if ( method_exists( 'WpeCommon', 'purge_memcached' ) ) {221 WpeCommon::purge_memcached();222 }223 if ( method_exists( 'WpeCommon', 'clear_maxcdn_cache' ) ) {224 WpeCommon::clear_maxcdn_cache();225 }226 if ( method_exists( 'WpeCommon', 'purge_varnish_cache' ) ) {227 WpeCommon::purge_varnish_cache();228 }229 }230 231 if ( function_exists('sg_cachepress_purge_cache') ) { // SGOptimzer232 sg_cachepress_purge_cache();233 }234 }235 175 /** 236 176 * Update product metafield … … 244 184 } 245 185 } 246 247 248 /**249 * Update settings250 *251 * @param Request object $request Data.252 * @return JSON data253 */254 public static function updateSettings($option_key, $option_value){255 update_option($option_key, $option_value);256 }257 258 186 259 187 /** -
ryviu/tags/3.1.25/ryviu.php
r3133949 r3137890 42 42 define('RYVIU_URL_ASSETS', plugins_url( 'assets/', __FILE__ ) ); 43 43 define('RYVIU_APP_HOOK_URL', 'https://app.ryviu.io/webhook/woocommerce/'); 44 define('RYVIU_NAMESPACE', 'ryviu/v1'); 44 45 45 46 add_action( 'before_woocommerce_init', function() { -
ryviu/trunk/includes/class-ryviu.php
r3134663 r3137890 37 37 include_once RYVIU_DIR_PATH . 'includes/functions.php'; 38 38 include_once RYVIU_DIR_PATH . 'includes/woo-hooks.php'; 39 include_once RYVIU_DIR_PATH . 'includes/class-ryviu-hook.php'; 39 40 } 40 41 -
ryviu/trunk/includes/functions.php
r3133949 r3137890 225 225 echo "<div class=\"lt-block-reviews\"><questions-answers handle=\"$product_handle\"></questions-answers></div>"; 226 226 } 227 } 228 } 229 230 function ryviu_badge_section(){ 231 $featured_ryviu_data = get_option( 'featured_ryviu_data' ); 232 if($featured_ryviu_data){ 233 echo '<ryviu-feature-extend reviews_badge="1" reviews_data="'.$featured_ryviu_data.'"></ryviu-feature-extend>'; 234 }else{ 235 echo '<ryviu-feature-extend reviews_badge="1"></ryviu-feature-extend>'; 227 236 } 228 237 } … … 762 771 763 772 add_shortcode( 'ryviu_question_and_answer', 'question_and_answer_func' ); 773 774 // Reviews Badge shortcode 775 776 function ryviu_badge_func( $atts ) { 777 778 ob_start(); 779 780 ryviu_badge_section(); 781 782 return ob_get_clean(); 783 } 784 785 add_shortcode( 'ryviu_badge', 'ryviu_badge_func' ); -
ryviu/trunk/includes/ryviu-api-controller.php
r3131432 r3137890 32 32 public function __construct(){ 33 33 RyviuApiController::_header(); 34 include_once RYVIU_DIR_PATH . 'includes/common-functions.php'; 34 35 } 35 36 … … 145 146 if($product_id && $meta_key){ 146 147 self::updateProductMetafield($product_id, $meta_key, $meta_value); 147 self::clearWpCache();148 CommonFunctions::clearStoreCache(); 148 149 }else{ 149 150 wp_die( 'Empty product ID or meta key', 'Request Error' ); … … 157 158 158 159 if($settings){ 159 self::updateSettings( 'ryviu_client_settings', json_decode($settings));160 self::clearWpCache();160 CommonFunctions::updateSettings('ryviu_client_settings', json_decode($settings)); 161 CommonFunctions::clearStoreCache(); 161 162 } 162 163 163 164 if($key_id){ 164 self::updateSettings( 'ryviu_user_api_key_id', $key_id);165 self::clearWpCache();165 CommonFunctions::updateSettings('ryviu_user_api_key_id', $key_id); 166 CommonFunctions::clearStoreCache(); 166 167 } 167 168 … … 172 173 } 173 174 174 // Clear Plugin Cache175 176 public static function clearWpCache() {177 178 global $wp_fastest_cache;179 180 if ( function_exists( 'rocket_clean_domain' ) ) { // WP Rocket181 rocket_clean_domain();182 }183 184 if ( function_exists( 'wp_cache_flush' ) ) {185 wp_cache_flush();186 }187 188 // Purge entire WP Rocket cache.189 if (class_exists('\LiteSpeed\Purge')) {190 \LiteSpeed\Purge::purge_all();191 }192 193 if ( function_exists( 'wp_cache_clear_cache' ) ) { // WP Super Cache194 wp_cache_clear_cache();195 }196 197 if ( function_exists( 'w3tc_flush_posts' ) ) { // W3 Total Cache198 w3tc_flush_posts();199 }200 if ( has_action( 'ce_clear_cache' ) ) { // Cache Enabler201 do_action( 'ce_clear_cache' );202 }203 if ( class_exists( 'Breeze_PurgeCache' ) ) { // Breeze204 if ( method_exists( 'Breeze_PurgeCache', 'breeze_cache_flush' ) ) {205 Breeze_PurgeCache::breeze_cache_flush();206 }207 }208 209 if ( class_exists( 'Swift_Performance_Cache' ) ) {210 if ( method_exists( 'Swift_Performance_Cache', 'clear_all_cache' ) ) {211 Swift_Performance_Cache::clear_all_cache();212 }213 }214 215 if ( method_exists( 'WpFastestCache', 'deleteCache' ) && ! empty( $wp_fastest_cache ) ) { // WP Fastest Cache216 $wp_fastest_cache->deleteCache();217 }218 219 if ( class_exists( 'WpeCommon' ) ) { // Autoptimize220 if ( method_exists( 'WpeCommon', 'purge_memcached' ) ) {221 WpeCommon::purge_memcached();222 }223 if ( method_exists( 'WpeCommon', 'clear_maxcdn_cache' ) ) {224 WpeCommon::clear_maxcdn_cache();225 }226 if ( method_exists( 'WpeCommon', 'purge_varnish_cache' ) ) {227 WpeCommon::purge_varnish_cache();228 }229 }230 231 if ( function_exists('sg_cachepress_purge_cache') ) { // SGOptimzer232 sg_cachepress_purge_cache();233 }234 }235 175 /** 236 176 * Update product metafield … … 244 184 } 245 185 } 246 247 248 /**249 * Update settings250 *251 * @param Request object $request Data.252 * @return JSON data253 */254 public static function updateSettings($option_key, $option_value){255 update_option($option_key, $option_value);256 }257 258 186 259 187 /** -
ryviu/trunk/ryviu.php
r3133949 r3137890 42 42 define('RYVIU_URL_ASSETS', plugins_url( 'assets/', __FILE__ ) ); 43 43 define('RYVIU_APP_HOOK_URL', 'https://app.ryviu.io/webhook/woocommerce/'); 44 define('RYVIU_NAMESPACE', 'ryviu/v1'); 44 45 45 46 add_action( 'before_woocommerce_init', function() {
Note: See TracChangeset
for help on using the changeset viewer.