LezWatch.TV News and Information - Version 1.2.2

Version Description

  • March 2021 by Ipstenu
  • Fix bug with transients
  • Compat with PHP 8 and WP 5.7
Download this release

Release Info

Developer Ipstenu
Plugin Icon 128x128 LezWatch.TV News and Information
Version 1.2.2
Comparing to
See all releases

Code changes from version 1.2 to 1.2.2

Files changed (3) hide show
  1. changelog.txt +11 -1
  2. lezwatchtv-main.php +153 -124
  3. readme.txt +25 -13
changelog.txt CHANGED
@@ -1,4 +1,14 @@
1
- === 1.0.0 ===
 
 
 
 
 
 
 
 
 
 
2
 
3
  * September 2018 by Ipstenu
4
  * Reboot and rebranding - all the good, none of the bad.
1
+ = 1.1.1 =
2
+
3
+ * July 2019 by Ipstenu
4
+ * Corrected fallback for when site is offline.
5
+
6
+ = 1.1.0 =
7
+
8
+ * December 2018 by Ipstenu
9
+ * Updated OTD blocks to ESNext
10
+
11
+ = 1.0.0 =
12
 
13
  * September 2018 by Ipstenu
14
  * Reboot and rebranding - all the good, none of the bad.
lezwatchtv-main.php CHANGED
@@ -3,12 +3,12 @@
3
  * Plugin Name: LezWatch.TV News & Information
4
  * Plugin URI: https://lezwatchtv.com/about/resources/
5
  * Description: Display information on queer female and trans representation on TV. Brought to you by LezWatch.TV.
6
- * Version: 1.2
7
  * Author: LezWatch.TV
8
  * Author URI: https://lezwatchtv.com/
9
  * License: GPLv2 (or Later)
10
  *
11
- * Copyright 2017-2020 LezWatch.TV (email: webmaster@lezwatchtv.com)
12
  *
13
  * This file is part of LezWatch.TV News & Information, a plugin for WordPress.
14
  *
@@ -37,6 +37,7 @@ class LezWatchTV {
37
 
38
  protected static $version;
39
  public static $apiurl;
 
40
 
41
  /**
42
  * Constructor
@@ -47,12 +48,13 @@ class LezWatchTV {
47
  add_action( 'init', array( $this, 'init' ) );
48
  add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
49
 
50
- self::$version = '1.0.0';
51
- self::$apiurl = 'https://lezwatchtv.com/wp-json/lwtv/v1';
 
52
 
53
  // This should only apply to LWTV Dev sites.
54
- if ( WP_DEBUG && ( defined( 'LWTV_DEV_SITE' ) && LWTV_DEV_SITE ) ) {
55
- self::$apiurl = home_url() . '/wp-json/lwtv/v1';
56
  }
57
  }
58
 
@@ -155,11 +157,19 @@ class LezWatchTV {
155
  */
156
  public function register_widgets() {
157
 
158
- $widgets = array( 'LezWatchTV_Last_Death_Widget', 'LezWatchTV_Of_The_Day_Widget', 'LezWatchTV_On_This_Day_Widget', 'LezWatchTV_Statistics_Widget', 'LezWatchTV_This_Year_Widget' );
 
 
 
 
 
 
159
 
160
  foreach ( $widgets as $widget ) {
161
- $this->widget = new $widget();
162
- register_widget( $this->widget );
 
 
163
  }
164
  }
165
 
@@ -173,13 +183,17 @@ class LezWatchTV {
173
 
174
  // Make sure it's running before we do anything...
175
  if ( wp_remote_retrieve_response_code( $request ) !== 200 ) {
176
- $return = __( '<p>LezWatch.TV is temporarily offline, but will return soon.</p>', 'lezwatchtv' );
 
 
 
 
177
  } else {
178
  $response = wp_remote_retrieve_body( $request );
179
  $response = json_decode( $response, true );
180
  // translators: %s is the amount of time since a queer death (1 day, 2 days, 1 month, etc)
181
  $return = '<p>' . sprintf( __( 'It has been %s since the last queer female death on television', 'lezwatchtv' ), '<strong>' . human_time_diff( $response['died'], current_time( 'timestamp' ) ) . '</strong> ' );
182
- $return .= ': <a href="' . $response['url'] . '">' . $response['name'] . '</a> - ' . date( 'F j, Y', $response['died'] ) . '</p>';
183
  }
184
 
185
  $return = '<div class="lezwatchtv last-death">' . $return . '</div>';
@@ -203,34 +217,38 @@ class LezWatchTV {
203
 
204
  // Make sure it's running before we do anything...
205
  if ( wp_remote_retrieve_response_code( $request ) !== 200 ) {
206
- return __( '<p>LezWatch.TV is temporarily offline, but will return soon.</p>', 'lezwatchtv' );
207
- }
208
-
209
- $response = wp_remote_retrieve_body( $request );
210
- $response = json_decode( $response, true );
 
 
 
211
 
212
- switch ( $type ) {
213
- case 'death':
214
- $image = '';
215
- $title = '';
216
- $content = self::died_on_this_day( 'today' );
217
- break;
218
- case 'birthday':
219
- if ( ! empty( $response ) && isset( $response['birthdays'] ) ) {
220
- $image = '<img src="' . plugins_url( 'assets/birthday.jpg', __FILE__ ) . '" width="' . get_option( 'medium_size_w' ) . '">';
221
- $content = $response['birthdays'];
222
- } else {
223
  $image = '';
224
  $title = '';
225
- $content = __( 'No one is celebrating a birthday today.', 'lezwatchtv' );
226
- }
227
- break;
228
- default:
229
- $image = '<a href="' . $response['url'] . '"><img src="' . $response['image'] . '" width="' . get_option( 'medium_size_w' ) . '"></a><br />';
230
- $content = '<a href="' . $response['url'] . '">' . $response['name'] . '</a>';
231
- }
 
 
 
 
 
 
 
 
 
232
 
233
- $return = '<div class="lezwatchtv of-the-day ' . $type . '-of-the-day">' . $image . $content . '</div>';
 
234
 
235
  return $return;
236
  }
@@ -254,31 +272,35 @@ class LezWatchTV {
254
 
255
  // Make sure it's running before we do anything...
256
  if ( wp_remote_retrieve_response_code( $request ) !== 200 ) {
257
- return __( '<p>LezWatch.TV is temporarily offline, but will return soon.</p>', 'lezwatchtv' );
258
- }
259
-
260
- $response = wp_remote_retrieve_body( $request );
261
- $response = json_decode( $response, true );
 
 
 
262
 
263
- $count = ( 'none' === key( $response ) ) ? 0 : count( $response );
264
- $how_many = __( 'no characters died!', 'lezwatchtv' );
265
- $the_dead = '';
266
 
267
- if ( $count > 0 ) {
268
- // translators: %s is the number of dead characters.
269
- $how_many = sprintf( _n( '%s character died:', '%s characters died:', $count, 'lezwatchtv' ), $count );
270
 
271
- $the_dead = '<ul class="byq-otd">';
272
 
273
- foreach ( $response as $dead_character ) {
274
- $the_dead .= '<li><a href="' . $dead_character['url'] . '">' . $dead_character['name'] . '</a> - ' . $dead_character['died'] . '</li>';
 
 
275
  }
276
- $the_dead .= '</ul>';
277
- }
278
 
279
- // translators: %1$s is the date; %2$s is the number of dead
280
- $onthisday = '<p>' . sprintf( __( 'On %1$s, %2$s', 'lezwatchtv' ), date( 'F jS', $echo_day ), $how_many ) . '</p>';
281
- $return = $onthisday . $the_dead;
 
282
 
283
  return $return;
284
  }
@@ -295,45 +317,48 @@ class LezWatchTV {
295
 
296
  // Make sure it's running before we do anything...
297
  if ( wp_remote_retrieve_response_code( $request ) !== 200 ) {
298
- return __( '<p>LezWatch.TV is temporarily offline, but will return soon.</p>', 'lezwatchtv' );
299
- }
300
-
301
- $response = wp_remote_retrieve_body( $request );
302
- $response = json_decode( $response, true );
303
-
304
- // The Math part
305
- $live_chars = $response['characters']['alive'];
306
- $dead_chars = $response['characters']['dead'];
307
- $total_chars = $live_chars + $dead_chars;
308
- $percent_chars = number_format( ( $dead_chars / $total_chars ) * 100, 2 );
309
-
310
- $live_shows = $response['shows']['no-death'];
311
- $dead_shows = $response['shows']['death'];
312
- $total_shows = $live_shows + $dead_shows;
313
- $percent_shows = number_format( ( $dead_shows / $total_shows ) * 100, 2 );
314
-
315
- // translators: %1$s is the number of dead characters out of %2$s total characters.
316
- $character_return = sprintf( __( 'There are %1$s dead characters out of %2$s.', 'lezwatchtv' ), $live_chars, $total_chars );
317
- // translators: %s is the percentage of dead.
318
- $character_percent_return = sprintf( __( '%s%% of all queer females on TV are dead.', 'lezwatchtv' ), $percent_chars );
319
-
320
- // translators: %1$s is the number of shows with dead characters out of %2$s total shows.
321
- $show_return = sprintf( __( 'There are %1$s shows with dead characters out of %2$s.', 'lezwatchtv' ), $dead_shows, $total_shows );
322
- // translators: %s is the percentage of shows with dead.
323
- $show_percent_return = sprintf( __( '%s%% of TV shows with any queer female have at least one dead.', 'lezwatchtv' ), $percent_shows );
324
-
325
- switch ( $format ) {
326
- case 'characters':
327
- $return = $character_percent_return;
328
- break;
329
-
330
- case 'shows':
331
- $return = $show_percent_return;
332
- break;
333
 
334
- default:
335
- $return = $character_percent_return . ' ' . $show_percent_return;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
336
  }
 
337
  return '<p>' . $return . '</p>';
338
  }
339
 
@@ -355,43 +380,47 @@ class LezWatchTV {
355
 
356
  // Make sure it's running before we do anything...
357
  if ( wp_remote_retrieve_response_code( $request ) !== 200 ) {
358
- return __( '<p>LezWatch.TV is temporarily offline, but will return soon.</p>', 'lezwatchtv' );
359
- }
 
 
 
 
 
 
360
 
361
- $response = wp_remote_retrieve_body( $request );
362
- $response = json_decode( $response, true );
 
 
 
 
363
 
364
- // If we got an error, bail
365
- if ( array_key_exists( 'success', $response ) && ! $response['success'] ) {
366
- // translators: %s is a year. Probably 1961.
367
- $fail = sprintf( __( 'There were no queer female or trans characters on TV prior to %s.', 'lezwatchtv' ), $response['data'] );
368
- return $fail;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
369
  }
370
 
371
- // Posts etc made.
372
- // translators: %s is the number of characters
373
- $characters = ( 0 === $response['characters'] ) ? __( 'no characters', 'lezwatchtv' ) : sprintf( _n( '%s character', '%s characters', $response['characters'], 'bury-your-queers' ), $response['characters'] );
374
- // translators: %s is the number of shows
375
- $shows = ( 0 === $response['shows'] ) ? 'no shows' : sprintf( _n( '%s show', '%s shows', $response['shows'], 'bury-your-queers' ), $response['shows'] );
376
- // translators: %s is the number of posts
377
- $posts = ( 0 === $response['posts'] ) ? 'no posts' : sprintf( _n( '%s post', '%s posts', $response['posts'], 'bury-your-queers' ), $response['posts'] );
378
-
379
- // This Year On Air information:
380
- // translators: %s is the number of shows on air in that year
381
- $on_air = ( 0 === $response['on_air']['current'] ) ? __( 'no shows', 'lezwatchtv' ) : sprintf( _n( '%s show', '%s shows', $response['on_air']['current'], 'bury-your-queers' ), $response['on_air']['current'] );
382
- // translators: %s is the number of shows that started in that year
383
- $started = ( 0 === $response['on_air']['started'] ) ? __( 'no shows', 'lezwatchtv' ) : sprintf( _n( 'Only %s show', 'A total of %s shows', $response['on_air']['started'], 'bury-your-queers' ), $response['on_air']['started'] );
384
- // translators: %s is the number of shows that ended in that year
385
- $ended = ( 0 === $response['on_air']['ended'] ) ? __( 'no shows', 'lezwatchtv' ) : sprintf( _n( 'only %s show', '%s shows', $response['on_air']['ended'], 'bury-your-queers' ), $response['on_air']['ended'] );
386
-
387
- // Death
388
- // translators: %s is the number of characters that died in that year
389
- $death_this_year = ( 0 === $response['dead_year'] ) ? __( 'Amazingly no characters died', 'lezwatchtv' ) : sprintf( _n( 'Only %s character died', 'Sadly, %s characters died', $response['dead_year'], 'bury-your-queers' ), $response['dead_year'] );
390
-
391
- // The Output
392
- // translators: %1$s is the year; %2$s is the number of characters on TV that Year; %3$s is the number of shows that begun that year; %4$s is the number of shows that ended that year; %5$s is the all the stuff about dead that year
393
- $return = sprintf( __( 'In %1$s, there were %2$s with queer female or trans characters on the air. %3$s started and %4$s ended that year. %5$s.', 'lezwatchtv' ), $year, $on_air, $started, $ended, $death_this_year );
394
-
395
  return $return;
396
  }
397
 
3
  * Plugin Name: LezWatch.TV News & Information
4
  * Plugin URI: https://lezwatchtv.com/about/resources/
5
  * Description: Display information on queer female and trans representation on TV. Brought to you by LezWatch.TV.
6
+ * Version: 1.2.2
7
  * Author: LezWatch.TV
8
  * Author URI: https://lezwatchtv.com/
9
  * License: GPLv2 (or Later)
10
  *
11
+ * Copyright 2017-2021 LezWatch.TV (email: webmaster@lezwatchtv.com)
12
  *
13
  * This file is part of LezWatch.TV News & Information, a plugin for WordPress.
14
  *
37
 
38
  protected static $version;
39
  public static $apiurl;
40
+ public static $unavailable;
41
 
42
  /**
43
  * Constructor
48
  add_action( 'init', array( $this, 'init' ) );
49
  add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
50
 
51
+ self::$version = '1.2.1';
52
+ self::$apiurl = 'https://lezwatchtv.com/wp-json/lwtv/v1';
53
+ self::$unavailable = __( 'LezWatch.TV\'s API is temporarily offline, but will return soon.', 'lezwatchtv' );
54
 
55
  // This should only apply to LWTV Dev sites.
56
+ if ( WP_DEBUG && defined( 'LWTV_DEV_SITE_API' ) ) {
57
+ self::$apiurl = LWTV_DEV_SITE_API . '/wp-json/lwtv/v1';
58
  }
59
  }
60
 
157
  */
158
  public function register_widgets() {
159
 
160
+ $widgets = array(
161
+ 'LezWatchTV_Last_Death_Widget',
162
+ 'LezWatchTV_Of_The_Day_Widget',
163
+ 'LezWatchTV_On_This_Day_Widget',
164
+ 'LezWatchTV_Statistics_Widget',
165
+ 'LezWatchTV_This_Year_Widget',
166
+ );
167
 
168
  foreach ( $widgets as $widget ) {
169
+ if ( class_exists( $widget ) ) {
170
+ $this->widget = new $widget();
171
+ register_widget( $this->widget );
172
+ }
173
  }
174
  }
175
 
183
 
184
  // Make sure it's running before we do anything...
185
  if ( wp_remote_retrieve_response_code( $request ) !== 200 ) {
186
+ $message = self::$unavailable;
187
+ if ( WP_DEBUG ) {
188
+ $message .= ' - ' . wp_remote_retrieve_response_code( $request );
189
+ }
190
+ $return = '<p>' . $message . '</p>';
191
  } else {
192
  $response = wp_remote_retrieve_body( $request );
193
  $response = json_decode( $response, true );
194
  // translators: %s is the amount of time since a queer death (1 day, 2 days, 1 month, etc)
195
  $return = '<p>' . sprintf( __( 'It has been %s since the last queer female death on television', 'lezwatchtv' ), '<strong>' . human_time_diff( $response['died'], current_time( 'timestamp' ) ) . '</strong> ' );
196
+ $return .= ': <a href="' . $response['url'] . '">' . $response['name'] . '</a> - ' . gmdate( 'F j, Y', $response['died'] ) . '</p>';
197
  }
198
 
199
  $return = '<div class="lezwatchtv last-death">' . $return . '</div>';
217
 
218
  // Make sure it's running before we do anything...
219
  if ( wp_remote_retrieve_response_code( $request ) !== 200 ) {
220
+ $message = self::$unavailable;
221
+ if ( WP_DEBUG ) {
222
+ $message .= ' - ' . wp_remote_retrieve_response_code( $request );
223
+ }
224
+ $return = '<p>' . $message . '</p>';
225
+ } else {
226
+ $response = wp_remote_retrieve_body( $request );
227
+ $response = json_decode( $response, true );
228
 
229
+ switch ( $type ) {
230
+ case 'death':
 
 
 
 
 
 
 
 
 
231
  $image = '';
232
  $title = '';
233
+ $content = self::died_on_this_day( 'today' );
234
+ break;
235
+ case 'birthday':
236
+ if ( ! empty( $response ) && isset( $response['birthdays'] ) ) {
237
+ $image = '<img src="' . plugins_url( 'assets/birthday.jpg', __FILE__ ) . '" width="' . get_option( 'medium_size_w' ) . '">';
238
+ $content = $response['birthdays'];
239
+ } else {
240
+ $image = '';
241
+ $title = '';
242
+ $content = __( 'No one is celebrating a birthday today.', 'lezwatchtv' );
243
+ }
244
+ break;
245
+ default:
246
+ $image = '<a href="' . $response['url'] . '"><img src="' . $response['image'] . '" width="' . get_option( 'medium_size_w' ) . '"></a><br />';
247
+ $content = '<a href="' . $response['url'] . '">' . $response['name'] . '</a>';
248
+ }
249
 
250
+ $return = '<div class="lezwatchtv of-the-day ' . $type . '-of-the-day">' . $image . $content . '</div>';
251
+ }
252
 
253
  return $return;
254
  }
272
 
273
  // Make sure it's running before we do anything...
274
  if ( wp_remote_retrieve_response_code( $request ) !== 200 ) {
275
+ $message = self::$unavailable;
276
+ if ( WP_DEBUG ) {
277
+ $message .= ' - ' . wp_remote_retrieve_response_code( $request );
278
+ }
279
+ $return = '<p>' . $message . '</p>';
280
+ } else {
281
+ $response = wp_remote_retrieve_body( $request );
282
+ $response = json_decode( $response, true );
283
 
284
+ $count = ( 'none' === key( $response ) ) ? 0 : count( $response );
285
+ $how_many = __( 'no characters died!', 'lezwatchtv' );
286
+ $the_dead = '';
287
 
288
+ if ( $count > 0 ) {
289
+ // translators: %s is the number of dead characters.
290
+ $how_many = sprintf( _n( '%s character died:', '%s characters died:', $count, 'lezwatchtv' ), $count );
291
 
292
+ $the_dead = '<ul class="byq-otd">';
293
 
294
+ foreach ( $response as $dead_character ) {
295
+ $the_dead .= '<li><a href="' . $dead_character['url'] . '">' . $dead_character['name'] . '</a> - ' . $dead_character['died'] . '</li>';
296
+ }
297
+ $the_dead .= '</ul>';
298
  }
 
 
299
 
300
+ // translators: %1$s is the date; %2$s is the number of dead
301
+ $onthisday = '<p>' . sprintf( __( 'On %1$s, %2$s', 'lezwatchtv' ), gmdate( 'F jS', $echo_day ), $how_many ) . '</p>';
302
+ $return = $onthisday . $the_dead;
303
+ }
304
 
305
  return $return;
306
  }
317
 
318
  // Make sure it's running before we do anything...
319
  if ( wp_remote_retrieve_response_code( $request ) !== 200 ) {
320
+ $message = self::$unavailable;
321
+ if ( WP_DEBUG ) {
322
+ $message .= ' - ' . wp_remote_retrieve_response_code( $request );
323
+ }
324
+ $return = '<p>' . $message . '</p>';
325
+ } else {
326
+ $response = wp_remote_retrieve_body( $request );
327
+ $response = json_decode( $response, true );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
328
 
329
+ // The Math part
330
+ $live_chars = $response['characters']['alive'];
331
+ $dead_chars = $response['characters']['dead'];
332
+ $total_chars = $live_chars + $dead_chars;
333
+ $percent_chars = number_format( ( $dead_chars / $total_chars ) * 100, 2 );
334
+
335
+ $live_shows = $response['shows']['no-death'];
336
+ $dead_shows = $response['shows']['death'];
337
+ $total_shows = $live_shows + $dead_shows;
338
+ $percent_shows = number_format( ( $dead_shows / $total_shows ) * 100, 2 );
339
+
340
+ // translators: %1$s is the number of dead characters out of %2$s total characters.
341
+ $character_return = sprintf( __( 'There are %1$s dead characters out of %2$s.', 'lezwatchtv' ), $live_chars, $total_chars );
342
+ // translators: %s is the percentage of dead.
343
+ $character_percent_return = sprintf( __( '%s%% of all queer females on TV are dead.', 'lezwatchtv' ), $percent_chars );
344
+
345
+ // translators: %1$s is the number of shows with dead characters out of %2$s total shows.
346
+ $show_return = sprintf( __( 'There are %1$s shows with dead characters out of %2$s.', 'lezwatchtv' ), $dead_shows, $total_shows );
347
+ // translators: %s is the percentage of shows with dead.
348
+ $show_percent_return = sprintf( __( '%s%% of TV shows with any queer female have at least one dead.', 'lezwatchtv' ), $percent_shows );
349
+
350
+ switch ( $format ) {
351
+ case 'characters':
352
+ $return = $character_percent_return;
353
+ break;
354
+ case 'shows':
355
+ $return = $show_percent_return;
356
+ break;
357
+ default:
358
+ $return = $character_percent_return . ' ' . $show_percent_return;
359
+ }
360
  }
361
+
362
  return '<p>' . $return . '</p>';
363
  }
364
 
380
 
381
  // Make sure it's running before we do anything...
382
  if ( wp_remote_retrieve_response_code( $request ) !== 200 ) {
383
+ $message = self::$unavailable;
384
+ if ( WP_DEBUG ) {
385
+ $message .= ' - ' . wp_remote_retrieve_response_code( $request );
386
+ }
387
+ $return = '<p>' . $message . '</p>';
388
+ } else {
389
+ $response = wp_remote_retrieve_body( $request );
390
+ $response = json_decode( $response, true );
391
 
392
+ // If we got an error, bail
393
+ if ( array_key_exists( 'success', $response ) && ! $response['success'] ) {
394
+ // translators: %s is a year. Probably 1961.
395
+ $fail = sprintf( __( 'There were no queer female or trans characters on TV prior to %s.', 'lezwatchtv' ), $response['data'] );
396
+ return $fail;
397
+ }
398
 
399
+ // Posts etc made.
400
+ // translators: %s is the number of characters
401
+ $characters = ( 0 === $response['characters'] ) ? __( 'no characters', 'lezwatchtv' ) : sprintf( _n( '%s character', '%s characters', $response['characters'], 'bury-your-queers' ), $response['characters'] );
402
+ // translators: %s is the number of shows
403
+ $shows = ( 0 === $response['shows'] ) ? 'no shows' : sprintf( _n( '%s show', '%s shows', $response['shows'], 'bury-your-queers' ), $response['shows'] );
404
+ // translators: %s is the number of posts
405
+ $posts = ( 0 === $response['posts'] ) ? 'no posts' : sprintf( _n( '%s post', '%s posts', $response['posts'], 'bury-your-queers' ), $response['posts'] );
406
+
407
+ // This Year On Air information:
408
+ // translators: %s is the number of shows on air in that year
409
+ $on_air = ( 0 === $response['on_air']['current'] ) ? __( 'no shows', 'lezwatchtv' ) : sprintf( _n( '%s show', '%s shows', $response['on_air']['current'], 'bury-your-queers' ), $response['on_air']['current'] );
410
+ // translators: %s is the number of shows that started in that year
411
+ $started = ( 0 === $response['on_air']['started'] ) ? __( 'no shows', 'lezwatchtv' ) : sprintf( _n( 'Only %s show', 'A total of %s shows', $response['on_air']['started'], 'bury-your-queers' ), $response['on_air']['started'] );
412
+ // translators: %s is the number of shows that ended in that year
413
+ $ended = ( 0 === $response['on_air']['ended'] ) ? __( 'no shows', 'lezwatchtv' ) : sprintf( _n( 'only %s show', '%s shows', $response['on_air']['ended'], 'bury-your-queers' ), $response['on_air']['ended'] );
414
+
415
+ // Death
416
+ // translators: %s is the number of characters that died in that year
417
+ $death_this_year = ( 0 === $response['dead_year'] ) ? __( 'Amazingly no characters died', 'lezwatchtv' ) : sprintf( _n( 'Only %s character died', 'Sadly, %s characters died', $response['dead_year'], 'bury-your-queers' ), $response['dead_year'] );
418
+
419
+ // The Output
420
+ // translators: %1$s is the year; %2$s is the number of characters on TV that Year; %3$s is the number of shows that begun that year; %4$s is the number of shows that ended that year; %5$s is the all the stuff about dead that year
421
+ $return = sprintf( __( 'In %1$s, there were %2$s with queer female or trans characters on the air. %3$s started and %4$s ended that year. %5$s.', 'lezwatchtv' ), $year, $on_air, $started, $ended, $death_this_year );
422
  }
423
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
424
  return $return;
425
  }
426
 
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === LezWatch.TV News and Information ===
2
  Contributors: Ipstenu, liljimmi
3
- Tags: television, queer, lesbian, tv, lezwatchtv
4
  Requires at least: 4.8
5
- Tested up to: 5.4
6
- Stable tag: 1.2
7
  License: GPLv2 (or Later)
8
 
9
  Display information on queer female, transgender, and non-binary representation on TV. Brought to you by LezWatch.TV.
@@ -28,7 +28,7 @@ By using this plugin, you agree to the [terms of Use of LezWatch.TV](https://lez
28
 
29
  = Usage =
30
 
31
- The data can be displayed via a widget, a shortcode, or a Gutenberg Block.
32
 
33
  **Widgets**
34
 
@@ -89,6 +89,15 @@ The IP address and domain of sites that use this plugin are tracked _only_ when
89
  * [Terms of Use](https://lezwatchtv.com/tos/)
90
  * [Privacy Policy](https://lezwatchtv.com/tos/privacy/)
91
 
 
 
 
 
 
 
 
 
 
92
  == Screenshots ==
93
 
94
  == Installation ==
@@ -101,17 +110,20 @@ The IP address and domain of sites that use this plugin are tracked _only_ when
101
 
102
  ==Changelog==
103
 
104
- = 1.1.1 =
105
 
106
- * July 2019 by Ipstenu
107
- * Corrected fallback for when site is offline.
 
108
 
109
- = 1.1.0 =
110
 
111
- * December 2018 by Ipstenu
112
- * Updated OTD blocks to ESNext
 
 
113
 
114
- = 1.0.0 =
115
 
116
- * September 2018 by Ipstenu
117
- * Reboot and rebranding - all the good, none of the bad.
1
  === LezWatch.TV News and Information ===
2
  Contributors: Ipstenu, liljimmi
3
+ Tags: television, queer, lesbian, tv, block
4
  Requires at least: 4.8
5
+ Tested up to: 5.7
6
+ Stable tag: 1.2.2
7
  License: GPLv2 (or Later)
8
 
9
  Display information on queer female, transgender, and non-binary representation on TV. Brought to you by LezWatch.TV.
28
 
29
  = Usage =
30
 
31
+ The data can be displayed via a widget, a shortcode, or a Block.
32
 
33
  **Widgets**
34
 
89
  * [Terms of Use](https://lezwatchtv.com/tos/)
90
  * [Privacy Policy](https://lezwatchtv.com/tos/privacy/)
91
 
92
+ = Can I change the URL it calls data from? =
93
+
94
+ You can, but we caution you that the calls won't work unless you match the data. You're more than welcome to fork the code from our [Github repository](https://github.com/LezWatch/lwtv-plugin/tree/production/rest-api). Once you've built your own version, you'll need to do the following:
95
+
96
+ 1. Turn on `WP_DEBUG`
97
+ 2. Define `LWTV_DEV_SITE_API` as your demo url
98
+
99
+ It's only meant for in-house development, but flexibility is king.
100
+
101
  == Screenshots ==
102
 
103
  == Installation ==
110
 
111
  ==Changelog==
112
 
113
+ = 1.2.2 =
114
 
115
+ * March 2021 by Ipstenu
116
+ * Fix bug with transients
117
+ * Compat with PHP 8 and WP 5.7
118
 
119
+ = 1.2.1 =
120
 
121
+ * August 2020 by Ipstenu
122
+ * DRY: Combined translations
123
+ * Adjust development hooks
124
+ * Full compatibility with WP 5.5+ and PHP 7.4
125
 
126
+ = 1.2 =
127
 
128
+ * March 2020 by Ipstenu
129
+ * Update for WP 5.4