Skip to content

Commit

Permalink
Fixed PHP 8.0 warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
takashi-matsuyama committed Jun 5, 2021
1 parent 39688dd commit fe65ca5
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 24 deletions.
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

This is the development repository for Browsing History, a WordPress plugin that saves user's browsing history and lists them. You can also download the plugin package installation from the [WordPress.org Plugin Directory](https://wordpress.org/plugins/browsing-history/).

Contributors: takashimatsuyama
Donate link:
Tags: browsing history, accessibility, design
Requires at least: 4.8
Tested up to: 5.7
Requires PHP: 5.4.0
Stable tag: 1.2.1
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Contributors: takashimatsuyama
Donate link:
Tags: browsing history, accessibility, design
Requires at least: 4.8
Tested up to: 5.7
Requires PHP: 5.4.0
Stable tag: 1.2.2
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Save user’s browsing history and list them.

Expand All @@ -36,6 +36,9 @@ Detailed usage is under preparation.

## Changelog

# 1.2.2
Fixed PHP 8.0 warning.

# 1.2.1
Modify the handle names of wp_enqueue_script.

Expand Down
2 changes: 1 addition & 1 deletion addons/ccc-post_thumbnail/ccc-post_thumbnail.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public static function get_first_image_url( $post=null ) {
ob_start();
ob_end_clean();
preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post_content, $matches);
if( $matches[1][0] ) {
if( isset($matches[1][0]) ) {
$first_img = $matches[1][0]; //投稿本文の中から1枚目の画像のURLを取得
}
} // endif
Expand Down
2 changes: 1 addition & 1 deletion browsing-history.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Browsing History
* Plugin URI: https://wordpress.org/plugins/browsing-history
* Description: Save user’s browsing history and list them.
* Version: 1.2.1
* Version: 1.2.2
* Requires at least: 4.8
* Requires PHP: 5.4.0
* Author: Takashi Matsuyama
Expand Down
2 changes: 2 additions & 0 deletions function.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ public function save_scripts() {
if( ! ( is_home() or is_front_page() ) and ( is_single() or is_page() ) ) {
global $post;
$post_id = $post->ID;
} else {
$post_id = null;
}
$handle = 'ccc_browsing_history-save';
$file = 'save.js';
Expand Down
18 changes: 5 additions & 13 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Tags: browsing history, accessibility, design
Requires at least: 4.8
Tested up to: 5.7
Requires PHP: 5.4.0
Stable tag: 1.2.1
Stable tag: 1.2.2
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand All @@ -31,18 +31,10 @@ Detailed usage is under preparation.
2. Activate the plugin through the 'Plugins' menu in WordPress.
3. Use shortcodes to display the browsing history list.

== Screenshots ==
== Discover More ==

== Changelog ==

= 1.2.1 =
Modify the handle names of wp_enqueue_script.
This plugin is [developed on GitHub](https://github.com/takashi-matsuyama/browsing-history)

= 1.2.0 =
Modify markup of thumbnails and modify CSS.

= 1.1.0 =
Add shortcode attribute (`style=""`) and modify CSS.
== Changelog ==

= 1.0.0 =
Initial release.
See the [release notes on GitHub](https://github.com/takashi-matsuyama/browsing-history/releases).

0 comments on commit fe65ca5

Please sign in to comment.