' . esc_html__( 'Bulk Generate', 'plus-webp' ) . ''; } return $links; } /** ================================================== * Settings page * * @since 1.00 */ public function plugin_menu() { add_management_page( 'Plus WebP', 'Plus WebP', 'manage_options', 'pluswebp', array( $this, 'plugin_options' ) ); } /** ================================================== * Add Css and Script * * @since 1.00 */ public function load_custom_wp_admin_style() { if ( $this->is_my_plugin_screen() ) { wp_enqueue_style( 'jquery-responsiveTabs', plugin_dir_url( __DIR__ ) . 'css/responsive-tabs.css', array(), '1.4.0' ); wp_enqueue_style( 'jquery-responsiveTabs-style', plugin_dir_url( __DIR__ ) . 'css/style.css', array(), '1.4.0' ); wp_enqueue_script( 'jquery' ); wp_enqueue_script( 'jquery-responsiveTabs', plugin_dir_url( __DIR__ ) . 'js/jquery.responsiveTabs.min.js', array(), '1.4.0', false ); wp_enqueue_script( 'pluswebp-admin-js', plugin_dir_url( __DIR__ ) . 'js/jquery.pluswebp.admin.js', array( 'jquery' ), array(), '1.00', false ); } } /** ================================================== * For only admin style * * @since 1.00 */ private function is_my_plugin_screen() { $screen = get_current_screen(); if ( is_object( $screen ) && 'tools_page_pluswebp' === $screen->id ) { return true; } else { return false; } } /** ================================================== * Settings page * * @since 1.00 */ public function plugin_options() { if ( ! current_user_can( 'manage_options' ) ) { wp_die( esc_html__( 'You do not have sufficient permissions to access this page.' ) ); } $pluswebp_settings = get_option( 'pluswebp' ); if ( isset( $_POST['Generatewebp'] ) && ! empty( $_POST['Generatewebp'] ) ) { if ( check_admin_referer( 'pwp_gnt', 'pluswebp_gnt' ) ) { if ( ! empty( $pluswebp_settings['types'] ) ) { $user = wp_get_current_user(); $to = $user->user_email; $userid = $user->ID; if ( ! wp_next_scheduled( 'AllImagesRegenerateHook', array( $to ) ) ) { /* 30seconds */ wp_schedule_single_event( time() + 30, 'AllImagesRegenerateHook', array( $to ) ); echo '
'; } else { echo '
'; } } else { echo '
'; } } } $this->options_updated(); $scriptname = admin_url( 'tools.php?page=pluswebp' ); ?>

Plus WebP

/>

>

credit(); ?>
'Plugin Name', 'version' => 'Version', ) ); if ( array_key_exists( 'name', $plugin_datas ) && ! empty( $plugin_datas['name'] ) && array_key_exists( 'version', $plugin_datas ) && ! empty( $plugin_datas['version'] ) ) { $plugin_name = $plugin_datas['name']; $plugin_ver_num = $plugin_datas['version']; break; } } } } $plugin_version = __( 'Version:' ) . ' ' . $plugin_ver_num; /* translators: FAQ Link & Slug */ $faq = sprintf( esc_html__( 'https://wordpress.org/plugins/%s/faq', '%s' ), $slug ); $support = 'https://wordpress.org/support/plugin/' . $slug; $review = 'https://wordpress.org/support/view/plugin-reviews/' . $slug; $translate = 'https://translate.wordpress.org/projects/wp-plugins/' . $slug; $facebook = 'https://www.facebook.com/katsushikawamori/'; $twitter = 'https://twitter.com/dodesyo312'; $youtube = 'https://www.youtube.com/channel/UC5zTLeyROkvZm86OgNRcb_w'; $donate = sprintf( esc_html__( 'https://shop.riverforest-wp.info/donate/', '%s' ), $slug ); ?>
| | |
| | |

Plugin Author Katsushi Kawamori
plus_webp_mime_type = 'AND post_mime_type IN (' . $mime_types . ')'; $post_ids = $wpdb->get_col( " SELECT ID FROM $wpdb->posts WHERE post_type = 'attachment' $wpdb->plus_webp_mime_type AND post_status = 'inherit' " ); if ( ! empty( $post_ids ) ) { delete_option( 'pluswebp_generate' ); include_once ABSPATH . 'wp-admin/includes/image.php'; /* Generate WebP */ foreach ( $post_ids as $attach_id ) { $metadata = wp_get_attachment_metadata( $attach_id ); do_action( 'wp_generate_attachment_metadata', $metadata, $attach_id ); } /* Mail send */ do_action( 'pluswebp_mail_send', $to ); } else { ?>
'; function( $value ) { return sanitize_text_field( $value ); }, ] ); foreach ( $tmps as $key => $value ) { $list_types[] = $key; } $pluswebp_settings['types'] = $list_types; } else { $pluswebp_settings['types'] = $list_types; } if ( isset( $_POST['replace'] ) && ! empty( $_POST['replace'] ) ) { $pluswebp_settings['replace'] = true; } else { $pluswebp_settings['replace'] = false; } if ( isset( $_POST['quality'] ) ) { $pluswebp_settings['quality'] = intval( $_POST['quality'] ); } update_option( 'pluswebp', $pluswebp_settings ); echo '
'; } } } /** ================================================== * Generate notice * * @since 1.09 */ public function generate_notice() { if ( get_option( 'pluswebp_generate_mail' ) ) { $pluswebp_mail_send = get_option( 'pluswebp_generate_mail' ); if ( 0 < $pluswebp_mail_send['count'] ) { ?>