Plugin Directory

Changeset 3435289


Ignore:
Timestamp:
01/08/2026 04:23:58 PM (3 months ago)
Author:
david.kane
Message:

Releasing v2.27.0

Location:
supapress/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • supapress/trunk/admin/views/add-edit-partials/content.php

    r2389550 r3435289  
    3030    <div class="hide bulk lookup-source-input supapress-field-wrapper">
    3131        <label class="supapress-label" for="isbn_lookup_bulk"><?php _e( 'Enter ISBN(s):', 'supapress' ); ?></label>
    32         <textarea name="isbn_lookup_bulk" class="supapress-input" id="isbn_lookup_bulk" type="text" data-ajax-url="<?php echo admin_url('admin-ajax.php'); ?>" placeholder="Enter product ISBN(s) - one per line or comma separated"></textarea>
     32        <textarea name="isbn_lookup_bulk" class="supapress-input" id="isbn_lookup_bulk" type="text" data-ajax-url="<?php echo admin_url('admin-ajax.php'); ?>" placeholder="Enter product ISBN(s) - one per line or comma separated. Maximum 550 ISBNs allowed."></textarea>
    3333        <a id="supapress-add-bulk-isbns-button"><?php _e( 'Add ISBN(s)', 'supapress' ); ?></a>
    3434    </div>
  • supapress/trunk/admin/views/add-edit-partials/elements.php

    r3221654 r3435289  
    505505        echo supapress_get_toggle_field( __( 'Subtitle', 'supapress' ), 'show_subtitle', $properties );
    506506        echo supapress_get_toggle_field( __( 'Author name', 'supapress' ), 'show_author', $properties, '', $action );
    507         echo supapress_get_toggle_field( __( 'Author bio', 'supapress' ), 'show_author_bio', $properties );
     507        echo supapress_get_toggle_field( __( 'Author bio', 'supapress' ), 'show_author_bio', $properties, 'product_details' );
    508508        echo supapress_get_toggle_field( __( 'Edition', 'supapress' ), 'show_edition', $properties );
    509509        echo supapress_get_toggle_field( __( 'Format', 'supapress' ), 'show_format', $properties );
  • supapress/trunk/composer.json

    r3397928 r3435289  
    33  "description": "Quickly and easily connect your book metadata (ONIX) to your WordPress site.",
    44  "type": "wordpress-plugin",
    5   "version": "2.26.9",
     5  "version": "2.27.0",
    66  "authors": [
    77    {
  • supapress/trunk/includes/functions.php

    r3397928 r3435289  
    807807}
    808808
     809/**
     810 * @param $field
     811 * @param $value
     812 *
     813 * @return false|mixed|string|void|null
     814 *
     815 */
     816
     817 function supapress_override_seo_field( $field = '', $value = '' ) {
     818
     819    $book_details_pages_array = get_option( 'widget_book_link_page' );
     820
     821    // test if book details page has been set, or if on full details page
     822    if( $book_details_pages_array === false || in_array( get_the_ID(), $book_details_pages_array ) === false ) {
     823        return;
     824    }
     825
     826    // check that the ISBN is set
     827    $isbn = get_query_var('supapress_isbn');
     828    if (!preg_match('/\d{13}$/', $isbn)) {
     829        return;
     830    }
     831
     832    $extractedParams = supapress_extract_params_for_seo( get_the_ID() );
     833
     834    $result = supapress_call_supafolio( 'book/' . get_query_var( 'supapress_isbn' ), $extractedParams );
     835
     836    return supapress_run_seo_filters($result, $field);
     837
     838}
     839add_action('get_header', 'supapress_override_seo_field');
     840
    809841/** @type SupaPress_Book $supapress */
    810842function supapress_run_seo_filters($result, $field = '') {
     
    897929
    898930    if( $field !== '' ) {
    899 
    900         /**
    901          * the below logic is included to maintain old functionality:
    902          *
    903          * the function supapress_call_supafolio_by_isbn_full_details() can also be used within a Yoast Hook:
    904          *
    905          * For example:
    906          *
    907          * add_filter( 'wpseo_title', function ( $title ) {
    908          *  return supapress_call_supafolio_by_isbn_full_details( 'title', $title );
    909          * }, 15, 3 );
    910          *
    911          * however this will make a Supafolio call for each Yoast Hook that gets run
    912          *
    913          */
    914 
    915931        if( $field === 'title' ) {
    916932            return $supapress_seo_override_title( $field );
     
    936952
    937953    supapress_run_canonical_redirect($supapress_seo_override_url( $field ));
    938 
     954    echo supapress_book_schema($supapress);
     955}
     956
     957function supapress_book_schema($supapress) {
     958    if (empty($supapress) || is_string($supapress)) {
     959        return '';
     960    }
     961
     962    $isbn13 = $supapress->get_isbn13() ?? "";
     963    $bookTitle = $supapress->get_title() ?? "";
     964    $coverImage = $supapress->get_cover() ?? "";
     965    $contributors = $supapress->get_author_text() ?? "";
     966
     967    if ($coverImage) {
     968        $coverImage = preg_replace('/([?&])w=\d+/', '$1w=1500', $coverImage, -1, $count);
     969
     970        if (!$count) {
     971            $coverImage .= (strpos($coverImage, '?') === false ? '?' : '&') . 'w=1500';
     972        }
     973    }
     974
     975    $schema = apply_filters(
     976        'supapress_schema',
     977        [
     978            "@context" => "https://schema.org",
     979            "@type"    => "Book",
     980            "name"     => $bookTitle,
     981            "isbn"     => $isbn13,
     982            "author"   => [
     983                "@type" => "Person",
     984                "name"  => $contributors,
     985            ],
     986            "image"    => [
     987                "@type" => "ImageObject",
     988                "url"   => $coverImage,
     989            ],
     990        ],
     991        $supapress
     992    );
     993
     994    if( empty( $schema ) ) {
     995        return '';
     996    }
     997
     998    return '<script type="application/ld+json">' . json_encode($schema, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) . '</script>';
    939999}
    9401000
     
    9571017        exit();
    9581018    }
    959 }
    960 
    961 
    962 /**
    963  * @param $field
    964  * @param $value
    965  *
    966  * @return false|mixed|string|void|null
    967  *
    968  */
    969 
    970 function supapress_override_seo_field( $field = '', $value = '' ) {
    971 
    972     $book_details_pages_array = get_option( 'widget_book_link_page' );
    973 
    974     // test if book details page has been set, or if on full details page
    975     if( $book_details_pages_array === false || in_array( get_the_ID(), $book_details_pages_array ) === false ) {
    976         return;
    977     }
    978 
    979     // check that the ISBN is set
    980     $isbn = get_query_var('supapress_isbn');
    981     if (!preg_match('/\d{13}$/', $isbn)) {
    982         return;
    983     }
    984 
    985     $extractedParams = supapress_extract_params_for_seo( get_the_ID() );
    986 
    987     $result = supapress_call_supafolio( 'book/' . get_query_var( 'supapress_isbn' ), $extractedParams );
    988 
    989     return supapress_run_seo_filters($result, $field);
    990 
    991 }
    992 
    993 add_action('get_header', 'supapress_override_seo_field');
    994 
    995 
    996 /**
    997  * @param $field
    998  * @param $value
    999  *
    1000  * @return false|mixed|string|void|null
    1001  *
    1002  * the below function is depreciated. use the supapress_override_seo_field function run seo hooks
    1003  *
    1004  */
    1005 
    1006 function supapress_call_supafolio_by_isbn_full_details( $field, $value ) {
    1007     return supapress_override_seo_field( $field );
    10081019}
    10091020
  • supapress/trunk/readme.txt

    r3397928 r3435289  
    33Tags: supadü, supadu, folio, books, publishers, supafolio, supadu for wordpress, supapress, supafolio for wordpress
    44Requires at least: 6.0
    5 Tested up to: 6.8.3
    6 Stable tag: 2.26.9
     5Tested up to: 6.9.0
     6Stable tag: 2.27.0
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3838
    3939== Changelog ==
     40
     41= 2.27.0 =
     42Release Date: Jan 2026
     43* Change: add book schema on product page
     44* Change: edit placeholder for isbn-lookup field
     45* Bug: author_bio check removed from isbn-lookup modules
    4046
    4147= 2.26.9 =
  • supapress/trunk/supapress.php

    r3397928 r3435289  
    77 * Plugin URI: https://www.supadu.com
    88 * Description: Quickly and easily connect your book metadata (ONIX) to your WordPress site.
    9  * Version: 2.26.9
     9 * Version: 2.27.0
    1010 * Author: Supadü
    1111 * Author URI: https://www.supadu.com
     
    3737defined( 'ABSPATH' ) or die( 'Illegal Access!' );
    3838
    39 define( 'SUPAPRESS_VERSION', '2.26.9' );
     39define( 'SUPAPRESS_VERSION', '2.27.0' );
    4040
    4141define( 'SUPAPRESS_SITE_URL', get_site_url() );
Note: See TracChangeset for help on using the changeset viewer.