Skip to content

Commit

Permalink
Transient name sent has boolean instead of string #11
Browse files Browse the repository at this point in the history
  • Loading branch information
iworks committed Nov 20, 2023
1 parent 1066a03 commit c801075
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
12 changes: 6 additions & 6 deletions includes/iworks/class-iworks-opengraph.php
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,10 @@ public function wp_head() {
*
* @param integer expire time, default DAY_IN_SECONDS
*/
if ( ! empty( $og ) ) {
if (
! empty( $og )
&& ! $this->debug
) {
set_transient( $cache_key, $og, apply_filters( 'og_set_transient_expiration', DAY_IN_SECONDS ) );
}
} else {
Expand Down Expand Up @@ -979,7 +982,7 @@ public function wp_head() {
*
* @since 2.9.3
*/
foreach ( $og as $key => $data ) {
foreach ( $og as $key => $data ) {
$og[ $key ] = apply_filters( 'og_' . $key . '_array', $data );
}
/**
Expand Down Expand Up @@ -1128,7 +1131,7 @@ private function echo_one( $property, $value, $name = 'property' ) {
/**
* filter name
*/
$filter_name = sprintf( 'og_%s_value', $property_filter_string );
$filter_name = sprintf( 'og_%s_value', $property_filter_string );
/**
* Filter value of single meta
*
Expand Down Expand Up @@ -1270,9 +1273,6 @@ private function get_attachment_id( $url ) {
* @since 2.6.0
*/
private function get_transient_key( $post_id ) {
if ( $this->debug ) {
return false;
}
$key = sprintf( 'og_%d_%s', $post_id, $this->version );
$locale = $this->get_locale();
if ( ! empty( $locale ) ) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"title": "OG — Better Share on Social Media",
"tagline": "The simple method to add Open Graph metadata to your entries so that they look great when shared on sites.",
"description": "Very tiny Open Graph plugin - add featured image as facebook image. This plugin do not have any configuration - you can check how it works looking into page source.",
"version": "3.2.4",
"version": "3.2.5",
"homepage": "http://og.iworks.pl/",
"author": [
{
Expand Down
3 changes: 3 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ Thank you for wanting to make OG better for everyone!

Project maintained on github at [iworks/og](https://github.com/iworks/og).

= 3.2.5 (2023-11-20) =
* When a site was in debug mode, the `set_transient()` function was called improperly. It has been fixed. Props for [X-Raym](https://wordpress.org/support/users/x-raym/) & [John Blackbourn](https://wordpress.org/support/users/johnbillion/).

= 3.2.4 (2023-11-02) =
* Schema "tagline" has been removed by default. Use the `og_allow_to_use_schema_tagline` filter to turn it on (not recommended).

Expand Down

0 comments on commit c801075

Please sign in to comment.