Plugin Directory

Changeset 2549572


Ignore:
Timestamp:
06/17/2021 09:10:19 AM (5 years ago)
Author:
resoc
Message:

Version 1.0.7

Location:
resoc/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • resoc/trunk/README.txt

    r2549439 r2549572  
    55Requires at least: 5.0
    66Tested up to: 5.7.2
    7 Stable tag: 1.0.6
     7Stable tag: 1.0.7
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    8181== Changelog ==
    8282
     83= 1.0.7 =
     84* Compatibility with SEOPress
     85
    8386= 1.0.6 =
    8487* More explicit message on settings change
  • resoc/trunk/includes/class-resoc-compatibility.php

    r2548886 r2549572  
    2929  public static function is_aiosp_active() {
    3030    return is_plugin_active( 'all-in-one-seo-pack/all_in_one_seo_pack.php' );
     31  }
     32
     33  public static function is_seopress_active() {
     34    return is_plugin_active( 'wp-seopress/seopress.php' );
    3135  }
    3236
  • resoc/trunk/public/class-resoc-public.php

    r2548884 r2549572  
    6969      );
    7070    }
     71    else if ( Resoc_Compatibility::is_seopress_active() ) {
     72      add_filter(
     73        'seopress_social_og_thumb',
     74        array( $this, 'override_seopress_image' ),
     75        10, 1
     76      );
     77    }
    7178    else {
    7279      $conflicting_plugin = Resoc_Compatibility::conflicting_plugin();
     
    114121
    115122    return $facebookMeta;
     123  }
     124
     125  public function override_seopress_image( $seopress_image ) {
     126    $specific_image_id = get_post_meta( get_the_ID(), Resoc::POST_META_OG_IMAGE_ID, true );
     127
     128    if ( $specific_image_id ) {
     129      $image_data = wp_get_attachment_metadata( $specific_image_id );
     130
     131      if ( is_array( $image_data ) ) {
     132        $image_data['url'] = wp_get_attachment_image_url( $specific_image_id, 'full' );
     133
     134        $resoc_image = '<meta property="og:image" value="' . esc_attr( $image_data['url'] ) . '" />' . "\n";
     135
     136        if ( $image_data['width'] && $image_data['height'] ) {
     137          $resoc_image .= '<meta property="og:image:width" value="' . esc_attr( $image_data['width'] ) . '" />' . "\n";
     138          $resoc_image .= '<meta property="og:image:height" value="' . esc_attr( $image_data['height'] ) . '" />' . "\n";
     139        }
     140
     141        return $resoc_image;
     142      }
     143    }
     144
     145    return $seopress_image;
    116146  }
    117147
  • resoc/trunk/resoc.php

    r2549439 r2549572  
    1717 * Plugin URI:        https://resoc.io/resoc-uri/
    1818 * Description:       This is a short description of what the plugin does. It's displayed in the WordPress admin area.
    19  * Version:           1.0.6
     19 * Version:           1.0.7
    2020 * Author:            Resoc
    2121 * Author URI:        https://resoc.io/
     
    3636 * Rename this for your plugin and update it as you release new versions.
    3737 */
    38 define( 'RESOC_VERSION', '1.0.6' );
     38define( 'RESOC_VERSION', '1.0.7' );
    3939
    4040/**
Note: See TracChangeset for help on using the changeset viewer.