Skip to content

Commit

Permalink
fix events sending IDs instad of URI; add compatibility with WPRM 8.10
Browse files Browse the repository at this point in the history
  • Loading branch information
ziodave committed Sep 19, 2023
1 parent 0ca21dd commit 7e90dc7
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 5 deletions.
24 changes: 24 additions & 0 deletions src/install/class-wordlift-install-3-49-2.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

/**
* @since 3.45.1
*/
class Wordlift_Install_3_49_2 extends Wordlift_Install {

/**
* {@inheritdoc}
*/
protected static $version = '3.49.2';

public function install() {

global $wpdb;

$wpdb->query( "DELETE FROM $wpdb->termmeta WHERE meta_key = 'wl_mentions_count'" );
$wpdb->query( "DELETE FROM $wpdb->termmeta WHERE meta_key = 'wl_about_count'" );
$wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_key = 'wl_mentions_count'" );
$wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_key = 'wl_about_count'" );

}

}
3 changes: 3 additions & 0 deletions src/install/class-wordlift-install-service.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ public function __construct() {
require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-3-44-4.php';
require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-3-45-0.php';
require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-3-45-1.php';
require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-3-49-2.php';

// Get the install services.
$this->installs = array(
Expand Down Expand Up @@ -127,6 +128,8 @@ public function __construct() {

new Wordlift_Install_3_45_0(),
new Wordlift_Install_3_45_1(),

new Wordlift_Install_3_49_2(),
);
self::$instance = $this;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ private function set_events_request( $jsonld_arr, $post_id ) {
$change_status = $this->update_counts_if_necessary_post( $jsonld_arr, $counts, $post_id );

if ( $change_status ) {
$this->send_api_request_post( $counts, $post_id );
$this->send_api_request_post( $counts, $permalink );
}

return $jsonld_arr;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function set_events_request( $data, $term_id, $context ) {
$change_status = $this->update_counts_if_necessary( $jsonld_arr, $counts, $term_id );

if ( $change_status ) {
$this->send_api_request( $counts, $term_id );
$this->send_api_request( $counts, $term_url );
}

return $data;
Expand Down
4 changes: 2 additions & 2 deletions src/modules/food-kg/includes/Preconditions.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ private function has_prerequisites() {

private function check_version() {
$check = version_compare( WPRM_VERSION, '8.1.0', '>=' )
&& version_compare( WPRM_VERSION, '8.9.3', '<' );
&& version_compare( WPRM_VERSION, '8.11.0', '<' );

if ( ! $check ) {
$this->notices->queue(
'warning',
/* translators: 1: minimum supported WPRM version, 2: maximum supported WPRM version, 3: Detected WP Recipe Maker version. */
sprintf( __( 'WordLift Food KG support requires WP Recipe Maker %1$s-%2$s, %3$s found.', 'wordlift' ), '8.1', '8.7', WPRM_VERSION )
sprintf( __( 'WordLift Food KG support requires WP Recipe Maker %1$s-%2$s, %3$s found.', 'wordlift' ), '8.1', '8.10', WPRM_VERSION )
);
}

Expand Down
5 changes: 5 additions & 0 deletions src/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@ You can open your datasets to the public, attaching to it a free or a commercial

== Changelog ==

= 3.49.2 (2023-09-19) =

* Events are sending IDs instead of URLs, squashed 💪
* Added WPRM 8.10 compatibility.

= 3.49.1 (2023-08-16) =

* Limit the increase of words in the structured data description property only to Products.
Expand Down
2 changes: 1 addition & 1 deletion src/wordlift.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
use Wordlift\Post\Post_Adapter;

define( 'WORDLIFT_PLUGIN_FILE', __FILE__ );
define( 'WORDLIFT_VERSION', '3.49.1' );
define( 'WORDLIFT_VERSION', '3.49.2' );

// ## DO NOT REMOVE THIS LINE: WHITELABEL PLACEHOLDER ##

Expand Down

0 comments on commit 7e90dc7

Please sign in to comment.