Skip to content

Commit

Permalink
4.5.19
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelbart committed Jun 26, 2022
1 parent 25b80b2 commit b4f2458
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 18 deletions.
2 changes: 1 addition & 1 deletion core/customizer/class-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @package Helpful
* @subpackage Core\Modules
* @version 4.5.0
* @version 4.5.19
* @since 4.3.0
*/

Expand Down
4 changes: 2 additions & 2 deletions core/helpers/class-feedback.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @package Helpful
* @subpackage Core\Helpers
* @version 4.5.7
* @version 4.5.19
* @since 1.0.0
*/

Expand Down Expand Up @@ -43,7 +43,7 @@ public static function get_feedback( $entry ) {
$feedback['time'] = sprintf(
/* translators: %s = time difference */
__( 'Submitted %s ago', 'helpful' ),
human_time_diff( $time, time() )
human_time_diff( $time, date_i18n('U') )
);

if ( $entry->fields ) {
Expand Down
5 changes: 2 additions & 3 deletions core/modules/class-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @package Helpful
* @subpackage Core\Modules
* @version 4.5.7
* @version 4.5.19
* @since 4.3.0
*/

Expand Down Expand Up @@ -284,8 +284,7 @@ public function editor_settings() {
* @return void
*/
public function update_option_hook( $option, $old_value, $value ) {
$service = new Services\Options();

$service = Services\Options::get_instance();
$options = $service->get_defaults_array( '', true );

if ( in_array( $option, $options, true ) || strpos( $option, 'helpful_customizer' ) ) {
Expand Down
12 changes: 6 additions & 6 deletions core/modules/class-frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* @package Helpful
* @subpackage Core\Modules
* @version 4.5.5
* @version 4.5.19
* @since 4.3.0
*/

Expand Down Expand Up @@ -118,12 +118,12 @@ public function enqueue_scripts() {
return;
}

$options = new Services\Options();
$customizer = $options->get_option( 'helpful_customizer', '' );
$active_theme = ( is_array( $customizer ) && array_key_exists( 'theme', $customizer ) ) ? esc_attr( $customizer['theme'] ) : 'base';
$service = new Services\Options();

$themes = apply_filters( 'helpful_themes', array() );
$plugin = Helper::get_plugin_data();
$customizer = $service->get_option('helpful_customizer', []);
$active_theme = ( is_array( $customizer ) && array_key_exists( 'theme', $customizer ) ) ? esc_attr( $customizer['theme'] ) : 'base';
$themes = apply_filters( 'helpful_themes', array() );
$plugin = Helper::get_plugin_data();

if ( ! empty( $themes ) ) {
foreach ( $themes as $theme ) {
Expand Down
25 changes: 23 additions & 2 deletions core/services/class-options.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* @package Helpful
* @subpackage Core\Services
* @version 4.5.8
* @version 4.5.19
* @since 4.4.47
*/

Expand All @@ -30,6 +30,27 @@ class Options {
*/
private $options;

/**
* Instanzholder.
*
* @var self
*/
private static $instance;

/**
* Constructs an instance.
*
* @return self
*/
public static function get_instance()
{
if (!self::$instance) {
self::$instance = new static();
}

return self::$instance;
}

/**
* Constructor
*/
Expand All @@ -42,7 +63,7 @@ public function __construct() {
* Resave the options.
*/
public function renew_options() {
update_option( 'helpful_options', $this->options );
update_option( 'helpful_options', maybe_serialize( $this->options ) );
}

/**
Expand Down
4 changes: 2 additions & 2 deletions core/tabs/class-feedback.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @package Helpful
* @subpackage Core\Tabs
* @version 4.5.5
* @version 4.5.19
* @since 4.3.0
*/

Expand Down Expand Up @@ -231,7 +231,7 @@ public function register_tab_alerts() {
* @return mixed
*/
public function sanitize_input( $value ) {
return wp_kses( $value, Helper::kses_allowed_tags() );
return esc_html( wp_kses( $value, Helper::kses_allowed_tags() ) );
}

/**
Expand Down
2 changes: 1 addition & 1 deletion helpful.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Plugin Name: Helpful
* Description: Add a fancy feedback form under your posts or post-types and ask your visitors a question. Give them the abbility to vote with yes or no.
* Version: 4.5.18
* Version: 4.5.19
* Author: Pixelbart
* Author URI: https://pixelbart.de
* Text Domain: helpful
Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Tags: helpful, poll, feedback, reviews, vote, review, voting
Requires at least: 4.6
Tested up to: 6.0
Requires PHP: 5.6.20
Stable tag: 4.5.18
Stable tag: 4.5.19
License: MIT License
License URI: https://opensource.org/licenses/MIT

Expand Down

0 comments on commit b4f2458

Please sign in to comment.