event issue with Varnish cache. * * @since 3.9.1 deprecated * @since 2.9.5 * @author Remy Perona * * @param string $rules htaccess rules. * @return string Updated htaccess rules. */ function rocket_remove_html_expire_goddady( $rules ) { _deprecated_function( __FUNCTION__ . '()', '3.9.1', '\WP_Rocket\ThirdParty\Hostings\Godaddy::remove_html_expire_goddady' ); $rules = preg_replace( '@\s*#\s*Your document html@', '', $rules ); $rules = preg_replace( '@\s*ExpiresByType text/html\s*"access plus \d+ (seconds|minutes|hour|week|month|year)"@', '', $rules ); return $rules; } /** * Call the Varnish server to purge the cache with GoDaddy. * * @since 3.9.1 deprecated * @since 2.9.5 * * @return void */ function rocket_clean_domain_godaddy() { _deprecated_function( __FUNCTION__ . '()', '3.9.1', '\WP_Rocket\ThirdParty\Hostings\Godaddy::clean_domain_godaddy' ); rocket_godaddy_request( 'BAN' ); } /** * Call the Varnish server to purge a specific URL with GoDaddy. * * @since 3.9.1 deprecated * @since 2.9.5 * * @param string $url URL to purge. * @return void */ function rocket_clean_file_godaddy( $url ) { _deprecated_function( __FUNCTION__ . '()', '3.9.1', '\WP_Rocket\ThirdParty\Hostings\Godaddy::clean_file_godaddy' ); rocket_godaddy_request( 'PURGE', home_url( $url ) ); } /** * Call the Varnish server to purge the home with GoDaddy. * * @since 3.9.1 deprecated * @since 2.9.5 * * @param string $root root URL. * @param string $lang language code. * @return void */ function rocket_clean_home_godaddy( $root, $lang ) { _deprecated_function( __FUNCTION__ . '()', '3.9.1', '\WP_Rocket\ThirdParty\Hostings\Godaddy::clean_home_godaddy' ); $home_url = trailingslashit( get_rocket_i18n_home_url( $lang ) ); $home_pagination_url = $home_url . trailingslashit( $GLOBALS['wp_rewrite']->pagination_base ); rocket_godaddy_request( 'PURGE', $home_url ); rocket_godaddy_request( 'PURGE', $home_pagination_url ); } /** * Perform the call to the Varnish server to purge * * @since 3.9.1 deprecated * @since 2.9.5 * @source WPaaS\Cache * * @param string $method can be BAN or PURGE. * @param string $url URL to purge. * @return void */ function rocket_godaddy_request( $method, $url = null ) { _deprecated_function( __FUNCTION__ . '()', '3.9.0.4', '\WP_Rocket\ThirdParty\Hostings\Godaddy::godaddy_request' ); if ( ! method_exists( 'WPaas\Plugin', 'vip' ) ) { return; } if ( empty( $url ) ) { $url = home_url(); } $host = rocket_extract_url_component( $url, PHP_URL_HOST ); $url = set_url_scheme( str_replace( $host, WPaas\Plugin::vip(), $url ), 'http' ); wp_cache_flush(); // This forces the APC cache to flush across the server. update_option( 'gd_system_last_cache_flush', time() ); wp_remote_request( esc_url_raw( $url ), [ 'method' => $method, 'blocking' => false, 'headers' => [ 'Host' => $host, ], ] ); } eopress-pro'); case 'duration': return __("Video Duration (recommended)", 'wp-seopress-pro'); case 'rating': return __("Video Rating", 'wp-seopress-pro'); case 'view_count': return __("View count", 'wp-seopress-pro'); } } protected function getDescriptionByField($field){ switch($field){ case 'url': case 'view_count': return ''; case 'title': return __('Default: title tag, if not available, post title.', 'wp-seopress-pro'); case 'desc': return __('2048 characters max.; default: meta description. If not available, use the beginning of the post content.', 'wp-seopress-pro'); case 'thumbnail': return __('Minimum size: 160x90px (1920x1080 max), JPG, PNG or GIF formats. Default: your post featured image.', 'wp-seopress-pro'); case 'tag': return __('32 tags max., separate tags with commas. Default: target keywords + post tags if available.', 'wp-seopress-pro'); case 'internal_video_meta'; return __('The video will be available only to users with SafeSearch turned off.?', 'wp-seopress-pro'); case 'duration': return __("The duration of the video in seconds. Value must be between 0 and 28800 (8 hours).", 'wp-seopress-pro'); case 'rating': return __("Allowed values are float numbers in the range 0.0 to 5.0.", 'wp-seopress-pro'); } } /** * @since 5.1.0 */ public function processGet(\WP_REST_Request $request) { $id = $request->get_param('id'); $videos = get_post_meta($id, '_seopress_video', true); $fieldsVideo = [ 'url', 'internal_video', 'title', 'desc', 'thumbnail', 'duration', 'rating', 'view_count', 'tag', 'family_friendly', ]; $dataVideos = []; foreach ($videos as $keyVideo => $video) { foreach ($video as $key => $value) { $field = [ 'key' => $key, 'type' => $this->getTypeByField($key), 'label' => $this->getLabelByField($key), 'value' => $value, 'description' => $this->getDescriptionByField($key), 'visible' => true ]; if($key === 'rating'){ $field['step'] = 0.1; $field['min'] = 0; $field['max'] = 5; } $dataVideos[$keyVideo][] = $field; } } foreach($fieldsVideo as $key=> $field){ $bindField = [ 'key' => $field, 'type' => $this->getTypeByField($field), 'label' => $this->getLabelByField($field), 'value' => '', 'description' => $this->getDescriptionByField($field), 'visible' => true ]; if($field === 'rating'){ $bindField['step'] = 0.1; $bindField['min'] = 0; $bindField['max'] = 5; } $fieldsVideo[$key] = $bindField; } $data = [ [ 'key' => '_seopress_video_disabled', 'type' => 'checkbox', 'placeholder' => '', 'use_default' => '', 'default' => '', 'value' => !empty(get_post_meta($id, '_seopress_video_disabled', true)), 'label' => __('Exclude this post from Video Sitemap?', 'wp-seopress-pro'), 'visible' => true, 'description' => __('YouTube videos are automatically added when you create / save a post, page or post type. If your post is set to noindex, it will be automatically excluded from the sitemap.', 'wp-seopress-pro'), ], [ 'key' => 'videos', 'visible' => true, 'type' => 'repeater', 'data' => $dataVideos ] ]; return new \WP_REST_Response(["data" => $data, "fields_video" => $fieldsVideo]); } } ( 'Center', 'js_composer' ) => 'center', ), 'heading' => esc_html__( 'Alignment', 'js_composer' ), 'description' => esc_html__( 'Select accordion section title alignment.', 'js_composer' ), ), array( 'type' => 'dropdown', 'param_name' => 'autoplay', 'value' => array( esc_html__( 'None', 'js_composer' ) => 'none', '1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5', '10' => '10', '20' => '20', '30' => '30', '40' => '40', '50' => '50', '60' => '60', ), 'std' => 'none', 'heading' => esc_html__( 'Autoplay', 'js_composer' ), 'description' => esc_html__( 'Select auto rotate for accordion in seconds (Note: disabled by default).', 'js_composer' ), ), array( 'type' => 'checkbox', 'param_name' => 'collapsible_all', 'heading' => esc_html__( 'Allow collapse all?', 'js_composer' ), 'description' => esc_html__( 'Allow collapse all accordion sections.', 'js_composer' ), ), // Control Icons array( 'type' => 'dropdown', 'param_name' => 'c_icon', 'value' => array( esc_html__( 'None', 'js_composer' ) => '', esc_html__( 'Chevron', 'js_composer' ) => 'chevron', esc_html__( 'Plus', 'js_composer' ) => 'plus', esc_html__( 'Triangle', 'js_composer' ) => 'triangle', ), 'std' => 'plus', 'heading' => esc_html__( 'Icon', 'js_composer' ), 'description' => esc_html__( 'Select accordion navigation icon.', 'js_composer' ), ), array( 'type' => 'dropdown', 'param_name' => 'c_position', 'value' => array( esc_html__( 'Default', 'js_composer' ) => 'default', esc_html__( 'Left', 'js_composer' ) => 'left', esc_html__( 'Right', 'js_composer' ) => 'right', ), 'dependency' => array( 'element' => 'c_icon', 'not_empty' => true, ), 'heading' => esc_html__( 'Position', 'js_composer' ), 'description' => esc_html__( 'Select accordion navigation icon position.', 'js_composer' ), ), // Control Icons END array( 'type' => 'textfield', 'param_name' => 'active_section', 'heading' => esc_html__( 'Active section', 'js_composer' ), 'value' => 1, 'description' => esc_html__( 'Enter active section number (Note: to have all sections closed on initial load enter non-existing number).', 'js_composer' ), ), vc_map_add_css_animation(), array( 'type' => 'el_id', 'heading' => esc_html__( 'Element ID', 'js_composer' ), 'param_name' => 'el_id', 'description' => sprintf( esc_html__( 'Enter element ID (Note: make sure it is unique and valid according to %1$sw3c specification%2$s).', 'js_composer' ), '', '' ), ), array( 'type' => 'textfield', 'heading' => esc_html__( 'Extra class name', 'js_composer' ), 'param_name' => 'el_class', 'description' => esc_html__( 'If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'js_composer' ), ), array( 'type' => 'css_editor', 'heading' => esc_html__( 'CSS box', 'js_composer' ), 'param_name' => 'css', 'group' => esc_html__( 'Design Options', 'js_composer' ), ), ), 'js_view' => 'VcBackendTtaAccordionView', 'custom_markup' => '
', 'default_content' => '[vc_tta_section title="' . sprintf( '%s %d', esc_html__( 'Section', 'js_composer' ), 1 ) . '"][/vc_tta_section][vc_tta_section title="' . sprintf( '%s %d', esc_html__( 'Section', 'js_composer' ), 2 ) . '"][/vc_tta_section]', );